19 declare(strict_types=1);
46 $this->ui_factory = $DIC->ui()->factory();
47 $this->ui_renderer = $DIC->ui()->renderer();
48 $this->
ctrl = $DIC->ctrl();
49 $this->
lng = $DIC->language();
57 return $this->ui_factory->input()->container()->form()->standard(
65 $wopi_activated = (bool) $this->
settings->get(
"wopi_activated",
'0');
66 $wopi_discovery_url = $this->
settings->get(
"wopi_discovery_url");
68 $wopi_url = $this->ui_factory->input()->field()->text(
69 $this->
lng->txt(
"wopi_url"),
70 $this->
lng->txt(
"wopi_url_byline")
77 $this->
refinery->custom()->transformation(
function ($v) {
78 return $v ===
'' ? null : $v;
80 )->withAdditionalTransformation(
81 $this->
refinery->custom()->constraint(
function ($v) {
86 }, $this->
lng->txt(
'msg_error_wopi_invalid_discorvery_url'))
87 )->withAdditionalTransformation(
88 $this->
refinery->custom()->transformation(
function ($v) {
89 $this->
settings->set(
"wopi_discovery_url", $v);
94 $wopi_discovery_url ??
'' 97 return $this->ui_factory->input()->field()->section(
99 $this->ui_factory->input()->field()->optionalGroup(
101 $this->
lng->txt(
"activate_wopi")
103 $wopi_discovery_url === null ? null : [$wopi_discovery_url]
104 )->withAdditionalTransformation(
105 $this->
refinery->custom()->transformation(
function ($v) {
106 if ($v === null || $v === [null]) {
107 $this->
settings->set(
"wopi_activated",
'0');
108 $this->
settings->delete(
"wopi_discovery_url");
110 $this->
settings->set(
"wopi_activated",
"1");
116 $this->
lng->txt(
"wopi_settings"),
122 $this->
form = $this->
form->withRequest($request);
124 return $this->
form->getData() !== null;
129 return $this->ui_renderer->render($this->
form);
132 private function renderLink(
string $translation,
string $url,
bool $new_tab =
true): string
134 $link = $this->ui_factory->link()->standard(
137 )->withOpenInNewViewport($new_tab);
138 return $this->ui_renderer->render($link);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
The scope of this class is split ilias-conform URI's into components.
form( $class_path, string $cmd, string $submit_caption="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...