diff --git a/mod/lesson/deprecatedlib.php b/mod/lesson/deprecatedlib.php index b1929f66a34..7eccd695c7c 100644 --- a/mod/lesson/deprecatedlib.php +++ b/mod/lesson/deprecatedlib.php @@ -29,3 +29,10 @@ function lesson_get_completion_state() { $completionclass = \mod_lesson\completion\custom_completion::class; throw new coding_exception(__FUNCTION__ . "() has been removed, please use the '{$completionclass}' class instead"); } + +/** + * @deprecated since Moodle 4.0 + */ +function lesson_add_header_buttons() { + throw new coding_exception(__FUNCTION__ . '() has been removed'); +} diff --git a/mod/lesson/locallib.php b/mod/lesson/locallib.php index 0d089adbaf1..967d726d89e 100644 --- a/mod/lesson/locallib.php +++ b/mod/lesson/locallib.php @@ -567,37 +567,6 @@ function lesson_menu_block_contents($cmid, $lesson) { return $bc; } -/** - * Adds header buttons to the page for the lesson - * - * @deprecated since Moodle 4.0 in favour of tertiary navigation. - * @todo MDL-73545 This will be deleted in Moodle 4.4 - * @param object $cm - * @param object $context - * @param bool $extraeditbuttons - * @param int $lessonpageid - */ -function lesson_add_header_buttons($cm, $context, $extraeditbuttons=false, $lessonpageid=null) { - global $CFG, $PAGE, $OUTPUT; - - debugging('lesson_add_header_buttons() is deprecated in favour of tertiary navigation.', DEBUG_DEVELOPER); - - if (has_capability('mod/lesson:edit', $context) && $extraeditbuttons) { - if ($lessonpageid === null) { - throw new \moodle_exception('invalidpageid', 'lesson'); - } - if (!empty($lessonpageid) && $lessonpageid != LESSON_EOL) { - $url = new moodle_url('/mod/lesson/editpage.php', array( - 'id' => $cm->id, - 'pageid' => $lessonpageid, - 'edit' => 1, - 'returnto' => $PAGE->url->out_as_local_url(false) - )); - $PAGE->set_button($OUTPUT->single_button($url, get_string('editpagecontent', 'lesson'))); - } - } -} - /** * This is a function used to detect media types and generate html code. * diff --git a/mod/lesson/upgrade.txt b/mod/lesson/upgrade.txt index 8894913f4da..0ce6fa5997c 100644 --- a/mod/lesson/upgrade.txt +++ b/mod/lesson/upgrade.txt @@ -1,5 +1,9 @@ This files describes API changes in the lesson code. +=== 4.4 === + +* The deprecated `lesson_add_header_buttons` method has been removed + === 4.0 === * Deprecated the function lesson_add_header_buttons in favour of tertiary navigation.