Commit d9e0a02f authored by Wouter Wolters's avatar Wouter Wolters Committed by Stefan Neufeind
Browse files

[TASK] Cleanup entry classes in typo3/ part2

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']

Change-Id: Ie5bcf1f6f09a070a946a021d41d4809567ff6229
Resolves: #49454
Releases: 6.2
Reviewed-on: https://review.typo3.org/21669
Reviewed-by: Alexander Opitz
Reviewed-by: Markus Klein
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
parent ebe1573b
......@@ -24,6 +24,7 @@
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* Context menu
*
......@@ -35,17 +36,11 @@
*
* If you want to integrate a context menu in your scripts, please see template::getContextMenuCode()
*
* Revised for TYPO3 3.6 2/2003 by Kasper Skårhøj
* XHTML compliant
*
* @author Kasper Skårhøj <kasperYYYY@typo3.com>
*/
require 'init.php';
$LANG->includeLLFile('EXT:lang/locallang_misc.xlf');
// Make instance:
$SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\ClickMenuController');
$SOBE->init();
$clickMenuController = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\ClickMenuController');
/**
* Include files for extra click menu options
......@@ -55,6 +50,6 @@ foreach ($SOBE->include_once as $INC_FILE) {
include_once $INC_FILE;
}
$SOBE->main();
$SOBE->printContent();
$clickMenuController->main();
$clickMenuController->printContent();
?>
\ No newline at end of file
......@@ -24,23 +24,19 @@
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* Page navigation tree for the Web module
*
* Revised for TYPO3 3.6 2/2003 by Kasper Skårhøj
* XHTML compliant
*
* @author Kasper Skårhøj <kasperYYYY@typo3.com>
*/
$BACK_PATH = '';
require_once 'init.php';
// Make instance if it is not an AJAX call
if (!(TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_AJAX)) {
$SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\PageTreeNavigationController');
$SOBE->init();
$SOBE->initPage();
$SOBE->main();
$SOBE->printContent();
$pageTreeNavigationController = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\PageTreeNavigationController');
$pageTreeNavigationController->initPage();
$pageTreeNavigationController->main();
$pageTreeNavigationController->printContent();
}
?>
\ No newline at end of file
......@@ -24,36 +24,31 @@
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* Main form rendering script
* By sending certain parameters to this script you can bring up a form
* which allows the user to edit the content of one or more database records.
*
* Revised for TYPO3 3.6 November/2003 by Kasper Skårhøj
* XHTML compliant
*
* @author Kasper Skårhøj <kasperYYYY@typo3.com>
*/
require_once 'init.php';
$GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_alt_doc.xml');
\TYPO3\CMS\Backend\Utility\BackendUtility::lockRecords();
// Make instance:
$SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\EditDocumentController');
$editDocumentController = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\EditDocumentController');
// Preprocessing, storing data if submitted to
$SOBE->preInit();
$editDocumentController->preInit();
$formprotection = \TYPO3\CMS\Core\FormProtection\FormProtectionFactory::get();
// Checks, if a save button has been clicked (or the doSave variable is sent)
if ($SOBE->doProcessData()) {
if ($editDocumentController->doProcessData()) {
if ($formprotection->validateToken(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('formToken'), 'editRecord')) {
$SOBE->processData();
$editDocumentController->processData();
}
}
// Main:
$SOBE->init();
$SOBE->main();
$SOBE->printContent();
$editDocumentController->init();
$editDocumentController->main();
$editDocumentController->printContent();
?>
\ No newline at end of file
......@@ -24,22 +24,17 @@
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* No-document script
* This is used by eg. the Doc module if no documents is registered as "open"
* (a concept which is better known from the "classic backend"...)
*
* Revised for TYPO3 3.6 November/2003 by Kasper Skårhøj
* XHTML compliant
*
* @author Kasper Skårhøj <kasperYYYY@typo3.com>
*/
require 'init.php';
$LANG->includeLLFile('EXT:lang/locallang_alt_doc.xml');
// Make instance:
$SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Backend\Controller\NoDocumentsOpenController');
$SOBE->init();
$SOBE->main();
$SOBE->printContent();
$noDocumentsOpenController = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Backend\Controller\NoDocumentsOpenController');
$noDocumentsOpenController->main();
$noDocumentsOpenController->printContent();
?>
\ No newline at end of file
......@@ -24,23 +24,21 @@
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* Folder tree in the File main module.
*
* Revised for TYPO3 3.6 2/2003 by Kasper Skårhøj
* XHTML compliant
*
* @author Kasper Skårhøj <kasperYYYY@typo3.com>
*/
$BACK_PATH = '';
require_once 'init.php';
// Make instance if it is not an AJAX call
if (!(TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_AJAX)) {
$SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\FileSystemNavigationFrameController');
$SOBE->init();
$SOBE->initPage();
$SOBE->main();
$SOBE->printContent();
$fileSystemNavigationFrameController = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
'TYPO3\\CMS\\Backend\\Controller\\FileSystemNavigationFrameController'
);
$fileSystemNavigationFrameController->initPage();
$fileSystemNavigationFrameController->main();
$fileSystemNavigationFrameController->printContent();
}
?>
\ No newline at end of file
......@@ -24,25 +24,20 @@
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* Shortcut frame
* Appears in the bottom frame of the backend frameset.
* Provides links to registered shortcuts
* If the 'cms' extension is loaded you will also have a field for entering page id/alias which will be found/edited
*
* Revised for TYPO3 3.6 2/2003 by Kasper Skårhøj
* XHTML compliant output
*
* @author Kasper Skårhøj <kasperYYYY@typo3.com>
*/
require 'init.php';
$LANG->includeLLFile('EXT:lang/locallang_misc.xlf');
// Make instance:
$SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\ShortcutFrameController');
$SOBE->preinit();
$SOBE->preprocess();
$SOBE->init();
$SOBE->main();
$SOBE->printContent();
$shortcutFrameController = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\ShortcutFrameController');
$shortcutFrameController->preprocess();
$shortcutFrameController->init();
$shortcutFrameController->main();
$shortcutFrameController->printContent();
?>
\ No newline at end of file
......@@ -24,23 +24,17 @@
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* Displays the page/file tree for browsing database records or files.
* Used from TCEFORMS an other elements
* In other words: This is the ELEMENT BROWSER!
*
* 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 'init.php';
$LANG->includeLLFile('EXT:lang/locallang_browse_links.xlf');
// Make instance:
$SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Recordlist\\Controller\\ElementBrowserController');
$SOBE->init();
$SOBE->main();
$SOBE->printContent();
$elementBrowserController = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Recordlist\\Controller\\ElementBrowserController');
$elementBrowserController->main();
$elementBrowserController->printContent();
?>
\ No newline at end of file
......@@ -24,18 +24,15 @@
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* This is the frameset to the file/record browser window
*
* Revised for TYPO3 3.6 July/2003 by Kasper Skårhøj
* XHTML-frames compatible.
*
* @author Kasper Skårhøj <kasperYYYY@typo3.com>
* @author Kasper Skårhøj <kasperYYYY@typo3.com>
*/
require 'init.php';
// Make instance:
$SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Recordlist\\Controller\\ElementBrowserFramesetController');
$SOBE->main();
$SOBE->printContent();
$elementBrowserFramesetController = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Recordlist\\Controller\\ElementBrowserFramesetController');
$elementBrowserFramesetController->main();
$elementBrowserFramesetController->printContent();
?>
\ No newline at end of file
......@@ -142,7 +142,6 @@ class localPageTree extends \TYPO3\CMS\Backend\Tree\View\BrowseTreeView {
*/
class rtePageTree extends localPageTree {
}
/**
......@@ -269,7 +268,6 @@ class localFolderTree extends \TYPO3\CMS\Backend\Tree\View\FolderTreeView {
*/
class rteFolderTree extends localFolderTree {
}
/**
......
#! /usr/bin/env php
<?php
/***************************************************************
* Copyright notice
*
* (c) 2005-2013 Kasper Skaarhoj (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!
***************************************************************/
* Copyright notice
*
* (c) 2005-2013 Kasper Skaarhoj (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!
***************************************************************/
/**
* Command Line Interface module dispatcher
......
......@@ -24,20 +24,16 @@
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* New database item menu
*
* This script lets users choose a new database element to create.
* Includes a wizard mode for visually pointing out the position of new pages
*
* 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 'init.php';
$LANG->includeLLFile('EXT:lang/locallang_misc.xlf');
/**
* Extension for the tree class that generates the tree of pages in the page-wizard mode
......@@ -71,9 +67,7 @@ class localPageTree extends \TYPO3\CMS\Backend\Tree\View\PageTreeView {
}
}
// Make instance:
$SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\NewRecordController');
$SOBE->init();
$SOBE->main();
$SOBE->printContent();
$newRecordController = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\NewRecordController');
$newRecordController->main();
$newRecordController->printContent();
?>
\ No newline at end of file
......@@ -24,18 +24,15 @@
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* Dummy document - displays nothing but background color.
*
* Revised for TYPO3 3.6 2/2003 by Kasper Skårhøj
* XHTML compliant content
*
* @author Kasper Skårhøj <kasperYYYY@typo3.com>
*/
require 'init.php';
// Make instance:
$SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\DummyController');
$SOBE->main();
$SOBE->printContent();
$dummyController = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\DummyController');
$dummyController->main();
$dummyController->printContent();
?>
\ No newline at end of file
......@@ -24,20 +24,15 @@
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* Web>File: Editing documents
*
* Revised for TYPO3 3.6 2/2003 by Kasper Skårhøj
* XHTML compliant (except textarea field)
*
* @author Kasper Skårhøj <kasperYYYY@typo3.com>
*/
$GLOBALS['BACK_PATH'] = '';
require 'init.php';
// Make instance:
$SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\File\\EditFileController');
$SOBE->init();
$SOBE->main();
$SOBE->printContent();
$editFileController = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\File\\EditFileController');
$editFileController->main();
$editFileController->printContent();
?>
\ No newline at end of file
......@@ -24,19 +24,15 @@
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* Web>File: Create new folders in the filemounts
*
* Revised for TYPO3 3.6 November/2003 by Kasper Skårhøj
*
* @author Kasper Skårhøj <kasperYYYY@typo3.com>
*/
$BACK_PATH = '';
require 'init.php';
// Make instance:
$SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\File\\CreateFolderController');
$SOBE->init();
$SOBE->main();
$SOBE->printContent();
$createFolderController = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\File\\CreateFolderController');
$createFolderController->main();
$createFolderController->printContent();
?>
\ No newline at end of file
......@@ -24,19 +24,15 @@
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* Web>File: Renaming files and folders
*
* Revised for TYPO3 3.6 November/2003 by Kasper Skårhøj
*
* @author Kasper Skårhøj <kasperYYYY@typo3.com>
*/
$BACK_PATH = '';
require 'init.php';
// Make instance:
$SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\File\\RenameFileController');
$SOBE->init();
$SOBE->main();
$SOBE->printContent();
$renameFileController = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\File\\RenameFileController');
$renameFileController->main();
$renameFileController->printContent();
?>
\ No newline at end of file
......@@ -24,20 +24,15 @@
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* Web>File: Upload of files
*
* Revised for TYPO3 3.6 November/2003 by Kasper Skårhøj
*
* @author Kasper Skårhøj <kasperYYYY@typo3.com>
*/
$BACK_PATH = '';
require 'init.php';
$LANG->includeLLFile('EXT:lang/locallang_misc.xlf');
// Make instance:
$SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\File\\FileUploadController');
$SOBE->init();
$SOBE->main();
$SOBE->printContent();
$fileUploadController = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\File\\FileUploadController');
$fileUploadController->main();
$fileUploadController->printContent();
?>
\ No newline at end of file
......@@ -82,13 +82,22 @@ class ClickMenuController {
*/
public $extClassArray = array();
/**
* Constructor
*/
public function __construct() {
$GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_misc.xlf');
$GLOBALS['SOBE'] = $this;
$this->init();
}
/**
* Constructor function for script class.
*
* @return void
* @todo Define visibility
*/
public function init() {
protected function init() {
// Setting GPvars:
$this->backPath = GeneralUtility::_GP('backPath');
$this->item = GeneralUtility::_GP('item');
......@@ -177,7 +186,6 @@ class ClickMenuController {
* Main function - generating the click menu in whatever form it has.
*
* @return void
* @todo Define visibility
*/
public function main() {
$this->ajax = GeneralUtility::_GP('ajax') ? TRUE : FALSE;
......@@ -210,7 +218,6 @@ class ClickMenuController {
* End page and output content.
*
* @return void
* @todo Define visibility
*/
public function printContent() {
if (!$this->ajax) {
......
......@@ -43,7 +43,6 @@ class DummyController {
* Create content for the dummy script - outputting a blank page.
*
* @return void
* @todo Define visibility
*/
public function main() {
// Start page
......@@ -56,7 +55,6 @@ class DummyController {
* Outputting the accumulated content to screen
*
* @return void
* @todo Define visibility
*/
public function printContent() {
echo $this->content;
......
......@@ -351,11 +351,18 @@ class EditDocumentController {
*/
public $dontStoreDocumentRef;
/**
* Constructor
*/
public function __construct() {
$GLOBALS['SOBE'] = $this;
$GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_alt_doc.xml');
}
/**
* First initialization.
*
* @return void
* @todo Define visibility
*/
public function preInit() {
if (GeneralUtility::_GP('justLocalized')) {
......@@ -408,7 +415,6 @@ class EditDocumentController {
* Detects, if a save command has been triggered.
*
* @return boolean TRUE, then save the document (data submitted)
* @todo Define visibility
*/
public function doProcessData() {
$out = $this->doSave || isset($_POST['_savedok_x']) || isset($_POST['_saveandclosedok_x']) || isset($_POST['_savedokview_x']) || isset($_POST['_savedoknew_x']) || isset($_POST['_translation_savedok_x']) || isset($_POST['_translation_savedokclear_x']);
......@@ -419,7 +425,6 @@ class EditDocumentController {
* Do processing of data, submitting it to TCEmain.
*
* @return void
* @todo Define visibility
*/
public function processData() {
// GPvars specifically for processing:
......@@ -554,7 +559,6 @@ class EditDocumentController {
* Initialize the normal module operation
*
* @return void
* @todo Define visibility
*/
public function init() {
// Setting more GPvars:
......@@ -632,7 +636,6 @@ class EditDocumentController {
* Main module operation
*
* @return void
* @todo Define visibility
*/
public function main() {
// Begin edit:
......@@ -699,7 +702,6 @@ class EditDocumentController {
* Outputting the accumulated content to screen
*
* @return void
* @todo Define visibility
*/
public function printContent() {
echo $this->content;
......
......@@ -91,12 +91,21 @@ class CreateFolderController {
public $content;
/**
* Constructor function for class
* Constructor
*/
public function __construct() {
$GLOBALS['SOBE'] = $this;
$GLOBALS['BACK_PATH'] = '';
$this->init();
}
/**
* Initialize
*
* @return void
* @todo Define visibility
*/