Skip to content
Snippets Groups Projects
Commit 260b6ac6 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

fixes #4090

Closes #4090

Merge request studip/studip!2934
parent 6dee621e
No related branches found
No related tags found
No related merge requests found
...@@ -35,6 +35,11 @@ class PageLayout ...@@ -35,6 +35,11 @@ class PageLayout
*/ */
private static $help_keyword; private static $help_keyword;
/**
* current help URL (or null if unset)
*/
private static ?string $help_url = null;
/** /**
* base item path for tab view (defaults to active item in top nav) * base item path for tab view (defaults to active item in top nav)
*/ */
...@@ -179,7 +184,24 @@ class PageLayout ...@@ -179,7 +184,24 @@ class PageLayout
*/ */
public static function getHelpKeyword() public static function getHelpKeyword()
{ {
return isset(self::$help_keyword) ? self::$help_keyword : 'Basis.Allgemeines'; return self::$help_keyword ?? 'Basis.Allgemeines';
}
/**
* Set the help URL in the help bar. Pass null to fall back to the help keyword.
*/
public static function setHelpUrl(?string $url): void
{
self::$help_url = $url;
}
/**
* Get the current help URL. If no URL is set explicitely, the URL for
* the help keyword is used.
*/
public static function getHelpUrl(): ?string
{
return self::$help_url ?? format_help_url(self::getHelpKeyword());
} }
/** /**
......
...@@ -253,7 +253,8 @@ class Helpbar extends WidgetContainer ...@@ -253,7 +253,8 @@ class Helpbar extends WidgetContainer
// add wiki link and remove it from navigation // add wiki link and remove it from navigation
$this->addLink( $this->addLink(
_('Weiterführende Hilfe'), _('Weiterführende Hilfe'),
format_help_url(PageLayout::getHelpKeyword()), Icon::create('link-extern', 'info_alt'), PageLayout::getHelpUrl(),
Icon::create('link-extern', Icon::ROLE_INFO_ALT),
'_blank', '_blank',
['rel' => 'noopener noreferrer'] ['rel' => 'noopener noreferrer']
); );
......
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