_trigger_get_hook_actions
modules/trigger/trigger.admin.inc, строка 272
- Версии
- 6
_trigger_get_hook_actions($hook, $op, $type = NULL)
Get the actions that have already been defined for this type-hook-op combination.
Параметры
$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'
.
Возвращаемое значение
An array of action descriptions keyed by action IDs.
Код
<?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;
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии