aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engine/lib/pageowner.php35
1 files changed, 35 insertions, 0 deletions
diff --git a/engine/lib/pageowner.php b/engine/lib/pageowner.php
index b1a3fe8ff..4531b5037 100644
--- a/engine/lib/pageowner.php
+++ b/engine/lib/pageowner.php
@@ -108,4 +108,39 @@
}
+ /**
+ * Sets the functional context of a page
+ *
+ * @param string $context The context of the page
+ * @return string|false Either the context string, or false on failure
+ */
+ function set_context($context) {
+
+ global $CONFIG;
+ if (!empty($context)) {
+ $context = trim($context);
+ $context = strtolower($context);
+ $CONFIG->context = $context;
+ return $context;
+ } else {
+ return false;
+ }
+
+ }
+
+ /**
+ * Returns the functional context of a page
+ *
+ * @return string The context, or 'main' if no context has been provided
+ */
+ function get_context() {
+
+ global $CONFIG;
+ if (isset($CONFIG->context) && !empty($CONFIG->context)) {
+ return $CONFIG->context;
+ }
+ return "main";
+
+ }
+
?> \ No newline at end of file