ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
GlyphRendererFactory.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
26
28{
34 protected const array USE_BUTTON_CONTEXT_RENDERER_FOR = [
35 'BranchNodeFieldInput',
36 'LeafNodeFieldInput',
37 'AsyncNodeFieldInput',
38 'StandardButton',
39 'PrimaryButton',
40 'BulkyButton',
41 'ShyButton',
42 'BulkyLink',
43 'ShyLink',
44 'MultiSelectFieldInput',
45 'RadioFieldInput',
46 ];
47
48 public function getRendererInContext(Component\Component $component, array $contexts): ComponentRenderer
49 {
50 if (count(array_intersect(self::USE_BUTTON_CONTEXT_RENDERER_FOR, $contexts)) > 0) {
51 return new ButtonContextRenderer(
52 $this->ui_factory,
53 $this->tpl_factory,
54 $this->lng,
55 $this->js_binding,
56 $this->image_path_resolver,
57 $this->data_factory,
58 $this->help_text_retriever,
59 $this->upload_limit_resolver
60 );
61 }
62 return new Renderer(
63 $this->ui_factory,
64 $this->tpl_factory,
65 $this->lng,
66 $this->js_binding,
67 $this->image_path_resolver,
68 $this->data_factory,
69 $this->help_text_retriever,
70 $this->upload_limit_resolver
71 );
72 }
73}
getRendererInContext(Component\Component $component, array $contexts)
const array USE_BUTTON_CONTEXT_RENDERER_FOR
components which render glyphs inside an HTML <button> element, where only palpable content is allowe...
An entity that renders components to a string output.