19 declare(strict_types=1);
44 private bool $write_access
47 $this->ui_factory = $DIC->ui()->factory();
48 $this->ui_renderer = $DIC->ui()->renderer();
49 $this->
ctrl = $DIC->ctrl();
50 $this->
lng = $DIC->language();
58 return $this->ui_factory->input()->container()->form()->standard(
66 $wopi_discovery_url = $this->
settings->get(
"wopi_discovery_url");
67 $saving_interval_value = (
int) $this->
settings->get(
"saving_interval",
'0');
68 $saving_interval_value = $saving_interval_value === 0 ?
null : $saving_interval_value;
70 $wopi_url = $this->ui_factory
74 $this->
lng->txt(
"wopi_url"),
75 $this->
lng->txt(
"wopi_url_byline")
77 ->withDisabled(!$this->write_access)
78 ->withAdditionalTransformation(
79 $this->
refinery->custom()->transformation(fn($v) => $v ===
'' ?
null : $v)
81 $this->
refinery->custom()->constraint(
function ($v):
bool {
86 }, $this->
lng->txt(
'msg_error_wopi_invalid_discorvery_url'))
87 )->withAdditionalTransformation(
88 $this->
refinery->custom()->transformation(
function ($v):
true {
89 $this->
settings->set(
"wopi_discovery_url", $v);
94 $wopi_discovery_url ??
'' 97 $saving_interval = $this->ui_factory->input()->field()->optionalGroup(
103 $this->
lng->txt(
"saving_interval"),
104 $this->
lng->txt(
"saving_interval_byline")
106 ->withDisabled(!$this->write_access)
107 ->withAdditionalTransformation(
108 $this->
refinery->custom()->transformation(fn($v) => $v ===
'' ?
null : $v)
110 $this->
refinery->custom()->transformation(
function ($v):
true {
111 if ($v ===
null || $v === 0) {
112 $this->
settings->delete(
"saving_interval");
116 $this->
settings->set(
"saving_interval", (
string) $v);
121 $saving_interval_value
124 $this->
lng->txt(
"activate_saving_interval")
126 $saving_interval_value ===
null ?
null : [$saving_interval_value]
127 )->withAdditionalTransformation(
128 $this->
refinery->custom()->transformation(
function ($v) {
130 $this->
settings->delete(
"saving_interval");
136 return $this->ui_factory
145 [$wopi_url, $saving_interval],
146 $this->
lng->txt(
"activate_wopi")
148 ->withDisabled(!$this->write_access)
150 $wopi_discovery_url ===
null ?
null : [
152 $saving_interval_value ===
null ?
null : [$saving_interval_value]
154 )->withAdditionalTransformation(
155 $this->
refinery->custom()->transformation(
function ($v) {
157 $this->
settings->set(
"wopi_activated",
'0');
158 $this->
settings->delete(
"wopi_discovery_url");
160 $this->
settings->set(
"wopi_activated",
"1");
166 $this->
lng->txt(
"wopi_settings"),
172 $this->
form = $this->
form->withRequest($request);
174 return $this->
form->getData() !==
null;
179 return $this->ui_renderer->render($this->
form);
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
This is how the factory for UI elements looks.
form( $class_path, string $cmd, string $submit_caption="")