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 { ...@@ -101,7 +101,7 @@ class PluginController extends AbstractPlugin {
$renderer->addInlineJavaScriptCode($records, $this->pluginConfiguration['mode'], $tabId); $renderer->addInlineJavaScriptCode($records, $this->pluginConfiguration['mode'], $tabId);
} elseif ($this->pluginConfiguration['renderer'] === 'Fluid') { } elseif ($this->pluginConfiguration['renderer'] === 'Fluid') {
/** @var $renderer FluidView */ /** @var $renderer FluidView */
$renderer = GeneralUtility::makeInstance(FluidView::class); $renderer = GeneralUtility::makeInstance(FluidView::class, $this->pluginConfiguration);
} }
return $renderer; return $renderer;
......
...@@ -32,6 +32,31 @@ use TYPO3\CMS\Core\Utility\GeneralUtility; ...@@ -32,6 +32,31 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
* Renders the content * Renders the content
*/ */
class FluidView implements SingletonInterface { 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 * Renders the tabs
* *
...@@ -41,11 +66,14 @@ class FluidView implements SingletonInterface { ...@@ -41,11 +66,14 @@ class FluidView implements SingletonInterface {
*/ */
public function renderTabs($tabElements, $tabId) { public function renderTabs($tabElements, $tabId) {
$fluidView = GeneralUtility::makeInstance(\TYPO3\CMS\Fluid\View\StandaloneView::class); $fluidView = GeneralUtility::makeInstance(\TYPO3\CMS\Fluid\View\StandaloneView::class);
$fluidView->setTemplateRootPaths([ $fluidView->setTemplateRootPaths($this->settings['templateRootPaths']);
GeneralUtility::getFileAbsFileName('EXT:df_tabs/Resources/Private/Templates') $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(); return $fluidView->render();
} }
} }
...@@ -7,6 +7,13 @@ plugin.tx_dftabs_plugin1 { ...@@ -7,6 +7,13 @@ plugin.tx_dftabs_plugin1 {
# cat=plugin.tx_dftabs_plugin1/settings; type=text; label=Defines the Renderer that is used # cat=plugin.tx_dftabs_plugin1/settings; type=text; label=Defines the Renderer that is used
renderer = TypoScript 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 # typoscript specific options
enableJavascript = 1 enableJavascript = 1
defaultTabTitle = Tab defaultTabTitle = Tab
......
...@@ -32,6 +32,19 @@ plugin.tx_dftabs_plugin1 { ...@@ -32,6 +32,19 @@ plugin.tx_dftabs_plugin1 {
tt_content = {$plugin.tx_dftabs_plugin1.tt_content} tt_content = {$plugin.tx_dftabs_plugin1.tt_content}
renderer = {$plugin.tx_dftabs_plugin1.renderer} 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 # javascript events
events { events {
onBeforeInitialize = function() {} onBeforeInitialize = function() {}
......
{ {
"name": "sgalinski/df-tabs", "name": "sgalinski/df-tabs",
"type": "typo3-cms-extension", "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.", "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", "homepage": "https://www.sgalinski.de",
"license": [ "license": ["GPL-2.0-or-later"],
"GPL-2.0-or-later" "version": "7.0.4",
], "support": {
"support": { "issues": "https://gitlab.sgalinski.de/typo3/df_tabs/issues"
"issues": "https://gitlab.sgalinski.de/typo3/df_tabs/issues" },
},
"version": "7.0.3",
"require": { "require": {
"typo3/cms-core": "^10.4" "typo3/cms-core": "^10.4"
}, },
"replace": { "replace": {
"sgalinski/df_tabs": "self.version" "sgalinski/df_tabs": "self.version"
}, },
"extra": { "extra": {
"typo3/cms": { "typo3/cms": {
"extension-key": "df_tabs" "extension-key": "df_tabs"
} }
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"SGalinski\\DfTabs\\": "Classes/" "SGalinski\\DfTabs\\": "Classes/"
}
} }
}
} }
...@@ -15,7 +15,7 @@ $EM_CONF['df_tabs'] = [ ...@@ -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.', 'description' => 'Create tab based content elements and pages easily and flexible with configurable mouseover handling, animations and autoplay features! It requires jquery.',
'category' => 'fe', 'category' => 'fe',
'shy' => 0, 'shy' => 0,
'version' => '7.0.3', 'version' => '7.0.4',
'dependencies' => '', 'dependencies' => '',
'conflicts' => '', 'conflicts' => '',
'priority' => '', '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