本文整理汇总了PHP中UserManager::get_extra_field_information方法的典型用法代码示例。如果您正苦于以下问题:PHP UserManager::get_extra_field_information方法的具体用法?PHP UserManager::get_extra_field_information怎么用?PHP UserManager::get_extra_field_information使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserManager
的用法示例。
在下文中一共展示了UserManager::get_extra_field_information方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: is_numeric
// Getting all the additional information of an additional profile field.
if (isset($_GET['additional_profile_field']) &&
is_numeric($_GET['additional_profile_field'])
) {
$user_array = array();
foreach ($a_students as $key => $item) {
$user_array[] = $key;
}
// Fetching only the user that are loaded NOT ALL user in the portal.
$additional_user_profile_info = TrackingCourseLog::get_addtional_profile_information_of_field_by_user(
$_GET['additional_profile_field'],
$user_array
);
$extra_info = UserManager::get_extra_field_information(
$_GET['additional_profile_field']
);
}
/* MAIN CODE */
echo '<div class="actions">';
echo Display::return_icon('user_na.png', get_lang('StudentsTracking'), array(), ICON_SIZE_MEDIUM);
echo Display::url(
Display::return_icon('course.png', get_lang('CourseTracking'), array(), ICON_SIZE_MEDIUM),
'course_log_tools.php?'.api_get_cidreq()
);
echo Display::url(
Display::return_icon('tools.png', get_lang('ResourcesTracking'), array(), ICON_SIZE_MEDIUM),
示例2: get_lang
$form->addRule('fieldlabel', get_lang('OnlyLettersAndNumbersAllowed'), 'username');
$form->addRule('fieldlabel', '', 'maxlength', 60);
//$form->addRule('fieldlabel', get_lang('FieldTaken'), 'fieldlabel_available');
// Field options possible
$form->addElement('text', 'fieldoptions', get_lang('FieldPossibleValues') . Display::return_icon('info3.gif', get_lang('FieldPossibleValuesComment'), array('align' => 'absmiddle', 'hspace' => '3px')));
$form->applyFilter('fieldoptions', 'trim');
if (is_numeric($_GET['field_id'])) {
$form->addElement('static', 'option_reorder', '', '<a href="user_fields_options.php?field_id=' . Security::remove_XSS($_GET['field_id']) . '">' . get_lang('ReorderOptions') . '</a>');
}
// Field default value
$form->addElement('text', 'fielddefaultvalue', get_lang('FieldDefaultValue'));
$form->applyFilter('fielddefaultvalue', 'trim');
// Set default values (only not empty when editing)
$defaults = array();
if (is_numeric($_GET['field_id'])) {
$form_information = UserManager::get_extra_field_information((int) $_GET['field_id']);
$defaults['fieldtitle'] = $form_information['field_display_text'];
$defaults['fieldlabel'] = $form_information['field_variable'];
$defaults['fieldtype'] = $form_information['field_type'];
$defaults['fielddefaultvalue'] = $form_information['field_default_value'];
$count = 0;
// we have to concatenate the options
if (count($form_information['options']) > 0) {
foreach ($form_information['options'] as $option_id => $option) {
if ($count != 0) {
$defaults['fieldoptions'] = $defaults['fieldoptions'] . '; ' . $option['option_display_text'];
} else {
$defaults['fieldoptions'] = $option['option_display_text'];
}
$count++;
}
示例3: get_addtional_profile_information_of_field_by_user
/**
* This function gets all the information of a certrain ($field_id)
* additional profile field for a specific list of users is more efficent
* than get_addtional_profile_information_of_field() function
* It gets the information of all the users so that it can be displayed
* in the sortable table or in the csv or xls export
*
* @author Julio Montoya <gugli100@gmail.com>
* @param int field id
* @param array list of user ids
* @return array
* @since Nov 2009
* @version 1.8.6.2
*/
public static function get_addtional_profile_information_of_field_by_user($field_id, $users)
{
// Database table definition
$table_user = Database::get_main_table(TABLE_MAIN_USER);
$table_user_field_values = Database::get_main_table(TABLE_MAIN_USER_FIELD_VALUES);
$result_extra_field = UserManager::get_extra_field_information($field_id);
if (!empty($users)) {
if ($result_extra_field['field_type'] == UserManager::USER_FIELD_TYPE_TAG ) {
foreach($users as $user_id) {
$user_result = UserManager::get_user_tags($user_id, $field_id);
$tag_list = array();
foreach($user_result as $item) {
$tag_list[] = $item['tag'];
}
$return[$user_id][] = implode(', ',$tag_list);
}
} else {
$new_user_array = array();
foreach($users as $user_id) {
$new_user_array[]= "'".$user_id."'";
}
$users = implode(',',$new_user_array);
//selecting only the necessary information NOT ALL the user list
$sql = "SELECT user.user_id, field.field_value FROM $table_user user INNER JOIN $table_user_field_values field
ON (user.user_id = field.user_id)
WHERE field.field_id=".intval($field_id)." AND user.user_id IN ($users)";
$result = Database::query($sql);
while($row = Database::fetch_array($result)) {
// get option value for field type double select by id
if (!empty($row['field_value'])) {
if ($result_extra_field['field_type'] == USER_FIELD_TYPE_DOUBLE_SELECT) {
$id_double_select = explode(';',$row['field_value']);
if (is_array($id_double_select)) {
$value1 = $result_extra_field['options'][$id_double_select[0]]['option_value'];
$value2 = $result_extra_field['options'][$id_double_select[1]]['option_value'];
$row['field_value'] = ($value1.';'.$value2);
}
}
}
// get other value from extra field
$return[$row['user_id']][] = $row['field_value'];
}
}
}
return $return;
}
示例4: get_addtional_profile_information_of_field_by_user
/**
* This function gets all the information of a certrain ($field_id)
* additional profile field for a specific list of users is more efficent
* than get_addtional_profile_information_of_field() function
* It gets the information of all the users so that it can be displayed
* in the sortable table or in the csv or xls export
*
* @author Julio Montoya <gugli100@gmail.com>
* @param int field id
* @param array list of user ids
* @return array
* @since Nov 2009
* @version 1.8.6.2
*/
public static function get_addtional_profile_information_of_field_by_user($field_id, $users)
{
// Database table definition
$table_user = Database::get_main_table(TABLE_MAIN_USER);
$table_user_field_values = Database::get_main_table(TABLE_EXTRA_FIELD_VALUES);
$extraField = Database::get_main_table(TABLE_EXTRA_FIELD);
$result_extra_field = UserManager::get_extra_field_information($field_id);
if (!empty($users)) {
if ($result_extra_field['field_type'] == UserManager::USER_FIELD_TYPE_TAG) {
foreach ($users as $user_id) {
$user_result = UserManager::get_user_tags($user_id, $field_id);
$tag_list = array();
foreach ($user_result as $item) {
$tag_list[] = $item['tag'];
}
$return[$user_id][] = implode(', ', $tag_list);
}
} else {
$new_user_array = array();
foreach ($users as $user_id) {
$new_user_array[] = "'" . $user_id . "'";
}
$users = implode(',', $new_user_array);
$extraFieldType = EntityExtraField::USER_FIELD_TYPE;
// Selecting only the necessary information NOT ALL the user list
$sql = "SELECT user.user_id, v.value\n \t\t\t FROM {$table_user} user\n \t\t\t INNER JOIN {$table_user_field_values} v\n ON (user.user_id = v.item_id)\n INNER JOIN {$extraField} f\n ON (f.id = v.field_id)\n WHERE\n f.extra_field_type = {$extraFieldType} AND\n v.field_id=" . intval($field_id) . " AND\n user.user_id IN ({$users})";
$result = Database::query($sql);
while ($row = Database::fetch_array($result)) {
// get option value for field type double select by id
if (!empty($row['value'])) {
if ($result_extra_field['field_type'] == ExtraField::FIELD_TYPE_DOUBLE_SELECT) {
$id_double_select = explode(';', $row['value']);
if (is_array($id_double_select)) {
$value1 = $result_extra_field['options'][$id_double_select[0]]['option_value'];
$value2 = $result_extra_field['options'][$id_double_select[1]]['option_value'];
$row['value'] = $value1 . ';' . $value2;
}
}
}
// get other value from extra field
$return[$row['user_id']][] = $row['value'];
}
}
}
return $return;
}
示例5: SortableTable
}
break;
case 'movedown':
if (api_is_platform_admin() && !empty($_GET['option_id'])) {
if (move_user_field_option('movedown', $_GET['option_id'])) {
Display::display_confirmation_message(get_lang('FieldOptionMovedDown'));
} else {
Display::display_error_message(get_lang('CannotMoveFieldOption'));
}
}
break;
}
}
}
// getting all the information of the field
$field_info = UserManager::get_extra_field_information($_GET['field_id']);
echo Display::page_header($field_info['3']);
// the total number of options (used in the actions_filter function but declared here for performance reasons)
$number_of_options = get_number_of_options();
// displaying the sortable table
$parameters['sec_token'] = Security::get_token();
$parameters['field_id'] = Security::remove_XSS($_GET['field_id']);
$table = new SortableTable('options', 'get_number_of_options', 'get_options_data', 2);
$table->set_additional_parameters($parameters);
$table->set_header(0, get_lang('DisplayOrder'), false);
$table->set_header(1, get_lang('OptionText'), false);
$table->set_header(2, get_lang('Actions'), false);
$table->set_column_filter(2, 'actions_filter');
$table->display();
// display footer
Display::display_footer();