aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-13 16:39:11 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-13 16:39:11 +0000
commitfc3305a58e6c76186c04929ec5fed3b6be0429f6 (patch)
tree8fa1262d42fa46df2356cfff5d886799960bec10 /engine
parent5252e84dda067e1c537025bf732700297e2e8b1f (diff)
downloadelgg-fc3305a58e6c76186c04929ec5fed3b6be0429f6.tar.gz
elgg-fc3305a58e6c76186c04929ec5fed3b6be0429f6.tar.bz2
using_widgets();
git-svn-id: https://code.elgg.org/elgg/trunk@915 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine')
-rw-r--r--engine/lib/widgets.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/engine/lib/widgets.php b/engine/lib/widgets.php
index e92c52f36..8a7a82e92 100644
--- a/engine/lib/widgets.php
+++ b/engine/lib/widgets.php
@@ -31,6 +31,23 @@
}
/**
+ * Determines whether or not the current context is using widgets
+ *
+ * @return true|false Depending on widget status
+ */
+ function using_widgets() {
+
+ global $CONFIG;
+ $context = get_context();
+ if (isset($CONFIG->widgets->contexts) && is_array($CONFIG->widgets->contexts)) {
+ if (in_array($context, $CONFIG->widgets->contexts)) return true;
+ }
+
+ return false;
+
+ }
+
+ /**
* When given a widget entity and a new requested location, saves the new location
* and also provides a sensible ordering for all widgets in that column
*