[TASK] Cleanup ext:setup and ext:tstemplate 91/21791/3
authorWouter Wolters <typo3@wouterwolters.nl>
Tue, 2 Jul 2013 10:26:28 +0000 (12:26 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Tue, 2 Jul 2013 11:28:07 +0000 (13:28 +0200)
* Remove require_once calls
* Move language inclusion to init() for ext:setup

Change-Id: Icdb07a7170e40d57a93fcdc69e788081a47cac6c
Resolves: #49580
Releases: 6.2
Reviewed-on: https://review.typo3.org/21791
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
typo3/sysext/setup/Classes/Controller/SetupModuleController.php
typo3/sysext/setup/ext_tables.php
typo3/sysext/setup/mod/index.php
typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateModuleController.php
typo3/sysext/tstemplate/ts/index.php

index 69ba188..dbb0b1a 100644 (file)
@@ -263,6 +263,7 @@ class SetupModuleController {
         * @todo Define visibility
         */
        public function init() {
+               $GLOBALS['LANG']->includeLLFile('EXT:setup/mod/locallang.xml');
                $this->MCONF = $GLOBALS['MCONF'];
                // Returns the script user - that is the REAL logged in user! ($GLOBALS[BE_USER] might be another user due to simulation!)
                $scriptUser = $this->getRealScriptUserObj();
index 129cf8a..9286022 100755 (executable)
@@ -2,9 +2,17 @@
 if (!defined('TYPO3_MODE')) {
        die('Access denied.');
 }
-if (TYPO3_MODE == 'BE') {
-       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addModule('user', 'setup', 'after:task', \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'mod/');
-       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('_MOD_user_setup', 'EXT:setup/locallang_csh_mod.xml');
+if (TYPO3_MODE === 'BE') {
+       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addModule(
+               'user',
+               'setup',
+               'after:task',
+               \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'mod/'
+       );
+       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr(
+               '_MOD_user_setup',
+               'EXT:setup/locallang_csh_mod.xml'
+       );
 }
 $GLOBALS['TYPO3_USER_SETTINGS'] = array(
        'ctrl' => array(
index 5216d8f..6c13c35 100755 (executable)
@@ -1,16 +1,33 @@
 <?php
-/*
- * @deprecated since 6.0, the classname SC_mod_user_setup_index and this file is obsolete
- * and will be removed with 6.2. The class was renamed and is now located at:
- * typo3/sysext/setup/Classes/Controller/SetupModuleController.php
- */
-require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('setup') . 'Classes/Controller/SetupModuleController.php';
-// Make instance:
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 1999-2013 Kasper Skårhøj (kasperYYYY@typo3.com)
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
 $SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Setup\\Controller\\SetupModuleController');
 $SOBE->simulateUser();
 $SOBE->storeIncomingData();
-// These includes MUST be afterwards the settings are saved...!
-$LANG->includeLLFile('EXT:setup/mod/locallang.xml');
 $SOBE->init();
 $SOBE->main();
 $SOBE->printContent();
index db878dd..47ede6d 100644 (file)
@@ -77,6 +77,14 @@ class TypoScriptTemplateModuleController extends \TYPO3\CMS\Backend\Module\BaseS
        public $modMenu_setDefaultList = '';
 
        /**
+        * Constructor
+        */
+       public function __construct() {
+               $GLOBALS['LANG']->includeLLFile('EXT:tstemplate/ts/locallang.xlf');
+               $GLOBALS['BE_USER']->modAccess($GLOBALS['MCONF'], TRUE);
+       }
+
+       /**
         * Init
         *
         * @return void
index 0f623a7..cdc841e 100644 (file)
  *
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
-$GLOBALS['LANG']->includeLLFile('EXT:tstemplate/ts/locallang.xlf');
-$BE_USER->modAccess($MCONF, TRUE);
-/*
- * @deprecated since 6.0, the classname SC_mod_web_ts_index and this file is obsolete
- * and will be removed with 6.2. The class was renamed and is now located at:
- * typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateModuleController.php
- */
-require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('tstemplate') . 'Classes/Controller/TypoScriptTemplateModuleController.php';
-// Make instance:
+
 $SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Tstemplate\\Controller\\TypoScriptTemplateModuleController');
 /* @var $SOBE SC_mod_web_ts_index */
 $SOBE->init();