19declare(strict_types=1);
51 foreach (self::_getSearchableFieldsInfo($a_admin) as $field) {
52 if (is_numeric($field[
'db'])) {
53 $field[
'db'] =
'udf_' . $field[
'db'];
56 $col_info[$field[
'db']] = array(
57 'txt' => $field[
'lang']
60 if ($field[
'db'] ==
'login' or $field[
'db'] ==
'firstname' or $field[
'db'] ==
'lastname') {
61 $col_info[$field[
'db']][
'default'] =
true;
74 $lng->loadLanguageModule(
'user');
82 if ($a_admin ==
false and !ilUserSearchOptions::_isEnabled($field)) {
85 $fields[
$counter][
'values'] = array();
93 $fields[
$counter][
'autoComplete'] =
false;
100 $fields[
$counter][
'autoComplete'] =
true;
111 $fields[
$counter][
'values'] = array(
112 0 =>
$lng->txt(
'please_choose'),
113 'n' =>
$lng->txt(
'gender_n'),
114 'f' =>
$lng->txt(
'gender_f'),
115 'm' =>
$lng->txt(
'gender_m'),
123 $lng->loadLanguageModule(
'meta');
128 array_unshift($fields[
$counter][
'values'],
$lng->txt(
'please_choose'));
135 foreach ($paths as $org_ref_id =>
$path) {
144 case 'interests_general':
145 case 'interests_help_offered':
146 case 'interests_help_looking':
155 return $fields ?: array();
160 return array(
'gender',
178 'interests_help_offered',
179 'interests_help_looking'
189 public static function _isEnabled($a_key): bool
194 $profile =
$DIC[
'user']->getProfile();
197 if ($a_key ==
'login') {
201 return $profile->getFieldByIdentifier($a_key)?->isSearchable() ??
false;
204 public static function _saveStatus(
string $a_key,
bool $a_enabled): bool
208 $ilias =
$DIC[
'ilias'];
210 $ilias->setSetting(
'search_enabled_' . $a_key, (
string) $a_enabled);
218 foreach (
$DIC[
'user']->getProfile()->getVisibleUserDefinedFields(Context::Search) as $field) {
219 $input = $field->getLegacyInput(
$lng, Context::Search);
221 $fields[
$counter][
'db'] =
"udf_{$field->getIdentifier()}";
223 switch ($input::class) {
224 case ilTextInputGUI::class:
225 case ilTextAreaInputGUI::class:
229 case ilMultiSelectInputGUI::class:
234 case ilSelectInputGUI::class:
241 $fields[
$counter][
'type'] = $input::class;
255 $new_values = array(0 =>
$lng->txt(
'please_choose'));
256 foreach ($a_values as $value) {
257 $new_values[$value] = $value;
static getCountryCodes()
Get country codes (DIN EN 3166-1)
static getTextRepresentationOfOrgUnits(bool $sort_by_title=true)
Get ref id path array.
Class ilUserSearchOptions.
static __appendUserDefinedFields(array $fields, int $counter)
const int FIELD_TYPE_UDF_UNDEFINED
static _getSearchableFieldsInfo(bool $a_admin=false)
static _saveStatus(string $a_key, bool $a_enabled)
const int FIELD_TYPE_UDF_TEXT
const int FIELD_TYPE_SELECT
const int FIELD_TYPE_UDF_WYSIWYG
const int FIELD_TYPE_MULTI
static _isSearchable(string $a_key)
static __prepareValues(array $a_values)
static _getPossibleFields(bool $a_admin=false)
static getSelectableColumnInfo(bool $a_admin=false)
Get info of searchable fields for selectable columns in table gui.
const int FIELD_TYPE_UDF_SELECT
const int FIELD_TYPE_TEXT