From 1f0206ba31205029fe2316e88bccc7439672c349 Mon Sep 17 00:00:00 2001 From: Jan-Hendrik Willms <tleilax+studip@gmail.com> Date: Mon, 17 Jun 2024 07:56:14 +0000 Subject: [PATCH] fixes #4311 Closes #4311 Merge request studip/studip!3115 --- lib/classes/helpbar/Helpbar.php | 2 +- templates/helpbar/helpbar.php | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/classes/helpbar/Helpbar.php b/lib/classes/helpbar/Helpbar.php index cfa98a34b8f..a31a0062de5 100644 --- a/lib/classes/helpbar/Helpbar.php +++ b/lib/classes/helpbar/Helpbar.php @@ -264,7 +264,7 @@ class Helpbar extends WidgetContainer $template = $GLOBALS['template_factory']->open('helpbar/helpbar'); $template->widgets = $this->widgets; $template->open = $this->open; - $template->tour_data = $tour_data; + $template->tour_data = $tour_data ?? null; $content = $template->render(); } diff --git a/templates/helpbar/helpbar.php b/templates/helpbar/helpbar.php index cc77053c8bd..6f8efbbb1d5 100644 --- a/templates/helpbar/helpbar.php +++ b/templates/helpbar/helpbar.php @@ -1,5 +1,11 @@ +<?php +/** + * @var bool $open + * @var Widget[] $widgets + */ +?> <div class="helpbar-container"> - <?= SkipLinks::addIndex(_('Tipps & Hilfe'), 'helpbar_icon', 920) ?> + <? SkipLinks::addIndex(_('Tipps & Hilfe'), 'helpbar_icon', 920) ?> <a id="helpbar_icon" href="#" class="helpbar-toggler" data-toggles=".helpbar" role="button" title="<?= _('Hilfelasche anzeigen/verstecken') ?>" aria-controls="helpbar-content" aria-expanded="<?= $open ? 'true' : 'false' ?>"> @@ -41,7 +47,7 @@ </ul> </div> </div> -<? if ($tour_data['active_tour_id']) : ?> +<? if (!empty($tour_data['active_tour_id'])) : ?> <script> STUDIP.Tour.init('<?=$tour_data['active_tour_id']?>', '<?=$tour_data['active_tour_step_nr']?>') </script> -- GitLab