19 declare(strict_types=1);
79 $this->main_tpl = $DIC->ui()->mainTemplate();
80 $this->
tabs = $DIC->tabs();
81 $this->global_screen = $DIC->globalScreen();
82 $this->global_screen->layout()->meta()->addJs(
'./Services/WOPI/js/dist/index.min.js');
83 $this->global_screen->layout()->meta()->addOnloadCode(
'il.WOPI.init();');
84 $this->renderer =
new Renderer($this->application);
85 $this->ui_renderer = $DIC->ui()->renderer();
86 $this->
http = $DIC->http()->wrapper()->query();
88 $this->
ctrl = $DIC->ctrl();
89 $this->
lng = $DIC->language();
90 $this->
lng->loadLanguageModule(
'wopi');
95 if (!$this->application->isInline()) {
96 $this->
tabs->clearTargets();
98 $this->global_screen->tool()->context()->current()->addAdditionalData(
99 EmbeddedApplicationGSProvider::EMBEDDED_APPLICATION,
102 $a_value = bin2hex((
string) $this->application->getBackTarget());
103 $this->
ctrl->setParameter($this, self::P_RETURN_TO, $a_value);
105 match ($this->
ctrl->getCmd()) {
106 default => $this->
edit(),
107 self::CMD_EDIT => $this->
edit(),
108 self::CMD_VIEW => $this->
view(),
109 self::CMD_RETURN => $this->
return(),
115 $this->main_tpl->setContent(
116 $this->ui_renderer->render($this->renderer->getComponent())
122 $this->main_tpl->setContent(
123 $this->ui_renderer->render($this->renderer->getComponent())
127 private function return():
void 129 $return_to = $this->
http->has(self::P_RETURN_TO)
130 ? hex2bin((
string) $this->
http->retrieve(self::P_RETURN_TO, $this->refinery->kindlyTo()->string()))
133 if ($return_to === null) {
134 $return_to = (string) $this->application->getBackTarget();
137 $this->main_tpl->setOnScreenMessage(
139 $this->
lng->txt(
'close_wopi_editor_info'),
143 $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
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