19 declare(strict_types=1);
60 $this->
ctrl = $DIC->ctrl();
61 $this->
access = $DIC->access();
62 $this->
http = $DIC->http();
64 $this->
lng = $DIC->language();
65 $this->
lng->loadLanguageModule(
"wopi");
66 $this->maint_tpl = $DIC->ui()->mainTemplate();
67 $this->ref_id = $this->
http->wrapper()->query()->has(
"ref_id")
68 ? (
int) $this->
http->wrapper()->query()->retrieve(
70 $DIC->refinery()->to()->string()
77 $this->ui_factory = $DIC->ui()->factory();
78 $this->ui_renderer = $DIC->ui()->renderer();
83 if (!$this->
access->checkAccess(
"read",
"", $this->ref_id)) {
84 $this->maint_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"permission_denied"),
true);
85 $this->
ctrl->redirectByClass(ilObjExternalToolsSettingsGUI::class);
88 $cmd = $this->
ctrl->getCmd(self::CMD_DEFAULT);
90 self::CMD_DEFAULT => $this->
index(),
91 self::CMD_SHOW => $this->
show(),
92 self::CMD_STORE => $this->
store(),
93 default =>
throw new ilException(
"command not found: " . $cmd),
101 if (!empty($supported_suffixes)) {
102 $listing = $this->ui_factory->panel()->secondary()->legacy(
103 $this->
lng->txt(
"currently_supported"),
104 $this->ui_factory->legacy(
105 $this->ui_renderer->render(
106 $this->ui_factory->listing()->descriptive([
107 $this->
lng->txt(
'action_edit') => implode(
", ", $supported_suffixes[ActionTarget::EDIT->value]),
108 $this->
lng->txt(
'action_view') => implode(
", ", $supported_suffixes[ActionTarget::VIEW->value]),
113 $info = $this->ui_renderer->render($listing);
118 $this->
access->checkAccess(
"write",
"", $this->ref_id)
121 $this->maint_tpl->setContent(
125 $this->maint_tpl->setRightContent(
$info);
130 $wopi_activated = (bool) $this->
settings->get(
"wopi_activated",
'0');
131 if (!$wopi_activated) {
135 ActionTarget::EDIT->value => $this->action_repo->getSupportedSuffixes(ActionTarget::EDIT),
136 ActionTarget::VIEW->value => $this->action_repo->getSupportedSuffixes(ActionTarget::VIEW),
143 fn(
Action $action):
Item => $this->ui_factory->item()->standard($action->
getExtension())->withProperties([
145 $this->
lng->txt(
'action') => $action->
getName()
147 $this->action_repo->getActionsForTargets(ActionTarget::EDIT, ActionTarget::EMBED_EDIT)
150 $this->maint_tpl->setContent(
151 $this->ui_renderer->render(
152 $this->ui_factory->item()->group(
153 $this->
lng->txt(
'actions'),
162 if (!$this->
access->checkAccess(
"write",
"", $this->ref_id)) {
163 $this->maint_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"permission_denied"),
true);
164 $this->
ctrl->redirect($this, self::CMD_DEFAULT);
169 $this->
access->checkAccess(
"write",
"", $this->ref_id)
172 if ($form->proceed($this->http->request())) {
175 $this->maint_tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_wopi_settings_modified"),
true);
178 $discovery_url = $this->
settings->get(
"wopi_discovery_url");
179 if ($discovery_url ===
null) {
180 $this->app_repo->clear($this->action_repo);
182 $apps = $this->crawler->crawl(
new URI($discovery_url));
183 if ($apps !==
null) {
184 $this->app_repo->storeCollection($apps, $this->action_repo);
188 $this->
ctrl->redirect($this, self::CMD_DEFAULT);
191 $this->maint_tpl->setContent($form->getHTML());
ActionRepository $action_repo
ilGlobalTemplateInterface $maint_tpl
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static http()
Fetches the global http state from ILIAS.
This is how the factory for UI elements looks.
Common interface to all items.
ActionTarget
Officialy supported action targets, see https://learn.microsoft.com/en-us/openspecs/office_protocols/...