Skip to content

Commit

Permalink
Merge branch 'MDL-81459-main' of https://github.com/andrewnicols/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
HuongNV13 committed Apr 10, 2024
2 parents 99de5da + 5ff5cf8 commit 7f3c0f2
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions lib/outputrenderers.php
Expand Up @@ -672,8 +672,8 @@ public function htmlattributes() {
$hook->add_attribute('xmlns', 'http://www.w3.org/1999/xhtml');
}

di::get(hook_manager::class)->dispatch($hook);
$hook->process_legacy_callbacks();
di::get(hook_manager::class)->dispatch($hook);

foreach ($hook->get_attributes() as $key => $val) {
$val = s($val);
Expand Down Expand Up @@ -706,8 +706,8 @@ public function standard_head_html() {
// must always return a string containing valid html head content.

$hook = new \core\hook\output\before_standard_head_html_generation($this);
di::get(hook_manager::class)->dispatch($hook);
$hook->process_legacy_callbacks();
di::get(hook_manager::class)->dispatch($hook);

// Allow a url_rewrite plugin to setup any dynamic head content.
if (isset($CFG->urlrewriteclass) && !isset($CFG->upgraderunning)) {
Expand Down Expand Up @@ -820,8 +820,8 @@ public function standard_top_of_body_html() {

// Allow components to add content to the top of the body.
$hook = new before_standard_top_of_body_html_generation($this, $output);
di::get(hook_manager::class)->dispatch($hook);
$hook->process_legacy_callbacks();
di::get(hook_manager::class)->dispatch($hook);
$output = $hook->get_output();

$output .= $this->maintenance_warning();
Expand Down Expand Up @@ -885,8 +885,8 @@ public function standard_footer_html() {
require_once(__DIR__ . '/classes/hook/output/before_standard_footer_html_generation.php');

$hook = new before_standard_footer_html_generation($this);
di::get(hook_manager::class)->dispatch($hook);
$hook->process_legacy_callbacks();
di::get(hook_manager::class)->dispatch($hook);
$output = $hook->get_output();

if ($this->page->devicetypeinuse == 'legacy') {
Expand Down Expand Up @@ -1122,8 +1122,8 @@ public function standard_after_main_region_html() {
$hook->add_html($CFG->additionalhtmlbottomofbody);
}

di::get(hook_manager::class)->dispatch($hook);
$hook->process_legacy_callbacks();
di::get(hook_manager::class)->dispatch($hook);

return $hook->get_output();
}
Expand Down Expand Up @@ -1365,7 +1365,9 @@ public function header() {
// TODO MDL-81134 Remove after LTS+1.
require_once(__DIR__ . '/classes/hook/output/before_http_headers.php');

di::get(hook_manager::class)->dispatch(new before_http_headers($this));
$hook = new before_http_headers($this);
$hook->process_legacy_callbacks();
di::get(hook_manager::class)->dispatch($hook);

if (\core\session\manager::is_loggedinas()) {
$this->page->add_body_class('userloggedinas');
Expand Down Expand Up @@ -1489,8 +1491,8 @@ public function footer() {
require_once(__DIR__ . '/classes/hook/output/before_footer_html_generation.php');

$hook = new before_footer_html_generation($this);
di::get(hook_manager::class)->dispatch($hook);
$hook->process_legacy_callbacks();
di::get(hook_manager::class)->dispatch($hook);
$hook->add_html($this->container_end_all(true));
$output = $hook->get_output();

Expand Down

0 comments on commit 7f3c0f2

Please sign in to comment.