Commit 27affa26 authored by Ankit Agarwal's avatar Ankit Agarwal
Browse files

MDL-35226 lesson: Adding $extrapagetitle to the api mod_lesson_renderer::header()

parent c8ac4809
......@@ -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 ===
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment