Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
moodle
moodle
Commits
27affa26
Commit
27affa26
authored
Sep 14, 2012
by
Ankit Agarwal
Browse files
MDL-35226 lesson: Adding $extrapagetitle to the api mod_lesson_renderer::header()
parent
c8ac4809
Changes
3
Hide whitespace changes
Inline
Side-by-side
mod/lesson/renderer.php
View file @
27affa26
...
...
@@ -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
);
...
...
mod/lesson/view.php
View file @
27affa26
...
...
@@ -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
);
...
...
mod/upgrade.txt
View file @
27affa26
...
...
@@ -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 ===
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment