You are here

function _library_get_hook_aids in Library 6.2

Same name and namespace in other branches
  1. 5.2 library.actions.inc \_library_get_hook_aids()
  2. 6 library.actions.inc \_library_get_hook_aids()

Since the library hooks are generated dynamically based on the list of library actions, it's necessary to call the list of actions directly. This generates a list of actions for the given trigger that are then called by actions_do()

1 call to _library_get_hook_aids()
library_transaction_form_submit in ./library.pages.inc
Handles transaction form submissions.

File

./library.actions.inc, line 29
Hooks into core Drupal actions module

Code

function _library_get_hook_aids($hook, $op = '') {
  $aids = array();
  $result = db_query("SELECT aa.aid, a.type FROM {trigger_assignments} aa LEFT JOIN {actions} a ON aa.aid = a.aid WHERE aa.hook = '%s' AND aa.op = '%s' ORDER BY weight", $hook, $op);
  while ($action = db_fetch_object($result)) {
    $aids[] = $action->aid;
  }
  return $aids;
}