diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-01-24 02:02:46 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-01-24 02:02:46 +0000 |
commit | de3b6654ddc28fe0fc7d6e1fb615ddb4fd3e3e47 (patch) | |
tree | ca658f3be6585f6a64a56693000bc46d7796289c /engine/lib/widgets.php | |
parent | 1cf47c89b8ca9f5c42f5e247c3cba939f9676564 (diff) | |
download | elgg-de3b6654ddc28fe0fc7d6e1fb615ddb4fd3e3e47.tar.gz elgg-de3b6654ddc28fe0fc7d6e1fb615ddb4fd3e3e47.tar.bz2 |
welcome to the admin dashboard
git-svn-id: http://code.elgg.org/elgg/trunk@7922 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/widgets.php')
-rw-r--r-- | engine/lib/widgets.php | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/engine/lib/widgets.php b/engine/lib/widgets.php index e11e4b8e3..9a092e92d 100644 --- a/engine/lib/widgets.php +++ b/engine/lib/widgets.php @@ -215,12 +215,13 @@ function elgg_is_widget_type($handler) { * * The widget types are stdClass objects. * - * @param string context The widget context or empty string for current context + * @param string $context The widget context or empty string for current context + * @param bool $exact Only return widgets registered for this context (false) * * @return array * @since 1.8.0 */ -function elgg_get_widget_types($context = "") { +function elgg_get_widget_types($context = "", $exact = false) { global $CONFIG; if (empty($CONFIG->widgets) || @@ -236,8 +237,14 @@ function elgg_get_widget_types($context = "") { $widgets = array(); foreach ($CONFIG->widgets->handlers as $key => $handler) { - if (in_array('all', $handler->context) || in_array($context, $handler->context)) { - $widgets[$key] = $handler; + if ($exact) { + if (in_array($context, $handler->context)) { + $widgets[$key] = $handler; + } + } else { + if (in_array('all', $handler->context) || in_array($context, $handler->context)) { + $widgets[$key] = $handler; + } } } |