Commit 567c271d authored by Christian Kuhn's avatar Christian Kuhn Committed by Benni Mack
Browse files

[TASK] BACK_PATH BE controller

Resolves: #68829
Releases: master
Change-Id: Ibf9b0a1c7884b68eb27f880e1d42369580d3ec04
Reviewed-on: http://review.typo3.org/42354


Reviewed-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
parent b62a10ab
......@@ -106,7 +106,6 @@ class ElementInformationController {
* Constructor
*/
public function __construct() {
$GLOBALS['BACK_PATH'] = '';
$GLOBALS['SOBE'] = $this;
$this->init();
......
......@@ -79,8 +79,6 @@ class CreateFolderController {
*/
public function __construct() {
$GLOBALS['SOBE'] = $this;
$GLOBALS['BACK_PATH'] = '';
$this->init();
}
......
......@@ -75,8 +75,6 @@ class EditFileController {
*/
public function __construct() {
$GLOBALS['SOBE'] = $this;
$GLOBALS['BACK_PATH'] = '';
$this->init();
}
......
......@@ -70,8 +70,6 @@ class FileUploadController {
public function __construct() {
$GLOBALS['SOBE'] = $this;
$this->getLanguageService()->includeLLFile('EXT:lang/locallang_misc.xlf');
$GLOBALS['BACK_PATH'] = '';
$this->init();
}
......
......@@ -68,8 +68,6 @@ class RenameFileController {
*/
public function __construct() {
$GLOBALS['SOBE'] = $this;
$GLOBALS['BACK_PATH'] = '';
$this->init();
}
......
......@@ -75,8 +75,6 @@ class ReplaceFileController {
*/
public function __construct() {
$GLOBALS['SOBE'] = $this;
$GLOBALS['BACK_PATH'] = '';
$this->init();
}
......@@ -183,7 +181,7 @@ class ReplaceFileController {
$docHeaderButtons = array(
'back' => ''
);
$docHeaderButtons['csh'] = BackendUtility::cshItem('xMOD_csh_corebe', 'file_rename', $GLOBALS['BACK_PATH']);
$docHeaderButtons['csh'] = BackendUtility::cshItem('xMOD_csh_corebe', 'file_rename');
// Back
if ($this->returnUrl) {
$docHeaderButtons['back'] = '<a href="' . htmlspecialchars(GeneralUtility::linkThisUrl($this->returnUrl))
......
......@@ -71,7 +71,6 @@ class FileSystemNavigationFrameController {
*/
public function __construct() {
$GLOBALS['SOBE'] = $this;
$GLOBALS['BACK_PATH'] = '';
$this->init();
}
......
......@@ -157,8 +157,6 @@ class NewRecordController {
public function __construct() {
$GLOBALS['SOBE'] = $this;
$this->getLanguageService()->includeLLFile('EXT:lang/locallang_misc.xlf');
$GLOBALS['BACK_PATH'] = '';
$this->init();
}
......
......@@ -531,7 +531,7 @@ class PageLayoutController {
$this->doc->JScode .= $this->doc->wrapScriptTags('
if (top.fsMod) top.fsMod.recentIds["web"] = ' . (int)$this->id . ';
if (top.fsMod) top.fsMod.navFrameHighlightedID["web"] = "pages' . (int)$this->id . '_"+top.fsMod.currentBank; ' . (int)$this->id . ';
' . ($this->popView ? BackendUtility::viewOnClick($this->id, $GLOBALS['BACK_PATH'], BackendUtility::BEgetRootLine($this->id)) : '') . '
' . ($this->popView ? BackendUtility::viewOnClick($this->id, '', BackendUtility::BEgetRootLine($this->id)) : '') . '
function deleteRecord(table,id,url) { //
if (confirm(' . GeneralUtility::quoteJSvalue($lang->getLL('deleteWarning')) . ')) {
......@@ -1129,7 +1129,7 @@ class PageLayoutController {
);
// View page
if (!VersionState::cast($this->pageinfo['t3ver_state'])->equals(VersionState::DELETE_PLACEHOLDER)) {
$buttons['view'] = '<a href="#" onclick="' . htmlspecialchars(BackendUtility::viewOnClick($this->pageinfo['uid'], $GLOBALS['BACK_PATH'], BackendUtility::BEgetRootLine($this->pageinfo['uid']))) . '" title="' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.showPage', TRUE) . '">' . IconUtility::getSpriteIcon('actions-document-view') . '</a>';
$buttons['view'] = '<a href="#" onclick="' . htmlspecialchars(BackendUtility::viewOnClick($this->pageinfo['uid'], '', BackendUtility::BEgetRootLine($this->pageinfo['uid']))) . '" title="' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.showPage', TRUE) . '">' . IconUtility::getSpriteIcon('actions-document-view') . '</a>';
}
// Shortcut
if ($this->getBackendUser()->mayMakeShortcut()) {
......@@ -1214,7 +1214,6 @@ class PageLayoutController {
$buttons['undo'] = '<a href="#"
onclick="' . htmlspecialchars('window.location.href=' .
GeneralUtility::quoteJSvalue(
$GLOBALS['BACK_PATH'] .
BackendUtility::getModuleUrl(
'record_history',
array(
......@@ -1230,7 +1229,6 @@ class PageLayoutController {
$buttons['history_record'] = '<a href="#"
onclick="' . htmlspecialchars('jumpToUrl(' .
GeneralUtility::quoteJSvalue(
$GLOBALS['BACK_PATH'] .
BackendUtility::getModuleUrl(
'record_history',
array(
......
......@@ -85,8 +85,6 @@ class PageTreeNavigationController {
public function __construct() {
GeneralUtility::deprecationLog('PageTreeNavigationController is deprecated in favor of new pagetrees');
$GLOBALS['SOBE'] = $this;
$GLOBALS['BACK_PATH'] = '';
$this->init();
}
......
......@@ -2629,12 +2629,12 @@ class BackendUtility {
*
* @param string $table Table name
* @param string $field Field name
* @param string $BACK_PATH UNUSED
* @param string $_ UNUSED
* @param bool $force Force display of icon no matter BE_USER setting for help
* @return string HTML content for a help icon/text
* @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8, use cshItem() instead
*/
static public function helpTextIcon($table, $field, $BACK_PATH = '', $force = FALSE) {
static public function helpTextIcon($table, $field, $_ = '', $force = FALSE) {
GeneralUtility::logDeprecatedFunction();
if (is_array($GLOBALS['TCA_DESCR'][$table]) && is_array($GLOBALS['TCA_DESCR'][$table]['columns'][$field])) {
return self::wrapInHelp($table, $field);
......@@ -2760,12 +2760,12 @@ class BackendUtility {
*
* @param string $table Table name ('_MOD_'+module name)
* @param string $field Field name (CSH locallang main key)
* @param string $BACK_PATH Back path, not needed anymore, don't use
* @param string $_ (unused)
* @param string $wrap Wrap code for icon-mode, splitted by "|". Not used for full-text mode.
* @return string HTML content for help text
* @see helpTextIcon()
*/
static public function cshItem($table, $field, $BACK_PATH = NULL, $wrap = '') {
static public function cshItem($table, $field, $_ = '', $wrap = '') {
static::getLanguageService()->loadSingleTableDescription($table);
if (is_array($GLOBALS['TCA_DESCR'][$table])
&& is_array($GLOBALS['TCA_DESCR'][$table]['columns'][$field])) {
......
......@@ -252,7 +252,7 @@ class BackendUserController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionCont
$updateData
);
$redirectUrl = $GLOBALS['BACK_PATH'] . 'index.php' . ($GLOBALS['TYPO3_CONF_VARS']['BE']['interfaces'] ? '' : '?commandLI=1');
$redirectUrl = 'index.php' . ($GLOBALS['TYPO3_CONF_VARS']['BE']['interfaces'] ? '' : '?commandLI=1');
\TYPO3\CMS\Core\Utility\HttpUtility::redirect($redirectUrl);
}
}
......
......@@ -100,7 +100,7 @@ class PermissionController extends ActionController {
$view->assign(
'previewUrl',
BackendUtility::viewonclick(
$this->pageInfo['uid'], $GLOBALS['BACK_PATH'],
$this->pageInfo['uid'], '',
BackendUtility::BEgetRootLine($this->pageInfo['uid'])
)
);
......@@ -168,7 +168,7 @@ class PermissionController extends ActionController {
$this->view->assign('viewTree', $tree->tree);
// CSH for permissions setting
$this->view->assign('cshItem', BackendUtility::cshItem('xMOD_csh_corebe', 'perm_module', $GLOBALS['BACK_PATH']));
$this->view->assign('cshItem', BackendUtility::cshItem('xMOD_csh_corebe', 'perm_module'));
}
/**
......
......@@ -64,7 +64,7 @@ class ConfigurationForm extends ExtendedTemplateService {
* @param string $backPath BackPath is the backReference from current position to typo3/ dir
* @return array
*/
public function ext_initTSstyleConfig($configTemplate, $pathRel, $pathAbs, $backPath) {
public function ext_initTSstyleConfig($configTemplate, $pathRel, $pathAbs, $backPath = '') {
// Do not log time-performance information
$this->tt_track = 0;
$this->constants = array($configTemplate, '');
......
......@@ -14,6 +14,8 @@ namespace TYPO3\CMS\Extensionmanager\Utility;
* The TYPO3 project - inspiring people to share!
*/
use TYPO3\CMS\Core\TypoScript\ConfigurationForm;
/**
* Utility for dealing with ext_emconf and ext_conf_template settings
*/
......@@ -118,14 +120,14 @@ class ConfigurationUtility implements \TYPO3\CMS\Core\SingletonInterface {
if ((string)$rawConfigurationString !== '') {
$extensionPathInformation = $this->getExtensionPathInformation($extensionKey);
$tsStyleConfig = $this->objectManager->get(\TYPO3\CMS\Core\TypoScript\ConfigurationForm::class);
/** @var ConfigurationForm $tsStyleConfig */
$tsStyleConfig = $this->objectManager->get(ConfigurationForm::class);
$tsStyleConfig->doNotSortCategoriesBeforeMakingForm = TRUE;
$theConstants = $tsStyleConfig->ext_initTSstyleConfig(
$rawConfigurationString,
$extensionPathInformation['siteRelPath'],
PATH_site . $extensionPathInformation['siteRelPath'],
$GLOBALS['BACK_PATH']
PATH_site . $extensionPathInformation['siteRelPath']
);
// Loop through configuration items, see if it is assigned to a sub category
......
......@@ -516,8 +516,8 @@ class FileListController {
$buttons['csh'] = BackendUtility::cshItem('xMOD_csh_corebe', 'filelist_module');
// Upload button (only if upload to this directory is allowed)
if ($this->folderObject && $this->folderObject->getStorage()->checkUserActionPermission('add', 'File') && $this->folderObject->checkActionPermission('write')) {
$buttons['upload'] = '<a href="' . htmlspecialchars($GLOBALS['BACK_PATH']
. BackendUtility::getModuleUrl(
$buttons['upload'] = '<a href="' . htmlspecialchars(
BackendUtility::getModuleUrl(
'file_upload',
array(
'target' => $this->folderObject->getCombinedIdentifier(),
......@@ -529,8 +529,8 @@ class FileListController {
if ($this->folderObject && $this->folderObject->checkActionPermission('write')
&& ($this->folderObject->getStorage()->checkUserActionPermission('add', 'File') || $this->folderObject->checkActionPermission('add'))
) {
$buttons['new'] = '<a href="' . htmlspecialchars($GLOBALS['BACK_PATH']
. BackendUtility::getModuleUrl(
$buttons['new'] = '<a href="' . htmlspecialchars(
BackendUtility::getModuleUrl(
'file_newfolder',
array(
'target' => $this->folderObject->getCombinedIdentifier(),
......
......@@ -688,7 +688,7 @@ class FileList extends AbstractRecordList {
$data = array(
'sys_file_metadata' => array($translations[$languageId]['uid'] => 'edit')
);
$editOnClick = BackendUtility::editOnClick(GeneralUtility::implodeArrayForUrl('edit', $data), $GLOBALS['BACK_PATH'], $this->listUrl());
$editOnClick = BackendUtility::editOnClick(GeneralUtility::implodeArrayForUrl('edit', $data), '', $this->listUrl());
$languageCode .= '<a href="#" class="btn btn-default" onclick="' . htmlspecialchars($editOnClick) . '">' . $flagButtonIcon . '</a>';
} else {
$parameters = [
......
......@@ -140,7 +140,7 @@ class TranslationStatusController extends \TYPO3\CMS\Backend\Module\AbstractFunc
// DEFAULT language:
// "View page" link is created:
$viewPageLink = '<a href="#" onclick="' . htmlspecialchars(BackendUtility::viewOnClick(
$data['row']['uid'], $GLOBALS['BACK_PATH'], '', '', '', '&L=###LANG_UID###')
$data['row']['uid'], '', '', '', '', '&L=###LANG_UID###')
) . '" title="' . $lang->sL('LLL:EXT:frontend/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_viewPage') . '">' .
IconUtility::getSpriteIcon('actions-document-view') . '</a>';
$status = $data['row']['l18n_cfg'] & 1 ? 'danger' : 'success';
......
......@@ -145,7 +145,7 @@ class PageFunctionsController extends \TYPO3\CMS\Backend\Module\BaseScriptClass
if ($this->id && is_array($this->pageinfo)) {
// View page
$buttons['view'] = '<a href="#" '
. 'onclick="' . htmlspecialchars(BackendUtility::viewOnClick($this->pageinfo['uid'], $GLOBALS['BACK_PATH'], BackendUtility::BEgetRootLine($this->pageinfo['uid']))) . '" '
. 'onclick="' . htmlspecialchars(BackendUtility::viewOnClick($this->pageinfo['uid'], '', BackendUtility::BEgetRootLine($this->pageinfo['uid']))) . '" '
. 'title="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.showPage', TRUE) . '">'
. \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-view') . '</a>';
// Shortcut
......
......@@ -3651,7 +3651,7 @@ class ImportExport {
if ($table === 'pages') {
$viewID = $this->mode === 'export' ? $uid : ($this->doesImport ? $this->import_mapId['pages'][$uid] : 0);
if ($viewID) {
$pInfo['title'] = '<a href="#" onclick="' . htmlspecialchars(BackendUtility::viewOnClick($viewID, $GLOBALS['BACK_PATH'])) . 'return false;">' . $pInfo['title'] . '</a>';
$pInfo['title'] = '<a href="#" onclick="' . htmlspecialchars(BackendUtility::viewOnClick($viewID)) . 'return false;">' . $pInfo['title'] . '</a>';
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment