Commit 706a8eee authored by Georg Ringer's avatar Georg Ringer Committed by Anja Leichsenring
Browse files

[TASK] Remove direct usage of DocumentTemplate::header

If ModuleTemplate is available, use its method 'header`
instead of the method of DocumentTemplate.

Change-Id: I2950d5e9b9b1ae7297b6b593074882c81c589d6e
Resolves: #72763
Releases: master
Reviewed-on: https://review.typo3.org/45994

Reviewed-by: default avatarMorton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: default avatarMorton Jonuschat <m.jonuschat@mojocode.de>
Reviewed-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
parent a212ccf2
......@@ -120,7 +120,7 @@ class InfoModuleController extends BaseScriptClass
$this->content .= '</form>';
} else {
// If no access or if ID == zero
$this->content = $this->doc->header($this->languageService->getLL('title'));
$this->content = $this->moduleTemplate->header($this->languageService->getLL('title'));
}
}
......
......@@ -68,11 +68,6 @@ class SetupModuleController extends AbstractModule
*/
public $MOD_SETTINGS = array();
/**
* @var \TYPO3\CMS\Backend\Template\DocumentTemplate
*/
public $doc;
/**
* @var string
*/
......@@ -185,10 +180,8 @@ class SetupModuleController extends AbstractModule
/**
* If settings are submitted to _POST[DATA], store them
* NOTICE: This method is called before the \TYPO3\CMS\Backend\Template\DocumentTemplate
* NOTICE: This method is called before the \TYPO3\CMS\Backend\Template\ModuleTemplate
* is included. See bottom of document.
*
* @see \TYPO3\CMS\Backend\Template\DocumentTemplate
*/
public function storeIncomingData()
{
......@@ -336,8 +329,6 @@ class SetupModuleController extends AbstractModule
$this->tsFieldConf['password2.']['disabled'] = 1;
$this->tsFieldConf['passwordCurrent.']['disabled'] = 1;
}
// Create instance of object for output of data
$this->doc = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Template\DocumentTemplate::class);
}
/**
......@@ -383,7 +374,7 @@ class SetupModuleController extends AbstractModule
$this->loadModules = GeneralUtility::makeInstance(ModuleLoader::class);
$this->loadModules->observeWorkspaces = true;
$this->loadModules->load($GLOBALS['TBE_MODULES']);
$this->content .= $this->doc->header($this->getLanguageService()->getLL('UserSettings'));
$this->content .= $this->moduleTemplate->header($this->getLanguageService()->getLL('UserSettings'));
// Show if setup was saved
if ($this->setupIsUpdated && !$this->settingsAreResetToDefault) {
$flashMessage = GeneralUtility::makeInstance(FlashMessage::class, $this->getLanguageService()->getLL('setupWasUpdated'), $this->getLanguageService()->getLL('UserSettings'));
......
......@@ -170,8 +170,6 @@ class TypoScriptTemplateModuleController extends BaseScriptClass
$this->pageinfo = BackendUtility::readPageAccess($this->id, $this->perms_clause);
$this->access = is_array($this->pageinfo);
/** @var DocumentTemplate doc */
$this->doc = GeneralUtility::makeInstance(DocumentTemplate::class);
$this->moduleTemplate->getPageRenderer()->addCssFile(ExtensionManagementUtility::extRelPath('tstemplate') . 'Resources/Public/Css/styles.css');
$lang = $this->getLanguageService();
......@@ -208,7 +206,7 @@ class TypoScriptTemplateModuleController extends BaseScriptClass
$this->moduleTemplate->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Backend/ClickMenu');
// Build the module content
$this->content = '<form action="' . htmlspecialchars($aHref) . '" method="post" enctype="multipart/form-data" id="TypoScriptTemplateModuleController" name="editForm" class="form">';
$this->content .= $this->doc->header($lang->getLL('moduleTitle'));
$this->content .= $this->moduleTemplate->header($lang->getLL('moduleTitle'));
$this->extObjContent();
// Setting up the buttons and markers for docheader
$this->getButtons();
......@@ -244,7 +242,7 @@ class TypoScriptTemplateModuleController extends BaseScriptClass
'<tbody>' . implode('', $this->renderList($pArray)) . '</tbody>' .
'</table></div>';
$this->content = $this->doc->header($lang->getLL('moduleTitle'));
$this->content = $this->moduleTemplate->header($lang->getLL('moduleTitle'));
$this->content .= '<div><p class="lead">' . $lang->getLL('overview') . '</p>' . $table . '</div>';
// RENDER LIST of pages with templates, END
......
Markdown is supported
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