From b1cc4ba35b1cb02444560a6a87fce3fcbc83df29 Mon Sep 17 00:00:00 2001 From: Elmar Ludwig <elmar.ludwig@uni-osnabrueck.de> Date: Mon, 5 Sep 2022 13:19:33 +0000 Subject: [PATCH] transfer fixes from #368 to my_studygroups, fixes #1541 Closes #1541 Merge request studip/studip!958 --- app/controllers/institute/overview.php | 22 +++++++++++----------- app/views/my_studygroups/_course.php | 23 ++++++++++++++--------- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/app/controllers/institute/overview.php b/app/controllers/institute/overview.php index 38cf38111bf..99a59cabfab 100644 --- a/app/controllers/institute/overview.php +++ b/app/controllers/institute/overview.php @@ -42,17 +42,6 @@ class Institute_OverviewController extends AuthenticatedController object_set_visit($this->institute_id, 0); } - //gibt es eine Anweisung zur Umleitung? - if (Request::get('redirect_to')) { - $query_parts = explode('&', mb_stristr(urldecode($_SERVER['QUERY_STRING']), 'redirect_to')); - list( , $where_to) = explode('=', array_shift($query_parts)); - $new_query = $where_to . '?' . join('&', $query_parts); - page_close(); - $new_query = preg_replace('/[^:0-9a-z+_.#?&=\/-]/i', '', $new_query); - header('Location: '.URLHelper::getURL($new_query, ['cid' => $this->institute_id])); - die; - } - PageLayout::setHelpKeyword("Basis.Einrichtungen"); PageLayout::setTitle($this->institute->getFullName() . " - " ._("Kurzinfo")); Navigation::activateItem('/course/main/info'); @@ -66,6 +55,17 @@ class Institute_OverviewController extends AuthenticatedController */ function index_action() { + //gibt es eine Anweisung zur Umleitung? + $redirect_to = Request::get('redirect_to'); + if ($redirect_to) { + if (!is_internal_url($redirect_to)) { + throw new Exception('Invalid redirection'); + } + + $this->redirect(URLHelper::getURL($redirect_to, ['cid' => $this->institute_id])); + return; + } + $this->sidebar = Sidebar::get(); if (Config::get()->NEWS_RSS_EXPORT_ENABLE && $this->institute_id){ diff --git a/app/views/my_studygroups/_course.php b/app/views/my_studygroups/_course.php index fcdae826e3c..52e3b327992 100644 --- a/app/views/my_studygroups/_course.php +++ b/app/views/my_studygroups/_course.php @@ -22,21 +22,26 @@ <?= tooltipicon($infotext) ?> <? endif ?> </td> - <td style="text-align: left"> + <td style="text-align: left; white-space: nowrap;"> <? if (!empty($group['navigation'])) : ?> + <ul class="my-courses-navigation" style="flex-wrap: nowrap"> <? foreach (MyRealmModel::array_rtrim($group['navigation']) as $key => $nav) : ?> <? if (isset($nav) && $nav->isVisible(true)) : ?> - <a href="<?= - URLHelper::getLink('seminar_main.php', - ['auswahl' => $group['seminar_id'], - 'redirect_to' => strtr($nav->getURL(), '?', '&')]) ?>" <?= $nav->hasBadgeNumber() ? 'class="badge" data-badge-number="' . intval($nav->getBadgeNumber()) . '"' : '' ?>> - <?= $nav->getImage()->asImg(20, $nav->getLinkAttributes()) ?> - </a> + <li class="my-courses-navigation-item <? if ($nav->getImage()->signalsAttention()) echo 'my-courses-navigation-important'; ?>"> + <a href="<?= + URLHelper::getLink('seminar_main.php', + ['auswahl' => $group['seminar_id'], + 'redirect_to' => $nav->getURL()]) ?>" <?= $nav->hasBadgeNumber() ? 'class="badge" data-badge-number="' . intval($nav->getBadgeNumber()) . '"' : '' ?>> + <?= $nav->getImage()->asImg(20, $nav->getLinkAttributes()) ?> + </a> + </li> <? elseif (is_string($key)) : ?> - <?= Assets::img('blank.gif', ['width' => 20, 'height' => 20]); ?> + <li class="my-courses-navigation-item"> + <span class="empty-slot" style="width: 20px"></span> + </li> <? endif ?> - <? echo ' ' ?> <? endforeach ?> + </ul> <? endif ?> </td> <td style="text-align: right"> -- GitLab