ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\User\Settings\Setting Class Reference
+ Inheritance diagram for ILIAS\User\Settings\Setting:
+ Collaboration diagram for ILIAS\User\Settings\Setting:

Public Member Functions

 __construct (private SettingDefinition $definition, private bool $changeable_by_user, private bool $changeable_in_local_user_administration, private bool $export)
 
 getIdentifier ()
 
 getLabel (Language $lng)
 
 isChangeableByUser ()
 
 isChangeableInLocalUserAdministration ()
 
 export ()
 
 getSettingsPage ()
 
 getSection ()
 
 getTableRow (DataRowBuilder $row_builder, Language $lng)
 
 getInput (FieldFactory $field_factory, Language $lng, Refinery $refinery, \ilSetting $settings, ?\ilObjUser $user=null)
 
 getLegacyInput (Language $lng, \ilSetting $settings, ?\ilObjUser $user=null)
 
 getForm (Language $lng, FieldFactory $ff, Refinery $refinery)
 
 getDefaultValueForDisplay (Language $lng, \ilSetting $settings)
 
 hasUserPersonalizedSetting (\ilSetting $settings, ?\ilObjUser $user)
 
 persistUserInput (\ilObjUser $user, Context $context, mixed $input, ?\ilPropertyFormGUI $form=null)
 
 retrieveValueFromUser (\ilObjUser $user)
 
 validateUserChoice (\ilGlobalTemplateInterface $tpl, Language $lng, \ilPropertyFormGUI $form)
 
 getIdentifier ()
 
 getLabel (Language $lng)
 
 getSection ()
 
 retrieveValueFromUser (\ilObjUser $user)
 

Private Member Functions

 buildCreateSettingTransformation (Refinery $refinery)
 

Detailed Description

Definition at line 34 of file Setting.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\User\Settings\Setting::__construct ( private SettingDefinition  $definition,
private bool  $changeable_by_user,
private bool  $changeable_in_local_user_administration,
private bool  $export 
)

Definition at line 36 of file Setting.php.

41 {
42 }

Member Function Documentation

◆ buildCreateSettingTransformation()

ILIAS\User\Settings\Setting::buildCreateSettingTransformation ( Refinery  $refinery)
private

Definition at line 187 of file Setting.php.

189 : Transformation {
190 return $refinery->custom()->transformation(
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'];
196 return $clone;
197 }
198 );
199 }

◆ export()

ILIAS\User\Settings\Setting::export ( )

Definition at line 64 of file Setting.php.

64 : bool
65 {
66 return $this->export;
67 }

Referenced by ILIAS\User\Settings\ConfigurationGUI\sortRows().

+ Here is the caller graph for this function:

◆ getDefaultValueForDisplay()

ILIAS\User\Settings\Setting::getDefaultValueForDisplay ( Language  $lng,
\ilSetting  $settings 
)

Definition at line 141 of file Setting.php.

144 : string {
145 $default_value = $this->definition->getDefaultValueForDisplay($lng, $settings);
146 if ($default_value === null) {
147 return '';
148 }
149 return $default_value;
150 }
global $lng
Definition: privfeed.php:31

◆ getForm()

ILIAS\User\Settings\Setting::getForm ( Language  $lng,
FieldFactory  $ff,
Refinery  $refinery 
)

Definition at line 119 of file Setting.php.

123 : array {
124 return [
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
134 ))->withValue($this->export),
135 ])->withAdditionalTransformation(
136 $this->buildCreateSettingTransformation($refinery)
137 )
138 ];
139 }
buildCreateSettingTransformation(Refinery $refinery)
Definition: Setting.php:187

◆ getIdentifier()

ILIAS\User\Settings\Setting::getIdentifier ( )

Implements ILIAS\User\Property.

Definition at line 44 of file Setting.php.

44 : string
45 {
46 return $this->definition->getIdentifier();
47 }

Referenced by ILIAS\User\Settings\SettingsImplementation\addAdditionalInputsToLegacyForm(), and ILIAS\User\Settings\SettingsImplementation\retrieveValuefromInputs().

+ Here is the caller graph for this function:

◆ getInput()

ILIAS\User\Settings\Setting::getInput ( FieldFactory  $field_factory,
Language  $lng,
Refinery  $refinery,
\ilSetting  $settings,
?\ilObjUser  $user = null 
)

Definition at line 94 of file Setting.php.

100 : Input {
101 return $this->definition->getInput($field_factory, $lng, $refinery, $settings, $user);
102 }

◆ getLabel()

ILIAS\User\Settings\Setting::getLabel ( Language  $lng)

Implements ILIAS\User\Property.

Definition at line 49 of file Setting.php.

49 : string
50 {
51 return $this->definition->getLabel($lng);
52 }

References $lng.

Referenced by ILIAS\User\Settings\ConfigurationGUI\sortRows().

+ Here is the caller graph for this function:

◆ getLegacyInput()

ILIAS\User\Settings\Setting::getLegacyInput ( Language  $lng,
\ilSetting  $settings,
?\ilObjUser  $user = null 
)

Definition at line 104 of file Setting.php.

109 $input = $this->definition->getLegacyInput(
110 $lng,
111 $settings,
112 $user
113 );
114
115 $input->setPostVar($this->definition->getIdentifier());
116 return $input;
117 }
This class represents a property in a property form.
setPostVar(string $a_postvar)

Referenced by ILIAS\User\Settings\SettingsImplementation\addAdditionalInputsToLegacyForm().

+ Here is the caller graph for this function:

◆ getSection()

ILIAS\User\Settings\Setting::getSection ( )

Implements ILIAS\User\Property.

Definition at line 74 of file Setting.php.

75 {
76 return $this->definition->getSection();
77 }

Referenced by ILIAS\User\Settings\SettingsImplementation\buildSectionKey().

+ Here is the caller graph for this function:

◆ getSettingsPage()

ILIAS\User\Settings\Setting::getSettingsPage ( )

Definition at line 69 of file Setting.php.

70 {
71 return $this->definition->getSettingsPage();
72 }

Referenced by ILIAS\User\Settings\SettingsImplementation\buildSectionKey().

+ Here is the caller graph for this function:

◆ getTableRow()

ILIAS\User\Settings\Setting::getTableRow ( DataRowBuilder  $row_builder,
Language  $lng 
)

Definition at line 79 of file Setting.php.

82 : DataRow {
83 return $row_builder->buildDataRow(
84 $this->definition->getIdentifier(),
85 [
86 'field' => $this->definition->getLabel($lng),
87 'changeable_by_user' => $this->changeable_by_user,
88 'changeable_in_local_user_administration' => $this->changeable_in_local_user_administration,
89 'export' => $this->export
90 ]
91 );
92 }
buildDataRow(string $id, array $record)

◆ hasUserPersonalizedSetting()

ILIAS\User\Settings\Setting::hasUserPersonalizedSetting ( \ilSetting  $settings,
?\ilObjUser  $user 
)

Definition at line 152 of file Setting.php.

155 : bool {
156 if ($user === null) {
157 return false;
158 }
159 return $this->definition->hasUserPersonalizedSetting($settings, $user);
160 }

Referenced by ILIAS\User\Settings\SettingsImplementation\addAdditionalInputsToLegacyForm().

+ Here is the caller graph for this function:

◆ isChangeableByUser()

ILIAS\User\Settings\Setting::isChangeableByUser ( )

Definition at line 54 of file Setting.php.

54 : bool
55 {
56 return $this->changeable_by_user;
57 }

Referenced by ILIAS\User\Settings\ConfigurationGUI\sortRows().

+ Here is the caller graph for this function:

◆ isChangeableInLocalUserAdministration()

ILIAS\User\Settings\Setting::isChangeableInLocalUserAdministration ( )

Definition at line 59 of file Setting.php.

59 : bool
60 {
61 return $this->changeable_in_local_user_administration;
62 }

Referenced by ILIAS\User\Settings\ConfigurationGUI\sortRows().

+ Here is the caller graph for this function:

◆ persistUserInput()

ILIAS\User\Settings\Setting::persistUserInput ( \ilObjUser  $user,
Context  $context,
mixed  $input,
?\ilPropertyFormGUI  $form = null 
)

Definition at line 162 of file Setting.php.

167 : \ilObjUser {
168 if (!$context->isSettingAvailableInType($this)) {
169 throw \Exception('It is not possible to Change this from here!');
170 }
171 return $this->definition->persistUserInput($user, $input, $form);
172 }
User class.
$context
Definition: webdav.php:31

◆ retrieveValueFromUser()

ILIAS\User\Settings\Setting::retrieveValueFromUser ( \ilObjUser  $user)

Implements ILIAS\User\Property.

Definition at line 174 of file Setting.php.

174 : mixed
175 {
176 return $this->definition->retrieveValueFromUser($user);
177 }

◆ validateUserChoice()

ILIAS\User\Settings\Setting::validateUserChoice ( \ilGlobalTemplateInterface  $tpl,
Language  $lng,
\ilPropertyFormGUI  $form 
)

Definition at line 179 of file Setting.php.

183 : ?bool {
184 return $this->definition->validateUserChoice($tpl, $lng, $form);
185 }

The documentation for this class was generated from the following file: