You are here

function notifications_tags_vocabulary_list in Notifications 7

Get list of allowed vocabularies

Parameters

$field: Optional field to retrieve as array value. If empty the whole vocalubary object will be returned.

2 calls to notifications_tags_vocabulary_list()
notifications_tags_admin_settings in notifications_tags/notifications_tags.admin.inc
Admin settings form. Omitted taxonomy vocabularies.
notifications_tags_node_get_terms in notifications_tags/notifications_tags.module
Helper function to get latest node terms that belong to our vocabularies for subscriptions

File

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

Code

function notifications_tags_vocabulary_list($field = NULL) {
  $vocabularies =& drupal_static(__FUNCTION__);
  if (!isset($vocabularies)) {
    $vocabularies = array();
    foreach (taxonomy_get_vocabularies() as $vid => $vocabulary) {
      if (notifications_tags_vocabulary_enabled($vid)) {
        $vocabularies[$vid] = $vocabulary;
      }
    }
  }
  if ($field) {
    $list = array();
    foreach ($vocabularies as $vid => $vocab) {
      $list[$vid] = $vocab->{$field};
    }
    return $list;
  }
  else {
    return $vocabularies;
  }
}