diff options
author | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-06-12 11:16:11 +0000 |
---|---|---|
committer | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-06-12 11:16:11 +0000 |
commit | 40beee7e0a122811516122a388f6aaa5b1b3c2f4 (patch) | |
tree | 4627cac8c355a1d3a266a223040a87e555939e52 | |
parent | 08e2e2e28bba5fae7a146569b62a7fb67660b7ec (diff) | |
download | elgg-40beee7e0a122811516122a388f6aaa5b1b3c2f4.tar.gz elgg-40beee7e0a122811516122a388f6aaa5b1b3c2f4.tar.bz2 |
Added use_widgets function to register a context for widget use.
git-svn-id: https://code.elgg.org/elgg/trunk@881 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r-- | engine/lib/widgets.php | 19 |
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
|