Commit f02301b5 authored by Wouter Wolters's avatar Wouter Wolters Committed by Morton Jonuschat
Browse files

[!!!][TASK] Remove deprecated code from backend controllers

Resolves: #72419
Releases: master
Change-Id: I0aa18f1089281f04d25c95ec52d469ddc72b71d2
Reviewed-on: https://review.typo3.org/45363


Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: default avatarMorton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: default avatarMorton Jonuschat <m.jonuschat@mojocode.de>
parent 5fce8635
...@@ -92,16 +92,6 @@ class BackendController ...@@ -92,16 +92,6 @@ class BackendController
*/ */
protected $pageRenderer; protected $pageRenderer;
/**
* @return PageRenderer
* @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8
*/
public function getPageRenderer()
{
GeneralUtility::logDeprecatedFunction();
return $this->pageRenderer;
}
/** /**
* Constructor * Constructor
*/ */
...@@ -830,20 +820,6 @@ class BackendController ...@@ -830,20 +820,6 @@ class BackendController
return $cssFileAdded; return $cssFileAdded;
} }
/**
* Adds an item to the toolbar, the class file for the toolbar item must be loaded at this point
*
* @param string $toolbarItemName Toolbar item name, f.e. tx_toolbarExtension_coolItem
* @param string $toolbarItemClassName Toolbar item class name, f.e. tx_toolbarExtension_coolItem
* @return void
* @throws \UnexpectedValueException
* @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8. Toolbar items are registered in $GLOBALS['TYPO3_CONF_VARS']['BE']['toolbarItems'] now.
*/
public function addToolbarItem($toolbarItemName, $toolbarItemClassName)
{
GeneralUtility::logDeprecatedFunction();
}
/** /**
* Executes defined hooks functions for the given identifier. * Executes defined hooks functions for the given identifier.
* *
......
...@@ -34,14 +34,6 @@ class ClickMenuController ...@@ -34,14 +34,6 @@ class ClickMenuController
*/ */
public $reloadListFrame; public $reloadListFrame;
/**
* Content accumulation
*
* @var string
* @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8
*/
public $content = '';
/** /**
* @var \TYPO3\CMS\Backend\Template\DocumentTemplate * @var \TYPO3\CMS\Backend\Template\DocumentTemplate
*/ */
...@@ -74,59 +66,6 @@ class ClickMenuController ...@@ -74,59 +66,6 @@ class ClickMenuController
$this->doc = GeneralUtility::makeInstance(DocumentTemplate::class); $this->doc = GeneralUtility::makeInstance(DocumentTemplate::class);
} }
/**
* Constructor function for script class.
*
* @return void
* @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8, all done in the constructor now
*/
protected function init()
{
GeneralUtility::logDeprecatedFunction();
}
/**
* Main function - generating the click menu in whatever form it has.
*
* @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8, as an AJAX Route is now the main entry point
* @return void
*/
public function main()
{
GeneralUtility::logDeprecatedFunction();
// Initialize Clipboard object:
$clipObj = GeneralUtility::makeInstance(Clipboard::class);
$clipObj->initializeClipboard();
// This locks the clipboard to the Normal for this request.
$clipObj->lockToNormal();
// Update clipboard if some actions are sent.
$CB = GeneralUtility::_GET('CB');
$clipObj->setCmd($CB);
$clipObj->cleanCurrent();
// Saves
$clipObj->endClipboard();
// Create clickmenu object
$clickMenu = GeneralUtility::makeInstance(ClickMenu::class);
// Set internal vars in clickmenu object:
$clickMenu->clipObj = $clipObj;
$clickMenu->extClassArray = $this->extClassArray;
// Set content of the clickmenu with the incoming var, "item"
$this->content .= $clickMenu->init();
}
/**
* End page and output content.
*
* @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8, as an AJAX Route is now the main entry point
* @return void
*/
public function printContent()
{
GeneralUtility::logDeprecatedFunction();
header('Content-Type: text/xml');
echo '<?xml version="1.0"?>' . LF . '<t3ajax>' . $this->content . '</t3ajax>';
}
/** /**
* this is an intermediate clickmenu handler * this is an intermediate clickmenu handler
* *
......
...@@ -552,20 +552,6 @@ class ElementInformationController ...@@ -552,20 +552,6 @@ class ElementInformationController
</div>'; </div>';
} }
/**
* End page and print content
*
* @return void
* @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8, use mainAction() instead
*/
public function printContent()
{
GeneralUtility::logDeprecatedFunction();
echo $this->doc->startPage($this->titleTag) .
$this->doc->insertStylesAndJS($this->content) .
$this->doc->endPage();
}
/** /**
* Get field name for specified table/column name * Get field name for specified table/column name
* *
......
...@@ -236,18 +236,6 @@ class MoveElementController extends AbstractModule ...@@ -236,18 +236,6 @@ class MoveElementController extends AbstractModule
$this->moduleTemplate->setTitle($lang->getLL('movingElement')); $this->moduleTemplate->setTitle($lang->getLL('movingElement'));
} }
/**
* Print out the accumulated content:
*
* @return void
* @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8, use mainAction() instead
*/
public function printContent()
{
GeneralUtility::logDeprecatedFunction();
echo $this->content;
}
/** /**
* Create the panel of buttons for submitting the form or otherwise perform operations. * Create the panel of buttons for submitting the form or otherwise perform operations.
*/ */
......
...@@ -270,23 +270,6 @@ class NewContentElementController extends AbstractModule ...@@ -270,23 +270,6 @@ class NewContentElementController extends AbstractModule
$aOnClick = "document.editForm.defValues.value=unescape('" . rawurlencode($wInfo['params']) . "');goToalt_doc();" . (!$this->onClickEvent?"window.location.hash='#sel2';":''); $aOnClick = "document.editForm.defValues.value=unescape('" . rawurlencode($wInfo['params']) . "');goToalt_doc();" . (!$this->onClickEvent?"window.location.hash='#sel2';":'');
} }
if (isset($wInfo['icon'])) {
GeneralUtility::deprecationLog('The PageTS-Config: mod.wizards.newContentElement.wizardItems.*.elements.*.icon'
. ' is deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8.'
. ' Register your icon in IconRegistry::registerIcon and use the new setting:'
. ' mod.wizards.newContentElement.wizardItems.*.elements.*.iconIdentifier');
$wInfo['iconIdentifier'] = 'content-' . $k;
$icon = $wInfo['icon'];
if (StringUtility::beginsWith($icon, '../typo3conf/ext/')) {
$icon = str_replace('../typo3conf/ext/', 'EXT:', $icon);
}
if (!StringUtility::beginsWith($icon, 'EXT:') && strpos($icon, '/') !== false) {
$icon = TYPO3_mainDir . GeneralUtility::resolveBackPath($wInfo['icon']);
}
$iconRegistry->registerIcon($wInfo['iconIdentifier'], BitmapIconProvider::class, array(
'source' => $icon
));
}
$icon = $this->moduleTemplate->getIconFactory()->getIcon($wInfo['iconIdentifier'])->render(); $icon = $this->moduleTemplate->getIconFactory()->getIcon($wInfo['iconIdentifier'])->render();
$menuItems[$key]['content'] .= ' $menuItems[$key]['content'] .= '
<div class="media"> <div class="media">
...@@ -373,17 +356,6 @@ class NewContentElementController extends AbstractModule ...@@ -373,17 +356,6 @@ class NewContentElementController extends AbstractModule
* OTHER FUNCTIONS: * OTHER FUNCTIONS:
* *
***************************/ ***************************/
/**
* Returns the content of wizardArray() function...
*
* @return array Returns the content of wizardArray() function...
* @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8, use "wizardArray()" directly
*/
public function getWizardItems()
{
GeneralUtility::logDeprecatedFunction();
return $this->wizardArray();
}
/** /**
* Returns the array of elements in the wizard display. * Returns the array of elements in the wizard display.
......
...@@ -65,18 +65,6 @@ class DummyController ...@@ -65,18 +65,6 @@ class DummyController
$this->content .= $this->getDocumentTemplate()->endPage(); $this->content .= $this->getDocumentTemplate()->endPage();
} }
/**
* Outputting the accumulated content to screen
*
* @return void
* @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8, use mainAction() instead
*/
public function printContent()
{
GeneralUtility::logDeprecatedFunction();
echo $this->content;
}
/** /**
* Returns an instance of DocumentTemplate * Returns an instance of DocumentTemplate
* *
......
...@@ -175,15 +175,6 @@ class EditDocumentController extends AbstractModule ...@@ -175,15 +175,6 @@ class EditDocumentController extends AbstractModule
*/ */
public $viewUrl; public $viewUrl;
/**
* If this is pointing to a page id it will automatically load all content elements
* (NORMAL column/default language) from that page into the form!
*
* @var int
* @deprecated since TYPO3 CMS 7, will be removed with TYPO3 CMS 8
*/
public $editRegularContentFromId;
/** /**
* Alternative title for the document handler. * Alternative title for the document handler.
* *
...@@ -694,7 +685,6 @@ class EditDocumentController extends AbstractModule ...@@ -694,7 +685,6 @@ class EditDocumentController extends AbstractModule
$this->popViewId = GeneralUtility::_GP('popViewId'); $this->popViewId = GeneralUtility::_GP('popViewId');
$this->popViewId_addParams = GeneralUtility::_GP('popViewId_addParams'); $this->popViewId_addParams = GeneralUtility::_GP('popViewId_addParams');
$this->viewUrl = GeneralUtility::_GP('viewUrl'); $this->viewUrl = GeneralUtility::_GP('viewUrl');
$this->editRegularContentFromId = GeneralUtility::_GP('editRegularContentFromId');
$this->recTitle = GeneralUtility::_GP('recTitle'); $this->recTitle = GeneralUtility::_GP('recTitle');
$this->noView = GeneralUtility::_GP('noView'); $this->noView = GeneralUtility::_GP('noView');
$this->perms_clause = $beUser->getPagePermsClause(1); $this->perms_clause = $beUser->getPagePermsClause(1);
...@@ -965,9 +955,6 @@ class EditDocumentController extends AbstractModule ...@@ -965,9 +955,6 @@ class EditDocumentController extends AbstractModule
/** @var FormResultCompiler formResultCompiler */ /** @var FormResultCompiler formResultCompiler */
$this->formResultCompiler = GeneralUtility::makeInstance(FormResultCompiler::class); $this->formResultCompiler = GeneralUtility::makeInstance(FormResultCompiler::class);
if ($this->editRegularContentFromId) {
$this->editRegularContentFromId();
}
// Creating the editing form, wrap it with buttons, document selector etc. // Creating the editing form, wrap it with buttons, document selector etc.
$editForm = $this->makeEditForm(); $editForm = $this->makeEditForm();
if ($editForm) { if ($editForm) {
...@@ -1009,18 +996,6 @@ class EditDocumentController extends AbstractModule ...@@ -1009,18 +996,6 @@ class EditDocumentController extends AbstractModule
$this->moduleTemplate->setContent($body); $this->moduleTemplate->setContent($body);
} }
/**
* Outputting the accumulated content to screen
*
* @return void
* @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8
*/
public function printContent()
{
GeneralUtility::logDeprecatedFunction();
echo $this->content;
}
/*************************** /***************************
* *
* Sub-content functions, rendering specific parts of the module content. * Sub-content functions, rendering specific parts of the module content.
...@@ -1494,7 +1469,6 @@ class EditDocumentController extends AbstractModule ...@@ -1494,7 +1469,6 @@ class EditDocumentController extends AbstractModule
'overrideVals', 'overrideVals',
'columnsOnly', 'columnsOnly',
'returnNewPageId', 'returnNewPageId',
'editRegularContentFromId',
'noView']); 'noView']);
$this->moduleTemplate->getDocHeaderComponent()->getButtonBar()->addButton($shortCutButton); $this->moduleTemplate->getDocHeaderComponent()->getButtonBar()->addButton($shortCutButton);
} }
...@@ -1830,35 +1804,6 @@ class EditDocumentController extends AbstractModule ...@@ -1830,35 +1804,6 @@ class EditDocumentController extends AbstractModule
} }
} }
/**
* Function, which populates the internal editconf array with editing commands for all tt_content elements from
* the normal column in normal language from the page pointed to by $this->editRegularContentFromId
*
* @return void
* @deprecated since TYPO3 CMS 7, will be removed with TYPO3 CMS 8
*/
public function editRegularContentFromId()
{
GeneralUtility::logDeprecatedFunction();
$dbConnection = $this->getDatabaseConnection();
$res = $dbConnection->exec_SELECTquery(
'uid',
'tt_content',
'pid=' . (int)$this->editRegularContentFromId . BackendUtility::deleteClause('tt_content')
. BackendUtility::versioningPlaceholderClause('tt_content') . ' AND colPos=0 AND sys_language_uid=0',
'',
'sorting'
);
if ($dbConnection->sql_num_rows($res)) {
$ecUids = array();
while ($ecRec = $dbConnection->sql_fetch_assoc($res)) {
$ecUids[] = $ecRec['uid'];
}
$this->editconf['tt_content'][implode(',', $ecUids)] = 'edit';
}
$dbConnection->sql_free_result($res);
}
/** /**
* Populates the variables $this->storeArray, $this->storeUrl, $this->storeUrlMd5 * Populates the variables $this->storeArray, $this->storeUrl, $this->storeUrlMd5
* *
...@@ -1868,7 +1813,7 @@ class EditDocumentController extends AbstractModule ...@@ -1868,7 +1813,7 @@ class EditDocumentController extends AbstractModule
public function compileStoreDat() public function compileStoreDat()
{ {
$this->storeArray = GeneralUtility::compileSelectedGetVarsFromArray( $this->storeArray = GeneralUtility::compileSelectedGetVarsFromArray(
'edit,defVals,overrideVals,columnsOnly,noView,editRegularContentFromId,workspace', 'edit,defVals,overrideVals,columnsOnly,noView,workspace',
$this->R_URL_getvars $this->R_URL_getvars
); );
$this->storeUrl = GeneralUtility::implodeArrayForUrl('', $this->storeArray); $this->storeUrl = GeneralUtility::implodeArrayForUrl('', $this->storeArray);
......
...@@ -214,18 +214,6 @@ class FileSystemNavigationFrameController ...@@ -214,18 +214,6 @@ class FileSystemNavigationFrameController
$this->content = $this->moduleTemplate->renderContent(); $this->content = $this->moduleTemplate->renderContent();
} }
/**
* Outputting the accumulated content to screen
*
* @return void
* @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8
*/
public function printContent()
{
GeneralUtility::logDeprecatedFunction();
echo $this->content;
}
/** /**
* Register docHeader buttons * Register docHeader buttons
*/ */
......
<?php
namespace TYPO3\CMS\Backend\Controller;
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* Script Class for redirecting shortcut actions to the correct script
* @deprecated since TYPO3 CMS 7, this file will be removed in TYPO3 CMS 8, this logic is not needed anymore
*/
class ListFrameLoaderController
{
/**
* @var string
*/
protected $content;
/**
* Main content generated
*
* @return void
* @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8
*/
public function main()
{
GeneralUtility::logDeprecatedFunction();
$GLOBALS['TBE_TEMPLATE']->divClass = '';
$this->content .= $this->getDocumentTemplate()->startPage('List Frame Loader');
$this->content .= $this->getDocumentTemplate()->wrapScriptTags('
var theUrl = top.getModuleUrl("");
if (theUrl) window.location.href=theUrl;
');
// End page:
$this->content .= $this->getDocumentTemplate()->endPage();
// Output:
echo $this->content;
}
/**
* Returns an instance of DocumentTemplate
*
* @return \TYPO3\CMS\Backend\Template\DocumentTemplate
*/
protected function getDocumentTemplate()
{
return $GLOBALS['TBE_TEMPLATE'];
}
}
...@@ -189,10 +189,6 @@ class LoginController ...@@ -189,10 +189,6 @@ class LoginController
// Logo // Logo
if (!empty($extConf['loginLogo'])) { if (!empty($extConf['loginLogo'])) {
$logo = $extConf['loginLogo']; $logo = $extConf['loginLogo'];
} elseif (!empty($GLOBALS['TBE_STYLES']['logo_login'])) {
// Fallback to old TBE_STYLES login logo
$logo = $GLOBALS['TBE_STYLES']['logo_login'];
GeneralUtility::deprecationLog('$GLOBALS["TBE_STYLES"]["logo_login"] is deprecated since TYPO3 CMS 7 and will be removed in TYPO3 CMS 8, please use the backend extension\'s configuration instead.');
} else { } else {
// Use TYPO3 logo depending on highlight color // Use TYPO3 logo depending on highlight color
if (!empty($extConf['loginHighlightColor'])) { if (!empty($extConf['loginHighlightColor'])) {
......
...@@ -73,18 +73,6 @@ class LoginFramesetController ...@@ -73,18 +73,6 @@ class LoginFramesetController
</html>'; </html>';
} }
/**
* Outputs the page content.
*
* @return void
* @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8, use mainAction() instead
*/
public function printContent()
{
GeneralUtility::logDeprecatedFunction();
echo $this->content;
}
/** /**
* Returns an instance of DocumentTemplate * Returns an instance of DocumentTemplate
* *
......
...@@ -618,18 +618,6 @@ class NewRecordController extends AbstractModule ...@@ -618,18 +618,6 @@ class NewRecordController extends AbstractModule
} }
} }
/**
* Ending page output and echo'ing content to browser.
*
* @return void
* @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8, use mainAction() instead
*/
public function printContent()
{
GeneralUtility::logDeprecatedFunction();
echo $this->content;
}
/** /**
* Links the string $code to a create-new form for a record in $table created on page $pid * Links the string $code to a create-new form for a record in $table created on page $pid
* *
......
<?php
namespace TYPO3\CMS\Backend\Controller;
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use TYPO3\CMS\Backend\Template\DocumentTemplate;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Backend\View\PageTreeView;
use TYPO3\CMS\Core\Imaging\Icon;
use TYPO3\CMS\Core\Imaging\IconFactory;
use TYPO3\CMS\Core\Messaging\FlashMessage;
use TYPO3\CMS\Core\Page\PageRenderer;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\MathUtility;
use TYPO3\CMS\Workspaces\Service\WorkspaceService;
/**
* Main script class for the page tree navigation frame
* This is the class for rendering the "page tree" navigation frame without ExtJS, used prior to TYPO3 CMS 4.5.
* This functionality is deprecated since TYPO3 CMS 7, and will be removed with TYPO3 CMS 8