Skip to content

Commit

Permalink
[FEATURE] Add new content element wizard
Browse files Browse the repository at this point in the history
  • Loading branch information
fabarea committed Aug 29, 2016
1 parent 4930190 commit f064b79
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 13 deletions.
1 change: 1 addition & 0 deletions Classes/Backend/TceForms.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ protected function getPluginConfiguration(array $setup, $extensionName)

/**
* @return ObjectManager
* @throws \InvalidArgumentException
*/
protected function getObjectManager()
{
Expand Down
46 changes: 46 additions & 0 deletions Classes/Backend/Wizard.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php
namespace Fab\RssDisplay\Backend;

/*
* This file is part of the Fab/RssDisplay project under GPLv2 or later.
*
* For the full copyright and license information, please read the
* LICENSE.md file that was distributed with this source code.
*/

use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;

/**
* Class that adds the wizard icon.
*/
class Wizard
{

/**
* Processing the wizard items array
*
* @param array $wizardItems : The wizard items
* @return array
* @throws \BadFunctionCallException
*/
public function proc($wizardItems)
{
$wizardItems['plugins_tx_rssdisplay_pi1'] = array(
'icon' => ExtensionManagementUtility::extRelPath('rss_display') . 'ext_icon.png', #'Resources/Public/Images/RssDisplay.png',
'title' => $this->getLanguageService()->sL('LLL:EXT:rss_display/Resources/Private/Language/locallang.xlf:wizard.title'),
'description' => $this->getLanguageService()->sL('LLL:EXT:rss_display/Resources/Private/Language/locallang.xlf:wizard.description'),
'params' => '&defVals[tt_content][CType]=list&defVals[tt_content][list_type]=rssdisplay_pi1'
);

return $wizardItems;
}

/**
* @return \TYPO3\CMS\Lang\LanguageService
*/
protected function getLanguageService()
{
return $GLOBALS['LANG'];
}

}
13 changes: 8 additions & 5 deletions Resources/Private/Language/fr.locallang.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,27 @@
<file source-language="en" datatype="plaintext" original="messages">
<header/>
<body>
<!-- Wizard -->
<trans-unit id="wizard.title">
<target>Affiche un flux RSS</target>
</trans-unit>
<trans-unit id="wizard.description">
<source>Récupère un flux RSS / Atom et affiche-le.</source>
</trans-unit>

<trans-unit id="tt_content.tx_rssdisplay_feedUrl">
<source>Feed URL</source>
<target>URL du flux</target>
</trans-unit>
<trans-unit id="tt_content.tx_rssdisplay_numberOfItems">
<source>Number of items to be displayed (&gt;1)</source>
<target>Nombre d'items à afficher (&gt;1)</target>
</trans-unit>
<trans-unit id="tt_content.tx_rssdisplay_template">
<source>Template</source>
<target>Template</target>
</trans-unit>
<trans-unit id="tt_content.tx_rssdisplay_descriptionlength">
<source>Length of the description (characters)</source>
<target>Longueur de la description (en caractères)</target>
</trans-unit>
<trans-unit id="tt_content.list_type_pi1">
<source>RSS Feed Display</source>
<target>RSS Feed Display</target>
</trans-unit>
</body>
Expand Down
8 changes: 8 additions & 0 deletions Resources/Private/Language/locallang.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
<file source-language="en" datatype="plaintext" original="messages">
<header/>
<body>
<!-- Wizard -->
<trans-unit id="wizard.title">
<source>RSS Feed Display</source>
</trans-unit>
<trans-unit id="wizard.description">
<source>Fetch a RSS / Atom Feed and display its content.</source>
</trans-unit>

<trans-unit id="tt_content.tx_rssdisplay_feedUrl">
<source>Feed URL</source>
</trans-unit>
Expand Down
Binary file removed ext_icon.gif
Binary file not shown.
Binary file added ext_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 5 additions & 7 deletions ext_localconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,15 @@
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'Fab.rss_display',
'Pi1',
array('Feed' => 'show'),
$pluginType === 'USER_INT' ? array('Feed' => 'show') : array()
['Feed' => 'show'],
$pluginType === 'USER_INT' ? ['Feed' => 'show'] : []
);

$TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['rssdisplay'] = array(
$TYPO3_CONF_VARS['SYS']['caching']['cacheConfigurations']['rssdisplay'] = [
'frontend' => 'TYPO3\CMS\Core\Cache\Frontend\StringFrontend',
// 'options' => array(),
'groups' => array('all', 'rssdisplay')
);


'groups' => ['all', 'rssdisplay']
];

# Install PSR-0-compatible class autoloader for SimplePie Library in Resources/PHP/SimplePie
spl_autoload_register(function ($class) {
Expand Down
4 changes: 3 additions & 1 deletion ext_tables.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@
$configuration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['rss_display']);
if (true === isset($configuration['autoload_typoscript']['value']) && true === (bool)$configuration['autoload_typoscript']['value']) {
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile('rss_display', 'Configuration/TypoScript', 'RSS Display: display a RSS / Atom feed');
}
}

$GLOBALS['TBE_MODULES_EXT']["xMOD_db_new_content_el"]['addElClasses'][\Fab\RssDisplay\Backend\Wizard::class] = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('rss_display') . 'Classes/Backend/Wizard.php';

0 comments on commit f064b79

Please sign in to comment.