aboutsummaryrefslogtreecommitdiff
path: root/views/default/layout/objects/widget/controls.php
diff options
context:
space:
mode:
Diffstat (limited to 'views/default/layout/objects/widget/controls.php')
-rw-r--r--views/default/layout/objects/widget/controls.php37
1 files changed, 20 insertions, 17 deletions
diff --git a/views/default/layout/objects/widget/controls.php b/views/default/layout/objects/widget/controls.php
index 79e434f1a..9693ba42f 100644
--- a/views/default/layout/objects/widget/controls.php
+++ b/views/default/layout/objects/widget/controls.php
@@ -17,24 +17,27 @@ $params = array(
);
$collapse_link = elgg_view('output/url', $params);
-$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);
+$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
<div class="elgg-widget-controls">