ILIAS  Release_4_1_x_branch Revision 61804
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilUserSearchOptions Class Reference
+ Collaboration diagram for ilUserSearchOptions:

Public Member Functions

 ilUserSearchOptions ()
 _getSearchableFieldsInfo ($a_admin=false)
 _getPossibleFields ($a_admin=false)
 _isSearchable ($a_key)
 _isEnabled ($a_key)
 _saveStatus ($a_key, $a_enabled)
 __appendUserDefinedFields ($fields, $counter)
 __prepareValues ($a_values)

Data Fields

 $db = null

Detailed Description

Definition at line 38 of file class.ilUserSearchOptions.php.

Member Function Documentation

ilUserSearchOptions::__appendUserDefinedFields (   $fields,
  $counter 
)

Definition at line 181 of file class.ilUserSearchOptions.php.

References __prepareValues(), ilUserDefinedFields\_getInstance(), FIELD_TYPE_UDF_SELECT, FIELD_TYPE_UDF_TEXT, UDF_TYPE_SELECT, and UDF_TYPE_TEXT.

Referenced by _getSearchableFieldsInfo().

{
include_once './Services/User/classes/class.ilUserDefinedFields.php';
$user_defined_fields =& ilUserDefinedFields::_getInstance();
foreach($user_defined_fields->getSearchableDefinitions() as $definition)
{
$fields[$counter]['values'] = ilUserSearchOptions::__prepareValues($definition['field_values']);
$fields[$counter]['lang'] = $definition['field_name'];
$fields[$counter]['db'] = $definition['field_id'];
switch($definition['field_type'])
{
$fields[$counter]['type'] = FIELD_TYPE_UDF_TEXT;
break;
$fields[$counter]['type'] = FIELD_TYPE_UDF_SELECT;
break;
}
++$counter;
}
return $fields ? $fields : array();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilUserSearchOptions::__prepareValues (   $a_values)

Definition at line 208 of file class.ilUserSearchOptions.php.

Referenced by __appendUserDefinedFields().

{
$new_values = array(0 => $this->lng->txt('please_choose'));
foreach($a_values as $value)
{
$new_values[$value] = $value;
}
return $new_values ? $new_values : array();
}

+ Here is the caller graph for this function:

ilUserSearchOptions::_getPossibleFields (   $a_admin = false)

Definition at line 116 of file class.ilUserSearchOptions.php.

Referenced by _getSearchableFieldsInfo(), and _isSearchable().

{
if ($a_admin === true)
{
return array(
// 'active',
'gender',
'login',
'lastname',
'firstname',
'title',
'institution',
'department',
'street',
'zipcode',
'city',
'country',
'sel_country',
'email',
'matriculation');
}
return array('gender',
'login',
'lastname',
'firstname',
'title',
'institution',
'department',
'street',
'zipcode',
'city',
'country',
'sel_country',
'email',
'hobby',
'matriculation');
}

+ Here is the caller graph for this function:

ilUserSearchOptions::_getSearchableFieldsInfo (   $a_admin = false)

Definition at line 50 of file class.ilUserSearchOptions.php.

References $lng, __appendUserDefinedFields(), _getPossibleFields(), _isEnabled(), FIELD_TYPE_SELECT, FIELD_TYPE_TEXT, and ilCountry\getCountryCodes().

Referenced by ilAdminUserSearchGUI\__fillUserSearch(), ilRepositorySearchGUI\__performUserSearch(), ilAdminUserSearchGUI\__performUserSearch(), and ilRepositorySearchGUI\initFormSearch().

{
global $lng;
$counter = 1;
foreach(ilUserSearchOptions::_getPossibleFields($a_admin) as $field)
{
// TODO: check enabled
// DONE
if($a_admin == false and !ilUserSearchOptions::_isEnabled($field))
{
continue;
}
$fields[$counter]['values'] = array();
$fields[$counter]['type'] = FIELD_TYPE_TEXT;
$fields[$counter]['lang'] = $this->lng->txt($field);
$fields[$counter]['db'] = $field;
switch($field)
{
case 'title':
$fields[$counter]['lang'] = $lng->txt('person_title');
break;
// SELECTS
case 'gender':
$fields[$counter]['type'] = FIELD_TYPE_SELECT;
$fields[$counter]['values'] = array(0 => $lng->txt('please_choose'),
'f' => $lng->txt('gender_f'),
'm' => $lng->txt('gender_m'));
break;
case 'sel_country':
$fields[$counter]['type'] = FIELD_TYPE_SELECT;
$fields[$counter]['values'] = array(0 => $lng->txt('please_choose'));
// #7843 -- see ilCountrySelectInputGUI
$lng->loadLanguageModule('meta');
include_once('./Services/Utilities/classes/class.ilCountry.php');
foreach (ilCountry::getCountryCodes() as $c)
{
$fields[$counter]['values'][$c] = $lng->txt('meta_c_'.$c);
}
asort($fields[$counter]['values']);
break;
/*
case 'active':
$fields[$counter]['type'] = FIELD_TYPE_SELECT;
$fields[$counter]['values'] = array(-1 => $lng->txt('please_choose'),
'1' => $lng->txt('active'),
'0' => $lng->txt('inactive'));
break;
*/
}
++$counter;
}
return $fields ? $fields : array();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilUserSearchOptions::_isEnabled (   $a_key)

Definition at line 160 of file class.ilUserSearchOptions.php.

Referenced by _getSearchableFieldsInfo(), and ilUserFieldSettingsTableGUI\fillRow().

{
global $ilias;
// login is always enabled
if($a_key == 'login')
{
return true;
}
return (bool) $ilias->getSetting('search_enabled_'.$a_key);
}

+ Here is the caller graph for this function:

ilUserSearchOptions::_isSearchable (   $a_key)

Definition at line 155 of file class.ilUserSearchOptions.php.

References _getPossibleFields().

Referenced by ilUserFieldSettingsTableGUI\fillRow(), and ilObjUserFolderGUI\saveGlobalUserSettingsObject().

{
return in_array($a_key,ilUserSearchOptions::_getPossibleFields());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilUserSearchOptions::_saveStatus (   $a_key,
  $a_enabled 
)

Definition at line 173 of file class.ilUserSearchOptions.php.

Referenced by ilObjUserFolderGUI\saveGlobalUserSettingsObject().

{
global $ilias;
$ilias->setSetting('search_enabled_'.$a_key,(int) $a_enabled);
return true;
}

+ Here is the caller graph for this function:

ilUserSearchOptions::ilUserSearchOptions ( )

Definition at line 42 of file class.ilUserSearchOptions.php.

References $ilDB.

{
global $ilDB;
$this->db =& $ilDB;
$this->__read();
}

Field Documentation

ilUserSearchOptions::$db = null

Definition at line 40 of file class.ilUserSearchOptions.php.


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