You are here

function _fb_registration_form_alter_fields in Drupal for Facebook 7.3

Same name and namespace in other branches
  1. 6.3 contrib/fb_registration.module \_fb_registration_form_alter_fields()

@file

http://developers.facebook.com/docs/user_registration

1 call to _fb_registration_form_alter_fields()
fb_registration_form_alter in contrib/fb_registration.module
Implements hook_form_alter().

File

contrib/fb_registration.module, line 10
http://developers.facebook.com/docs/user_registration

Code

function _fb_registration_form_alter_fields(&$form) {

  // name, email and password require special treatment.
  if (isset($form['name'])) {
    $form['name']['#fb_registration_field'] = 'name';
  }
  if (isset($form['mail'])) {
    $form['mail']['#fb_registration_field'] = 'email';
  }

  /* user_login form needs this
       $form['pass']['#fb_registration_field'] = array(
       'name' => 'password',
       'view' => 'not_prefilled',
       );
    */
  if (isset($form['captcha'])) {
    $form['captcha']['#fb_registration_field'] = 'captcha';
  }

  // Because profile module may or may not nest fields in fieldsets, we must recurse.
  foreach (element_children($form) as $key) {
    _fb_registration_form_alter_fields($form[$key]);
  }
}