aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/widgets.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib/widgets.php')
-rw-r--r--engine/lib/widgets.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/engine/lib/widgets.php b/engine/lib/widgets.php
index baa20b45d..aa12bf76b 100644
--- a/engine/lib/widgets.php
+++ b/engine/lib/widgets.php
@@ -11,6 +11,25 @@
* @link http://elgg.org/
*/
+ /**
+ * Register a particular context for use with widgets.
+ *
+ * @param string $context The context we wish to enable context for
+ */
+ function use_widgets($context) {
+
+ global $CONFIG;
+ if (!isset($CONFIG->widgets))
+ $CONFIG->widgets = new stdClass;
+ if (!isset($CONFIG->widgets->contexts)) {
+ $CONFIG->widgets->contexts = array();
+ }
+ if (!empty($context)) {
+ $CONFIG->widgets->contexts[] = $context;
+ }
+
+ }
+
/**
* Registers a particular action with a widget handler