aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/pageowner.php
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-05-22 11:14:47 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-05-22 11:14:47 +0000
commitdfc41712e3343c6e9ab3ba8327c454c5cd3179b1 (patch)
treedb5ad75af597eee2e4ab877e6d014910c36206a3 /engine/lib/pageowner.php
parent5ea5c8f55b7560ac41bcf529482e6ac771b71ae0 (diff)
downloadelgg-dfc41712e3343c6e9ab3ba8327c454c5cd3179b1.tar.gz
elgg-dfc41712e3343c6e9ab3ba8327c454c5cd3179b1.tar.bz2
Plugins can now set context
git-svn-id: https://code.elgg.org/elgg/trunk@677 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/pageowner.php')
-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