diff options
Diffstat (limited to 'views/default/object/widget/elements')
-rw-r--r-- | views/default/object/widget/elements/controls.php | 14 | ||||
-rw-r--r-- | views/default/object/widget/elements/settings.php | 25 |
2 files changed, 39 insertions, 0 deletions
diff --git a/views/default/object/widget/elements/controls.php b/views/default/object/widget/elements/controls.php new file mode 100644 index 000000000..57a935f62 --- /dev/null +++ b/views/default/object/widget/elements/controls.php @@ -0,0 +1,14 @@ +<?php +/** + * Elgg widget controls + * + * @uses $vars['widget'] + * @uses $vars['show_edit'] Whether to show the edit button (true) + */ + +echo elgg_view_menu('widget', array( + 'entity' => elgg_extract('widget', $vars), + '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 new file mode 100644 index 000000000..25cda58c9 --- /dev/null +++ b/views/default/object/widget/elements/settings.php @@ -0,0 +1,25 @@ +<?php +/** + * Elgg widget edit settings + * + * @uses $vars['widget'] + */ + +$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 $form; ?> +</div> |