This commit is contained in:
Huong Nguyen 2024-04-10 08:53:20 +07:00
commit 7f3c0f2d31
No known key found for this signature in database
GPG Key ID: 40D88AB693A3E72A

View File

@ -672,8 +672,8 @@ class core_renderer extends renderer_base {
$hook->add_attribute('xmlns', 'http://www.w3.org/1999/xhtml'); $hook->add_attribute('xmlns', 'http://www.w3.org/1999/xhtml');
} }
di::get(hook_manager::class)->dispatch($hook);
$hook->process_legacy_callbacks(); $hook->process_legacy_callbacks();
di::get(hook_manager::class)->dispatch($hook);
foreach ($hook->get_attributes() as $key => $val) { foreach ($hook->get_attributes() as $key => $val) {
$val = s($val); $val = s($val);
@ -706,8 +706,8 @@ class core_renderer extends renderer_base {
// must always return a string containing valid html head content. // must always return a string containing valid html head content.
$hook = new \core\hook\output\before_standard_head_html_generation($this); $hook = new \core\hook\output\before_standard_head_html_generation($this);
di::get(hook_manager::class)->dispatch($hook);
$hook->process_legacy_callbacks(); $hook->process_legacy_callbacks();
di::get(hook_manager::class)->dispatch($hook);
// Allow a url_rewrite plugin to setup any dynamic head content. // Allow a url_rewrite plugin to setup any dynamic head content.
if (isset($CFG->urlrewriteclass) && !isset($CFG->upgraderunning)) { if (isset($CFG->urlrewriteclass) && !isset($CFG->upgraderunning)) {
@ -820,8 +820,8 @@ class core_renderer extends renderer_base {
// Allow components to add content to the top of the body. // Allow components to add content to the top of the body.
$hook = new before_standard_top_of_body_html_generation($this, $output); $hook = new before_standard_top_of_body_html_generation($this, $output);
di::get(hook_manager::class)->dispatch($hook);
$hook->process_legacy_callbacks(); $hook->process_legacy_callbacks();
di::get(hook_manager::class)->dispatch($hook);
$output = $hook->get_output(); $output = $hook->get_output();
$output .= $this->maintenance_warning(); $output .= $this->maintenance_warning();
@ -885,8 +885,8 @@ class core_renderer extends renderer_base {
require_once(__DIR__ . '/classes/hook/output/before_standard_footer_html_generation.php'); require_once(__DIR__ . '/classes/hook/output/before_standard_footer_html_generation.php');
$hook = new before_standard_footer_html_generation($this); $hook = new before_standard_footer_html_generation($this);
di::get(hook_manager::class)->dispatch($hook);
$hook->process_legacy_callbacks(); $hook->process_legacy_callbacks();
di::get(hook_manager::class)->dispatch($hook);
$output = $hook->get_output(); $output = $hook->get_output();
if ($this->page->devicetypeinuse == 'legacy') { if ($this->page->devicetypeinuse == 'legacy') {
@ -1122,8 +1122,8 @@ class core_renderer extends renderer_base {
$hook->add_html($CFG->additionalhtmlbottomofbody); $hook->add_html($CFG->additionalhtmlbottomofbody);
} }
di::get(hook_manager::class)->dispatch($hook);
$hook->process_legacy_callbacks(); $hook->process_legacy_callbacks();
di::get(hook_manager::class)->dispatch($hook);
return $hook->get_output(); return $hook->get_output();
} }
@ -1365,7 +1365,9 @@ class core_renderer extends renderer_base {
// TODO MDL-81134 Remove after LTS+1. // TODO MDL-81134 Remove after LTS+1.
require_once(__DIR__ . '/classes/hook/output/before_http_headers.php'); 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()) { if (\core\session\manager::is_loggedinas()) {
$this->page->add_body_class('userloggedinas'); $this->page->add_body_class('userloggedinas');
@ -1489,8 +1491,8 @@ class core_renderer extends renderer_base {
require_once(__DIR__ . '/classes/hook/output/before_footer_html_generation.php'); require_once(__DIR__ . '/classes/hook/output/before_footer_html_generation.php');
$hook = new before_footer_html_generation($this); $hook = new before_footer_html_generation($this);
di::get(hook_manager::class)->dispatch($hook);
$hook->process_legacy_callbacks(); $hook->process_legacy_callbacks();
di::get(hook_manager::class)->dispatch($hook);
$hook->add_html($this->container_end_all(true)); $hook->add_html($this->container_end_all(true));
$output = $hook->get_output(); $output = $hook->get_output();