4 include_once(
"./Services/Table/classes/class.ilTable2GUI.php");
26 $this->
setTitle($lng->txt(
"usr_settings_header_profile"));
27 $this->
setDescription($lng->txt(
"usr_settings_explanation_profile"));
32 $this->
addColumn($this->lng->txt(
"user_field"),
"");
33 $this->
addColumn($this->lng->txt(
"access"),
"");
34 $this->
addColumn($this->lng->txt(
"export").
" / ".$this->lng->txt(
"search"),
"");
35 $this->
addColumn($this->lng->txt(
"default"),
"");
39 $this->
setRowTemplate(
"tpl.std_fields_settings_row.html",
"Services/User");
43 include_once(
"./Services/User/classes/class.ilUserProfile.php");
45 $up->skipField(
"username");
46 $fds = $up->getStandardFields();
48 foreach ($fds as $k => $f)
63 $field = $a_set[
"key"];
66 "visible" =>
"user_visible_in_profile",
67 "changeable" =>
"changeable",
68 "searchable" =>
"header_searchable",
69 "required" =>
"required_field",
71 "course_export" =>
"course_export",
72 'group_export' =>
'group_export',
73 "visib_reg" =>
"header_visible_registration",
74 'visib_lua' =>
'usr_settings_visib_lua',
75 'changeable_lua' =>
'usr_settings_changeable_lua'
78 foreach ($props as $prop => $lv)
80 $up_prop = strtoupper($prop);
82 if (($prop !=
"searchable" && $a_set[$prop.
"_hide"] !=
true) ||
85 $this->tpl->setCurrentBlock($prop);
86 $this->tpl->setVariable(
"HEADER_".$up_prop,
88 $this->tpl->setVariable(
"PROFILE_OPTION_".$up_prop, $prop.
"_".$field);
92 if ($prop ==
"visible" && $ilSetting->get(
"usr_settings_hide_".$field) !=
"1")
96 if ($prop ==
"changeable" && $ilSetting->get(
"usr_settings_disable_".$field) !=
"1")
104 if ($prop ==
"required" && $ilSetting->get(
"require_".$field) ==
"1")
108 if ($prop ==
"export" && $ilSetting->get(
"usr_settings_export_".$field) ==
"1")
112 if ($prop ==
"course_export" && $ilSetting->get(
"usr_settings_course_export_".$field) ==
"1")
116 if ($prop ==
"group_export" && $ilSetting->get(
"usr_settings_group_export_".$field) ==
"1")
120 if ($prop ==
"visib_reg" && (
int)$ilSetting->get(
'usr_settings_visib_reg_'.$field,
'1'))
124 if ($prop ==
"visib_lua" && (
int)$ilSetting->get(
'usr_settings_visib_lua_'.$field,
'1'))
129 if ($prop ==
"changeable_lua" && (
int)$ilSetting->get(
'usr_settings_changeable_lua_'.$field,
'1'))
135 if ($this->confirm_change == 1)
137 $checked =
$_POST[
"chb"][$prop.
"_".$field];
139 if (isset($a_set[$prop.
"_fix_value"]))
141 $checked = $a_set[$prop.
"_fix_value"];
146 $this->tpl->setVariable(
"CHECKED_".$up_prop,
" checked=\"checked\"");
148 if (isset($a_set[$prop.
"_fix_value"]))
150 $this->tpl->setVariable(
"DISABLE_".$up_prop,
" disabled=\"disabled\"");
152 $this->tpl->parseCurrentBlock();
157 if ($a_set[
"default"] !=
"")
159 switch ($a_set[
"input"])
163 $selected_option = $ilSetting->get($field);
164 if ($selected_option ==
"")
166 $selected_option = $a_set[
"default"];
168 foreach ($a_set[
"options"] as $k => $v)
170 $this->tpl->setCurrentBlock(
"def_sel_option");
171 $this->tpl->setVariable(
"OPTION_VALUE", $k);
172 $text = ($a_set[
"input"] ==
"selection")
175 if ($a_set[
"input"] ==
"hitsperpage" && $k == 9999)
177 $text = $lng->txt(
"no_limit");
179 if ($selected_option == $k)
181 $this->tpl->setVariable(
"OPTION_SELECTED",
182 ' selected="selected" ');
184 $this->tpl->setVariable(
"OPTION_TEXT", $text);
185 $this->tpl->parseCurrentBlock();
187 $this->tpl->setCurrentBlock(
"def_selection");
188 $this->tpl->setVariable(
"PROFILE_OPTION_DEFAULT_VALUE",
"default_" . $field);
189 $this->tpl->parseCurrentBlock();
192 $this->tpl->setCurrentBlock(
"default");
193 $this->tpl->parseCurrentBlock();
197 $this->tpl->setVariable(
"TXT_GROUP", $lng->txt($a_set[
"group"]));
200 $lv = ($a_set[
"lang_var"] ==
"")
202 : $a_set[
"lang_var"];
203 if ($a_set[
"key"] ==
"country")
205 $lv =
"country_free_text";
207 if ($a_set[
"key"] ==
"sel_country")
209 $lv =
"country_selection";
212 $this->tpl->setVariable(
"TXT_FIELD", $lng->txt($lv));
217 $this->confirm_change =
true;