Commit a6692f20 authored by Benni Mack's avatar Benni Mack
Browse files

[TASK] Make Backend Module URLs absolute

In the approach to remove all occurences of dealing with
relative URL referencing in the TYPO3 Backend, the main mod.php
calls are now always prefixed with "/{possiblesubfolder/}typo3/" so
no backPath parameter and calculations are needed anymore.

The patch thus removes all locations of the JavaScript
variable "top.TS.PATH_typo3" containing the backpath and
makes the "relative" path to BackendUtility::getModuleUrl()
always a absolute prefix relative to the PATH_typo3 structure.

Resolves: #66052
Releases: master
Change-Id: Ie8192f227b8d1715be90efff8746482adf252ac7
Reviewed-on: http://review.typo3.org/38246


Reviewed-by: default avatarMarkus Klein <klein.t3@reelworx.at>
Tested-by: default avatarMarkus Klein <klein.t3@reelworx.at>
Reviewed-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
Reviewed-by: Benni Mack's avatarBenjamin Mack <benni@typo3.org>
Tested-by: Benni Mack's avatarBenjamin Mack <benni@typo3.org>
parent 3a1d0abf
......@@ -54,7 +54,7 @@ class ClearCacheToolbarItem implements ToolbarItemInterface {
'id' => 'pages',
'title' => $languageService->sL('LLL:EXT:lang/locallang_core.xlf:flushPageCachesTitle', TRUE),
'description' => $languageService->sL('LLL:EXT:lang/locallang_core.xlf:flushPageCachesDescription', TRUE),
'href' => BackendUtility::getModuleUrl('tce_db') . '&vC=' . $backendUser->veriCode() . '&cacheCmd=pages&ajaxCall=1' . BackendUtility::getUrlToken('tceAction'),
'href' => BackendUtility::getModuleUrl('tce_db', ['vC' => $backendUser->veriCode(), 'cacheCmd' => 'pages', 'ajaxCall' => 1]) . BackendUtility::getUrlToken('tceAction'),
'icon' => IconUtility::getSpriteIcon('actions-system-cache-clear-impact-low')
);
$this->optionValues[] = 'pages';
......@@ -66,7 +66,7 @@ class ClearCacheToolbarItem implements ToolbarItemInterface {
'id' => 'all',
'title' => $languageService->sL('LLL:EXT:lang/locallang_core.xlf:flushGeneralCachesTitle', TRUE),
'description' => $languageService->sL('LLL:EXT:lang/locallang_core.xlf:flushGeneralCachesDescription', TRUE),
'href' => BackendUtility::getModuleUrl('tce_db') . '&vC=' . $backendUser->veriCode() . '&cacheCmd=all&ajaxCall=1' . BackendUtility::getUrlToken('tceAction'),
'href' => BackendUtility::getModuleUrl('tce_db', ['vC' => $backendUser->veriCode(), 'cacheCmd' => 'all', 'ajaxCall' => 1]) . BackendUtility::getUrlToken('tceAction'),
'icon' => IconUtility::getSpriteIcon('actions-system-cache-clear-impact-medium')
);
$this->optionValues[] = 'all';
......@@ -82,7 +82,7 @@ class ClearCacheToolbarItem implements ToolbarItemInterface {
'id' => 'system',
'title' => $languageService->sL('LLL:EXT:lang/locallang_core.xlf:flushSystemCachesTitle', TRUE),
'description' => $languageService->sL('LLL:EXT:lang/locallang_core.xlf:flushSystemCachesDescription', TRUE),
'href' => BackendUtility::getModuleUrl('tce_db') . '&vC=' . $backendUser->veriCode() . '&cacheCmd=system&ajaxCall=1' . BackendUtility::getUrlToken('tceAction'),
'href' => BackendUtility::getModuleUrl('tce_db', ['vC' => $backendUser->veriCode(), 'cacheCmd' => 'system', 'ajaxCall' => 1]) . BackendUtility::getUrlToken('tceAction'),
'icon' => IconUtility::getSpriteIcon('actions-system-cache-clear-impact-high')
);
$this->optionValues[] = 'system';
......
......@@ -324,7 +324,7 @@ class ShortcutToolbarItem implements ToolbarItemInterface {
if (strpos($parsedUrl['path'], 'mod.php') !== FALSE && isset($parameters['M'])) {
$module = $parameters['M'];
$url = str_replace('mod.php', '', $parsedUrl['path']) . BackendUtility::getModuleUrl($module, $parameters);
$url = BackendUtility::getModuleUrl($module, $parameters);
}
return $url;
}
......
......@@ -490,7 +490,7 @@ class ClickMenu {
public function urlRefForCM($url, $retUrl = '', $hideCM = TRUE, $overrideLoc = '') {
$loc = 'top.content.list_frame';
return ($overrideLoc ? 'var docRef=' . $overrideLoc : 'var docRef=(top.content.list_frame)?top.content.list_frame:' . $loc)
. '; docRef.location.href=top.TS.PATH_typo3+\'' . $url . '\'' . ($retUrl ? '+\'&' . $retUrl . '=\'+top.rawurlencode('
. '; docRef.location.href=\'' . $url . '\'' . ($retUrl ? '+\'&' . $retUrl . '=\'+top.rawurlencode('
. $this->frameLocation('docRef.document') . '.pathname+' . $this->frameLocation('docRef.document') . '.search)' : '')
. ';';
}
......@@ -535,7 +535,7 @@ class ClickMenu {
} else {
$conf = $loc;
}
$editOnClick = 'if(' . $conf . '){' . $loc . '.location.href=top.TS.PATH_typo3+\'' . $this->clipObj->pasteUrl($table, $uid, 0) . '&redirect=\'+top.rawurlencode(' . $this->frameLocation(($loc . '.document')) . '.pathname+' . $this->frameLocation(($loc . '.document')) . '.search);}';
$editOnClick = 'if(' . $conf . '){' . $loc . '.location.href=\'' . $this->clipObj->pasteUrl($table, $uid, 0) . '&redirect=\'+top.rawurlencode(' . $this->frameLocation(($loc . '.document')) . '.pathname+' . $this->frameLocation(($loc . '.document')) . '.search);}';
return $this->linkItem($this->label('paste' . $type), IconUtility::getSpriteIcon('actions-document-paste-' . $type), $editOnClick . 'return false;');
}
......@@ -699,11 +699,11 @@ class ClickMenu {
if ($this->backendUser->uc['classicPageEditMode']) {
$addParam = '&editRegularContentFromId=' . (int)$this->iParts[1];
} else {
$editOnClick = 'if(' . $loc . '){' . $loc . '.location.href=top.TS.PATH_typo3+\'' . $link . '&returnUrl=\'+top.rawurlencode(' . $this->frameLocation(($loc . '.document')) . '.pathname+' . $this->frameLocation(($loc . '.document')) . '.search)+\'' . $addParam . '\';}';
$editOnClick = 'if(' . $loc . '){' . $loc . '.location.href=\'' . $link . '&returnUrl=\'+top.rawurlencode(' . $this->frameLocation(($loc . '.document')) . '.pathname+' . $this->frameLocation(($loc . '.document')) . '.search)+\'' . $addParam . '\';}';
}
}
if (!$editOnClick) {
$editOnClick = 'if(' . $loc . '){' . $loc . '.location.href=top.TS.PATH_typo3+\'' . $link . '&returnUrl=\'+top.rawurlencode(' . $this->frameLocation(($loc . '.document')) . '.pathname+' . $this->frameLocation(($loc . '.document')) . '.search)+\'' . $addParam . '\';}';
$editOnClick = 'if(' . $loc . '){' . $loc . '.location.href=\'' . $link . '&returnUrl=\'+top.rawurlencode(' . $this->frameLocation(($loc . '.document')) . '.pathname+' . $this->frameLocation(($loc . '.document')) . '.search)+\'' . $addParam . '\';}';
}
return $this->linkItem($this->label('edit'), IconUtility::getSpriteIcon($theIcon), $editOnClick . ';');
}
......@@ -722,7 +722,7 @@ class ClickMenu {
$module = $this->listFrame
? GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('record_edit', array('edit[' . $table . '][-' . $uid . ']' => 'new')) . '&returnUrl=') . '+top.rawurlencode(' . $location . '.pathname+' . $location . '.search)'
: GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('db_new', array('id' => (int)$uid)));
$editOnClick = 'if(' . $frame . '){' . $frame . '.location.href=top.TS.PATH_typo3+' . $module . ';}';
$editOnClick = 'if(' . $frame . '){' . $frame . '.location.href=' . $module . ';}';
$icon = IconUtility::getSpriteIcon('actions-' . ($table === 'pages' ? 'page' : 'document') . '-new');
return $this->linkItem($this->label('new'), $icon, $editOnClick);
}
......@@ -743,7 +743,7 @@ class ClickMenu {
} else {
$conf = '1==1';
}
$editOnClick = 'if(' . $loc . ' && ' . $conf . ' ){' . $loc . '.location.href=top.TS.PATH_typo3+' .
$editOnClick = 'if(' . $loc . ' && ' . $conf . ' ){' . $loc . '.location.href=' .
GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('tce_db') . '&redirect=') . '+top.rawurlencode(' .
$this->frameLocation($loc . '.document') . '.pathname+' . $this->frameLocation(($loc . '.document')) . '.search)+' .
GeneralUtility::quoteJSvalue(
......@@ -819,7 +819,7 @@ class ClickMenu {
public function DB_changeFlag($table, $rec, $flagField, $title) {
$uid = $rec['_ORIG_uid'] ?: $rec['uid'];
$loc = 'top.content.list_frame';
$editOnClick = 'if(' . $loc . '){' . $loc . '.location.href=top.TS.PATH_typo3+' .
$editOnClick = 'if(' . $loc . '){' . $loc . '.location.href=' .
GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('tce_db') . '&redirect=') . '+top.rawurlencode(' .
$this->frameLocation($loc . '.document') . '.pathname+' . $this->frameLocation(($loc . '.document')) . '.search)+' .
GeneralUtility::quoteJSvalue(
......@@ -1003,7 +1003,7 @@ class ClickMenu {
$scriptUrl = BackendUtility::getModuleUrl($moduleName);
}
$editOnClick = 'if(' . $loc . '){' . $loc . '.location.href=top.TS.PATH_typo3+' . GeneralUtility::quoteJSvalue($scriptUrl . '&target=' . rawurlencode($path)) . ($noReturnUrl ? '' : '+\'&returnUrl=\'+top.rawurlencode(' . $this->frameLocation($loc . '.document') . '.pathname+' . $this->frameLocation($loc . '.document') . '.search)') . ';}';
$editOnClick = 'if(' . $loc . '){' . $loc . '.location.href=' . GeneralUtility::quoteJSvalue($scriptUrl . '&target=' . rawurlencode($path)) . ($noReturnUrl ? '' : '+\'&returnUrl=\'+top.rawurlencode(' . $this->frameLocation($loc . '.document') . '.pathname+' . $this->frameLocation($loc . '.document') . '.search)') . ';}';
return $this->linkItem($this->label($type), IconUtility::getSpriteIcon($iconName), $editOnClick . 'top.nav.refresh();');
}
......@@ -1044,7 +1044,7 @@ class ClickMenu {
} else {
$conf = '1==1';
}
$editOnClick = 'if(' . $loc . ' && ' . $conf . ' ){' . $loc . '.location.href=top.TS.PATH_typo3+' .
$editOnClick = 'if(' . $loc . ' && ' . $conf . ' ){' . $loc . '.location.href=' .
GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('tce_file') . '&redirect=') . '+top.rawurlencode(' .
$this->frameLocation(($loc . '.document')) . '.pathname+' . $this->frameLocation(($loc . '.document')) . '.search)+' .
GeneralUtility::quoteJSvalue(
......@@ -1069,7 +1069,7 @@ class ClickMenu {
} else {
$conf = $loc;
}
$editOnClick = 'if(' . $conf . '){' . $loc . '.location.href=top.TS.PATH_typo3+\'' . $this->clipObj->pasteUrl('_FILE', $path, 0) . '&redirect=\'+top.rawurlencode(' . $this->frameLocation(($loc . '.document')) . '.pathname+' . $this->frameLocation(($loc . '.document')) . '.search); };top.nav.refresh();';
$editOnClick = 'if(' . $conf . '){' . $loc . '.location.href=\'' . $this->clipObj->pasteUrl('_FILE', $path, 0) . '&redirect=\'+top.rawurlencode(' . $this->frameLocation(($loc . '.document')) . '.pathname+' . $this->frameLocation(($loc . '.document')) . '.search); };top.nav.refresh();';
return $this->linkItem($this->label('pasteinto'), IconUtility::getSpriteIcon('actions-document-paste-into'), $editOnClick . 'return false;');
}
......@@ -1148,7 +1148,7 @@ class ClickMenu {
public function dragDrop_copymovepage($srcUid, $dstUid, $action, $into) {
$negativeSign = $into === 'into' ? '' : '-';
$loc = 'top.content.list_frame';
$editOnClick = 'if(' . $loc . '){' . $loc . '.document.location=top.TS.PATH_typo3+' .
$editOnClick = 'if(' . $loc . '){' . $loc . '.document.location=' .
GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('tce_db') . '&redirect=') . '+top.rawurlencode(' .
$this->frameLocation(($loc . '.document')) . '.pathname+' . $this->frameLocation(($loc . '.document')) . '.search)+' .
GeneralUtility::quoteJSvalue(
......@@ -1169,7 +1169,7 @@ class ClickMenu {
*/
public function dragDrop_copymovefolder($srcPath, $dstPath, $action) {
$loc = 'top.content.list_frame';
$editOnClick = 'if(' . $loc . '){' . $loc . '.document.location=top.TS.PATH_typo3+' .
$editOnClick = 'if(' . $loc . '){' . $loc . '.document.location=' .
GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('tce_file') . '&redirect=') . '+top.rawurlencode(' .
$this->frameLocation(($loc . '.document')) . '.pathname+' . $this->frameLocation(($loc . '.document')) . '.search)+' .
GeneralUtility::quoteJSvalue(
......
......@@ -503,7 +503,7 @@ class Clipboard {
if ($this->fileMode) {
$str = '<span class="text-muted">' . $str . '</span>';
} else {
$str = '<a href="' . htmlspecialchars(BackendUtility::getModuleUrl('web_list', array('id' => $rec['pid']), $this->backPath)) . '">' . $str . '</a>';
$str = '<a href="' . htmlspecialchars(BackendUtility::getModuleUrl('web_list', array('id' => $rec['pid']))) . '">' . $str . '</a>';
}
} elseif (file_exists($rec)) {
if (!$this->fileMode) {
......@@ -566,14 +566,20 @@ class Clipboard {
* @return string
*/
public function pasteUrl($table, $uid, $setRedirect = TRUE, array $update = NULL) {
return ($table == '_FILE' ? BackendUtility::getModuleUrl('tce_file', array(), $this->backPath) : BackendUtility::getModuleUrl('tce_db', array(), $this->backPath)) .
($setRedirect ? '&redirect=' . rawurlencode(GeneralUtility::linkThisScript(array('CB' => ''))) : '') .
'&vC=' . $this->getBackendUser()->veriCode() .
'&prErr=1&uPT=1' .
'&CB[paste]=' . rawurlencode($table . '|' . $uid) .
'&CB[pad]=' . $this->current .
(is_array($update) ? GeneralUtility::implodeArrayForUrl('CB[update]', $update) : '') .
BackendUtility::getUrlToken('tceAction');
$urlParameters = [
'vC' => $this->getBackendUser()->veriCode(),
'prErr' => 1,
'uPT' => 1,
'CB[paste]' => $table . '|' . $uid,
'CB[pad]' => $this->current
];
if ($setRedirect) {
$urlParameters['redirect'] = GeneralUtility::linkThisScript(array('CB' => ''));
}
if (is_array($update)) {
$urlParameters['CB[update]'] = $update;
}
return BackendUtility::getModuleUrl($table === '_FILE' ? 'tce_file' : 'tce_db', $urlParameters) . BackendUtility::getUrlToken('tceAction');
}
/**
......@@ -584,9 +590,17 @@ class Clipboard {
* @return string
*/
public function deleteUrl($setRedirect = 1, $file = 0) {
return ($file ? BackendUtility::getModuleUrl('tce_file', array(), $this->backPath) : BackendUtility::getModuleUrl('tce_db', array(), $this->backPath))
. ($setRedirect ? '&redirect=' . rawurlencode(GeneralUtility::linkThisScript(array('CB' => ''))) : '') . '&vC=' . $this->getBackendUser()->veriCode()
. '&prErr=1&uPT=1' . '&CB[delete]=1' . '&CB[pad]=' . $this->current . BackendUtility::getUrlToken('tceAction');
$urlParameters = [
'vC' => $this->getBackendUser()->veriCode(),
'prErr' => 1,
'uPT' => 1,
'CB[delete]' => 1,
'CB[pad]' => $this->current
];
if ($setRedirect) {
$urlParameters['redirect'] = GeneralUtility::linkThisScript(array('CB' => ''));
}
return BackendUtility::getModuleUrl($file ? 'tce_file' : 'tce_db', $urlParameters) . BackendUtility::getUrlToken('tceAction');
}
/**
......
......@@ -684,7 +684,7 @@ class EditDocumentController {
function typoSetup() { //
this.uniqueID = "";
this.passwordDummy = "********";
this.PATH_typo3 = " ";
this.PATH_typo3 = "";
this.decimalSign = ".";
}
var TS = new typoSetup();
......
......@@ -141,7 +141,7 @@ class FileSystemNavigationFrameController {
$this->doc->JScode .= $this->doc->wrapScriptTags(($this->currentSubScript ? 'top.currentSubScript=unescape("' . rawurlencode($this->currentSubScript) . '");' : '') . '
// Function, loading the list frame from navigation tree:
function jumpTo(id, linkObj, highlightID, bank) {
var theUrl = top.TS.PATH_typo3 + top.currentSubScript ;
var theUrl = top.currentSubScript;
if (theUrl.indexOf("?") != -1) {
theUrl += "&id=" + id
} else {
......
......@@ -483,7 +483,7 @@ class PageLayoutController {
function deleteRecord(table,id,url) { //
if (confirm(' . GeneralUtility::quoteJSvalue($GLOBALS['LANG']->getLL('deleteWarning')) . ')) {
window.location.href = ' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('tce_db', array(), $GLOBALS['BACK_PATH']) . '&cmd[') . '+table+"]["+id+"][delete]=1&redirect="+escape(url)+"&vC=' . $GLOBALS['BE_USER']->veriCode() . BackendUtility::getUrlToken('tceAction') . '&prErr=1&uPT=1";
window.location.href = ' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('tce_db') . '&cmd[') . '+table+"]["+id+"][delete]=1&redirect="+escape(url)+"&vC=' . $GLOBALS['BE_USER']->veriCode() . BackendUtility::getUrlToken('tceAction') . '&prErr=1&uPT=1";
}
return false;
}
......@@ -662,7 +662,7 @@ class PageLayoutController {
// Alternative template
$this->doc->setModuleTemplate('EXT:backend/Resources/Private/Templates/db_layout_quickedit.html');
// Alternative form tag; Quick Edit submits its content to tce_db.php.
$this->doc->form = '<form action="' . htmlspecialchars(BackendUtility::getModuleUrl('tce_db', array(), $GLOBALS['BACK_PATH']) . '&prErr=1&uPT=1') . '" method="post" enctype="' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['form_enctype'] . '" name="editform" onsubmit="return TBE_EDITOR.checkSubmit(1);">';
$this->doc->form = '<form action="' . htmlspecialchars(BackendUtility::getModuleUrl('tce_db', ['prErr' => 1, 'uPT' => 1])) . '" method="post" enctype="' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['form_enctype'] . '" name="editform" onsubmit="return TBE_EDITOR.checkSubmit(1);">';
// Setting up the context sensitive menu:
$this->doc->getContextMenuCode();
// Set the edit_record value for internal use in this function:
......@@ -676,7 +676,7 @@ class PageLayoutController {
}
$url = BackendUtility::getModuleUrl('record_edit', array(
'edit[tt_content][' . implode(',', $idListA) . ']' => 'edit',
'returnUrl' => rawurlencode($this->local_linkThisScript(array('edit_record' => '')))
'returnUrl' => $this->local_linkThisScript(array('edit_record' => ''))
));
\TYPO3\CMS\Core\Utility\HttpUtility::redirect($url);
}
......@@ -1093,7 +1093,12 @@ class PageLayoutController {
if (!$this->modTSconfig['properties']['disableIconToolbar']) {
// Move record
if (MathUtility::canBeInterpretedAsInteger($this->eRParts[1])) {
$buttons['move_record'] = '<a href="' . htmlspecialchars(BackendUtility::getModuleUrl('move_element', array(), $GLOBALS['BACK_PATH']) . '&table=' . $this->eRParts[0] . '&uid=' . $this->eRParts[1] . '&returnUrl=' . rawurlencode(GeneralUtility::getIndpEnv('REQUEST_URI'))) . '">' . IconUtility::getSpriteIcon(('actions-' . ($this->eRParts[0] == 'tt_content' ? 'document' : 'page') . '-move'), array('class' => 'c-inputButton', 'title' => $GLOBALS['LANG']->getLL(('move_' . ($this->eRParts[0] == 'tt_content' ? 'record' : 'page')), TRUE))) . '</a>';
$urlParameters = [
'table' => $this->eRParts[0],
'uid' => $this->eRParts[1],
'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
];
$buttons['move_record'] = '<a href="' . htmlspecialchars(BackendUtility::getModuleUrl('move_element', $urlParameters)) . '">' . IconUtility::getSpriteIcon(('actions-' . ($this->eRParts[0] == 'tt_content' ? 'document' : 'page') . '-move'), array('class' => 'c-inputButton', 'title' => $GLOBALS['LANG']->getLL(('move_' . ($this->eRParts[0] == 'tt_content' ? 'record' : 'page')), TRUE))) . '</a>';
}
// Edit page properties and page language overlay icons
......
......@@ -155,7 +155,7 @@ class PageTreeNavigationController {
$this->doc->JScode .= $this->doc->wrapScriptTags(($this->currentSubScript ? 'top.currentSubScript=unescape("' . rawurlencode($this->currentSubScript) . '");' : '') . '
// Function, loading the list frame from navigation tree:
function jumpTo(id, linkObj, highlightID, bank) { //
var theUrl = top.TS.PATH_typo3 + top.currentSubScript ;
var theUrl = top.currentSubScript ;
if (theUrl.indexOf("?") != -1) {
theUrl += "&id=" + id
} else {
......@@ -227,7 +227,7 @@ class PageTreeNavigationController {
'refresh' => ''
);
// New Page
$onclickNewPageWizard = 'top.content.list_frame.location.href=top.TS.PATH_typo3+' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('db_new', ['pagesOnly' => 1, 'id' => ''])) . '+Tree.pageID;';
$onclickNewPageWizard = 'top.content.list_frame.location.href=' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('db_new', ['pagesOnly' => 1, 'id' => ''])) . '+Tree.pageID;';
$buttons['new_page'] = '<a href="#" onclick="' . $onclickNewPageWizard . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:cms/layout/locallang.xlf:newPage', TRUE) . '">' . IconUtility::getSpriteIcon('actions-page-new') . '</a>';
// Refresh
$buttons['refresh'] = '<a href="' . htmlspecialchars(GeneralUtility::getIndpEnv('REQUEST_URI')) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.refresh', TRUE) . '">' . IconUtility::getSpriteIcon('actions-system-refresh') . '</a>';
......
......@@ -203,7 +203,7 @@ class AddController extends AbstractWizardController {
$redirectUrl = BackendUtility::getModuleUrl('record_edit', array(
'returnEditConf' => 1,
'edit[' . $this->P['params']['table'] . '][' . $this->pid . ']' => 'new',
'returnUrl' => rawurlencode(GeneralUtility::getIndpEnv('REQUEST_URI'))
'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
));
HttpUtility::redirect($redirectUrl);
}
......
......@@ -741,7 +741,7 @@ class InlineElement {
$url = BackendUtility::getModuleUrl('record_edit', array(
'edit[sys_file_metadata][' . (int)$recordInDatabase['uid'] . ']' => 'edit'
));
$editOnClick = 'if(top.content.list_frame){top.content.list_frame.location.href=top.TS.PATH_typo3+\'' . $url . '&returnUrl=\'+top.rawurlencode('
$editOnClick = 'if(top.content.list_frame){top.content.list_frame.location.href=\'' . $url . '&returnUrl=\'+top.rawurlencode('
. 'top.content.list_frame.document.location' . '.pathname+top.content.list_frame.document.location' . '.search);}';
$title = $languageService->sL('LLL:EXT:lang/locallang_core.xlf:cm.editMetadata');
$cells['editmetadata'] = '
......
......@@ -926,7 +926,7 @@ class FormEngine {
$lTTS_url = BackendUtility::getModuleUrl('record_edit', array(
'edit[' . $table . '][' . $row['uid'] . ']' => 'edit',
'columnsOnly' => $field,
'returnUrl' => rawurlencode($this->thisReturnUrl())
'returnUrl' => $this->thisReturnUrl()
));
$label = '<a href="' . htmlspecialchars($lTTS_url) . '">' . $label . '</a>';
}
......
......@@ -249,7 +249,7 @@ class LiveSearch {
$returnUrl = BackendUtility::getModuleUrl('web_list', array('id' => $row['pid']));
$editLink = BackendUtility::getModuleUrl('record_edit', array(
'edit[' . $tableName . '][' . $row['uid'] . ']' => 'edit',
'returnUrl' => rawurlencode($returnUrl)
'returnUrl' => $returnUrl
));
}
return $editLink;
......
......@@ -545,7 +545,7 @@ function jumpToUrl(URL) {
*/
public function issueCommand($params, $redirectUrl = '') {
$redirectUrl = $redirectUrl ? $redirectUrl : GeneralUtility::getIndpEnv('REQUEST_URI');
$commandUrl = BackendUtility::getModuleUrl('tce_db', array(), $this->backPath) . '&' . $params . '&redirect=' . ($redirectUrl == -1 ? '\'+T3_THIS_LOCATION+\'' : rawurlencode($redirectUrl)) . '&vC=' . rawurlencode($GLOBALS['BE_USER']->veriCode()) . BackendUtility::getUrlToken('tceAction') . '&prErr=1&uPT=1';
$commandUrl = BackendUtility::getModuleUrl('tce_db') . '&' . $params . '&redirect=' . ($redirectUrl == -1 ? '\'+T3_THIS_LOCATION+\'' : rawurlencode($redirectUrl)) . '&vC=' . rawurlencode($GLOBALS['BE_USER']->veriCode()) . BackendUtility::getUrlToken('tceAction') . '&prErr=1&uPT=1';
return $commandUrl;
}
......
......@@ -2672,7 +2672,7 @@ class BackendUtility {
* REMEMBER to always htmlspecialchar() content in href-properties to ampersands get converted to entities (XHTML requirement and XSS precaution)
*
* @param string $params Parameters sent along to EditDocumentController. This requires a much more details description which you must seek in Inside TYPO3s documentation of the FormEngine API. And example could be '&edit[pages][123] = edit' which will show edit form for page record 123.
* @param string $backPath Must point back to the TYPO3_mainDir directory (where the main entry point is)
* @param string $backPath (unused)
* @param string $requestUri An optional returnUrl you can set - automatically set to REQUEST_URI.
*
* @return string
......@@ -2683,7 +2683,7 @@ class BackendUtility {
? '\'+T3_THIS_LOCATION+\''
: rawurlencode($requestUri ?: GeneralUtility::getIndpEnv('REQUEST_URI'));
$retUrlParam = 'returnUrl=' . $returnUrl;
return 'window.location.href=\'' . self::getModuleUrl('record_edit', array(), $backPath) . '&' . $retUrlParam . $params . '\'; return false;';
return 'window.location.href=\'' . self::getModuleUrl('record_edit') . '&' . $retUrlParam . $params . '\'; return false;';
}
/**
......@@ -3136,16 +3136,11 @@ class BackendUtility {
*
* @param string $moduleName Name of the module
* @param array $urlParameters URL parameters that should be added as key value pairs
* @param bool|string $backPathOverride backpath that should be used instead of the global $BACK_PATH
* @param bool|string $backPathOverride (unused)
* @param bool $returnAbsoluteUrl If set to TRUE, the URL returned will be absolute, $backPathOverride will be ignored in this case
* @return string Calculated URL
*/
static public function getModuleUrl($moduleName, $urlParameters = array(), $backPathOverride = FALSE, $returnAbsoluteUrl = FALSE) {
if ($backPathOverride === FALSE) {
$backPath = isset($GLOBALS['BACK_PATH']) ? $GLOBALS['BACK_PATH'] : '';
} else {
$backPath = $backPathOverride;
}
$urlParameters = array(
'M' => $moduleName,
'moduleToken' => FormProtectionFactory::get()->generateToken('moduleCall', $moduleName)
......@@ -3154,7 +3149,7 @@ class BackendUtility {
if ($returnAbsoluteUrl) {
return GeneralUtility::getIndpEnv('TYPO3_REQUEST_DIR') . $url;
} else {
return $backPath . $url;
return PathUtility::getAbsoluteWebPath(PATH_typo3 . $url);
}
}
......
......@@ -861,8 +861,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
}
if ($this->ext_CALC_PERMS & Permission::PAGE_DELETE || $this->ext_CALC_PERMS & Permission::PAGE_EDIT) {
$bArray[1] = $this->getPageLayoutController()->doc->t3Button(
'window.location.href=' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('move_element', array(), $this->backPath) . '&table=pages&uid=' . $id
. '&returnUrl=' . rawurlencode(GeneralUtility::getIndpEnv('REQUEST_URI'))) . ';',
'window.location.href=' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('move_element', ['table' => 'pages', 'uid' => $id, 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')])) . ';',
$this->getLanguageService()->getLL('move_page')
);
}
......@@ -873,7 +872,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
];
$bArray[2] = $this->getPageLayoutController()->doc->t3Button(
'window.location.href=' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('db_new', $parameters, $this->backPath)) . ';',
'window.location.href=' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('db_new', $parameters)) . ';',
$this->getLanguageService()->getLL('newPage2')
);
}
......@@ -1835,8 +1834,8 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
$url = BackendUtility::getModuleUrl('record_edit', array(
'edit[pages_language_overlay]['. $id . ']' => 'new',
'overrideVals[pages_language_overlay][doktype]' => (int)$this->pageRecord['doktype'],
'returnUrl' => rawurlencode(GeneralUtility::getIndpEnv('REQUEST_URI'))
), $this->backPath);
'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
));
$onChangeContent = 'window.location.href=\'' . $url . '&overrideVals[pages_language_overlay][sys_language_uid]=\'+this.options[this.selectedIndex].value';
return '<div class="form-inline form-inline-spaced">'
. '<div class="form-group">'
......
......@@ -50,7 +50,7 @@ class ext_posMap extends \TYPO3\CMS\Backend\Tree\View\PagePositionMap {
'edit[tt_content][' . (is_array($row) ? -$row['uid'] : $pid) . ']' => 'new',
'defVals[tt_content][colPos]' => $vv,
'defVals[tt_content][sys_language_uid]' => $sys_lang,
'returnUrl' => rawurlencode($GLOBALS['SOBE']->R_URI)
'returnUrl' => $GLOBALS['SOBE']->R_URI
));
return 'window.location.href=' . \TYPO3\CMS\Core\Utility\GeneralUtility::quoteJSvalue($location) . '+document.editForm.defValues.value; return false;';
}
......
......@@ -97,7 +97,7 @@ define('TYPO3/CMS/Backend/ContextHelp', ['jquery', 'TYPO3/CMS/Backend/Popover',
var identifier = $trigger.data('table') + '.' + $trigger.data('field');
try {
var cshWindow = window.open(
top.TYPO3.configuration.PATH_typo3 + ContextHelp.helpModuleUrl + '&tfID=' + identifier,
ContextHelp.helpModuleUrl + '&tfID=' + identifier,
'ContextHelpWindow',
'height=' + top.TYPO3.configuration.ContextHelpWindows.height + ',width=' + top.TYPO3.configuration.ContextHelpWindows.width + ',status=0,menubar=0,scrollbars=1'
);
......
......@@ -134,7 +134,7 @@ function str_replace(match,replace,string) { //
*/
function launchView(table, uid, bP) {
var thePreviewWindow = "";
thePreviewWindow = window.open(TS.PATH_typo3 + TYPO3.settings.ShowItem.moduleUrl + '&table=' + encodeURIComponent(table) + "&uid=" + encodeURIComponent(uid),
thePreviewWindow = window.open(TYPO3.settings.ShowItem.moduleUrl + '&table=' + encodeURIComponent(table) + "&uid=" + encodeURIComponent(uid),
"ShowItem" + TS.uniqueID,
"width=650,height=600,status=0,menubar=0,resizable=0,location=0,directories=0,scrollbars=1,toolbar=0");
if (thePreviewWindow && thePreviewWindow.focus) {
......
......@@ -715,7 +715,7 @@ TYPO3.Components.PageTree.Actions = {
fsMod.recentIds['web'] = node.attributes.nodeData.id;
TYPO3.Backend.ContentContainer.setUrl(
TS.PATH_typo3 + currentSubScript + separator + 'id=' + node.attributes.nodeData.id
currentSubScript + separator + 'id=' + node.attributes.nodeData.id
);
},
......
......@@ -192,7 +192,7 @@ var inline = {
makeAjaxCall: function (method, params, lock, context) {
var url = '', urlParams = '', options = {};
if (method && params && params.length && this.lockAjaxMethod(method, lock)) {
url = TBE_EDITOR.getBackendPath() + TYPO3.settings.ajaxUrls['t3lib_TCEforms_inline::' + method];
url = TYPO3.settings.ajaxUrls['t3lib_TCEforms_inline::' + method];
urlParams = '';
for (var i = 0, max = params.length; i < max; i++) {
urlParams += '&ajax[' + i + ']=' + encodeURIComponent(params[i]);
......
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