[TASK] Cleanup entry classes in typo3/ part1 47/21647/7
authorWouter Wolters <typo3@wouterwolters.nl>
Mon, 24 Jun 2013 21:33:38 +0000 (23:33 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Tue, 2 Jul 2013 17:02:18 +0000 (19:02 +0200)
Cleanup the entry classes inside typo3/ with the following
changes:

* Move language include to constructor
* Remove not needed doc-comments
* Make class available in $GLOBALS['SOBE']
* Remove transferData class, which is not used

Change-Id: I03727b4620b9f0242760ad1be37e31a66c4fdb39
Resolves: #49394
Releases: 6.2
Reviewed-on: https://review.typo3.org/21647
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
18 files changed:
typo3/index.php
typo3/listframe_loader.php
typo3/login_frameset.php
typo3/logout.php
typo3/move_el.php
typo3/show_item.php
typo3/show_rechis.php
typo3/sysext/backend/Classes/Controller/ContentElement/ElementHistoryController.php
typo3/sysext/backend/Classes/Controller/ContentElement/ElementInformationController.php
typo3/sysext/backend/Classes/Controller/ContentElement/MoveElementController.php
typo3/sysext/backend/Classes/Controller/File/FileController.php
typo3/sysext/backend/Classes/Controller/ListFrameLoaderController.php
typo3/sysext/backend/Classes/Controller/LoginController.php
typo3/sysext/backend/Classes/Controller/LoginFramesetController.php
typo3/sysext/backend/Classes/Controller/LogoutController.php
typo3/sysext/backend/Classes/Controller/SimpleDataHandlerController.php
typo3/tce_db.php
typo3/tce_file.php

index b3f31f5..6ec242d 100644 (file)
  *
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
+
 /**
  * Login-screen of TYPO3.
  *
- * Revised for TYPO3 3.6 December/2003 by Kasper Skårhøj
- * XHTML compliant
- *
  * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  */
 define('TYPO3_PROCEED_IF_NO_USER', 1);
 require 'init.php';
 
-/**
- * @var $SOBE \TYPO3\CMS\Backend\Controller\LoginController
- */
-$SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\LoginController');
-$SOBE->init();
-$SOBE->main();
-$SOBE->printContent();
+$loginController = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\LoginController');
+$loginController->main();
+$loginController->printContent();
 ?>
\ No newline at end of file
index 3cf0818..cedbe61 100644 (file)
  *
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
+
 /**
  * Redirects to real module if shortcut pressed
  *
- * Revised for TYPO3 3.6 2/2003 by Kasper Skårhøj
- * XHTML-trans compliant
- *
  * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  */
 require 'init.php';
 
-// Make instance:
-$SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\ListFrameLoaderController');
-$SOBE->main();
+$listFrameLoaderController = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\ListFrameLoaderController');
+$listFrameLoaderController->main();
 ?>
\ No newline at end of file
index 6804b01..0294b78 100644 (file)
  *
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
+
 /**
  * Login frameset
  *
  * This script generates a login-frameset used when the user must relogin.
- * Revised for TYPO3 3.6 November/2003 by Kasper Skårhøj
- * XHTML-frames compatible.
  *
  * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  */
@@ -37,7 +36,7 @@ define('TYPO3_PROCEED_IF_NO_USER', 1);
 require 'init.php';
 
 // Make instance:
-$SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\LoginFramesetController');
-$SOBE->main();
-$SOBE->printContent();
+$loginFramesetController = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\LoginFramesetController');
+$loginFramesetController->main();
+$loginFramesetController->printContent();
 ?>
\ No newline at end of file
index f4d819e..47807ee 100644 (file)
@@ -24,6 +24,7 @@
  *
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
+
 /**
  * Logout script for the backend
  * This script saves the interface positions and calls the closeTypo3Windows in the frameset
@@ -32,7 +33,6 @@
  */
 require 'init.php';
 
-// Make instance:
-$SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\LogoutController');
-$SOBE->logout();
+$logoutController = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\LogoutController');
+$logoutController->logout();
 ?>
\ No newline at end of file
index d98d845..578adf3 100644 (file)
  *
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
+
 /**
  * Move element wizard:
  * Moving pages or content elements (tt_content) around in the system via a page tree navigation.
  *
- * Revised for TYPO3 3.6 November/2003 by Kasper Skårhøj
- * XHTML compatible.
- *
  * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  */
-
-$BACK_PATH = '';
 require 'init.php';
-$LANG->includeLLFile('EXT:lang/locallang_misc.xlf');
 
 /**
  * Local extension of the page tree class
@@ -152,9 +147,7 @@ class ext_posMap_tt_content extends \TYPO3\CMS\Backend\Tree\View\PagePositionMap
        }
 }
 
-// Make instance:
-$SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\ContentElement\\MoveElementController');
-$SOBE->init();
-$SOBE->main();
-$SOBE->printContent();
+$moveElementController = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\ContentElement\\MoveElementController');
+$moveElementController->main();
+$moveElementController->printContent();
 ?>
\ No newline at end of file
index 19bacee..63cb9c4 100644 (file)
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
 
-$GLOBALS['BACK_PATH'] = '';
-require_once 'init.php';
+require 'init.php';
 
-/**
- * Extension of transfer data class
- *
- * @author Kasper Skårhøj <kasperYYYY@typo3.com>
- */
-class transferData extends \TYPO3\CMS\Backend\Form\DataPreprocessor {
-       /**
-        * @var string
-        * @todo Define visibility
-        */
-       public $formname = 'loadform';
-
-       /**
-        * @var boolean
-        * @todo Define visibility
-        */
-       public $loading = 1;
-
-       /**
-        * Extra for show_item.php:
-        *
-        * @var array
-        * @todo Define visibility
-        */
-       public $theRecord = array();
-
-       /**
-        * Register item function.
-        *
-        * @param string $table Table name
-        * @param integer $id Record uid
-        * @param string $field Field name
-        * @param string $content Content string.
-        * @return void
-        * @todo Define visibility
-        */
-       public function regItem($table, $id, $field, $content) {
-               $config = $GLOBALS['TCA'][$table]['columns'][$field]['config'];
-               switch ($config['type']) {
-               case 'input':
-                       if (isset($config['checkbox']) && $content == $config['checkbox']) {
-                               $content = '';
-                               break;
-                       }
-                       if (\TYPO3\CMS\Core\Utility\GeneralUtility::inList($config['eval'], 'date')) {
-                               $content = date($GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'], $content);
-                       }
-                       break;
-               case 'group':
-
-               case 'select':
-                       break;
-               }
-               $this->theRecord[$field] = $content;
-       }
-}
-
-/**
- * @var $SOBE \TYPO3\CMS\Backend\Controller\ContentElement\ElementInformationController
- */
-$SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\ContentElement\\ElementInformationController');
-$SOBE->init();
-$SOBE->main();
-$SOBE->printContent();
+$elementInformationController = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
+       'TYPO3\\CMS\\Backend\\Controller\\ContentElement\\ElementInformationController'
+);
+$elementInformationController->main();
+$elementInformationController->printContent();
 ?>
\ No newline at end of file
index 5982746..b56be55 100644 (file)
  *
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
+
 /**
  * Shows information about a database or file item
  *
- * Revised for TYPO3 3.6 November/2003 by Kasper Skårhøj
- * XHTML Compliant
- *
  * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
  */
-$BACK_PATH = '';
-require $BACK_PATH . 'init.php';
-$LANG->includeLLFile('EXT:lang/locallang_show_rechis.xlf');
+require 'init.php';
 
-// Make instance:
-$SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\ContentElement\\ElementHistoryController');
-$SOBE->init();
-$SOBE->main();
-$SOBE->printContent();
+$elementHistoryController = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\ContentElement\\ElementHistoryController');
+$elementHistoryController->main();
+$elementHistoryController->printContent();
 ?>
\ No newline at end of file
index 70e51fb..a2a5727 100644 (file)
@@ -51,17 +51,26 @@ class ElementHistoryController {
        public $doc;
 
        /**
+        * Constructor
+        */
+       public function __construct() {
+               $GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_show_rechis.xlf');
+               $GLOBALS['SOBE'] = $this;
+
+               $this->init();
+       }
+
+       /**
         * Initialize the module output
         *
         * @return void
-        * @todo Define visibility
         */
-       public function init() {
-               // Create internal template object:
+       protected function init() {
+               // Create internal template object
                $this->doc = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
                $this->doc->backPath = $GLOBALS['BACK_PATH'];
                $this->doc->setModuleTemplate('EXT:backend/Resources/Private/Templates/show_rechis.html');
-               // Start the page header:
+               // Start the page header
                $this->content .= $this->doc->header($GLOBALS['LANG']->getLL('title'));
        }
 
@@ -69,7 +78,6 @@ class ElementHistoryController {
         * Generate module output
         *
         * @return void
-        * @todo Define visibility
         */
        public function main() {
                // Start history object
@@ -89,7 +97,6 @@ class ElementHistoryController {
         * Outputting the accumulated content to screen
         *
         * @return void
-        * @todo Define visibility
         */
        public function printContent() {
                $this->content .= $this->doc->endPage();
index 1a3d220..1a4bdfc 100644 (file)
@@ -109,6 +109,16 @@ class ElementInformationController {
        protected $folderObject;
 
        /**
+        * Constructor
+        */
+       public function __construct() {
+               $GLOBALS['BACK_PATH'] = '';
+               $GLOBALS['SOBE'] = $this;
+
+               $this->init();
+       }
+
+       /**
         * Determines if table/uid point to database record or file and
         * if user has access to view information
         *
index c8e304b..fc83d23 100644 (file)
@@ -96,6 +96,15 @@ class MoveElementController {
        public $content;
 
        /**
+        * Constructor
+        */
+       public function __construct() {
+               $GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_misc.xlf');
+               $GLOBALS['SOBE'] = $this;
+               $this->init();
+       }
+
+       /**
         * Constructor, initializing internal variables.
         *
         * @return void
index 865d1ea..371aca0 100644 (file)
@@ -66,11 +66,19 @@ class FileController {
        protected $fileData;
 
        /**
+        * Constructor
+        */
+       public function __construct() {
+               $GLOBALS['SOBE'] = $this;
+               $this->init();
+       }
+
+       /**
         * Registering incoming data
         *
         * @return void
         */
-       public function init() {
+       protected function init() {
                // Set the GPvars from outside
                $this->file = GeneralUtility::_GP('file');
                $this->CB = GeneralUtility::_GP('CB');
index f5db642..2139c10 100644 (file)
@@ -38,7 +38,6 @@ class ListFrameLoaderController {
         * Main content generated
         *
         * @return void
-        * @todo Define visibility
         */
        public function main() {
                $GLOBALS['TBE_TEMPLATE']->divClass = '';
index 7d53b10..a8dd268 100644 (file)
@@ -138,6 +138,13 @@ class LoginController {
        protected $signalSlotDispatcher;
 
        /**
+        * Constructor
+        */
+       public function __construct() {
+               $this->init();
+       }
+
+       /**
         * Initialize the login box. Will also react on a &L=OUT flag and exit.
         *
         * @return void
index d9b676c..00e00d2 100644 (file)
@@ -34,18 +34,16 @@ namespace TYPO3\CMS\Backend\Controller;
  */
 class LoginFramesetController {
 
-       // Internal, dynamic
        /**
-        * @todo Define visibility
+        * @var string
         */
-       public $content;
+       protected $content;
 
        /**
         * Main function.
         * Creates the header code in XHTML, then the frameset for the two frames.
         *
         * @return void
-        * @todo Define visibility
         */
        public function main() {
                // Set doktype:
@@ -67,7 +65,6 @@ class LoginFramesetController {
         * Outputs the page content.
         *
         * @return void
-        * @todo Define visibility
         */
        public function printContent() {
                echo $this->content;
index abd70dc..6eab196 100644 (file)
@@ -41,7 +41,6 @@ class LogoutController {
         * Performs the logout processing
         *
         * @return void
-        * @todo Define visibility
         */
        public function logout() {
                // Logout written to log
index 5a2d404..2fc020e 100644 (file)
@@ -124,6 +124,14 @@ class SimpleDataHandlerController {
        public $tce;
 
        /**
+        * Constructor
+        */
+       public function __construct() {
+               $GLOBALS['SOBE'] = $this;
+               $this->init();
+       }
+
+       /**
         * Initialization of the class
         *
         * @return void
index 42d680d..4e0b4d4 100644 (file)
  * that manipulates all information in the database!!
  * For syntax and API information, see the document 'TYPO3 Core APIs'
  *
- * Revised for TYPO3 3.6 July/2003 by Kasper Skårhøj
- *
  * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  */
 require 'init.php';
 
-// Make instance:
-$SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\SimpleDataHandlerController');
-$SOBE->init();
+$simpleDataHandlerController = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\SimpleDataHandlerController');
 
-// Include files?
-foreach ($SOBE->include_once as $INC_FILE) {
-       include_once $INC_FILE;
-}
 $formprotection = \TYPO3\CMS\Core\FormProtection\FormProtectionFactory::get();
 if ($formprotection->validateToken(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('formToken'), 'tceAction')) {
-       $SOBE->initClipboard();
-       $SOBE->main();
+       $simpleDataHandlerController->initClipboard();
+       $simpleDataHandlerController->main();
 }
-$SOBE->finish();
-?>
+$simpleDataHandlerController->finish();
+?>
\ No newline at end of file
index 01e38ee..426a895 100644 (file)
@@ -24,6 +24,7 @@
  *
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
+
 /**
  * Gateway for TCE (TYPO3 Core Engine) file-handling through POST forms.
  * This script serves as the fileadministration part of the TYPO3 Core Engine.
  *
  * For syntax and API information, see the document 'TYPO3 Core APIs'
  *
- * Revised for TYPO3 3.6 July/2003 by Kasper Skårhøj
- *
  * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  */
-require_once 'init.php';
+require 'init.php';
 
-// Make instance:
-$SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\File\\FileController');
-$SOBE->init();
-$SOBE->main();
-$SOBE->finish();
+$fileController = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\File\\FileController');
+$fileController->main();
+$fileController->finish();
 ?>
\ No newline at end of file