Skip to content
Snippets Groups Projects
Commit e21dc462 authored by Fabian Galinski's avatar Fabian Galinski :pouting_cat:
Browse files

Merge branch 'master' of gitlab.sgalinski.de:typo3/sg_news

parents d0cd79a7 7e2db04d
No related branches found
No related tags found
No related merge requests found
...@@ -2,29 +2,31 @@ ...@@ -2,29 +2,31 @@
namespace SGalinski\SgNews\Controller; namespace SGalinski\SgNews\Controller;
/*************************************************************** /***************************************************************
* Copyright notice * Copyright notice
* *
* (c) sgalinski Internet Services (https://www.sgalinski.de) * (c) sgalinski Internet Services (https://www.sgalinski.de)
* *
* All rights reserved * All rights reserved
* *
* This script is part of the TYPO3 project. The TYPO3 project is * This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify * free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* The GNU General Public License can be found at * The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html. * http://www.gnu.org/copyleft/gpl.html.
* *
* This script is distributed in the hope that it will be useful, * This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* This copyright notice MUST APPEAR in all copies of the script! * This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/ ***************************************************************/
use TYPO3\CMS\Core\Utility\GeneralUtility;
/** /**
* Controller that handles the news feed rendering * Controller that handles the news feed rendering
...@@ -42,7 +44,8 @@ class NewsFeedController extends AbstractController { ...@@ -42,7 +44,8 @@ class NewsFeedController extends AbstractController {
* @return void * @return void
*/ */
public function indexAction() { public function indexAction() {
$news = $this->newsRepository->findLastUpdatedOrHighlightedNewsByCategories(10, FALSE); $categories = GeneralUtility::intExplode(',', $this->settings['showCategories'], TRUE);
$news = $this->newsRepository->findLastUpdatedOrHighlightedNewsByCategories(10, FALSE, $categories);
$this->view->assign('news', $news); $this->view->assign('news', $news);
} }
} }
...@@ -32,6 +32,22 @@ use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractConditionViewHelper; ...@@ -32,6 +32,22 @@ use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractConditionViewHelper;
* ExtendedIfViewHelper * ExtendedIfViewHelper
*/ */
class ExtendedIfViewHelper extends AbstractConditionViewHelper { class ExtendedIfViewHelper extends AbstractConditionViewHelper {
/**
* @return void
*/
public function initializeArguments() {
$this->registerArgument('condition', 'boolean', 'Condition to be evaluated.');
$this->registerArgument('or', 'boolean', 'First or condition');
$this->registerArgument('or2', 'boolean', 'Second or condition');
$this->registerArgument('or3', 'boolean', 'Third or condition');
$this->registerArgument('or4', 'boolean', 'Fourth or condition');
$this->registerArgument('and', 'boolean', 'First and condition');
$this->registerArgument('and2', 'boolean', 'Second and condition');
$this->registerArgument('and3', 'boolean', 'Third and condition');
$this->registerArgument('and4', 'boolean', 'Fourth and condition');
$this->registerArgument('negate', 'boolean', 'Negate complete condition');
}
/** /**
* renders <f:then> child if $condition or $or is true, otherwise renders <f:else> child. * renders <f:then> child if $condition or $or is true, otherwise renders <f:else> child.
* *
......
...@@ -101,81 +101,78 @@ $imageColumns = [ ...@@ -101,81 +101,78 @@ $imageColumns = [
], ],
]; ];
$columns = array_merge([ $columns = array_merge(
'tx_sgnews_author' => [ [
'exclude' => TRUE, 'tx_sgnews_author' => [
'l10n_exclude' => TRUE, 'exclude' => TRUE,
'label' => 'LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:pages.tx_sgnews_author', 'l10n_exclude' => TRUE,
'config' => [ 'label' => 'LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:pages.tx_sgnews_author',
'type' => 'select', 'config' => [
'minitems' => 0, 'type' => 'group',
'foreign_table' => 'fe_users', 'internal_type' => 'db',
'foreign_table_where' => 'ORDER BY fe_users.name', 'allowed' => 'fe_users',
'items' => [ 'size' => 1,
['', ''], 'minitems' => 0,
], 'maxitems' => 1,
'wizards' => [ 'items' => [
'edit' => [ ['', ''],
'type' => 'popup',
'title' => 'Edit',
'module' => ['name' => 'wizard_edit'],
'icon' => 'edit2.gif',
'popup_onlyOpenIfSelected' => 1,
], ],
'suggest' => [ 'wizards' => [
'type' => 'suggest', 'suggest' => [
'type' => 'suggest',
],
], ],
], ],
], ],
], 'tx_sgnews_related_news' => [
'tx_sgnews_related_news' => [ 'exclude' => TRUE,
'exclude' => TRUE, 'l10n_exclude' => TRUE,
'l10n_exclude' => TRUE, 'label' => 'LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:pages.tx_sgnews_related_news',
'label' => 'LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:pages.tx_sgnews_related_news', 'config' => [
'config' => [ 'type' => 'group',
'type' => 'group', 'internal_type' => 'db',
'internal_type' => 'db', 'allowed' => 'pages',
'allowed' => 'pages', 'size' => 5,
'size' => 5, 'minitems' => 0,
'minitems' => 0, 'maxitems' => 99,
'maxitems' => 99, 'wizards' => [
'wizards' => [ 'suggest' => [
'suggest' => [ 'type' => 'suggest',
'type' => 'suggest', ],
], ],
], ],
], ],
], 'tx_sgnews_highlighted' => [
'tx_sgnews_highlighted' => [ 'displayCond' => 'FIELD:tx_sgnews_never_highlighted:=:0',
'displayCond' => 'FIELD:tx_sgnews_never_highlighted:=:0', 'exclude' => TRUE,
'exclude' => TRUE, 'l10n_exclude' => TRUE,
'l10n_exclude' => TRUE, 'label' => 'LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:pages.tx_sgnews_highlighted',
'label' => 'LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:pages.tx_sgnews_highlighted', 'config' => [
'config' => [ 'type' => 'check',
'type' => 'check', ],
], ],
], 'tx_sgnews_never_highlighted' => [
'tx_sgnews_never_highlighted' => [ 'displayCond' => 'FIELD:tx_sgnews_highlighted:=:0',
'displayCond' => 'FIELD:tx_sgnews_highlighted:=:0', 'exclude' => TRUE,
'exclude' => TRUE, 'l10n_exclude' => TRUE,
'l10n_exclude' => TRUE, 'label' => 'LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:pages.tx_sgnews_never_highlighted',
'label' => 'LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:pages.tx_sgnews_never_highlighted', 'config' => [
'config' => [ 'type' => 'check',
'type' => 'check', ],
], ],
], 'lastUpdated' => [
'lastUpdated' => [ 'exclude' => TRUE,
'exclude' => TRUE, 'label' => 'LLL:EXT:cms/locallang_tca.xlf:pages.lastUpdated',
'label' => 'LLL:EXT:cms/locallang_tca.xlf:pages.lastUpdated', 'config' => [
'config' => [ 'type' => 'input',
'type' => 'input', 'size' => '13',
'size' => '13', 'max' => '20',
'max' => '20', 'eval' => 'datetime',
'eval' => 'datetime', 'default' => $GLOBALS['EXEC_TIME'],
'default' => $GLOBALS['EXEC_TIME'], ]
] ],
], ], $imageColumns
], $imageColumns); );
// # // #
// # Pages // # Pages
...@@ -216,7 +213,10 @@ $GLOBALS['TCA']['pages']['types'][116] = [ ...@@ -216,7 +213,10 @@ $GLOBALS['TCA']['pages']['types'][116] = [
--div--;LLL:EXT:cms/locallang_tca.xlf:pages.tabs.access, --div--;LLL:EXT:cms/locallang_tca.xlf:pages.tabs.access,
--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.visibility;visibility, --palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.visibility;visibility,
--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.access;access, --palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.access;access,
--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.miscellaneous;miscellaneous, --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.behaviour,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.caching;caching,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.language;language,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.miscellaneous;miscellaneous,
' '
]; ];
...@@ -236,7 +236,10 @@ $GLOBALS['TCA']['pages']['types'][117] = [ ...@@ -236,7 +236,10 @@ $GLOBALS['TCA']['pages']['types'][117] = [
--div--;LLL:EXT:cms/locallang_tca.xlf:pages.tabs.access, --div--;LLL:EXT:cms/locallang_tca.xlf:pages.tabs.access,
--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.visibility;visibility, --palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.visibility;visibility,
--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.access;access, --palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.access;access,
--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.miscellaneous;miscellaneous, --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.behaviour,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.caching;caching,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.language;language,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.miscellaneous;miscellaneous,
' '
]; ];
...@@ -260,7 +263,7 @@ if (!\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('realurl')) { ...@@ -260,7 +263,7 @@ if (!\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('realurl')) {
$GLOBALS['TCA']['pages_language_overlay']['types'][116] = [ $GLOBALS['TCA']['pages_language_overlay']['types'][116] = [
'showitem' => '--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.standard;standard, 'showitem' => '--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.standard;standard,
subtitle, description, tx_realurl_pathsegment, subtitle, description, tx_realurl_pathsegment, author,
--div--;LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:pages.tabs.images, --div--;LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:pages.tabs.images,
tx_sgnews_teaser2_image, tx_sgnews_teaser1_image, tx_sgnews_teaser2_image, tx_sgnews_teaser1_image,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.metadata, --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.metadata,
......
...@@ -9,7 +9,23 @@ newsFeed = PAGE ...@@ -9,7 +9,23 @@ newsFeed = PAGE
newsFeed { newsFeed {
typeNum = 78906523 typeNum = 78906523
10 < tt_content.list.20.sgnews_newsfeed 10 = USER
10 {
userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
extensionName = SgNews
pluginName = NewsFeed
vendorName = SGalinski
controller = NewsFeed
action = index
view < plugin.tx_sgnews.view
persistence < plugin.tx_sgnews.persistence
features < plugin.tx_sgnews.features
legacy < plugin.tx_sgnews.legacy
settings {
# if not provided all categories are shown
showCategories =
}
}
config { config {
disableAllHeaderCode = 1 disableAllHeaderCode = 1
......
...@@ -33,10 +33,6 @@ ...@@ -33,10 +33,6 @@
<source>News Overview</source> <source>News Overview</source>
<target>News-Übersicht</target> <target>News-Übersicht</target>
</trans-unit> </trans-unit>
<trans-unit id="titlePageBrowserPlugin" approved="yes">
<source>Page Browser Plugin</source>
<target>Seitenbrowser-Plugin</target>
</trans-unit>
<trans-unit id="titleSingleViewPlugin" approved="yes"> <trans-unit id="titleSingleViewPlugin" approved="yes">
<source>News Single View</source> <source>News Single View</source>
<target>News-Einzelansicht</target> <target>News-Einzelansicht</target>
......
...@@ -27,9 +27,6 @@ ...@@ -27,9 +27,6 @@
<trans-unit id="titleOverviewPlugin"> <trans-unit id="titleOverviewPlugin">
<source>News Overview</source> <source>News Overview</source>
</trans-unit> </trans-unit>
<trans-unit id="titlePageBrowserPlugin">
<source>Page Browser Plugin</source>
</trans-unit>
<trans-unit id="titleSingleViewPlugin"> <trans-unit id="titleSingleViewPlugin">
<source>News Single View</source> <source>News Single View</source>
</trans-unit> </trans-unit>
......
<?xml version="1.0" encoding="utf-8"?>{namespace sg=SGalinski\SgNews\ViewHelpers} <?xml version="1.0" encoding="utf-8"?>{namespace sg=SGalinski\SgNews\ViewHelpers}
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de"> <feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
<title>News Feed</title> <title>News Feed</title>
<link href="{f:uri.page(pageUid: '{rootpageId}', absolute: '1')}" /> <subtitle type="html">{settings.siteName}</subtitle>
<link rel="self" type="application/atom+xml" href="{f:uri.page(pageUid: '{rootpageId}', absolute: '1', pageType: '78906523')}" /> <link href="{f:uri.page(pageUid: '{settings.rootpageId}', absolute: '1')}" />
<id>{f:uri.page(pageUid: '{rootpageId}', absolute: '1')}news.xml</id> <link rel="self" type="application/atom+xml" href="{f:uri.page(pageUid: '{settings.rootpageId}', absolute: '1', pageType: '78906523')}" />
<id>{f:uri.page(pageUid: '{settings.rootpageId}', absolute: '1', pageType: '78906523')}</id>
<updated>{news.0.lastUpdated -> f:format.date(format: "Y-m-d\TH:i:s+01:00")}</updated> <updated>{news.0.lastUpdated -> f:format.date(format: "Y-m-d\TH:i:s+01:00")}</updated>
<subtitle type="html">News Feed - {absoluteUrl}</subtitle>
<author> <author>
<name>{settings.siteName}</name> <name>{settings.siteName}</name>
</author> </author>
...@@ -18,4 +18,4 @@ ...@@ -18,4 +18,4 @@
<summary type="html">{singleNews.description}</summary> <summary type="html">{singleNews.description}</summary>
</entry> </entry>
</f:for> </f:for>
</feed> </feed>
\ No newline at end of file
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"description": "News System", "description": "News System",
"homepage": "https://www.sgalinski.de", "homepage": "https://www.sgalinski.de",
"license": ["GPL-2.0+"], "license": ["GPL-2.0+"],
"version": "3.3.2", "version": "3.3.3",
"support": { "support": {
}, },
"repositories": [ "repositories": [
......
<?php <?php
$EM_CONF[$_EXTKEY] = [ $EM_CONF[$_EXTKEY] = [
'title' => 'sgalinski News System', 'title' => 'News System',
'description' => 'News System', 'description' => 'News System',
'category' => 'plugin', 'category' => 'plugin',
'author' => 'Stefan Galinski', 'author' => 'Stefan Galinski',
...@@ -19,11 +19,11 @@ $EM_CONF[$_EXTKEY] = [ ...@@ -19,11 +19,11 @@ $EM_CONF[$_EXTKEY] = [
'modify_tables' => '', 'modify_tables' => '',
'clearCacheOnLoad' => 0, 'clearCacheOnLoad' => 0,
'lockType' => '', 'lockType' => '',
'version' => '3.3.2', 'version' => '3.3.3',
'constraints' => [ 'constraints' => [
'depends' => [ 'depends' => [
'typo3' => '7.6.0-7.6.99', 'typo3' => '7.6.0-7.6.99',
'php' => '5.5.0-5.6.99', 'php' => '5.5.0-7.0.99',
], ],
'conflicts' => [], 'conflicts' => [],
'suggests' => [ 'suggests' => [
...@@ -32,5 +32,4 @@ $EM_CONF[$_EXTKEY] = [ ...@@ -32,5 +32,4 @@ $EM_CONF[$_EXTKEY] = [
], ],
], ],
'suggests' => [], 'suggests' => [],
'_md5_values_when_last_written' => '',
]; ];
...@@ -28,17 +28,11 @@ TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( ...@@ -28,17 +28,11 @@ TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
'LLL:EXT:sg_news/Resources/Private/Language/locallang_backend.xlf:titleListByCategoryPlugin' 'LLL:EXT:sg_news/Resources/Private/Language/locallang_backend.xlf:titleListByCategoryPlugin'
); );
TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
'sg_news', 'PageBrowser',
'LLL:EXT:sg_news/Resources/Private/Language/locallang_backend.xlf:titlePageBrowserPlugin'
);
// Removal of the unused plugin setting fields // Removal of the unused plugin setting fields
$TCA['tt_content']['types']['list']['subtypes_excludelist']['sgnews_overview'] = 'select_key,pages,recursive'; $TCA['tt_content']['types']['list']['subtypes_excludelist']['sgnews_overview'] = 'select_key,pages,recursive';
$TCA['tt_content']['types']['list']['subtypes_excludelist']['sgnews_listbycategory'] = 'select_key,pages,recursive'; $TCA['tt_content']['types']['list']['subtypes_excludelist']['sgnews_listbycategory'] = 'select_key,pages,recursive';
$TCA['tt_content']['types']['list']['subtypes_excludelist']['sgnews_latest'] = 'select_key,pages,recursive'; $TCA['tt_content']['types']['list']['subtypes_excludelist']['sgnews_latest'] = 'select_key,pages,recursive';
$TCA['tt_content']['types']['list']['subtypes_excludelist']['sgnews_singleview'] = 'select_key,pages,recursive'; $TCA['tt_content']['types']['list']['subtypes_excludelist']['sgnews_singleview'] = 'select_key,pages,recursive';
$TCA['tt_content']['types']['list']['subtypes_excludelist']['sgnews_pagebrowser'] = 'select_key,pages,recursive';
// Flex form assignment // Flex form assignment
$pluginSignature = str_replace('_', '', 'sg_news') . '_overview'; $pluginSignature = str_replace('_', '', 'sg_news') . '_overview';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment