. require_once($CFG->dirroot . '/theme/bootstrapbase/renderers.php'); /** * Clean core renderers. * * @package theme_clean * @copyright 2015 Frédéric Massart - FMCorz.net * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class theme_clean_core_renderer extends theme_bootstrapbase_core_renderer { /** * 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); } /** * Determines if we should render the logo. * * @param int $headinglevel What level the 'h' tag will be. * @return bool Should the logo be rendered. */ protected function should_render_logo($headinglevel = 1) { global $PAGE; // Only render the logo if we're on the front page or login page // and the theme has a logo. if ($headinglevel == 1 && !empty($this->page->theme->settings->logo)) { if ($PAGE->pagelayout == 'frontpage' || $PAGE->pagelayout == 'login') { return true; } } return false; } }