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

Public Member Functions

 ilUserSearchOptions ()

Static Public Member Functions

static getSelectableColumnInfo ($a_admin=false)
 Get info of searchable fields for selectable columns in table gui.
static _getSearchableFieldsInfo ($a_admin=false)
static _getPossibleFields ($a_admin=false)
static _isSearchable ($a_key)
static _isEnabled ($a_key)
static _saveStatus ($a_key, $a_enabled)
static __appendUserDefinedFields ($fields, $counter)
static __prepareValues ($a_values)

Data Fields

 $db = null

Detailed Description

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

Member Function Documentation

static ilUserSearchOptions::__appendUserDefinedFields (   $fields,
  $counter 
)
static

Definition at line 222 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:

static ilUserSearchOptions::__prepareValues (   $a_values)
static

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

References $lng.

Referenced by __appendUserDefinedFields().

{
global $lng;
$new_values = array(0 => $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:

static ilUserSearchOptions::_getPossibleFields (   $a_admin = false)
static

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

Referenced by _getSearchableFieldsInfo(), and _isSearchable().

{
return array('gender',
'lastname',
'firstname',
'login',
'title',
'institution',
'department',
'street',
'zipcode',
'city',
'country',
'sel_country',
'email',
'hobby',
// begin-patch lok
'matriculation',
'interests_general',
'interests_help_offered',
'interests_help_looking'
);
// end-patch lok
}

+ Here is the caller graph for this function:

static ilUserSearchOptions::_getSearchableFieldsInfo (   $a_admin = false)
static
Todo:
: implement a more general solution

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

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

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

{
global $lng;
// begin-patch lok
$lng->loadLanguageModule('user');
// end-patch lok
$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'] = $lng->txt($field);
$fields[$counter]['db'] = $field;
$fields[$counter]['autoComplete'] = false;
switch($field)
{
case 'login':
case 'firstname':
case 'lastname':
case 'email':
$fields[$counter]['autoComplete'] = true;
break;
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;
// begin-patch lok
case 'interests_general':
case 'interests_help_offered':
case 'interests_help_looking':
$fields[$counter]['type'] = FIELD_TYPE_MULTI;
break;
// end-patch lok
/*
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:

static ilUserSearchOptions::_isEnabled (   $a_key)
static

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

Referenced by _getSearchableFieldsInfo(), ilUserFieldSettingsTableGUI\fillRow(), ilUserAutoComplete\getFields(), and ilMailAutoCompleteUserProvider\getFields().

{
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:

static ilUserSearchOptions::_isSearchable (   $a_key)
static

Definition at line 196 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:

static ilUserSearchOptions::_saveStatus (   $a_key,
  $a_enabled 
)
static

Definition at line 214 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:

static ilUserSearchOptions::getSelectableColumnInfo (   $a_admin = false)
static

Get info of searchable fields for selectable columns in table gui.

Parameters
bool$a_admin
Returns
array

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

Referenced by ilRepositoryUserResultTableGUI\getSelectableColumns().

{
$col_info = array();
foreach(self::_getSearchableFieldsInfo($a_admin) as $field)
{
if(is_numeric($field['db']))
{
$field['db'] = 'udf_'.$field['db'];
}
$col_info[$field['db']] = array(
'txt' => $field['lang']
);
if($field['db'] == 'login' or $field['db'] == 'firstname' or $field['db'] == 'lastname')
{
$col_info[$field['db']]['default'] = true;
}
}
return $col_info;
}

+ Here is the caller graph for this function:

ilUserSearchOptions::ilUserSearchOptions ( )

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

{
}

Field Documentation

ilUserSearchOptions::$db = null

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


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