trigger_user
modules/trigger/trigger.module, строка 359
- Версии
- 6
trigger_user($op, &$edit, &$account, $category = NULL)
Реализация hook_user()
.
Код
<?php
function trigger_user($op, &$edit, &$account, $category = NULL) {
// Keep objects for reuse so that changes actions make to objects can persist.
static $objects;
// We support a subset of operations.
if (!in_array($op, array('login', 'logout', 'insert', 'update', 'delete', 'view'))) {
return;
}
$aids = _trigger_get_hook_aids('user', $op);
$context = array(
'hook' => 'user',
'op' => $op,
'form_values' => &$edit,
);
foreach ($aids as $aid => $action_info) {
if ($action_info['type'] != 'user') {
if (!isset($objects[$action_info['type']])) {
$objects[$action_info['type']] = _trigger_normalize_user_context($action_info['type'], $account);
}
$context['account'] = $account;
actions_do($aid, $objects[$action_info['type']], $context);
}
else {
actions_do($aid, $account, $context, $category);
}
}
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии