Skip to content
Snippets Groups Projects
Commit 80a0d3c9 authored by Kathrin Osswald's avatar Kathrin Osswald
Browse files

Bugfix: body and html tags were closed before additional layout elements were added.

parent 916ddc20
Branches
Tags
No related merge requests found
......@@ -6,6 +6,7 @@ Changes
### Unreleased
* 2018-12-04 - Bugfix: body and html tags were closed before additional layout elements were added.
* 2018-12-04 - Changed travis.yml due to upstream changes.
### Release v3.5-r3
......
......@@ -105,14 +105,11 @@ if (get_config('theme_boost_campus', 'showsettingsincourse') == 'yes') {
$templatecontext['activitynode'] = theme_boost_campus_get_incourse_activity_settings();
}
// Render colums2.mustache from boost_campus.
echo $OUTPUT->render_from_template('theme_boost_campus/columns2', $templatecontext);
// MODIFICATION END.
/* ORIGINAL START.
echo $OUTPUT->render_from_template('theme_boost/columns2', $templatecontext);
ORIGINAL END. */
// MODIFICATION START: Handle additional layout elements.
// The output buffer is needed to render the additional layout elements now without outputting them to the page directly.
ob_start();
// MODIFICATION START: Require additional layout files.
// Require additional layout files.
// Add footer blocks and standard footer.
require_once(__DIR__ . '/includes/footer.php');
// Get imageareaitems config.
......@@ -127,4 +124,20 @@ if (!empty($footnote)) {
// Add footnote layout file.
require_once(__DIR__ . '/includes/footnote.php');
}
// Get output buffer.
$pagebottomelements = ob_get_clean();
// If there isn't anything in the buffer, set the additional layouts string to an empty string to avoid problems later on.
if ($pagebottomelements == false) {
$pagebottomelements = '';
}
// Add the additional layouts to the template context.
$templatecontext['pagebottomelements'] = $pagebottomelements;
// Render columns2.mustache from boost_campus.
echo $OUTPUT->render_from_template('theme_boost_campus/columns2', $templatecontext);
// MODIFICATION END.
/* ORIGINAL START.
echo $OUTPUT->render_from_template('theme_boost/columns2', $templatecontext);
ORIGINAL END. */
......@@ -33,9 +33,10 @@ $templatecontext = [
'bodyattributes' => $bodyattributes
];
echo $OUTPUT->render_from_template('theme_boost/login', $templatecontext);
// MODIFICATION START: Handle additional layout elements.
// The output buffer is needed to render the additional layout elements now without outputting them to the page directly.
ob_start();
// MOFIFICATION START.
// Include own layout file for the footnote region.
// The theme_boost/login template already renders the standard footer.
// The footer blocks and the image area are currently not shown on the login page.
......@@ -46,4 +47,20 @@ if (!empty($footnote)) {
// Add footnote layout file.
require_once(__DIR__ . '/includes/footnote.php');
}
// Get output buffer.
$pagebottomelements = ob_get_clean();
// If there isn't anything in the buffer, set the additional layouts string to an empty string to avoid problems later on.
if ($pagebottomelements == false) {
$pagebottomelements = '';
}
// Add the additional layouts to the template context.
$templatecontext['pagebottomelements'] = $pagebottomelements;
// Render own template.
echo $OUTPUT->render_from_template('theme_boost_campus/login', $templatecontext);
// MODIFICATION END.
/* ORIGINAL START.
echo $OUTPUT->render_from_template('theme_boost/login', $templatecontext);
ORIGINAL END. */
......@@ -30,6 +30,7 @@
* navdraweropen - true if the nav drawer should be open on page load
* regionmainsettingsmenu - HTML for the region main settings menu
* hasregionmainsettingsmenu - There is a region main settings menu on this page.
* pagebottomelements - HTML for all additional layout elements below the main content, e.g. the footer.
Example context (json):
{
......@@ -45,15 +46,17 @@
"hasblocks":true,
"navdraweropen":true,
"regionmainsettingsmenu": "",
"hasregionmainsettingsmenu": false
"hasregionmainsettingsmenu": false,
"pagebottomelements": ""
}
}}
{{! MODIFICATION:
* Remove section for footer blocks with own mustache template
* Require own javascript module for back to top button functionality
* If setting "showsettingsincourse" is enabled, then render course context menu from theme_boost_campus/settings_link_page template
and use the equivalent own javascript "incoursesettings".
* If setting "showsettingsincourse" is enabled, then render course context menu from theme_boost_campus/settings_link_page
template and use the equivalent own javascript "incoursesettings".
* Call to own navbar mustache template instead of boost/navbar.
* Add own additional layout elements: the footer, footnote or image area.
}}
{{> theme_boost/head }}
......@@ -104,6 +107,7 @@
</div>
{{> theme_boost/nav-drawer }}
</div>
{{{ pagebottomelements }}}
</body>
</html>
......
......@@ -106,5 +106,6 @@
{{{ output.standard_end_of_body_html }}}
</div>
</div>
</div>
</footer>
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template theme_boost/login
Login page template
Example context (json):
{
"output": {
"doctype": "<!DOCTYPE html>",
"page_title": "Login page",
"favicon": "favicon.ico",
"main_content": "<h1>Headers keep HTML validators happy</h1>"
}
* pagebottomelements - HTML for all additional layout elements: the footnote.
}
}}
{{! MODIFICATION:
* Add own additional layout elements: the footnote.
}}
{{> theme_boost/head }}
<body {{{ bodyattributes }}}>
<div id="page-wrapper">
{{{ output.standard_top_of_body_html }}}
<div id="page" class="container-fluid mt-0">
<div id="page-content" class="row">
<div id="region-main-box" class="col-12">
<section id="region-main" class="col-12">
{{{ output.course_content_header }}}
{{{ output.main_content }}}
{{{ output.course_content_footer }}}
</section>
</div>
</div>
</div>
</div>
<footer id="page-footer" class="py-3 bg-dark text-light">
<div class="container">
<div id="course-footer">{{{ output.course_footer }}}</div>
{{# output.page_doc_link }}
<p class="helplink">{{{ output.page_doc_link }}}</p>
{{/ output.page_doc_link }}
{{{ output.login_info }}}
{{{ output.home_link }}}
{{{ output.standard_footer_html }}}
{{{ output.standard_end_of_body_html }}}
</div>
</footer>
{{{ pagebottomelements }}}
</body>
</html>
{{#js}}
require(['theme_boost/loader']);
{{/js}}
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template theme_boost/login
Login page template
Example context (json):
{
"output": {
"doctype": "<!DOCTYPE html>",
"page_title": "Login page",
"favicon": "favicon.ico",
"main_content": "<h1>Headers keep HTML validators happy</h1>"
}
}
}}
{{> theme_boost/head }}
<body {{{ bodyattributes }}}>
<div id="page-wrapper">
{{{ output.standard_top_of_body_html }}}
<div id="page" class="container-fluid mt-0">
<div id="page-content" class="row">
<div id="region-main-box" class="col-12">
<section id="region-main" class="col-12">
{{{ output.course_content_header }}}
{{{ output.main_content }}}
{{{ output.course_content_footer }}}
</section>
</div>
</div>
</div>
</div>
<footer id="page-footer" class="py-3 bg-dark text-light">
<div class="container">
<div id="course-footer">{{{ output.course_footer }}}</div>
{{# output.page_doc_link }}
<p class="helplink">{{{ output.page_doc_link }}}</p>
{{/ output.page_doc_link }}
{{{ output.login_info }}}
{{{ output.home_link }}}
{{{ output.standard_footer_html }}}
{{{ output.standard_end_of_body_html }}}
</div>
</footer>
</body>
</html>
{{#js}}
require(['theme_boost/loader']);
{{/js}}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment