aboutsummaryrefslogtreecommitdiff
path: root/views/default/object
diff options
context:
space:
mode:
Diffstat (limited to 'views/default/object')
-rw-r--r--views/default/object/widget/elements/controls.php4
-rw-r--r--views/default/object/widget/elements/settings.php14
2 files changed, 14 insertions, 4 deletions
diff --git a/views/default/object/widget/elements/controls.php b/views/default/object/widget/elements/controls.php
index d1d630c4f..57a935f62 100644
--- a/views/default/object/widget/elements/controls.php
+++ b/views/default/object/widget/elements/controls.php
@@ -8,9 +8,7 @@
echo elgg_view_menu('widget', array(
'entity' => elgg_extract('widget', $vars),
- 'params' => array(
- 'show_edit' => elgg_extract('show_edit', $vars, true)
- ),
+ 'show_edit' => elgg_extract('show_edit', $vars, true),
'sort_by' => 'priority',
'class' => 'elgg-menu-hz',
));
diff --git a/views/default/object/widget/elements/settings.php b/views/default/object/widget/elements/settings.php
index 5afe56ed8..25cda58c9 100644
--- a/views/default/object/widget/elements/settings.php
+++ b/views/default/object/widget/elements/settings.php
@@ -6,8 +6,20 @@
*/
$widget = elgg_extract('widget', $vars);
+
+// not using elgg_view_form() so that we can detect if the form is empty
+$form_body = elgg_view('forms/widgets/save', $vars);
+if (!$form_body) {
+ return true;
+}
+
+$form = elgg_view('input/form', array(
+ 'action' => 'action/widgets/save',
+ 'body' => $form_body,
+ 'class' => 'elgg-form-widgets-save',
+));
?>
<div class="elgg-widget-edit" id="widget-edit-<?php echo $widget->guid; ?>">
- <?php echo elgg_view_form('widgets/save', array(), $vars); ?>
+ <?php echo $form; ?>
</div>