19declare(strict_types=1);
38 private bool $changeable_by_user,
39 private bool $changeable_in_local_user_administration,
46 return $this->definition->getIdentifier();
51 return $this->definition->getLabel(
$lng);
56 return $this->changeable_by_user;
61 return $this->changeable_in_local_user_administration;
71 return $this->definition->getSettingsPage();
76 return $this->definition->getSection();
83 return $row_builder->buildDataRow(
87 'changeable_by_user' => $this->changeable_by_user,
88 'changeable_in_local_user_administration' => $this->changeable_in_local_user_administration,
95 FieldFactory $field_factory,
109 $input = $this->definition->getLegacyInput(
115 $input->
setPostVar($this->definition->getIdentifier());
125 'setting' => $ff->group([
126 'changeable_by_user' => $ff->checkbox(
$lng->txt(
127 PropertyAttributes::ChangeableByUser->value
128 ))->
withValue($this->changeable_by_user),
129 'changeable_in_local_user_administration' => $ff->checkbox(
$lng->txt(
130 PropertyAttributes::ChangeableInLocalUserAdministration->value
131 ))->
withValue($this->changeable_in_local_user_administration),
132 'export' => $ff->checkbox(
$lng->txt(
133 PropertyAttributes::
Export->value
136 $this->buildCreateSettingTransformation(
$refinery)
145 $default_value = $this->definition->getDefaultValueForDisplay(
$lng, $settings);
146 if ($default_value ===
null) {
149 return $default_value;
156 if ($user === null) {
159 return $this->definition->hasUserPersonalizedSetting($settings, $user);
168 if (!
$context->isSettingAvailableInType($this)) {
169 throw \Exception(
'It is not possible to Change this from here!');
171 return $this->definition->persistUserInput($user, $input, $form);
176 return $this->definition->retrieveValueFromUser($user);
184 return $this->definition->validateUserChoice($tpl,
$lng, $form);
191 function (array $vs): self {
192 $clone = clone $this;
193 $clone->changeable_by_user = $vs[
'changeable_by_user'];
194 $clone->changeable_in_local_user_administration = $vs[
'changeable_in_local_user_administration'];
195 $clone->export = $vs[
'export'];
__construct(private SettingDefinition $definition, private bool $changeable_by_user, private bool $changeable_in_local_user_administration, private bool $export)
getTableRow(DataRowBuilder $row_builder, Language $lng)
isChangeableInLocalUserAdministration()
persistUserInput(\ilObjUser $user, Context $context, mixed $input, ?\ilPropertyFormGUI $form=null)
validateUserChoice(\ilGlobalTemplateInterface $tpl, Language $lng, \ilPropertyFormGUI $form)
getDefaultValueForDisplay(Language $lng, \ilSetting $settings)
hasUserPersonalizedSetting(\ilSetting $settings, ?\ilObjUser $user)
getLegacyInput(Language $lng, \ilSetting $settings, ?\ilObjUser $user=null)
buildCreateSettingTransformation(Refinery $refinery)
getForm(Language $lng, FieldFactory $ff, Refinery $refinery)
retrieveValueFromUser(\ilObjUser $user)
getInput(FieldFactory $field_factory, Language $lng, Refinery $refinery, \ilSetting $settings, ?\ilObjUser $user=null)
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
if(!file_exists('../ilias.ini.php'))