*/
public function page_set_cm(moodle_page $page) {
}
+
+ /**
+ * Course-specific information to be output on any course page (usually above navigation bar)
+ *
+ * Example of usage:
+ * define
+ * class format_FORMATNAME_XXX implements renderable {}
+ *
+ * create format renderer in course/format/FORMATNAME/renderer.php, define rendering function:
+ * class format_FORMATNAME_renderer extends plugin_renderer_base {
+ * protected function render_format_FORMATNAME_XXX(format_FORMATNAME_XXX $xxx) {
+ * return html_writer::tag('div', 'This is my header/footer');
+ * }
+ * }
+ *
+ * Return instance of format_FORMATNAME_XXX in this function, the appropriate method from
+ * plugin renderer will be called
+ *
+ * @return null|renderable null for no output or object with data for plugin renderer
+ */
+ public function course_header() {
+ return null;
+ }
+
+ /**
+ * Course-specific information to be output on any course page (usually in the beginning of
+ * standard footer)
+ *
+ * See {@link format_base::course_header()} for usage
+ *
+ * @return null|renderable null for no output or object with data for plugin renderer
+ */
+ public function course_footer() {
+ return null;
+ }
+
+ /**
+ * Course-specific information to be output immediately above content on any course page
+ *
+ * See {@link format_base::course_header()} for usage
+ *
+ * @return null|renderable null for no output or object with data for plugin renderer
+ */
+ public function course_content_header() {
+ return null;
+ }
+
+ /**
+ * Course-specific information to be output immediately below content on any course page
+ *
+ * See {@link format_base::course_header()} for usage
+ *
+ * @return null|renderable null for no output or object with data for plugin renderer
+ */
+ public function course_content_footer() {
+ return null;
+ }
+
+ /**
+ * Returns instance of page renderer used by this plugin
+ *
+ * @param moodle_page $page
+ * @return renderer_base
+ */
+ public function get_renderer(moodle_page $page) {
+ return $page->get_renderer('format_'. $this->get_format());
+ }
}
/**
$header = $this->doctype() . $header;
}
+ // If this theme version is below 2.4 release and this is a course view page
+ if ((!isset($this->page->theme->settings->version) || $this->page->theme->settings->version < 2012101500) &&
+ $this->page->pagelayout === 'course' && $this->page->url->compare(new moodle_url('/course/view.php'), URL_MATCH_BASE)) {
+ // check if course content header/footer have not been output during render of theme layout
+ $coursecontentheader = $this->course_content_header(true);
+ $coursecontentfooter = $this->course_content_footer(true);
+ if (!empty($coursecontentheader)) {
+ // display debug message and add header and footer right above and below main content
+ // Please note that course header and footer (to be displayed above and below the whole page)
+ // are not displayed in this case at all.
+ // Besides the content header and footer are not displayed on any other course page
+ debugging('The current theme is not optimised for 2.4, the course-specific header and footer defined in course format will not be output', DEBUG_DEVELOPER);
+ $header .= $coursecontentheader;
+ $footer = $coursecontentfooter. $footer;
+ }
+ }
+
send_headers($this->contenttype, $this->page->cacheable);
$this->opencontainers->push('header/footer', $footer);
return $this->opencontainers->pop_all_but_last($shouldbenone);
}
+ /**
+ * Returns course-specific information to be output immediately above content on any course page
+ * (for the current course)
+ *
+ * @param bool $onlyifnotcalledbefore output content only if it has not been output before
+ * @return string
+ */
+ public function course_content_header($onlyifnotcalledbefore = false) {
+ global $CFG;
+ if ($this->page->course->id == SITEID) {
+ // return immediately and do not include /course/lib.php if not necessary
+ return '';
+ }
+ static $functioncalled = false;
+ if ($functioncalled && $onlyifnotcalledbefore) {
+ // we have already output the content header
+ return '';
+ }
+ require_once($CFG->dirroot.'/course/lib.php');
+ $functioncalled = true;
+ $courseformat = course_get_format($this->page->course);
+ if (($obj = $courseformat->course_content_header()) !== null) {
+ return $courseformat->get_renderer($this->page)->render($obj);
+ }
+ return '';
+ }
+
+ /**
+ * Returns course-specific information to be output immediately below content on any course page
+ * (for the current course)
+ *
+ * @param bool $onlyifnotcalledbefore output content only if it has not been output before
+ * @return string
+ */
+ public function course_content_footer($onlyifnotcalledbefore = false) {
+ global $CFG;
+ if ($this->page->course->id == SITEID) {
+ // return immediately and do not include /course/lib.php if not necessary
+ return '';
+ }
+ static $functioncalled = false;
+ if ($functioncalled && $onlyifnotcalledbefore) {
+ // we have already output the content footer
+ return '';
+ }
+ $functioncalled = true;
+ require_once($CFG->dirroot.'/course/lib.php');
+ $courseformat = course_get_format($this->page->course);
+ if (($obj = $courseformat->course_content_footer()) !== null) {
+ return $courseformat->get_renderer($this->page)->render($obj);
+ }
+ return '';
+ }
+
+ /**
+ * Returns course-specific information to be output on any course page in the header area
+ * (for the current course)
+ *
+ * @return string
+ */
+ public function course_header() {
+ global $CFG;
+ if ($this->page->course->id == SITEID) {
+ // return immediately and do not include /course/lib.php if not necessary
+ return '';
+ }
+ require_once($CFG->dirroot.'/course/lib.php');
+ $courseformat = course_get_format($this->page->course);
+ if (($obj = $courseformat->course_header()) !== null) {
+ return $courseformat->get_renderer($this->page)->render($obj);
+ }
+ return '';
+ }
+
+ /**
+ * Returns course-specific information to be output on any course page in the footer area
+ * (for the current course)
+ *
+ * @return string
+ */
+ public function course_footer() {
+ global $CFG;
+ if ($this->page->course->id == SITEID) {
+ // return immediately and do not include /course/lib.php if not necessary
+ return '';
+ }
+ require_once($CFG->dirroot.'/course/lib.php');
+ $courseformat = course_get_format($this->page->course);
+ if (($obj = $courseformat->course_footer()) !== null) {
+ return $courseformat->get_renderer($this->page)->render($obj);
+ }
+ return '';
+ }
+
/**
* Returns lang menu or '', this method also checks forcing of languages in courses.
*
'popup' => array(
'file' => 'default.php',
'regions' => array(),
- 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'nocustommenu'=>true, 'nologininfo'=>true),
+ 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'nocustommenu'=>true, 'nologininfo'=>true, 'nocourseheaderfooter'=>true),
),
// No blocks and minimal footer - used for legacy frame layouts only!
'frametop' => array(
'file' => 'default.php',
'regions' => array(),
- 'options' => array('nofooter'=>true),
+ 'options' => array('nofooter'=>true, 'nocoursefooter'=>true),
),
// Embedded pages, like iframe/object embeded in moodleform - it needs as much space as possible
'embedded' => array(
'maintenance' => array(
'file' => 'default.php',
'regions' => array(),
- 'options' => array('noblocks'=>true, 'nofooter'=>true, 'nonavbar'=>true, 'nocustommenu'=>true),
+ 'options' => array('noblocks'=>true, 'nofooter'=>true, 'nonavbar'=>true, 'nocustommenu'=>true, 'nocourseheaderfooter'=>true),
),
// Should display the content and basic headers only.
'print' => array(
'file' => 'default.php',
'regions' => array(),
- 'options' => array('noblocks'=>true, 'nofooter'=>true, 'nonavbar'=>false, 'nocustommenu'=>true),
+ 'options' => array('noblocks'=>true, 'nofooter'=>true, 'nonavbar'=>false, 'nocustommenu'=>true, 'nocourseheaderfooter'=>true),
),
// The pagelayout used when a redirection is occuring.
'redirect' => array(
'file' => 'default.php',
'regions' => array('side-pre', 'side-post'),
'defaultregion' => 'side-pre',
- 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'nocustommenu'=>true, 'nologinlinks'=>true),
+ 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'nocustommenu'=>true, 'nologinlinks'=>true, 'nocourseheaderfooter'=>true),
),
);
$hasfootnote = (!empty($PAGE->theme->settings->footnote));
+$courseheader = $coursecontentheader = $coursecontentfooter = $coursefooter = '';
+if (empty($PAGE->layout_options['nocourseheaderfooter'])) {
+ $courseheader = $OUTPUT->course_header();
+ $coursecontentheader = $OUTPUT->course_content_header();
+ if (empty($PAGE->layout_options['nocoursefooter'])) {
+ $coursecontentfooter = $OUTPUT->course_content_footer();
+ $coursefooter = $OUTPUT->course_footer();
+ }
+}
+
$bodyclasses = array();
if ($showsidepre && !$showsidepost) {
if (!right_to_left()) {
<?php echo $OUTPUT->standard_top_of_body_html() ?>
<div id="page-wrapper">
<div id="page">
- <?php if ($hasheading || $hasnavbar) { ?>
- <div id="page-header">
- <?php if ($hasheading) { ?>
+ <?php if ($hasheading) { ?>
+ <div id="page-header">
<a class="logo" href="<?php echo $CFG->wwwroot; ?>" title="<?php print_string('home'); ?>"></a>
<div class="headermenu"><?php
if ($haslogininfo) {
}
echo $PAGE->headingmenu
?></div>
- <?php } ?>
- </div>
-<?php } ?>
+ </div>
+ <?php } ?>
<!-- END OF HEADER -->
<!-- START CUSTOMMENU AND NAVBAR -->
<div id="navcontainer">
</div>
+ <?php if (!empty($courseheader)) { ?>
+ <div id="course-header"><?php echo $courseheader; ?></div>
+ <?php } ?>
+
<?php if ($hasnavbar) { ?>
<div class="navbar clearfix">
<div class="breadcrumb"><?php echo $OUTPUT->navbar(); ?></div>
<div id="region-pre-box">
<div id="region-main">
<div class="region-content">
+ <?php echo $coursecontentheader; ?>
<?php echo $OUTPUT->main_content() ?>
+ <?php echo $coursecontentfooter; ?>
</div>
</div>
</div>
<!-- START OF FOOTER -->
+ <?php if (!empty($coursefooter)) { ?>
+ <div id="course-footer"><?php echo $coursefooter; ?></div>
+ <?php } ?>
<?php if ($hasfooter) { ?>
<div id="page-footer" class="clearfix">
'popup' => array(
'file' => 'general.php',
'regions' => array(),
- 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'noblocks'=>true),
+ 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'noblocks'=>true, 'nocourseheaderfooter'=>true),
),
// No blocks and minimal footer - used for legacy frame layouts only!
'frametop' => array(
'file' => 'general.php',
'regions' => array(),
- 'options' => array('nofooter', 'noblocks'=>true),
+ 'options' => array('nofooter', 'noblocks'=>true, 'nocoursefooter'=>true),
),
// Embeded pages, like iframe embeded in moodleform
'embedded' => array(
'file' => 'general.php',
'regions' => array(),
- 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'noblocks'=>true),
+ 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'noblocks'=>true, 'nocourseheaderfooter'=>true),
),
// Used during upgrade and install, and for the 'This site is undergoing maintenance' message.
// This must not have any blocks, and it is good idea if it does not have links to
'maintenance' => array(
'file' => 'general.php',
'regions' => array(),
- 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'noblocks'=>true),
+ 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'noblocks'=>true, 'nocourseheaderfooter'=>true),
),
// Should display the content and basic headers only.
'print' => array(
'file' => 'general.php',
'regions' => array(),
- 'options' => array('nofooter'=>true, 'nonavbar'=>false, 'noblocks'=>true),
+ 'options' => array('nofooter'=>true, 'nonavbar'=>false, 'noblocks'=>true, 'nocourseheaderfooter'=>true),
),
'report' => array(
'file' => 'report.php',
$bodyclasses[] = 'hasnavbar';
}
+$courseheader = $coursecontentheader = $coursecontentfooter = $coursefooter = '';
+if (empty($PAGE->layout_options['nocourseheaderfooter'])) {
+ $courseheader = $OUTPUT->course_header();
+ $coursecontentheader = $OUTPUT->course_content_header();
+ if (empty($PAGE->layout_options['nocoursefooter'])) {
+ $coursecontentfooter = $OUTPUT->course_content_footer();
+ $coursefooter = $OUTPUT->course_footer();
+ }
+}
+
echo $OUTPUT->doctype() ?>
<html <?php echo $OUTPUT->htmlattributes() ?>>
<head>
<?php echo $OUTPUT->standard_top_of_body_html() ?>
<div id="page">
-<?php if ($hasheading || $hasnavbar) { ?>
+<?php if ($hasheading || $hasnavbar || !empty($courseheader)) { ?>
<div id="page-header">
<div class="rounded-corner top-left"></div>
<div class="rounded-corner top-right"></div>
echo $PAGE->headingmenu
?></div><?php } ?>
+ <?php if (!empty($courseheader)) { ?>
+ <div id="course-header"><?php echo $courseheader; ?></div>
+ <?php } ?>
<?php if ($hascustommenu) { ?>
- <div id="custommenu"><?php echo $custommenu; ?></div>
+ <div id="custommenu"><?php echo $custommenu; ?></div>
<?php } ?>
<?php if ($hasnavbar) { ?>
<div id="region-main-wrap">
<div id="region-main">
<div class="region-content">
+ <?php echo $coursecontentheader; ?>
<?php echo $OUTPUT->main_content() ?>
+ <?php echo $coursecontentfooter; ?>
</div>
</div>
</div>
</div>
<!-- START OF FOOTER -->
+ <?php if (!empty($coursefooter)) { ?>
+ <div id="course-footer"><?php echo $coursefooter; ?></div>
+ <?php } ?>
<?php if ($hasfooter) { ?>
<div id="page-footer" class="clearfix">
<p class="helplink"><?php echo page_doc_link(get_string('moodledocslink')) ?></p>
$bodyclasses[] = 'hasnavbar';
}
+$courseheader = $coursecontentheader = $coursecontentfooter = $coursefooter = '';
+if (empty($PAGE->layout_options['nocourseheaderfooter'])) {
+ $courseheader = $OUTPUT->course_header();
+ $coursecontentheader = $OUTPUT->course_content_header();
+ if (empty($PAGE->layout_options['nocoursefooter'])) {
+ $coursecontentfooter = $OUTPUT->course_content_footer();
+ $coursefooter = $OUTPUT->course_footer();
+ }
+}
+
echo $OUTPUT->doctype() ?>
<html <?php echo $OUTPUT->htmlattributes() ?>>
<head>
echo $PAGE->headingmenu
?></div><?php } ?>
+ <?php if (!empty($courseheader)) { ?>
+ <div id="course-header"><?php echo $courseheader; ?></div>
+ <?php } ?>
<?php if ($hascustommenu) { ?>
<div id="custommenu"><?php echo $custommenu; ?></div>
<?php } ?>
<div id="page-content" class="clearfix">
<div id="report-main-content">
<div class="region-content">
+ <?php echo $coursecontentheader; ?>
<?php echo $OUTPUT->main_content() ?>
+ <?php echo $coursecontentfooter; ?>
</div>
</div>
<?php if ($hassidepre) { ?>
</div>
<!-- START OF FOOTER -->
+ <?php if (!empty($coursefooter)) { ?>
+ <div id="course-footer"><?php echo $coursefooter; ?></div>
+ <?php } ?>
<?php if ($hasfooter) { ?>
<div id="page-footer" class="clearfix">
<p class="helplink"><?php echo page_doc_link(get_string('moodledocslink')) ?></p>
'popup' => array(
'file' => 'general.php',
'regions' => array(),
- 'options' => array('nofooter'=>true, 'noblocks'=>true, 'nonavbar'=>true, 'nocustommenu'=>true),
+ 'options' => array('nofooter'=>true, 'noblocks'=>true, 'nonavbar'=>true, 'nocustommenu'=>true, 'nocourseheaderfooter'=>true),
),
'frametop' => array(
'file' => 'general.php',
'regions' => array(),
- 'options' => array('nofooter'=>true),
+ 'options' => array('nofooter'=>true, 'nocoursefooter'=>true),
),
'maintenance' => array(
'file' => 'general.php',
'regions' => array(),
- 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'nocustommenu'=>true),
+ 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'nocustommenu'=>true, 'nocourseheaderfooter'=>true),
),
'embedded' => array(
'theme' => 'canvas',
'file' => 'embedded.php',
'regions' => array(),
- 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'nocustommenu'=>true),
+ 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'nocustommenu'=>true, 'nocourseheaderfooter'=>true),
),
// Should display the content and basic headers only.
'print' => array(
'file' => 'general.php',
'regions' => array(),
- 'options' => array('nofooter'=>true, 'noblocks'=>true, 'nonavbar'=>false, 'nocustommenu'=>true),
+ 'options' => array('nofooter'=>true, 'noblocks'=>true, 'nonavbar'=>false, 'nocustommenu'=>true, 'nocourseheaderfooter'=>true),
),
'report' => array(
'file' => 'report.php',
$bodyclasses[] = 'has-custom-menu';
}
+$courseheader = $coursecontentheader = $coursecontentfooter = $coursefooter = '';
+if (empty($PAGE->layout_options['nocourseheaderfooter'])) {
+ $courseheader = $OUTPUT->course_header();
+ $coursecontentheader = $OUTPUT->course_content_header();
+ if (empty($PAGE->layout_options['nocoursefooter'])) {
+ $coursecontentfooter = $OUTPUT->course_content_footer();
+ $coursefooter = $OUTPUT->course_footer();
+ }
+}
+
echo $OUTPUT->doctype() ?>
<html <?php echo $OUTPUT->htmlattributes() ?>>
<head>
<div id="page">
- <?php if ($hasheading || $hasnavbar) { ?>
+ <?php if ($hasheading || $hasnavbar || !empty($courseheader) || !empty($coursefooter)) { ?>
<div id="wrapper" class="clearfix">
<!-- START OF HEADER -->
<?php } ?>
</div>
</div>
+ <?php if (!empty($courseheader)) { ?>
+ <div id="course-header"><?php echo $courseheader; ?></div>
+ <?php } ?>
<?php if ($hasnavbar) { ?>
<div class="navbar">
<div class="wrapper clearfix">
<div id="region-main-wrap">
<div id="region-main">
<div class="region-content">
+ <?php echo $coursecontentheader; ?>
<?php echo $OUTPUT->main_content() ?>
+ <?php echo $coursecontentfooter; ?>
</div>
</div>
</div>
<!-- END OF CONTENT -->
- <?php if ($hasheading || $hasnavbar) { ?>
+ <?php if (!empty($coursefooter)) { ?>
+ <div id="course-footer"><?php echo $coursefooter; ?></div>
+ <?php } ?>
+
+ <?php if ($hasheading || $hasnavbar || !empty($courseheader) || !empty($coursefooter)) { ?>
</div>
<?php } ?>
$bodyclasses[] = 'has-custom-menu';
}
+$courseheader = $coursecontentheader = $coursecontentfooter = $coursefooter = '';
+if (empty($PAGE->layout_options['nocourseheaderfooter'])) {
+ $courseheader = $OUTPUT->course_header();
+ $coursecontentheader = $OUTPUT->course_content_header();
+ if (empty($PAGE->layout_options['nocoursefooter'])) {
+ $coursecontentfooter = $OUTPUT->course_content_footer();
+ $coursefooter = $OUTPUT->course_footer();
+ }
+}
+
echo $OUTPUT->doctype() ?>
<html <?php echo $OUTPUT->htmlattributes() ?>>
<head>
<div id="page">
- <?php if ($hasheading || $hasnavbar) { ?>
+ <?php if ($hasheading || $hasnavbar || !empty($courseheader) || !empty($coursefooter)) { ?>
<div id="wrapper" class="clearfix">
<!-- START OF HEADER -->
<?php } ?>
</div>
</div>
+ <?php if (!empty($courseheader)) { ?>
+ <div id="course-header"><?php echo $courseheader; ?></div>
+ <?php } ?>
<?php if ($hasnavbar) { ?>
<div class="navbar">
<div class="wrapper clearfix">
<div id="page-content" class="clearfix">
<div id="report-main-content">
<div class="region-content">
+ <?php echo $coursecontentheader; ?>
<?php echo $OUTPUT->main_content() ?>
+ <?php echo $coursecontentfooter; ?>
</div>
</div>
<?php if ($hassidepost) { ?>
</div>
</div>
- </div>
-
<!-- END OF CONTENT -->
- <?php if ($hasheading || $hasnavbar) { ?>
+ <?php if (!empty($coursefooter)) { ?>
+ <div id="course-footer"><?php echo $coursefooter; ?></div>
+ <?php } ?>
+
+ <?php if ($hasheading || $hasnavbar || !empty($courseheader) || !empty($coursefooter)) { ?>
</div>
<?php } ?>
'popup' => array(
'file' => 'general.php',
'regions' => array(),
- 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'nocustommenu'=>true, 'nologininfo'=>true),
+ 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'nocustommenu'=>true, 'nologininfo'=>true, 'nocourseheaderfooter'=>true),
),
// No blocks and minimal footer - used for legacy frame layouts only!
'frametop' => array(
'file' => 'general.php',
'regions' => array(),
- 'options' => array('nofooter'=>true),
+ 'options' => array('nofooter'=>true, 'nocoursefooter'=>true),
),
// Embeded pages, like iframe/object embeded in moodleform - it needs as much space as possible
'embedded' => array(
'file' => 'embedded.php',
'regions' => array(),
- 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'nocustommenu'=>true),
+ 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'nocustommenu'=>true, 'nocourseheaderfooter'=>true),
),
// Used during upgrade and install, and for the 'This site is undergoing maintenance' message.
// This must not have any blocks, and it is good idea if it does not have links to
'maintenance' => array(
'file' => 'general.php',
'regions' => array(),
- 'options' => array('noblocks'=>true, 'nofooter'=>true, 'nonavbar'=>true, 'nocustommenu'=>true),
+ 'options' => array('noblocks'=>true, 'nofooter'=>true, 'nonavbar'=>true, 'nocustommenu'=>true, 'nocourseheaderfooter'=>true),
),
// Should display the content and basic headers only.
'print' => array(
'file' => 'general.php',
'regions' => array(),
- 'options' => array('noblocks'=>true, 'nofooter'=>true, 'nonavbar'=>false, 'nocustommenu'=>true),
+ 'options' => array('noblocks'=>true, 'nofooter'=>true, 'nonavbar'=>false, 'nocustommenu'=>true, 'nocourseheaderfooter'=>true),
),
// The pagelayout used when a redirection is occuring.
'redirect' => array(
'file' => 'embedded.php',
'regions' => array(),
- 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'nocustommenu'=>true),
+ 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'nocustommenu'=>true, 'nocourseheaderfooter'=>true),
),
// The pagelayout used for reports.
'report' => array(
'file' => 'general.php',
'regions' => array('side-pre', 'side-post'),
'defaultregion' => 'side-pre',
- 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'nocustommenu'=>true, 'nologinlinks'=>true),
+ 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'nocustommenu'=>true, 'nologinlinks'=>true, 'nocourseheaderfooter'=>true),
),
);
$custommenu = $OUTPUT->custom_menu();
$hascustommenu = (empty($PAGE->layout_options['nocustommenu']) && !empty($custommenu));
+$courseheader = $coursecontentheader = $coursecontentfooter = $coursefooter = '';
+if (empty($PAGE->layout_options['nocourseheaderfooter'])) {
+ $courseheader = $OUTPUT->course_header();
+ $coursecontentheader = $OUTPUT->course_content_header();
+ if (empty($PAGE->layout_options['nocoursefooter'])) {
+ $coursecontentfooter = $OUTPUT->course_content_footer();
+ $coursefooter = $OUTPUT->course_footer();
+ }
+}
+
$bodyclasses = array();
if ($showsidepre && !$showsidepost) {
if (!right_to_left()) {
<body id="<?php p($PAGE->bodyid) ?>" class="<?php p($PAGE->bodyclasses.' '.join(' ', $bodyclasses)) ?>">
<?php echo $OUTPUT->standard_top_of_body_html() ?>
<div id="page">
-<?php if ($hasheading || $hasnavbar) { ?>
+<?php if ($hasheading || $hasnavbar || !empty($courseheader)) { ?>
<div id="page-header">
<?php if ($hasheading) { ?>
<h1 class="headermain"><?php echo $PAGE->heading ?></h1>
}
echo $PAGE->headingmenu
?></div><?php } ?>
+ <?php if (!empty($courseheader)) { ?>
+ <div id="course-header"><?php echo $courseheader; ?></div>
+ <?php } ?>
<?php if ($hascustommenu) { ?>
<div id="custommenu"><?php echo $custommenu; ?></div>
<?php } ?>
<div id="region-main-wrap">
<div id="region-main">
<div class="region-content">
+ <?php echo $coursecontentheader; ?>
<?php echo $OUTPUT->main_content() ?>
+ <?php echo $coursecontentfooter; ?>
</div>
</div>
</div>
</div>
<!-- START OF FOOTER -->
+ <?php if (!empty($coursefooter)) { ?>
+ <div id="course-footer"><?php echo $coursefooter; ?></div>
+ <?php } ?>
<?php if ($hasfooter) { ?>
<div id="page-footer" class="clearfix">
<p class="helplink"><?php echo page_doc_link(get_string('moodledocslink')) ?></p>
if ($hascustommenu) {
$bodyclasses[] = 'has_custom_menu';
}
+$courseheader = $coursecontentheader = $coursecontentfooter = $coursefooter = '';
+if (empty($PAGE->layout_options['nocourseheaderfooter'])) {
+ $courseheader = $OUTPUT->course_header();
+ $coursecontentheader = $OUTPUT->course_content_header();
+ if (empty($PAGE->layout_options['nocoursefooter'])) {
+ $coursecontentfooter = $OUTPUT->course_content_footer();
+ $coursefooter = $OUTPUT->course_footer();
+ }
+}
echo $OUTPUT->doctype() ?>
<html <?php echo $OUTPUT->htmlattributes() ?>>
<body id="<?php p($PAGE->bodyid) ?>" class="<?php p($PAGE->bodyclasses.' '.join(' ', $bodyclasses)) ?>">
<?php echo $OUTPUT->standard_top_of_body_html() ?>
<div id="page">
-<?php if ($hasheading || $hasnavbar) { ?>
+<?php if ($hasheading || $hasnavbar || !empty($courseheader)) { ?>
<div id="page-header">
<?php if ($hasheading) { ?>
<h1 class="headermain"><?php echo $PAGE->heading ?></h1>
}
echo $PAGE->headingmenu
?></div><?php } ?>
+ <?php if (!empty($courseheader)) { ?>
+ <div id="course-header"><?php echo $courseheader; ?></div>
+ <?php } ?>
<?php if ($hascustommenu) { ?>
<div id="custommenu"><?php echo $custommenu; ?></div>
<?php } ?>
<div id="page-content" class="clearfix">
<div id="report-main-content">
<div class="region-content">
+ <?php echo $coursecontentheader; ?>
<?php echo $OUTPUT->main_content() ?>
+ <?php echo $coursecontentfooter; ?>
</div>
</div>
<?php if ($hassidepre) { ?>
</div>
<!-- START OF FOOTER -->
+ <?php if (!empty($coursefooter)) { ?>
+ <div id="course-footer"><?php echo $coursefooter; ?></div>
+ <?php } ?>
<?php if ($hasfooter) { ?>
<div id="page-footer" class="clearfix">
<p class="helplink"><?php echo page_doc_link(get_string('moodledocslink')) ?></p>
</div>
<?php echo $OUTPUT->standard_end_of_body_html() ?>
</body>
-</html>
\ No newline at end of file
+</html>
*/
.headermain {float:left;margin:15px;font-size:2.3em;}
.headermenu {float:right;margin:10px;font-size:0.8em;text-align:right;}
+#course-header {clear:both;}
/**
* Navbar
.performanceinfo .cachesused .cache-store-stats {text-indent: 1em;}
.performanceinfo .cachesused .cache-total-stats {font-weight:bold;margin-top:0.3em;}
+#course-footer {clear:both;}
+
/**
* Tabs
*/
'popup' => array(
'file' => 'general.php',
'regions' => array(),
- 'options' => array('nofooter'=>true, 'noblocks'=>true, 'nonavbar'=>true, 'nocustommenu'=>true),
+ 'options' => array('nofooter'=>true, 'noblocks'=>true, 'nonavbar'=>true, 'nocustommenu'=>true, 'nocourseheaderfooter'=>true),
),
'frametop' => array(
'file' => 'general.php',
'regions' => array(),
- 'options' => array('nofooter'=>true),
+ 'options' => array('nofooter'=>true, 'nocoursefooter'=>true),
),
'maintenance' => array(
'file' => 'general.php',
'regions' => array(),
- 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'nocustommenu'=>true),
+ 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'nocustommenu'=>true, 'nocourseheaderfooter'=>true),
),
'embedded' => array(
'theme' => 'canvas',
'file' => 'embedded.php',
'regions' => array(),
- 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'nocustommenu'=>true),
+ 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'nocustommenu'=>true, 'nocourseheaderfooter'=>true),
),
// Should display the content and basic headers only.
'print' => array(
'file' => 'general.php',
'regions' => array(),
- 'options' => array('nofooter'=>true, 'noblocks'=>true, 'nonavbar'=>false, 'nocustommenu'=>true),
+ 'options' => array('nofooter'=>true, 'noblocks'=>true, 'nonavbar'=>false, 'nocustommenu'=>true, 'nocourseheaderfooter'=>true),
),
'report' => array(
'file' => 'report.php',
$bodyclasses[] = 'has-custom-menu';
}
+$courseheader = $coursecontentheader = $coursecontentfooter = $coursefooter = '';
+if (empty($PAGE->layout_options['nocourseheaderfooter'])) {
+ $courseheader = $OUTPUT->course_header();
+ $coursecontentheader = $OUTPUT->course_content_header();
+ if (empty($PAGE->layout_options['nocoursefooter'])) {
+ $coursecontentfooter = $OUTPUT->course_content_footer();
+ $coursefooter = $OUTPUT->course_footer();
+ }
+}
+
echo $OUTPUT->doctype() ?>
<html <?php echo $OUTPUT->htmlattributes() ?>>
<head>
<div id="page">
- <?php if ($hasheading || $hasnavbar) { ?>
+ <?php if ($hasheading || $hasnavbar || !empty($courseheader) || !empty($coursefooter)) { ?>
<div id="wrapper" class="clearfix">
<!-- START OF HEADER -->
<?php } ?>
</div>
</div>
-
+ <?php if (!empty($courseheader)) { ?>
+ <div id="course-header"><?php echo $courseheader; ?></div>
+ <?php } ?>
<?php if ($hasnavbar) { ?>
<div class="navbar">
<div class="wrapper clearfix">
<div id="region-main-wrap">
<div id="region-main">
<div class="region-content">
+ <?php echo $coursecontentheader; ?>
<?php echo $OUTPUT->main_content() ?>
+ <?php echo $coursecontentfooter; ?>
</div>
</div>
</div>
<!-- END OF CONTENT -->
- <?php if ($hasheading || $hasnavbar) { ?>
+ <?php if (!empty($coursefooter)) { ?>
+ <div id="course-footer"><?php echo $coursefooter; ?></div>
+ <?php } ?>
+
+ <?php if ($hasheading || $hasnavbar || !empty($courseheader) || !empty($coursefooter)) { ?>
<div class="myclear"></div>
</div>
<?php } ?>
$bodyclasses[] = 'has-custom-menu';
}
+$courseheader = $coursecontentheader = $coursecontentfooter = $coursefooter = '';
+if (empty($PAGE->layout_options['nocourseheaderfooter'])) {
+ $courseheader = $OUTPUT->course_header();
+ $coursecontentheader = $OUTPUT->course_content_header();
+ if (empty($PAGE->layout_options['nocoursefooter'])) {
+ $coursecontentfooter = $OUTPUT->course_content_footer();
+ $coursefooter = $OUTPUT->course_footer();
+ }
+}
+
echo $OUTPUT->doctype() ?>
<html <?php echo $OUTPUT->htmlattributes() ?>>
<head>
<div id="page">
- <?php if ($hasheading || $hasnavbar) { ?>
+ <?php if ($hasheading || $hasnavbar || !empty($courseheader) || !empty($coursefooter)) { ?>
<div id="wrapper" class="clearfix">
<!-- START OF HEADER -->
<?php } ?>
</div>
</div>
+ <?php if (!empty($courseheader)) { ?>
+ <div id="course-header"><?php echo $courseheader; ?></div>
+ <?php } ?>
<?php if ($hasnavbar) { ?>
<div class="navbar">
<div id="page-content" class="clearfix">
<div id="report-main-content">
<div class="region-content">
+ <?php echo $coursecontentheader; ?>
<?php echo $OUTPUT->main_content() ?>
+ <?php echo $coursecontentfooter; ?>
</div>
</div>
<?php if ($hassidepost) { ?>
<!-- END OF CONTENT -->
- <?php if ($hasheading || $hasnavbar) { ?>
+ <?php if (!empty($coursefooter)) { ?>
+ <div id="course-footer"><?php echo $coursefooter; ?></div>
+ <?php } ?>
+
+ <?php if ($hasheading || $hasnavbar || !empty($courseheader) || !empty($coursefooter)) { ?>
<div class="myclear"></div>
</div>
<?php } ?>
'popup' => array(
'file' => 'general.php',
'regions' => array(),
- 'options' => array('nofooter'=>true),
+ 'options' => array('nofooter'=>true, 'nocourseheaderfooter'=>true),
),
'frametop' => array(
'file' => 'general.php',
'regions' => array(),
- 'options' => array('nofooter'=>true),
+ 'options' => array('nofooter'=>true, 'nocoursefooter'=>true),
),
'maintenance' => array(
'theme' => 'boxxie',
'file' => 'general.php',
'regions' => array(),
- 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'noblocks'=>false, 'nocustommenu'=>true),
+ 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'noblocks'=>false, 'nocustommenu'=>true, 'nocourseheaderfooter'=>true),
),
'embedded' => array(
'file' => 'embedded.php',
'regions' => array(),
- 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'noblocks'=>false, 'nocustommenu'=>true),
+ 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'noblocks'=>false, 'nocustommenu'=>true, 'nocourseheaderfooter'=>true),
),
// Should display the content and basic headers only.
'print' => array(
'file' => 'general.php',
'regions' => array(),
- 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'noblocks'=>false, 'nocustommenu'=>true),
+ 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'noblocks'=>false, 'nocustommenu'=>true, 'nocourseheaderfooter'=>true),
),
);
$bodyclasses[] = 'has-custom-menu';
}
+$courseheader = $coursecontentheader = $coursecontentfooter = $coursefooter = '';
+if (empty($PAGE->layout_options['nocourseheaderfooter'])) {
+ $courseheader = $OUTPUT->course_header();
+ $coursecontentheader = $OUTPUT->course_content_header();
+ if (empty($PAGE->layout_options['nocoursefooter'])) {
+ $coursecontentfooter = $OUTPUT->course_content_footer();
+ $coursefooter = $OUTPUT->course_footer();
+ }
+}
+
echo $OUTPUT->doctype() ?>
<html <?php echo $OUTPUT->htmlattributes() ?>>
<head>
<?php echo $OUTPUT->standard_top_of_body_html() ?>
-<?php if ($hasheading || $hasnavbar) { ?>
+<?php if ($hasheading || $hasnavbar || !empty($courseheader) || !empty($coursefooter)) { ?>
<div id="page-wrapper">
<div id="page" class="clearfix">
<div class="myclear"></div>
+ <?php if (!empty($courseheader)) { ?>
+ <div id="course-header"><?php echo $courseheader; ?></div>
+ <?php } ?>
+
<?php if ($hasnavbar) { ?>
<div class="navbar clearfix">
<div class="breadcrumb"><?php echo $OUTPUT->navbar(); ?></div>
<div id="region-main-wrap">
<div id="region-main">
<div class="region-content">
+ <?php echo $coursecontentheader; ?>
<?php echo $OUTPUT->main_content() ?>
+ <?php echo $coursecontentfooter; ?>
</div>
</div>
</div>
</div>
<div class="myclear"></div>
+ <?php if (!empty($coursefooter)) { ?>
+ <div id="course-footer"><?php echo $coursefooter; ?></div>
+ <?php } ?>
<?php if ($hasfooter) { ?>
<div id="page-footer" class="clearfix">
<?php }
-if ($hasheading || $hasnavbar) { ?>
+if ($hasheading || $hasnavbar || !empty($courseheader) || !empty($coursefooter)) { ?>
<div class="myclear"></div>
</div> <!-- END #page -->
'popup' => array(
'file' => 'general.php',
'regions' => array(),
- 'options' => array('nofooter'=>true, 'noblocks'=>true, 'nonavbar'=>true),
+ 'options' => array('nofooter'=>true, 'noblocks'=>true, 'nonavbar'=>true, 'nocourseheaderfooter'=>true),
),
'frametop' => array(
'file' => 'general.php',
'regions' => array(),
- 'options' => array('nofooter'=>true),
+ 'options' => array('nofooter'=>true, 'nocoursefooter'=>true),
),
'maintenance' => array(
'file' => 'general.php',
'regions' => array(),
- 'options' => array('nofooter'=>true, 'nonavbar'=>true),
+ 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'nocourseheaderfooter'=>true),
),
'embedded' => array(
'theme' => 'canvas',
'file' => 'embedded.php',
'regions' => array(),
- 'options' => array('nofooter'=>true, 'nonavbar'=>true),
+ 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'nocourseheaderfooter'=>true),
),
'report' => array(
'file' => 'general.php',
$bodyclasses[] = 'content-only';
}
+$courseheader = $coursecontentheader = $coursecontentfooter = $coursefooter = '';
+if (empty($PAGE->layout_options['nocourseheaderfooter'])) {
+ $courseheader = $OUTPUT->course_header();
+ $coursecontentheader = $OUTPUT->course_content_header();
+ if (empty($PAGE->layout_options['nocoursefooter'])) {
+ $coursecontentfooter = $OUTPUT->course_content_footer();
+ $coursefooter = $OUTPUT->course_footer();
+ }
+}
+
echo $OUTPUT->doctype() ?>
<html <?php echo $OUTPUT->htmlattributes() ?>>
<head>
<div id="page">
<div id="wrapper" class="clearfix">
+ <?php if (!empty($courseheader)) { ?>
+ <div id="course-header"><?php echo $courseheader; ?></div>
+ <?php } ?>
<!-- START OF CONTENT -->
<div id="page-content-wrapper" class="wrapper clearfix">
</div>
<?php } ?>
+ <?php echo $coursecontentheader; ?>
<?php echo $OUTPUT->main_content() ?>
+ <?php echo $coursecontentfooter; ?>
</div>
</div>
</div>
<!-- END OF CONTENT -->
+ <?php if (!empty($coursefooter)) { ?>
+ <div id="course-footer"><?php echo $coursefooter; ?></div>
+ <?php } ?>
</div>
'popup' => array(
'file' => 'general.php',
'regions' => array(),
- 'options' => array('nofooter'=>true, 'noblocks'=>true, 'nonavbar'=>true),
+ 'options' => array('nofooter'=>true, 'noblocks'=>true, 'nonavbar'=>true, 'nocourseheaderfooter'=>true),
),
'frametop' => array(
'file' => 'general.php',
'regions' => array(),
- 'options' => array('nofooter'=>true),
+ 'options' => array('nofooter'=>true, 'nocoursefooter'=>true),
),
'maintenance' => array(
'file' => 'general.php',
'regions' => array(),
- 'options' => array('nofooter'=>true, 'nonavbar'=>true),
+ 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'nocourseheaderfooter'=>true),
),
'embedded' => array(
'file' => 'embedded.php',
'regions' => array(),
- 'options' => array('nofooter'=>true, 'nonavbar'=>true),
+ 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'nocourseheaderfooter'=>true),
),
// Should display the content and basic headers only.
'print' => array(
'file' => 'general.php',
'regions' => array(),
- 'options' => array('nofooter'=>true, 'nonavbar'=>false, 'noblocks'=>true),
+ 'options' => array('nofooter'=>true, 'nonavbar'=>false, 'noblocks'=>true, 'nocourseheaderfooter'=>true),
),
// The pagelayout used when a redirection is occuring.
'redirect' => array(
'file' => 'embedded.php',
'regions' => array(),
- 'options' => array('nofooter'=>true, 'nonavbar'=>true),
+ 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'nocourseheaderfooter'=>true),
),
'report' => array(
'file' => 'report.php',
'file' => 'general.php',
'regions' => array('side-pre', 'side-post'),
'defaultregion' => 'side-pre',
- 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'nocustommenu'=>true, 'nologinlinks'=>true),
+ 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'nocustommenu'=>true, 'nologinlinks'=>true, 'nocourseheaderfooter'=>true),
),
);
$bodyclasses[] = 'has_custom_menu';
}
+$courseheader = $coursecontentheader = $coursecontentfooter = $coursefooter = '';
+if (empty($PAGE->layout_options['nocourseheaderfooter'])) {
+ $courseheader = $OUTPUT->course_header();
+ $coursecontentheader = $OUTPUT->course_content_header();
+ if (empty($PAGE->layout_options['nocoursefooter'])) {
+ $coursecontentfooter = $OUTPUT->course_content_footer();
+ $coursefooter = $OUTPUT->course_footer();
+ }
+}
+
echo $OUTPUT->doctype() ?>
<html <?php echo $OUTPUT->htmlattributes() ?>>
<head>
<!-- START OF HEADER -->
- <?php if ($hasheading || $hasnavbar) { ?>
- <div id="wrapper" class="clearfix">
+ <?php if ($hasheading || $hasnavbar || !empty($courseheader) || !empty($coursefooter)) { ?>
+ <div id="wrapper" class="clearfix">
+ <?php } ?>
+ <?php if ($hasheading) { ?>
<div id="page-header">
<div id="page-header-wrapper" class="clearfix">
- <?php if ($hasheading) { ?>
<h1 class="headermain"><?php echo $PAGE->heading ?></h1>
<div class="headermenu">
<?php
echo $PAGE->headingmenu;
?>
</div>
- <?php } ?>
</div>
</div>
+ <?php } ?>
<?php if ($hascustommenu) { ?>
<div id="custommenu"><?php echo $custommenu; ?></div>
<?php } ?>
+ <?php if (!empty($courseheader)) { ?>
+ <div id="course-header"><?php echo $courseheader; ?></div>
+ <?php } ?>
+
<?php if ($hasnavbar) { ?>
<div class="navbar clearfix">
<div class="breadcrumb"><?php echo $OUTPUT->navbar(); ?></div>
</div>
<?php } ?>
-<?php } ?>
-
<!-- END OF HEADER -->
<!-- START OF CONTENT -->
<div id="region-main-wrap">
<div id="region-main">
<div class="region-content">
+ <?php echo $coursecontentheader; ?>
<?php echo $OUTPUT->main_content() ?>
+ <?php echo $coursecontentfooter; ?>
</div>
</div>
</div>
<!-- START OF FOOTER -->
+ <?php if (!empty($coursefooter)) { ?>
+ <div id="course-footer"><?php echo $coursefooter; ?></div>
+ <?php } ?>
<?php if ($hasfooter) { ?>
<div id="page-footer" class="clearfix">
<p class="helplink"><?php echo page_doc_link(get_string('moodledocslink')) ?></p>
</div>
<?php } ?>
- <?php if ($hasheading || $hasnavbar) { ?>
+ <?php if ($hasheading || $hasnavbar || !empty($courseheader) || !empty($coursefooter)) { ?>
</div> <!-- END #wrapper -->
<?php } ?>
$bodyclasses[] = 'has_custom_menu';
}
+$courseheader = $coursecontentheader = $coursecontentfooter = $coursefooter = '';
+if (empty($PAGE->layout_options['nocourseheaderfooter'])) {
+ $courseheader = $OUTPUT->course_header();
+ $coursecontentheader = $OUTPUT->course_content_header();
+ if (empty($PAGE->layout_options['nocoursefooter'])) {
+ $coursecontentfooter = $OUTPUT->course_content_footer();
+ $coursefooter = $OUTPUT->course_footer();
+ }
+}
+
echo $OUTPUT->doctype() ?>
<html <?php echo $OUTPUT->htmlattributes() ?>>
<head>
<!-- START OF HEADER -->
- <?php if ($hasheading || $hasnavbar) { ?>
+<?php if ($hasheading || $hasnavbar || !empty($courseheader) || !empty($coursefooter)) { ?>
<div id="wrapper" class="clearfix">
+<?php } ?>
+ <?php if ($hasheading) { ?>
<div id="page-header">
<div id="page-header-wrapper" class="clearfix">
- <?php if ($hasheading) { ?>
<h1 class="headermain"><?php echo $PAGE->heading ?></h1>
<div class="headermenu">
<?php
echo $PAGE->headingmenu;
?>
</div>
- <?php } ?>
</div>
</div>
+ <?php } ?>
<?php if ($hascustommenu) { ?>
<div id="custommenu"><?php echo $custommenu; ?></div>
<?php } ?>
+ <?php if (!empty($courseheader)) { ?>
+ <div id="course-header"><?php echo $courseheader; ?></div>
+ <?php } ?>
+
<?php if ($hasnavbar) { ?>
<div class="navbar clearfix">
<div class="breadcrumb"><?php echo $OUTPUT->navbar(); ?></div>
</div>
<?php } ?>
-<?php } ?>
-
<!-- END OF HEADER -->
<!-- START OF CONTENT -->
<div id="page-content">
<div id="report-main-content">
<div class="region-content">
+ <?php echo $coursecontentheader; ?>
<?php echo $OUTPUT->main_content() ?>
+ <?php echo $coursecontentfooter; ?>
</div>
</div>
<?php if ($hassidepre) { ?>
<?php } ?>
</div>
</div>
- </div>
<!-- END OF CONTENT -->
<!-- START OF FOOTER -->
+ <?php if (!empty($coursefooter)) { ?>
+ <div id="course-footer"><?php echo $coursefooter; ?></div>
+ <?php } ?>
<?php if ($hasfooter) { ?>
<div id="page-footer" class="clearfix">
<p class="helplink"><?php echo page_doc_link(get_string('moodledocslink')) ?></p>
</div>
<?php } ?>
- <?php if ($hasheading || $hasnavbar) { ?>
+ <?php if ($hasheading || $hasnavbar || !empty($courseheader) || !empty($coursefooter)) { ?>
</div> <!-- END #wrapper -->
<?php } ?>
.navbar .navbutton {margin:5px;}
.mform fieldset {border-color:#DDD;}
+#course-footer, #course-header {margin:0px 10px;}
/**
* Tabs
*/
=== 2.4 ===
+required changes:
+* output course and course content header/footer that may be returned by course format (see MDL-36048)
+
optional changes:
* new optional boolean parameter $withlinks for public function login_info() in lib/outputrenderers.php (MDL-31365)
* new layout option "nologinlinks" and new page layout "secure" e.g. for safebrowser and securewindow (MDL-31365)