ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ButtonContextRenderer.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
25
27{
28 protected function getTemplateFilename(): string
29 {
30 return "tpl.glyph.context_btn.html";
31 }
32
33 protected function renderAction(Component\Component $component, Template $tpl): Template
34 {
35 return $tpl;
36 }
37
38 protected function renderLabel(Component\Component $component, Template $tpl): Template
39 {
40 $aria_label = $component->getLabel();
41 if($aria_label != '') {
42 $aria_label = $this->txt($aria_label);
43 }
44 foreach ($component->getCounters() as $counter) {
45 if($counter->getNumber() > 0) {
46 $aria_label .= $this->txt("counter_" . $counter->getType()) . " " . $counter->getNumber() . "; ";
47 }
48 }
49
50 if($aria_label != "") {
51 $tpl->setVariable("LABEL", $aria_label);
52 }
53
54 return $tpl;
55 }
56}
Interface to templating as it is used in the UI framework.
Definition: Template.php:29
setVariable(string $name, $value)
Set a variable in the current block.
$counter