diff --git a/Classes/Controller/NewsFeedController.php b/Classes/Controller/NewsFeedController.php index 1c130c418f08b0e0cf301f97759e5ffaf90ea9a8..8808e69f2fbce99665dd947d86073099d0626db5 100644 --- a/Classes/Controller/NewsFeedController.php +++ b/Classes/Controller/NewsFeedController.php @@ -2,29 +2,31 @@ namespace SGalinski\SgNews\Controller; - /*************************************************************** - * Copyright notice - * - * (c) sgalinski Internet Services (https://www.sgalinski.de) - * - * All rights reserved - * - * This script is part of the TYPO3 project. The TYPO3 project is - * free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * The GNU General Public License can be found at - * http://www.gnu.org/copyleft/gpl.html. - * - * This script is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * This copyright notice MUST APPEAR in all copies of the script! - ***************************************************************/ +/*************************************************************** + * Copyright notice + * + * (c) sgalinski Internet Services (https://www.sgalinski.de) + * + * All rights reserved + * + * This script is part of the TYPO3 project. The TYPO3 project is + * free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * The GNU General Public License can be found at + * http://www.gnu.org/copyleft/gpl.html. + * + * This script is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * This copyright notice MUST APPEAR in all copies of the script! + ***************************************************************/ + +use TYPO3\CMS\Core\Utility\GeneralUtility; /** * Controller that handles the news feed rendering @@ -42,7 +44,8 @@ class NewsFeedController extends AbstractController { * @return void */ 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); } } diff --git a/Classes/ViewHelpers/ExtendedIfViewHelper.php b/Classes/ViewHelpers/ExtendedIfViewHelper.php index 6fad1ac503bce26a05b2d7b1d429bd124cf678bf..e1e50c2134105e8fc24051dd5574edbcf4ab50f5 100644 --- a/Classes/ViewHelpers/ExtendedIfViewHelper.php +++ b/Classes/ViewHelpers/ExtendedIfViewHelper.php @@ -32,6 +32,22 @@ use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractConditionViewHelper; * ExtendedIfViewHelper */ 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. * diff --git a/Configuration/TCA/Overrides/pages.php b/Configuration/TCA/Overrides/pages.php index d7eacbfa4a822315e6041ee0866076f8f8852f24..101a636bba65d7ce94e5e385b9c93b5f3af69b70 100644 --- a/Configuration/TCA/Overrides/pages.php +++ b/Configuration/TCA/Overrides/pages.php @@ -101,81 +101,78 @@ $imageColumns = [ ], ]; -$columns = array_merge([ - 'tx_sgnews_author' => [ - 'exclude' => TRUE, - 'l10n_exclude' => TRUE, - 'label' => 'LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:pages.tx_sgnews_author', - 'config' => [ - 'type' => 'select', - 'minitems' => 0, - 'foreign_table' => 'fe_users', - 'foreign_table_where' => 'ORDER BY fe_users.name', - 'items' => [ - ['', ''], - ], - 'wizards' => [ - 'edit' => [ - 'type' => 'popup', - 'title' => 'Edit', - 'module' => ['name' => 'wizard_edit'], - 'icon' => 'edit2.gif', - 'popup_onlyOpenIfSelected' => 1, +$columns = array_merge( + [ + 'tx_sgnews_author' => [ + 'exclude' => TRUE, + 'l10n_exclude' => TRUE, + 'label' => 'LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:pages.tx_sgnews_author', + 'config' => [ + 'type' => 'group', + 'internal_type' => 'db', + 'allowed' => 'fe_users', + 'size' => 1, + 'minitems' => 0, + 'maxitems' => 1, + 'items' => [ + ['', ''], ], - 'suggest' => [ - 'type' => 'suggest', + 'wizards' => [ + 'suggest' => [ + 'type' => 'suggest', + ], ], ], ], - ], - 'tx_sgnews_related_news' => [ - 'exclude' => TRUE, - 'l10n_exclude' => TRUE, - 'label' => 'LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:pages.tx_sgnews_related_news', - 'config' => [ - 'type' => 'group', - 'internal_type' => 'db', - 'allowed' => 'pages', - 'size' => 5, - 'minitems' => 0, - 'maxitems' => 99, - 'wizards' => [ - 'suggest' => [ - 'type' => 'suggest', + 'tx_sgnews_related_news' => [ + 'exclude' => TRUE, + 'l10n_exclude' => TRUE, + 'label' => 'LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:pages.tx_sgnews_related_news', + 'config' => [ + 'type' => 'group', + 'internal_type' => 'db', + 'allowed' => 'pages', + 'size' => 5, + 'minitems' => 0, + 'maxitems' => 99, + 'wizards' => [ + 'suggest' => [ + 'type' => 'suggest', + ], ], ], ], - ], - 'tx_sgnews_highlighted' => [ - 'displayCond' => 'FIELD:tx_sgnews_never_highlighted:=:0', - 'exclude' => TRUE, - 'l10n_exclude' => TRUE, - 'label' => 'LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:pages.tx_sgnews_highlighted', - 'config' => [ - 'type' => 'check', + 'tx_sgnews_highlighted' => [ + 'displayCond' => 'FIELD:tx_sgnews_never_highlighted:=:0', + 'exclude' => TRUE, + 'l10n_exclude' => TRUE, + 'label' => 'LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:pages.tx_sgnews_highlighted', + 'config' => [ + 'type' => 'check', + ], ], - ], - 'tx_sgnews_never_highlighted' => [ - 'displayCond' => 'FIELD:tx_sgnews_highlighted:=:0', - 'exclude' => TRUE, - 'l10n_exclude' => TRUE, - 'label' => 'LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:pages.tx_sgnews_never_highlighted', - 'config' => [ - 'type' => 'check', + 'tx_sgnews_never_highlighted' => [ + 'displayCond' => 'FIELD:tx_sgnews_highlighted:=:0', + 'exclude' => TRUE, + 'l10n_exclude' => TRUE, + 'label' => 'LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:pages.tx_sgnews_never_highlighted', + 'config' => [ + 'type' => 'check', + ], ], - ], - 'lastUpdated' => [ - 'exclude' => TRUE, - 'label' => 'LLL:EXT:cms/locallang_tca.xlf:pages.lastUpdated', - 'config' => [ - 'type' => 'input', - 'size' => '13', - 'max' => '20', - 'eval' => 'datetime', - 'default' => $GLOBALS['EXEC_TIME'], - ] - ], -], $imageColumns); + 'lastUpdated' => [ + 'exclude' => TRUE, + 'label' => 'LLL:EXT:cms/locallang_tca.xlf:pages.lastUpdated', + 'config' => [ + 'type' => 'input', + 'size' => '13', + 'max' => '20', + 'eval' => 'datetime', + 'default' => $GLOBALS['EXEC_TIME'], + ] + ], + ], $imageColumns +); // # // # Pages @@ -216,7 +213,10 @@ $GLOBALS['TCA']['pages']['types'][116] = [ --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.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] = [ --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.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')) { $GLOBALS['TCA']['pages_language_overlay']['types'][116] = [ '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, tx_sgnews_teaser2_image, tx_sgnews_teaser1_image, --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.metadata, diff --git a/Configuration/TypoScript/Frontend/setup.txt b/Configuration/TypoScript/Frontend/setup.txt index e4ccb4f85e139ae0c5da52b1843e4ab62a46bdc5..fcf18fad451a019291f66a10a04a77d4ced7dc69 100644 --- a/Configuration/TypoScript/Frontend/setup.txt +++ b/Configuration/TypoScript/Frontend/setup.txt @@ -9,7 +9,23 @@ newsFeed = PAGE newsFeed { 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 { disableAllHeaderCode = 1 diff --git a/Resources/Private/Language/de.locallang_backend.xlf b/Resources/Private/Language/de.locallang_backend.xlf index 390e281691c57841c1a8f69aefea73428b2fab4b..49715fd3909f972da69b6bbf2855ae2230a20f17 100644 --- a/Resources/Private/Language/de.locallang_backend.xlf +++ b/Resources/Private/Language/de.locallang_backend.xlf @@ -33,10 +33,6 @@ <source>News Overview</source> <target>News-Ãœbersicht</target> </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"> <source>News Single View</source> <target>News-Einzelansicht</target> diff --git a/Resources/Private/Language/locallang_backend.xlf b/Resources/Private/Language/locallang_backend.xlf index 12770e7d8138e0ba608bd5c968b0d4bbdf65e184..885fca1384fd197378b4307e6b2f38a3dacbba43 100644 --- a/Resources/Private/Language/locallang_backend.xlf +++ b/Resources/Private/Language/locallang_backend.xlf @@ -27,9 +27,6 @@ <trans-unit id="titleOverviewPlugin"> <source>News Overview</source> </trans-unit> - <trans-unit id="titlePageBrowserPlugin"> - <source>Page Browser Plugin</source> - </trans-unit> <trans-unit id="titleSingleViewPlugin"> <source>News Single View</source> </trans-unit> diff --git a/Resources/Private/Templates/NewsFeed/Index.html b/Resources/Private/Templates/NewsFeed/Index.html index 3261b908df64648d73a5ee8c894aedb3234f1952..e0ba35d2a711e3a835e4a7ac2763d608c96b1c6e 100644 --- a/Resources/Private/Templates/NewsFeed/Index.html +++ b/Resources/Private/Templates/NewsFeed/Index.html @@ -1,11 +1,11 @@ <?xml version="1.0" encoding="utf-8"?>{namespace sg=SGalinski\SgNews\ViewHelpers} <feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de"> <title>News Feed</title> - <link href="{f:uri.page(pageUid: '{rootpageId}', absolute: '1')}" /> - <link rel="self" type="application/atom+xml" href="{f:uri.page(pageUid: '{rootpageId}', absolute: '1', pageType: '78906523')}" /> - <id>{f:uri.page(pageUid: '{rootpageId}', absolute: '1')}news.xml</id> + <subtitle type="html">{settings.siteName}</subtitle> + <link href="{f:uri.page(pageUid: '{settings.rootpageId}', absolute: '1')}" /> + <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> - <subtitle type="html">News Feed - {absoluteUrl}</subtitle> <author> <name>{settings.siteName}</name> </author> @@ -18,4 +18,4 @@ <summary type="html">{singleNews.description}</summary> </entry> </f:for> -</feed> \ No newline at end of file +</feed> diff --git a/composer.json b/composer.json index 4567dd306ec96051ae4e9369ad7234d2624dfe1a..ddc5ddc61d03750d7673b8b1b308021b975ea4fa 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "description": "News System", "homepage": "https://www.sgalinski.de", "license": ["GPL-2.0+"], - "version": "3.3.2", + "version": "3.3.3", "support": { }, "repositories": [ diff --git a/ext_emconf.php b/ext_emconf.php index 5963ed34e7db264a4c03d9c99719debd09381ffc..b52cdacee5080a1abf510b1a449903511c115aa4 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -1,7 +1,7 @@ <?php $EM_CONF[$_EXTKEY] = [ - 'title' => 'sgalinski News System', + 'title' => 'News System', 'description' => 'News System', 'category' => 'plugin', 'author' => 'Stefan Galinski', @@ -19,11 +19,11 @@ $EM_CONF[$_EXTKEY] = [ 'modify_tables' => '', 'clearCacheOnLoad' => 0, 'lockType' => '', - 'version' => '3.3.2', + 'version' => '3.3.3', 'constraints' => [ 'depends' => [ 'typo3' => '7.6.0-7.6.99', - 'php' => '5.5.0-5.6.99', + 'php' => '5.5.0-7.0.99', ], 'conflicts' => [], 'suggests' => [ @@ -32,5 +32,4 @@ $EM_CONF[$_EXTKEY] = [ ], ], 'suggests' => [], - '_md5_values_when_last_written' => '', ]; diff --git a/ext_tables.php b/ext_tables.php index 564a6a33f9148651e5c80c55c4b38597b01de4e3..1bd3d27f861aa8311a4c486d387dc9c8e8a4f82b 100644 --- a/ext_tables.php +++ b/ext_tables.php @@ -28,17 +28,11 @@ TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( '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 $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_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_pagebrowser'] = 'select_key,pages,recursive'; // Flex form assignment $pluginSignature = str_replace('_', '', 'sg_news') . '_overview';