[TASK] Move modAccess and language include in EXT:scheduler 14/28314/3
authorWouter Wolters <typo3@wouterwolters.nl>
Wed, 12 Mar 2014 18:48:58 +0000 (19:48 +0100)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Thu, 13 Mar 2014 22:17:06 +0000 (23:17 +0100)
Resolves: #56837
Releases: 6.2
Change-Id: Ieec0e8f532abd8fab0444e137c31424f1a69b67e
Reviewed-on: https://review.typo3.org/28314
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
typo3/sysext/scheduler/Classes/Controller/SchedulerModuleController.php
typo3/sysext/scheduler/ext_localconf.php
typo3/sysext/scheduler/ext_tables.php
typo3/sysext/scheduler/mod1/index.php

index 3e12092..6fac4ec 100644 (file)
@@ -82,6 +82,8 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
         * @return \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController
         */
        public function __construct() {
+               $GLOBALS['LANG']->includeLLFile('EXT:scheduler/mod1/locallang.xlf');
+               $GLOBALS['BE_USER']->modAccess($GLOBALS['MCONF'], TRUE);
                $this->backPath = $GLOBALS['BACK_PATH'];
                // Set key for CSH
                $this->cshKey = '_MOD_' . $GLOBALS['MCONF']['name'];
index 87930a1..9dd1d0e 100644 (file)
@@ -58,7 +58,7 @@ $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Sch
 
 // Add recycler directory cleanup task. Windows is not supported
 // because "filectime" does not change after moving a file
-if (TYPO3_OS != 'WIN') {
+if (TYPO3_OS !== 'WIN') {
        $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Scheduler\\Task\\RecyclerGarbageCollectionTask'] = array(
                'extension' => $_EXTKEY,
                'title' => 'LLL:EXT:' . $_EXTKEY . '/locallang.xlf:recyclerGarbageCollection.name',
index c4edf7f..6f7c418 100644 (file)
@@ -2,9 +2,14 @@
 if (!defined('TYPO3_MODE')) {
        die('Access denied.');
 }
-if (TYPO3_MODE == 'BE') {
+if (TYPO3_MODE === 'BE') {
        // Add module
-       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addModule('system', 'txschedulerM1', '', \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'mod1/');
+       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addModule(
+               'system',
+               'txschedulerM1',
+               '',
+               \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'mod1/'
+       );
 
        // Add context sensitive help (csh) to the backend module
        \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr(
index 4f49b7b..3a94b8d 100644 (file)
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
 
-$LANG->includeLLFile('EXT:scheduler/mod1/locallang.xlf');
-$BE_USER->modAccess($MCONF, 1);
-// This checks permissions and exits if the users has no permission for entry.
-// Make instance:
 $SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Scheduler\\Controller\\SchedulerModuleController');
 $SOBE->init();
 // Include files?