21 return $this->
renderGroup($component, $default_renderer);
31 $title = $component->getTitle();
32 $items = $component->getItems();
35 foreach ($items as $item) {
36 $tpl->setCurrentBlock(
"item");
37 $tpl->setVariable(
"ITEM", $default_renderer->render($item));
38 $tpl->parseCurrentBlock();
42 $actions = $component->getActions();
43 if ($actions !== null) {
44 $tpl->setVariable(
"ACTIONS", $default_renderer->render($actions));
60 $color = $component->getColor();
61 if ($color !== null) {
62 $tpl->setCurrentBlock(
"color");
63 $tpl->setVariable(
"COLOR", $color->asHex());
64 $tpl->parseCurrentBlock();
68 $lead = $component->getLead();
70 if (is_string($lead)) {
71 $tpl->setCurrentBlock(
"lead_text");
72 $tpl->setVariable(
"LEAD_TEXT", $lead);
73 $tpl->parseCurrentBlock();
75 if ($lead instanceof
Component\Image\Image) {
76 $tpl->setCurrentBlock(
"lead_image");
77 $tpl->setVariable(
"LEAD_IMAGE", $default_renderer->render($lead));
78 $tpl->parseCurrentBlock();
80 if ($lead instanceof
Component\Icon\Icon) {
81 $tpl->setCurrentBlock(
"lead_icon");
82 $tpl->setVariable(
"LEAD_ICON", $default_renderer->render($lead));
83 $tpl->parseCurrentBlock();
84 $tpl->setCurrentBlock(
"lead_start_icon");
85 $tpl->parseCurrentBlock();
87 $tpl->setCurrentBlock(
"lead_start");
88 $tpl->parseCurrentBlock();
92 $tpl->touchBlock(
"lead_end");
96 $desc = $component->getDescription();
97 if (trim($desc) !=
"") {
98 $tpl->setCurrentBlock(
"desc");
99 $tpl->setVariable(
"DESC", $desc);
100 $tpl->parseCurrentBlock();
104 $actions = $component->getActions();
105 if ($actions !== null) {
106 $tpl->setVariable(
"ACTIONS", $default_renderer->render($actions));
110 $props = $component->getProperties();
111 if (count($props) > 0) {
113 foreach ($props as
$name => $value) {
115 $value = $default_renderer->render($value);
120 $tpl->setCurrentBlock(
"property_row");
122 $tpl->setVariable(
"PROP_VAL_A", $value);
125 $tpl->setVariable(
"PROP_VAL_B", $value);
126 $tpl->parseCurrentBlock();
130 $tpl->parseCurrentBlock();
132 $tpl->setCurrentBlock(
"properties");
133 $tpl->parseCurrentBlock();
136 $title = $component->getTitle();
renderGroup(Component\Item\Group $component, RendererInterface $default_renderer)
checkComponent(Component $component)
Check if a given component fits this renderer and throw if that is not the case. ...
Common interface to all items.
render(Component\Component $component, RendererInterface $default_renderer)
Common interface to all items.
renderStandard(Component\Item\Item $component, RendererInterface $default_renderer)
getComponentInterfaceName()
getTemplate($name, $purge_unfilled_vars, $purge_unused_blocks)
Get template of component this renderer is made for.
Base class for all component renderers.