mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
MDL-12744 - Add ability to pass an extra button for use in print header for modules that use the course page to display themselves with blocks.
This commit is contained in:
parent
5a8100234f
commit
7cdb6ee4a9
2 changed files with 8 additions and 2 deletions
|
@ -366,7 +366,7 @@ class page_course extends page_base {
|
||||||
|
|
||||||
// This function prints out the common part of the page's header.
|
// This function prints out the common part of the page's header.
|
||||||
// You should NEVER print the header "by hand" in other code.
|
// You should NEVER print the header "by hand" in other code.
|
||||||
function print_header($title, $morebreadcrumbs=NULL, $meta='', $bodytags='') {
|
function print_header($title, $morebreadcrumbs=NULL, $meta='', $bodytags='', $extrabuttons='') {
|
||||||
global $USER, $CFG;
|
global $USER, $CFG;
|
||||||
|
|
||||||
$this->init_full();
|
$this->init_full();
|
||||||
|
@ -405,6 +405,11 @@ class page_course extends page_base {
|
||||||
$buttons = switchroles_form($this->courserecord->id) . update_course_icon($this->courserecord->id );
|
$buttons = switchroles_form($this->courserecord->id) . update_course_icon($this->courserecord->id );
|
||||||
$buttons = empty($morebreadcrumbs) ? $buttons : ' ';
|
$buttons = empty($morebreadcrumbs) ? $buttons : ' ';
|
||||||
|
|
||||||
|
// Add any extra buttons requested (by the resource module, for example)
|
||||||
|
if ($extrabuttons != '') {
|
||||||
|
$buttons = ($buttons == ' ') ? $extrabuttons : $buttons.$extrabuttons;
|
||||||
|
}
|
||||||
|
|
||||||
print_header($title, $this->courserecord->fullname, $crumbtext,
|
print_header($title, $this->courserecord->fullname, $crumbtext,
|
||||||
'', $meta, true, $buttons, user_login_string($this->courserecord, $USER), false, $bodytags);
|
'', $meta, true, $buttons, user_login_string($this->courserecord, $USER), false, $bodytags);
|
||||||
|
|
||||||
|
|
|
@ -163,7 +163,8 @@ function display_course_blocks_start() {
|
||||||
$morebreadcrumbs = array($this->strresources => 'index.php?id='.$this->course->id,
|
$morebreadcrumbs = array($this->strresources => 'index.php?id='.$this->course->id,
|
||||||
$this->resource->name => '');
|
$this->resource->name => '');
|
||||||
|
|
||||||
$PAGE->print_header($this->course->shortname.': %fullname%', $morebreadcrumbs);
|
$PAGE->print_header($this->course->shortname.': %fullname%', $morebreadcrumbs, "", "",
|
||||||
|
update_module_button($this->cm->id, $this->course->id, $this->strresource));
|
||||||
|
|
||||||
echo '<table id="layout-table"><tr>';
|
echo '<table id="layout-table"><tr>';
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue