You are here

function referral_userpoints_userpoints in User Referral 6

Implementation of hook_userpoints

File

referral_userpoints/referral_userpoints.module, line 28

Code

function referral_userpoints_userpoints($op, $params = array()) {
  if ($op == 'setting') {
    $group = 'referral';
    $form[$group] = array(
      '#type' => 'fieldset',
      '#collapsible' => TRUE,
      '#collapsed' => TRUE,
      '#title' => t('!Points for referral', userpoints_translation()),
    );
    $form[$group][REFERRAL_USERPOINTS] = array(
      '#type' => 'textfield',
      '#title' => t('!Points for referring a user', userpoints_translation()),
      '#default_value' => variable_get(REFERRAL_USERPOINTS, 0),
      '#size' => 5,
      '#maxlength' => 5,
    );
    $form[$group][REFERRAL_USERPOINTS_TID] = array(
      '#type' => 'select',
      '#title' => t('Category'),
      '#default_value' => variable_get(REFERRAL_USERPOINTS_TID, 0),
      '#options' => userpoints_get_categories(),
      '#description' => t('Referral points will be assigned to this category. You can modify what categories are available by modifying the <a href="!url">userpoints taxonomy</a>.', array(
        '!url' => url('admin/content/taxonomy/' . variable_get(USERPOINTS_CATEGORY_DEFAULT_VID, '')),
      )),
    );
    $options = array(
      0 => t('No'),
      1 => t('Yes'),
    );
    $form[$group][REFERRAL_USERPOINTS_MODERATION] = array(
      '#type' => 'radios',
      '#title' => t('Moderation'),
      '#default_value' => variable_get(REFERRAL_USERPOINTS_MODERATION, 0),
      '#options' => $options,
      '#description' => t('Referral points can be moderated if moderation is set to "Yes".'),
    );
    return $form;
  }
}