You are here

function fb_actions_cron_per_user_form in Drupal for Facebook 5.2

Same name and namespace in other branches
  1. 5 fb_actions.module \fb_actions_cron_per_user_form()
  2. 6.2 contrib/fb_actions.module \fb_actions_cron_per_user_form()

File

./fb_actions.module, line 261
Actions defined here interact with Facebook's API. This makes it possible to notify facebook of various activities as they happen.

Code

function fb_actions_cron_per_user_form($values) {
  $form['description'] = array(
    '#value' => t('This action will iterate through user\'s of a Facebook Application, attempt to log into the Facebook API as that user (or failing that, the infinite session user), and execute additional actions.  Use this to perform per-user actions during a Facebook cron job.'),
  );
  $options = fb_get_app_options(FALSE);
  $form['fb_app_nids'] = array(
    '#type' => 'select',
    '#title' => t('Application'),
    '#multiple' => TRUE,
    '#required' => TRUE,
    '#default_value' => $values['fb_app_nids'],
    '#options' => $options,
    '#description' => t('Perform these actions for each user of which applications?'),
  );
  foreach (actions_get_all_actions() as $aid => $action) {
    $options[$action['type']][$aid] = $action['description'];
  }
  $form['actions'] = array(
    '#type' => 'select',
    '#title' => t('Actions'),
    '#default_value' => $values['actions'],
    '#multiple' => TRUE,
    '#required' => TRUE,
    '#options' => $options,
    '#description' => t('Select one or more actions to perform while logged in as a Facebook Application user.'),
  );
  $form['throttle'] = array(
    '#type' => 'textfield',
    '#title' => t('Throttle'),
    '#default_value' => $values['throttle'],
    '#required' => TRUE,
    '#description' => t('Number of users to iterate through each time this action is invoked.  Recommended: start with a small number and increase when you are sure things are working.'),
  );
  return $form;
}