[TASK] Use ModuleTemplate API for PageLayout 48/43348/23
authorJan Helke <typo3@helke.de>
Tue, 15 Sep 2015 15:52:02 +0000 (17:52 +0200)
committerMathias Schreiber <mathias.schreiber@wmdb.de>
Mon, 12 Oct 2015 07:16:16 +0000 (09:16 +0200)
Releases: master
Resolves: #69845
Change-Id: I7c5d007ec547c81004ec6e169f02fc3c56c40ef1
Reviewed-on: http://review.typo3.org/43348
Reviewed-by: Frans Saris <franssaris@gmail.com>
Tested-by: Frans Saris <franssaris@gmail.com>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Tested-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Build/Resources/Public/Less/Component/module.less
Build/Resources/Public/Less/TYPO3/_module_web_page.less
typo3/sysext/backend/Classes/Controller/PageLayoutController.php
typo3/sysext/backend/Classes/Template/Components/Buttons/Action/ShortcutButton.php
typo3/sysext/backend/Classes/Template/Components/Buttons/SplitButton.php
typo3/sysext/backend/Classes/Template/DocumentTemplate.php
typo3/sysext/backend/Classes/View/PageLayoutView.php
typo3/sysext/backend/Resources/Public/JavaScript/PageActions.js
typo3/sysext/backend/Resources/Public/JavaScript/ToggleSearchToolbox.js
typo3/sysext/recordlist/Classes/RecordList/AbstractDatabaseRecordList.php
typo3/sysext/t3skin/Resources/Public/Css/backend.css

index 01e9b51..96027b4 100644 (file)
 //
 .module-body {
        padding: @module-body-padding;
+       > .callout:first-child {
+               margin-top: 0;
+       }
 }
 .module-docheader + .module-body {
        padding-top: @module-docheader-height + @module-body-padding-vertical;
index b26c87e..ba50ecb 100644 (file)
@@ -34,7 +34,7 @@
        width: 100%;
 }
 .t3-grid-container {
-       margin: 0px (@page-grid-spacing * -1);
+       margin: 0px (@page-grid-spacing * -1) @line-height-computed;
 }
 .t3-grid-cell {
        background-color: @page-grid-cell-bg;
index ee0a312..5ab9c5b 100755 (executable)
@@ -21,33 +21,35 @@ use TYPO3\CMS\Backend\Form\FormDataCompiler;
 use TYPO3\CMS\Backend\Form\FormDataGroup\TcaDatabaseRecord;
 use TYPO3\CMS\Backend\Form\FormResultCompiler;
 use TYPO3\CMS\Backend\Form\NodeFactory;
+use TYPO3\CMS\Backend\Module\ModuleLoader;
+use TYPO3\CMS\Backend\Template\Components\ButtonBar;
+use TYPO3\CMS\Backend\Template\ModuleTemplate;
+use TYPO3\CMS\Backend\Tree\View\ContentLayoutPagePositionMap;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
+use TYPO3\CMS\Backend\View\BackendLayoutView;
+use TYPO3\CMS\Backend\View\PageLayoutView;
+use TYPO3\CMS\Core\DataHandling\DataHandler;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Imaging\IconFactory;
+use TYPO3\CMS\Core\Messaging\FlashMessage;
+use TYPO3\CMS\Core\Messaging\FlashMessageService;
 use TYPO3\CMS\Core\Page\PageRenderer;
 use TYPO3\CMS\Core\Type\Bitmask\Permission;
-use TYPO3\CMS\Core\Messaging\FlashMessage;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Core\Utility\HttpUtility;
 use TYPO3\CMS\Core\Utility\MathUtility;
+use TYPO3\CMS\Core\Versioning\VersionState;
 use TYPO3\CMS\Fluid\View\StandaloneView;
 use TYPO3\CMS\Fluid\ViewHelpers\Be\InfoboxViewHelper;
-use TYPO3\CMS\Recordlist\RecordList;
-use TYPO3\CMS\Core\DataHandling\DataHandler;
 use TYPO3\CMS\Frontend\Page\PageRepository;
-use TYPO3\CMS\Backend\Module\ModuleLoader;
-use TYPO3\CMS\Backend\Template\DocumentTemplate;
-use TYPO3\CMS\Backend\View\BackendLayoutView;
-use TYPO3\CMS\Core\Messaging\FlashMessageService;
-use TYPO3\CMS\Backend\View\PageLayoutView;
-use TYPO3\CMS\Backend\Tree\View\ContentLayoutPagePositionMap;
-use TYPO3\CMS\Core\Versioning\VersionState;
+use TYPO3\CMS\Recordlist\RecordList;
 
 /**
  * Script Class for Web > Layout module
  */
 class PageLayoutController
 {
+
     /**
      * Page Id for which to make the listing
      *
@@ -156,13 +158,7 @@ class PageLayoutController
     public $pageinfo;
 
     /**
-     * Document template object
-     *
-     * @var \TYPO3\CMS\Backend\Template\DocumentTemplate
-     */
-    public $doc;
 
-    /**
      * "Pseudo" Description -table name
      *
      * @var string
@@ -233,13 +229,6 @@ class PageLayoutController
     public $content;
 
     /**
-     * Function menu temporary storage
-     *
-     * @var string
-     */
-    public $topFuncMenu;
-
-    /**
      * List of column-integers accessible to the current BE user.
      * Is set from TSconfig, default is $colPosList
      *
@@ -248,13 +237,6 @@ class PageLayoutController
     public $activeColPosList;
 
     /**
-     * Markers array
-     *
-     * @var array
-     */
-    protected $markers = array();
-
-    /**
      * @var array
      */
     protected $eRParts = array();
@@ -290,6 +272,21 @@ class PageLayoutController
     protected $closeUrl;
 
     /**
+     * Caches the available languages in a colPos
+     *
+     * @var array
+     */
+    protected $languagesInColumnCache = array();
+
+    /**
+     * Caches the amount of content elements as a matrix
+     *
+     * @var array
+     * @internal
+     */
+    public $contentElementCache = array();
+
+    /**
      * @var IconFactory
      */
     protected $iconFactory;
@@ -302,6 +299,16 @@ class PageLayoutController
     protected $moduleName = 'web_layout';
 
     /**
+     * @var ModuleTemplate
+     */
+    protected $moduleTemplate;
+
+    /**
+     * @var ButtonBar
+     */
+    protected $buttonBar;
+
+    /**
      * Initializing the module
      *
      * @return void
@@ -309,11 +316,11 @@ class PageLayoutController
     public function init()
     {
         $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
+        $this->moduleTemplate = GeneralUtility::makeInstance(ModuleTemplate::class);
+        $this->buttonBar = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar();
         $this->getLanguageService()->includeLLFile('EXT:backend/Resources/Private/Language/locallang_layout.xlf');
-
         // Setting module configuration / page select clause
         $this->MCONF['name'] = $this->moduleName;
-
         $this->perms_clause = $this->getBackendUser()->getPagePermsClause(1);
         // Get session data
         $sessionData = $this->getBackendUser()->getSessionData(RecordList::class);
@@ -336,15 +343,13 @@ class PageLayoutController
         $this->getBackendUser()->setAndSaveSessionData(RecordList::class, $sessionData);
         // Load page info array:
         $this->pageinfo = BackendUtility::readPageAccess($this->id, $this->perms_clause);
+        $this->moduleTemplate->getDocHeaderComponent()->setMetaInformation($this->pageinfo);
         // Initialize menu
         $this->menuConfig();
         // Setting sys language from session var:
         $this->current_sys_language = (int)$this->MOD_SETTINGS['language'];
         // CSH / Descriptions:
         $this->descrTable = '_MOD_' . $this->moduleName;
-
-        $this->markers['SEARCHBOX'] = '';
-        $this->markers['BUTTONLIST_ADDITIONAL'] = '';
     }
 
     /**
@@ -368,11 +373,11 @@ class PageLayoutController
             )
         );
         // example settings:
-        //     $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['cms']['db_layout']['addTables']['tx_myext'] =
-        //             array ('default' => array(
-        //                             'MENU' => 'LLL:EXT:tx_myext/locallang_db.xlf:menuDefault',
-        //                             'fList' =>  'title,description,image',
-        //                             'icon' => TRUE));
+        //  $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['cms']['db_layout']['addTables']['tx_myext'] =
+        //      array ('default' => array(
+        //              'MENU' => 'LLL:EXT:tx_myext/locallang_db.xlf:menuDefault',
+        //              'fList' =>  'title,description,image',
+        //              'icon' => TRUE));
         if (is_array($this->externalTables)) {
             foreach ($this->externalTables as $table => $tableSettings) {
                 // delete the default settings from above
@@ -393,32 +398,63 @@ class PageLayoutController
                 $this->MOD_MENU['language'][$lRow['uid']] = $lRow['hidden'] ? '(' . $lRow['title'] . ')' : $lRow['title'];
             }
         }
+        // Setting alternative default label:
+        if (($this->modSharedTSconfig['properties']['defaultLanguageLabel'] || $this->modTSconfig['properties']['defaultLanguageLabel']) && isset($this->MOD_MENU['language'][0])) {
+            $this->MOD_MENU['language'][0] = $this->modTSconfig['properties']['defaultLanguageLabel'] ? $this->modSharedTSconfig['properties']['defaultLanguageLabel'] : $this->modSharedTSconfig['properties']['defaultLanguageLabel'];
+        }
+        // Clean up settings
+        $this->MOD_SETTINGS = BackendUtility::getModuleData($this->MOD_MENU, GeneralUtility::_GP('SET'), $this->moduleName);
+        // For all elements to be shown in draft workspaces & to also show hidden elements by default if user hasn't disabled the option
+        if ($this->getBackendUser()->workspace != 0 || $this->MOD_SETTINGS['tt_content_showHidden'] !== '0') {
+            $this->MOD_SETTINGS['tt_content_showHidden'] = 1;
+        }
+        $this->makeActionMenu();
+    }
+
+    /**
+     * This creates the dropdown menu with the different actions this module is able to provide.
+     * For now they are Columns, Quick Edit and Languages.
+     *
+     * @return void
+     */
+    protected function makeActionMenu()
+    {
+        $availableActionArray = array(
+            0 => $this->getLanguageService()->getLL('m_function_0'),
+            1 => $this->getLanguageService()->getLL('m_function_1'),
+            2 => $this->getLanguageService()->getLL('m_function_2')
+        );
         // Find if there are ANY languages at all (and if not, remove the language option from function menu).
         $count = $this->getDatabaseConnection()->exec_SELECTcountRows('uid', 'sys_language', $this->getBackendUser()->isAdmin() ? '' : 'hidden=0');
         if (!$count) {
-            unset($this->MOD_MENU['function']['2']);
+            unset($availableActionArray['2']);
         }
         // page/be_user TSconfig settings and blinding of menu-items
         $this->modSharedTSconfig = BackendUtility::getModTSconfig($this->id, 'mod.SHARED');
         $this->modTSconfig = BackendUtility::getModTSconfig($this->id, 'mod.' . $this->moduleName);
         if ($this->modTSconfig['properties']['QEisDefault']) {
-            ksort($this->MOD_MENU['function']);
+            ksort($availableActionArray);
         }
-        $this->MOD_MENU['function'] = BackendUtility::unsetMenuItems($this->modTSconfig['properties'], $this->MOD_MENU['function'], 'menu.function');
+        $availableActionArray = BackendUtility::unsetMenuItems($this->modTSconfig['properties'], $availableActionArray, 'menu.function');
         // Remove QuickEdit as option if page type is not...
         if (!GeneralUtility::inList($GLOBALS['TYPO3_CONF_VARS']['FE']['content_doktypes'] . ',6', $this->pageinfo['doktype'])) {
-            unset($this->MOD_MENU['function'][0]);
+            unset($availableActionArray[0]);
         }
-        // Setting alternative default label:
-        if (($this->modSharedTSconfig['properties']['defaultLanguageLabel'] || $this->modTSconfig['properties']['defaultLanguageLabel']) && isset($this->MOD_MENU['language'][0])) {
-            $this->MOD_MENU['language'][0] = $this->modTSconfig['properties']['defaultLanguageLabel'] ? $this->modSharedTSconfig['properties']['defaultLanguageLabel'] : $this->modSharedTSconfig['properties']['defaultLanguageLabel'];
-        }
-        // Clean up settings
-        $this->MOD_SETTINGS = BackendUtility::getModuleData($this->MOD_MENU, GeneralUtility::_GP('SET'), $this->moduleName);
-        // For all elements to be shown in draft workspaces & to also show hidden elements by default if user hasn't disabled the option
-        if ($this->getBackendUser()->workspace != 0 || $this->MOD_SETTINGS['tt_content_showHidden'] !== '0') {
-            $this->MOD_SETTINGS['tt_content_showHidden'] = 1;
+        $actionMenu = $this->moduleTemplate->getDocHeaderComponent()->getMenuRegistry()->makeMenu();
+        $actionMenu->setIdentifier('actionMenu');
+        $actionMenu->setLabel('');
+
+        foreach ($availableActionArray as $key => $action) {
+            $menuItem = $actionMenu
+                ->makeMenuItem()
+                ->setTitle($action)
+                ->setHref(BackendUtility::getModuleUrl($this->moduleName) . '&id=' . $this->id . '&SET[function]=' . $key);
+            if ((int)$this->MOD_SETTINGS['function'] === $key) {
+                $menuItem->setActive(true);
+            }
+            $actionMenu->addMenuItem($menuItem);
         }
+        $this->moduleTemplate->getDocHeaderComponent()->getMenuRegistry()->addMenu($actionMenu);
     }
 
     /**
@@ -445,9 +481,9 @@ class PageLayoutController
     {
         $content = '';
         $lang = $this->getLanguageService();
+
         // If page is a folder
         if ($this->pageinfo['doktype'] == PageRepository::DOKTYPE_SYSFOLDER) {
-            // Access to list module
             $moduleLoader = GeneralUtility::makeInstance(ModuleLoader::class);
             $moduleLoader->load($GLOBALS['TBE_MODULES']);
             $modules = $moduleLoader->modules;
@@ -455,7 +491,6 @@ class PageLayoutController
                 $title = $lang->getLL('goToListModule');
                 $message = '<p>' . $lang->getLL('goToListModuleMessage') . '</p>';
                 $message .= '<a class="btn btn-info" href="javascript:top.goToModule(\'web_list\',1);">' . $lang->getLL('goToListModule') . '</a>';
-
                 $view = GeneralUtility::makeInstance(StandaloneView::class);
                 $view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName('EXT:backend/Resources/Private/Templates/InfoBox.html'));
                 $view->assignMultiple(array(
@@ -469,11 +504,18 @@ class PageLayoutController
         // If content from different pid is displayed
         if ($this->pageinfo['content_from_pid']) {
             $contentPage = BackendUtility::getRecord('pages', (int)$this->pageinfo['content_from_pid']);
-            $title = BackendUtility::getRecordTitle('pages', $contentPage);
             $linkToPid = $this->local_linkThisScript(array('id' => $this->pageinfo['content_from_pid']));
             $link = '<a href="' . $linkToPid . '">' . htmlspecialchars($title) . ' (PID ' . (int)$this->pageinfo['content_from_pid'] . ')</a>';
-            $flashMessage = GeneralUtility::makeInstance(FlashMessage::class, sprintf($lang->getLL('content_from_pid_title'), $link), '', FlashMessage::INFO);
-            $content .= $flashMessage->render();
+            $title = BackendUtility::getRecordTitle('pages', $contentPage);
+            $message = sprintf($lang->getLL('content_from_pid_title'), $link);
+            $view = GeneralUtility::makeInstance(StandaloneView::class);
+            $view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName('EXT:backend/Resources/Private/Templates/InfoBox.html'));
+            $view->assignMultiple(array(
+                'title' => $title,
+                'message' => $message,
+                'state' => InfoboxViewHelper::STATE_INFO
+            ));
+            $content .= $view->render();
         }
         return $content;
     }
@@ -489,9 +531,9 @@ class PageLayoutController
                 'title',
                 'pages_language_overlay',
                 'pid = ' . (int)$this->id .
-                        ' AND sys_language_uid = ' . (int)$this->current_sys_language .
-                        BackendUtility::deleteClause('pages_language_overlay') .
-                        BackendUtility::versioningPlaceholderClause('pages_language_overlay'),
+                ' AND sys_language_uid = ' . (int)$this->current_sys_language .
+                BackendUtility::deleteClause('pages_language_overlay') .
+                BackendUtility::versioningPlaceholderClause('pages_language_overlay'),
                 '',
                 '',
                 '',
@@ -517,7 +559,7 @@ class PageLayoutController
         $this->init();
         $this->clearCache();
         $this->main();
-        $response->getBody()->write($this->content);
+        $response->getBody()->write($this->moduleTemplate->renderContent());
         return $response;
     }
 
@@ -533,50 +575,46 @@ class PageLayoutController
         // Access check...
         // The page will show only if there is a valid page and if this page may be viewed by the user
         $access = is_array($this->pageinfo) ? 1 : 0;
+        // Content
+        $content = '';
         if ($this->id && $access) {
             // Initialize permission settings:
             $this->CALC_PERMS = $this->getBackendUser()->calcPerms($this->pageinfo);
             $this->EDIT_CONTENT = $this->pageIsNotLockedForEditors();
 
-            // Start document template object:
-            $this->doc = GeneralUtility::makeInstance(DocumentTemplate::class);
-            $this->doc->setModuleTemplate('EXT:backend/Resources/Private/Templates/db_layout.html');
-
             // override the default jumpToUrl
-            $this->doc->JScodeArray['jumpToUrl'] = '
-                               function jumpToUrl(URL,formEl) {
-                                       if (document.editform && TBE_EDITOR.isFormChanged)      {       // Check if the function exists... (works in all browsers?)
-                                               if (!TBE_EDITOR.isFormChanged()) {
-                                                       window.location.href = URL;
-                                               } else if (formEl) {
-                                                       if (formEl.type=="checkbox") formEl.checked = formEl.checked ? 0 : 1;
-                                               }
-                                       } else {
-                                               window.location.href = URL;
-                                       }
-                               }
-';
-
-            $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, '', BackendUtility::BEgetRootLine($this->id)) : '') . '
-
-                               function deleteRecord(table,id,url) {   //
-                                       if (confirm(' . GeneralUtility::quoteJSvalue($lang->getLL('deleteWarning')) . ')) {
-                                               window.location.href = ' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('tce_db') . '&cmd[') . '+table+"]["+id+"][delete]=1&redirect="+escape(url)+"&vC=' . $this->getBackendUser()->veriCode() . '&prErr=1&uPT=1";
-                                       }
-                                       return false;
-                               }
-                       ');
+            $this->moduleTemplate->addJavaScriptCode('jumpToUrl', '
+                function jumpToUrl(URL,formEl) {
+                    if (document.editform && TBE_EDITOR.isFormChanged)  {   // Check if the function exists... (works in all browsers?)
+                        if (!TBE_EDITOR.isFormChanged()) {
+                            window.location.href = URL;
+                        } else if (formEl) {
+                            if (formEl.type=="checkbox") formEl.checked = formEl.checked ? 0 : 1;
+                        }
+                    } else {
+                        window.location.href = URL;
+                    }
+                }
+            ');
+            $this->moduleTemplate->addJavaScriptCode('mainJsFunctions', '
+                if (top.fsMod) {
+                    top.fsMod.recentIds["web"] = ' . (int)$this->id . ';
+                    top.fsMod.navFrameHighlightedID["web"] = "pages' . (int)$this->id . '_"+top.fsMod.currentBank; ' . (int)$this->id . ';
+                }
+                ' . ($this->popView ? BackendUtility::viewOnClick($this->id, '', BackendUtility::BEgetRootLine($this->id)) : '') . '
+                function deleteRecord(table,id,url) {   //
+                    if (confirm(' . GeneralUtility::quoteJSvalue($lang->getLL('deleteWarning')) . ')) {
+                        window.location.href = ' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('tce_db') . '&cmd[') . '+table+"]["+id+"][delete]=1&redirect="+escape(url)+"&vC=' . $this->getBackendUser()->veriCode() . '&prErr=1&uPT=1";
+                    }
+                    return false;
+                }
+            ');
+
             // Setting doc-header
-            $this->doc->form = '<form action="' . htmlspecialchars(
-                BackendUtility::getModuleUrl(
-                    $this->moduleName, array('id' => $this->id, 'imagemode' =>  $this->imagemode)
-                )) . '" method="post">';
-            // Creating the top function menu:
-            $this->topFuncMenu = BackendUtility::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function'], '', '');
-            $languageMenu = count($this->MOD_MENU['language']) > 1 ? $lang->sL('LLL:EXT:lang/locallang_general.xlf:LGL.language', true) . BackendUtility::getFuncMenu($this->id, 'SET[language]', $this->current_sys_language, $this->MOD_MENU['language'], '', '') : '';
+            $this->moduleTemplate->setForm(
+                '<form action="' . htmlspecialchars(BackendUtility::getModuleUrl($this->moduleName, array('id' => $this->id, 'imagemode' =>  $this->imagemode))) . '" method="post">'
+            );
+
             // Find backend layout / coumns
             $backendLayout = GeneralUtility::callUserFunction(BackendLayoutView::class . '->getSelectedBackendLayout', $this->id, $this);
             if (!empty($backendLayout['__colPosList'])) {
@@ -600,78 +638,42 @@ class PageLayoutController
             $this->activeColPosList = implode(',', $this->activeColPosList);
             $this->colPosList = implode(',', $this->colPosList);
 
-            $body = '';
-            $body .= $this->getHeaderFlashMessagesForCurrentPid();
+            $content .= $this->getHeaderFlashMessagesForCurrentPid();
+
+
             // Render the primary module content:
             if ($this->MOD_SETTINGS['function'] == 0) {
                 // QuickEdit
-                $body .= $this->renderQuickEdit();
+                $content .= $this->renderQuickEdit();
             } else {
                 // Page title
-                $body .= $this->doc->header($this->getLocalizedPageTitle());
+                $content .= '<h1 class="t3js-title-inlineedit">' . htmlspecialchars($this->getLocalizedPageTitle()) . '</h1>';
                 // All other listings
-                $body .= $this->renderListContent();
+                $content .= $this->renderListContent();
             }
-            // Setting up the buttons and markers for docheader
-            $docHeaderButtons = $this->getButtons($this->MOD_SETTINGS['function'] == 0 ? 'quickEdit' : '');
-            $this->markers['CSH'] = $docHeaderButtons['csh'];
-            $this->markers['TOP_FUNCTION_MENU'] = $this->topFuncMenu . $this->editSelect;
-            $this->markers['LANGSELECTOR'] = $languageMenu;
-            $this->markers['CONTENT'] = $body;
-            // Build the <body> for the module
-            $this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $this->markers);
-            // Renders the module page
-            $this->content = $this->doc->render($lang->getLL('title'), $this->content);
-        } else {
-            // If no access or id value, create empty document:
-            $this->doc = GeneralUtility::makeInstance(DocumentTemplate::class);
-            $this->doc->setModuleTemplate('EXT:backend/Resources/Private/Templates/db_layout.html');
-            $this->doc->JScode = $this->doc->wrapScriptTags('
-                               if (top.fsMod) top.fsMod.recentIds["web"] = ' . (int)$this->id . ';
-                       ');
-
-            $body = $this->doc->header($GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename']);
 
-            $title = $lang->getLL('clickAPage_header');
-            $message = $lang->getLL('clickAPage_content');
+            // Setting up the buttons for the docheader
+            $this->makeButtons($this->MOD_SETTINGS['function'] == 0 ? 'quickEdit' : '');
+            // Create LanguageMenu
+            $this->makeLanguageMenu();
 
+        } else {
+            $this->moduleTemplate->addJavaScriptCode(
+                'mainJsFunctions',
+                'if (top.fsMod) top.fsMod.recentIds["web"] = ' . (int)$this->id . ';'
+            );
+            $content .= '<h1>' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'] . '</h1>';
             $view = GeneralUtility::makeInstance(StandaloneView::class);
             $view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName('EXT:backend/Resources/Private/Templates/InfoBox.html'));
             $view->assignMultiple(array(
-                'title' => $title,
-                'message' => $message,
+                'title' => $lang->getLL('clickAPage_header'),
+                'message' => $lang->getLL('clickAPage_content'),
                 'state' => InfoboxViewHelper::STATE_INFO
             ));
-            $body .= $view->render();
-
-            // Setting up the buttons and markers for docheader
-            $docHeaderButtons = array(
-                'view' => '',
-                'history_page' => '',
-                'new_content' => '',
-                'move_page' => '',
-                'move_record' => '',
-                'new_page' => '',
-                'edit_page' => '',
-                'csh' => '',
-                'shortcut' => '',
-                'cache' => '',
-                'savedok' => '',
-                'savedokshow' => '',
-                'closedok' => '',
-                'deletedok' => '',
-                'undo' => '',
-                'history_record' => '',
-                'edit_language' => ''
-            );
-            $this->markers['CSH'] = '';
-            $this->markers['TOP_FUNCTION_MENU'] = '';
-            $this->markers['LANGSELECTOR'] = '';
-            $this->markers['CONTENT'] = $body;
-            $this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $this->markers);
-            // Renders the module page
-            $this->content = $this->doc->render($lang->getLL('title'), $this->content);
+            $content .= $view->render();
         }
+        // Set content
+        $this->moduleTemplate->setContent($content);
     }
 
     /**
@@ -684,12 +686,10 @@ class PageLayoutController
         $databaseConnection = $this->getDatabaseConnection();
         $beUser = $this->getBackendUser();
         $lang = $this->getLanguageService();
-        // 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', ['prErr' => 1, 'uPT' => 1])) . '" method="post" enctype="multipart/form-data" name="editform" onsubmit="return TBE_EDITOR.checkSubmit(1);">';
-        // Setting up the context sensitive menu:
-        $this->doc->getContextMenuCode();
+        $this->moduleTemplate->setForm(
+            '<form action="' . htmlspecialchars(BackendUtility::getModuleUrl('tce_db', ['prErr' => 1, 'uPT' => 1])) . '" method="post" enctype="multipart/form-data" name="editform" onsubmit="return TBE_EDITOR.checkSubmit(1);">'
+        );
         // Set the edit_record value for internal use in this function:
         $edit_record = $this->edit_record;
         // If a command to edit all records in a column is issue, then select all those elements, and redirect to FormEngine
@@ -713,64 +713,7 @@ class PageLayoutController
                 $edit_record = $sys_log_row['tablename'] . ':' . $sys_log_row['recuid'];
             }
         }
-        // Creating the selector box, allowing the user to select which element to edit:
-        $opt = array();
-        $is_selected = 0;
-        $languageOverlayRecord = '';
-        if ($this->current_sys_language) {
-            list($languageOverlayRecord) = BackendUtility::getRecordsByField('pages_language_overlay', 'pid', $this->id, 'AND sys_language_uid=' . (int)$this->current_sys_language);
-        }
-        if (is_array($languageOverlayRecord)) {
-            $inValue = 'pages_language_overlay:' . $languageOverlayRecord['uid'];
-            $is_selected += (int)$edit_record == $inValue;
-            $opt[] = '<option value="' . $inValue . '"' . ($edit_record == $inValue ? ' selected="selected"' : '') . '>[ ' . $lang->getLL('editLanguageHeader', true) . ' ]</option>';
-        } else {
-            $inValue = 'pages:' . $this->id;
-            $is_selected += (int)$edit_record == $inValue;
-            $opt[] = '<option value="' . $inValue . '"' . ($edit_record == $inValue ? ' selected="selected"' : '') . '>[ ' . $lang->getLL('editPageProperties', true) . ' ]</option>';
-        }
-        // Selecting all content elements from this language and allowed colPos:
-        $whereClause = 'pid=' . (int)$this->id . ' AND sys_language_uid=' . (int)$this->current_sys_language . ' AND colPos IN (' . $this->colPosList . ')' . ($this->MOD_SETTINGS['tt_content_showHidden'] ? '' : BackendUtility::BEenableFields('tt_content')) . BackendUtility::deleteClause('tt_content') . BackendUtility::versioningPlaceholderClause('tt_content');
-        if (!$this->getBackendUser()->user['admin']) {
-            $whereClause .= ' AND editlock = 0';
-        }
-        $res = $databaseConnection->exec_SELECTquery('*', 'tt_content', $whereClause, '', 'colPos,sorting');
-        $colPos = null;
-        $first = 1;
-        // Page is the pid if no record to put this after.
-        $prev = $this->id;
-        while ($cRow = $databaseConnection->sql_fetch_assoc($res)) {
-            BackendUtility::workspaceOL('tt_content', $cRow);
-            if (is_array($cRow)) {
-                if ($first) {
-                    if (!$edit_record) {
-                        $edit_record = 'tt_content:' . $cRow['uid'];
-                    }
-                    $first = 0;
-                }
-                if (!isset($colPos) || $cRow['colPos'] !== $colPos) {
-                    $colPos = $cRow['colPos'];
-                    $opt[] = '<option value=""></option>';
-                    $opt[] = '<option value="_EDIT_COL:' . $colPos . '">__' . $lang->sL(BackendUtility::getLabelFromItemlist('tt_content', 'colPos', $colPos), true) . ':__</option>';
-                }
-                $inValue = 'tt_content:' . $cRow['uid'];
-                $is_selected += (int)$edit_record == $inValue;
-                $opt[] = '<option value="' . $inValue . '"' . ($edit_record == $inValue ? ' selected="selected"' : '') . '>' . htmlspecialchars(GeneralUtility::fixed_lgd_cs(($cRow['header'] ? $cRow['header'] : '[' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.no_title') . '] ' . strip_tags($cRow['bodytext'])), $beUser->uc['titleLen'])) . '</option>';
-                $prev = -$cRow['uid'];
-            }
-        }
-        // If edit_record is not set (meaning, no content elements was found for this language) we simply set it to create a new element:
-        if (!$edit_record) {
-            $edit_record = 'tt_content:new/' . $prev . '/' . $colPos;
-            $inValue = 'tt_content:new/' . $prev . '/' . $colPos;
-            $is_selected += (int)$edit_record == $inValue;
-            $opt[] = '<option value="' . $inValue . '"' . ($edit_record == $inValue ? ' selected="selected"' : '') . '>[ ' . $lang->getLL('newLabel', 1) . ' ]</option>';
-        }
-        // If none is yet selected...
-        if (!$is_selected) {
-            $opt[] = '<option value=""></option>';
-            $opt[] = '<option value="' . $edit_record . '"  selected="selected">[ ' . $lang->getLL('newLabel', true) . ' ]</option>';
-        }
+        $edit_record = $this->makeQuickEditMenu($edit_record);
         // Splitting the edit-record cmd value into table/uid:
         $this->eRParts = explode(':', $edit_record);
         $tableName = $this->eRParts[0];
@@ -789,18 +732,6 @@ class PageLayoutController
         unset($R_URL_getvars['new_unique_uid']);
         $R_URL_getvars['edit_record'] = $edit_record;
         $this->R_URI = $R_URL_parts['path'] . '?' . GeneralUtility::implodeArrayForUrl('', $R_URL_getvars);
-        // Setting close url/return url for exiting this script:
-        // Goes to 'Columns' view if close is pressed (default)
-        $this->closeUrl = $this->local_linkThisScript(array('SET' => array('function' => 1)));
-        if ($this->returnUrl) {
-            $this->closeUrl = $this->returnUrl;
-        }
-        // Return-url for JavaScript:
-        $retUrlStr = $this->returnUrl ? '+\'&returnUrl=\'+' . GeneralUtility::quoteJSvalue(rawurlencode($this->returnUrl)) : '';
-        // Drawing the edit record selectbox
-        $this->editSelect = '<select name="edit_record" onchange="' . htmlspecialchars('jumpToUrl(' . GeneralUtility::quoteJSvalue(
-            BackendUtility::getModuleUrl($this->moduleName) . '&id=' . $this->id . '&edit_record='
-        ) . '+escape(this.options[this.selectedIndex].value)' . $retUrlStr . ',this);') . '">' . implode('', $opt) . '</select>';
 
         // Creating editing form:
         $content = '';
@@ -871,21 +802,17 @@ class PageLayoutController
                 if ($uidVal == 'new') {
                     $panel .= '<input type="hidden" name="data[' . $tableName . '][' . $row['uid'] . '][pid]" value="' . $row['pid'] . '" />';
                 }
+                $redirect = ($uidVal == 'new' ? BackendUtility::getModuleUrl(
+                    $this->moduleName,
+                    ['id' => $this->id,'new_unique_uid' => $new_unique_uid,'returnUrl' => $this->returnUrl]
+                ) : $this->R_URI);
                 $panel .= '
-                                       <input type="hidden" name="_serialNumber" value="' . md5(microtime()) . '" />
-                                       <input type="hidden" name="edit_record" value="' . $edit_record . '" />
-                                       <input type="hidden" name="redirect" value="' . htmlspecialchars(($uidVal == 'new' ? BackendUtility::getModuleUrl(
-                        $this->moduleName,
-                        array(
-                            'id' => $this->id,
-                            'new_unique_uid' => $new_unique_uid,
-                            'returnUrl' => $this->returnUrl
-                        )
-                    ) : $this->R_URI)) . '" />
-                                       ';
+                    <input type="hidden" name="_serialNumber" value="' . md5(microtime()) . '" />
+                    <input type="hidden" name="edit_record" value="' . $edit_record . '" />
+                    <input type="hidden" name="redirect" value="' . htmlspecialchars($redirect) . '" />
+                    ';
                 // Add JavaScript as needed around the form:
-                $panel = $formResultCompiler->JStop() . $panel . $formResultCompiler->printNeededJSFunctions();
-                $content = $this->doc->section('', $panel);
+                $content = $formResultCompiler->JStop() . $panel . $formResultCompiler->printNeededJSFunctions();
 
                 // Display "is-locked" message:
                 if ($command === 'edit') {
@@ -902,41 +829,40 @@ class PageLayoutController
                 }
             } catch (AccessDeniedException $e) {
                 // If no edit access, print error message:
-                $content = $this->doc->section($lang->getLL('noAccess'), $lang->getLL('noAccess_msg')
+                $content = $this->moduleTemplate->section($lang->getLL('noAccess'), $lang->getLL('noAccess_msg')
                     . '<br /><br />'
-                    . ($beUser->errorMsg ? 'Reason: ' . $beUser->errorMsg . '<br /><br />' : ''), 0, 1
-                );
+                    . ($beUser->errorMsg ? 'Reason: ' . $beUser->errorMsg . '<br /><br />' : ''), 0, 1);
             }
         } else {
             // If no edit access, print error message:
-            $content = $this->doc->section($lang->getLL('noAccess'), $lang->getLL('noAccess_msg') . '<br /><br />', 0, 1);
+            $content = $this->moduleTemplate->section($lang->getLL('noAccess'), $lang->getLL('noAccess_msg'), 0, 1);
         }
 
-        // Bottom controls (function menus):
-        $q_count = $this->getNumberOfHiddenElements();
-        if ($q_count) {
-            $h_func_b = '<div class="checkbox">' .
-                '<label for="checkTt_content_showHidden">' .
-                BackendUtility::getFuncCheck($this->id, 'SET[tt_content_showHidden]', $this->MOD_SETTINGS['tt_content_showHidden'], '', '', 'id="checkTt_content_showHidden"') .
-                (!$q_count ? ('<span class="text-muted">' . $lang->getLL('hiddenCE', true) . '</span>') : $lang->getLL('hiddenCE', true) . ' (' . $q_count . ')') .
-                '</label>' .
-                '</div>';
-
-            $content .= $this->doc->section('', $h_func_b, 0, 0);
-            $content .= $this->doc->spacer(10);
-        }
-
-        // Select element matrix:
+        // Element selection matrix:
         if ($tableName === 'tt_content' && MathUtility::canBeInterpretedAsInteger($this->eRParts[1])) {
+            $content .= '<h2>' . $lang->getLL('CEonThisPage') . '</h2>';
+            // PositionMap
             $posMap = GeneralUtility::makeInstance(ContentLayoutPagePositionMap::class);
             $posMap->cur_sys_language = $this->current_sys_language;
-            $HTMLcode = '';
-            // CSH:
-            $HTMLcode .= BackendUtility::cshItem($this->descrTable, 'quickEdit_selElement', null, '|<br />');
-            $HTMLcode .= $posMap->printContentElementColumns($this->id, $this->eRParts[1], $this->colPosList, $this->MOD_SETTINGS['tt_content_showHidden'], $this->R_URI);
-            $content .= $this->doc->spacer(20);
-            $content .= $this->doc->section($lang->getLL('CEonThisPage'), $HTMLcode, 0, 1);
-            $content .= $this->doc->spacer(20);
+            $content .= $posMap->printContentElementColumns(
+                $this->id,
+                $this->eRParts[1],
+                $this->colPosList,
+                $this->MOD_SETTINGS['tt_content_showHidden'],
+                $this->R_URI
+            );
+            // Toggle hidden ContentElements
+            $numberOfHiddenElements = $this->getNumberOfHiddenElements();
+            if ($numberOfHiddenElements) {
+                $content .= '<div class="checkbox">';
+                $content .= '<label for="checkTt_content_showHidden">';
+                $content .= BackendUtility::getFuncCheck($this->id, 'SET[tt_content_showHidden]', $this->MOD_SETTINGS['tt_content_showHidden'], '', '', 'id="checkTt_content_showHidden"');
+                $content .= (!$numberOfHiddenElements ? ('<span class="text-muted">' . $lang->getLL('hiddenCE', true) . '</span>') : $lang->getLL('hiddenCE', true) . ' (' . $numberOfHiddenElements . ')');
+                $content .= '</label>';
+                $content .= '</div>';
+            }
+            // CSH
+            $content .= BackendUtility::cshItem($this->descrTable, 'quickEdit_selElement');
         }
 
         return $content;
@@ -949,6 +875,8 @@ class PageLayoutController
      */
     public function renderListContent()
     {
+        $this->moduleTemplate->getPageRenderer()->loadJquery();
+        $this->moduleTemplate->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Backend/ClickMenu');
         /** @var $dbList \TYPO3\CMS\Backend\View\PageLayoutView */
         $dbList = GeneralUtility::makeInstance(PageLayoutView::class);
         $dbList->thumbs = $this->imagemode;
@@ -980,19 +908,21 @@ class PageLayoutController
         // Traverse the list of table names which has records on this page (that array is populated
         // by the $dblist object during the function getTableMenu()):
         foreach ($dbList->activeTables as $table => $value) {
+            $h_func = '';
             $h_func_b = '';
             if (!isset($dbList->externalTables[$table])) {
-                $q_count = $this->getNumberOfHiddenElements();
-
-                if ($q_count > 0) {
-                    $h_func_b =
-                        '<div class="checkbox">'
-                        . '<label for="checkTt_content_showHidden">'
-                        . '<input type="checkbox" id="checkTt_content_showHidden" class="checkbox" name="SET[tt_content_showHidden]" value="1" ' . ($this->MOD_SETTINGS['tt_content_showHidden'] ? 'checked="checked"' : '') . ' />'
-                        . $this->getLanguageService()->getLL('hiddenCE', true) . ' (<span class="t3js-hidden-counter">' . $q_count . '</span>)'
-                        . '</label>'
-                        . '</div>';
+                // Toggle hidden ContentElements
+                $numberOfHiddenElements = $this->getNumberOfHiddenElements();
+                if ($numberOfHiddenElements > 0) {
+                    $h_func_b = '
+                        <div class="checkbox">
+                            <label for="checkTt_content_showHidden">
+                                <input type="checkbox" id="checkTt_content_showHidden" class="checkbox" name="SET[tt_content_showHidden]" value="1" ' . ($this->MOD_SETTINGS['tt_content_showHidden'] ? 'checked="checked"' : '') . ' />
+                                ' . $this->getLanguageService()->getLL('hiddenCE', true) . ' (<span class="t3js-hidden-counter">' . $numberOfHiddenElements . '</span>)
+                            </label>
+                        </div>';
                 }
+
                 // Boolean: Display up/down arrows and edit icons for tt_content records
                 $dbList->tt_contentConfig['showCommands'] = 1;
                 // Boolean: Display info-marks or not
@@ -1025,8 +955,6 @@ class PageLayoutController
             } else {
                 if (isset($this->MOD_SETTINGS) && isset($this->MOD_MENU)) {
                     $h_func = BackendUtility::getFuncMenu($this->id, 'SET[' . $table . ']', $this->MOD_SETTINGS[$table], $this->MOD_MENU[$table], '', '');
-                } else {
-                    $h_func = '';
                 }
             }
             // Start the dblist object:
@@ -1035,11 +963,11 @@ class PageLayoutController
             $dbList->counter = $CMcounter;
             $dbList->ext_function = $this->MOD_SETTINGS['function'];
             // Render versioning selector:
-            $dbList->HTMLcode .= $this->doc->getVersionSelector($this->id);
+            $dbList->HTMLcode .= $this->moduleTemplate->getVersionSelector($this->id);
             // Generate the list of elements here:
             $dbList->generateList();
             // Adding the list content to the tableOutput variable:
-            $tableOutput[$table] = ($h_func ? $h_func . '<br /><span style="width: 1px; height: 4px; display: inline-block;"></span><br />' : '') . $dbList->HTMLcode . ($h_func_b ? '<span style="width: 1px; height: 10px; display:inline-block;"></span><br />' . $h_func_b : '');
+            $tableOutput[$table] = $h_func .  $dbList->HTMLcode . $h_func_b;
             // ... and any accumulated JavaScript goes the same way!
             $tableJSOutput[$table] = $dbList->JScode;
             // Increase global counter:
@@ -1051,7 +979,6 @@ class PageLayoutController
         }
         // END: traverse tables
         // For Context Sensitive Menus:
-        $this->doc->getContextMenuCode();
         // Init the content
         $content = '';
         // Additional header content
@@ -1064,14 +991,18 @@ class PageLayoutController
         }
         // Add the content for each table we have rendered (traversing $tableOutput variable)
         foreach ($tableOutput as $table => $output) {
-            $content .= $this->doc->section('', $output, true, true, 0, true);
-            $content .= $this->doc->sectionEnd();
+            $content .= $output;
         }
         // Making search form:
         if (!$this->modTSconfig['properties']['disableSearchBox'] && !empty($tableOutput)) {
             $this->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Backend/ToggleSearchToolbox');
-            $this->markers['BUTTONLIST_ADDITIONAL'] = '<a href="#" class="t3js-toggle-search-toolbox" title="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.title.searchIcon', true) . '">' . $this->iconFactory->getIcon('actions-search', Icon::SIZE_SMALL)->render() . '</a>';
-            $this->markers['SEARCHBOX'] = $dbList->getSearchBox(0);
+            $toggleSearchFormButton = $this->buttonBar->makeLinkButton()
+                ->setClasses('t3js-toggle-search-toolbox')
+                ->setTitle($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.title.searchIcon', true))
+                ->setIcon($this->iconFactory->getIcon('actions-search', Icon::SIZE_SMALL))
+                ->setHref('#');
+            $this->buttonBar->addButton($toggleSearchFormButton, ButtonBar::BUTTON_POSITION_LEFT, 4);
+            $content .= $dbList->getSearchBox(0);
         }
         // Additional footer content
         $footerContentHook = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/db_layout.php']['drawFooterHook'];
@@ -1085,15 +1016,21 @@ class PageLayoutController
     }
 
     /**
+     * @return ModuleTemplate
+     */
+    public function getModuleTemplate()
+    {
+        return $this->moduleTemplate;
+    }
+
+    /**
      * Print accumulated content of module
      *
      * @return void
-     * @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8
      */
     public function printContent()
     {
-        GeneralUtility::logDeprecatedFunction();
-        echo $this->content;
+        echo $this->moduleTemplate->renderContent();
     }
 
     /***************************
@@ -1102,45 +1039,47 @@ class PageLayoutController
      *
      ***************************/
     /**
-     * Create the panel of buttons for submitting the form or otherwise perform operations.
+     * This creates the buttons for die modules
      *
      * @param string $function Identifier for function of module
-     * @return array all available buttons as an assoc. array
+     * @return void
      */
-    protected function getButtons($function = '')
+    protected function makeButtons($function = '')
     {
         $lang = $this->getLanguageService();
-        $buttons = array(
-            'view' => '',
-            'history_page' => '',
-            'new_content' => '',
-            'move_page' => '',
-            'move_record' => '',
-            'new_page' => '',
-            'edit_page' => '',
-            'edit_language' => '',
-            'csh' => '',
-            'shortcut' => '',
-            'cache' => '',
-            'savedok' => '',
-            'save_close' => '',
-            'savedokshow' => '',
-            'closedok' => '',
-            'deletedok' => '',
-            'undo' => '',
-            'history_record' => ''
-        );
         // View page
         if (!VersionState::cast($this->pageinfo['t3ver_state'])->equals(VersionState::DELETE_PLACEHOLDER)) {
-            $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) . '">' . $this->iconFactory->getIcon('actions-document-view', Icon::SIZE_SMALL)->render() . '</a>';
+            $viewButton = $this->buttonBar->makeLinkButton()
+                ->setOnClick(htmlspecialchars(BackendUtility::viewOnClick($this->pageinfo['uid'], '', BackendUtility::BEgetRootLine($this->pageinfo['uid']))))
+                ->setTitle($lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.showPage', true))
+                ->setIcon($this->iconFactory->getIcon('actions-document-view', Icon::SIZE_SMALL))
+                ->setHref('#');
+
+            $this->buttonBar->addButton($viewButton, ButtonBar::BUTTON_POSITION_LEFT, 3);
         }
         // Shortcut
         if ($this->getBackendUser()->mayMakeShortcut()) {
-            $buttons['shortcut'] = $this->doc->makeShortcutIcon('id, edit_record, pointer, new_unique_uid, search_field, search_levels, showLimit', implode(',', array_keys($this->MOD_MENU)), $this->moduleName);
+            $shortcutButton = $this->buttonBar->makeShortcutButton()
+                ->setModuleName($this->moduleName)
+                ->setGetVariables([
+                    'id',
+                    'edit_record',
+                    'pointer',
+                    'new_unique_uid',
+                    'search_field',
+                    'search_levels',
+                    'showLimit'
+                ])
+                ->setSetVariables(array_keys($this->MOD_MENU));
+            $this->buttonBar->addButton($shortcutButton);
         }
         // Cache
         if (!$this->modTSconfig['properties']['disableAdvanced']) {
-            $buttons['cache'] = '<a href="' . htmlspecialchars(BackendUtility::getModuleUrl($this->moduleName, array('id' => $this->pageinfo['uid'], 'clear_cache' => '1'))) . '" title="' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.clear_cache', true) . '">' . $this->iconFactory->getIcon('actions-system-cache-clear', Icon::SIZE_SMALL)->render() . '</a>';
+            $clearCacheButton = $this->buttonBar->makeLinkButton()
+                ->setHref(BackendUtility::getModuleUrl($this->moduleName, ['id' => $this->pageinfo['uid'], 'clear_cache' => '1']))
+                ->setTitle($lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.clear_cache', true))
+                ->setIcon($this->iconFactory->getIcon('actions-system-cache-clear', Icon::SIZE_SMALL));
+            $this->buttonBar->addButton($clearCacheButton, ButtonBar::BUTTON_POSITION_RIGHT, 1, array($shortcutButton));
         }
         if (!$this->modTSconfig['properties']['disableIconToolbar']) {
             // Move record
@@ -1150,12 +1089,15 @@ class PageLayoutController
                     'uid' => $this->eRParts[1],
                     'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
                 ];
-                $buttons['move_record'] = '<a href="' . htmlspecialchars(BackendUtility::getModuleUrl('move_element', $urlParameters)) . '" title="' . $lang->getLL('move_' . ($this->eRParts[0] == 'tt_content' ? 'record' : 'page'), true) . '">' . $this->iconFactory->getIcon('actions-' . ($this->eRParts[0] == 'tt_content' ? 'document' : 'page') . '-move', Icon::SIZE_SMALL)->render() . '</a>';
+                $moveButton = $this->buttonBar->makeLinkButton()
+                    ->setHref(BackendUtility::getModuleUrl('move_element', $urlParameters))
+                    ->setTitle($lang->getLL('move_' . ($this->eRParts[0] == 'tt_content' ? 'record' : 'page'), true))
+                    ->setIcon($this->iconFactory->getIcon('actions-' . ($this->eRParts[0] == 'tt_content' ? 'document' : 'page') . '-move', Icon::SIZE_SMALL));
+                $this->buttonBar->addButton($moveButton, ButtonBar::BUTTON_POSITION_LEFT, 2);
             }
 
             // Edit page properties and page language overlay icons
             if ($this->pageIsNotLockedForEditors()) {
-
                 // Edit localized page_language_overlay only when one specific language is selected
                 if ($this->MOD_SETTINGS['function'] == 1 && $this->current_sys_language > 0) {
                     $overlayRecord = $this->getDatabaseConnection()->exec_SELECTgetSingleRow(
@@ -1170,69 +1112,76 @@ class PageLayoutController
                         '',
                         'sys_language_uid'
                     );
-
-                    $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>';
+                    $editLanguageButton = $this->buttonBar->makeLinkButton()
+                        ->setHref('#')
+                        ->setTitle($lang->getLL('editPageLanguageOverlayProperties', true))
+                        ->setOnClick(htmlspecialchars(BackendUtility::editOnClick('&edit[pages_language_overlay][' . $overlayRecord['uid'] . ']=edit')))
+                        ->setIcon($this->iconFactory->getIcon('mimetypes-x-content-page-language-overlay', Icon::SIZE_SMALL));
+                    $this->buttonBar->addButton($editLanguageButton, ButtonBar::BUTTON_POSITION_LEFT, 3);
                 }
-
-
-                // Edit page properties
-                $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>';
+                $editPageButton = $this->buttonBar->makeLinkButton()
+                    ->setHref('#')
+                    ->setTitle($lang->getLL('editPageProperties', true))
+                    ->setOnClick(htmlspecialchars(BackendUtility::editOnClick('&edit[pages][' . $this->id . ']=edit')))
+                    ->setIcon($this->iconFactory->getIcon('actions-page-open', Icon::SIZE_SMALL));
+                $this->buttonBar->addButton($editPageButton, ButtonBar::BUTTON_POSITION_LEFT, 3);
             }
 
             // Add CSH (Context Sensitive Help) icon to tool bar
+            $contextSensitiveHelpButton = $this->buttonBar->makeHelpButton()
+                ->setModuleName($this->descrTable)
+                ->setFieldName(($function === 'quickEdit' ? 'quickEdit' : 'columns_' . $this->MOD_SETTINGS['function']));
+            $this->buttonBar->addButton($contextSensitiveHelpButton);
+
+            // QuickEdit
             if ($function == 'quickEdit') {
-                $buttons['csh'] = BackendUtility::cshItem($this->descrTable, 'quickEdit');
-            } else {
-                $buttons['csh'] = BackendUtility::cshItem($this->descrTable, 'columns_' . $this->MOD_SETTINGS['function']);
-            }
-            if ($function == 'quickEdit') {
-                // Save record
-                $buttons['savedok'] = '<button class="c-inputButton" name="_savedok_x" value="1" title="' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:rm.saveDoc', true) . '">'
-                    . $this->iconFactory->getIcon('actions-document-save', Icon::SIZE_SMALL)->render()
-                    . '</button>';
-                // Save and close
-                $buttons['save_close'] = '<button class="c-inputButton" name="_saveandclosedok_x" value="1" title="' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:rm.saveCloseDoc', true) . '">'
-                    . $this->iconFactory->getIcon('actions-document-save-close', Icon::SIZE_SMALL)->render()
-                    . '</button>';
-                // Save record and show page
-                $buttons['savedokshow'] = '<a href="#" onclick="' . htmlspecialchars('document.editform.redirect.value+=\'&popView=1\'; TBE_EDITOR.checkAndDoSubmit(1); return false;') . '" title="' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:rm.saveDocShow', true) . '">'
-                    . $this->iconFactory->getIcon('actions-document-save-view', Icon::SIZE_SMALL)->render()
-                    . '</a>';
-                // Close record
-                $buttons['closedok'] = '<a href="#" onclick="' . htmlspecialchars('jumpToUrl(' . GeneralUtility::quoteJSvalue($this->closeUrl) . '); return false;') . '" title="' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:rm.closeDoc', true) . '">'
-                    . $this->iconFactory->getIcon('actions-document-close', Icon::SIZE_SMALL)->render()
-                    . '</a>';
+                // Close Record
+                $closeButton = $this->buttonBar->makeLinkButton()
+                    ->setHref('#')
+                    ->setOnClick(htmlspecialchars('jumpToUrl(' . GeneralUtility::quoteJSvalue($this->closeUrl) . '); return false;'))
+                    ->setTitle($lang->sL('LLL:EXT:lang/locallang_core.xlf:rm.closeDoc', true))
+                    ->setIcon($this->iconFactory->getIcon('actions-document-close', Icon::SIZE_SMALL));
+                $this->buttonBar->addButton($closeButton, ButtonBar::BUTTON_POSITION_LEFT, 0);
+
+                // Save Record
+                $saveButtonDropdown = $this->buttonBar->makeSplitButton();
+                $saveButton = $this->buttonBar->makeInputButton()
+                    ->setName('_savedok')
+                    ->setValue('1')
+                    ->setTitle($lang->sL('LLL:EXT:lang/locallang_core.xlf:rm.saveDoc', true))
+                    ->setIcon($this->iconFactory->getIcon('actions-document-save', Icon::SIZE_SMALL));
+                $saveButtonDropdown->addItem($saveButton);
+                $saveAndCloseButton = $this->buttonBar->makeInputButton()
+                    ->setName('_saveandclosedok')
+                    ->setValue('1')
+                    ->setOnClick('document.editform.redirect.value=\'' . $this->closeUrl . '\';')
+                    ->setTitle($lang->sL('LLL:EXT:lang/locallang_core.xlf:rm.saveCloseDoc', true))
+                    ->setIcon($this->iconFactory->getIcon('actions-document-save-close', Icon::SIZE_SMALL));
+                $saveButtonDropdown->addItem($saveAndCloseButton);
+                $saveAndShowPageButton = $this->buttonBar->makeInputButton()
+                    ->setName('_savedokview')
+                    ->setValue('1')
+                    ->setOnClick('document.editform.redirect.value+=\'&popView=1\';')
+                    ->setTitle($lang->sL('LLL:EXT:lang/locallang_core.xlf:rm.saveDocShow', true))
+                    ->setIcon($this->iconFactory->getIcon('actions-document-save-view', Icon::SIZE_SMALL));
+                $saveButtonDropdown->addItem($saveAndShowPageButton);
+                $this->buttonBar->addButton($saveButtonDropdown, ButtonBar::BUTTON_POSITION_LEFT, 1);
+
                 // Delete record
                 if ($this->deleteButton) {
-                    $buttons['deletedok'] = '<a href="#" onclick="' . htmlspecialchars('return deleteRecord(' . GeneralUtility::quoteJSvalue($this->eRParts[0]) . ',' . GeneralUtility::quoteJSvalue($this->eRParts[1]) . ',' . GeneralUtility::quoteJSvalue(GeneralUtility::getIndpEnv('SCRIPT_NAME') . '?id=' . $this->id) . ');') . '" title="' . $lang->getLL('deleteItem', true) . '">'
-                        . $this->iconFactory->getIcon('actions-edit-delete', Icon::SIZE_SMALL)->render()
-                        . '</a>';
+                    $deleteButton = $this->buttonBar->makeLinkButton()
+                        ->setHref('#')
+                        ->setOnClick(htmlspecialchars('return deleteRecord(' . GeneralUtility::quoteJSvalue($this->eRParts[0]) . ',' . GeneralUtility::quoteJSvalue($this->eRParts[1]) . ',' . GeneralUtility::quoteJSvalue(GeneralUtility::getIndpEnv('SCRIPT_NAME') . '?id=' . $this->id) . ');'))
+                        ->setTitle($lang->getLL('deleteItem', true))
+                        ->setIcon($this->iconFactory->getIcon('actions-edit-delete', Icon::SIZE_SMALL));
+                    $this->buttonBar->addButton($deleteButton, ButtonBar::BUTTON_POSITION_LEFT, 4);
                 }
+
+                // History
                 if ($this->undoButton) {
-                    // Undo button
-                    $buttons['undo'] = '<a href="#"
-                                               onclick="' . htmlspecialchars('window.location.href=' .
+                    $undoButton = $this->buttonBar->makeLinkButton()
+                        ->setHref('#')
+                        ->setOnClick(htmlspecialchars('window.location.href=' .
                             GeneralUtility::quoteJSvalue(
                                 BackendUtility::getModuleUrl(
                                     'record_history',
@@ -1243,22 +1192,27 @@ class PageLayoutController
                                         'returnUrl' => $this->R_URI,
                                     )
                                 )
-                            ) . '; return false;') . '"
-                                               title="' . htmlspecialchars(sprintf($lang->getLL('undoLastChange'), BackendUtility::calcAge($GLOBALS['EXEC_TIME'] - $this->undoButtonR['tstamp'], $lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.minutesHoursDaysYears')))) . '">' . $this->iconFactory->getIcon('actions-edit-undo', Icon::SIZE_SMALL)->render() . '</a>';
-                    // History button
-                    $buttons['history_record'] = '<a href="#"
-                                               onclick="' . htmlspecialchars('jumpToUrl(' .
+                            ) . '; return false;'))
+                        ->setTitle(htmlspecialchars(sprintf($lang->getLL('undoLastChange'), BackendUtility::calcAge($GLOBALS['EXEC_TIME'] - $this->undoButtonR['tstamp'], $lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.minutesHoursDaysYears')))))
+                        ->setIcon($this->iconFactory->getIcon('actions-edit-undo', Icon::SIZE_SMALL));
+                    $this->buttonBar->addButton($undoButton, ButtonBar::BUTTON_POSITION_LEFT, 5);
+                    $historyButton = $this->buttonBar->makeLinkButton()
+                        ->setHref('#')
+                        ->setOnClick(htmlspecialchars('jumpToUrl(' .
                             GeneralUtility::quoteJSvalue(
                                 BackendUtility::getModuleUrl(
                                     'record_history',
                                     array(
-                                        'element' => $this->eRParts[0] . ':' . $this->eRParts[1],
-                                        'returnUrl' => $this->R_URI,
-                                    )
+                                            'element' => $this->eRParts[0] . ':' . $this->eRParts[1],
+                                            'returnUrl' => $this->R_URI,
+                                        )
                                 ) . '#latest'
-                            ) . ');return false;') . '"
-                                               title="' . $lang->getLL('recordHistory', true) . '">' . $this->iconFactory->getIcon('actions-document-history-open', Icon::SIZE_SMALL)->render() . '</a>';
+                            ) . ');return false;'))
+                        ->setTitle($lang->getLL('recordHistory', true))
+                        ->setIcon($this->iconFactory->getIcon('actions-document-history-open', Icon::SIZE_SMALL));
+                    $this->buttonBar->addButton($historyButton, ButtonBar::BUTTON_POSITION_LEFT, 3);
                 }
+
             }
         }
         return $buttons;
@@ -1313,7 +1267,7 @@ class PageLayoutController
                 'sys_language.*',
                 'pages_language_overlay,sys_language',
                 'pages_language_overlay.sys_language_uid=sys_language.uid AND pages_language_overlay.pid=' . (int)$id . $exQ .
-                    BackendUtility::versioningPlaceholderClause('pages_language_overlay'),
+                BackendUtility::versioningPlaceholderClause('pages_language_overlay'),
                 'pages_language_overlay.sys_language_uid,sys_language.uid,sys_language.pid,sys_language.tstamp,sys_language.hidden,sys_language.title,sys_language.language_isocode,sys_language.static_lang_isocode,sys_language.flag',
                 'sys_language.title'
             );
@@ -1329,6 +1283,95 @@ class PageLayoutController
     }
 
     /**
+     * Get used languages in a colPos of a page
+     *
+     * @param int $pageId
+     * @param int $colPos
+     * @return bool|\mysqli_result|object
+     */
+    public function getUsedLanguagesInPageAndColumn($pageId, $colPos)
+    {
+        if (!isset($languagesInColumnCache[$pageId])) {
+            $languagesInColumnCache[$pageId] = array();
+        }
+        if (!isset($languagesInColumnCache[$pageId][$colPos])) {
+            $languagesInColumnCache[$pageId][$colPos] = array();
+        }
+
+        if (empty($languagesInColumnCache[$pageId][$colPos])) {
+            $exQ = BackendUtility::deleteClause('tt_content') .
+                ($this->getBackendUser()->isAdmin() ? '' : ' AND sys_language.hidden=0');
+
+            $databaseConnection = $this->getDatabaseConnection();
+            $res = $databaseConnection->exec_SELECTquery(
+                'sys_language.*',
+                'tt_content,sys_language',
+                'tt_content.sys_language_uid=sys_language.uid AND tt_content.colPos = ' . (int)$colPos . ' AND tt_content.pid=' . (int)$pageId . $exQ .
+                BackendUtility::versioningPlaceholderClause('tt_content'),
+                'tt_content.sys_language_uid,sys_language.uid,sys_language.pid,sys_language.tstamp,sys_language.hidden,sys_language.title,sys_language.language_isocode,sys_language.static_lang_isocode,sys_language.flag',
+                'sys_language.title'
+            );
+            while ($row = $databaseConnection->sql_fetch_assoc($res)) {
+                $languagesInColumnCache[$pageId][$colPos][$row['uid']] = $row;
+            }
+            $databaseConnection->sql_free_result($res);
+        }
+
+        return $languagesInColumnCache[$pageId][$colPos];
+    }
+
+    /**
+     * Check if a column of a page for a language is empty. Translation records are ignored here!
+     *
+     * @param int $colPos
+     * @param int $languageId
+     * @return bool
+     */
+    public function isColumnEmpty($colPos, $languageId)
+    {
+        foreach ($this->contentElementCache[$languageId][$colPos] as $uid => $row) {
+            if ((int)$row['l18n_parent'] === 0) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    /**
+     * Get elements for a column and a language
+     *
+     * @param int $pageId
+     * @param int $colPos
+     * @param int $languageId
+     * @return array
+     */
+    public function getElementsFromColumnAndLanguage($pageId, $colPos, $languageId)
+    {
+        if (!isset($this->contentElementCache[$languageId][$colPos])) {
+            $languageId = (int)$languageId;
+            $whereClause = 'tt_content.pid=' . (int)$pageId . ' AND tt_content.colPos=' . (int)$colPos . ' AND tt_content.sys_language_uid=' . $languageId . BackendUtility::deleteClause('tt_content');
+            if ($languageId > 0) {
+                $whereClause .= ' AND tt_content.l18n_parent=0 AND sys_language.uid=' . $languageId . ($this->getBackendUser()->isAdmin() ? '' : ' AND sys_language.hidden=0');
+            }
+
+            $databaseConnection = $this->getDatabaseConnection();
+            $res = $databaseConnection->exec_SELECTquery(
+                'tt_content.uid',
+                'tt_content,sys_language',
+                $whereClause
+            );
+            while ($row = $databaseConnection->sql_fetch_assoc($res)) {
+                $this->contentElementCache[$languageId][$colPos][$row['uid']] = $row;
+            }
+            $databaseConnection->sql_free_result($res);
+        }
+        if (is_array($this->contentElementCache[$languageId][$colPos])) {
+            return array_keys($this->contentElementCache[$languageId][$colPos]);
+        }
+        return array();
+    }
+
+    /**
      * Check the editlock access
      *
      * @return bool
@@ -1377,4 +1420,148 @@ class PageLayoutController
     {
         return GeneralUtility::makeInstance(PageRenderer::class);
     }
+
+    /**
+     * @param $edit_record array
+     *
+     * @return array
+     */
+    protected function makeQuickEditMenu($edit_record)
+    {
+        $lang = $this->getLanguageService();
+        $databaseConnection = $this->getDatabaseConnection();
+        $beUser = $this->getBackendUser();
+
+        $quickEditMenu = $this->moduleTemplate->getDocHeaderComponent()->getMenuRegistry()->makeMenu();
+        $quickEditMenu->setIdentifier('quickEditMenu');
+        $quickEditMenu->setLabel('');
+
+        // Setting close url/return url for exiting this script:
+        // Goes to 'Columns' view if close is pressed (default)
+        $this->closeUrl = $this->local_linkThisScript(array('SET' => array('function' => 1)));
+        if ($this->returnUrl) {
+            $this->closeUrl = $this->returnUrl;
+        }
+        $retUrlStr = $this->returnUrl ? '&returnUrl=' . rawurlencode($this->returnUrl) : '';
+
+        // Creating the selector box, allowing the user to select which element to edit:
+        $isSelected = 0;
+        $languageOverlayRecord = '';
+        if ($this->current_sys_language) {
+            list($languageOverlayRecord) = BackendUtility::getRecordsByField(
+                'pages_language_overlay',
+                'pid',
+                $this->id,
+                'AND sys_language_uid=' . (int)$this->current_sys_language
+            );
+        }
+        if (is_array($languageOverlayRecord)) {
+            $inValue = 'pages_language_overlay:' . $languageOverlayRecord['uid'];
+            $isSelected += (int)$edit_record == $inValue;
+            $menuItem = $quickEditMenu->makeMenuItem()
+                ->setTitle('[ ' . $lang->getLL('editLanguageHeader', true) . ' ]')
+                ->setHref(BackendUtility::getModuleUrl($this->moduleName) . '&id=' . $this->id . '&edit_record=' . $inValue . $retUrlStr)
+                ->setActive($edit_record == $inValue);
+            $quickEditMenu->addMenuItem($menuItem);
+        } else {
+            $inValue = 'pages:' . $this->id;
+            $isSelected += (int)$edit_record == $inValue;
+            $menuItem = $quickEditMenu->makeMenuItem()
+                ->setTitle('[ ' . $lang->getLL('editPageProperties', true) . ' ]')
+                ->setHref(BackendUtility::getModuleUrl($this->moduleName) . '&id=' . $this->id . '&edit_record=' . $inValue . $retUrlStr)
+                ->setActive($edit_record == $inValue);
+            $quickEditMenu->addMenuItem($menuItem);
+        }
+        // Selecting all content elements from this language and allowed colPos:
+        $whereClause = 'pid=' . (int)$this->id . ' AND sys_language_uid=' . (int)$this->current_sys_language . ' AND colPos IN (' . $this->colPosList . ')' . ($this->MOD_SETTINGS['tt_content_showHidden'] ? '' : BackendUtility::BEenableFields('tt_content')) . BackendUtility::deleteClause('tt_content') . BackendUtility::versioningPlaceholderClause('tt_content');
+        if (!$this->getBackendUser()->user['admin']) {
+            $whereClause .= ' AND editlock = 0';
+        }
+        $res = $databaseConnection->exec_SELECTquery('*', 'tt_content', $whereClause, '', 'colPos,sorting');
+        $colPos = null;
+        $first = 1;
+        // Page is the pid if no record to put this after.
+        $prev = $this->id;
+        while ($cRow = $databaseConnection->sql_fetch_assoc($res)) {
+            BackendUtility::workspaceOL('tt_content', $cRow);
+            if (is_array($cRow)) {
+                if ($first) {
+                    if (!$edit_record) {
+                        $edit_record = 'tt_content:' . $cRow['uid'];
+                    }
+                    $first = 0;
+                }
+                if (!isset($colPos) || $cRow['colPos'] !== $colPos) {
+                    $colPos = $cRow['colPos'];
+                    $menuItem = $quickEditMenu->makeMenuItem()
+                        ->setTitle(' ')
+                        ->setHref('#');
+                    $quickEditMenu->addMenuItem($menuItem);
+                    $menuItem = $quickEditMenu->makeMenuItem()
+                        ->setTitle('__' . $lang->sL(BackendUtility::getLabelFromItemlist('tt_content', 'colPos', $colPos), true) . ':__')
+                        ->setHref(BackendUtility::getModuleUrl($this->moduleName) . '&id=' . $this->id . '&edit_record=_EDIT_COL:' . $colPos . $retUrlStr);
+                    $quickEditMenu->addMenuItem($menuItem);
+                }
+                $inValue = 'tt_content:' . $cRow['uid'];
+                $isSelected += (int)$edit_record == $inValue;
+                $menuItem = $quickEditMenu->makeMenuItem()
+                    ->setTitle(htmlspecialchars(GeneralUtility::fixed_lgd_cs(($cRow['header'] ? $cRow['header'] : '[' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.no_title') . '] ' . strip_tags($cRow['bodytext'])), $beUser->uc['titleLen'])))
+                    ->setHref(BackendUtility::getModuleUrl($this->moduleName) . '&id=' . $this->id . '&edit_record=' . $inValue . $retUrlStr)
+                    ->setActive($edit_record == $inValue);
+                $quickEditMenu->addMenuItem($menuItem);
+                $prev = -$cRow['uid'];
+            }
+        }
+        // If edit_record is not set (meaning, no content elements was found for this language) we simply set it to create a new element:
+        if (!$edit_record) {
+            $edit_record = 'tt_content:new/' . $prev . '/' . $colPos;
+            $inValue = 'tt_content:new/' . $prev . '/' . $colPos;
+            $isSelected += (int)$edit_record == $inValue;
+            $menuItem = $quickEditMenu->makeMenuItem()
+                ->setTitle('[ ' . $lang->getLL('newLabel', 1) . ' ]')
+                ->setHref(BackendUtility::getModuleUrl($this->moduleName) . '&id=' . $this->id . '&edit_record=' . $inValue . $retUrlStr)
+                ->setActive($edit_record == $inValue);
+            $quickEditMenu->addMenuItem($menuItem);
+        }
+        // If none is yet selected...
+        if (!$isSelected) {
+            $menuItem = $quickEditMenu->makeMenuItem()
+                ->setTitle('__________')
+                ->setHref('#');
+            $quickEditMenu->addMenuItem($menuItem);
+            $menuItem = $quickEditMenu->makeMenuItem()
+                ->setTitle('[ ' . $lang->getLL('newLabel', true) . ' ]')
+                ->setHref(BackendUtility::getModuleUrl($this->moduleName) . '&id=' . $this->id . '&edit_record=' . $edit_record . $retUrlStr)
+                ->setActive($edit_record == $inValue);
+            $quickEditMenu->addMenuItem($menuItem);
+        }
+        $this->moduleTemplate->getDocHeaderComponent()->getMenuRegistry()->addMenu($quickEditMenu);
+        return $edit_record;
+    }
+
+    /**
+     * Make the LanguageMenu
+     *
+     * @return void
+     */
+    protected function makeLanguageMenu()
+    {
+        if (count($this->MOD_MENU['language']) > 1) {
+            $lang = $this->getLanguageService();
+            $languageMenu = $this->moduleTemplate->getDocHeaderComponent()->getMenuRegistry()->makeMenu();
+            $languageMenu->setIdentifier('languageMenu');
+            $languageMenu->setLabel($lang->sL('LLL:EXT:lang/locallang_general.xlf:LGL.language', true));
+            foreach ($this->MOD_MENU['language'] as $key => $language) {
+                $menuItem = $languageMenu
+                    ->makeMenuItem()
+                    ->setTitle($language)
+                    ->setHref(BackendUtility::getModuleUrl($this->moduleName) . '&id=' . $this->id . '&SET[language]=' . $key);
+                if ((int)$this->current_sys_language === $key) {
+                    $menuItem->setActive(true);
+                }
+                $languageMenu->addMenuItem($menuItem);
+            }
+            $this->moduleTemplate->getDocHeaderComponent()->getMenuRegistry()->addMenu($languageMenu);
+        }
+    }
 }
index f60910e..746bc6f 100644 (file)
@@ -195,10 +195,12 @@ class ShortcutButton implements ButtonInterface, PositionInterface
         $shortcutMarkup = $documentTemplate->makeShortcutIcon(
             implode(',', $this->getVariables),
             implode(',', $this->setVariables),
-            $this->moduleName
+            $this->moduleName,
+            '',
+            'btn btn-sm btn-default'
         );
 
-        return '<span class="btn btn-sm btn-default">' . $shortcutMarkup . '</span>';
+        return $shortcutMarkup;
     }
 
     /**
index 4b4147c..0e0a778 100644 (file)
@@ -143,7 +143,7 @@ class SplitButton extends AbstractButton implements ButtonInterface
             'value' => $items['primary']->getValue()
         ];
         if (!empty($items['primary']->getOnClick())) {
-            $attributes['onclick'] = htmlspecialchars($items['primary']->getOnClick());
+            $attributes['onclick'] = $items['primary']->getOnClick();
         }
         $attributesString = '';
         foreach ($attributes as $key => $value) {
@@ -172,7 +172,7 @@ class SplitButton extends AbstractButton implements ButtonInterface
                 $optionAttributes['class'] = htmlspecialchars($option->getClasses());
             }
             if (!empty($option->getOnClick())) {
-                $optionAttributes['onclick'] = htmlspecialchars($option->getOnClick());
+                $optionAttributes['onclick'] = $option->getOnClick();
             }
             $optionAttributesString = '';
             foreach ($optionAttributes as $key => $value) {
index 03cf3cc..f070d16 100644 (file)
@@ -652,9 +652,10 @@ function jumpToUrl(URL) {
      * @param string $setList Is the list of SET[] variables to store (if any) - SET[] variables a stored in $GLOBALS["SOBE"]->MOD_SETTINGS for backend modules
      * @param string $modName Module name string
      * @param string|int $motherModName Is used to enter the "parent module name" if the module is a submodule under eg. Web>* or File>*. You can also set this value to 1 in which case the currentLoadedModule is sent to the shortcut script (so - not a fixed value!) - that is used in file_edit and wizard_rte modules where those are really running as a part of another module.
+     * @param string $classes
      * @return string HTML content
      */
-    public function makeShortcutIcon($gvList, $setList, $modName, $motherModName = '')
+    public function makeShortcutIcon($gvList, $setList, $modName, $motherModName = '', $classes = '')
     {
         $gvList = 'route,' . $gvList;
         $storeUrl = $this->makeShortcutUrl($gvList, $setList);
@@ -678,17 +679,17 @@ function jumpToUrl(URL) {
         $shortcutUrl = $pathInfo['path'] . '?' . $storeUrl;
         $shortcutExist = BackendUtility::shortcutExists($shortcutUrl);
 
-        $icon = '<span>' . $this->iconFactory->getIcon('actions-system-shortcut-new', Icon::SIZE_SMALL)->render() . '</span>';
+        $icon = $this->iconFactory->getIcon('actions-system-shortcut-new', Icon::SIZE_SMALL)->render();
 
         if ($shortcutExist) {
-            return '<a class="active" title="">' . $icon . '</a>';
+            return '<a class="active ' . htmlspecialchars($classes) . '" title="">' . $icon . '</a>';
         }
 
         $url = GeneralUtility::quoteJSvalue(rawurlencode($shortcutUrl));
         $onClick = 'top.TYPO3.ShortcutMenu.createShortcut(' . GeneralUtility::quoteJSvalue(rawurlencode($modName)) .
             ', ' . $url . ', ' . $confirmationText . ', ' . $motherModule . ', this);return false;';
 
-        return '<a href="#" onclick="' . htmlspecialchars($onClick) . '" title="' .
+        return '<a href="#" class="' . htmlspecialchars($classes) . '" onclick="' . htmlspecialchars($onClick) . '" title="' .
             $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.makeBookmark', true) . '">' . $icon . '</a>';
     }
 
index fe729d0..28624c3 100644 (file)
@@ -34,6 +34,7 @@ use TYPO3\CMS\Fluid\View\StandaloneView;
  */
 class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRecordList
 {
+
     /**
      * If TRUE, users/groups are shown in the page info box.
      *
@@ -206,7 +207,6 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
      */
     public function __construct()
     {
-        parent::__construct();
         $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
     }
 
@@ -214,7 +214,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
      *
      * Renderings
      *
-     *****************************************/
+        *****************************************/
     /**
      * Adds the code of a single table
      *
@@ -357,21 +357,12 @@ 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))), ':')
                     );
-                    $editUrl = BackendUtility::getModuleUrl('record_edit', [
-                        'edit' => [
-                            'pages' => [
-                                $editIdList => 'edit',
-                            ]
-                        ],
-                        'columnsOnly' => $field,
-                        'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
-                    ]);
-
-                    $eI = '<a href="' . htmlspecialchars($editUrl)
+                    $eI = '<a href="#" onclick="' . htmlspecialchars(BackendUtility::editOnClick($params))
                         . '" title="' . htmlspecialchars($iTitle) . '">'
                         . $this->iconFactory->getIcon('actions-document-open', Icon::SIZE_SMALL)->render() . '</a>';
                 } else {
@@ -401,7 +392,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
             }
             // CSH:
             $out = BackendUtility::cshItem($this->descrTable, ('func_' . $pKey)) . '
-                               <div class="table-fit">
+                <div class="table-fit">
                                        <table class="table table-striped table-hover typo3-page-pages">' .
                         '<thead>' .
                             $this->addelement(1, '', $theData) .
@@ -440,7 +431,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                        PageActions.setPageId(' . (int)$this->id . ');
                        PageActions.setCanEditPage(' . ($userCanEditPage ? 'true' : 'false') . ');
                        PageActions.setLanguageOverlayId(' . $this->tt_contentConfig['languageColsPointer'] . ');
-                       PageActions.initializePageTitleRenaming();
+            PageActions.initializePageTitleRenaming();
                }');
         // Get labels for CTypes and tt_content element fields in general:
         $this->CType_labels = array();
@@ -516,8 +507,8 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                                        <div class="t3js-page-new-ce t3-page-ce-wrapper-new-ce" id="colpos-' . $key . '-' . 'page-' . $id . '-' . StringUtility::getUniqueId() . '">'
                         . $link
                     . '</div>
-                                       <div class="t3-page-ce-dropzone-available t3js-page-ce-dropzone-available"></div>
-                               </div>
+                    <div class="t3-page-ce-dropzone-available t3js-page-ce-dropzone-available"></div>
+                </div>
                                ';
                 $editUidList = '';
                 $rowArr = $contentRecordsPerColumn[$key];
@@ -571,25 +562,16 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                         if (!$disableMoveAndNewButtons && $this->getPageLayoutController()->pageIsNotLockedForEditors()) {
                             // New content element:
                             if ($this->option_newWizard) {
-                                $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')
-                                ]);
+                                $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'))) . ';';
                             } else {
-                                $url = BackendUtility::getModuleUrl('record_edit', [
-                                    'edit' => [
-                                        'tt_content' => [
-                                            -$row['uid'] => 'new',
-                                        ]
-                                    ],
-                                    'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
-                                ]);
+                                $params = '&edit[tt_content][' . -$row['uid'] . ']=new';
+                                $onClick = BackendUtility::editOnClick($params);
                             }
                             $singleElementHTML .= '
-                                                               <a href="' . htmlspecialchars($url) . '" title="'
+                                                               <a href="#" onclick="' . htmlspecialchars($onClick) . '" title="'
                                     . $this->getLanguageService()->getLL('newContentElement', true) . '" class="btn btn-default btn-sm">'
                                     . $this->iconFactory->getIcon('actions-document-new', Icon::SIZE_SMALL)->render()
                                     . ' '
@@ -608,6 +590,7 @@ 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) {
@@ -620,7 +603,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, '', $pasteP);
+                $head[$key] .= $this->tt_content_drawColHeader($colTitle, $editParam, $newP, $pasteP);
             }
             // For each column, fit the rendered content into a table cell:
             $out = '';
@@ -643,7 +626,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
             } else {
                 $backendLayout = $this->getBackendLayoutView()->getSelectedBackendLayout($this->id);
                 // GRID VIEW:
-                $grid = '<div class="t3-grid-container"><table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%" class="t3-page-columns t3-grid-table t3js-page-columns">';
+                $grid = '<div class="t3-grid-container"><table border="0" cellspacing="0" cellpadding="0" width="100%" class="t3-page-columns t3-grid-table t3js-page-columns">';
                 // Add colgroups
                 $colCount = (int)$backendLayout['__config']['backend_layout.']['colCount'];
                 $rowCount = (int)$backendLayout['__config']['backend_layout.']['rowCount'];
@@ -680,27 +663,24 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
 
                         // Draw the pre-generated header with edit and new buttons if a colPos is assigned.
                         // If not, a new header without any buttons will be generated.
-                        if (
-                            isset($columnConfig['colPos']) && $columnConfig['colPos'] !== '' && $head[$columnKey]
+                        if (isset($columnConfig['colPos']) && $columnConfig['colPos'] !== '' && $head[$columnKey]
                             && GeneralUtility::inList($this->tt_contentConfig['activeCols'], $columnConfig['colPos'])
                         ) {
                             $grid .= $head[$columnKey] . $content[$columnKey];
-                        } elseif (
-                            isset($columnConfig['colPos']) && $columnConfig['colPos'] !== ''
+                        } elseif (isset($columnConfig['colPos']) && $columnConfig['colPos'] !== ''
                             && GeneralUtility::inList($this->tt_contentConfig['activeCols'], $columnConfig['colPos'])
                         ) {
-                            $grid .= $this->tt_content_drawColHeader($this->getLanguageService()->getLL('noAccess'));
-                        } elseif (
-                            isset($columnConfig['colPos']) && $columnConfig['colPos'] !== ''
+                            $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>';
@@ -741,44 +721,25 @@ 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);
-                    $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(
+                    $params = '&edit[pages_language_overlay][' . $lpRecord['uid'] . ']=edit&overrideVals[pages_language_overlay][sys_language_uid]=' . $lP;
+                    $lPLabel = $this->getPageLayoutController()->getModuleTemplate()->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="' . htmlspecialchars($editUrl)
+                            ? '<a href="#" onclick="' . htmlspecialchars(BackendUtility::editOnClick($params))
                                 . '" 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 {
-                    $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="' . htmlspecialchars($editUrl)
+                    $params = '&edit[pages][' . $this->id . ']=edit';
+                    $lPLabel = $this->getPageLayoutController()->getModuleTemplate()->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))
                             . '" title="' . $this->getLanguageService()->getLL('edit', true) . '">'
                             . $this->iconFactory->getIcon('actions-document-open', Icon::SIZE_SMALL)->render() . '</a>'
                             : ''
@@ -811,7 +772,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                             );
                         }
                         $out .= '
-                                               <tr>
+                        <tr>
                                                        <td valign="top" class="t3-grid-cell">' . implode(('</td>' . '
                                                        <td valign="top" class="t3-grid-cell">'), $cCont) . '</td>
                                                </tr>';
@@ -820,10 +781,10 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
             }
             // Finally, wrap it all in a table and add the language selector on top of it:
             $out = $languageSelector . '
-                               <div class="t3-grid-container">
-                                       <table cellpadding="0" cellspacing="0" class="t3-page-columns t3-grid-table t3js-page-columns">
+                <div class="t3-grid-container">
+                    <table cellpadding="0" cellspacing="0" class="t3-page-columns t3-grid-table t3js-page-columns">
                                                ' . $out . '
-                                       </table>
+                    </table>
                                </div>';
             // CSH:
             $out .= BackendUtility::cshItem($this->descrTable, 'language_list');
@@ -836,7 +797,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
      *
      * Generic listing of items
      *
-     **********************************/
+        **********************************/
     /**
      * Creates a standard list of elements from a table.
      *
@@ -877,15 +838,8 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
             . '</tr>';
         // Column's titles
         if ($this->doEdit) {
-            $url = BackendUtility::getModuleUrl('record_edit', [
-                'edit' => [
-                    $table => [
-                        $this->id => 'new',
-                    ]
-                ],
-                'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
-            ]);
-            $theData['__cmds__'] = '<a href="' . htmlspecialchars($url) . '" '
+            $onClick = BackendUtility::editOnClick('&edit[' . $table . '][' . $this->id . ']=new');
+            $theData['__cmds__'] = '<a href="#" onclick="' . htmlspecialchars($onClick) . '" '
                 . 'title="' . $this->getLanguageService()->getLL('new', true) . '">'
                 . $this->iconFactory->getIcon('actions-document-new', Icon::SIZE_SMALL)->render() . '</a>';
         }
@@ -898,6 +852,7 @@ 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) {
@@ -907,15 +862,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                     $Nrow = $this->dataFields($this->fieldArray, $table, $row, $Nrow);
                     // Attach edit icon
                     if ($this->doEdit) {
-                        $url = BackendUtility::getModuleUrl('record_edit', [
-                            'edit' => [
-                                $table => [
-                                    $row['uid'] => 'edit',
-                                ]
-                            ],
-                            'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
-                        ]);
-                        $Nrow['__editIconLink__'] = '<a href="' . htmlspecialchars($url)
+                        $Nrow['__editIconLink__'] = '<a href="#" onclick="' . htmlspecialchars(BackendUtility::editOnClick($params))
                             . '" title="' . $this->getLanguageService()->getLL('edit', true) . '">'
                             . $this->iconFactory->getIcon('actions-document-open', Icon::SIZE_SMALL)->render() . '</a>';
                     } else {
@@ -971,8 +918,8 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                     // ... otherwise just render the output:
                     $out[$fieldName] = nl2br(htmlspecialchars(trim(GeneralUtility::fixed_lgd_cs(
                         BackendUtility::getProcessedValue($table, $fieldName, $row[$fieldName], 0, 0, 0, $row['uid']),
-                        250)
-                    )));
+                        250
+                    ))));
                 }
             } else {
                 // Each field is separated by <br /> and shown in the same cell (If not a TCA field, then explode
@@ -982,12 +929,12 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                 foreach ($theFields as $fName2) {
                     if ($GLOBALS['TCA'][$table]['columns'][$fName2]) {
                         $out[$fieldName] .= '<strong>' . $this->getLanguageService()->sL(
-                                $GLOBALS['TCA'][$table]['columns'][$fName2]['label'],
-                                true
-                            ) . '</strong>' . '&nbsp;&nbsp;' . htmlspecialchars(GeneralUtility::fixed_lgd_cs(
-                                BackendUtility::getProcessedValue($table, $fName2, $row[$fName2], 0, 0, 0, $row['uid']),
-                                25
-                            )) . '<br />';
+                            $GLOBALS['TCA'][$table]['columns'][$fName2]['label'],
+                            true
+                        ) . '</strong>' . '&nbsp;&nbsp;' . htmlspecialchars(GeneralUtility::fixed_lgd_cs(
+                            BackendUtility::getProcessedValue($table, $fName2, $row[$fName2], 0, 0, 0, $row['uid']),
+                            25
+                        )) . '<br />';
                     }
                 }
             }
@@ -1053,7 +1000,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
      *
      * Additional functions; Pages
      *
-     **********************************/
+        **********************************/
     /**
      * Adds pages-rows to an array, selecting recursively in the page tree.
      *
@@ -1123,15 +1070,9 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                     break;
                 case 'uid':
                     if ($this->getBackendUser()->doesUserHaveAccess($row, 2)) {
-                        $url = BackendUtility::getModuleUrl('record_edit', [
-                            'edit' => [
-                                'pages' => [
-                                    $row['uid'] => 'edit',
-                                ]
-                            ],
-                            'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
-                        ]);
-                        $eI = '<a href="' . htmlspecialchars($url)
+                        $params = '&edit[pages][' . $row['uid'] . ']=edit';
+                        $eI = '<a href="#" onclick="'
+                            . htmlspecialchars(BackendUtility::editOnClick($params))
                             . '" title="' . $this->getLanguageService()->getLL('editThisPage', true) . '">'
                             . $this->iconFactory->getIcon('actions-document-open', Icon::SIZE_SMALL)->render() . '</a>';
                     } else {
@@ -1178,7 +1119,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
      *
      * Additional functions; Content Elements
      *
-     **********************************/
+        **********************************/
     /**
      * Draw header for a content element column:
      *
@@ -1188,7 +1129,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:
@@ -1286,23 +1227,18 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
             // Render control panel for the element:
             if ($this->tt_contentConfig['showCommands'] && $this->doEdit) {
                 // Edit content element:
-                $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
+                $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
                         ? sprintf($this->getLanguageService()->getLL('nextThree'), $this->nextThree)
                         : $this->getLanguageService()->getLL('edit'))
                     . '">' . $this->iconFactory->getIcon('actions-document-open', Icon::SIZE_SMALL)->render() . '</a>';
                 // Hide element:
                 $hiddenField = $GLOBALS['TCA']['tt_content']['ctrl']['enablecolumns']['disabled'];
-                if (
-                    $hiddenField && $GLOBALS['TCA']['tt_content']['columns'][$hiddenField]
+                if ($hiddenField && $GLOBALS['TCA']['tt_content']['columns'][$hiddenField]
                     && (!$GLOBALS['TCA']['tt_content']['columns'][$hiddenField]['exclude']
                         || $this->getBackendUser()->check('non_exclude_fields', 'tt_content:' . $hiddenField))
                 ) {
@@ -1315,7 +1251,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                     }
                     $params = '&data[tt_content][' . ($row['_ORIG_uid'] ? $row['_ORIG_uid'] : $row['uid'])
                         . '][' . $hiddenField . ']=' . $value;
-                    $out .= '<a class="btn btn-default" href="' . htmlspecialchars($this->getPageLayoutController()->doc->issueCommand($params))
+                    $out .= '<a class="btn btn-default" href="' . htmlspecialchars($this->getPageLayoutController()->getModuleTemplate()->issueCommand($params))
                         . '" title="' . $this->getLanguageService()->getLL($label, true) . '">'
                         . $this->iconFactory->getIcon('actions-edit-' . strtolower($label), Icon::SIZE_SMALL)->render() . '</a>';
                 }
@@ -1323,9 +1259,8 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                 $params = '&cmd[tt_content][' . $row['uid'] . '][delete]=1';
                 $confirm = $this->getLanguageService()->getLL('deleteWarning')
                     . BackendUtility::translationCount('tt_content', $row['uid'], (' '
-                    . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.translationsOfRecord'))
-                );
-                $out .= '<a class="btn btn-default t3js-modal-trigger" href="' . htmlspecialchars($this->getPageLayoutController()->doc->issueCommand($params)) . '"'
+                    . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.translationsOfRecord')));
+                $out .= '<a class="btn btn-default t3js-modal-trigger" href="' . htmlspecialchars($this->getPageLayoutController()->getModuleTemplate()->issueCommand($params)) . '"'
                     . ' data-severity="warning"'
                     . ' data-title="' . htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:lang/locallang_alt_doc.xlf:label.confirm.delete_record.title')) . '"'
                     . ' data-content="' . htmlspecialchars($confirm) . '" '
@@ -1342,7 +1277,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                     if ($this->tt_contentData['prev'][$row['uid']]) {
                         $params = '&cmd[tt_content][' . $row['uid'] . '][move]=' . $this->tt_contentData['prev'][$row['uid']];
                         $moveButtonContent .= '<a class="btn btn-default" href="'
-                            . htmlspecialchars($this->getPageLayoutController()->doc->issueCommand($params))
+                            . htmlspecialchars($this->getPageLayoutController()->getModuleTemplate()->issueCommand($params))
                             . '" title="' . $this->getLanguageService()->getLL('moveUp', true) . '">'
                             . $this->iconFactory->getIcon('actions-move-up', Icon::SIZE_SMALL)->render() . '</a>';
                         if (!$dragDropEnabled) {
@@ -1355,7 +1290,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                     if ($this->tt_contentData['next'][$row['uid']]) {
                         $params = '&cmd[tt_content][' . $row['uid'] . '][move]= ' . $this->tt_contentData['next'][$row['uid']];
                         $moveButtonContent .= '<a class="btn btn-default" href="'
-                            . htmlspecialchars($this->getPageLayoutController()->doc->issueCommand($params))
+                            . htmlspecialchars($this->getPageLayoutController()->getModuleTemplate()->issueCommand($params))
                             . '" title="' . $this->getLanguageService()->getLL('moveDown', true) . '">'
                             . $this->iconFactory->getIcon('actions-move-down', Icon::SIZE_SMALL)->render() . '</a>';
                         if (!$dragDropEnabled) {
@@ -1390,7 +1325,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
         // NOTE: end-tag for <div class="t3-page-ce-body"> is in getTable_tt_content()
         return '<div class="t3-page-ce-header ' . ($this->getBackendUser()->user['admin'] || ((int)$row['editlock'] === 0 && (int)$this->pageinfo['editlock'] === 0)  ? 't3-page-ce-header-draggable t3js-page-ce-draghandle' : '') . '">
                                        <div class="t3-page-ce-header-icons-left">' . implode('', $additionalIcons) . '</div>
-                                       <div class="t3-page-ce-header-icons-right">' . ($out ? '<div class="btn-toolbar">' . $out . '</div>' : '') . '</div>
+                                       <div class="t3-page-ce-header-icons-right">' . ($out ? '<div class="btn-toolbar">' .$out . '</div>' : '') . '</div>
                                </div>
                                <div class="t3-page-ce-body">';
     }
@@ -1509,8 +1444,14 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                             $shortcutRecord = BackendUtility::getRecord($tableName, $split[1]);
                             if (is_array($shortcutRecord)) {
                                 $icon = $this->iconFactory->getIconForRecord($tableName, $shortcutRecord, Icon::SIZE_SMALL)->render();
-                                $icon = $this->getPageLayoutController()->doc->wrapClickMenuOnIcon($icon, $tableName,
-                                    $shortcutRecord['uid'], 1, '', '+copy,info,edit,view');
+                                $icon = $this->getPageLayoutController()->getModuleTemplate()->wrapClickMenuOnIcon(
+                                    $icon,
+                                    $tableName,
+                                    $shortcutRecord['uid'],
+                                    1,
+                                    '',
+                                    '+copy,info,edit,view'
+                                );
                                 $shortcutContent[] = $icon
                                     . htmlspecialchars(BackendUtility::getRecordTitle($tableName, $shortcutRecord));
                             }
@@ -1554,9 +1495,9 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                         $out .= '<strong>' . $this->getLanguageService()->getLL('noPluginSelected') . '</strong>';
                     }
                     $out .= $this->getLanguageService()->sL(
-                            BackendUtility::getLabelFromItemlist('tt_content', 'pages', $row['pages']),
-                            true
-                        ) . '<br />';
+                        BackendUtility::getLabelFromItemlist('tt_content', 'pages', $row['pages']),
+                        true
+                    ) . '<br />';
                     break;
                 default:
                     $contentType = $this->CType_labels[$row['CType']];
@@ -1619,7 +1560,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
         foreach ($uidList as $uid) {
             $uid = (int)$uid;
             $record = BackendUtility::getRecord($table, $uid, 'title');
-            $content .= '<br>' . $record['title'] . ' (' . $uid . ')';
+            $content .= '<br>' . $record['title'] . ' (' .$uid. ')';
         }
         return $content;
     }
@@ -1674,7 +1615,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
         foreach ($this->getLanguagesToCopyFrom(GeneralUtility::_GP('id'), $lP, $colPos) as $languageId => $label) {
             $elementsInColumn = $languageId === 0 ? $defLanguageCount : $this->getElementsFromColumnAndLanguage(GeneralUtility::_GP('id'), $colPos, $languageId);
             if (!empty($elementsInColumn)) {
-                $onClick = 'window.location.href=' . GeneralUtility::quoteJSvalue($this->getPageLayoutController()->doc->issueCommand('&cmd[tt_content][' . implode(',', $elementsInColumn) . '][copyFromLanguage]=' . GeneralUtility::_GP('id') . ',' . $lP)) . '; return false;';
+                $onClick = 'window.location.href=' . GeneralUtility::quoteJSvalue($this->getPageLayoutController()->getModuleTemplate()->issueCommand('&cmd[tt_content][' . implode(',', $elementsInColumn) . '][copyFromLanguage]=' . GeneralUtility::_GP('id') . ',' . $lP)) . '; return false;';
                 $copyFromLanguageMenu .= '<li><a href="#" onclick="' . htmlspecialchars($onClick) . '">' . $this->languageFlag($languageId, false) . ' ' . htmlspecialchars($label) . '</a></li>' . LF;
             }
         }
@@ -1692,13 +1633,14 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
             }
 
             // We have content in the default language, create a split button
-            $onClick = 'window.location.href=' . GeneralUtility::quoteJSvalue($this->getPageLayoutController()->doc->issueCommand($params)) . '; return false;';
+            $onClick = 'window.location.href=' . GeneralUtility::quoteJSvalue($this->getPageLayoutController()->getModuleTemplate()->issueCommand($params)) . '; return false;';
             $theNewButton =
-                '<div class="btn-group">'
-                    . $this->getPageLayoutController()->doc->t3Button(
-                        $onClick,
-                        $this->getLanguageService()->getLL('newPageContent_copyForLang', true) . ' [' . count($defLanguageCount) . ']'
-                    );
+                '<div class="btn-group">
+                    <input
+                        class="btn btn-default"
+                                               type="submit" onclick="' . htmlspecialchars($onClick) . '; return false;"
+                                               value="' . htmlspecialchars($this->getLanguageService()->getLL('newPageContent_copyForLang', true) . ' [' . count($defLanguageCount) . ']') . '"
+                                       />';
             if ($copyFromLanguageMenu !== '' && $this->isColumnEmpty($colPos, $lP)) {
                 $theNewButton .= '<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">'
                     . '<span class="caret"></span>'
@@ -1757,20 +1699,15 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
      */
     public function linkEditContent($str, $row)
     {
+        $addButton = '';
+        $onClick = '';
         if ($this->doEdit && $this->getBackendUser()->recordEditAccessInternals('tt_content', $row)) {
-            $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;
+            // Setting onclick action for content link:
+            $onClick = BackendUtility::editOnClick('&edit[tt_content][' . $row['uid'] . ']=edit');
         }
+        // Return link
+        return $onClick ? '<a href="#" onclick="' . htmlspecialchars($onClick)
+            . '" title="' . $this->getLanguageService()->getLL('edit', true) . '">' . $str . '</a>' . $addButton : $str;
     }
 
     /**
@@ -1994,7 +1931,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
             // If any languages are left, make selector:
             if (count($langSelItems) > 1) {
                 $url = BackendUtility::getModuleUrl('record_edit', array(
-                    'edit[pages_language_overlay][' . $id . ']' => 'new',
+                    'edit[pages_language_overlay]['. $id . ']' => 'new',
                     'overrideVals[pages_language_overlay][doktype]' => (int)$this->pageRecord['doktype'],
                     'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
                 ));
@@ -2039,7 +1976,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
      *
      * Various helper functions
      *
-     ********************************/
+        ********************************/
 
     /**
      * Initializes the clipboard for generating paste links
@@ -2150,7 +2087,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
         $this->counter++;
         // The icon with link
         if ($this->getBackendUser()->recordEditAccessInternals($table, $row)) {
-            $icon = $this->getPageLayoutController()->doc->wrapClickMenuOnIcon($icon, $table, $row['uid']);
+            $icon = $this->getPageLayoutController()->getModuleTemplate()->wrapClickMenuOnIcon($icon, $table, $row['uid']);
         }
         return $icon;
     }
@@ -2242,7 +2179,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
      *
      * External renderings
      *
-     *****************************************/
+        *****************************************/
 
     /**
      * Creates a menu of the tables that can be listed by this function
@@ -2284,7 +2221,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                     // ... and to the internal array, activeTables we also add table icon and title (for use elsewhere)
                     $title = $this->getLanguageService()->sL($GLOBALS['TCA'][$tName]['ctrl']['title'], true)
                         . ': ' . $c . ' ' . $this->getLanguageService()->getLL('records', true);
-                    $this->activeTables[$tName] = '<span title="' . $title . '">'
+                    $this->activeTables[$tName] = '<span title="' . $title. '">'
                         . $this->iconFactory->getIconForRecord($tName, array(), Icon::SIZE_SMALL)->render()
                         . '</span>'
                         . '&nbsp;' . $this->getLanguageService()->sL($GLOBALS['TCA'][$tName]['ctrl']['title'], true);
@@ -2293,12 +2230,12 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
         }
         // Wrap cells in table tags:
         $out = '
-                       <!--
-                               Menu of tables on the page (table menu)
-                       -->
-                       <table border="0" cellpadding="0" cellspacing="0" id="typo3-page-tblMenu">
+            <!--
+                Menu of tables on the page (table menu)
+            -->
+            <table border="0" cellpadding="0" cellspacing="0" id="typo3-page-tblMenu">
                                <tr>' . $out . '
-                               </tr>
+                </tr>
                        </table>';
         // Return the content:
         return $out;
index 1ff10fe..ca21caf 100644 (file)
@@ -102,15 +102,15 @@ define('TYPO3/CMS/Backend/PageActions', ['jquery'], function($) {
         */
        PageActions.editPageTitle = function() {
                var $inputFieldWrap = $(
-                               '<form class="row">' +
-                                       '<div class="col-lg-4 col-md-6 col-sm-12">' +
-                                               '<div class="input-group">' +
+                               '<form>' +
+                                       '<div class="form-group">' +
+                                               '<div class="input-group input-group-lg">' +
                                                        '<input class="form-control">' +
                                                        '<span class="input-group-btn">' +
-                                                               '<button class="btn btn-default" type="button" data-action="submit"><span class="t3-icon fa fa-floppy-o"></span></button>' +
+                                                               '<button class="btn btn-default" type="button" data-action="submit"><span class="t3-icon fa fa-floppy-o"></span></button> ' +
                                                        '</span>' +
                                                        '<span class="input-group-btn">' +
-                                                               '<button class="btn btn-danger" type="button" data-action="cancel"><span class="t3-icon fa fa-times"></span></button>' +
+                                                               '<button class="btn btn-default" type="button" data-action="cancel"><span class="t3-icon fa fa-times"></span></button> ' +
                                                        '</span>' +
                                                '</div>' +
                                        '</div>' +
index 7acca7f..a92477d 100644 (file)
  * The TYPO3 project - inspiring people to share!
  */
 
-define('TYPO3/CMS/Backend/ToggleSearchToolbox', ['jquery', 'TYPO3/CMS/Backend/jquery.clearable'], function($) {
-       $(document).ready(function() {
+/**
+ * Toggle the search toolbox
+ */
+define('TYPO3/CMS/Backend/ToggleSearchToolbox', ['jquery', 'TYPO3/CMS/Backend/DocumentHeader', 'TYPO3/CMS/Backend/jquery.clearable'], function($, DocumentHeader) {
+       "use strict";
+
+       $(function() {
                var $toolbar = $('#db_list-searchbox-toolbar');
                $('.t3js-toggle-search-toolbox').on('click', function() {
                        $toolbar.toggle();
-
+                       DocumentHeader.reposition();
                        if ($toolbar.is(':visible')) {
                                $('#search_field').focus();
                        }
@@ -26,14 +31,12 @@ define('TYPO3/CMS/Backend/ToggleSearchToolbox', ['jquery', 'TYPO3/CMS/Backend/jq
                var searchResultShown = ('' !== $searchFields.val());
 
                // make search field clearable
-               $searchFields.clearable(
-                       {
-                               onClear: function() {
-                                       if (searchResultShown) {
-                                               $(this).closest('form').submit();
-                                       }
+               $searchFields.clearable({
+                       onClear: function() {
+                               if (searchResultShown) {
+                                       $(this).closest('form').submit();
                                }
                        }
-               );
+               });
        });
-});
\ No newline at end of file
+});
index cc97fc3..bd0d08f 100644 (file)
@@ -35,6 +35,7 @@ use TYPO3\CMS\Core\Utility\MathUtility;
  */
 class AbstractDatabaseRecordList extends AbstractRecordList
 {
+
     /**
      * Specify a list of tables which are the only ones allowed to be displayed.
      *
@@ -555,31 +556,31 @@ class AbstractDatabaseRecordList extends AbstractRecordList
         // Table with the search box:
         $content = '<div class="db_list-searchbox-form db_list-searchbox-toolbar module-docheader-bar module-docheader-bar-search t3js-module-docheader-bar t3js-module-docheader-bar-search" id="db_list-searchbox-toolbar" style="display: ' . ($this->searchString == '' ? 'none' : 'block') . ';">
                        ' . $formElements[0] . '
-                               <div id="typo3-dblist-search">
-                                       <div class="panel panel-default">
-                                               <div class="panel-body">
-                                                       <div class="form-inline form-inline-spaced">
-                                                               <div class="form-group">
+                <div id="typo3-dblist-search">
+                    <div class="panel panel-default">
+                        <div class="panel-body">
+                            <div class="form-inline form-inline-spaced">
+                                <div class="form-group">
                                                                        <input class="form-control" type="search" placeholder="' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.enterSearchString', true) . '" title="' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.title.searchString', true) . '" name="search_field" id="search_field" value="' . htmlspecialchars($this->searchString) . '" />
-                                                               </div>
-                                                               <div class="form-group">
+                                </div>
+                                <div class="form-group">
                                                                        <label for="search_levels">' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.label.search_levels', true) . ': </label>
                                                                        ' . $lMenu . '
-                                                               </div>
-                                                               <div class="form-group">
+                                </div>
+                                <div class="form-group">
                                                                        <label for="showLimit">' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.label.limit', true) . ': </label>
                                                                        <input class="form-control" type="number" min="0" max="10000" placeholder="10" title="' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.title.limit', true) . '" name="showLimit" id="showLimit" value="' . htmlspecialchars(($this->showLimit ? $this->showLimit : '')) . '" />
-                                                               </div>
-                                                               <div class="form-group">
+                                </div>
+                                <div class="form-group">
                                                                        <button type="submit" class="btn btn-default" name="search" title="' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.title.search', true) . '">
                                                                                ' . $iconFactory->getIcon('actions-search', Icon::SIZE_SMALL)->render() . ' ' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.search', true) . '
-                                                                       </button>
-                                                               </div>
-                                                       </div>
-                                               </div>
-                                       </div>
-                               </div>
-                       ' . $formElements[1] . '</div></div>';
+                                    </button>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+                       ' . $formElements[1] . '</div>';
         return $content;
     }
 
@@ -587,7 +588,7 @@ class AbstractDatabaseRecordList extends AbstractRecordList
      *
      * Various helper functions
      *
-     ******************************/
+        ******************************/
     /**
      * Setting the field names to display in extended list.
      * Sets the internal variable $this->setFields
@@ -728,12 +729,11 @@ class AbstractDatabaseRecordList extends AbstractRecordList
                                     $condition = '(' . $condition . ' AND ' . $tablePidField . '=' . $currentPid . ')';
                                 }
                                 $whereParts[] = $condition;
-                            } elseif (
-                                $fieldConfig['type'] == 'text' ||
+                            } elseif ($fieldConfig['type'] == 'text' ||
                                 $fieldConfig['type'] == 'flex' ||
                                 ($fieldConfig['type'] == 'input' && (!$fieldConfig['eval'] || !preg_match('/date|time|int/', $fieldConfig['eval'])))) {
-                                $condition = $fieldName . ' LIKE \'%' . $this->searchString . '%\'';
-                                $whereParts[] = $condition;
+                                    $condition = $fieldName . ' LIKE \'%' . $this->searchString . '%\'';
+                                    $whereParts[] = $condition;
                             }
                         }
                     }
@@ -833,7 +833,9 @@ class AbstractDatabaseRecordList extends AbstractRecordList
         // If the title is blank, make a "no title" label:
         if ((string)$code === '') {
             $code = '<i>[' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.no_title', 1) . ']</i> - ' . htmlspecialchars(GeneralUtility::fixed_lgd_cs(
-                        BackendUtility::getRecordTitle($table, $row), $this->getBackendUserAuthentication()->uc['titleLen']));
+                BackendUtility::getRecordTitle($table, $row),
+                $this->getBackendUserAuthentication()->uc['titleLen']
+            ));
         } else {
             $code = htmlspecialchars(GeneralUtility::fixed_lgd_cs($code, $this->fixedL), ENT_QUOTES, 'UTF-8', false);
             if ($code != htmlspecialchars($origCode)) {
@@ -859,7 +861,8 @@ class AbstractDatabaseRecordList extends AbstractRecordList
                 // "Show" link (only pages and tt_content elements)
                 if ($table == 'pages' || $table == 'tt_content') {
                     $code = '<a href="#" onclick="' . htmlspecialchars(
-                            BackendUtility::viewOnClick(($table == 'tt_content' ? $this->id . '#' . $row['uid'] : $row['uid']))) . '" title="' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.showPage', true) . '">' . $code . '</a>';
+                        BackendUtility::viewOnClick(($table == 'tt_content' ? $this->id . '#' . $row['uid'] : $row['uid']))
+                    ) . '" title="' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.showPage', true) . '">' . $code . '</a>';
                 }
                 break;
             case 'info':
@@ -949,7 +952,7 @@ class AbstractDatabaseRecordList extends AbstractRecordList
 
         $urlParameters = array_merge_recursive($urlParameters, $this->overrideUrlParameters);
 
-        return $this->getThisScript() . ltrim(GeneralUtility::implodeArrayForUrl('', $urlParameters), '&');
+        return BackendUtility::getModuleUrl(GeneralUtility::_GP('M'), $urlParameters);
     }
 
     /**
index 9fc7cb1..5e71bf1 100644 (file)
@@ -7945,6 +7945,9 @@ button.close {
 .module-body {
   padding: 24px 24px;
 }
+.module-body > .callout:first-child {
+  margin-top: 0;
+}
 .module-docheader + .module-body {
   padding-top: 89px;
 }
@@ -12791,7 +12794,7 @@ iframe {
   width: 100%;
 }
 .t3-grid-container {
-  margin: 0px -10px;
+  margin: 0px -10px 18px;
 }
 .t3-grid-cell {
   background-color: #fafafa;