From 0f41ed53843e0f0e5d8257e72be6bec15a5f5b1b Mon Sep 17 00:00:00 2001 From: cash Date: Thu, 30 Dec 2010 21:34:53 +0000 Subject: allow anyone to minimize a widget git-svn-id: http://code.elgg.org/elgg/trunk@7779 36083f99-b078-4883-b0ff-0f9b5a30f544 --- views/default/layout/objects/widget.php | 4 +-- views/default/layout/objects/widget/controls.php | 37 +++++++++++++----------- 2 files changed, 21 insertions(+), 20 deletions(-) (limited to 'views/default/layout/objects') diff --git a/views/default/layout/objects/widget.php b/views/default/layout/objects/widget.php index 1ba274aa6..d9a0681af 100644 --- a/views/default/layout/objects/widget.php +++ b/views/default/layout/objects/widget.php @@ -28,9 +28,7 @@ $widget_instance = "elgg-widget-instance-$handler";

$widget)); - } + echo elgg_view('layout/objects/widget/controls', array('widget' => $widget)); ?>
' ', - 'title' => elgg_echo('widget:delete', array($widget->getTitle())), - 'href' => elgg_get_site_url() . "action/widgets/delete?guid=$widget->guid", - 'is_action' => true, - 'class' => 'elgg-widget-delete-button', - 'internalid' => "elgg-widget-delete-button-$widget->guid" -); -$delete_link = elgg_view('output/url', $params); +$delete_link = $edit_link = ''; +if ($widget->canEdit()) { + $params = array( + 'text' => ' ', + 'title' => elgg_echo('widget:delete', array($widget->getTitle())), + 'href' => elgg_get_site_url() . "action/widgets/delete?guid=$widget->guid", + 'is_action' => true, + 'class' => 'elgg-widget-delete-button', + 'internalid' => "elgg-widget-delete-button-$widget->guid" + ); + $delete_link = elgg_view('output/url', $params); -$params = array( - 'text' => ' ', - 'title' => elgg_echo('widget:edit'), - 'href' => "#", - 'class' => 'elgg-widget-edit-button elgg-toggle', - 'internalid' => "elgg-toggler-widget-$widget->guid" -); -$edit_link = elgg_view('output/url', $params); + $params = array( + 'text' => ' ', + 'title' => elgg_echo('widget:edit'), + 'href' => "#", + 'class' => 'elgg-widget-edit-button elgg-toggle', + 'internalid' => "elgg-toggler-widget-$widget->guid" + ); + $edit_link = elgg_view('output/url', $params); +} echo <<<___END
-- cgit v1.2.3