Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Classes/Backend/FlexformHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Configuration\ConfigurationManager;
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
use TYPO3\CMS\Extbase\Object\ObjectManager;

/**
* Helper functions for Flexform
Expand Down
95 changes: 0 additions & 95 deletions Classes/Backend/TceForms.php

This file was deleted.

59 changes: 0 additions & 59 deletions Classes/Backend/Wizard.php

This file was deleted.

12 changes: 6 additions & 6 deletions Classes/Controller/FeedController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
use Psr\Http\Message\ResponseInterface;

/**
* RSS display that will fetch the content of a RSS Feed and display it onto the Frontend.
Expand All @@ -31,7 +32,7 @@ class FeedController extends ActionController
* Initialize object
* @throws \RuntimeException
*/
public function initializeAction()
public function initializeAction(): void
{
if (empty($this->settings['template'])) {
$this->settings['template'] = 'EXT:rss_display/Resources/Private/Templates/Feed/Show.html';
Expand All @@ -45,10 +46,9 @@ public function initializeAction()
}

/**
* @return string
* @throws \Exception
*/
public function showAction()
public function showAction(): ResponseInterface
{

// @todo !! better add check if the Feed URL is alive. If not log it and send an email to the webmaster.
Expand All @@ -68,7 +68,7 @@ public function showAction()
$this->view->assign('title', $feed->get_title());
$this->view->assign('items', $feed->get_items(0, (int)$this->settings['numberOfItems']));
$this->view->assign('settings', $this->settings);
$cObj = $this->configurationManager->getContentObject();
$cObj = $this->request->getAttribute('currentContentObject');
$this->view->assign('data', $cObj->data);
$result = $this->view->render();

Expand All @@ -79,7 +79,7 @@ public function showAction()
}
}

return $result;
return $this->htmlResponse($result);
}

/**
Expand All @@ -106,7 +106,7 @@ protected function canFetchResultFromCache()
$result = FALSE;
if ($this->getPluginType() === self::PLUGIN_TYPE_USER_INT
&& $this->getCacheInstance()->has($this->getCacheIdentifier())
&& !GeneralUtility::_GET('no_cache')
&& !($this->request->getQueryParams()['no_cache'] ?? null)
) {
$result = TRUE;
}
Expand Down
47 changes: 20 additions & 27 deletions Configuration/FlexForm/feed.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,37 +11,30 @@
<type>array</type>
<el>
<settings.feedUrl>
<TCEforms>
<label>LLL:EXT:rss_display/Resources/Private/Language/locallang.xlf:tt_content.tx_rssdisplay_feedUrl</label>
<config>
<type>input</type>
<size>50</size>
<max>400</max>
<default>http://www.w3.org/blog/news/feed/atom</default>
</config>
</TCEforms>
<label>LLL:EXT:rss_display/Resources/Private/Language/locallang.xlf:tt_content.tx_rssdisplay_feedUrl</label>
<config>
<type>input</type>
<size>50</size>
<max>400</max>
<default>http://www.w3.org/blog/news/feed/atom</default>
</config>
</settings.feedUrl>
<settings.numberOfItems>
<TCEforms>
<label>LLL:EXT:rss_display/Resources/Private/Language/locallang.xlf:tt_content.tx_rssdisplay_numberOfItems</label>
<config>
<type>input</type>
<size>30</size>
<eval>int</eval>
<default>10</default>
</config>
</TCEforms>
<label>LLL:EXT:rss_display/Resources/Private/Language/locallang.xlf:tt_content.tx_rssdisplay_numberOfItems</label>
<config>
<type>input</type>
<size>30</size>
<eval>int</eval>
<default>10</default>
</config>
</settings.numberOfItems>
<settings.template>
<TCEforms>
<label>LLL:EXT:rss_display/Resources/Private/Language/locallang.xlf:tt_content.tx_rssdisplay_template</label>
<config>
<type>select</type>
<itemsProcFunc>Fab\RssDisplay\Backend\FlexformHelper->populateTemplatesList</itemsProcFunc>
<renderType>selectSingle</renderType>
<items></items>
</config>
</TCEforms>
<label>LLL:EXT:rss_display/Resources/Private/Language/locallang.xlf:tt_content.tx_rssdisplay_template</label>
<config>
<type>select</type>
<itemsProcFunc>Fab\RssDisplay\Backend\FlexformHelper->populateTemplatesList</itemsProcFunc>
<renderType>selectSingle</renderType>
</config>
</settings.template>
<!-- @todo add conditional configuration tx_rssdisplay_descriptionlength -->
</el>
Expand Down
12 changes: 12 additions & 0 deletions Configuration/Services.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
services:
# general settings
_defaults:
autowire: true
autoconfigure: true
public: false

Fab\RssDisplay\:
resource: '../Classes/*'

Fab\RssDisplay\Controller\FeedController:
public: true
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?php

defined('TYPO3_MODE') or die();
defined('TYPO3') or die();

\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
'rss_display',
'Pi1',
'Fetch and display a RSS feed'
);

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('rssdisplay_pi1', 'FILE:EXT:rss_display/Configuration/FlexForm/feed.xml');
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['rssdisplay_pi1'] = 'layout, select_key, pages, recursive';
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['rssdisplay_pi1'] = 'pi_flexform';
Expand Down
17 changes: 17 additions & 0 deletions Configuration/TsConfig/ContentElementWizard.tsconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
mod.wizards {
newContentElement.wizardItems {
plugins {
elements {
rssdisplay_pi1 {
iconIdentifier = content-widget-rss
title = RSS Feed Display
description = Create a list of rss items
tt_content_defValues {
CType = list
list_type = rssdisplay_pi1
}
}
}
}
}
}
1 change: 1 addition & 0 deletions Configuration/page.tsconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import 'EXT:rss_display/Configuration/TsConfig/ContentElementWizard.tsconfig'
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"issues": "https://github.com/fabarea/rss_display/issues"
},
"require": {
"typo3/cms-core": "^10.4 || ^11.5",
"typo3/cms-core": "^12.4 || ^13.4",
"simplepie/simplepie": "^1.5"
},
"autoload": {
Expand Down
2 changes: 1 addition & 1 deletion ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
'author_company' => 'Ecodev',
'constraints' => [
'depends' => [
'typo3' => '10.4.0-11.5.99',
'typo3' => '12.4.0-13.4.99',
],
],
];
34 changes: 15 additions & 19 deletions ext_localconf.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
<?php
if (!defined('TYPO3_MODE')) die ('Access denied.');
$typo3Version = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Information\Typo3Version::class);
declare(strict_types=1);

if (!defined('TYPO3')) die ('Access denied.');


use Fab\RssDisplay\Controller\FeedController;



// Define whether USER or USER_INT.
$pluginType = 'USER_INT';
Expand All @@ -26,23 +32,13 @@
}

// Configure Extbase plugin
if ($typo3Version->getMajorVersion() >= 11) {
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'rss_display',
'Pi1',
[\Fab\RssDisplay\Controller\FeedController::class => 'show'],
$pluginType === 'USER_INT' ? [\Fab\RssDisplay\Controller\FeedController::class => 'show'] : [],
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::PLUGIN_TYPE_PLUGIN
);

} else {
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'Fab.rss_display',
'Pi1',
['Feed' => 'show'],
$pluginType === 'USER_INT' ? ['Feed' => 'show'] : []
);
}
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'rss_display',
'Pi1',
[FeedController::class => 'show'],
$pluginType === 'USER_INT' ? [FeedController::class => 'show'] : [],
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::PLUGIN_TYPE_PLUGIN
);

// cache configuration, see
// https://docs.typo3.org/typo3cms/CoreApiReference/ApiOverview/CachingFramework/Configuration/Index.html#cache-configurations
Expand Down
Loading