[TASK] Move modAccess and language include in EXT:recycler 13/28313/3
authorWouter Wolters <typo3@wouterwolters.nl>
Wed, 12 Mar 2014 18:38:13 +0000 (19:38 +0100)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Thu, 13 Mar 2014 22:15:49 +0000 (23:15 +0100)
* Remove deprecated require_once call

Resolves: #56835
Releases: 6.2
Change-Id: I7d79b4c9947c5f3da82c66a4dbb0e3d2e0fd9284
Reviewed-on: https://review.typo3.org/28313
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
typo3/sysext/recycler/Classes/Controller/RecyclerModuleController.php
typo3/sysext/recycler/ext_localconf.php
typo3/sysext/recycler/ext_tables.php
typo3/sysext/recycler/mod1/index.php

index 15518f0..e9d9570 100644 (file)
@@ -56,6 +56,14 @@ class RecyclerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClass
        protected $pageRenderer;
 
        /**
+        * Constructor
+        */
+       public function __construct() {
+               $GLOBALS['LANG']->includeLLFile('EXT:recycler/mod1/locallang.xlf');
+               $GLOBALS['BE_USER']->modAccess($GLOBALS['MCONF'], TRUE);
+       }
+
+       /**
         * Initializes the Module
         *
         * @return      void
index 70da5f1..4c652ea 100644 (file)
@@ -2,4 +2,4 @@
 if (!defined('TYPO3_MODE')) {
        die('Access denied.');
 }
-$TYPO3_CONF_VARS['BE']['AJAX']['RecyclerAjaxController::init'] = 'TYPO3\\CMS\\Recycler\\Controller\\RecyclerAjaxController->init';
+$GLOBALS['TYPO3_CONF_VARS']['BE']['AJAX']['RecyclerAjaxController::init'] = 'TYPO3\\CMS\\Recycler\\Controller\\RecyclerAjaxController->init';
index d33f656..835d894 100644 (file)
@@ -2,8 +2,16 @@
 if (!defined('TYPO3_MODE')) {
        die('Access denied.');
 }
-if (TYPO3_MODE == 'BE') {
+if (TYPO3_MODE === 'BE') {
        // Add module
-       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addModulePath('web_txrecyclerM1', \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'mod1/');
-       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addModule('web', 'txrecyclerM1', '', \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'mod1/');
+       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addModulePath(
+               'web_txrecyclerM1',
+               \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'mod1/'
+       );
+       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addModule(
+               'web',
+               'txrecyclerM1',
+               '',
+               \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'mod1/'
+       );
 }
index 9cf85a0..63536a9 100644 (file)
  *
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
-$LANG->includeLLFile('EXT:recycler/mod1/locallang.xlf');
-$BE_USER->modAccess($MCONF, 1);
-/*
- * @deprecated since 6.0, the classname tx_recycler_module1 and this file is obsolete
- * and will be removed with 6.2. The class was renamed and is now located at:
- * typo3/sysext/recycler/Classes/Controller/RecyclerModuleController.php
- */
-require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('recycler') . 'Classes/Controller/RecyclerModuleController.php';
-// Make instance:
+
 $SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Recycler\\Controller\\RecyclerModuleController');
 $SOBE->initialize();
 // Include files?