Skip to content

Commit

Permalink
MDL-50059 Output: Remove heading param from full_header
Browse files Browse the repository at this point in the history
It was only used for a hack in clean to show the logo.
  • Loading branch information
Damyon Wiese committed May 4, 2015
1 parent dd636ab commit 3454072
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
10 changes: 2 additions & 8 deletions lib/outputrenderers.php
Original file line number Diff line number Diff line change
Expand Up @@ -4120,17 +4120,11 @@ protected function render_context_header(context_header $contextheader) {
/**
* Wrapper for header elements.
*
* @param string $heading Heading to be used for the main header.
* @return string HTML to display the main header.
*/
public function full_header($heading = null) {
public function full_header() {
$html = html_writer::start_tag('header', array('id' => 'page-header', 'class' => 'clearfix'));
// This is to ensure that the logo completely overwrites the header if set.
if (isset($heading) && $heading == '<div class="logo"></div>') {
$html .= $heading;
} else {
$html .= $this->context_header(array('heading' => $heading));
}
$html .= $this->context_header();
$html .= html_writer::start_div('clearfix', array('id' => 'page-navbar'));
$html .= html_writer::tag('nav', $this->navbar(), array('class' => 'breadcrumb-nav'));
$html .= html_writer::div($this->page_heading_button(), 'breadcrumb-button');
Expand Down
23 changes: 13 additions & 10 deletions theme/clean/classes/core_renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,21 @@
class theme_clean_core_renderer extends theme_bootstrapbase_core_renderer {

/**
* Wrapper for header elements.
* Either returns the parent version of the header bar, or a version with the logo replacing the header.
*
* We override this renderer helper in order to inject the logo into the theme.
*
* @param string $heading Heading to be used for the main header.
* @return string HTML to display the main 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 full_header($heading = null) {
if (!empty($this->page->theme->settings->logo)) {
return parent::full_header(html_writer::tag('div', '', array('class' => 'logo')));
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::full_header();
return parent::context_header($headerinfo, $headinglevel);
}

}

0 comments on commit 3454072

Please sign in to comment.