aboutsummaryrefslogtreecommitdiff
path: root/views/default/layouts
diff options
context:
space:
mode:
Diffstat (limited to 'views/default/layouts')
-rw-r--r--views/default/layouts/widgets.php21
1 files changed, 10 insertions, 11 deletions
diff --git a/views/default/layouts/widgets.php b/views/default/layouts/widgets.php
index 5d6e42a43..38451d1c1 100644
--- a/views/default/layouts/widgets.php
+++ b/views/default/layouts/widgets.php
@@ -18,12 +18,19 @@ elgg_push_context('widgets');
elgg_get_widgets($owner->guid, $context);
if (elgg_can_edit_widgets()) {
- echo elgg_view('widgets/add', array('widgets' => $widgets));
+ if ($show_add_widgets) {
+ echo elgg_view('widgets/add_button');
+ }
+ $params = array(
+ 'widgets' => $widgets,
+ 'context' => $context,
+ );
+ echo elgg_view('widgets/add', $params);
}
echo $vars['box'];
-$widget_class = "widget_col_$num_columns";
+$widget_class = "widget_{$num_columns}_columns";
for ($column_index = 1; $column_index <= $num_columns; $column_index++) {
$widgets = get_widgets($owner->guid, $context, $column_index);
@@ -34,15 +41,7 @@ for ($column_index = 1; $column_index <= $num_columns; $column_index++) {
$widget2->handler = 'test';
$widgets = array($widget1, $widget2);
- $first = ($column_index == 1) ? 'widget_first_col' : '';
-
- echo "<div class=\"widget_column $widget_class $first\">";
- // button for adding new widgets
- if ($column_index == 1) {
- if ($show_add_widgets && elgg_can_edit_widgets()) {
- echo elgg_view('widgets/add_button');
- }
- }
+ echo "<div class=\"widget_column $widget_class widget_col_$column_index\">";
if (is_array($widgets) && sizeof($widgets) > 0) {
foreach ($widgets as $widget) {
echo elgg_view_entity($widget);