19 declare(strict_types=1);
42 $tpl = $this->
getTemplate(
"tpl.icon.html",
true,
true);
47 $tpl->setCurrentBlock(
"with_id");
48 $tpl->setVariable(
"ID",
$id);
49 $tpl->parseCurrentBlock();
53 $tpl->setVariable(
"SIZE", $component->getSize());
65 $tpl->setVariable(
"ABBREVIATION", $ab);
67 $abbreviation_tpl = $this->
getTemplate(
"tpl.abbreviation.svg",
true,
true);
68 $abbreviation_tpl->setVariable(
"ABBREVIATION", $ab);
69 $abbreviation = $abbreviation_tpl->get() .
'</svg>';
71 $image = file_get_contents(__DIR__ .
"/../../../../../../../../public/" . $imagepath);
72 $image = substr($image, strpos($image,
'<svg '));
73 $image = trim(str_replace(
'</svg>', $abbreviation, $image));
74 $imagepath =
"data:image/svg+xml;base64," . base64_encode($image);
77 $tpl->setVariable(
"CUSTOMIMAGE", $imagepath);
79 if ($component->isDisabled()) {
80 $tpl->touchBlock(
'disabled');
81 $tpl->touchBlock(
'aria_disabled');
95 $name = $icon->getName();
96 $is_in_standard_icon_list = in_array($name, $icon->getAllStandardHandles());
97 $is_in_page_editor_icon_list = in_array($name, $icon->getAllStandardPageEditorHandles());
98 if (!$is_in_standard_icon_list && !$is_in_page_editor_icon_list) {
99 $name = self::DEFAULT_ICON_NAME;
101 $pattern = self::ICON_NAME_PATTERN;
103 $icon_path_name =
'';
104 $icon_name = sprintf($pattern, $name);
105 if ($is_in_page_editor_icon_list) {
106 $icon_path_name =
'page_editor/' . $icon_name;
108 $icon_path_name =
'standard/' . $icon_name;
renderLabel(Component\Component $component, Template $tpl)
convertSpecialCharacters(string $value)
setVariable(string $name, $value)
Set a variable in the current block.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
getTemplate(string $name, bool $purge_unfilled_vars, bool $purge_unused_blocks)
Get template of component this renderer is made for.
getStandardIconPath(Component\Symbol\Icon\Icon $icon)
cannotHandleComponent(Component $component)
This method MUST be called by derived component renderers, if.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
render(Component\Component $component, RendererInterface $default_renderer)
Base class for all component renderers.
bindJavaScript(JavaScriptBindable $component)
Bind the component to JavaScript.