function hybridauth_additional_info_form in HybridAuth Social Login 6.2
Same name and namespace in other branches
- 7.2 hybridauth.pages.inc \hybridauth_additional_info_form()
1 string reference to 'hybridauth_additional_info_form'
File
- ./
hybridauth.pages.inc, line 326
Code
function hybridauth_additional_info_form(&$form_state, $data) {
$form = array();
$form['#data'] = $data;
$form['fset'] = array(
'#type' => 'fieldset',
'#title' => t('Required information'),
'#description' => t('Please fill in additional information to complete your registration.'),
);
if (variable_get('hybridauth_registration_username_change', 0)) {
$form['fset']['username'] = array(
'#type' => 'textfield',
'#title' => t('Username'),
'#maxlength' => USERNAME_MAX_LENGTH,
'#required' => TRUE,
'#attributes' => array(
'class' => 'username',
),
'#default_value' => _hybridauth_make_username($data),
'#description' => t('Choose your username.') . ' ' . t('Spaces are allowed; punctuation is not allowed except for periods, hyphens, and underscores.'),
);
if (module_exists('username_check')) {
_username_check_load_resources('auto');
$form['fset']['username']['#prefix'] = '<div id="username-check-wrapper">';
$form['fset']['username']['#suffix'] = '</div><div id="username-check-message"></div><div id="username-check-informer" class="username-check-informer"> </div>';
}
}
$hybridauth_fields = hybridauth_fields_list();
$required_fields = array_filter(variable_get('hybridauth_required_fields', array(
'email' => 'email',
)));
foreach ($required_fields as $key => $value) {
if (empty($data[$key]) && !($data[$key] === 0)) {
$form['fset'][$key] = array(
'#type' => 'textfield',
'#title' => $hybridauth_fields[$key],
'#required' => TRUE,
);
if ($key == 'email') {
$form['fset'][$key]['#maxlength'] = EMAIL_MAX_LENGTH;
$form['fset'][$key]['#description'] = t('A valid e-mail address. All e-mails from the system will be sent to this address. The e-mail address is not made public and will only be used if you wish to receive a new password or wish to receive certain news or notifications by e-mail.');
}
if ($key == 'gender') {
$form['fset'][$key]['#type'] = 'radios';
$form['fset'][$key]['#options'] = array(
'male' => t('Male'),
'female' => t('Female'),
);
}
}
}
$form['fset']['submit'] = array(
'#type' => 'submit',
'#value' => t('Submit'),
);
return $form;
}