You are here

function uc_roles_ca_action in Ubercart 6.2

Implements hook_ca_action().

File

uc_roles/uc_roles.ca.inc, line 179
This file contains the Conditional Actions hooks and functions necessary to make the roles-related entity, conditions, events, and actions work.

Code

function uc_roles_ca_action() {

  // Renew a role expiration.
  $actions['uc_roles_order_renew'] = array(
    '#title' => t('Renew the roles on an order.'),
    '#category' => t('renewal'),
    '#callback' => 'uc_roles_action_order_renew',
    '#arguments' => array(
      'order' => array(
        '#entity' => 'uc_order',
        '#title' => t('Order'),
      ),
    ),
  );

  // Send an email to an order with a role expiration
  $actions['uc_roles_order_email'] = array(
    '#title' => t('Send an order email regarding roles.'),
    '#category' => t('Notification'),
    '#callback' => 'uc_roles_action_order_email',
    '#arguments' => array(
      'order' => array(
        '#entity' => 'uc_order',
        '#title' => t('Order'),
      ),
      'expiration' => array(
        '#entity' => 'uc_roles_expiration',
        '#title' => t('Role expiration'),
      ),
    ),
  );

  // Send an email to a user with a role expiration
  $actions['uc_roles_user_email'] = array(
    '#title' => t('Send an order email regarding roles.'),
    '#category' => t('Notification'),
    '#callback' => 'uc_roles_action_user_email',
    '#arguments' => array(
      'account' => array(
        '#entity' => 'user',
        '#title' => t('User'),
      ),
      'expiration' => array(
        '#entity' => 'uc_roles_expiration',
        '#title' => t('Role expiration'),
      ),
    ),
  );
  return $actions;
}