ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
Renderer.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\WOPI\Embed;
22
25
30{
32
33 public function __construct(
34 private EmbeddedApplication $embedded_application
35 ) {
36 global $DIC;
37 $this->ui_factory = $DIC->ui()->factory();
38 }
39
40 public function getComponent(): Component
41 {
42 $tpl = new \ilTemplate('tpl.wopi_container.html', true, true, 'components/ILIAS/WOPI');
43 $tpl->setVariable('EDITOR_URL', (string) $this->embedded_application->getActionLauncherURL());
44 $tpl->setVariable('INLINE', (string) (int) $this->embedded_application->isInline());
45 $tpl->setVariable('TOKEN', $this->embedded_application->getToken());
46 $tpl->setVariable('TTL', (string) (time() + $this->embedded_application->getTTL()) * 1000); // in milliseconds
47
48 return $this->ui_factory->legacy()->content($tpl->get());
49 }
50}
Builds a Color from either hex- or rgb values.
Definition: Factory.php:31
__construct(private EmbeddedApplication $embedded_application)
Definition: Renderer.php:33
A component is the most general form of an entity in the UI.
Definition: Component.php:28
This is how the factory for UI elements looks.
Definition: Factory.php:38
global $DIC
Definition: shib_login.php:26