You are here

function role_expire_rules_action_info in Role Expire 7

Same name and namespace in other branches
  1. 6 role_expire.rules.inc \role_expire_rules_action_info()

Implementation of hook_rules_action_info().

File

./role_expire.rules.inc, line 34
Rules integration for the role expire module.

Code

function role_expire_rules_action_info() {
  $items['role_expire_rules_action_set_role_expire'] = array(
    'label' => t('Set expire time for role'),
    'group' => t('Role Expire'),
    'help' => t('Add an expiration time to a role a user has. This action does not add the role, only the expiration time.'),
    'parameter' => array(
      'user' => array(
        'type' => 'user',
        'label' => t('User'),
        'description' => t('The user which the expiration time will be added'),
      ),
      'role' => array(
        'type' => 'integer',
        'label' => t('Role'),
        'options list' => 'rules_user_roles_options_list',
      ),
      'timestamp' => array(
        'type' => 'date',
        'label' => t('Expiration'),
        'description' => t('The expiration time to be added'),
      ),
    ),
  );
  $items['role_expire_rules_action_set_role_expire_to_longest'] = array(
    'label' => t('Set expire time to longest for this user'),
    'group' => t('Role Expire'),
    'help' => t('Set an expiration time to the longest attached to a role this user has. This action does not add the role, but only sets the expiration time.'),
    'parameter' => array(
      'user' => array(
        'type' => 'user',
        'label' => t('User'),
        'description' => t('The user for which the expiration time will be set'),
      ),
      'role' => array(
        'type' => 'integer',
        'label' => t('Role'),
        'options list' => 'rules_user_roles_options_list',
      ),
    ),
  );
  $items['role_expire_rules_action_extend_role_expire'] = array(
    'label' => t('Extend expire time for role'),
    'group' => t('Role Expire'),
    'help' => t('Extend the expiration time for a role a user has. This action does not add the role, it only extends the expiration time. If no time was set, the current time when the action fires is used as a base.'),
    'parameter' => array(
      'user' => array(
        'type' => 'user',
        'label' => t('User'),
        'description' => t('The user which the expiration time will be added'),
      ),
      'role' => array(
        'type' => 'integer',
        'label' => t('Role'),
        'options list' => 'rules_user_roles_options_list',
      ),
      'timestamp' => array(
        'type' => 'date',
        'label' => t('Expiration'),
        'description' => t('The relative amount of time to be added.'),
      ),
    ),
  );
  $items['role_expire_rules_action_remove_role_expire'] = array(
    'label' => t('Remove expire time from role'),
    'group' => t('Role Expire'),
    'help' => t('Remove an expiration time to a role a user has. This action does not remove the role, only the expiration time.'),
    'parameter' => array(
      'user' => array(
        'type' => 'user',
        'label' => t('User'),
        'description' => t('The user from which the expiration time will be removed'),
      ),
      'role' => array(
        'type' => 'integer',
        'label' => t('Role'),
        'options list' => 'rules_user_roles_options_list',
      ),
    ),
  );
  return $items;
}