mirror of
https://github.com/moodle/moodle.git
synced 2025-08-10 19:36:41 +02:00
Merge branch 'MDL-73545' of https://github.com/paulholden/moodle
This commit is contained in:
commit
917aba079b
3 changed files with 11 additions and 31 deletions
|
@ -29,3 +29,10 @@ function lesson_get_completion_state() {
|
||||||
$completionclass = \mod_lesson\completion\custom_completion::class;
|
$completionclass = \mod_lesson\completion\custom_completion::class;
|
||||||
throw new coding_exception(__FUNCTION__ . "() has been removed, please use the '{$completionclass}' class instead");
|
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;
|
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.
|
* 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.
|
This files describes API changes in the lesson code.
|
||||||
|
|
||||||
|
=== 4.4 ===
|
||||||
|
|
||||||
|
* The deprecated `lesson_add_header_buttons` method has been removed
|
||||||
|
|
||||||
=== 4.0 ===
|
=== 4.0 ===
|
||||||
* Deprecated the function lesson_add_header_buttons in favour of tertiary navigation.
|
* Deprecated the function lesson_add_header_buttons in favour of tertiary navigation.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue