From 5e8adb25a54b7866d81836de166da8266aa67505 Mon Sep 17 00:00:00 2001 From: toyomoyo Date: Fri, 16 Feb 2007 01:26:19 +0000 Subject: [PATCH] merged fixed wrong context, it should be possible to manage a single block --- blocks/moodleblock.class.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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; -- 2.39.5