From dffd4bb94897f391c453828e5e38fd0b66446fe4 Mon Sep 17 00:00:00 2001 From: defacer Date: Wed, 2 Mar 2005 05:56:24 +0000 Subject: [PATCH] You know you are beyond hope of redemption when you make "API uniformity" changes. ;-) --- course/format/social/format.php | 4 ++-- course/format/topics/format.php | 4 ++-- course/format/weeks/format.php | 4 ++-- index.php | 4 ++-- lib/blocklib.php | 4 ++-- mod/chat/view.php | 2 +- mod/quiz/view.php | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/course/format/social/format.php b/course/format/social/format.php index 3b768daa495..fc4f3d87401 100644 --- a/course/format/social/format.php +++ b/course/format/social/format.php @@ -25,7 +25,7 @@ echo ''; echo ''; - if(blocks_have_content($pageblocks[BLOCK_POS_LEFT]) || $editing) { + if(blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $editing) { echo ''; @@ -54,7 +54,7 @@ echo ''; // The right column - if(blocks_have_content($pageblocks[BLOCK_POS_RIGHT]) || $editing) { + if(blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $editing) { echo ''; diff --git a/course/format/topics/format.php b/course/format/topics/format.php index 6e7b09281e6..a7fcd1418c9 100644 --- a/course/format/topics/format.php +++ b/course/format/topics/format.php @@ -63,7 +63,7 @@ /// The left column ... - if (blocks_have_content($pageblocks[BLOCK_POS_LEFT]) || $editing) { + if (blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $editing) { echo ''; @@ -254,7 +254,7 @@ echo ''; // The right column - if (blocks_have_content($pageblocks[BLOCK_POS_RIGHT]) || $editing) { + if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $editing) { echo ''; diff --git a/course/format/weeks/format.php b/course/format/weeks/format.php index cff4763f2ab..7a190ed0092 100644 --- a/course/format/weeks/format.php +++ b/course/format/weeks/format.php @@ -54,7 +54,7 @@ /// The left column ... - if (blocks_have_content($pageblocks[BLOCK_POS_LEFT]) || $editing) { + if (blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $editing) { echo ''; @@ -244,7 +244,7 @@ echo ''; // The right column - if (blocks_have_content($pageblocks[BLOCK_POS_RIGHT]) || $editing) { + if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $editing) { echo ''; diff --git a/index.php b/index.php index a7cdfe35834..bdff0d4f32b 100644 --- a/index.php +++ b/index.php @@ -69,7 +69,7 @@ '; blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT); echo ''; @@ -180,7 +180,7 @@ // The right column - if(blocks_have_content($pageblocks[BLOCK_POS_RIGHT]) || $editing || isadmin()) { + if(blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $editing || isadmin()) { echo '
'; blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT); echo ''; blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT); echo ''; blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT); echo ''; blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT); echo ''; blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT); echo ''; blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT); echo '
'; if (isadmin()) { echo '
'.update_course_icon($SITE->id).'
'; diff --git a/lib/blocklib.php b/lib/blocklib.php index 6259d7e76f8..91784559611 100644 --- a/lib/blocklib.php +++ b/lib/blocklib.php @@ -169,8 +169,8 @@ function blocks_delete_instance($instance) { // Accepts an array of block instances and checks to see if any of them have content to display // (causing them to calculate their content in the process). Returns true or false. Parameter passed // by reference for speed; the array is actually not modified. -function blocks_have_content(&$instances) { - foreach($instances as $instance) { +function blocks_have_content(&$pageblocks, $position) { + foreach($pageblocks[$position] as $instance) { if (!$instance->visible) { continue; } diff --git a/mod/chat/view.php b/mod/chat/view.php index 27e48894105..65388629e75 100644 --- a/mod/chat/view.php +++ b/mod/chat/view.php @@ -69,7 +69,7 @@ echo ''; - if(blocks_have_content($pageblocks[BLOCK_POS_LEFT]) || $PAGE->user_is_editing()) { + if(blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $PAGE->user_is_editing()) { echo ''; diff --git a/mod/quiz/view.php b/mod/quiz/view.php index d1b79f166e2..fbda82d0763 100644 --- a/mod/quiz/view.php +++ b/mod/quiz/view.php @@ -67,7 +67,7 @@ echo '
'; blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT); echo '
'; - if(blocks_have_content($pageblocks[BLOCK_POS_LEFT]) || $PAGE->user_is_editing()) { + if(blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $PAGE->user_is_editing()) { echo '';
'; blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT); echo '