From 24acdc993bbb06bb2f468781c90ead49bcbb682b Mon Sep 17 00:00:00 2001 From: defacer Date: Fri, 13 Jan 2006 16:20:40 +0000 Subject: [PATCH] Fixing a bug, see http://moodle.org/mod/forum/discuss.php?d=37545 Instead of grabbing variables defined by the course format with global $var; the block now recomputes them itself. Of course this also introduces a (significant?) performance hit. I think it's much preferable to "live with" the hit until a good solution is developed rather than have a hacky solution that could break anytime for any obscure reason (case in point). Objections? --- blocks/activity_modules/block_activity_modules.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/blocks/activity_modules/block_activity_modules.php b/blocks/activity_modules/block_activity_modules.php index 289fdc20acd..81c4024a2e0 100644 --- a/blocks/activity_modules/block_activity_modules.php +++ b/blocks/activity_modules/block_activity_modules.php @@ -3,14 +3,13 @@ class block_activity_modules extends block_list { function init() { $this->title = get_string('activities'); - $this->version = 2004041000; + $this->version = 2006011300; } function get_content() { global $USER, $CFG; - // This is really NOT pretty, but let's do it simple for now... - global $modnamesused, $modnamesplural; + get_all_mods($this->instance->pageid, $mods, $modnames, $modnamesplural, $modnamesused); if($this->content !== NULL) { return $this->content;