MDL-82160 renderer: Add render_context_header method to core_renderer

In MDL-81597 the original render_context_header method was removed and converted to a template.
That caused a regression, so this patch adds the method again but using the new template.
This commit is contained in:
Mikel Martín 2024-06-11 12:02:07 +02:00
parent ad7fc69c25
commit 3b419c4540
2 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,7 @@
issueNumber: MDL-82160
notes:
theme:
- message: >-
The method `core_renderer::render_context_header` has been deprecated
please use core_renderer::render($contextheader) instead
type: deprecated

View File

@ -4601,6 +4601,20 @@ EOD;
return $this->render($contextheader);
}
/**
* Renders the header bar.
*
* @param context_header $contextheader Header bar object.
* @return string HTML for the header bar.
* @deprecated since 4.5 Please use core_renderer::render($contextheader) instead
* @todo MDL-82163 This will be deleted in Moodle 6.0.
*/
#[\core\attribute\deprecated('core_renderer::render($contextheader)', since: '4.5', mdl: 'MDL-82160')]
protected function render_context_header(context_header $contextheader) {
$context = $contextheader->export_for_template($this);
return $this->render_from_template('core/context_header', $context);
}
/**
* Renders the skip links for the page.
*