diff --git a/typo3/sysext/backend/Classes/Module/BaseScriptClass.php b/typo3/sysext/backend/Classes/Module/BaseScriptClass.php index 7ae86314df718184bd841fb7cf57d8d317fecc8f..2bb139f284233e6fd87a7caae52a9190ac443aec 100644 --- a/typo3/sysext/backend/Classes/Module/BaseScriptClass.php +++ b/typo3/sysext/backend/Classes/Module/BaseScriptClass.php @@ -358,6 +358,21 @@ class BaseScriptClass } } + /** + * Return the content of the 'main' function inside the "Function menu module" if present + * + * @return string + */ + public function getExtObjContent() + { + $savedContent = $this->content; + $this->content = ''; + $this->extObjContent(); + $newContent = $this->content; + $this->content = $savedContent; + return $newContent; + } + /** * Returns the Language Service * @return LanguageService diff --git a/typo3/sysext/info/Classes/Controller/InfoModuleController.php b/typo3/sysext/info/Classes/Controller/InfoModuleController.php index a23eb222b52f2add31fe73328810325fbe8540e6..5da6fb5b5f45755f8a3c17e00b7587d9ec1d620a 100644 --- a/typo3/sysext/info/Classes/Controller/InfoModuleController.php +++ b/typo3/sysext/info/Classes/Controller/InfoModuleController.php @@ -22,6 +22,7 @@ use TYPO3\CMS\Backend\Template\ModuleTemplate; use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Core\Imaging\Icon; use TYPO3\CMS\Core\Utility\GeneralUtility; +use TYPO3\CMS\Fluid\View\StandaloneView; /** * Script Class for the Web > Info module @@ -58,6 +59,11 @@ class InfoModuleController extends BaseScriptClass */ protected $moduleTemplate; + /** + * @var StandaloneView + */ + protected $view; + /** * Constructor */ @@ -107,17 +113,15 @@ class InfoModuleController extends BaseScriptClass ); // Setting up the context sensitive menu: $this->moduleTemplate->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Backend/ClickMenu'); - $this->content .= '<form action="' . htmlspecialchars(BackendUtility::getModuleUrl($this->moduleName)) . - '" method="post" id="InfoModuleController" name="webinfoForm" class="form-inline form-inline-spaced">'; - $vContent = $this->moduleTemplate->getVersionSelector($this->id, 1); - if ($vContent) { - $this->content .= '<div>' . $vContent . '</div>'; - } - $this->extObjContent(); + + $this->view = $this->getFluidTemplateObject(); + $this->view->assign('moduleName', htmlspecialchars(BackendUtility::getModuleUrl($this->moduleName))); + $this->view->assign('versionSelector', $this->moduleTemplate->getVersionSelector($this->id, 1)); + $this->view->assign('functionMenuModuleContent', $this->getExtObjContent()); // Setting up the buttons and markers for docheader $this->getButtons(); $this->generateMenu(); - $this->content .= '</form>'; + $this->content .= $this->view->render(); } else { // If no access or if ID == zero $this->content = $this->moduleTemplate->header($this->languageService->getLL('title')); @@ -229,4 +233,23 @@ class InfoModuleController extends BaseScriptClass { return $this->moduleTemplate; } + + /** + * returns a new standalone view, shorthand function + * + * @return StandaloneView + */ + protected function getFluidTemplateObject() + { + /** @var StandaloneView $view */ + $view = GeneralUtility::makeInstance(StandaloneView::class); + $view->setLayoutRootPaths(array(GeneralUtility::getFileAbsFileName('EXT:info/Resources/Private/Layouts'))); + $view->setPartialRootPaths(array(GeneralUtility::getFileAbsFileName('EXT:info/Resources/Private/Partials'))); + $view->setTemplateRootPaths(array(GeneralUtility::getFileAbsFileName('EXT:info/Resources/Private/Templates'))); + + $view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName('EXT:info/Resources/Private/Templates/Main.html')); + + $view->getRequest()->setControllerExtensionName('info'); + return $view; + } } diff --git a/typo3/sysext/info/Resources/Private/Templates/Main.html b/typo3/sysext/info/Resources/Private/Templates/Main.html new file mode 100644 index 0000000000000000000000000000000000000000..589df2d2c14e580ff1ae032b2ac926894d44a3fc --- /dev/null +++ b/typo3/sysext/info/Resources/Private/Templates/Main.html @@ -0,0 +1,6 @@ +<form action="{moduleName}" method="post" id="InfoModuleController" name="webinfoForm" class="form-inline form-inline-spaced"> + <f:if condition="{versionSelector}"> + <div>{versionSelector}</div> + </f:if> + <f:format.raw>{functionMenuModuleContent}</f:format.raw> +</form>