You are here

function notifications_digest_get_templates in Notifications 6.4

Get templates for digesting

1 call to notifications_digest_get_templates()
notifications_digest_messaging in notifications_digest/notifications_digest.module
Implementation of hook_messaging()

File

notifications_digest/notifications_digest.module, line 47
Notifications digest module

Code

function notifications_digest_get_templates($op = 'all') {
  static $templates;
  if (!isset($templates)) {
    $templates = notifications_get_templates('info', 'digest');
  }
  if ($op == 'all') {
    return $templates;
  }
  elseif ($op == 'enabled') {

    // Get a list of templates for enabled event types
    $enabled_events = array_filter(notifications_event_types(NULL, NULL, FALSE));
    $enabled = array_map('notifications_digest_event_template', array_keys($enabled_events));
    return messaging_template_extract_group($enabled, $templates);
  }
}