From: toyomoyo Date: Fri, 16 Feb 2007 01:26:19 +0000 (+0000) Subject: merged fixed wrong context, it should be possible to manage a single block X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=5e8adb25a54b7866d81836de166da8266aa67505;p=moodle.git merged fixed wrong context, it should be possible to manage a single block --- diff --git a/blocks/moodleblock.class.php b/blocks/moodleblock.class.php index 27cda71f1e..f0550b6622 100644 --- a/blocks/moodleblock.class.php +++ b/blocks/moodleblock.class.php @@ -297,7 +297,6 @@ class block_base { * @todo complete documenting this function. Define $options. */ function _add_edit_controls($options) { - global $CFG, $USER, $PAGE; // this is the context relevant to this particular block instance @@ -309,8 +308,7 @@ class block_base { switch ($this->instance->pagetype) { case 'course-view': - $context = get_context_instance(CONTEXT_COURSE, $this->instance->pageid); - if (!has_capability('moodle/site:manageblocks', $context)) { + if (!has_capability('moodle/site:manageblocks', $blockcontext)) { return null; } break;