You are here

function userpoints_action_grant_points_form in User Points 6

Same name and namespace in other branches
  1. 5.3 userpoints_workflow_ng.module \userpoints_action_grant_points_form()

Rules action form configuration - allow number of points to be set.

File

./userpoints_rules.rules.inc, line 64
Provide better integration into the rules module

Code

function userpoints_action_grant_points_form($settings = array(), &$form) {
  $form['settings']['points'] = array(
    '#type' => 'textfield',
    '#title' => t('Number of points'),
    '#default_value' => isset($settings['points']) ? $settings['points'] : '',
    '#description' => t('The number of !points to award. You may enter a negative number as-well', userpoints_translation()),
  );
  $form['settings']['description'] = array(
    '#type' => 'textfield',
    '#title' => t('Description'),
    '#default_value' => isset($settings['description']) ? $settings['description'] : '',
    '#description' => t('Points description'),
  );
  $form['settings']['operation'] = array(
    '#type' => 'textfield',
    '#title' => t('Operation'),
    '#default_value' => isset($settings['operation']) ? $settings['operation'] : '',
  );
  $form['settings']['entity_type'] = array(
    '#type' => 'textfield',
    '#title' => t('Entity Type'),
    '#default_value' => isset($settings['entity_type']) ? $settings['entity_type'] : '',
    '#description' => t("Entity type. ex. 'node' or 'user'"),
  );
  $form['settings']['entity_id'] = array(
    '#type' => 'textfield',
    '#title' => t('Entity Id'),
    '#default_value' => isset($settings['entity_id']) ? $settings['entity_id'] : '',
    '#description' => t('ID of an entity in the Database. ex. $node->id or $user->uid'),
  );
  $form['settings']['tid'] = taxonomy_form(userpoints_get_vid(), isset($settings['tid']) ? $settings['tid'] : '', 'The category ID');
}