You are here

function notifications_nodetype_notifications_event in Notifications 6.4

Implementation of hook notifications_event()

Update event key for node events so we can handle the templates for it later.

File

notifications_nodetype/notifications_nodetype.module, line 88
Notifications content type extension

Code

function notifications_nodetype_notifications_event($op, $event = NULL) {
  if ($op == 'build' && $event->type == 'node' && in_array($event->action, array(
    'insert',
    'update',
    'comment',
  ))) {
    $node = $event
      ->get_object('node');

    // Fix event key and check again whether this is enabled
    $event->typekey = 'node-' . $node->type . '-' . $event->action;
    if (!notifications_event_enabled($event->typekey)) {
      $event->save = $event->queue = FALSE;
    }
  }
}