From 6ea01b6e99ca7e47ba5b949d5ea07a186f53de3b Mon Sep 17 00:00:00 2001 From: Davo Smith Date: Thu, 30 Apr 2020 10:53:58 +0100 Subject: [PATCH] MDL-68564 outputrenderers: extend before_footer hook to allow output --- lib/outputrenderers.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/outputrenderers.php b/lib/outputrenderers.php index 74e7c807777..4f8de591efc 100644 --- a/lib/outputrenderers.php +++ b/lib/outputrenderers.php @@ -1385,15 +1385,20 @@ class core_renderer extends renderer_base { public function footer() { global $CFG, $DB; + $output = ''; + // Give plugins an opportunity to touch the page before JS is finalized. $pluginswithfunction = get_plugins_with_function('before_footer', 'lib.php'); foreach ($pluginswithfunction as $plugins) { 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');