diff options
Diffstat (limited to 'views/default/layout/shells')
-rw-r--r-- | views/default/layout/shells/widgets.php | 9 | ||||
-rw-r--r-- | views/default/layout/shells/widgets/add_panel.php | 10 |
2 files changed, 15 insertions, 4 deletions
diff --git a/views/default/layout/shells/widgets.php b/views/default/layout/shells/widgets.php index 82489b37f..656a0e4c3 100644 --- a/views/default/layout/shells/widgets.php +++ b/views/default/layout/shells/widgets.php @@ -2,14 +2,16 @@ /** * Elgg widgets layout * - * @uses $vars['box'] Optional display box at the top of layout - * @uses $vars['num_columns'] Number of widget columns for this layout - * @uses $vars['show_add_widgets'] Display the add widgets button and panel + * @uses $vars['box'] Optional display box at the top of layout + * @uses $vars['num_columns'] Number of widget columns for this layout (3) + * @uses $vars['show_add_widgets'] Display the add widgets button and panel (true) + * @uses $vars['exact_match'] Widgets must match the current context (false) */ $box = elgg_get_array_value('box', $vars, ''); $num_columns = elgg_get_array_value('num_columns', $vars, 3); $show_add_widgets = elgg_get_array_value('show_add_widgets', $vars, true); +$exact_match = elgg_get_array_value('exact_match', $vars, false); $owner = elgg_get_page_owner(); $context = elgg_get_context(); @@ -24,6 +26,7 @@ if (elgg_can_edit_widget_layout($context)) { $params = array( 'widgets' => $widgets, 'context' => $context, + 'exact_match' => $exact_match, ); echo elgg_view('layout/shells/widgets/add_panel', $params); } diff --git a/views/default/layout/shells/widgets/add_panel.php b/views/default/layout/shells/widgets/add_panel.php index 1e2dc3bbc..2d2a05a08 100644 --- a/views/default/layout/shells/widgets/add_panel.php +++ b/views/default/layout/shells/widgets/add_panel.php @@ -1,9 +1,17 @@ <?php +/** + * Widget add panel + * + * @uses $vars['widgets'] Array of current widgets + * @uses $vars['context'] The context for this widget layout + * @uses $vars['exact_match'] Only use widgets that match the context + */ $widgets = $vars['widgets']; $context = $vars['context']; +$exact = elgg_get_array_value('exact_match', $vars, false); -$widget_types = elgg_get_widget_types($context); +$widget_types = elgg_get_widget_types($context, $exact); $current_handlers = array(); foreach ($widgets as $column_widgets) { |