Gets the action IDs of actions to be executed for a hook.
$hook: The name of the hook being fired.
An array whose keys are action IDs that the user has associated with this trigger, and whose values are arrays containing the action type and label.
function trigger_get_assigned_actions($hook) {
$actions =& drupal_static(__FUNCTION__, array());
if (!isset($actions[$hook])) {
$actions[$hook] = db_query("SELECT ta.aid, a.type, a.label FROM {trigger_assignments} ta LEFT JOIN {actions} a ON ta.aid = a.aid WHERE ta.hook = :hook ORDER BY ta.weight", array(
':hook' => $hook,
))
->fetchAllAssoc('aid', PDO::FETCH_ASSOC);
}
return $actions[$hook];
}