You are here

function userpoints_basic_userpoints in User Points 5

Same name and namespace in other branches
  1. 5.3 userpoints_basic.module \userpoints_basic_userpoints()
  2. 5.2 userpoints_basic.module \userpoints_basic_userpoints()

File

./userpoints_basic.module, line 19

Code

function userpoints_basic_userpoints($op, $points = 0, $uid = 0, $event = '') {
  switch ($op) {
    case 'setting':
      $group = 'basic';
      $form[$group] = array(
        '#type' => 'fieldset',
        '#collapsible' => TRUE,
        '#collapsed' => TRUE,
        '#title' => t('!Points for basic events', userpoints_translation()),
      );
      foreach (node_get_types() as $type => $name) {
        $form[$group][USERPOINTS_POST . $type] = array(
          '#type' => 'textfield',
          '#title' => t('!Points for posting a !node-name', array_merge(userpoints_translation(), array(
            '!node-name' => $name->name,
          ))),
          '#default_value' => variable_get(USERPOINTS_POST . $type, '0'),
          '#size' => 5,
          '#maxlength' => 5,
        );
      }
      $form[$group][USERPOINTS_POST_COMMENT] = array(
        '#type' => 'textfield',
        '#title' => t('!Points for posting a comment', userpoints_translation()),
        '#default_value' => variable_get(USERPOINTS_POST_COMMENT, 0),
        '#size' => 5,
        '#maxlength' => 5,
      );
      $form[$group][USERPOINTS_MODERATE_COMMENT] = array(
        '#type' => 'textfield',
        '#title' => t('!Points for moderating a comment', userpoints_translation()),
        '#default_value' => variable_get(USERPOINTS_MODERATE_COMMENT, 0),
        '#size' => 5,
        '#maxlength' => 5,
      );
      return $form;
      break;
  }
}