You are here

function fb_actions_cron_per_user_form in Drupal for Facebook 6.2

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

Implementation of fb_actions_cron_per_user action.

This is useful only if you have another action which you wish to trigger, once for each user of an application. Formerly used to update profile boxes during cron jobs. Profile boxes no longer exist, so there may no longer be a need for this.

File

contrib/fb_actions.module, line 38
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) {
  include drupal_get_path('module', 'fb') . '/fb.admin.inc';
  $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, and execute additional actions.  Use this to perform per-user actions during a Facebook cron job.'),
  );
  $options = fb_admin_get_app_options(FALSE);
  $form['fb_app_labels'] = array(
    '#type' => 'select',
    '#title' => t('Application'),
    '#multiple' => TRUE,
    '#required' => TRUE,
    '#default_value' => $values['fb_app_labels'],
    '#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;
}