function notifications_tags_vocabularies in Notifications 6.4
Same name and namespace in other branches
- 5 notifications_tags/notifications_tags.module \notifications_tags_vocabularies()
- 6 notifications_tags/notifications_tags.module \notifications_tags_vocabularies()
- 6.2 notifications_tags/notifications_tags.module \notifications_tags_vocabularies()
- 6.3 notifications_tags/notifications_tags.module \notifications_tags_vocabularies()
Get list of allowed vocabularies
Parameters
$field: Optional field to retrieve as array value. If empty the whole vocalubary object will be returned.
7 calls to notifications_tags_vocabularies()
- notifications_tags_autocomplete in notifications_tags/
notifications_tags.module - Helper function for term name autocompletion
- notifications_tags_form_alter in notifications_tags/
notifications_tags.module - Implementation of hook_form_alter().
- 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
- notifications_tags_notifications_object_node in notifications_tags/
notifications_tags.module - Implementation of hook_notifications_object_node()
- notifications_tags_notifications_object_term in notifications_tags/
notifications_tags.module - Implementation of hook_notifications_object_term()
1 string reference to 'notifications_tags_vocabularies'
- notifications_update_5 in ./
notifications.install - Update content type and taxonomy options
File
- notifications_tags/
notifications_tags.module, line 264 - Subscriptions to taxonomy terms
Code
function notifications_tags_vocabularies($field = NULL) {
$vocabularies =& messaging_static(__FUNCTION__);
if (!isset($vocabularies)) {
$vocabularies = array();
if ($allowed = variable_get('notifications_tags_vocabularies', array())) {
$allvocab = taxonomy_get_vocabularies();
foreach (array_filter($allowed) as $vid) {
$vocabularies[$vid] = $allvocab[$vid];
}
}
}
if ($field) {
$list = array();
foreach ($vocabularies as $vid => $vocab) {
$list[$vid] = $vocab->{$field};
}
return $list;
}
else {
return $vocabularies;
}
}