From: tjhunt Date: Fri, 17 Aug 2007 13:07:23 +0000 (+0000) Subject: MDL-10894 - Make block add/remove and edit permissions more consistent X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=2a4e13c5e71d7181760ce1d00079fa5994d6e98f;p=moodle.git MDL-10894 - Make block add/remove and edit permissions more consistent --- diff --git a/blocks/moodleblock.class.php b/blocks/moodleblock.class.php index 730348b7ba..49d369cd8a 100644 --- a/blocks/moodleblock.class.php +++ b/blocks/moodleblock.class.php @@ -361,20 +361,24 @@ class block_base { } $script = $page->url_get_full(array('instanceid' => $this->instance->id, 'sesskey' => $USER->sesskey)); - // place holder for roles button - $movebuttons .= '' . + // place holder for roles button + $movebuttons .= '' . ''.$this->str->assignroles.''; - $movebuttons .= '' . - ''.$title.''; + if ($this->user_can_edit()) { + $movebuttons .= '' . + ''.$title.''; + } if ($options & BLOCK_CONFIGURE && $this->user_can_edit()) { $movebuttons .= '' . ''. $this->str->configure .''; } - $movebuttons .= '' . - ''. $this->str->delete .''; + if ($this->user_can_addto($page)) { + $movebuttons .= '' . + ''. $this->str->delete .''; + } if ($options & BLOCK_MOVE_LEFT) { $movebuttons .= '' .