You are here

function user_badges_rules_action_info in User Badges 7.4

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

Implements hook_rules_action_info().

File

./user_badges.rules.inc, line 10
user_badges.rules.inc

Code

function user_badges_rules_action_info() {
  $items = array(
    'add_badge_by_name' => array(
      'label' => t('Add badge by name'),
      'base' => 'user_badges_rules_action_add_badge_by_name',
      'parameter' => array(
        'badge' => array(
          'type' => 'text',
          'label' => t('Badge name'),
          'options list' => 'user_badges_rules_get_badge_names',
          'restriction' => 'input',
        ),
        'user' => array(
          'type' => 'user',
          'label' => t('User on whose behalf to add the badge'),
        ),
      ),
      'group' => t('User'),
      'access_callback' => 'user_badges_rules_integration_access',
    ),
    'remove_badge_by_name' => array(
      'label' => t('Remove badge by name'),
      'base' => 'user_badges_rules_action_remove_badge_by_name',
      'parameter' => array(
        'badge' => array(
          'type' => 'text',
          'label' => t('Badge name'),
          'options list' => 'user_badges_rules_get_badge_names',
          'restriction' => 'input',
        ),
        'user' => array(
          'type' => 'user',
          'label' => t('User on whose behalf to add the badge'),
        ),
      ),
      'group' => t('User'),
      'access_callback' => 'user_badges_rules_integration_access',
    ),
  );
  return $items;
}