_trigger_user

7 trigger.module _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.

7 calls to _trigger_user()

File

modules/trigger/trigger.module, line 536
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);
    }
  }
}
Login or register to post comments