From fc3305a58e6c76186c04929ec5fed3b6be0429f6 Mon Sep 17 00:00:00 2001 From: ben Date: Fri, 13 Jun 2008 16:39:11 +0000 Subject: using_widgets(); git-svn-id: https://code.elgg.org/elgg/trunk@915 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/widgets.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'engine') 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 @@ -30,6 +30,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 -- cgit v1.2.3