diff --git a/app/controllers/settings/accessibility.php b/app/controllers/settings/accessibility.php index 6e53cc0531efa936312d16a7f657508d49a7e97b..5ca4e8dc1a1865b4b4acac4721aeaf254ded3af1 100644 --- a/app/controllers/settings/accessibility.php +++ b/app/controllers/settings/accessibility.php @@ -36,7 +36,6 @@ class Settings_AccessibilityController extends Settings_SettingsController CSRFProtection::verifyUnsafeRequest(); $this->config->store('USER_HIGH_CONTRAST', Request::bool('enable_high_contrast')); - $this->config->store('SKIPLINKS_ENABLE', Request::bool('skiplinks_enable')); PageLayout::postSuccess(_('Ihre Einstellungen wurden gespeichert.')); $this->redirect('settings/accessibility'); diff --git a/app/controllers/settings/general.php b/app/controllers/settings/general.php index 3c17eb66dab0c54e24a636ac5730a6c03714bb9e..8b6ef0edfb9a68f63ee8f0ac063dbbac72153076 100644 --- a/app/controllers/settings/general.php +++ b/app/controllers/settings/general.php @@ -64,7 +64,6 @@ class Settings_GeneralController extends Settings_SettingsController $this->config->store('PERSONAL_STARTPAGE', Request::int('personal_startpage')); $this->config->store('SHOWSEM_ENABLE', Request::int('showsem_enable')); - $this->config->store('SKIPLINKS_ENABLE', Request::int('skiplinks_enable')); $this->config->store('TOUR_AUTOSTART_DISABLE', Request::int('tour_autostart_disable')); $this->config->store('WIKI_COMMENTS_ENABLE', Request::int('wiki_comments_enable')); if ($this->show_room_management_autor_config) { diff --git a/app/views/settings/accessibility.php b/app/views/settings/accessibility.php index 7bd19a26edec3b8f4ca4c1790ad594b890c34900..366992e6e2bbe75a9456635971dd535f4cc40741 100644 --- a/app/views/settings/accessibility.php +++ b/app/views/settings/accessibility.php @@ -12,18 +12,6 @@ _('Mit dieser Einstellung wird ein Farbschema mit hohem Kontrast aktiviert.') ) ?> </label> - - <label> - <input type="checkbox" name="skiplinks_enable" - value="1" - <? if ($config->SKIPLINKS_ENABLE) echo 'checked'; ?>> - <?= _('Skiplinks einblenden') ?> - <?= tooltipIcon(_('Mit dieser Einstellung wird nach dem ersten Drücken der Tab-Taste eine ' - .'Liste mit Skiplinks eingeblendet, mit deren Hilfe Sie mit der Tastatur ' - .'schneller zu den Hauptinhaltsbereichen der Seite navigieren können. ' - .'Zusätzlich wird der aktive Bereich einer Seite hervorgehoben.')) ?> - </label> - </fieldset> <footer> diff --git a/db/migrations/5.3.13_remove_skiplinks_enable.php b/db/migrations/5.3.13_remove_skiplinks_enable.php new file mode 100644 index 0000000000000000000000000000000000000000..e1f7d1408d3e35fce63a6b7f01a8cfde31ea3a69 --- /dev/null +++ b/db/migrations/5.3.13_remove_skiplinks_enable.php @@ -0,0 +1,28 @@ +<?php + + +class RemoveSkiplinksEnable extends Migration +{ + public function description() + { + return 'Removes SKIPLINKS_ENABLE.'; + } + + protected function up() + { + $db = DBManager::get(); + $db->exec("DELETE FROM `config_values` WHERE `field` = 'SKIPLINKS_ENABLE'"); + $db->exec("DELETE FROM `config` WHERE `field` = 'SKIPLINKS_ENABLE'"); + } + + protected function down() + { + $db = DBManager::get(); + $db->exec( + "INSERT INTO `config` + (`field`, `value`, `type`, `range`, `section`, `mkdate`, `chdate`, `description`) + VALUES + ('SKIPLINKS_ENABLE', '', 'boolean', 'user', 'privacy', 1311411856, 1311411856, 'Wählen Sie diese Option, um Skiplinks beim ersten Drücken der Tab-Taste anzuzeigen (Systemdefault).')" + ); + } +} diff --git a/lib/classes/SkipLinks.php b/lib/classes/SkipLinks.php index 796206d0f11ec9a0dc7e20c37aeeac469f83b2b7..3d44ab12c467987a63f9909d19b550acc53203ed 100644 --- a/lib/classes/SkipLinks.php +++ b/lib/classes/SkipLinks.php @@ -25,34 +25,6 @@ class SkipLinks */ private static $links = []; - /** - * Returns whether skiplinks are enabled. - * - * @return boolean - */ - public static function isEnabled() - { - if (isset($GLOBALS['user']->id)) { - //Use the user configuration: - return UserConfig::get($GLOBALS['user']->id)->SKIPLINKS_ENABLE; - } else { - //Use the global configuration: - return Config::get()->SKIPLINKS_ENABLE; - } - } - - /** - * Inserts container for skip links in page layout. - */ - public static function insertContainer() - { - if (!self::isEnabled()) { - return; - } - - PageLayout::addBodyElements('<div id="skip_link_navigation" aria-busy="true"></div>'); - } - /** * Adds a link to the list of skip links. * @@ -92,7 +64,7 @@ class SkipLinks */ public static function getHTML() { - if (!self::isEnabled() || count(self::$links) === 0) { + if (count(self::$links) === 0) { return ''; } diff --git a/lib/include/html_head.inc.php b/lib/include/html_head.inc.php index a7f2c21e1c41478bd664a8a92aa80340d1f770fe..f1108ce75369b55c9746b910962fe7ea0abbddba 100644 --- a/lib/include/html_head.inc.php +++ b/lib/include/html_head.inc.php @@ -62,3 +62,5 @@ $lang_attr = str_replace('_', '-', $_SESSION['_language']); </head> <body id="<?= PageLayout::getBodyElementId() ?>"> + <div id="skip_link_navigation" aria-busy="true"></div> + <?= PageLayout::getBodyElements() ?> diff --git a/resources/assets/stylesheets/scss/skiplinks.scss b/resources/assets/stylesheets/scss/skiplinks.scss index da8cc52e44b817f6e1dc7a059caa42f6763040a1..dd25f8bdde8dbbda4cc139de3cbd012b8a50c954 100644 --- a/resources/assets/stylesheets/scss/skiplinks.scss +++ b/resources/assets/stylesheets/scss/skiplinks.scss @@ -41,16 +41,3 @@ button.skiplink { transition: color 0.3s; } } - -body.enable-skiplinks { - *:not(:empty):focus { - outline: 2px dashed $orange; - } - - #tabs { - a:focus { - position: relative; - z-index: 100; - } - } -} diff --git a/templates/header.php b/templates/header.php index c59d081627cd4165a005169d1bc16fab7bdfd348..be445e73ea25927eec20cff5cd931055a9365fff 100644 --- a/templates/header.php +++ b/templates/header.php @@ -50,7 +50,8 @@ if ($navigation) { } ?> -<? SkipLinks::insertContainer() ?> +<div id="skip_link_navigation" aria-busy="true"></div> +<? SkipLinks::addIndex(_('Hauptinhalt'), 'content', 100) ?> <?= PageLayout::getBodyElements() ?> <!-- Begin main site header --> diff --git a/templates/layouts/base.php b/templates/layouts/base.php index e3eb6c39ec111fbb46ccfc2390a3bf9fddecc6e1..ddf8b1b4da71d62b43b903676a3b40828859f9ba 100644 --- a/templates/layouts/base.php +++ b/templates/layouts/base.php @@ -70,7 +70,8 @@ $lang_attr = str_replace('_', '-', $_SESSION['_language']); </script> </head> -<body id="<?= PageLayout::getBodyElementId() ?>" <? if (SkipLinks::isEnabled()) echo 'class="enable-skiplinks"'; ?>> +<body id="<?= PageLayout::getBodyElementId() ?>" class="enable-skiplinks"> + <div id="skip_link_navigation" aria-busy="true"></div> <? SkipLinks::addIndex(_('Hauptinhalt'), 'content', 100) ?> <? include 'lib/include/header.php' ?>