You are here

function notifications_digest_event_template in Notifications 6.4

Get template name for digesting event

Parameters

$event: Event object or event type key

1 string reference to 'notifications_digest_event_template'
notifications_digest_get_templates in notifications_digest/notifications_digest.module
Get templates for digesting

File

notifications_digest/notifications_digest.module, line 132
Notifications digest module

Code

function notifications_digest_event_template($event) {
  $info =& messaging_static(__FUNCTION__);
  if (!isset($info)) {
    $info = variable_get('notifications_digest_template', array());
  }
  $key = is_object($event) ? $event->typekey : $event;
  if (!isset($info[$key])) {
    if ($template = notifications_event_types($key, 'digest_template')) {
      $info[$key] = $template;
    }
    else {
      $parts = array(
        'notifications',
        'digest',
      );

      // Get digesting information from event definition
      if ($digest = notifications_event_types($key, 'digest')) {

        // This will be an array like (node, nid) or (event, type)
        $parts = array_merge($parts, $digest);
      }
      $info[$key] = implode('-', $parts);
    }
  }
  return $info[$key];
}