function userloginbar_form_alter in UserLoginBar 5
Same name and namespace in other branches
- 7 userloginbar.module \userloginbar_form_alter()
File
- ./userloginbar.module, line 77
Code
function userloginbar_form_alter(&$form, $form_state, $form_id) {
global $form_values;
switch ($form_id) {
case 'user_login_block':
$form['#action'] = '?q=user&' . drupal_get_destination();
$form['#method'] = 'post';
$form['form_id'] = array(
'#type' => 'hidden',
'#default_value' => 'user_login',
);
$items = array();
if (variable_get('user_register', 1)) {
$items[] = l(t('Register'), 'user/register', array(
'title' => t('Create a new user account.'),
)) . ' | ';
}
$items[] = l(t('Forgot Password?'), 'user/password', array(
'title' => t('Request new password via e-mail.'),
));
$form['links'] = array(
'#value' => theme('item_list', $items),
);
break;
}
}