You are here

function notifications_lite_notifications_templates in Notifications 6.4

Implementation of hook_notifications_template()

File

notifications_lite/notifications_lite.module, line 169
Simple notifications API

Code

function notifications_lite_notifications_templates($op = 'info', $type = 'all', $language = NULL) {
  switch ($op) {
    case 'info':
      $info = array();

      // Generic notifications lite event (message)
      if ($type == 'all' || $type == 'notifications-event-lite') {
        $info['notifications-event-lite'] = array(
          'module' => 'notifications_lite',
          'name' => t('Simple notifications'),
          'help' => t('The subject and main body will be provided by the event itself'),
          'description' => t('Simple notifications triggered by other modules using the Notifications Lite API module.'),
          'fallback' => 'notifications-event',
        );
      }
      if ($type == 'digest' || $type == 'notifications-digest-lite') {
        $info['notifications-digest-lite'] = array(
          'module' => 'notifications_lite',
          'name' => t('Group of simple notifications'),
          'description' => t('Simple notifications digested with short format.'),
          'help' => t('Every line of the digest will be a separate message.'),
          'fallback' => 'notifications-digest',
        );
      }
      return $info;
    case 'parts':
      switch ($type) {
        case 'notifications-event-lite':

          // The other parts for these messages will be given by the event itself
          return array(
            'header' => t('Header'),
            'footer' => t('Footer'),
          );
          break;
        case 'notifications-digest-lite':
          $parts['title'] = t('Group title');
          $parts['closing'] = t('Group footer');
          return $parts;
      }
      break;
    case 'defaults':

      // Event notifications
      switch ($type) {
        case 'notifications-event-lite':
          return array(
            'header' => t("Greetings, [user].", array(), $language->language),
            'footer' => array(
              t('This is an automatic message from [site-name]', array(), $language->language),
              t('To manage your subscriptions, browse to [subscriptions-manage]', array(), $language->language),
            ),
          );
        case 'notifications-digest-lite':
          return array(
            'title' => t('Generic messages', array(), $language->language),
            'closing' => '...',
          );
      }
      break;
  }
}