mirror of
https://github.com/moodle/moodle.git
synced 2025-05-14 04:06:39 +02:00
MDL-35226 lesson: Adding $extrapagetitle to the api mod_lesson_renderer::header()
This commit is contained in:
parent
c8ac480979
commit
27affa2622
mod
@ -30,17 +30,22 @@ class mod_lesson_renderer extends plugin_renderer_base {
|
||||
/**
|
||||
* Returns the header for the lesson module
|
||||
*
|
||||
* @param lesson $lesson
|
||||
* @param string $currenttab
|
||||
* @param bool $extraeditbuttons
|
||||
* @param int $lessonpageid
|
||||
* @param lesson $lesson a lesson object.
|
||||
* @param string $currenttab current tab that is shown.
|
||||
* @param bool $extraeditbuttons if extra edit buttons should be displayed.
|
||||
* @param int $lessonpageid id of the lesson page that needs to be displayed.
|
||||
* @param string $extrapagetitle String to appent to the page title.
|
||||
* @return string
|
||||
*/
|
||||
public function header($lesson, $cm, $currenttab = '', $extraeditbuttons = false, $lessonpageid = null) {
|
||||
public function header($lesson, $cm, $currenttab = '', $extraeditbuttons = false, $lessonpageid = null, $extrapagetitle = null) {
|
||||
global $CFG;
|
||||
|
||||
$activityname = format_string($lesson->name, true, $lesson->course);
|
||||
$title = $this->page->course->shortname.": ".$activityname;
|
||||
if (empty($extrapagetitle)) {
|
||||
$title = $this->page->course->shortname.": ".$activityname;
|
||||
} else {
|
||||
$title = $this->page->course->shortname.": ".$activityname.": ".$extrapagetitle;
|
||||
}
|
||||
|
||||
// Build the buttons
|
||||
$context = context_module::instance($cm->id);
|
||||
|
@ -349,6 +349,7 @@ if ($pageid != LESSON_EOL) {
|
||||
$currenttab = 'view';
|
||||
$extraeditbuttons = true;
|
||||
$lessonpageid = $page->id;
|
||||
$extrapagetitle = $page->title;
|
||||
|
||||
if (($edit != -1) && $PAGE->user_allowed_editing()) {
|
||||
$USER->editing = $edit;
|
||||
@ -387,7 +388,7 @@ if ($pageid != LESSON_EOL) {
|
||||
}
|
||||
|
||||
lesson_add_fake_blocks($PAGE, $cm, $lesson, $timer);
|
||||
echo $lessonoutput->header($lesson, $cm, $currenttab, $extraeditbuttons, $lessonpageid);
|
||||
echo $lessonoutput->header($lesson, $cm, $currenttab, $extraeditbuttons, $lessonpageid, $extrapagetitle);
|
||||
if ($attemptflag) {
|
||||
// We are using level 3 header because attempt heading is a sub-heading of lesson title (MDL-30911).
|
||||
echo $OUTPUT->heading(get_string('attempt', 'lesson', $retries), 3);
|
||||
|
@ -8,6 +8,10 @@ new features:
|
||||
|
||||
* mod/xxx/adminlib.php may now include 'plugininfo_yoursubplugintype' class definition
|
||||
used by plugin_manager; it is recommended to store extra admin settings classes in this file
|
||||
|
||||
optional - no changes needed:
|
||||
|
||||
* mod_lesson_renderer::header() now accepts an additional parameter $extrapagetitle
|
||||
|
||||
=== 2.3 ===
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user