130 : StandardForm
131 {
132 $sections = [];
133 $sections[] = $this->ui_factory->input()->field()->section(
134 [
135 $this->ui_factory->input()->field()->checkbox(
136 $this->lng->txt("orgu_enable_my_staff"),
137 $this->lng->txt("orgu_enable_my_staff_info")
138 )
139 ->withValue($this->settings->get("enable_my_staff") ? true : false)
140 ],
141 $this->lng->txt("orgu_enable_my_staff")
142 );
143
144 $groups = [];
145 $values = [];
146 $available_types = $this->object_definition->getOrgUnitPermissionTypes();
147 foreach ($available_types as $object_type) {
148
150 $is_multi = false;
151
152 if ($this->object_definition->isPlugin($object_type)) {
154 } else {
155 $is_multi = !$this->object_definition->isSystemObject($object_type)
157 $lang_prefix = $is_multi ? 'objs_' : 'obj_';
158 $label = $this->
lng->txt($lang_prefix . $object_type);
159 }
160
161 $changeable = [];
162 if ($is_multi) {
163 $changeable[] = $this->ui_factory->input()->field()->switchableGroup(
164 [
165 $this->ui_factory->input()->field()->group(
166 [
167 $this->ui_factory->input()->field()->checkbox(
168 $this->lng->txt('orgu_global_set_type_default'),
169 $this->lng->txt('orgu_global_set_type_default_info'),
170 )
171 ->withValue((bool) $setting->getActivationDefault())
172 ],
173 $this->lng->txt('orgu_global_set_type_changeable_object'),
174 )
175 ,
176 $this->ui_factory->input()->field()->group(
177 [
178
179 ],
180 $this->lng->txt('orgu_global_set_type_changeable_no'),
181 )
182 ],
183 $this->lng->txt('orgu_global_set_type_changeable')
184 )
185 ->withValue(
186 $setting->isChangeableForObject() ? 0 : 1
187 )
188 ->withAdditionalTransformation(
189 $this->
refinery->custom()->transformation(
190 function ($v) {
191 $active = true;
192 $changeable = !(bool) array_shift($v);
193 $default = false;
194 if ($changeable) {
195 $default = (bool) current(array_shift($v));
196 }
197 return [$active, $changeable, $default];
198 }
199 )
200 );
201 } else {
202 $changeable[] = $this->ui_factory->input()->field()->hidden()->withValue('true')
203 ->withAdditionalTransformation(
204 $this->
refinery->custom()->transformation(
205 fn($v) => [true, false, false]
206 )
207 );
208 }
209
210 $groups[$object_type] = $this->ui_factory->input()->field()->optionalGroup(
211 $changeable,
212 $this->
lng->txt(
'orgu_global_set_positions_type_active') .
' ' . $label
213 );
214
215 if (!$setting->isActive()) {
216 $groups[$object_type] = $groups[$object_type]->withValue(null);
217 }
218 }
219
220 $sections[] = $this->ui_factory->input()->field()->section(
221 $groups,
222 $this->
lng->txt(
"orgu_global_set_positions")
223 );
224
225 $form_action = $this->
ctrl->getFormAction($this, self::CMD_SAVE);
226 return $this->ui_factory->input()->container()->form()->standard(
227 $form_action,
228 $sections
229 );
230 }
static lookupTxtById(string $plugin_id, string $lang_var)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...