From 7bd28dffc28c0e8a10d305b13f948226bce460b7 Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Tue, 20 Jun 2017 12:03:22 +0800 Subject: [PATCH] MDL-59165 output: Add standard footer html callback --- lib/outputrenderers.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/outputrenderers.php b/lib/outputrenderers.php index 15705a87fd6..7f6904fbc52 100644 --- a/lib/outputrenderers.php +++ b/lib/outputrenderers.php @@ -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')); -- 2.43.0