diff --git a/Build/Resources/Public/Less/Component/module.less b/Build/Resources/Public/Less/Component/module.less index 7b9210b3f9777732ac645f755943edc2c35a3801..dd59ac1139d10864f2dd7f8f917955edaa010f04 100644 --- a/Build/Resources/Public/Less/Component/module.less +++ b/Build/Resources/Public/Less/Component/module.less @@ -50,7 +50,7 @@ width: 100%; top: 0; left: 0; - height: @module-docheader-height; + min-height: @module-docheader-height; z-index: @module-docheader-zindex; background-color: @module-docheader-bg; border-bottom: 1px solid @module-docheader-border; @@ -58,7 +58,7 @@ .transition(margin-top 0.3s ease-in-out); .module-docheader-bar { .clearfix; - height: @module-docheader-bar-height; + min-height: @module-docheader-bar-height; margin: @module-docheader-bar-margin; line-height: @module-docheader-bar-height; label { diff --git a/Build/Resources/Public/Less/TYPO3/_element_table.less b/Build/Resources/Public/Less/TYPO3/_element_table.less index 7d5fcaea379b2202275aa2e6780910a0631cebf6..0facac699ef852bc466fd0ec621bc4677939ac00 100644 --- a/Build/Resources/Public/Less/TYPO3/_element_table.less +++ b/Build/Resources/Public/Less/TYPO3/_element_table.less @@ -44,6 +44,8 @@ // Revert Bootstrap @table-bg in order to allow ExtJS and dataTable <table> table { background: transparent; + font-size: inherit; + line-height: inherit; } // diff --git a/typo3/sysext/backend/Resources/Private/Partials/ButtonBar.html b/typo3/sysext/backend/Resources/Private/Partials/ButtonBar.html index f1b5b7195421abf07b277a718f089ded126ca9fc..188d4ce7cbc4cc0aea08c418f9d90aadaf57da16 100644 --- a/typo3/sysext/backend/Resources/Private/Partials/ButtonBar.html +++ b/typo3/sysext/backend/Resources/Private/Partials/ButtonBar.html @@ -1,9 +1,16 @@ <div class="btn-toolbar" role="toolbar" aria-label=""> <f:for each="{buttons}" as="buttonGroup"> - <div class="btn-group" role="group" aria-label=""> - <f:for each="{buttonGroup}" as="button"> - {button} - </f:for> - </div> + <f:if condition="{buttonGroup -> f:count()} > 1"> + <f:then> + <div class="btn-group" role="group" aria-label=""> + <f:for each="{buttonGroup}" as="button"> + {button} + </f:for> + </div> + </f:then> + <f:else> + {buttonGroup.0} + </f:else> + </f:if> </f:for> </div> \ No newline at end of file diff --git a/typo3/sysext/info/Classes/Controller/InfoModuleController.php b/typo3/sysext/info/Classes/Controller/InfoModuleController.php index d195c8ef4455824ad8c9865a2f77f3675b10d5f3..6addf07b6818f9d2840da7d6b5e38179536b4468 100644 --- a/typo3/sysext/info/Classes/Controller/InfoModuleController.php +++ b/typo3/sysext/info/Classes/Controller/InfoModuleController.php @@ -17,6 +17,8 @@ namespace TYPO3\CMS\Info\Controller; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use TYPO3\CMS\Backend\Module\BaseScriptClass; +use TYPO3\CMS\Backend\Template\Components\ButtonBar; +use TYPO3\CMS\Backend\Template\ModuleTemplate; use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Core\Imaging\Icon; use TYPO3\CMS\Core\Imaging\IconFactory; @@ -62,11 +64,19 @@ class InfoModuleController extends BaseScriptClass { */ protected $iconFactory; + /** + * ModuleTemplate Container + * + * @var ModuleTemplate + */ + protected $moduleTemplate; + /** * Constructor */ public function __construct() { $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class); + $this->moduleTemplate = GeneralUtility::makeInstance(ModuleTemplate::class); $this->languageService = $GLOBALS['LANG']; $this->languageService->includeLLFile('EXT:lang/locallang_mod_web_info.xlf'); @@ -83,49 +93,43 @@ class InfoModuleController extends BaseScriptClass { * @return void */ public function main() { + // We leave this here because of dependencies to submodules $this->doc = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Template\DocumentTemplate::class); // The page will show only if there is a valid page and if this page // may be viewed by the user $this->pageinfo = BackendUtility::readPageAccess($this->id, $this->perms_clause); + $this->moduleTemplate->getDocHeaderComponent()->setMetaInformation($this->pageinfo); $access = is_array($this->pageinfo); if ($this->id && $access || $this->backendUser->user['admin'] && !$this->id) { if ($this->backendUser->user['admin'] && !$this->id) { $this->pageinfo = array('title' => '[root-level]', 'uid' => 0, 'pid' => 0); } - $this->doc->setModuleTemplate('EXT:info/Resources/Private/Templates/info.html'); - // JavaScript - $this->doc->postCode = $this->doc->wrapScriptTags('if (top.fsMod) top.fsMod.recentIds["web"] = ' . (int)$this->id . ';'); + $this->moduleTemplate->addJavaScriptCode( + 'WebFuncInLineJS', + 'if (top.fsMod) top.fsMod.recentIds["web"] = ' . (int)$this->id . '; + function jumpToUrl(URL) { + window.location.href = URL; + return false; + } + '); // Setting up the context sensitive menu: - $this->doc->getContextMenuCode(); - $this->doc->form = '<form action="' . htmlspecialchars(BackendUtility::getModuleUrl($this->moduleName)) . - '" method="post" name="webinfoForm" class="form-inline form-inline-spaced">'; - $vContent = $this->doc->getVersionSelector($this->id, 1); + $this->moduleTemplate->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Backend/ClickMenu'); + $this->moduleTemplate->setForm('<form action="' . htmlspecialchars(BackendUtility::getModuleUrl($this->moduleName)) . + '" method="post" name="webinfoForm" class="form-inline form-inline-spaced">'); + $vContent = $this->moduleTemplate->getVersionSelector($this->id, 1); if ($vContent) { - $this->content .= $this->doc->section('', $vContent); + $this->content .= $this->moduleTemplate->section('', $vContent); } $this->extObjContent(); // Setting up the buttons and markers for docheader - $docHeaderButtons = $this->getButtons(); - $markers = array( - 'CSH' => $docHeaderButtons['csh'], - 'FUNC_MENU' => BackendUtility::getFuncMenu( - $this->id, - 'SET[function]', - $this->MOD_SETTINGS['function'], - $this->MOD_MENU['function'] - ), - 'CONTENT' => $this->content - ); - // Build the <body> for the module - $this->content = $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers); + $this->getButtons(); + $this->generateMenu(); } else { // If no access or if ID == zero $this->content = $this->doc->header($this->languageService->getLL('title')); } - // Renders the module page - $this->content = $this->doc->render($this->languageService->getLL('title'), $this->content); } /** @@ -159,40 +163,65 @@ class InfoModuleController extends BaseScriptClass { $this->checkSubExtObj(); $this->main(); - $this->content = $this->doc->insertStylesAndJS($this->content); - $response->getBody()->write($this->content); + $this->moduleTemplate->setContent($this->content); + $response->getBody()->write($this->moduleTemplate->renderContent()); return $response; } /** * Create the panel of buttons for submitting the form or otherwise perform operations. - * - * @return array All available buttons as an assoc. array */ protected function getButtons() { - $buttons = array( - 'csh' => '', - 'view' => '', - 'shortcut' => '' - ); + $buttonBar = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar(); // CSH - $buttons['csh'] = BackendUtility::cshItem('_MOD_web_info', ''); + $cshButton = $buttonBar->makeFullyRenderedButton() + ->setHtmlSource(BackendUtility::cshItem('_MOD_web_info', '')); + $buttonBar->addButton($cshButton, ButtonBar::BUTTON_POSITION_LEFT, 0); // View page - $buttons['view'] = '<a href="#" ' . - 'onclick="' . htmlspecialchars( - BackendUtility::viewOnClick($this->pageinfo['uid'], '', - BackendUtility::BEgetRootLine($this->pageinfo['uid'])) - ) . '" ' . - 'title="' . $this->languageService->sL('LLL:EXT:lang/locallang_core.xlf:labels.showPage', TRUE) . '">' . - $this->iconFactory->getIcon('actions-document-view', Icon::SIZE_SMALL) . - '</a>'; + $viewButton = $buttonBar->makeLinkButton() + ->setHref('#') + ->setOnClick(BackendUtility::viewOnClick($this->pageinfo['uid'], '', BackendUtility::BEgetRootLine($this->pageinfo['uid']))) + ->setTitle($this->languageService->sL('LLL:EXT:lang/locallang_core.xlf:labels.showPage', TRUE)) + ->setIcon($this->iconFactory->getIcon('actions-document-view', Icon::SIZE_SMALL)); + $buttonBar->addButton($viewButton, ButtonBar::BUTTON_POSITION_LEFT, 1); // Shortcut if ($this->backendUser->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 = $buttonBar->makeFullyRenderedButton() + ->setHtmlSource($this->moduleTemplate->makeShortcutIcon( + 'id, edit_record, pointer, new_unique_uid, search_field, search_levels, showLimit', + implode(',', array_keys($this->MOD_MENU)), $this->moduleName)); + $buttonBar->addButton($shortCutButton, ButtonBar::BUTTON_POSITION_RIGHT); } - return $buttons; + } + + /** + * Generate the ModuleMenu + */ + protected function generateMenu() { + $menu = $this->moduleTemplate->getDocHeaderComponent()->getMenuRegistry()->makeMenu(); + $menu->setIdentifier('WebInfoJumpMenu'); + foreach ($this->MOD_MENU['function'] as $controller => $title) { + $item = $menu + ->makeMenuItem() + ->setHref( + BackendUtility::getModuleUrl( + $this->moduleName, + [ + 'id' => $this->id, + 'SET' => [ + 'function' => $controller + ] + ] + ) + ) + ->setTitle($title); + if ($controller === $this->MOD_SETTINGS['function']) { + $item->setActive(TRUE); + } + $menu->addMenuItem($item); + } + $this->moduleTemplate->getDocHeaderComponent()->getMenuRegistry()->addMenu($menu); + } } diff --git a/typo3/sysext/t3skin/Resources/Public/Css/backend.css b/typo3/sysext/t3skin/Resources/Public/Css/backend.css index d3dcc27121430c1252ef86c7caf0440e1cd4637b..890ce906eee32855f692f04922a21e80182aa221 100644 --- a/typo3/sysext/t3skin/Resources/Public/Css/backend.css +++ b/typo3/sysext/t3skin/Resources/Public/Css/backend.css @@ -7867,7 +7867,7 @@ button.close { width: 100%; top: 0; left: 0; - height: 65px; + min-height: 65px; z-index: 300; background-color: #eeeeee; border-bottom: 1px solid #c3c3c3; @@ -7891,7 +7891,7 @@ button.close { clear: both; } .module-docheader .module-docheader-bar { - height: 26px; + min-height: 26px; margin: 4px 0; line-height: 26px; } @@ -10573,6 +10573,8 @@ span.checkbox-spinner { } table { background: transparent; + font-size: inherit; + line-height: inherit; } .table { background-color: #fafafa;