Commit 3520ed4f authored by Matthias Adrowski's avatar Matthias Adrowski
Browse files

[TASK] ECS Update + run

parent 110ed442
...@@ -163,10 +163,9 @@ class PluginController extends AbstractPlugin { ...@@ -163,10 +163,9 @@ class PluginController extends AbstractPlugin {
$content = $exception->getMessage(); $content = $exception->getMessage();
} }
if(isset($this->pluginConfiguration['classPrefix'] )) { if (isset($this->pluginConfiguration['classPrefix'])) {
$this->prefixId = $this->pluginConfiguration['classPrefix'] . 'plugin1'; $this->prefixId = $this->pluginConfiguration['classPrefix'] . 'plugin1';
} } else {
else {
$this->prefixId = 'plugin1'; $this->prefixId = 'plugin1';
} }
return $this->pi_wrapInBaseClass($content); return $this->pi_wrapInBaseClass($content);
......
...@@ -33,7 +33,6 @@ use TYPO3\CMS\Fluid\View\StandaloneView; ...@@ -33,7 +33,6 @@ use TYPO3\CMS\Fluid\View\StandaloneView;
* @package SGalinski\DfTabs\Hooks\PageLayoutView * @package SGalinski\DfTabs\Hooks\PageLayoutView
*/ */
class PluginRenderer implements \TYPO3\CMS\Backend\View\PageLayoutViewDrawItemHookInterface { class PluginRenderer implements \TYPO3\CMS\Backend\View\PageLayoutViewDrawItemHookInterface {
protected PreviewService $previewService; protected PreviewService $previewService;
public function init() { public function init() {
......
...@@ -31,7 +31,6 @@ use TYPO3\CMS\Fluid\View\StandaloneView; ...@@ -31,7 +31,6 @@ use TYPO3\CMS\Fluid\View\StandaloneView;
* *
*/ */
class PreviewRenderer implements PreviewRendererInterface { class PreviewRenderer implements PreviewRendererInterface {
public const RETURNTYPE_ARR = 'array'; public const RETURNTYPE_ARR = 'array';
/** /**
......
...@@ -27,7 +27,6 @@ use TYPO3\CMS\Fluid\View\StandaloneView; ...@@ -27,7 +27,6 @@ use TYPO3\CMS\Fluid\View\StandaloneView;
* small helper class, aslong as we use PageLayout hook + Previewrenderer.... * small helper class, aslong as we use PageLayout hook + Previewrenderer....
*/ */
class PreviewService { class PreviewService {
public const RETURNTYPE_ARR = 'array'; public const RETURNTYPE_ARR = 'array';
public function getPluginView(array $row): StandaloneView { public function getPluginView(array $row): StandaloneView {
...@@ -73,7 +72,7 @@ class PreviewService { ...@@ -73,7 +72,7 @@ class PreviewService {
]; ];
} }
$titles = GeneralUtility::trimExplode("\n",$this->passVDefOnKeyToTemplate($pluginConfiguration, 'titles')); $titles = GeneralUtility::trimExplode("\n", $this->passVDefOnKeyToTemplate($pluginConfiguration, 'titles'));
// Remove first item if it is empty to mimic what is actually saved to the DB and frontend behaviour. // Remove first item if it is empty to mimic what is actually saved to the DB and frontend behaviour.
// This gets done automatically on a second save of the plugin anyways but it should happen every time. // This gets done automatically on a second save of the plugin anyways but it should happen every time.
if ($titles[0] === '') { if ($titles[0] === '') {
...@@ -101,16 +100,15 @@ class PreviewService { ...@@ -101,16 +100,15 @@ class PreviewService {
* @return array|mixed|string * @return array|mixed|string
*/ */
private function passVDefOnKeyToTemplate(array $conf, string $key, string $returnType = '') { private function passVDefOnKeyToTemplate(array $conf, string $key, string $returnType = '') {
if(isset($conf[$key])) { if (isset($conf[$key])) {
return $conf[$key]['vDEF']; return $conf[$key]['vDEF'];
} }
// check if we got a possible returntype: // check if we got a possible returntype:
if($returnType === self::RETURNTYPE_ARR) { if ($returnType === self::RETURNTYPE_ARR) {
return []; return [];
} }
return ''; return '';
} }
} }
...@@ -59,6 +59,6 @@ call_user_func( ...@@ -59,6 +59,6 @@ call_user_func(
['source' => 'EXT:df_tabs/Resources/Public/Images/contentElementWizard.png'] ['source' => 'EXT:df_tabs/Resources/Public/Images/contentElementWizard.png']
); );
$GLOBALS['TCA']['tt_content']['types']['list']['previewRenderer']['df_tabs_plugin1'] = \SGalinski\DfTabs\Preview\PreviewRenderer::class; $GLOBALS['TCA']['tt_content']['types']['list']['previewRenderer']['df_tabs_plugin1'] = \SGalinski\DfTabs\Preview\PreviewRenderer::class;
} }
); );
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