Skip to content
Snippets Groups Projects
Commit 6ae35bf4 authored by Moritz Strohm's avatar Moritz Strohm Committed by David Siegfried
Browse files

TIC 1388, closes #1388

Closes #1388

Merge request studip/studip!1161
parent 5a61df26
No related branches found
No related tags found
No related merge requests found
......@@ -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');
......
......@@ -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) {
......
......@@ -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>
......
<?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).')"
);
}
}
......@@ -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 '';
}
......
......@@ -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() ?>
......@@ -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;
}
}
}
......@@ -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 -->
......
......@@ -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' ?>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment