diff --git a/calendar/renderer.php b/calendar/renderer.php index be082ab9050..1c906d60535 100644 --- a/calendar/renderer.php +++ b/calendar/renderer.php @@ -176,7 +176,7 @@ class core_calendar_renderer extends plugin_renderer_base { * @param mixed $pos BLOCK_POS_RIGHT | BLOCK_POS_LEFT */ public function add_pretend_calendar_block(block_contents $bc, $pos=BLOCK_POS_RIGHT) { - $this->page->blocks->add_pretend_block($bc, $pos); + $this->page->blocks->add_fake_block($bc, $pos); } /** diff --git a/lib/blocklib.php b/lib/blocklib.php index be0831f008c..20366580a01 100644 --- a/lib/blocklib.php +++ b/lib/blocklib.php @@ -406,21 +406,34 @@ class block_manager { * Add something that looks like a block, but which isn't an actual block_instance, * to this page. * - * @param block_contents $bc the content of the block like thing. + * @param block_contents $bc the content of the block-like thing. * @param string $region a block region that exists on this page. */ - public function add_pretend_block($bc, $region) { + public function add_fake_block($bc, $region) { $this->page->initialise_theme_and_output(); if (!$this->is_known_region($region)) { $region = $this->get_default_region(); } if (array_key_exists($region, $this->visibleblockcontent)) { throw new coding_exception('block_manager has already prepared the blocks in region ' . - $region . 'for output. It is too late to add a pretend block.'); + $region . 'for output. It is too late to add a fake block.'); } $this->extracontent[$region][] = $bc; } + /** + * When the block_manager class was created, the {@link add_fake_block()} + * was called add_pretend_block, which is inconsisted with + * {@link show_only_fake_blocks()}. To fix this inconsistency, this method + * was renamed to add_fake_block. Please update your code. + * @param block_contents $bc the content of the block-like thing. + * @param string $region a block region that exists on this page. + */ + public function add_pretend_block($bc, $region) { + debugging(DEBUG_DEVELOPER, 'add_pretend_block has been renamed to add_fake_block. Please rename the method call in your code.'); + $this->add_fake_block($bc, $region); + } + /** * Checks to see whether all of the blocks within the given region are docked * diff --git a/mod/lesson/continue.php b/mod/lesson/continue.php index b9e36345f2f..5a05f364e5a 100644 --- a/mod/lesson/continue.php +++ b/mod/lesson/continue.php @@ -156,7 +156,7 @@ $PAGE->set_url('/mod/lesson/view.php', array('id' => $cm->id, 'pageid' => $page- $PAGE->set_subpage($page->id); /// Print the header, heading and tabs -lesson_add_pretend_blocks($PAGE, $cm, $lesson, $timer); +lesson_add_fake_blocks($PAGE, $cm, $lesson, $timer); echo $lessonoutput->header($lesson, $cm, 'view', true, $page->id); if ($lesson->displayleft) { diff --git a/mod/lesson/locallib.php b/mod/lesson/locallib.php index 35b898248c9..fc38819e6f5 100644 --- a/mod/lesson/locallib.php +++ b/mod/lesson/locallib.php @@ -411,23 +411,23 @@ function lesson_displayleftif($lesson) { * @param $page * @return unknown_type */ -function lesson_add_pretend_blocks($page, $cm, $lesson, $timer = null) { +function lesson_add_fake_blocks($page, $cm, $lesson, $timer = null) { $bc = lesson_menu_block_contents($cm->id, $lesson); if (!empty($bc)) { $regions = $page->blocks->get_regions(); $firstregion = reset($regions); - $page->blocks->add_pretend_block($bc, $firstregion); + $page->blocks->add_fake_block($bc, $firstregion); } $bc = lesson_mediafile_block_contents($cm->id, $lesson); if (!empty($bc)) { - $page->blocks->add_pretend_block($bc, $page->blocks->get_default_region()); + $page->blocks->add_fake_block($bc, $page->blocks->get_default_region()); } if (!empty($timer)) { $bc = lesson_clock_block_contents($cm->id, $lesson, $timer, $page); if (!empty($bc)) { - $page->blocks->add_pretend_block($bc, $page->blocks->get_default_region()); + $page->blocks->add_fake_block($bc, $page->blocks->get_default_region()); } } } diff --git a/mod/lesson/view.php b/mod/lesson/view.php index 9889dc94d96..bac76c2f789 100644 --- a/mod/lesson/view.php +++ b/mod/lesson/view.php @@ -371,7 +371,7 @@ if ($pageid != LESSON_EOL) { ob_end_clean(); } - lesson_add_pretend_blocks($PAGE, $cm, $lesson, $timer); + lesson_add_fake_blocks($PAGE, $cm, $lesson, $timer); echo $lessonoutput->header($lesson, $cm, $currenttab, $extraeditbuttons, $lessonpageid); if ($attemptflag) { echo $OUTPUT->heading(get_string('attempt', 'lesson', $retries)); @@ -553,7 +553,7 @@ if ($pageid != LESSON_EOL) { $url = new moodle_url('/grade/index.php', array('id'=>$course->id)); $lessoncontent .= html_writer::link($url, get_string('viewgrades', 'lesson'), array('class'=>'centerpadded lessonbutton standardbutton')); - lesson_add_pretend_blocks($PAGE, $cm, $lesson, $timer); + lesson_add_fake_blocks($PAGE, $cm, $lesson, $timer); echo $lessonoutput->header($lesson, $cm, $currenttab, $extraeditbuttons, $lessonpageid); echo $lessoncontent; echo $lessonoutput->footer(); diff --git a/mod/quiz/attempt.php b/mod/quiz/attempt.php index a8c95959277..252a03c81fc 100644 --- a/mod/quiz/attempt.php +++ b/mod/quiz/attempt.php @@ -97,7 +97,7 @@ // Arrange for the navigation to be displayed. $navbc = $attemptobj->get_navigation_panel('quiz_attempt_nav_panel', $page); $firstregion = reset($PAGE->blocks->get_regions()); - $PAGE->blocks->add_pretend_block($navbc, $firstregion); + $PAGE->blocks->add_fake_block($navbc, $firstregion); // Print the page header $title = get_string('attempt', 'quiz', $attemptobj->get_attempt_number()); diff --git a/mod/quiz/review.php b/mod/quiz/review.php index 7b727b9d060..e3714d02ec5 100644 --- a/mod/quiz/review.php +++ b/mod/quiz/review.php @@ -93,7 +93,7 @@ // Arrange for the navigation to be displayed. $navbc = $attemptobj->get_navigation_panel('quiz_review_nav_panel', $page, $showall); $firstregion = reset($PAGE->blocks->get_regions()); - $PAGE->blocks->add_pretend_block($navbc, $firstregion); + $PAGE->blocks->add_fake_block($navbc, $firstregion); /// Print the page header $headtags = $attemptobj->get_html_head_contributions($page);