diff options
author | Cash Costello <cash.costello@gmail.com> | 2012-06-16 12:33:57 -0400 |
---|---|---|
committer | Cash Costello <cash.costello@gmail.com> | 2012-06-16 12:33:57 -0400 |
commit | 7d8064039f17059c4d87112dd107f828cf6c661a (patch) | |
tree | cf0ef85cd66ecf710455dc23390b07435ef3e1fa | |
parent | c58102ebcf60334f6902ba1df1aaee7104f6ba0d (diff) | |
download | elgg-7d8064039f17059c4d87112dd107f828cf6c661a.tar.gz elgg-7d8064039f17059c4d87112dd107f828cf6c661a.tar.bz2 |
Fixes #3463 not showing edit icon for widgets when nothing to edit
-rw-r--r-- | views/default/object/widget/elements/controls.php | 4 | ||||
-rw-r--r-- | views/default/object/widget/elements/settings.php | 14 |
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> |