Skip to content

Commit 22327a1

Browse files
committed
MDL-82055 output: replace usage of named templatable interface.
It's not available during, and breaks, site installation. The output class doesn't necessarily need it in 78db6bb, so switch to simple templatable interface instead.
1 parent bcd8e0d commit 22327a1

File tree

3 files changed

+4
-15
lines changed

3 files changed

+4
-15
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
issueNumber: MDL-81597
22
notes:
33
theme:
4-
- message: New `core/contextheader` mustache template has been added. This template can be overridden by themes to modify the context header
4+
- message: New `core/context_header` mustache template has been added. This template can be overridden by themes to modify the context header
55
type: improved

lib/outputcomponents.php

+2-13
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@
2626
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
2727
*/
2828

29-
use core\output\local\action_menu\subpanel;
30-
use core\output\named_templatable;
29+
use core\output\local\action_menu\subpanel;
3130

3231
defined('MOODLE_INTERNAL') || die();
3332

@@ -4110,7 +4109,7 @@ public function export_for_template(renderer_base $output) {
41104109
* @copyright 2015 Adrian Greeve <[email protected]>
41114110
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
41124111
*/
4113-
class context_header implements renderable, named_templatable {
4112+
class context_header implements renderable, templatable {
41144113

41154114
/**
41164115
* @var string $heading Main heading.
@@ -4232,16 +4231,6 @@ public function export_for_template(renderer_base $output): array {
42324231
'additionalbuttons' => $additionalbuttons ?? [],
42334232
];
42344233
}
4235-
4236-
/**
4237-
* Get the template name.
4238-
*
4239-
* @param renderer_base $renderer Renderer.
4240-
* @return string
4241-
*/
4242-
public function get_template_name(renderer_base $renderer): string {
4243-
return 'core/contextheader';
4244-
}
42454234
}
42464235

42474236
/**

lib/templates/contextheader.mustache lib/templates/context_header.mustache

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
1616
}}
1717
{{!
18-
@template core/contextheader
18+
@template core/context_header
1919
2020
Context header template.
2121

0 commit comments

Comments
 (0)