aboutsummaryrefslogtreecommitdiff
path: root/views/default/layouts
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-11-18 16:13:34 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-11-18 16:13:34 +0000
commitc5854870424d87372bcc86a7edf75b9bf8841825 (patch)
tree99dc5d53e82ba6decf27846e574ac9826f5743b2 /views/default/layouts
parent522fccf9ed173e3a5a68b3a616a3b7e1961bc22b (diff)
downloadelgg-c5854870424d87372bcc86a7edf75b9bf8841825.tar.gz
elgg-c5854870424d87372bcc86a7edf75b9bf8841825.tar.bz2
Refs #1793 added ability to add widgets to layout through ajax
git-svn-id: http://code.elgg.org/elgg/trunk@7338 36083f99-b078-4883-b0ff-0f9b5a30f544
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);