You are here

function ca_load_action in Ubercart 6.2

Load actions defined in modules via hook_ca_action().

Parameters

$action: Defaults to 'all'; may instead be the name of the action to load.

Return value

An array of data for the specified action or an array of all the action data if 'all' was specified. Returns FALSE if a specified action is non-existent.

3 calls to ca_load_action()
ca_actions_form in ca/ca.admin.inc
Build a form for adding and editing actions on a predicate.
ca_add_action in ca/ca.module
Add a new action to a predicate.
ca_load_trigger_actions in ca/ca.module
Return an array of actions available for the specified trigger.

File

ca/ca.module, line 679
This is a demonstration module for the new conditional actions API.

Code

function ca_load_action($action = 'all') {
  static $actions;

  // Load the actions defined in enabled modules to a cached variable.
  if (empty($actions)) {
    $actions = module_invoke_all('ca_action');
  }

  // Return the whole array if the trigger specified is 'all'.
  if ($action === 'all') {
    return $actions;
  }

  // If the specified trigger is non-existent, return FALSE.
  if (!isset($actions[$action])) {
    return FALSE;
  }
  return $actions[$action];
}