You are here

function user_badges_rules_condition_info in User Badges 7.3

Same name and namespace in other branches
  1. 6.2 user_badges.rules.inc \user_badges_rules_condition_info()
  2. 6 user_badges.rules.inc \user_badges_rules_condition_info()
  3. 7.4 user_badges.rules.inc \user_badges_rules_condition_info()

Implementation of hook_rules_condition_info().

File

./user_badges.rules.inc, line 85

Code

function user_badges_rules_condition_info() {
  $items = array(
    'user_badges_has_badge' => array(
      'label' => t('User has badge'),
      'base' => 'user_badges_rules_condition_has_badge',
      'parameter' => array(
        'badge_id' => array(
          'type' => 'text',
          'label' => t('Badge'),
          'options list' => 'user_badges_rules_get_badge_names',
          'restriction' => 'input',
        ),
        'user' => array(
          'type' => 'user',
          'label' => t('User'),
        ),
      ),
      'group' => t('User'),
    ),
    'user_badges_badge_count' => array(
      'label' => t('User badge count'),
      'base' => 'user_badges_rules_condition_badge_count',
      'parameter' => array(
        'user' => array(
          'type' => 'user',
          'label' => t('User'),
        ),
        'operator' => array(
          'type' => 'text',
          'label' => t('User\'s number of badges is: '),
          'default value' => '=',
          'options list' => 'user_badges_rules_condition_operator_options',
          'restriction' => 'input',
        ),
        'number' => array(
          'type' => 'number',
          'label' => t('Number'),
        ),
      ),
      'group' => t('User'),
    ),
  );
  return $items;
}