From 36a2d0f5080d5504553cacafba05057ed09bbe12 Mon Sep 17 00:00:00 2001 From: moodler Date: Wed, 30 Jun 2004 13:17:59 +0000 Subject: [PATCH] Pass the current course to the block class when creating it to find the name of the block. This allows the class to return different result depending on the course it is in. --- lib/blocklib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/blocklib.php b/lib/blocklib.php index 52a1c98ba2..f6ea7fc117 100644 --- a/lib/blocklib.php +++ b/lib/blocklib.php @@ -355,7 +355,7 @@ function block_find($blockid, $leftblocks, $rightblocks) { } //This function prints the block to admin blocks as necessary -function block_print_blocks_admin($course, $missingblocks) { +function block_print_blocks_admin(&$course, $missingblocks) { if (isediting($course->id)) { $strblocks = get_string('blocks'); $stradd = get_string('add'); @@ -363,7 +363,7 @@ function block_print_blocks_admin($course, $missingblocks) { $blockdata = get_records_list('blocks', 'id', implode(',', $missingblocks)); if ($blockdata !== false) { foreach ($blockdata as $block) { - $blockobject = block_instance($block->name, NULL); + $blockobject = block_instance($block->name, $course); if ($blockobject === false) { continue; } -- 2.39.5