48 $tpl->setVariable(
"TITLE", $component->getTitle());
50 $vcs = $component->getViewControls();
52 $tpl->touchBlock(
"viewcontrols");
53 foreach ($vcs as $vc) {
54 $tpl->setCurrentBlock(
"vc");
55 $tpl->setVariable(
"VC", $default_renderer->render($vc));
56 $tpl->parseCurrentBlock();
60 $row_mapping = $component->getRowMapping();
61 $data = $component->getData();
62 foreach (
$data as $record) {
67 $component->getEnvironment()
70 $tpl->setCurrentBlock(
"row");
71 $tpl->setVariable(
"ROW", $default_renderer->render(
$row));
72 $tpl->parseCurrentBlock();
89 $sig_show = $component->getShowSignal();
90 $sig_hide = $component->getCloseSignal();
91 $sig_toggle = $component->getToggleSignal();
94 $expander =
$f->glyph()->expand(
"#")
95 ->withOnClick($sig_show);
96 $collapser =
$f->glyph()->collapse(
"#")
97 ->withOnClick($sig_hide);
98 $shy_expander =
$f->button()->shy($this->
txt(
"presentation_table_more"),
"#")
99 ->withOnClick($sig_show);
102 $tpl->setVariable(
"EXPANDER", $default_renderer->render($expander));
103 $tpl->setVariable(
"COLLAPSER", $default_renderer->render($collapser));
104 $tpl->setVariable(
"SHY_EXPANDER", $default_renderer->render($shy_expander));
106 $tpl->setVariable(
"HEADLINE", $component->getHeadline());
107 $tpl->setVariable(
"TOGGLE_SIGNAL", $sig_toggle);
108 $tpl->setVariable(
"SUBHEADLINE", $component->getSubheadline());
110 foreach ($component->getImportantFields() as $label => $value) {
111 $tpl->setCurrentBlock(
"important_field");
112 if (is_string($label)) {
113 $tpl->setVariable(
"IMPORTANT_FIELD_LABEL", $label);
115 $tpl->setVariable(
"IMPORTANT_FIELD_VALUE", $value);
116 $tpl->parseCurrentBlock();
119 $tpl->setVariable(
"DESCLIST", $default_renderer->render($component->getContent()));
121 $further_fields_headline = $component->getFurtherFieldsHeadline();
122 if ($further_fields_headline) {
123 $tpl->setVariable(
"FURTHER_FIELDS_HEADLINE", $further_fields_headline);
126 foreach ($component->getFurtherFields() as $label => $value) {
127 $tpl->setCurrentBlock(
"further_field");
128 if (is_string($label)) {
129 $tpl->setVariable(
"FIELD_LABEL", $label);
131 $tpl->setVariable(
"FIELD_VALUE", $value);
132 $tpl->parseCurrentBlock();
135 $action = $component->getAction();
137 $tpl->setCurrentBlock(
"button");
138 $tpl->setVariable(
"BUTTON", $default_renderer->render(
$action));
139 $tpl->parseCurrentBlock();
150 parent::registerResources($registry);
151 $registry->
register(
'./src/UI/templates/js/Table/presentation.js');
159 $show = $component->getShowSignal();
160 $close = $component->getCloseSignal();
161 $toggle = $component->getToggleSignal();
162 return $component->withAdditionalOnLoadCode(
function (
$id) use ($show, $close, $toggle) {
164 "$(document).on('{$show}', function() { il.UI.table.presentation.expandRow('{$id}'); return false; });" .
165 "$(document).on('{$close}', function() { il.UI.table.presentation.collapseRow('{$id}'); return false; });" .
166 "$(document).on('{$toggle}', function() { il.UI.table.presentation.toggleRow('{$id}'); return false; });";
Registry for resources required by rendered output like Javascript or CSS.
checkComponent(Component $component)
Check if a given component fits this renderer and throw if that is not the case. ...
registerSignals(Component\Table\PresentationRow $component)
renderPresentationTable(Component\Table\Presentation $component, RendererInterface $default_renderer)
if(!array_key_exists('StateId', $_REQUEST)) $id
registerResources(ResourceRegistry $registry)
Announce resources this renderer requires.null
txt($id)
Get a text from the language file.
render(Component\Component $component, RendererInterface $default_renderer)
getComponentInterfaceName()
renderPresentationRow(Component\Table\PresentationRow $component, RendererInterface $default_renderer)
register($name)
Add a dependency.
getUIFactory()
Get a UI factory.
getTemplate($name, $purge_unfilled_vars, $purge_unused_blocks)
Get template of component this renderer is made for.
Base class for all component renderers.
bindJavaScript(JavaScriptBindable $component)
Bind the component to JavaScript.