Skip to content
Snippets Groups Projects
Commit 9e880e80 authored by Stefan Galinski's avatar Stefan Galinski :video_game:
Browse files

[FEATURE] Improve integration of the news feed to allow settings

parent 58cab336
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
}
......@@ -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
......
......@@ -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>
......
......@@ -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>
......
......@@ -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';
......
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