MDL-59165 output: Add standard footer html callback

This commit is contained in:
Andrew Nicols
2017-07-03 13:35:28 +08:00
parent 5a651b43fb
commit 7bd28dffc2
+12 -2
View File
@@ -741,16 +741,26 @@ class core_renderer extends renderer_base {
public function standard_footer_html() {
global $CFG, $SCRIPT;
$output = '';
if (during_initial_install()) {
// Debugging info can not work before install is finished,
// in any case we do not want any links during installation!
return '';
return $output;
}
// Give plugins an opportunity to add any footer elements.
// The callback must always return a string containing valid html footer content.
$pluginswithfunction = get_plugins_with_function('standard_footer_html', 'lib.php');
foreach ($pluginswithfunction as $plugins) {
foreach ($plugins as $function) {
$output .= $function();
}
}
// This function is normally called from a layout.php file in {@link core_renderer::header()}
// but some of the content won't be known until later, so we return a placeholder
// for now. This will be replaced with the real content in {@link core_renderer::footer()}.
$output = $this->unique_performance_info_token;
$output .= $this->unique_performance_info_token;
if ($this->page->devicetypeinuse == 'legacy') {
// The legacy theme is in use print the notification
$output .= html_writer::tag('div', get_string('legacythemeinuse'), array('class'=>'legacythemeinuse'));