MDL-73545 mod_lesson: final removal of reprecated header button method.

This commit is contained in:
Paul Holden 2023-12-15 14:31:37 +00:00
parent 513f3b02c7
commit 58237bb91a
No known key found for this signature in database
GPG Key ID: A81A96D6045F6164
3 changed files with 11 additions and 31 deletions

View File

@ -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');
}

View File

@ -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.
*

View File

@ -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.