You are here

function fb_test_create_form in Drupal for Facebook 7.3

Same name and namespace in other branches
  1. 6.3 contrib/fb_test.module \fb_test_create_form()
1 string reference to 'fb_test_create_form'
fb_test_detail_page in contrib/fb_test.module

File

contrib/fb_test.module, line 32
http://developers.facebook.com/docs/test_users

Code

function fb_test_create_form($form, &$form_state, $fb_app) {
  $form['#fb_app'] = $fb_app;

  // @TODO make this a dropdown, limit to 50 total test accounts.
  $form['how_many'] = array(
    '#type' => 'textfield',
    '#title' => t('Number of test accounts to create'),
  );
  $form['installed'] = array(
    '#type' => 'checkbox',
    '#title' => t('Installed'),
    '#description' => t('If selected, new users have already authorized the application'),
  );

  // Which permissions?
  $perms = array();
  drupal_alter('fb_required_perms', $perms);

  // @TODO pass fb_app to this function.
  $default_perms = count($perms) ? implode(',', $perms) : '';
  $form['perms'] = array(
    '#type' => 'textfield',
    '#title' => t('Extended Permission'),
    '#description' => t('If app is authorized, users have granted these permissions.'),
    '#default_value' => $default_perms,
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Create Test Accounts'),
  );
  return $form;
}