ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ButtonContextRenderer.php
Go to the documentation of this file.
1 <?php
2 
19 declare(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 = "";
41  foreach ($component->getCounters() as $counter) {
42  if($counter->getNumber() > 0) {
43  $aria_label .= $this->txt("counter_".$counter->getType()). " ".$counter->getNumber(). "; ";
44  }
45  }
46 
47  if($aria_label != "") {
48  $tpl->setVariable("LABEL", $aria_label);
49  }
50 
51  return $tpl;
52  }
53 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
txt(string $id)
Get a text from the language file.
setVariable(string $name, $value)
Set a variable in the current block.