From c1bd3bb9f221d1d837ee4ac2e65aa1f0ac37f7d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michaela=20Br=C3=BCckner?= Date: Tue, 3 Mar 2026 08:40:08 +0100 Subject: Resolve "Hohen Kontrast aktivieren und Sprachauswahl funktionieren nur auf Login Seite" Closes #6070 Merge request studip/studip!4779 --- app/controllers/nobody_settings.php | 48 +++++++++++++++++++++++++++++++++++ templates/header.php | 19 +------------- templates/login/_header_contrast.php | 18 +++++++++++++ templates/login/_header_languages.php | 3 ++- 4 files changed, 69 insertions(+), 19 deletions(-) create mode 100644 app/controllers/nobody_settings.php create mode 100644 templates/login/_header_contrast.php diff --git a/app/controllers/nobody_settings.php b/app/controllers/nobody_settings.php new file mode 100644 index 0000000..993f218 --- /dev/null +++ b/app/controllers/nobody_settings.php @@ -0,0 +1,48 @@ + + * @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2 + * @category Stud.IP + */ + +class NobodySettingsController extends StudipController +{ + protected $with_session = true; + + public function store_settings_action() + { + + $this->page = Request::get('page'); + + if (Request::submitted('user_config_submitted')) { + CSRFProtection::verifyUnsafeRequest(); + + if (Request::submitted('unset_contrast')) { + $_SESSION['contrast'] = 0; + } + if (Request::submitted('set_contrast')) { + $_SESSION['contrast'] = 1; + } + + foreach (array_keys($GLOBALS['INSTALLED_LANGUAGES']) as $language_key) { + if (Request::get('set_language') === $language_key) { + $_SESSION['forced_language'] = $language_key; + $_SESSION['_language'] = $language_key; + } + } + } + + $this->redirect($this->page); //we're too late to remove the high contrast mode, so we reload the page + } + +} diff --git a/templates/header.php b/templates/header.php index b4df4c4..c11d973 100644 --- a/templates/header.php +++ b/templates/header.php @@ -184,24 +184,7 @@ if ($navigation) { ]) ?> -
  • -
    - - -
    - - asSvg(24) ?> - - - - asSvg(24) ?> - - - -
    -
    -
  • +
  • render_partial('login/_header_contrast') ?>
  • render_partial('login/_header_languages') ?>
  • diff --git a/templates/login/_header_contrast.php b/templates/login/_header_contrast.php new file mode 100644 index 0000000..d98db07 --- /dev/null +++ b/templates/login/_header_contrast.php @@ -0,0 +1,18 @@ +
    + + + +
    + + asSvg(24) ?> + + + + asSvg(24) ?> + + + +
    + +
    diff --git a/templates/login/_header_languages.php b/templates/login/_header_languages.php index 6504cc9..435ab38 100644 --- a/templates/login/_header_languages.php +++ b/templates/login/_header_languages.php @@ -1,6 +1,7 @@ -
    + +