aboutsummaryrefslogtreecommitdiff
path: root/lib/classes/PageLayout.php
diff options
context:
space:
mode:
authorJan-Hendrik Willms <tleilax+studip@gmail.com>2024-04-29 12:01:39 +0000
committerJan-Hendrik Willms <tleilax+studip@gmail.com>2024-04-29 12:01:39 +0000
commit260b6ac6ea08dc3bf973580ab41ecea61635890f (patch)
tree5115d11b1b0f2155c52b8e4dfcd2bad3a21acf36 /lib/classes/PageLayout.php
parent6dee621eda725dd9e640a2eb34b4684ea0638af6 (diff)
fixes #4090
Closes #4090 Merge request studip/studip!2934
Diffstat (limited to 'lib/classes/PageLayout.php')
-rw-r--r--lib/classes/PageLayout.php24
1 files changed, 23 insertions, 1 deletions
diff --git a/lib/classes/PageLayout.php b/lib/classes/PageLayout.php
index fca69b5..4eb422c 100644
--- a/lib/classes/PageLayout.php
+++ b/lib/classes/PageLayout.php
@@ -36,6 +36,11 @@ class PageLayout
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)
*/
private static $tab_navigation_path = false;
@@ -179,7 +184,24 @@ class PageLayout
*/
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());
}
/**