diff --git a/typo3/sysext/backend/Classes/Controller/PageLayoutController.php b/typo3/sysext/backend/Classes/Controller/PageLayoutController.php index dbfecc8d67f919e2e730c9a52cab88decae31d2b..3133a82fbfbd072eb1f0c19a1695a36f9a3c0d90 100644 --- a/typo3/sysext/backend/Classes/Controller/PageLayoutController.php +++ b/typo3/sysext/backend/Classes/Controller/PageLayoutController.php @@ -22,6 +22,7 @@ use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\MathUtility; use TYPO3\CMS\Extbase\Object\ObjectManager; +use TYPO3\CMS\Fluid\View\StandaloneView; use TYPO3\CMS\Fluid\ViewHelpers\Be\InfoboxViewHelper; /** @@ -399,17 +400,15 @@ class PageLayoutController { $title = $GLOBALS['LANG']->getLL('goToListModule'); $message = '<p>' . $GLOBALS['LANG']->getLL('goToListModuleMessage') . '</p>'; $message .= '<a class="btn btn-info" href="javascript:top.goToModule(\'web_list\',1);">' . $GLOBALS['LANG']->getLL('goToListModule') . '</a>'; - // @todo Usage of InfoboxViewHelper this way is pretty ugly, but the best way at the moment - // A complete refactoring is necessary at this point - $arguments = array( + + $view = GeneralUtility::makeInstance(StandaloneView::class); + $view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName('EXT:backend/Resources/Private/Templates/InfoBox.html')); + $view->assignMultiple(array( 'title' => $title, 'message' => $message, - 'state' => InfoboxViewHelper::STATE_INFO, - 'iconName' => NULL, - 'disableIcon' => FALSE, - ); - $renderingContext = new \TYPO3\CMS\Fluid\Core\Rendering\RenderingContext(); - $content .= InfoboxViewHelper::renderStatic($arguments, function() {}, $renderingContext); + 'state' => InfoboxViewHelper::STATE_INFO + )); + $content .= $view->render(); } } // If content from different pid is displayed @@ -624,17 +623,15 @@ class PageLayoutController { $title = $GLOBALS['LANG']->getLL('clickAPage_header'); $message = $GLOBALS['LANG']->getLL('clickAPage_content'); - // @todo Usage of InfoboxViewHelper this way is pretty ugly, but the best way at the moment - // A complete refactoring is necessary at this point - $arguments = array( + + $view = GeneralUtility::makeInstance(StandaloneView::class); + $view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName('EXT:backend/Resources/Private/Templates/InfoBox.html')); + $view->assignMultiple(array( 'title' => $title, 'message' => $message, - 'state' => InfoboxViewHelper::STATE_INFO, - 'iconName' => NULL, - 'disableIcon' => FALSE, - ); - $renderingContext = new \TYPO3\CMS\Fluid\Core\Rendering\RenderingContext(); - $body .= InfoboxViewHelper::renderStatic($arguments, function() {}, $renderingContext); + 'state' => InfoboxViewHelper::STATE_INFO + )); + $body .= $view->render(); // Setting up the buttons and markers for docheader $docHeaderButtons = array( diff --git a/typo3/sysext/backend/Resources/Private/Templates/InfoBox.html b/typo3/sysext/backend/Resources/Private/Templates/InfoBox.html new file mode 100644 index 0000000000000000000000000000000000000000..a526fbbd5e574a218565c35c14efacf64eb6c349 --- /dev/null +++ b/typo3/sysext/backend/Resources/Private/Templates/InfoBox.html @@ -0,0 +1,3 @@ +<f:be.infobox title="{title}" state="{state}"> + <f:format.html>{message}</f:format.html> +</f:be.infobox> diff --git a/typo3/sysext/func/Classes/Controller/PageFunctionsController.php b/typo3/sysext/func/Classes/Controller/PageFunctionsController.php index 6b47e63b6ab3e06d5b2ed55e54590fe98990c50f..6f44dea2470e161a80a57cf4b21fb3d54665b2f1 100644 --- a/typo3/sysext/func/Classes/Controller/PageFunctionsController.php +++ b/typo3/sysext/func/Classes/Controller/PageFunctionsController.php @@ -17,6 +17,7 @@ namespace TYPO3\CMS\Func\Controller; use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Object\ObjectManager; +use TYPO3\CMS\Fluid\View\StandaloneView; use TYPO3\CMS\Fluid\ViewHelpers\Be\InfoboxViewHelper; /** @@ -102,17 +103,14 @@ class PageFunctionsController extends \TYPO3\CMS\Backend\Module\BaseScriptClass // If no access or if ID == zero $title = $this->getLanguageService()->getLL('title'); $message = $this->getLanguageService()->getLL('clickAPage_content'); - // @todo Usage of InfoboxViewHelper this way is pretty ugly, but the best way at the moment - // A complete refactoring is necessary at this point - $arguments = array( + $view = GeneralUtility::makeInstance(StandaloneView::class); + $view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName('EXT:func/Resources/Private/Templates/InfoBox.html')); + $view->assignMultiple(array( 'title' => $title, 'message' => $message, - 'state' => InfoboxViewHelper::STATE_INFO, - 'iconName' => NULL, - 'disableIcon' => FALSE, - ); - $renderingContext = new \TYPO3\CMS\Fluid\Core\Rendering\RenderingContext(); - $this->content = InfoboxViewHelper::renderStatic($arguments, function() {}, $renderingContext); + 'state' => InfoboxViewHelper::STATE_INFO + )); + $this->content = $view->render(); // Setting up the buttons and markers for docheader $docHeaderButtons = $this->getButtons(); diff --git a/typo3/sysext/func/Resources/Private/Templates/InfoBox.html b/typo3/sysext/func/Resources/Private/Templates/InfoBox.html new file mode 100644 index 0000000000000000000000000000000000000000..a526fbbd5e574a218565c35c14efacf64eb6c349 --- /dev/null +++ b/typo3/sysext/func/Resources/Private/Templates/InfoBox.html @@ -0,0 +1,3 @@ +<f:be.infobox title="{title}" state="{state}"> + <f:format.html>{message}</f:format.html> +</f:be.infobox> diff --git a/typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateModuleController.php b/typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateModuleController.php index 79a66bb34c27d3bf9044d9ba6dfecc5c4774d9c1..7b510bcf54786dfb4924b97b0df6b638badf78ac 100644 --- a/typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateModuleController.php +++ b/typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateModuleController.php @@ -24,6 +24,7 @@ use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Backend\Utility\IconUtility; use TYPO3\CMS\Core\Utility\MathUtility; use TYPO3\CMS\Extbase\Object\ObjectManager; +use TYPO3\CMS\Fluid\View\StandaloneView; use TYPO3\CMS\Fluid\ViewHelpers\Be\InfoboxViewHelper; /** @@ -358,17 +359,15 @@ class TypoScriptTemplateModuleController extends BaseScriptClass { $title = $lang->getLL('noTemplate'); $message = '<p>' . $lang->getLL('noTemplateDescription') . '<br />' . $lang->getLL('createTemplateToEditConfiguration') . '</p>'; - // @todo Usage of InfoboxViewHelper this way is pretty ugly, but the best way at the moment - // A complete refactoring is necessary at this point - $arguments = array( + + $view = GeneralUtility::makeInstance(StandaloneView::class); + $view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName('EXT:tstemplate/Resources/Private/Templates/InfoBox.html')); + $view->assignMultiple(array( 'title' => $title, 'message' => $message, - 'state' => InfoboxViewHelper::STATE_INFO, - 'iconName' => NULL, - 'disableIcon' => FALSE, - ); - $renderingContext = new \TYPO3\CMS\Fluid\Core\Rendering\RenderingContext(); - $theOutput = InfoboxViewHelper::renderStatic($arguments, function() {}, $renderingContext); + 'state' => InfoboxViewHelper::STATE_INFO + )); + $theOutput = $view->render(); // New standard? if ($newStandardTemplate) { diff --git a/typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateObjectBrowserModuleFunctionController.php b/typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateObjectBrowserModuleFunctionController.php index ca27253c189cdf046d204c72fc3fe0dc591c2842..82f57bb5af4de803943be8f798fd47cdb5eaf87c 100644 --- a/typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateObjectBrowserModuleFunctionController.php +++ b/typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateObjectBrowserModuleFunctionController.php @@ -24,6 +24,7 @@ use TYPO3\CMS\Core\TypoScript\ExtendedTemplateService; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\MathUtility; use TYPO3\CMS\Extbase\Object\ObjectManager; +use TYPO3\CMS\Fluid\View\StandaloneView; use TYPO3\CMS\Fluid\ViewHelpers\Be\InfoboxViewHelper; use TYPO3\CMS\Frontend\Page\PageRepository; @@ -438,17 +439,14 @@ class TypoScriptTemplateObjectBrowserModuleFunctionController extends AbstractFu $title = $lang->getLL('errorsWarnings'); $message = '<p>' . implode($errMsg, '<br />') . '</p>'; - // @todo Usage of InfoboxViewHelper this way is pretty ugly, but the best way at the moment - // A complete refactoring is necessary at this point - $arguments = array( + $view = GeneralUtility::makeInstance(StandaloneView::class); + $view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName('EXT:tstemplate/Resources/Private/Templates/InfoBox.html')); + $view->assignMultiple(array( 'title' => $title, 'message' => $message, - 'state' => InfoboxViewHelper::STATE_WARNING, - 'iconName' => NULL, - 'disableIcon' => FALSE, - ); - $renderingContext = new \TYPO3\CMS\Fluid\Core\Rendering\RenderingContext(); - $theOutput .= InfoboxViewHelper::renderStatic($arguments, function() {}, $renderingContext); + 'state' => InfoboxViewHelper::STATE_WARNING + )); + $theOutput .= $view->render(); } if (isset($this->pObj->MOD_SETTINGS['ts_browser_TLKeys_' . $bType][$theKey])) { diff --git a/typo3/sysext/tstemplate/Resources/Private/Templates/InfoBox.html b/typo3/sysext/tstemplate/Resources/Private/Templates/InfoBox.html new file mode 100644 index 0000000000000000000000000000000000000000..a526fbbd5e574a218565c35c14efacf64eb6c349 --- /dev/null +++ b/typo3/sysext/tstemplate/Resources/Private/Templates/InfoBox.html @@ -0,0 +1,3 @@ +<f:be.infobox title="{title}" state="{state}"> + <f:format.html>{message}</f:format.html> +</f:be.infobox>