diff options
Diffstat (limited to 'views/default/page/layouts/widgets.php')
| -rw-r--r-- | views/default/page/layouts/widgets.php | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/views/default/page/layouts/widgets.php b/views/default/page/layouts/widgets.php index eac9d43fc..c6b162516 100644 --- a/views/default/page/layouts/widgets.php +++ b/views/default/page/layouts/widgets.php @@ -16,6 +16,8 @@ $show_access = elgg_extract('show_access', $vars, true); $owner = elgg_get_page_owner_entity(); +$widget_types = elgg_get_widget_types(); + $context = elgg_get_context(); elgg_push_context('widgets'); @@ -23,26 +25,33 @@ $widgets = elgg_get_widgets($owner->guid, $context); if (elgg_can_edit_widget_layout($context)) { if ($show_add_widgets) { - echo elgg_view('layout/shells/widgets/add_button'); + echo elgg_view('page/layouts/widgets/add_button'); } $params = array( 'widgets' => $widgets, 'context' => $context, 'exact_match' => $exact_match, + 'show_access' => $show_access, ); - echo elgg_view('layout/shells/widgets/add_panel', $params); + echo elgg_view('page/layouts/widgets/add_panel', $params); } echo $vars['content']; $widget_class = "elgg-col-1of{$num_columns}"; for ($column_index = 1; $column_index <= $num_columns; $column_index++) { - $column_widgets = $widgets[$column_index]; + if (isset($widgets[$column_index])) { + $column_widgets = $widgets[$column_index]; + } else { + $column_widgets = array(); + } echo "<div class=\"$widget_class elgg-widgets\" id=\"elgg-widget-col-$column_index\">"; - if (is_array($column_widgets) && sizeof($column_widgets) > 0) { + if (sizeof($column_widgets) > 0) { foreach ($column_widgets as $widget) { - echo elgg_view_entity($widget, array('show_access' => $show_access)); + if (array_key_exists($widget->handler, $widget_types)) { + echo elgg_view_entity($widget, array('show_access' => $show_access)); + } } } echo '</div>'; |
