ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
Renderer.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 2018 Thomas Famula <famula@leifos.de> Extended GPL, see docs/LICENSE */
4 
6 
10 
16 {
20  public function render(Component\Component $component, RendererInterface $default_renderer)
21  {
22  $ui_fac = $this->getUIFactory();
23 
27  $this->checkComponent($component);
28  $tpl = $this->getTemplate("tpl.messagebox.html", true, true);
29 
30  $buttons = $component->getButtons();
31  if (count($buttons) > 0) {
32  $tpl->setCurrentBlock("buttons");
33  $tpl->setVariable("BUTTONS", $default_renderer->render($buttons));
34  $tpl->parseCurrentBlock();
35  }
36 
37  $tpl->setCurrentBlock("message_box");
38 
39  $tpl->setVariable("MESSAGE_TEXT", $component->getMessageText());
40  $tpl->setVariable("ACC_TEXT", $this->txt($component->getType() . "_message"));
41 
42 
43  $links = $component->getLinks();
44  if (count($links) > 0) {
45  $unordered = $ui_fac->listing()->unordered(
46  $links
47  );
48 
49  $tpl->setVariable("LINK_LIST", $default_renderer->render($unordered));
50  }
51 
52  $tpl->touchBlock($component->getType() . "_class");
53 
54  $tpl->parseCurrentBlock();
55 
56  return $tpl->get();
57  }
58 
59  protected function getComponentInterfaceName()
60  {
61  return array(Component\MessageBox\MessageBox::class);
62  }
63 }
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
checkComponent(Component $component)
Check if a given component fits this renderer and throw if that is not the case. ...
render(Component $component, Renderer $default_renderer)
Render the component if possible and delegate additional rendering to the default_renderer.
getTemplate($name, $purge_unfilled_vars, $purge_unused_blocks)
Get template of component this renderer is made for.