/[drupal]/contributions/modules/userpoints/userpoints_rules.rules.inc
ViewVC logotype

Diff of /contributions/modules/userpoints/userpoints_rules.rules.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1.2.1 by kbahey, Sun Sep 13 02:47:01 2009 UTC revision 1.1.2.2 by kbahey, Sat Nov 21 00:37:19 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: userpoints_rules.rules.inc,v 1.1 2009/08/11 15:40:49 kbahey Exp $  // $Id: userpoints_rules.rules.inc,v 1.1.2.1 2009/09/13 02:47:01 kbahey Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 42  function userpoints_rules_event_info() { Line 42  function userpoints_rules_event_info() {
42   * Rules action - grant points to a user.   * Rules action - grant points to a user.
43   */   */
44  function userpoints_action_grant_points($account, $settings) {  function userpoints_action_grant_points($account, $settings) {
45    userpoints_userpointsapi(array('uid' => $account->uid, 'points' => $settings['points']));    userpoints_userpointsapi(array('uid' => $account->uid, 'points' => $settings['points'], 'description' => $settings['description'], 'operation' => $settings['operation']));
46  }  }
47    
48  /**  /**
# Line 55  function userpoints_action_grant_points_ Line 55  function userpoints_action_grant_points_
55      '#default_value' => isset($settings['points']) ? $settings['points'] : '',      '#default_value' => isset($settings['points']) ? $settings['points'] : '',
56      '#description' => t('The number of !points to award. You may enter a negative number as-well', userpoints_translation())      '#description' => t('The number of !points to award. You may enter a negative number as-well', userpoints_translation())
57    );    );
58    $form['settings']['description'] = array(
59        '#type' => 'textfield',
60        '#title' => t('Description'),
61        '#default_value' => isset($settings['description']) ? $settings['description'] : '',
62        '#description' => t('Points description')
63      );
64    $form['settings']['operation'] = array(
65        '#type' => 'textfield',
66        '#title' => t('Operation'),
67        '#default_value' => isset($settings['operation']) ? $settings['operation'] : ''
68      );
69  }  }
70    
71    
# Line 88  function userpoints_rules_amount_form($s Line 99  function userpoints_rules_amount_form($s
99      '#default_value' => isset($settings['amount']) ? $settings['amount'] : '',      '#default_value' => isset($settings['amount']) ? $settings['amount'] : '',
100      '#description' => t('The amount to compare if userpoints are >=. Example:30, will trigger the condition if the user userpoints are >= than 30 points.')      '#description' => t('The amount to compare if userpoints are >=. Example:30, will trigger the condition if the user userpoints are >= than 30 points.')
101    );    );
102    
103    $form['settings']['type'] = array(    $form['settings']['type'] = array(
104      '#type' => 'select',      '#type' => 'select',
105      '#title' => t('Userpoints Categories to analyze'),      '#title' => t('Userpoints Categories to analyze'),

Legend:
Removed from v.1.1.2.1  
changed lines
  Added in v.1.1.2.2

  ViewVC Help
Powered by ViewVC 1.1.3