_trigger_user
function _trigger_user
_trigger_user($hook, &$edit, $account, $category = NULL)
Calls action functions for user triggers.
Parameters
$hook: The hook that called this function.
$edit: Edit variable passed in to the hook or empty array if not needed.
$account: Account variable passed in to the hook.
$method: Method variable passed in to the hook or NULL if not needed.
File
- modules/trigger/trigger.module, line 558
- Enables functions to be stored and executed at a later time.
Code
function _trigger_user($hook, &$edit, $account, $category = NULL) { // Keep objects for reuse so that changes actions make to objects can persist. static $objects; $aids = trigger_get_assigned_actions($hook); $context = array( 'group' => 'user', 'hook' => $hook, 'form_values' => &$edit, ); foreach ($aids as $aid => $info) { $type = $info['type']; if ($type != 'user') { if (!isset($objects[$type])) { $objects[$type] = _trigger_normalize_user_context($type, $account); } $context['user'] = $account; actions_do($aid, $objects[$type], $context); } else { actions_do($aid, $account, $context, $category); } } }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!trigger!trigger.module/function/_trigger_user/7.x