Commit 9a70d5f7 authored by Benni Mack's avatar Benni Mack Committed by Oliver Bartsch
Browse files

[TASK] Add label text to various buttons in docheader

All buttons on the left side of the docheader
should get a label to describe the functionality better.
In the next step the unification of the labels
for equivalent buttons will take place.

Resolves: #98320
Releases: main
Change-Id: I65b0e9238fc8319c36ad44edaa46dce0c6dfb7f6
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/75678


Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Jochen's avatarJochen <rothjochen@gmail.com>
Tested-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: Jochen's avatarJochen <rothjochen@gmail.com>
Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
parent 163e27ff
......@@ -321,6 +321,7 @@ class NewRecordController
->setHref('#')
->setDataAttributes($previewDataAttributes ?? [])
->setTitle($lang->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.showPage'))
->setShowLabelText(true)
->setIcon($this->iconFactory->getIcon(
'actions-view-page',
Icon::SIZE_SMALL
......
......@@ -72,6 +72,7 @@ class NewMultiplePagesController
$viewButton = $buttonBar->makeLinkButton()
->setDataAttributes($previewDataAttributes ?? [])
->setTitle($this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.showPage'))
->setShowLabelText(true)
->setIcon($this->iconFactory->getIcon('actions-view-page', Icon::SIZE_SMALL))
->setHref('#');
$buttonBar->addButton($viewButton);
......
......@@ -69,6 +69,7 @@ class SortSubPagesController
$viewButton = $buttonBar->makeLinkButton()
->setDataAttributes($previewDataAttributes ?? [])
->setTitle($this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.showPage'))
->setShowLabelText(true)
->setIcon($this->iconFactory->getIcon('actions-view-page', Icon::SIZE_SMALL))
->setHref('#');
$buttonBar->addButton($viewButton);
......
......@@ -551,8 +551,9 @@ class PageLayoutController
->setDataAttributes($previewDataAttributes ?? [])
->setTitle($languageService->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.showPage'))
->setIcon($this->iconFactory->getIcon('actions-view-page', Icon::SIZE_SMALL))
->setShowLabelText(true)
->setHref('#');
$buttonBar->addButton($viewButton, ButtonBar::BUTTON_POSITION_LEFT, 3);
$buttonBar->addButton($viewButton, ButtonBar::BUTTON_POSITION_LEFT, 1);
}
// Shortcut
......@@ -572,6 +573,7 @@ class PageLayoutController
->setHref('#')
->setDataAttributes(['id' => $this->pageinfo['uid']])
->setClasses('t3js-clear-page-cache')
->setShowLabelText(true)
->setTitle($languageService->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.clear_cache'))
->setIcon($this->iconFactory->getIcon('actions-system-cache-clear', Icon::SIZE_SMALL));
$buttonBar->addButton($clearCacheButton, ButtonBar::BUTTON_POSITION_RIGHT, 1);
......@@ -592,8 +594,9 @@ class PageLayoutController
$editPageButton = $buttonBar->makeLinkButton()
->setHref($url)
->setTitle($languageService->getLL('editPageProperties'))
->setShowLabelText(true)
->setIcon($this->iconFactory->getIcon('actions-page-open', Icon::SIZE_SMALL));
$buttonBar->addButton($editPageButton, ButtonBar::BUTTON_POSITION_LEFT, 3);
$buttonBar->addButton($editPageButton, ButtonBar::BUTTON_POSITION_LEFT, 2);
}
// Edit page properties of page language overlay (Only when one specific language is selected)
......@@ -636,6 +639,7 @@ class PageLayoutController
);
$editLanguageButton = $buttonBar->makeLinkButton()
->setHref($url)
->setShowLabelText(true)
->setTitle($languageService->getLL('editPageLanguageOverlayProperties'))
->setIcon($this->iconFactory->getIcon('mimetypes-x-content-page-language-overlay', Icon::SIZE_SMALL));
$buttonBar->addButton($editLanguageButton, ButtonBar::BUTTON_POSITION_LEFT, 3);
......
......@@ -169,6 +169,7 @@ class BackendUserController extends ActionController
$addUserButton = $buttonBar->makeLinkButton()
->setIcon($this->iconFactory->getIcon('actions-add', Icon::SIZE_SMALL))
->setTitle(LocalizationUtility::translate('LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:newRecordGeneral'))
->setShowLabelText(true)
->setHref((string)$this->backendUriBuilder->buildUriFromRoute('record_edit', [
'edit' => ['be_users' => [0 => 'new']],
'returnUrl' => $this->request->getAttribute('normalizedParams')->getRequestUri(),
......@@ -232,6 +233,7 @@ class BackendUserController extends ActionController
$editButton = $buttonBar->makeLinkButton()
->setIcon($this->iconFactory->getIcon('actions-open', Icon::SIZE_SMALL))
->setTitle(LocalizationUtility::translate('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.goBack'))
->setShowLabelText(true)
->setHref((string)$this->backendUriBuilder->buildUriFromRoute('record_edit', [
'edit' => ['be_users' => [$uid => 'edit']],
'returnUrl' => $this->request->getAttribute('normalizedParams')->getRequestUri(),
......@@ -240,6 +242,7 @@ class BackendUserController extends ActionController
$addUserButton = $buttonBar->makeLinkButton()
->setIcon($this->iconFactory->getIcon('actions-add', Icon::SIZE_SMALL))
->setTitle(LocalizationUtility::translate('LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:newRecordGeneral'))
->setShowLabelText(true)
->setHref((string)$this->backendUriBuilder->buildUriFromRoute('record_edit', [
'edit' => ['be_users' => [0 => 'new']],
'returnUrl' => $this->request->getAttribute('normalizedParams')->getRequestUri(),
......@@ -401,6 +404,7 @@ class BackendUserController extends ActionController
$addGroupButton = $buttonBar->makeLinkButton()
->setIcon($this->iconFactory->getIcon('actions-add', Icon::SIZE_SMALL))
->setTitle(LocalizationUtility::translate('LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:newRecordGeneral'))
->setShowLabelText(true)
->setHref((string)$this->backendUriBuilder->buildUriFromRoute('record_edit', [
'edit' => ['be_groups' => [0 => 'new']],
'returnUrl' => $this->request->getAttribute('normalizedParams')->getRequestUri(),
......
......@@ -142,6 +142,8 @@ class RecyclerModuleCest
$page = $this->pageTree->getPageXPathByPageName(static::$pageTitle);
$I->click($page);
// Close all notifications to avoid click interceptions
$I->click('#alert-container .close');
$I->switchToContentFrame();
$I->click('a[title="Edit page properties"]');
$I->click('a[title="Delete"]');
......
......@@ -61,7 +61,7 @@ class PageTree extends AbstractPageTree
$this->tester->pressKey($nodeEditInput, WebDriverKeys::ENTER);
$this->tester->waitForElementNotVisible($nodeEditInput);
$this->tester->see($pageTitle);
$this->tester->waitForText($pageTitle);
}
/**
......
......@@ -231,6 +231,7 @@ class ListController extends AbstractController
$button = $buttonBar->makeLinkButton()
->setHref($uri)
->setTitle($title)
->setShowLabelText(true)
->setClasses($classes)
->setIcon($icon);
$buttonBar->addButton($button, ButtonBar::BUTTON_POSITION_LEFT);
......
......@@ -174,6 +174,7 @@ class RenameFileController
$backButton = $buttonBar->makeLinkButton()
->setHref($this->returnUrl)
->setTitle($this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.goBack'))
->setShowLabelText(true)
->setIcon($this->iconFactory->getIcon('actions-close', Icon::SIZE_SMALL));
$buttonBar->addButton($backButton);
}
......
......@@ -417,6 +417,7 @@ class FormEditorController extends AbstractBackendController
->setHref((string)$uriBuilder->buildUriFromRoute('web_FormFormbuilder'))
->setClasses('t3-form-element-close-form-button hidden')
->setTitle($this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:rm.closeDoc'))
->setShowLabelText(true)
->setIcon($this->iconFactory->getIcon('actions-close', Icon::SIZE_SMALL));
$saveButton = $buttonBar->makeInputButton()
......
......@@ -497,6 +497,7 @@ class FormManagerController extends AbstractBackendController
->setDataAttributes(['identifier' => 'newForm'])
->setHref('#')
->setTitle($this->getLanguageService()->sL('LLL:EXT:form/Resources/Private/Language/Database.xlf:formManager.create_new_form'))
->setShowLabelText(true)
->setIcon($this->iconFactory->getIcon('actions-add', Icon::SIZE_SMALL));
$buttonBar->addButton($addFormButton, ButtonBar::BUTTON_POSITION_LEFT);
......
......@@ -136,6 +136,7 @@ class ImportController
->buildDispatcherDataAttributes();
$viewButton = $buttonBar->makeLinkButton()
->setTitle($this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.showPage'))
->setShowLabelText(true)
->setHref('#')
->setIcon($this->iconFactory->getIcon('actions-view-page', Icon::SIZE_SMALL))
->setDataAttributes($previewDataAttributes ?? []);
......
......@@ -148,6 +148,7 @@ class InfoModuleController
$viewButton = $buttonBar->makeLinkButton()
->setHref('#')
->setDataAttributes($previewDataAttributes ?? [])
->setShowLabelText(true)
->setTitle($languageService->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.showPage'))
->setIcon($this->iconFactory->getIcon('actions-view-page', Icon::SIZE_SMALL));
$buttonBar->addButton($viewButton, ButtonBar::BUTTON_POSITION_LEFT);
......
......@@ -280,6 +280,7 @@ class RecordListController
->setHref('#')
->setClasses('t3js-toggle-search-toolbox')
->setTitle($this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.title.searchIcon'))
->setShowLabelText(true)
->setIcon($this->iconFactory->getIcon('actions-search', Icon::SIZE_SMALL));
$buttonBar->addButton(
$searchButton,
......@@ -307,6 +308,7 @@ class RecordListController
$newRecordButton = $buttonBar->makeLinkButton()
->setHref((string)$this->uriBuilder->buildUriFromRoute('db_new', ['id' => $this->id, 'returnUrl' => $listUrl]))
->setTitle($lang->sL('LLL:EXT:core/Resources/Private/Language/locallang_mod_web_list.xlf:newRecordGeneral'))
->setShowLabelText(true)
->setIcon($this->iconFactory->getIcon('actions-add', Icon::SIZE_SMALL));
$buttonBar->addButton($newRecordButton, ButtonBar::BUTTON_POSITION_LEFT, 10);
}
......@@ -320,8 +322,9 @@ class RecordListController
->setHref('#')
->setDataAttributes($previewDataAttributes ?? [])
->setTitle($lang->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.showPage'))
->setShowLabelText(true)
->setIcon($this->iconFactory->getIcon('actions-view-page', Icon::SIZE_SMALL));
$buttonBar->addButton($viewButton, ButtonBar::BUTTON_POSITION_LEFT, 20);
$buttonBar->addButton($viewButton, ButtonBar::BUTTON_POSITION_LEFT, 15);
}
// If edit permissions are set, see BackendUserAuthentication
if ($this->isPageEditable()) {
......@@ -337,6 +340,7 @@ class RecordListController
$editButton = $buttonBar->makeLinkButton()
->setHref((string)$editLink)
->setTitle($lang->sL('LLL:EXT:core/Resources/Private/Language/locallang_mod_web_list.xlf:editPage'))
->setShowLabelText(true)
->setIcon($this->iconFactory->getIcon('actions-page-open', Icon::SIZE_SMALL));
$buttonBar->addButton($editButton, ButtonBar::BUTTON_POSITION_LEFT, 20);
}
......@@ -356,7 +360,8 @@ class RecordListController
'bs-content' => $confirmMessage,
'title' => $lang->sL('LLL:EXT:core/Resources/Private/Language/locallang_mod_web_list.xlf:clip_paste'),
])
->setIcon($this->iconFactory->getIcon('actions-document-paste-into', Icon::SIZE_SMALL));
->setIcon($this->iconFactory->getIcon('actions-document-paste-into', Icon::SIZE_SMALL))
->setShowLabelText(true);
$buttonBar->addButton($pasteButton, ButtonBar::BUTTON_POSITION_LEFT, 40);
}
}
......@@ -366,6 +371,7 @@ class RecordListController
->setHref('#')
->setDataAttributes(['id' => $this->id])
->setClasses('t3js-clear-page-cache')
->setShowLabelText(true)
->setTitle($lang->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.clear_cache'))
->setIcon($this->iconFactory->getIcon('actions-system-cache-clear', Icon::SIZE_SMALL));
$buttonBar->addButton($clearCacheButton, ButtonBar::BUTTON_POSITION_RIGHT);
......@@ -382,15 +388,9 @@ class RecordListController
->setTitle($lang->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:rm.export'))
->setIcon($this->iconFactory->getIcon('actions-document-export-t3d', Icon::SIZE_SMALL))
->setShowLabelText(true);
$buttonBar->addButton($exportButton, ButtonBar::BUTTON_POSITION_LEFT, 40);
$buttonBar->addButton($exportButton, ButtonBar::BUTTON_POSITION_LEFT, 50);
}
}
// Reload
$reloadButton = $buttonBar->makeLinkButton()
->setHref($listUrl)
->setTitle($lang->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.reload'))
->setIcon($this->iconFactory->getIcon('actions-refresh', Icon::SIZE_SMALL));
$buttonBar->addButton($reloadButton, ButtonBar::BUTTON_POSITION_RIGHT);
// Shortcut
$shortCutButton = $buttonBar->makeShortcutButton()->setRouteIdentifier('web_list');
......
......@@ -131,6 +131,7 @@ class ManagementController
]
))
->setTitle($languageService->sL('LLL:EXT:redirects/Resources/Private/Language/locallang_module_redirect.xlf:redirect_add_text'))
->setShowLabelText(true)
->setIcon($this->iconFactory->getIcon('actions-add', Icon::SIZE_SMALL));
$buttonBar->addButton($newRecordButton, ButtonBar::BUTTON_POSITION_LEFT, 10);
......
......@@ -1009,6 +1009,7 @@ class SchedulerModuleController
$buttonBar = $moduleTemplate->getDocHeaderComponent()->getButtonBar();
$addButton = $buttonBar->makeLinkButton()
->setTitle($languageService->sL('LLL:EXT:scheduler/Resources/Private/Language/locallang.xlf:function.add'))
->setShowLabelText(true)
->setIcon($this->iconFactory->getIcon('actions-add', Icon::SIZE_SMALL))
->setHref((string)$this->uriBuilder->buildUriFromRoute('system_txschedulerM1', ['action' => 'add']));
$buttonBar->addButton($addButton, ButtonBar::BUTTON_POSITION_LEFT, 2);
......@@ -1029,7 +1030,8 @@ class SchedulerModuleController
->setValue('save')
->setForm('tx_scheduler_form')
->setIcon($this->iconFactory->getIcon('actions-document-save', Icon::SIZE_SMALL))
->setTitle($languageService->sL('LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:save'));
->setTitle($languageService->sL('LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:save'))
->setShowLabelText(true);
$saveButtonDropdown->addItem($saveButton);
$saveAndNewButton = $buttonBar->makeInputButton()
->setName('CMD')
......@@ -1062,7 +1064,8 @@ class SchedulerModuleController
'bs-content' => $languageService->sL('LLL:EXT:scheduler/Resources/Private/Language/locallang.xlf:msg.delete'),
])
->setIcon($this->iconFactory->getIcon('actions-edit-delete', Icon::SIZE_SMALL))
->setTitle($languageService->sL('LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:delete'));
->setTitle($languageService->sL('LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:delete'))
->setShowLabelText(true);
$buttonBar->addButton($deleteButton, ButtonBar::BUTTON_POSITION_LEFT, 4);
}
......
......@@ -142,6 +142,7 @@ abstract class AbstractTemplateModuleController
->setHref('#')
->setDataAttributes($previewDataAttributes ?? [])
->setTitle($languageService->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.showPage'))
->setShowLabelText(true)
->setIcon($this->iconFactory->getIcon('actions-view-page', Icon::SIZE_SMALL));
$buttonBar->addButton($viewButton, ButtonBar::BUTTON_POSITION_LEFT, 99);
}
......
......@@ -19,9 +19,11 @@ namespace TYPO3\CMS\Tstemplate\Controller;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use TYPO3\CMS\Backend\Template\ModuleTemplate;
use TYPO3\CMS\Backend\Template\ModuleTemplateFactory;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Http\RedirectResponse;
use TYPO3\CMS\Core\Imaging\Icon;
/**
* This class displays the Info/Modify screen of the Web > Template module
......@@ -121,4 +123,23 @@ class InfoModifyController extends AbstractTemplateModuleController
]);
return $view->renderResponse('InfoModifyMain');
}
protected function addNewButtonToDocHeader(ModuleTemplate $view, string $moduleIdentifier, int $pageId): void
{
$languageService = $this->getLanguageService();
if ($pageId) {
$urlParameters = [
'id' => $pageId,
'template' => 'all',
'createExtension' => 'new',
];
$buttonBar = $view->getDocHeaderComponent()->getButtonBar();
$newButton = $buttonBar->makeLinkButton()
->setHref((string)$this->uriBuilder->buildUriFromRoute($moduleIdentifier, $urlParameters))
->setTitle($languageService->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:db_new.php.pagetitle'))
->setShowLabelText(true)
->setIcon($this->iconFactory->getIcon('actions-add', Icon::SIZE_SMALL));
$buttonBar->addButton($newButton);
}
}
}
......@@ -156,6 +156,7 @@ class ViewModuleController
]),
])
->setTitle($languageService->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.showPage'))
->setShowLabelText(true)
->setIcon($this->iconFactory->getIcon('actions-view-page', Icon::SIZE_SMALL));
$buttonBar->addButton($showButton);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment