You are here

function ca_load_trigger in Ubercart 6.2

Load triggers defined in modules via hook_ca_trigger().

Parameters

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

Return value

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

6 calls to ca_load_trigger()
ca_actions_form in ca/ca.admin.inc
Build a form for adding and editing actions on a predicate.
ca_load_trigger_actions in ca/ca.module
Return an array of actions available for the specified trigger.
ca_load_trigger_arguments in ca/ca.module
Return a trigger's arguments formatted for select element options.
ca_load_trigger_conditions in ca/ca.module
Return an array of conditions available for the specified trigger.
ca_pull_trigger in ca/ca.module
Pull a trigger and evaluate any predicates associated with that trigger.

... See full list

File

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

Code

function ca_load_trigger($trigger = 'all') {
  static $triggers;

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

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

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