/** * Either returns the parent version of the header bar, or a version with the logo replacing the header. * * @since Moodle 2.9 * @param array $headerinfo An array of header information, dependant on what type of header is being displayed. The following * array example is user specific. * heading => Override the page heading. * user => User object. * usercontext => user context. * @param int $headinglevel What level the 'h' tag will be. * @return string HTML for the header bar. */ public function context_header($headerinfo = null, $headinglevel = 1) { if ($headinglevel == 1 && !empty($this->page->theme->settings->logo)) { return html_writer::tag('div', '', array('class' => 'logo')); } return parent::context_header($headerinfo, $headinglevel); }
/** * Either returns the parent version of the header bar, or a version with the logo replacing the header. * * @since Moodle 2.9 * @param array $headerinfo An array of header information, dependant on what type of header is being displayed. The following * array example is user specific. * heading => Override the page heading. * user => User object. * usercontext => user context. * @param int $headinglevel What level the 'h' tag will be. * @return string HTML for the header bar. */ public function context_header($headerinfo = null, $headinglevel = 1) { if ($this->should_render_logo($headinglevel)) { return html_writer::tag('div', '', array('class' => 'logo')); } return parent::context_header($headerinfo, $headinglevel); }
/** * Either returns the parent version of the header bar, or a version with the logo replacing the header. * * @since Moodle 2.9 * @param array $headerinfo An array of header information, dependant on what type of header is being displayed. The following * array example is user specific. * heading => Override the page heading. * user => User object. * usercontext => user context. * @param int $headinglevel What level the 'h' tag will be. * @return string HTML for the header bar. */ public function context_header($headerinfo = null, $headinglevel = 1) { $html = parent::context_header($headerinfo, $headinglevel); if ($headinglevel == 1) { # replace only the overarching header $thtml = preg_replace('/(class="page-context-header)(")/', '${1} span8${2}', $html); $html = isset($thtml) && !empty($thtml) ? $thtml : $html; } return $html; }