[TASK] Remove direct usage of DocumentTemplate::header 94/45994/3
authorGeorg Ringer <georg.ringer@gmail.com>
Sat, 16 Jan 2016 10:03:40 +0000 (11:03 +0100)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Sat, 16 Jan 2016 12:05:41 +0000 (13:05 +0100)
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: Morton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/info/Classes/Controller/InfoModuleController.php
typo3/sysext/setup/Classes/Controller/SetupModuleController.php
typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateModuleController.php

index b007ca9..a23eb22 100644 (file)
@@ -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'));
         }
     }
 
index b9b9a6c..59bd260 100644 (file)
@@ -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'));
index 311b618..4d5d666 100755 (executable)
@@ -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