19 declare(strict_types=1);
77 $this->main_tpl = $DIC->ui()->mainTemplate();
78 $this->
tabs = $DIC->tabs();
79 $this->global_screen = $DIC->globalScreen();
80 $this->global_screen->layout()->meta()->addJs(
'./assets/js/wopi.min.js');
81 $this->global_screen->layout()->meta()->addOnloadCode(
'il.WOPI.init();');
83 $this->ui_renderer = $DIC->ui()->renderer();
84 $this->
http = $DIC->http()->wrapper()->query();
86 $this->
ctrl = $DIC->ctrl();
87 $this->
lng = $DIC->language();
88 $this->
lng->loadLanguageModule(
'wopi');
93 if (!$this->application->isInline()) {
94 $this->
tabs->clearTargets();
96 $this->global_screen->tool()->context()->current()->addAdditionalData(
97 EmbeddedApplicationGSProvider::EMBEDDED_APPLICATION,
100 $a_value = bin2hex((
string) $this->application->getBackTarget());
101 $this->
ctrl->setParameter($this, self::P_RETURN_TO, $a_value);
103 match ($this->
ctrl->getCmd()) {
104 default => $this->
edit(),
105 self::CMD_EDIT => $this->
edit(),
106 self::CMD_VIEW => $this->
view(),
107 self::CMD_RETURN => $this->
return(),
113 $this->main_tpl->setContent(
114 $this->ui_renderer->render($this->renderer->getComponent())
120 $this->main_tpl->setContent(
121 $this->ui_renderer->render($this->renderer->getComponent())
125 private function return():
void 127 $return_to = $this->
http->has(self::P_RETURN_TO)
128 ? hex2bin((
string) $this->
http->retrieve(self::P_RETURN_TO, $this->refinery->kindlyTo()->string()))
131 if ($return_to ===
null) {
132 $return_to = (string) $this->application->getBackTarget();
135 $this->main_tpl->setOnScreenMessage(
137 $this->
lng->txt(
'close_wopi_editor_info'),
141 $this->
ctrl->redirectToURL($return_to);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ArrayBasedRequestWrapper $http
__construct(private EmbeddedApplication $application,)
ilGlobalTemplateInterface $main_tpl
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static http()
Fetches the global http state from ILIAS.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ILIAS UI Renderer $ui_renderer
Class ArrayBasedRequestWrapper.