Skip to content

Commit

Permalink
MDL-63303 message: move message drawer to end of <body>
Browse files Browse the repository at this point in the history
Fix some of the behat tests that are looking for generic button
names that match some of the buttons in the message drawer which
happen to appear earlier in the DOM.
  • Loading branch information
ryanwyllie committed Nov 15, 2018
1 parent 663ccd5 commit c75559c
Show file tree
Hide file tree
Showing 12 changed files with 48 additions and 3 deletions.
33 changes: 33 additions & 0 deletions lib/outputrenderers.php
Original file line number Diff line number Diff line change
Expand Up @@ -946,6 +946,39 @@ public function standard_end_of_body_html() {
return $output;
}

/**
* The standard HTML that should be output just before the <footer> tag.
* Designed to be called in theme layout.php files.
*
* @return string HTML fragment.
*/
public function standard_after_main_region_html() {
global $CFG;
$output = '';
if ($this->page->pagelayout !== 'embedded' && !empty($CFG->additionalhtmlbottomofbody)) {
$output .= "\n".$CFG->additionalhtmlbottomofbody;
}

// Give subsystems an opportunity to inject extra html content. The callback
// must always return a string containing valid html.
foreach (\core_component::get_core_subsystems() as $name => $path) {
if ($path) {
$output .= component_callback($name, 'standard_after_main_region_html', [], '');
}
}

// Give plugins an opportunity to inject extra html content. The callback
// must always return a string containing valid html.
$pluginswithfunction = get_plugins_with_function('standard_after_main_region_html', 'lib.php');
foreach ($pluginswithfunction as $plugins) {
foreach ($plugins as $function) {
$output .= $function();
}
}

return $output;
}

/**
* Return the standard string that says whether you are logged in (and switched
* roles/logged in as another user).
Expand Down
2 changes: 1 addition & 1 deletion message/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ function core_message_render_navbar_output(\renderer_base $renderer) {
*
* @return string HTML
*/
function core_message_before_standard_top_of_body_html() {
function core_message_standard_after_main_region_html() {
global $USER, $CFG, $PAGE;

// Early bail out conditions.
Expand Down
2 changes: 1 addition & 1 deletion theme/boost/scss/moodle/message.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1200,7 +1200,7 @@ $message-drawer-width: 320px;
right: 0;
height: calc(100% - #{$navbar-height});
width: $message-drawer-width;
z-index: $zindex-fixed;
z-index: $zindex-sticky;
box-shadow: -2px 2px 4px rgba(0, 0, 0, .08);
display: flex;
flex-direction: column;
Expand Down
2 changes: 1 addition & 1 deletion theme/boost/style/moodle.css
Original file line number Diff line number Diff line change
Expand Up @@ -14077,7 +14077,7 @@ a.ygtvspacer:hover {
right: 0;
height: calc(100% - 50px);
width: 320px;
z-index: 1030;
z-index: 1020;
box-shadow: -2px 2px 4px rgba(0, 0, 0, 0.08);
display: flex;
flex-direction: column;
Expand Down
3 changes: 3 additions & 0 deletions theme/boost/templates/columns1.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@
</div>
</div>
</div>

{{{ output.standard_after_main_region_html }}}

</div>
{{{ output.standard_end_of_body_html }}}
</body>
Expand Down
1 change: 1 addition & 0 deletions theme/boost/templates/columns2.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
</div>
</div>
</div>
{{{ output.standard_after_main_region_html }}}
{{> theme_boost/nav-drawer }}
{{> theme_boost/footer }}
</div>
Expand Down
3 changes: 3 additions & 0 deletions theme/bootstrapbase/layout/columns1.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -69,6 +70,8 @@
</section>
</div>

<?php echo $OUTPUT->standard_after_main_region_html() ?>

<footer id="page-footer">
<div id="course-footer"><?php echo $OUTPUT->course_footer(); ?></div>
<p class="helplink"><?php echo $OUTPUT->page_doc_link(); ?></p>
Expand Down
1 change: 1 addition & 0 deletions theme/bootstrapbase/layout/columns2.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
</section>
<?php echo $OUTPUT->blocks('side-pre', $sidepre); ?>
</div>
<?php echo $OUTPUT->standard_after_main_region_html() ?>

<footer id="page-footer">
<div id="course-footer"><?php echo $OUTPUT->course_footer(); ?></div>
Expand Down
1 change: 1 addition & 0 deletions theme/bootstrapbase/layout/columns3.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
</div>
<?php echo $OUTPUT->blocks('side-post', $sidepost); ?>
</div>
<?php echo $OUTPUT->standard_after_main_region_html() ?>

<footer id="page-footer">
<div id="course-footer"><?php echo $OUTPUT->course_footer(); ?></div>
Expand Down
1 change: 1 addition & 0 deletions theme/clean/layout/columns1.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
?>
</section>
</div>
<?php echo $OUTPUT->standard_after_main_region_html() ?>

<footer id="page-footer">
<div id="course-footer"><?php echo $OUTPUT->course_footer(); ?></div>
Expand Down
1 change: 1 addition & 0 deletions theme/clean/layout/columns2.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
<?php echo $OUTPUT->blocks('side-pre', $sidepre);
?>
</div>
<?php echo $OUTPUT->standard_after_main_region_html() ?>

<footer id="page-footer">
<div id="course-footer"><?php echo $OUTPUT->course_footer(); ?></div>
Expand Down
1 change: 1 addition & 0 deletions theme/clean/layout/columns3.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
</div>
<?php echo $OUTPUT->blocks('side-post', $sidepost); ?>
</div>
<?php echo $OUTPUT->standard_after_main_region_html() ?>

<footer id="page-footer">
<div id="course-footer"><?php echo $OUTPUT->course_footer(); ?></div>
Expand Down

0 comments on commit c75559c

Please sign in to comment.