function twitter_signin_form_alter in Twitter 6.4
Same name and namespace in other branches
- 6.5 twitter_signin/twitter_signin.module \twitter_signin_form_alter()
- 6.3 twitter_signin/twitter_signin.module \twitter_signin_form_alter()
- 7.6 twitter_signin/twitter_signin.module \twitter_signin_form_alter()
- 7.3 twitter_signin/twitter_signin.module \twitter_signin_form_alter()
- 7.4 twitter_signin/twitter_signin.module \twitter_signin_form_alter()
- 7.5 twitter_signin/twitter_signin.module \twitter_signin_form_alter()
Implementation of hook_form_alter()
File
- twitter_signin/
twitter_signin.module, line 97 - Hook implementations for twitter_signin module.
Code
function twitter_signin_form_alter(&$form, $form_state, $form_id) {
if ($form_id == 'twitter_oauth_callback' && isset($_SESSION['twitter_oauth']['signin'])) {
$form['#submit'] = array_merge(array(
'twitter_signin_oauth_callback_submit',
), $form['#submit']);
}
if ($form_id == 'user_login' || $form_id == 'user_login_block') {
$items = array();
$items[] = twitter_signin_button();
$form['twitter_signin'] = array(
'#value' => theme('item_list', $items),
);
}
elseif ($form_id == 'user_register' && isset($_SESSION['twitter']['values'])) {
$form['name']['#default_value'] = $_SESSION['twitter']['values']['screen_name'];
$form['auth_twitter'] = array(
'#type' => 'hidden',
'#value' => $_SESSION['twitter']['values']['user_id'],
);
}
}