19 declare(strict_types=1);
39 $ilCtrl = $DIC[
'ilCtrl'];
46 $this->main_tpl->setOnScreenMessage(
'info',
$lng->
txt(
'usr_settings_explanation_profile'));
53 $this->
addColumn($this->
lng->txt(
"export") .
" / " . $this->
lng->txt(
"search"),
"");
58 $this->
setRowTemplate(
"tpl.std_fields_settings_row.html",
"components/ILIAS/User");
63 $up->skipField(
"username");
64 $fds = $up->getStandardFields();
65 foreach ($fds as $k =>
$f) {
81 protected function fillRow(array $a_set): void
88 $req_checked = $this->user_request->getChecked();
90 $field = $a_set[
"key"];
93 $up_prop = strtoupper($prop);
95 if (($prop !=
"searchable" && ($a_set[$prop .
"_hide"] ??
false) !=
true) ||
97 $this->tpl->setCurrentBlock($prop);
98 $this->tpl->setVariable(
102 $this->tpl->setVariable(
"PROFILE_OPTION_" . $up_prop, $prop .
"_" . $field);
106 if ($prop ===
"visible" && $user_settings_config->
isVisible($field)) {
109 if ($prop ===
"changeable" && $user_settings_config->
isChangeable($field)) {
115 if ($prop ===
"required" &&
$ilSetting->get(
"require_" . $field) ==
"1") {
118 if ($prop ===
"export" &&
$ilSetting->get(
"usr_settings_export_" . $field) ==
"1") {
121 if ($prop ===
"course_export" &&
$ilSetting->get(
"usr_settings_course_export_" . $field) ==
"1") {
124 if ($prop ===
"group_export" &&
$ilSetting->get(
"usr_settings_group_export_" . $field) ==
"1") {
127 if ($prop ===
"visib_reg" && (
int)
$ilSetting->get(
'usr_settings_visib_reg_' . $field,
'1')) {
130 if ($prop ===
"visib_lua" && (
int)
$ilSetting->get(
'usr_settings_visib_lua_' . $field,
'1')) {
133 if ($prop ===
"changeable_lua" && (
int)
$ilSetting->get(
'usr_settings_changeable_lua_' . $field,
'1')) {
136 if ($prop ===
"prg_export" &&
$ilSetting->get(
"usr_settings_prg_export_" . $field) ===
"1") {
140 if ($this->confirm_change == 1) {
141 $checked = $req_checked[$prop .
"_" . $field] ??
false;
143 if (isset($a_set[$prop .
"_fix_value"])) {
144 $checked = $a_set[$prop .
"_fix_value"];
148 $this->tpl->setVariable(
"CHECKED_" . $up_prop,
" checked=\"checked\"");
149 if (!isset($a_set[
"{$prop}_fix_value"])) {
150 $this->tpl->setVariable(
"CURRENT_OPTION_VISIBLE",
"1");
153 $this->tpl->setVariable(
"CURRENT_OPTION_VISIBLE",
"0");
156 if (isset($a_set[$prop .
"_fix_value"])) {
157 $this->tpl->setVariable(
"DISABLE_" . $up_prop,
" disabled=\"disabled\"");
159 $this->tpl->parseCurrentBlock();
164 if (($a_set[
"default"] ??
"") !=
"") {
165 switch ($a_set[
"input"]) {
168 if ($selected_option ==
"") {
169 $selected_option = $a_set[
"default"];
171 foreach ($a_set[
"options"] as $k => $v) {
172 $this->tpl->setCurrentBlock(
"def_sel_option");
173 $this->tpl->setVariable(
"OPTION_VALUE", $k);
174 $text = ($a_set[
"input"] ==
"selection")
177 if ($selected_option == $k) {
178 $this->tpl->setVariable(
180 ' selected="selected" ' 183 $this->tpl->setVariable(
"OPTION_TEXT", $text);
184 $this->tpl->parseCurrentBlock();
186 $this->tpl->setCurrentBlock(
"def_selection");
187 $this->tpl->setVariable(
"PROFILE_OPTION_DEFAULT_VALUE",
"default_" . $field);
188 $this->tpl->parseCurrentBlock();
191 $this->tpl->setCurrentBlock(
'def_input');
193 $this->tpl->setVariable(
'PROFILE_OPTION_DEFAULT_VALUE',
'default_' . $field);
195 $this->tpl->setVariable(
'CURRENT_OPTION_VISIBLE', $session_reminder->getGlobalSessionReminderLeadTime());
196 $this->tpl->setVariable(
'CURRENT_OPTION_MAXIMUM', $session_reminder->getMaxPossibleLeadTime());
199 $this->tpl->parseCurrentBlock();
203 $this->tpl->setCurrentBlock(
"default");
204 $this->tpl->parseCurrentBlock();
208 $this->tpl->setVariable(
"TXT_GROUP",
$lng->
txt($a_set[
"group"]));
211 $lv = (($a_set[
"lang_var"] ??
"") ==
"")
213 : $a_set[
"lang_var"];
214 if ($a_set[
"key"] ==
"country") {
215 $lv =
"country_free_text";
217 if ($a_set[
"key"] ==
"sel_country") {
218 $lv =
"country_selection";
221 $this->tpl->setVariable(
"TXT_FIELD",
$lng->
txt($lv));
226 $this->confirm_change =
true;
__construct(object $a_parent_obj, string $a_parent_cmd)
UserGUIRequest $user_request
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setFormAction(string $a_form_action, bool $a_multipart=false)
isVisible(string $field)
Is setting visible to user?
setEnableTitle(bool $a_enabletitle)
static _isSearchable(string $a_key)
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
ilUserSettingsConfig $user_settings_config
isChangeable(string $field)
Is setting changeable by user?
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
const USER_FIELD_TRANSLATION_MAPPING
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
__construct(Container $dic, ilPlugin $plugin)
setLimit(int $a_limit=0, int $a_default_limit=0)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
disable(string $a_module_name)
static _isEnabled($a_key)
setEnableHeader(bool $a_enableheader)
const int LEAD_TIME_DISABLED