aboutsummaryrefslogtreecommitdiff
path: root/lib/classes/PageLayout.php
diff options
context:
space:
mode:
authorJan-Hendrik Willms <tleilax+studip@gmail.com>2023-03-20 14:37:56 +0000
committerJan-Hendrik Willms <tleilax+studip@gmail.com>2023-03-20 14:37:56 +0000
commit352d8259532c10384d6aa31fc0d76efcd5bbccb0 (patch)
tree48fa976df103713539a2062ec48d56310ddcf1b3 /lib/classes/PageLayout.php
parentcae6febc3efa76da31d581b4bc52e4afb494a254 (diff)
implement PageLayout::disableSidebar() and PageLayout::disableFooter.php, fixes #2395
Closes #2395 Merge request studip/studip!1585
Diffstat (limited to 'lib/classes/PageLayout.php')
-rw-r--r--lib/classes/PageLayout.php52
1 files changed, 52 insertions, 0 deletions
diff --git a/lib/classes/PageLayout.php b/lib/classes/PageLayout.php
index 64a1d93..3921ef0 100644
--- a/lib/classes/PageLayout.php
+++ b/lib/classes/PageLayout.php
@@ -65,6 +65,16 @@ class PageLayout
*/
private static $display_header = true;
+ /**
+ * determines whether the sidebar is displayed or not
+ */
+ private static $display_sidebar = true;
+
+ /**
+ * determines whether the page footer is displayed or not
+ */
+ private static $display_footer = true;
+
/*
* Custom quicksearch on the page
*/
@@ -465,6 +475,48 @@ class PageLayout
}
/**
+ * Disable output of the sidebar for this page.
+ *
+ * @since Stud.IP 5.4
+ */
+ public static function disableSidebar(bool $state = true)
+ {
+ self::$display_sidebar = !$state;
+ }
+
+ /**
+ * Return whether output of the sidebar is enabled.
+ *
+ * @since Stud.IP 5.4
+ */
+ public static function isSidebarEnabled(): bool
+ {
+ return self::$display_sidebar;
+ }
+
+ /**
+ * Disable output of the page footer for this page.
+ *
+ * @param bool $state
+ *
+ * @since Stud.IP 5.4
+ */
+ public static function disableFooter(bool $state = true)
+ {
+ self::$display_footer = !$state;
+ }
+
+ /**
+ * Return whether output of the page footer is enabled.
+ *
+ * @since Stud.IP 5.4
+ */
+ public static function isFooterEnabled(): bool
+ {
+ return self::$display_footer;
+ }
+
+ /**
* Sets the id of the html body element.
* The given id is stripped of all non alpha-numeric characters
* (except for -).