You are here

function og_vocab_label in OG Vocabulary 7

Label callback.

Return the taxonomy name for privleged users, otherwise the OG vocab ID.

1 string reference to 'og_vocab_label'
og_vocab_entity_info in ./og_vocab.module
Implements hook_entity_info().

File

./og_vocab.module, line 214
Give each group its own system controlled vocabularies.

Code

function og_vocab_label($og_vocab) {
  $relation = og_vocab_relation_get($og_vocab->vid);
  if (og_user_access($relation->group_type, $relation->gid, 'administer taxonomy')) {
    $entity_info = entity_get_info($og_vocab->entity_type);
    $vocab = taxonomy_vocabulary_load($og_vocab->vid);
    $params = array(
      '@id' => $og_vocab->id,
      '@bundle' => $entity_info['bundles'][$og_vocab->bundle]['label'],
      '@name' => $vocab->name,
    );
    return t('@bundle bundle in @name vocabulary (OG Vocabulary ID @id)', $params);
  }
  return t('OG Vocabulary ID @id', array(
    '@id' => $og_vocab->id,
  ));
}