MDL-68564 outputrenderers: extend before_footer hook to allow output

This commit is contained in:
Davo Smith 2020-04-30 10:53:58 +01:00 committed by Davo Smith
parent ab5d361c80
commit 23efc7337a

View file

@ -1385,15 +1385,20 @@ class core_renderer extends renderer_base {
public function footer() { public function footer() {
global $CFG, $DB; global $CFG, $DB;
$output = '';
// Give plugins an opportunity to touch the page before JS is finalized. // Give plugins an opportunity to touch the page before JS is finalized.
$pluginswithfunction = get_plugins_with_function('before_footer', 'lib.php'); $pluginswithfunction = get_plugins_with_function('before_footer', 'lib.php');
foreach ($pluginswithfunction as $plugins) { foreach ($pluginswithfunction as $plugins) {
foreach ($plugins as $function) { foreach ($plugins as $function) {
$function(); $extrafooter = $function();
if (is_string($extrafooter)) {
$output .= $extrafooter;
}
} }
} }
$output = $this->container_end_all(true); $output .= $this->container_end_all(true);
$footer = $this->opencontainers->pop('header/footer'); $footer = $this->opencontainers->pop('header/footer');