_trigger_get_hook_actions
- Versions
- 6
_trigger_get_hook_actions($hook, $op, $type = NULL)
Get the actions that have already been defined for this type-hook-op combination.
Parameters
$type One of 'node', 'user', 'comment'.
$hook The name of the hook for which actions have been assigned, e.g. 'nodeapi'.
$op The hook operation for which the actions have been assigned, e.g., 'view'.
Return value
An array of action descriptions keyed by action IDs.
Code
modules/trigger/trigger.admin.inc, line 272
<?php
function _trigger_get_hook_actions($hook, $op, $type = NULL) {
$actions = array();
if ($type) {
$result = db_query("SELECT h.aid, a.description FROM {trigger_assignments} h LEFT JOIN {actions} a on a.aid = h.aid WHERE a.type = '%s' AND h.hook = '%s' AND h.op = '%s' ORDER BY h.weight", $type, $hook, $op);
}
else {
$result = db_query("SELECT h.aid, a.description FROM {trigger_assignments} h LEFT JOIN {actions} a on a.aid = h.aid WHERE h.hook = '%s' AND h.op = '%s' ORDER BY h.weight", $hook, $op);
}
while ($action = db_fetch_object($result)) {
$actions[$action->aid] = $action->description;
}
return $actions;
}
?>Login or register to post comments 