本文整理汇总了PHP中UserManager::set_extra_fields_in_form方法的典型用法代码示例。如果您正苦于以下问题:PHP UserManager::set_extra_fields_in_form方法的具体用法?PHP UserManager::set_extra_fields_in_form怎么用?PHP UserManager::set_extra_fields_in_form使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserManager
的用法示例。
在下文中一共展示了UserManager::set_extra_fields_in_form方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_lang
}
if ($list['language'] == 1) {
//LANGUAGE
$form->addElement('select_language', 'language', get_lang('Language'));
if (api_get_setting('profile', 'language') !== 'true') {
$form->freeze('language');
}
if (api_get_setting('profile', 'language') == 'true') {
$form->addRule('language', get_lang('ThisFieldIsRequired'), 'required');
}
}
// EXTRA FIELDS
$extra_data = UserManager :: get_extra_user_data($user_id, true);
UserManager::set_extra_fields_in_form($form, $extra_data, 'profile');
$form->addElement('style_submit_button', '', get_lang('Next'), array('class' => 'next'));
$user_data = array_merge($user_data, $extra_data);
$form->setDefaults($user_data);
}
if ($survey_data['form_fields'] && $survey_data['anonymous'] == 0 && is_array($user_data) && !isset($_GET['show'])) {
if ($form->validate()) {
$user_data = $form->exportValues();
if (is_array($user_data)) {
if (count($user_data) > 0) {
$extras = array();
// Build SQL query
$sql = "UPDATE $table_user SET";
foreach ($user_data as $key => $value) {
示例2: api_get_user_info
$creatorInfo = api_get_user_info($user_data['creator_id']);
$date = sprintf(get_lang('CreatedByXYOnZ'), 'user_information.php?user_id=' . $user_data['creator_id'], $creatorInfo['username'], $user_data['registration_date']);
$form->addElement('html', '<div class="control-group"><label class="control-label">' . get_lang('RegistrationDate') . '</label><div class="controls">' . $date . '</div></div>');
if (!$user_data['platform_admin']) {
// Expiration Date
$form->addElement('radio', 'radio_expiration_date', get_lang('ExpirationDate'), get_lang('NeverExpires'), 0);
$group = array();
$group[] = $form->createElement('radio', 'radio_expiration_date', null, get_lang('On'), 1);
$group[] = $form->createElement('datepicker', 'expiration_date', null, array('form_name' => $form->getAttribute('name'), 'onchange' => 'javascript: enable_expiration_date();'));
$form->addGroup($group, 'max_member_group', null, '', false);
// Active account or inactive account
$form->addElement('radio', 'active', get_lang('ActiveAccount'), get_lang('Active'), 1);
$form->addElement('radio', 'active', '', get_lang('Inactive'), 0);
}
// EXTRA FIELDS
$return_params = UserManager::set_extra_fields_in_form($form, $extra_data, 'user_edit', true, $user_id);
$jquery_ready_content = $return_params['jquery_ready_content'];
// the $jquery_ready_content variable collects all functions that will be load in the $(document).ready javascript function
$htmlHeadXtra[] = '<script>
$(document).ready(function(){
' . $jquery_ready_content . '
});
</script>';
// Submit button
$form->addElement('style_submit_button', 'submit', get_lang('ModifyInformation'), 'class="save"');
// Set default values
$user_data['reset_password'] = 0;
$expiration_date = $user_data['expiration_date'];
if ($expiration_date == '0000-00-00 00:00:00') {
$user_data['radio_expiration_date'] = 0;
$user_data['expiration_date'] = array();
示例3: array
// Send email
$group = array();
$group[] = $form->createElement('radio', 'send_mail', null, get_lang('Yes'), 1);
$group[] = $form->createElement('radio', 'send_mail', null, get_lang('No'), 0);
$form->addGroup($group, 'mail', get_lang('SendMailToNewUser'), ' ');
// Expiration Date
$form->addElement('radio', 'radio_expiration_date', get_lang('ExpirationDate'), get_lang('NeverExpires'), 0);
$group = array();
$group[] = $form->createElement('radio', 'radio_expiration_date', null, get_lang('On'), 1);
$group[] = $form->createElement('datepicker', 'expiration_date', null, array('form_name' => $form->getAttribute('name'), 'onchange' => 'javascript: enable_expiration_date();'));
$form->addGroup($group, 'max_member_group', null, '', false);
// Active account or inactive account
$form->addElement('radio', 'active', get_lang('ActiveAccount'), get_lang('Active'), 1);
$form->addElement('radio', 'active', '', get_lang('Inactive'), 0);
$extra_data = UserManager::get_extra_user_data(0, true);
$return_params = UserManager::set_extra_fields_in_form($form, $extra_data, 'user_add');
$jquery_ready_content = $return_params['jquery_ready_content'];
// the $jquery_ready_content variable collects all functions that will be load in the $(document).ready javascript function
$htmlHeadXtra[] = '<script>
$(document).ready(function(){
' . $jquery_ready_content . '
});
</script>';
// Set default values
$defaults['admin']['platform_admin'] = 0;
$defaults['mail']['send_mail'] = 1;
$defaults['password']['password_auto'] = 1;
$defaults['active'] = 1;
$defaults['expiration_date'] = array();
$days = api_get_setting('account_valid_duration');
$time = strtotime('+' . $days . ' day');
示例4: get_lang
if (api_get_setting('extendedprofile_registration', 'mycomptetences') == 'true' && api_get_setting('extendedprofile_registrationrequired', 'mycomptetences') == 'true') {
$form->addRule('competences', get_lang('ThisFieldIsRequired'), 'required');
}
if (api_get_setting('extendedprofile_registration', 'mydiplomas') == 'true' && api_get_setting('extendedprofile_registrationrequired', 'mydiplomas') == 'true') {
$form->addRule('diplomas', get_lang('ThisFieldIsRequired'), 'required');
}
if (api_get_setting('extendedprofile_registration', 'myteach') == 'true' && api_get_setting('extendedprofile_registrationrequired', 'myteach') == 'true') {
$form->addRule('teach', get_lang('ThisFieldIsRequired'), 'required');
}
if (api_get_setting('extendedprofile_registration', 'mypersonalopenarea') == 'true' && api_get_setting('extendedprofile_registrationrequired', 'mypersonalopenarea') == 'true') {
$form->addRule('openarea', get_lang('ThisFieldIsRequired'), 'required');
}
}
// EXTRA FIELDS
$extra_data = UserManager::get_extra_user_data(api_get_user_id(), true);
UserManager::set_extra_fields_in_form($form, $extra_data, 'registration');
}
if (isset($_SESSION['user_language_choice']) && $_SESSION['user_language_choice'] != '') {
$defaults['language'] = $_SESSION['user_language_choice'];
} else {
$defaults['language'] = api_get_setting('platformLanguage');
}
if (!empty($_GET['username'])) {
$defaults['username'] = Security::remove_XSS($_GET['username']);
}
if (!empty($_GET['email'])) {
$defaults['email'] = Security::remove_XSS($_GET['email']);
}
if (!empty($_GET['phone'])) {
$defaults['phone'] = Security::remove_XSS($_GET['phone']);
}
示例5: array
if (is_platform_authentication() && is_profile_editable() && api_get_setting('profile', 'password') == 'true') {
$form->addElement('password', 'password0', array(get_lang('Pass'), get_lang('Enter2passToChange')), array('size' => 40));
$form->addElement('password', 'password1', get_lang('NewPass'), array('id' => 'password1', 'size' => 40));
if (isset($_configuration['allow_strength_pass_checker']) && $_configuration['allow_strength_pass_checker']) {
$form->addElement('label', null, '<div id="password_progress"></div>');
}
$form->addElement('password', 'password2', get_lang('Confirmation'), array('size' => 40));
// user must enter identical password twice so we can prevent some user errors
$form->addRule(array('password1', 'password2'), get_lang('PassTwo'), 'compare');
if (CHECK_PASS_EASY_TO_FIND) {
$form->addRule('password1', get_lang('CurrentPasswordEmptyOrIncorrect'), 'callback', 'api_check_password');
}
}
// EXTRA FIELDS
$extra_data = UserManager::get_extra_user_data(api_get_user_id(), true);
$return_params = UserManager::set_extra_fields_in_form($form, $extra_data, 'profile', false, api_get_user_id());
$jquery_ready_content = $return_params['jquery_ready_content'];
// the $jquery_ready_content variable collects all functions that will be load in the $(document).ready javascript function
$htmlHeadXtra[] = '<script>
$(document).ready(function(){
' . $jquery_ready_content . '
});
</script>';
if (api_get_setting('profile', 'apikeys') == 'true') {
$form->addElement('html', '<div id="div_api_key">');
$form->addElement('text', 'api_key_generate', get_lang('MyApiKey'), array('size' => 40, 'id' => 'id_api_key_generate'));
$form->addElement('html', '</div>');
$form->addElement('button', 'generate_api_key', get_lang('GenerateApiKey'), array('id' => 'id_generate_api_key', 'onclick' => 'generate_open_id_form(); return false;'));
//generate_open_id_form()
}
// SUBMIT