3 declare(strict_types=1);
38 $items = $component->getItems();
39 if (count($items) == 0) {
43 $width = str_replace(
",",
".", (
string) round(100 / count($items), 5));
45 foreach ($component->getItems() as
$txt => $active) {
47 $tpl->setCurrentBlock(
"active");
48 $tpl->setVariable(
"TXT_ACTIVE", $this->
txt(
"active"));
49 $tpl->parseCurrentBlock();
50 $tpl->touchBlock(
"active_class");
53 $tpl->setCurrentBlock(
"item");
54 $tpl->setVariable(
"ITEM_TEXT", $txt);
55 $tpl->setVariable(
"ITEM_WIDTH", $width);
56 $tpl->parseCurrentBlock();
67 return array(
Component\Chart\ScaleBar::class);
getComponentInterfaceName()
render(Component\Component $component, RendererInterface $default_renderer)
checkComponent(Component $component)
Check if a given component fits this renderer and throw if that is not the case. ...
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.
getTemplate(string $name, bool $purge_unfilled_vars, bool $purge_unused_blocks)
Get template of component this renderer is made for.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Base class for all component renderers.