[TASK] Replace editOnClick with pure HTML - Part 2 94/43694/6
authorBenjamin Mack <benni@typo3.org>
Thu, 1 Oct 2015 12:48:25 +0000 (14:48 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 8 Oct 2015 16:55:26 +0000 (18:55 +0200)
Resolves: #70266
Releases: master
Change-Id: I216912131d2eeeeffab6986e49e38ca1bb99444b
Reviewed-on: http://review.typo3.org/43694
Reviewed-by: Frans Saris <franssaris@gmail.com>
Tested-by: Frans Saris <franssaris@gmail.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/backend/Classes/Controller/PageLayoutController.php
typo3/sysext/backend/Classes/View/PageLayoutView.php
typo3/sysext/beuser/Classes/ViewHelpers/IssueCommandViewHelper.php
typo3/sysext/core/Classes/Database/QueryView.php
typo3/sysext/frontend/Classes/Controller/TranslationStatusController.php
typo3/sysext/linkvalidator/Classes/Report/LinkValidatorReport.php
typo3/sysext/version/Classes/Controller/VersionModuleController.php

index b553347..70fde46 100755 (executable)
@@ -1160,9 +1160,15 @@ class PageLayoutController {
                                                'sys_language_uid'
                                        );
 
-                                       $editLanguageOnClick = htmlspecialchars(BackendUtility::editOnClick('&edit[pages_language_overlay][' . $overlayRecord['uid'] . ']=edit'));
-                                       $buttons['edit_language'] = '<a href="#" ' .
-                                               'onclick="' . $editLanguageOnClick . '"' .
+                                       $editUrl = BackendUtility::getModuleUrl('record_edit', [
+                                               'edit' => [
+                                                       'pages_language_overlay' => [
+                                                               $overlayRecord['uid'] => 'edit'
+                                                       ]
+                                               ],
+                                               'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
+                                       ]);
+                                       $buttons['edit_language'] = '<a href="' . htmlspecialchars($editUrl) . '" ' .
                                                'title="' . $lang->getLL('editPageLanguageOverlayProperties', TRUE) . '">' .
                                                $this->iconFactory->getIcon('mimetypes-x-content-page-language-overlay', Icon::SIZE_SMALL)->render() .
                                                '</a>';
@@ -1170,8 +1176,15 @@ class PageLayoutController {
 
 
                                // Edit page properties
-                               $editPageOnClick = htmlspecialchars(BackendUtility::editOnClick('&edit[pages][' . $this->id . ']=edit'));
-                               $buttons['edit_page'] = '<a href="#" onclick="' . $editPageOnClick . '" title="' . $lang->getLL('editPageProperties', TRUE) . '">'
+                               $editUrl = BackendUtility::getModuleUrl('record_edit', [
+                                       'edit' => [
+                                               'pages' => [
+                                                       $this->id => 'edit'
+                                               ]
+                                       ],
+                                       'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
+                               ]);
+                               $buttons['edit_page'] = '<a href="' . htmlspecialchars($editUrl) . '" title="' . $lang->getLL('editPageProperties', TRUE) . '">'
                                        . $this->iconFactory->getIcon('actions-page-open', Icon::SIZE_SMALL)->render()
                                        . '</a>';
                        }
index 155e2b2..af4d5f2 100644 (file)
@@ -352,12 +352,21 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                        // Traverse fields (as set above) in order to create header values:
                        foreach ($this->fieldArray as $field) {
                                if ($editIdList && isset($GLOBALS['TCA']['pages']['columns'][$field]) && $field != 'uid' && !$this->pages_noEditColumns) {
-                                       $params = '&edit[pages][' . $editIdList . ']=edit&columnsOnly=' . $field;
                                        $iTitle = sprintf(
                                                $this->getLanguageService()->getLL('editThisColumn'),
                                                rtrim(trim($this->getLanguageService()->sL(BackendUtility::getItemLabel('pages', $field))), ':')
                                        );
-                                       $eI = '<a href="#" onclick="' . htmlspecialchars(BackendUtility::editOnClick($params))
+                                       $editUrl = BackendUtility::getModuleUrl('record_edit', [
+                                               'edit' => [
+                                                       'pages' => [
+                                                               $editIdList => 'edit',
+                                                       ]
+                                               ],
+                                               'columnsOnly' => $field,
+                                               'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
+                                       ]);
+
+                                       $eI = '<a href="' . htmlspecialchars($editUrl)
                                                . '" title="' . htmlspecialchars($iTitle) . '">'
                                                . $this->iconFactory->getIcon('actions-document-open', Icon::SIZE_SMALL)->render() . '</a>';
                                } else {
@@ -556,16 +565,25 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                                                if (!$disableMoveAndNewButtons && $this->getPageLayoutController()->pageIsNotLockedForEditors()) {
                                                        // New content element:
                                                        if ($this->option_newWizard) {
-                                                               $onClick = 'window.location.href=' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('new_content_element') . '&id=' . $row['pid']
-                                                                       . '&sys_language_uid=' . $row['sys_language_uid'] . '&colPos=' . $row['colPos']
-                                                                       . '&uid_pid=' . -$row['uid'] .
-                                                                       '&returnUrl=' . rawurlencode(GeneralUtility::getIndpEnv('REQUEST_URI'))) . ';';
+                                                               $url = BackendUtility::getModuleUrl('new_content_element', [
+                                                                       'id' => $row['pid'],
+                                                                       'sys_language_uid' => $row['sys_language_uid'],
+                                                                       'colPos' => $row['colPos'],
+                                                                       'uid_pid' => -$row['uid'],
+                                                                       'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
+                                                               ]);
                                                        } else {
-                                                               $params = '&edit[tt_content][' . -$row['uid'] . ']=new';
-                                                               $onClick = BackendUtility::editOnClick($params);
+                                                               $url = BackendUtility::getModuleUrl('record_edit', [
+                                                                       'edit' => [
+                                                                               'tt_content' => [
+                                                                                       -$row['uid'] => 'new',
+                                                                               ]
+                                                                       ],
+                                                                       'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
+                                                               ]);
                                                        }
                                                        $singleElementHTML .= '
-                                                               <a href="#" onclick="' . htmlspecialchars($onClick) . '" title="'
+                                                               <a href="' . htmlspecialchars($url) . '" title="'
                                                                        . $this->getLanguageService()->getLL('newContentElement', TRUE) . '" class="btn btn-default btn-sm">'
                                                                        . $this->iconFactory->getIcon('actions-document-new', Icon::SIZE_SMALL)->render()
                                                                        . ' '
@@ -584,7 +602,6 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                                }
                                $content[$key] .= '</div>';
                                // Add new-icon link, header:
-                               $newP = $this->newContentElementOnClick($id, $key, $lP);
                                $colTitle = BackendUtility::getProcessedValue('tt_content', 'colPos', $key);
                                $tcaItems = GeneralUtility::callUserFunction(\TYPO3\CMS\Backend\View\BackendLayoutView::class . '->getColPosListItemsParsed', $id, $this);
                                foreach ($tcaItems as $item) {
@@ -597,7 +614,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                                $editParam = $this->doEdit && !empty($rowArr)
                                        ? '&edit[tt_content][' . $editUidList . ']=edit' . $pageTitleParamForAltDoc
                                        : '';
-                               $head[$key] .= $this->tt_content_drawColHeader($colTitle, $editParam, $newP, $pasteP);
+                               $head[$key] .= $this->tt_content_drawColHeader($colTitle, $editParam, '', $pasteP);
                        }
                        // For each column, fit the rendered content into a table cell:
                        $out = '';
@@ -666,18 +683,18 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                                                        isset($columnConfig['colPos']) && $columnConfig['colPos'] !== ''
                                                        && GeneralUtility::inList($this->tt_contentConfig['activeCols'], $columnConfig['colPos'])
                                                ) {
-                                                       $grid .= $this->tt_content_drawColHeader($this->getLanguageService()->getLL('noAccess'), '', '');
+                                                       $grid .= $this->tt_content_drawColHeader($this->getLanguageService()->getLL('noAccess'));
                                                } elseif (
                                                        isset($columnConfig['colPos']) && $columnConfig['colPos'] !== ''
                                                        && !GeneralUtility::inList($this->tt_contentConfig['activeCols'], $columnConfig['colPos'])
                                                ) {
                                                        $grid .= $this->tt_content_drawColHeader($this->getLanguageService()->sL($columnConfig['name']) .
-                                                               ' (' . $this->getLanguageService()->getLL('noAccess') . ')', '', '');
+                                                               ' (' . $this->getLanguageService()->getLL('noAccess') . ')');
                                                } elseif (isset($columnConfig['name']) && $columnConfig['name'] !== '') {
                                                        $grid .= $this->tt_content_drawColHeader($this->getLanguageService()->sL($columnConfig['name'])
-                                                               . ' (' . $this->getLanguageService()->getLL('notAssigned') . ')', '', '');
+                                                               . ' (' . $this->getLanguageService()->getLL('notAssigned') . ')');
                                                } else {
-                                                       $grid .= $this->tt_content_drawColHeader($this->getLanguageService()->getLL('notAssigned'), '', '');
+                                                       $grid .= $this->tt_content_drawColHeader($this->getLanguageService()->getLL('notAssigned'));
                                                }
 
                                                $grid .= '</td>';
@@ -718,25 +735,44 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                                if ($lP) {
                                        list($lpRecord) = BackendUtility::getRecordsByField('pages_language_overlay', 'pid', $id, 'AND sys_language_uid=' . $lP);
                                        BackendUtility::workspaceOL('pages_language_overlay', $lpRecord);
-                                       $params = '&edit[pages_language_overlay][' . $lpRecord['uid'] . ']=edit&overrideVals[pages_language_overlay][sys_language_uid]=' . $lP;
+                                       $editUrl = BackendUtility::getModuleUrl('record_edit', [
+                                               'edit' => [
+                                                       'pages_language_overlay' => [
+                                                               $lpRecord['uid'] => 'edit',
+                                                       ]
+                                               ],
+                                               'overrideVals' => [
+                                                       'pages_language_overlay' => [
+                                                               'sys_language_uid' => $lP
+                                                       ]
+                                               ],
+                                               'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
+                                       ]);
                                        $lPLabel = $this->getPageLayoutController()->doc->wrapClickMenuOnIcon(
                                                $this->iconFactory->getIconForRecord('pages_language_overlay', $lpRecord, Icon::SIZE_SMALL)->render(),
                                                'pages_language_overlay',
                                                $lpRecord['uid']
                                        ) . $viewLink . ($this->getBackendUser()->check('tables_modify', 'pages_language_overlay')
-                                                       ? '<a href="#" onclick="' . htmlspecialchars(BackendUtility::editOnClick($params))
+                                                       ? '<a href="' . htmlspecialchars($editUrl)
                                                                . '" title="' . $this->getLanguageService()->getLL('edit', TRUE) . '">'
                                                                . $this->iconFactory->getIcon('actions-document-open', Icon::SIZE_SMALL)->render() . '</a>'
                                                        : ''
                                                ) . htmlspecialchars(GeneralUtility::fixed_lgd_cs($lpRecord['title'], 20));
                                } else {
-                                       $params = '&edit[pages][' . $this->id . ']=edit';
+                                       $editUrl = BackendUtility::getModuleUrl('record_edit', [
+                                               'edit' => [
+                                                       'pages' => [
+                                                               $this->id => 'edit',
+                                                       ]
+                                               ],
+                                               'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
+                                       ]);
                                        $lPLabel = $this->getPageLayoutController()->doc->wrapClickMenuOnIcon(
                                                        $this->iconFactory->getIconForRecord('pages', $this->pageRecord, Icon::SIZE_SMALL)->render(),
                                                        'pages',
                                                        $this->id
                                                ) . $viewLink . ($this->getBackendUser()->check('tables_modify', 'pages_language_overlay')
-                                                       ? '<a href="#" onclick="' . htmlspecialchars(BackendUtility::editOnClick($params))
+                                                       ? '<a href="' . htmlspecialchars($editUrl)
                                                        . '" title="' . $this->getLanguageService()->getLL('edit', TRUE) . '">'
                                                        . $this->iconFactory->getIcon('actions-document-open', Icon::SIZE_SMALL)->render() . '</a>'
                                                        : ''
@@ -834,8 +870,15 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                        . '</tr>';
                // Column's titles
                if ($this->doEdit) {
-                       $onClick = BackendUtility::editOnClick('&edit[' . $table . '][' . $this->id . ']=new');
-                       $theData['__cmds__'] = '<a href="#" onclick="' . htmlspecialchars($onClick) . '" '
+                       $url = BackendUtility::getModuleUrl('record_edit', [
+                               'edit' => [
+                                       $table => [
+                                               $this->id => 'new',
+                                       ]
+                               ],
+                               'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
+                       ]);
+                       $theData['__cmds__'] = '<a href="' . htmlspecialchars($url) . '" '
                                . 'title="' . $this->getLanguageService()->getLL('new', TRUE) . '">'
                                . $this->iconFactory->getIcon('actions-document-new', Icon::SIZE_SMALL)->render() . '</a>';
                }
@@ -848,7 +891,6 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                                list($flag, $code) = $this->fwd_rwd_nav();
                                $out .= $code;
                                if ($flag) {
-                                       $params = '&edit[' . $table . '][' . $row['uid'] . ']=edit';
                                        $Nrow = array();
                                        // Setting icons links
                                        if ($icon) {
@@ -858,7 +900,15 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                                        $Nrow = $this->dataFields($this->fieldArray, $table, $row, $Nrow);
                                        // Attach edit icon
                                        if ($this->doEdit) {
-                                               $Nrow['__editIconLink__'] = '<a href="#" onclick="' . htmlspecialchars(BackendUtility::editOnClick($params))
+                                               $url = BackendUtility::getModuleUrl('record_edit', [
+                                                       'edit' => [
+                                                               $table => [
+                                                                       $row['uid'] => 'edit',
+                                                               ]
+                                                       ],
+                                                       'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
+                                               ]);
+                                               $Nrow['__editIconLink__'] = '<a href="' . htmlspecialchars($url)
                                                        . '" title="' . $this->getLanguageService()->getLL('edit', TRUE) . '">'
                                                        . $this->iconFactory->getIcon('actions-document-open', Icon::SIZE_SMALL)->render() . '</a>';
                                        } else {
@@ -1061,9 +1111,15 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                                        break;
                                case 'uid':
                                        if ($this->getBackendUser()->doesUserHaveAccess($row, 2)) {
-                                               $params = '&edit[pages][' . $row['uid'] . ']=edit';
-                                               $eI = '<a href="#" onclick="'
-                                                       . htmlspecialchars(BackendUtility::editOnClick($params))
+                                               $url = BackendUtility::getModuleUrl('record_edit', [
+                                                       'edit' => [
+                                                               'pages' => [
+                                                                       $row['uid'] => 'edit',
+                                                               ]
+                                                       ],
+                                                       'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
+                                               ]);
+                                               $eI = '<a href="' . htmlspecialchars($url)
                                                        . '" title="' . $this->getLanguageService()->getLL('editThisPage', TRUE) . '">'
                                                        . $this->iconFactory->getIcon('actions-document-open', Icon::SIZE_SMALL)->render() . '</a>';
                                        } else {
@@ -1119,7 +1175,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
         * @param array|NULL $pasteParams Paste element params (i.e. array(colPos => 1, sys_language_uid => 2))
         * @return string HTML table
         */
-       public function tt_content_drawColHeader($colName, $editParams, $newParams, array $pasteParams = NULL) {
+       public function tt_content_drawColHeader($colName, $editParams = '', $newParams = '', array $pasteParams = NULL) {
                $iconsArr = array();
                // Create command links:
                if ($this->tt_contentConfig['showCommands']) {
@@ -1214,12 +1270,16 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                        // Render control panel for the element:
                        if ($this->tt_contentConfig['showCommands'] && $this->doEdit) {
                                // Edit content element:
-                               $params = '&edit[tt_content][' . $this->tt_contentData['nextThree'][$row['uid']] . ']=edit';
-                               $out .= '<a class="btn btn-default" href="#" onclick="' . htmlspecialchars(BackendUtility::editOnClick(
-                                               $params,
-                                               '',
-                                               GeneralUtility::getIndpEnv('REQUEST_URI') . '#element-tt_content-' . $row['uid']
-                                       )) . '" title="' . htmlspecialchars($this->nextThree > 1
+                               $url = BackendUtility::getModuleUrl('record_edit', [
+                                       'edit' => [
+                                               'tt_content' => [
+                                                       $this->tt_contentData['nextThree'][$row['uid']] => 'edit',
+                                               ]
+                                       ],
+                                       'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI') . '#element-tt_content-' . $row['uid']
+                               ]);
+                               $out .= '<a class="btn btn-default" href="' . htmlspecialchars($url)
+                                       . '" title="' . htmlspecialchars($this->nextThree > 1
                                                ? sprintf($this->getLanguageService()->getLL('nextThree'), $this->nextThree)
                                                : $this->getLanguageService()->getLL('edit'))
                                        . '">' . $this->iconFactory->getIcon('actions-document-open', Icon::SIZE_SMALL)->render() . '</a>';
@@ -1675,15 +1735,20 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
         * @see getTable_tt_content()
         */
        public function linkEditContent($str, $row) {
-               $addButton = '';
-               $onClick = '';
                if ($this->doEdit && $this->getBackendUser()->recordEditAccessInternals('tt_content', $row)) {
-                       // Setting onclick action for content link:
-                       $onClick = BackendUtility::editOnClick('&edit[tt_content][' . $row['uid'] . ']=edit');
+                       $editUrl = BackendUtility::getModuleUrl('record_edit', [
+                               'edit' => [
+                                       'tt_content' => [
+                                               $row['uid'] => 'edit',
+                                       ]
+                               ],
+                               'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
+                       ]);
+                       // Return link
+                       return '<a href="' . htmlspecialchars($editUrl) . '" title="' . $this->getLanguageService()->getLL('edit', TRUE) . '">' . $str . '</a>';
+               } else {
+                       return $str;
                }
-               // Return link
-               return $onClick ? '<a href="#" onclick="' . htmlspecialchars($onClick)
-                       . '" title="' . $this->getLanguageService()->getLL('edit', TRUE) . '">' . $str . '</a>' . $addButton : $str;
        }
 
        /**
index 131ee94..038a626 100644 (file)
@@ -34,7 +34,6 @@ class IssueCommandViewHelper extends AbstractViewHelper implements CompilableInt
         * @param string $redirectUrl Redirect URL if any other that \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('REQUEST_URI') is wished
         *
         * @return string URL to tce_db.php + parameters
-        * @see \TYPO3\CMS\Backend\Utility\BackendUtility::editOnClick()
         * @see \TYPO3\CMS\Backend\Template\DocumentTemplate::issueCommand()
         */
        public function render($parameters, $redirectUrl = '') {
index b3a7f23..9b82e51 100644 (file)
@@ -546,12 +546,18 @@ class QueryView {
                                $out .= '<td>' . $fVnew . '</td>';
                        }
                }
-               $params = '&edit[' . $table . '][' . $row['uid'] . ']=edit';
                $out .= '<td><div class="btn-group">';
                if (!$row['deleted']) {
-                       $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
+                       $url = BackendUtility::getModuleUrl('record_edit', [
+                               'edit' => [
+                                       $table => [
+                                               $row['uid'] => 'edit'
+                                       ]
+                               ],
+                               'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI') . GeneralUtility::implodeArrayForUrl('SET', (array)GeneralUtility::_POST('SET'))
+                       ]);
                        $out .= '<a class="btn btn-default" href="#" onClick="top.launchView(\'' . $table . '\',' . $row['uid'] . ',\'' . $GLOBALS['BACK_PATH'] . '\');return false;">' . $iconFactory->getIcon('actions-document-info', Icon::SIZE_SMALL)->render() . '</a>';
-                       $out .= '<a class="btn btn-default" href="#" onClick="' . htmlspecialchars(BackendUtility::editOnClick($params, '', GeneralUtility::getIndpEnv('REQUEST_URI') . GeneralUtility::implodeArrayForUrl('SET', (array)GeneralUtility::_POST('SET')))) . '">' . $iconFactory->getIcon('actions-document-open', Icon::SIZE_SMALL)->render() . '</a>';
+                       $out .= '<a class="btn btn-default" href="' . htmlspecialchars($url) . '">' . $iconFactory->getIcon('actions-document-open', Icon::SIZE_SMALL)->render() . '</a>';
                } else {
                        $out .= '<a class="btn btn-default" href="' . GeneralUtility::linkThisUrl(BackendUtility::getModuleUrl('tce_db'), array(
                                        ('cmd[' . $table . '][' . $row['uid'] . '][undelete]') => '1',
index f564ce4..e9458bb 100644 (file)
@@ -145,10 +145,15 @@ class TranslationStatusController extends \TYPO3\CMS\Backend\Module\AbstractFunc
                                $this->iconFactory->getIcon('actions-document-view', Icon::SIZE_SMALL)->render() . '</a>';
                        $status = $data['row']['l18n_cfg'] & 1 ? 'danger' : 'success';
                        // Create links:
-                       $info = '';
-                       $editUid = $data['row']['uid'];
-                       $params = '&edit[pages][' . $editUid . ']=edit';
-                       $info .= '<a href="#" onclick="' . htmlspecialchars(BackendUtility::editOnClick($params))
+                       $editUrl = BackendUtility::getModuleUrl('record_edit', [
+                               'edit' => [
+                                       'pages' => [
+                                               $data['row']['uid'] => 'edit'
+                                       ]
+                               ],
+                               'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
+                       ]);
+                       $info = '<a href="' . htmlspecialchars($editUrl)
                                . '" title="' . $lang->sL(
                                        'LLL:EXT:frontend/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_editDefaultLanguagePage'
                                ) . '">' . $this->iconFactory->getIcon('actions-document-open', Icon::SIZE_SMALL)->render() . '</a>';
@@ -186,10 +191,16 @@ class TranslationStatusController extends \TYPO3\CMS\Backend\Module\AbstractFunc
                                                                'LLL:EXT:frontend/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_editPageLang'
                                                        ) . '">' . $info . '</a></td>';
                                                // Edit whole record:
-                                               $info = '';
-                                               $editUid = $row['uid'];
-                                               $params = '&edit[pages_language_overlay][' . $editUid . ']=edit';
-                                               $info .= '<a href="#" onclick="' . htmlspecialchars(BackendUtility::editOnClick($params))
+                                               // Create links:
+                                               $editUrl = BackendUtility::getModuleUrl('record_edit', [
+                                                       'edit' => [
+                                                               'pages_language_overlay' => [
+                                                                       $row['uid'] => 'edit'
+                                                               ]
+                                                       ],
+                                                       'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
+                                               ]);
+                                               $info = '<a href="' . htmlspecialchars($editUrl)
                                                        . '" title="' . $lang->sL(
                                                                'LLL:EXT:frontend/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_editLanguageOverlayRecord'
                                                        ) . '">' . $this->iconFactory->getIcon('actions-document-open', Icon::SIZE_SMALL)->render() . '</a>';
@@ -230,8 +241,16 @@ class TranslationStatusController extends \TYPO3\CMS\Backend\Module\AbstractFunc
                $tCells = array();
                $tCells[] = '<td>' . $lang->sL('LLL:EXT:frontend/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_page') . ':</td>';
                if (is_array($langRecUids[0])) {
-                       $params = '&edit[pages][' . implode(',', $langRecUids[0]) . ']=edit&columnsOnly=title,nav_title,l18n_cfg,hidden';
-                       $editIco = '<a href="#" onclick="' . htmlspecialchars(BackendUtility::editOnClick($params))
+                       $editUrl = BackendUtility::getModuleUrl('record_edit', [
+                               'edit' => [
+                                       'pages' => [
+                                               implode(',', $langRecUids[0]) => 'edit'
+                                       ]
+                               ],
+                               'columnsOnly' => 'title,nav_title,l18n_cfg,hidden',
+                               'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
+                       ]);
+                       $editIco = '<a href="' . htmlspecialchars($editUrl)
                                . '" title="' . $lang->sL(
                                        'LLL:EXT:frontend/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_editPageProperties'
                                ) . '">' . $this->iconFactory->getIcon('actions-document-open', Icon::SIZE_SMALL)->render() . '</a>';
@@ -247,10 +266,16 @@ class TranslationStatusController extends \TYPO3\CMS\Backend\Module\AbstractFunc
                                $tCells[] = '<td class="col-border-left">' . htmlspecialchars($langRow['title']) . '</td>';
                                // Edit language overlay records:
                                if (is_array($langRecUids[$langRow['uid']])) {
-                                       $params = '&edit[pages_language_overlay][' .
-                                               implode(',', $langRecUids[$langRow['uid']]) .
-                                               ']=edit&columnsOnly=title,nav_title,hidden';
-                                       $tCells[] = '<td><a href="#" onclick="' . htmlspecialchars(BackendUtility::editOnClick($params))
+                                       $editUrl = BackendUtility::getModuleUrl('record_edit', [
+                                               'edit' => [
+                                                       'pages_language_overlay' => [
+                                                               implode(',', $langRecUids[$langRow['uid']]) => 'edit'
+                                                       ]
+                                               ],
+                                               'columnsOnly' => 'title,nav_title,hidden',
+                                               'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
+                                       ]);
+                                       $tCells[] = '<td><a href="' . htmlspecialchars($editUrl)
                                                . '" title="' . $lang->sL(
                                                        'LLL:EXT:frontend/Resources/Private/Language/locallang_webinfo.xlf:lang_renderl10n_editLangOverlays'
                                                ) . '">' . $this->iconFactory->getIcon('actions-document-open', Icon::SIZE_SMALL)->render() . '</a></td>';
index 221ba41..cace1de 100644 (file)
@@ -473,12 +473,15 @@ class LinkValidatorReport extends \TYPO3\CMS\Backend\Module\AbstractFunctionModu
                $requestUri = GeneralUtility::getIndpEnv('REQUEST_URI') .
                        '&id=' . $this->pObj->id .
                        '&search_levels=' . $this->searchLevel;
-               $actionLink = '<a href="#" onclick="';
-               $actionLink .= htmlspecialchars(BackendUtility::editOnClick(
-                       '&edit[' . $table . '][' . $row['record_uid'] . ']=edit',
-                       '',
-                       $requestUri
-               ));
+               $url = BackendUtility::getModuleUrl('record_edit', [
+                       'edit' => [
+                               $table => [
+                                       $row['record_uid'] => 'edit'
+                               ]
+                       ],
+                       'returnUrl' => $requestUri
+               ]);
+               $actionLink = '<a href="' . htmlspecialchars($url);
                $actionLink .= '" title="' . $this->getLanguageService()->getLL('list.edit') . '">';
                $actionLink .= $iconFactory->getIcon('actions-document-open', Icon::SIZE_SMALL)->render();
                $actionLink .= '</a>';
index b7941e8..e5dd06e 100644 (file)
@@ -355,6 +355,16 @@ class VersionModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClass
                $versions = BackendUtility::selectVersionsOfRecord($this->table, $this->uid, '*', $GLOBALS['BE_USER']->workspace);
                foreach ($versions as $row) {
                        $adminLinks = $this->adminLinks($this->table, $row);
+
+                       $editUrl = BackendUtility::getModuleUrl('record_edit', [
+                               'edit' => [
+                                       $this->table => [
+                                               $row['uid'] => 'edit'
+                                       ]
+                               ],
+                               'columnsOnly' => 't3ver_label',
+                               'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
+                       ]);
                        $content .= '
                                <tr' . ($row['uid'] != $this->uid ? '' : ' class="active"') . '>
                                        <td class="col-icon">' .
@@ -374,7 +384,7 @@ class VersionModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClass
                                        <td>' . $row['t3ver_count'] . '</td>
                                        <td>' . $row['pid'] . '</td>
                                        <td>
-                                               <a href="#" onclick="' . htmlspecialchars(BackendUtility::editOnClick('&edit[' . $this->table . '][' . $row['uid'] . ']=edit&columnsOnly=t3ver_label')) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:cm.edit', TRUE) . '">
+                                               <a href="' . htmlspecialchars($editUrl) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:cm.edit', TRUE) . '">
                                                        ' . $this->iconFactory->getIcon('actions-document-open', Icon::SIZE_SMALL)->render() . '
                                                </a>' . htmlspecialchars($row['t3ver_label']) . '
                                        </td>
@@ -502,7 +512,15 @@ class VersionModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClass
         */
        public function adminLinks($table, $row) {
                // Edit link:
-               $adminLink = '<a class="btn btn-default" href="#" onclick="' . htmlspecialchars(BackendUtility::editOnClick('&edit[' . $table . '][' . $row['uid'] . ']=edit')) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:cm.edit', TRUE) . '">' . $this->iconFactory->getIcon('actions-document-open', Icon::SIZE_SMALL)->render() . '</a>';
+               $editUrl = BackendUtility::getModuleUrl('record_edit', [
+                       'edit' => [
+                               $table => [
+                                       $row['uid'] => 'edit'
+                               ]
+                       ],
+                       'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
+               ]);
+               $adminLink = '<a class="btn btn-default" href="' . htmlspecialchars($editUrl) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:cm.edit', TRUE) . '">' . $this->iconFactory->getIcon('actions-document-open', Icon::SIZE_SMALL)->render() . '</a>';
                // Delete link:
                $adminLink .= '<a class="btn btn-default" href="' . htmlspecialchars($this->doc->issueCommand('&cmd[' . $table . '][' . $row['uid'] . '][delete]=1')) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:cm.delete', TRUE) . '">' . $this->iconFactory->getIcon('actions-edit-delete', Icon::SIZE_SMALL)->render() . '</a>';
                if ($table === 'pages') {