The page position map for web_layout uses
a simple linkThisScript method and calls the global
variable.
The change includes the tiny adaptions in the own
class as well, to remove the dependency on
$GLOBALS[SOBE] for this use case.
Resolves: #72670
Releases: master
Change-Id: I797d1073abc0cd63f9c4434632cc2dc1b78f8ba7
Reviewed-on: https://review.typo3.org/45859
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
*/
public function wrapRecordTitle($str, $row)
{
*/
public function wrapRecordTitle($str, $row)
{
- $aOnClick = 'jumpToUrl(' . GeneralUtility::quoteJSvalue($GLOBALS['SOBE']->local_linkThisScript(array('edit_record' => ('tt_content:' . $row['uid'])))) . ');return false;';
+ $aOnClick = 'jumpToUrl(' . GeneralUtility::quoteJSvalue($this->linkToCurrentModule(['edit_record' => 'tt_content:' . $row['uid']])) . ');return false;';
return '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">' . $str . '</a>';
}
return '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">' . $str . '</a>';
}
*/
public function wrapColumnHeader($str, $vv)
{
*/
public function wrapColumnHeader($str, $vv)
{
- $aOnClick = 'jumpToUrl(' . GeneralUtility::quoteJSvalue($GLOBALS['SOBE']->local_linkThisScript(array('edit_record' => ('_EDIT_COL:' . $vv)))) . ');return false;';
+ $aOnClick = 'jumpToUrl(' . GeneralUtility::quoteJSvalue($this->linkToCurrentModule(['edit_record' => '_EDIT_COL:' . $vv])) . ');return false;';
return '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">' . $str . '</a>';
}
return '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">' . $str . '</a>';
}
public function onClickInsertRecord($row, $vv, $moveUid, $pid, $sys_lang = 0)
{
if (is_array($row)) {
public function onClickInsertRecord($row, $vv, $moveUid, $pid, $sys_lang = 0)
{
if (is_array($row)) {
- $location = $GLOBALS['SOBE']->local_linkThisScript(array('edit_record' => 'tt_content:new/-' . $row['uid'] . '/' . $row['colPos']));
+ $linkInformation = 'tt_content:new/-' . $row['uid'] . '/' . $row['colPos'];
- $location = $GLOBALS['SOBE']->local_linkThisScript(array('edit_record' => 'tt_content:new/' . $pid . '/' . $vv));
+ $linkInformation = 'tt_content:new/' . $pid . '/' . $vv;
+ $location = $this->linkToCurrentModule(['edit_record' => $linkInformation]);
return 'jumpToUrl(' . GeneralUtility::quoteJSvalue($location) . ');return false;';
}
return 'jumpToUrl(' . GeneralUtility::quoteJSvalue($location) . ');return false;';
}
+
+ /**
+ * Returns URL to the current script.
+ * In particular the "popView" and "new_unique_uid" Get vars are unset.
+ *
+ * @param array $params Parameters array, merged with global GET vars.
+ * @return string URL
+ */
+ protected function linkToCurrentModule($params)
+ {
+ unset($params['popView']);
+ unset($params['new_unique_uid']);
+ return GeneralUtility::linkThisScript($params);
+ }
+