You are here

function uc_recurring_subscription_rules_action_info in UC Recurring Payments and Subscriptions 7.2

Implements hook_rules_action_info().

File

modules/uc_recurring_subscription/uc_recurring_subscription.rules.inc, line 38
Rules definitions.

Code

function uc_recurring_subscription_rules_action_info() {
  $actions = array();
  $actions['uc_recurring_subscription_grant_role'] = array(
    'label' => t('Grant a role on an order.'),
    'group' => t('Role'),
    'parameter' => array(
      'order' => array(
        'type' => 'uc_order',
        'label' => t('Order'),
      ),
      'role_option' => array(
        'type' => 'text',
        'label' => t('Where are the role(s) defined?'),
        'options list' => '_uc_recurring_subscription_role_options',
      ),
      'roles' => array(
        'type' => 'list<integer>',
        'label' => t('Role'),
        'options list' => '_uc_recurring_subscription_user_roles',
        'optional' => TRUE,
      ),
    ),
  );
  $actions['uc_recurring_subscription_revoke_role'] = array(
    'label' => t('Revoke a role on an order.'),
    'group' => t('Role'),
    'parameter' => array(
      'order' => array(
        'type' => 'uc_order',
        'label' => t('Order'),
      ),
      'role_option' => array(
        'type' => 'text',
        'label' => t('Where are the role(s) defined?'),
        'options list' => '_uc_recurring_subscription_role_options',
      ),
      'role_option' => array(
        'type' => 'text',
        'label' => t('Where are the role(s) defined?'),
        'options list' => '_uc_recurring_subscription_role_options',
      ),
      'roles' => array(
        'type' => 'list<integer>',
        'label' => t('Role'),
        'options list' => '_uc_recurring_subscription_user_roles',
        'optional' => TRUE,
      ),
    ),
  );
  if (module_exists('og')) {

    // actions to subscribe/unsubscribe user from organic group.
    $actions['uc_recurring_subscription_grant_og'] = array(
      'label' => t('Grant organic group membership on order.'),
      'group' => t('Organic Group'),
      'parameter' => array(
        'order' => array(
          'type' => 'uc_order',
          'label' => t('Order'),
        ),
        'group_option' => array(
          'type' => 'text',
          'label' => t('Where are the role(s) defined?'),
          'options list' => '_uc_recurring_subscription_role_options',
        ),
        'group' => array(
          'type' => 'group',
          'label' => t('Group'),
        ),
      ),
    );
    $actions['uc_recurring_subscription_revoke_og'] = array(
      'label' => t('Revoke organic group membership on order.'),
      'group' => t('Organic Group'),
      'parameter' => array(
        'order' => array(
          'type' => 'uc_order',
          'label' => t('Order'),
        ),
        'group_option' => array(
          'type' => 'text',
          'label' => t('Where are the role(s) defined?'),
          'options list' => '_uc_recurring_subscription_role_options',
        ),
        'group' => array(
          'type' => 'group',
          'label' => t('Group'),
        ),
      ),
    );
  }
  return $actions;
}