From b965138d570e9d8a39c802c3fcf386f5ab7fc806 Mon Sep 17 00:00:00 2001 From: Molkobain Date: Sat, 12 Jun 2021 18:11:55 +0200 Subject: [PATCH] Accessibility: Add missing aria-label to some UIBlock - Button - Global search - Quick create - Navigation menu - Tab container --- application/cmdbabstract.class.inc.php | 3 ++- .../layouts/cs.dictionary.itop.tab-container.php | 1 + .../layouts/da.dictionary.itop.tab-container.php | 1 + .../layouts/de.dictionary.itop.tab-container.php | 1 + .../layouts/en.dictionary.itop.tab-container.php | 1 + .../es_cr.dictionary.itop.tab-container.php | 1 + .../layouts/fr.dictionary.itop.tab-container.php | 1 + .../layouts/hu.dictionary.itop.tab-container.php | 1 + .../layouts/it.dictionary.itop.tab-container.php | 1 + .../layouts/ja.dictionary.itop.tab-container.php | 1 + .../layouts/nl.dictionary.itop.tab-container.php | 1 + .../pt_br.dictionary.itop.tab-container.php | 1 + .../layouts/ru.dictionary.itop.tab-container.php | 1 + .../layouts/sk.dictionary.itop.tab-container.php | 1 + .../layouts/tr.dictionary.itop.tab-container.php | 1 + .../zh_cn.dictionary.itop.tab-container.php | 1 + .../base/components/button/buttonjs.html.twig | 14 ++++++++++++-- .../base/components/button/buttonurl.html.twig | 14 ++++++++++++-- templates/base/components/button/layout.html.twig | 15 +++++++++++++-- .../components/global-search/layout.html.twig | 7 ++++++- .../base/components/quick-create/layout.html.twig | 8 ++++++-- .../base/layouts/navigation-menu/layout.html.twig | 5 +++-- .../base/layouts/tab-container/layout.html.twig | 5 ++++- 23 files changed, 73 insertions(+), 13 deletions(-) diff --git a/application/cmdbabstract.class.inc.php b/application/cmdbabstract.class.inc.php index eb3da7ffa6..cdb49a46ec 100644 --- a/application/cmdbabstract.class.inc.php +++ b/application/cmdbabstract.class.inc.php @@ -3216,7 +3216,8 @@ EOF // - Fullscreen toggler for large fields $sFullscreenTogglerTooltip = Dict::S('UI:ToggleFullScreen'); $sFullscreenTogglerHTML = (false === in_array($oAttDef->GetEditClass(), static::GetAttEditClassesToRenderAsLargeField())) ? '' : << HTML; diff --git a/dictionaries/ui/layouts/cs.dictionary.itop.tab-container.php b/dictionaries/ui/layouts/cs.dictionary.itop.tab-container.php index ee95c7c54e..7ff6fc8d9e 100644 --- a/dictionaries/ui/layouts/cs.dictionary.itop.tab-container.php +++ b/dictionaries/ui/layouts/cs.dictionary.itop.tab-container.php @@ -5,6 +5,7 @@ */ Dict::Add('CS CZ', 'Czech', 'Čeština', [ + 'UI:Layout:TabContainer:ExtraTabsListToggler:Label' => 'Other tabs~~', 'UIBlock:Error:AddBlockNotTabForbidden' => 'Cannot add block %1$s to %2$s (only Tab blocks are allowed)~~', 'UIBlock:TabContainer:RemoteTabLoad' => 'Click to load this tab~~', ]); diff --git a/dictionaries/ui/layouts/da.dictionary.itop.tab-container.php b/dictionaries/ui/layouts/da.dictionary.itop.tab-container.php index e38dc49a4f..46748fe5df 100644 --- a/dictionaries/ui/layouts/da.dictionary.itop.tab-container.php +++ b/dictionaries/ui/layouts/da.dictionary.itop.tab-container.php @@ -5,6 +5,7 @@ */ Dict::Add('DA DA', 'Danish', 'Dansk', [ + 'UI:Layout:TabContainer:ExtraTabsListToggler:Label' => 'Other tabs~~', 'UIBlock:Error:AddBlockNotTabForbidden' => 'Cannot add block %1$s to %2$s (only Tab blocks are allowed)~~', 'UIBlock:TabContainer:RemoteTabLoad' => 'Click to load this tab~~', ]); diff --git a/dictionaries/ui/layouts/de.dictionary.itop.tab-container.php b/dictionaries/ui/layouts/de.dictionary.itop.tab-container.php index dfda84fa5d..75152a3d83 100644 --- a/dictionaries/ui/layouts/de.dictionary.itop.tab-container.php +++ b/dictionaries/ui/layouts/de.dictionary.itop.tab-container.php @@ -5,6 +5,7 @@ */ Dict::Add('DE DE', 'German', 'Deutsch', [ + 'UI:Layout:TabContainer:ExtraTabsListToggler:Label' => 'Other tabs~~', 'UIBlock:Error:AddBlockNotTabForbidden' => 'Cannot add block %1$s to %2$s (only Tab blocks are allowed)~~', 'UIBlock:TabContainer:RemoteTabLoad' => 'Click to load this tab~~', ]); diff --git a/dictionaries/ui/layouts/en.dictionary.itop.tab-container.php b/dictionaries/ui/layouts/en.dictionary.itop.tab-container.php index d44e906ae7..afbebe918e 100644 --- a/dictionaries/ui/layouts/en.dictionary.itop.tab-container.php +++ b/dictionaries/ui/layouts/en.dictionary.itop.tab-container.php @@ -5,6 +5,7 @@ */ Dict::Add('EN US', 'English', 'English', [ + 'UI:Layout:TabContainer:ExtraTabsListToggler:Label' => 'Other tabs', 'UIBlock:Error:AddBlockNotTabForbidden' => 'Cannot add block %1$s to %2$s (only Tab blocks are allowed)', 'UIBlock:TabContainer:RemoteTabLoad' => 'Click to load this tab', ]); diff --git a/dictionaries/ui/layouts/es_cr.dictionary.itop.tab-container.php b/dictionaries/ui/layouts/es_cr.dictionary.itop.tab-container.php index 78326e7f49..967537cf94 100644 --- a/dictionaries/ui/layouts/es_cr.dictionary.itop.tab-container.php +++ b/dictionaries/ui/layouts/es_cr.dictionary.itop.tab-container.php @@ -5,6 +5,7 @@ */ Dict::Add('ES CR', 'Spanish', 'Español, Castellaño', [ + 'UI:Layout:TabContainer:ExtraTabsListToggler:Label' => 'Other tabs~~', 'UIBlock:Error:AddBlockNotTabForbidden' => 'Cannot add block %1$s to %2$s (only Tab blocks are allowed)~~', 'UIBlock:TabContainer:RemoteTabLoad' => 'Click to load this tab~~', ]); diff --git a/dictionaries/ui/layouts/fr.dictionary.itop.tab-container.php b/dictionaries/ui/layouts/fr.dictionary.itop.tab-container.php index 4101d49d56..4ec3edc857 100644 --- a/dictionaries/ui/layouts/fr.dictionary.itop.tab-container.php +++ b/dictionaries/ui/layouts/fr.dictionary.itop.tab-container.php @@ -5,6 +5,7 @@ */ Dict::Add('FR FR', 'French', 'Français', [ + 'UI:Layout:TabContainer:ExtraTabsListToggler:Label' => 'Autres onglets', 'UIBlock:Error:AddBlockNotTabForbidden' => 'Impossible d\'ajouter le bloc %1$s à %2$s (seul les blocs de type Tab sont autorisés) : Veuillez contacter votre administrateur', 'UIBlock:TabContainer:RemoteTabLoad' => 'Cliquez pour charger cet onglet', ]); diff --git a/dictionaries/ui/layouts/hu.dictionary.itop.tab-container.php b/dictionaries/ui/layouts/hu.dictionary.itop.tab-container.php index fe63d81bde..fbfd7e662b 100644 --- a/dictionaries/ui/layouts/hu.dictionary.itop.tab-container.php +++ b/dictionaries/ui/layouts/hu.dictionary.itop.tab-container.php @@ -5,6 +5,7 @@ */ Dict::Add('HU HU', 'Hungarian', 'Magyar', [ + 'UI:Layout:TabContainer:ExtraTabsListToggler:Label' => 'Other tabs~~', 'UIBlock:Error:AddBlockNotTabForbidden' => 'Cannot add block %1$s to %2$s (only Tab blocks are allowed)~~', 'UIBlock:TabContainer:RemoteTabLoad' => 'Click to load this tab~~', ]); diff --git a/dictionaries/ui/layouts/it.dictionary.itop.tab-container.php b/dictionaries/ui/layouts/it.dictionary.itop.tab-container.php index e5baee6f01..d936e7bdfe 100644 --- a/dictionaries/ui/layouts/it.dictionary.itop.tab-container.php +++ b/dictionaries/ui/layouts/it.dictionary.itop.tab-container.php @@ -5,6 +5,7 @@ */ Dict::Add('IT IT', 'Italian', 'Italiano', [ + 'UI:Layout:TabContainer:ExtraTabsListToggler:Label' => 'Other tabs~~', 'UIBlock:Error:AddBlockNotTabForbidden' => 'Cannot add block %1$s to %2$s (only Tab blocks are allowed)~~', 'UIBlock:TabContainer:RemoteTabLoad' => 'Click to load this tab~~', ]); diff --git a/dictionaries/ui/layouts/ja.dictionary.itop.tab-container.php b/dictionaries/ui/layouts/ja.dictionary.itop.tab-container.php index 583cec8d4f..60ea3731d0 100644 --- a/dictionaries/ui/layouts/ja.dictionary.itop.tab-container.php +++ b/dictionaries/ui/layouts/ja.dictionary.itop.tab-container.php @@ -5,6 +5,7 @@ */ Dict::Add('JA JP', 'Japanese', '日本語', [ + 'UI:Layout:TabContainer:ExtraTabsListToggler:Label' => 'Other tabs~~', 'UIBlock:Error:AddBlockNotTabForbidden' => 'Cannot add block %1$s to %2$s (only Tab blocks are allowed)~~', 'UIBlock:TabContainer:RemoteTabLoad' => 'Click to load this tab~~', ]); diff --git a/dictionaries/ui/layouts/nl.dictionary.itop.tab-container.php b/dictionaries/ui/layouts/nl.dictionary.itop.tab-container.php index f582baa2c7..145037382e 100644 --- a/dictionaries/ui/layouts/nl.dictionary.itop.tab-container.php +++ b/dictionaries/ui/layouts/nl.dictionary.itop.tab-container.php @@ -5,6 +5,7 @@ */ Dict::Add('NL NL', 'Dutch', 'Nederlands', [ + 'UI:Layout:TabContainer:ExtraTabsListToggler:Label' => 'Other tabs~~', 'UIBlock:Error:AddBlockNotTabForbidden' => 'Cannot add block %1$s to %2$s (only Tab blocks are allowed)~~', 'UIBlock:TabContainer:RemoteTabLoad' => 'Click to load this tab~~', ]); diff --git a/dictionaries/ui/layouts/pt_br.dictionary.itop.tab-container.php b/dictionaries/ui/layouts/pt_br.dictionary.itop.tab-container.php index 29a5eb4e52..a589b3930c 100644 --- a/dictionaries/ui/layouts/pt_br.dictionary.itop.tab-container.php +++ b/dictionaries/ui/layouts/pt_br.dictionary.itop.tab-container.php @@ -5,6 +5,7 @@ */ Dict::Add('PT BR', 'Brazilian', 'Brazilian', [ + 'UI:Layout:TabContainer:ExtraTabsListToggler:Label' => 'Other tabs~~', 'UIBlock:Error:AddBlockNotTabForbidden' => 'Cannot add block %1$s to %2$s (only Tab blocks are allowed)~~', 'UIBlock:TabContainer:RemoteTabLoad' => 'Click to load this tab~~', ]); diff --git a/dictionaries/ui/layouts/ru.dictionary.itop.tab-container.php b/dictionaries/ui/layouts/ru.dictionary.itop.tab-container.php index 8989ab64db..45b5c10d43 100644 --- a/dictionaries/ui/layouts/ru.dictionary.itop.tab-container.php +++ b/dictionaries/ui/layouts/ru.dictionary.itop.tab-container.php @@ -5,6 +5,7 @@ */ Dict::Add('RU RU', 'Russian', 'Русский', [ + 'UI:Layout:TabContainer:ExtraTabsListToggler:Label' => 'Other tabs~~', 'UIBlock:Error:AddBlockNotTabForbidden' => 'Cannot add block %1$s to %2$s (only Tab blocks are allowed)~~', 'UIBlock:TabContainer:RemoteTabLoad' => 'Click to load this tab~~', ]); diff --git a/dictionaries/ui/layouts/sk.dictionary.itop.tab-container.php b/dictionaries/ui/layouts/sk.dictionary.itop.tab-container.php index a303e174ac..8a55d90c6e 100644 --- a/dictionaries/ui/layouts/sk.dictionary.itop.tab-container.php +++ b/dictionaries/ui/layouts/sk.dictionary.itop.tab-container.php @@ -5,6 +5,7 @@ */ Dict::Add('SK SK', 'Slovak', 'Slovenčina', [ + 'UI:Layout:TabContainer:ExtraTabsListToggler:Label' => 'Other tabs~~', 'UIBlock:Error:AddBlockNotTabForbidden' => 'Cannot add block %1$s to %2$s (only Tab blocks are allowed)~~', 'UIBlock:TabContainer:RemoteTabLoad' => 'Click to load this tab~~', ]); diff --git a/dictionaries/ui/layouts/tr.dictionary.itop.tab-container.php b/dictionaries/ui/layouts/tr.dictionary.itop.tab-container.php index 1f5e8c3290..c550aafdc1 100644 --- a/dictionaries/ui/layouts/tr.dictionary.itop.tab-container.php +++ b/dictionaries/ui/layouts/tr.dictionary.itop.tab-container.php @@ -5,6 +5,7 @@ */ Dict::Add('TR TR', 'Turkish', 'Türkçe', [ + 'UI:Layout:TabContainer:ExtraTabsListToggler:Label' => 'Other tabs~~', 'UIBlock:Error:AddBlockNotTabForbidden' => 'Cannot add block %1$s to %2$s (only Tab blocks are allowed)~~', 'UIBlock:TabContainer:RemoteTabLoad' => 'Click to load this tab~~', ]); diff --git a/dictionaries/ui/layouts/zh_cn.dictionary.itop.tab-container.php b/dictionaries/ui/layouts/zh_cn.dictionary.itop.tab-container.php index 065733c752..8eb7999fe5 100644 --- a/dictionaries/ui/layouts/zh_cn.dictionary.itop.tab-container.php +++ b/dictionaries/ui/layouts/zh_cn.dictionary.itop.tab-container.php @@ -5,6 +5,7 @@ */ Dict::Add('ZH CN', 'Chinese', '简体中文', [ + 'UI:Layout:TabContainer:ExtraTabsListToggler:Label' => 'Other tabs~~', 'UIBlock:Error:AddBlockNotTabForbidden' => 'Cannot add block %1$s to %2$s (only Tab blocks are allowed)~~', 'UIBlock:TabContainer:RemoteTabLoad' => 'Click to load this tab~~', ]); diff --git a/templates/base/components/button/buttonjs.html.twig b/templates/base/components/button/buttonjs.html.twig index 2db9496d0f..5c9f720343 100644 --- a/templates/base/components/button/buttonjs.html.twig +++ b/templates/base/components/button/buttonjs.html.twig @@ -1,5 +1,6 @@ +{% set sAriaLabel = oUIBlock.GetLabel() is not empty ? oUIBlock.GetLabel() : (oUIBlock.GetTooltip() is not empty ? oUIBlock.GetTooltip() : '') %}