mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
MDL-73545 mod_lesson: final removal of reprecated header button method.
This commit is contained in:
parent
513f3b02c7
commit
58237bb91a
@ -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');
|
||||
}
|
||||
|
@ -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.
|
||||
*
|
||||
|
@ -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.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user