You are here

function _notifications_tags_node_options in Notifications 6.2

Same name and namespace in other branches
  1. 6.3 notifications_tags/notifications_tags.module \_notifications_tags_node_options()

Provide tag subscriptions on nodes.

1 call to _notifications_tags_node_options()
notifications_tags_notifications in notifications_tags/notifications_tags.module
Implementation of hook_notifications().

File

notifications_tags/notifications_tags.module, line 124
Subscriptions to taxonomy terms

Code

function _notifications_tags_node_options($account, $node) {
  $options = array();
  $vocabs = notifications_tags_vocabularies();
  if (notifications_content_type_enabled($node->type, 'taxonomy') && !empty($node->taxonomy)) {
    foreach ($node->taxonomy as $tid => $term) {
      if (array_key_exists($term->vid, $vocabs)) {
        $options[] = array(
          'name' => t('Posts tagged with %name', array(
            '%name' => $term->name,
          )),
          'type' => 'taxonomy',
          'fields' => array(
            'tid' => $tid,
          ),
        );
      }
    }
  }
  return $options;
}