Commit 8ff0af04 authored by Matthias Adrowski's avatar Matthias Adrowski
Browse files

Merge branch 'master' into feature_Upgrade-to-TYPO3-11

parents 6c62dedb abc1c444
......@@ -101,7 +101,7 @@ class PluginController extends AbstractPlugin {
$renderer->addInlineJavaScriptCode($records, $this->pluginConfiguration['mode'], $tabId);
} elseif ($this->pluginConfiguration['renderer'] === 'Fluid') {
/** @var $renderer FluidView */
$renderer = GeneralUtility::makeInstance(FluidView::class);
$renderer = GeneralUtility::makeInstance(FluidView::class, $this->pluginConfiguration);
}
return $renderer;
......
......@@ -32,6 +32,31 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
* Renders the content
*/
class FluidView implements SingletonInterface {
/**
* @var array
*/
protected $settings = [
'templateRootPaths' => ['EXT:df_tabs/Resources/Private/Templates/'],
'partialRootPaths' => ['EXT:df_tabs/Resources/Private/Partials/'],
'layoutRootPaths' => ['EXT:df_tabs/Resources/Private/Layouts/']
];
/**
* FluidView constructor.
* @param array $settings
*/
public function __construct(array $settings = []) {
if (!empty($settings['view.']['templateRootPaths.'])) {
$this->settings['templateRootPaths'] = $settings['view.']['templateRootPaths.'];
}
if (!empty($settings['view.']['partialRootPaths.'])) {
$this->settings['partialRootPaths'] = $settings['view.']['partialRootPaths.'];
}
if (!empty($settings['view.']['layoutRootPaths.'])) {
$this->settings['layoutRootPaths'] = $settings['view.']['layoutRootPaths.'];
}
}
/**
* Renders the tabs
*
......@@ -41,11 +66,14 @@ class FluidView implements SingletonInterface {
*/
public function renderTabs($tabElements, $tabId) {
$fluidView = GeneralUtility::makeInstance(\TYPO3\CMS\Fluid\View\StandaloneView::class);
$fluidView->setTemplateRootPaths([
GeneralUtility::getFileAbsFileName('EXT:df_tabs/Resources/Private/Templates')
$fluidView->setTemplateRootPaths($this->settings['templateRootPaths']);
$fluidView->setPartialRootPaths($this->settings['partialRootPaths']);
$fluidView->setLayoutRootPaths($this->settings['layoutRootPaths']);
$fluidView->setTemplate('Standard/Tabs.html');
$fluidView->assignMultiple([
'tabElements' => $tabElements,
'tabId' => $tabId
]);
$fluidView->setTemplate('Tabs.html');
$fluidView->assign('tabElements', $tabElements);
return $fluidView->render();
}
}
......@@ -7,6 +7,13 @@ plugin.tx_dftabs_plugin1 {
# cat=plugin.tx_dftabs_plugin1/settings; type=text; label=Defines the Renderer that is used
renderer = TypoScript
# Fluid settings
view {
templateRootPath = EXT:df_tabs/Resources/Private/Templates/
partialRootPath = EXT:df_tabs/Resources/Private/Partials/
layoutRootPath = EXT:df_tabs/Resources/Private/Layouts/
}
# typoscript specific options
enableJavascript = 1
defaultTabTitle = Tab
......
......@@ -32,6 +32,19 @@ plugin.tx_dftabs_plugin1 {
tt_content = {$plugin.tx_dftabs_plugin1.tt_content}
renderer = {$plugin.tx_dftabs_plugin1.renderer}
# Fluid view settings
view {
templateRootPaths {
10 = {$plugin.tx_dftabs_plugin1.view.templateRootPath}
}
partialRootPaths {
10 = {$plugin.tx_dftabs_plugin1.view.partialRootPath}
}
layoutRootPaths {
10 = {$plugin.tx_dftabs_plugin1.view.layoutRootPath}
}
}
# javascript events
events {
onBeforeInitialize = function() {}
......
{
"name": "sgalinski/df-tabs",
"type": "typo3-cms-extension",
"description": "Tabbed Content and Pages - Create tab based content elements and pages easily and flexible with configurable mouseover handling, animations and autoplay features! It requires jquery.",
"homepage": "https://www.sgalinski.de",
"license": [
"GPL-2.0-or-later"
],
"support": {
"issues": "https://gitlab.sgalinski.de/typo3/df_tabs/issues"
},
"version": "7.0.3",
"name": "sgalinski/df-tabs",
"type": "typo3-cms-extension",
"description": "Tabbed Content and Pages - Create tab based content elements and pages easily and flexible with configurable mouseover handling, animations and autoplay features! It requires jquery.",
"homepage": "https://www.sgalinski.de",
"license": ["GPL-2.0-or-later"],
"version": "7.0.4",
"support": {
"issues": "https://gitlab.sgalinski.de/typo3/df_tabs/issues"
},
"require": {
"typo3/cms-core": "^10.4"
},
"replace": {
"sgalinski/df_tabs": "self.version"
},
"extra": {
"typo3/cms": {
"extension-key": "df_tabs"
}
},
"autoload": {
"psr-4": {
"SGalinski\\DfTabs\\": "Classes/"
}
"replace": {
"sgalinski/df_tabs": "self.version"
},
"extra": {
"typo3/cms": {
"extension-key": "df_tabs"
}
},
"autoload": {
"psr-4": {
"SGalinski\\DfTabs\\": "Classes/"
}
}
}
......@@ -15,7 +15,7 @@ $EM_CONF['df_tabs'] = [
'description' => 'Create tab based content elements and pages easily and flexible with configurable mouseover handling, animations and autoplay features! It requires jquery.',
'category' => 'fe',
'shy' => 0,
'version' => '7.0.3',
'version' => '7.0.4',
'dependencies' => '',
'conflicts' => '',
'priority' => '',
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment