mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 17:06:53 +02:00
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.
This commit is contained in:
parent
82b815c445
commit
36a2d0f508
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue