}
else {
// We need to show the config screen, so we highjack the display logic and then die
- $page->print_header(get_string('pageheaderconfigablock', 'moodle'));
- print_heading(get_string('blockconfiga', 'moodle', $block->name));
+ $strheading = get_string('blockconfiga', 'moodle', $block->name);
+ $page->print_header(get_string('pageheaderconfigablock', 'moodle'), array($strheading => ''));
+ print_heading($strheading);
echo '<form method="post" action="'. $page->url_get_path() .'">';
echo '<p>';
foreach($hiddendata as $name => $val) {
// HTML OUTPUT SECTION
// We have absolutely no idea what derived pages are all about
- function print_header($title) {
+ function print_header($title, $morebreadcrumbs) {
trigger_error('Page class does not implement method <strong>print_header()</strong>', E_USER_WARNING);
return;
}
// This function prints out the common part of the page's header.
// You should NEVER print the header "by hand" in other code.
- function print_header($title) {
- global $USER;
+ function print_header($title, $morebreadcrumbs = NULL) {
+ global $USER, $CFG;
+
$this->init_full();
$replacements = array(
'%fullname%' => $this->courserecord->fullname
$title = str_replace($search, $replace, $title);
}
+ $breadcrumbs = array($this->courserecord->shortname => $CFG->wwwroot.'/course/view.php?id='.$this->courserecord->id);
+ if(!empty($morebreadcrumbs)) {
+ $breadcrumbs = array_merge($breadcrumbs, $morebreadcrumbs);
+ }
+
+ $total = count($breadcrumbs);
+ $current = 1;
+ $crumbtext = '';
+ foreach($breadcrumbs as $text => $href) {
+ if($current++ == $total) {
+ $crumbtext .= ' '.$text;
+ }
+ else {
+ $crumbtext .= ' <a href="'.$href.'">'.$text.'</a> ->';
+ }
+ }
+
$loggedinas = '<p class="logininfo">'. user_login_string($this->courserecord, $USER) .'</p>';
- print_header($title, $this->courserecord->fullname, $this->courserecord->shortname,
- '', '', true, update_course_icon($this->courserecord->id), $loggedinas);
+ print_header($title, $this->courserecord->fullname, $crumbtext,
+ '', '', true, ' ', $loggedinas);
}
// SELF-REPORTING SECTION