aboutsummaryrefslogtreecommitdiff
path: root/views/default/widgets/wrapper.php
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-16 09:16:09 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-16 09:16:09 +0000
commit02656d384074c068d7f50aaa3acaa160b5fbbba0 (patch)
tree07fa714659ecf8f1564c13643861d2556c508666 /views/default/widgets/wrapper.php
parent241bc2dbf0b5dfbca9d125c65ab67c362a8acb93 (diff)
downloadelgg-02656d384074c068d7f50aaa3acaa160b5fbbba0.tar.gz
elgg-02656d384074c068d7f50aaa3acaa160b5fbbba0.tar.bz2
Widget edit controls now only appear if you can edit the widget in question.
git-svn-id: https://code.elgg.org/elgg/trunk@925 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/widgets/wrapper.php')
-rw-r--r--views/default/widgets/wrapper.php14
1 files changed, 12 insertions, 2 deletions
diff --git a/views/default/widgets/wrapper.php b/views/default/widgets/wrapper.php
index 41f9dcb90..bf77aea62 100644
--- a/views/default/widgets/wrapper.php
+++ b/views/default/widgets/wrapper.php
@@ -11,7 +11,7 @@
* @link http://elgg.org/
*/
- if ($vars['entity'] instanceof ElggObject && $vars['entity']->subtype = 'widget') {
+ if ($vars['entity'] instanceof ElggObject && $vars['entity']->getSubtype() == 'widget') {
$handler = $vars['entity']->handler;
$title = $vars['entity']->title;
} else {
@@ -23,9 +23,14 @@
<div class="collapsable_box">
<div class="collapsable_box_header">
- <a href="javascript:void(0);" class="toggle_box_contents">-</a><a href="javascript:void(0);" class="toggle_box_edit_panel"><?php echo elgg_echo('edit'); ?></a>
+ <a href="javascript:void(0);" class="toggle_box_contents">-</a><?php if ($vars['entity']->canEdit()) { ?><a href="javascript:void(0);" class="toggle_box_edit_panel"><?php echo elgg_echo('edit'); ?></a><?php } ?>
<h1><?php echo $title; ?></h1>
</div>
+ <?php
+
+ if ($vars['entity']->canEdit()) {
+
+ ?>
<div class="collapsable_box_editpanel"><?php
echo elgg_view('widgets/editwrapper',
@@ -36,6 +41,11 @@
);
?></div><!-- /collapsable_box_editpanel -->
+ <?php
+
+ }
+
+ ?>
<div class="collapsable_box_content">
<?php echo elgg_view("widgets/{$handler}/view",$vars); ?>
</div><!-- /.collapsable_box_content -->