You are here

function notifications_tags_notifications_object_taxonomy_vocabulary in Notifications 7

Implements hook_notifications_object_taxonomy_vocabulary()

File

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

Code

function notifications_tags_notifications_object_taxonomy_vocabulary($op, $vocabulary, $account = NULL) {
  switch ($op) {
    case 'subscription types':
      return array(
        'taxonomy_vocabulary',
      );
    case 'subscriptions':
      $options = array();
      if (!$account || user_access('subscribe to taxonomy vocabulary')) {
        $options[] = notifications_subscription('taxonomy_vocabulary')
          ->add_field('vocabulary:vid', $vocabulary->vid);
      }
      return $options;
  }
}