You are here

function og_vocab_taxonomy_form_all in OG Vocabulary 6

Helper function; Generate a set of options for selecting a term from all vocabularies that user has access to.

See also

taxonomy_form_all().

1 call to og_vocab_taxonomy_form_all()
og_vocab_form_search_alter in ./og_vocab.module
Helper function; Show only accessible vocabularies in advanced search.

File

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

Code

function og_vocab_taxonomy_form_all($free_tags = FALSE) {
  $vocabularies = og_vocab_get_accessible_vocabs();
  $options = array();
  foreach ($vocabularies as $vid => $vocabulary) {
    if ($vocabulary->tags && !$free_tags) {
      continue;
    }
    $tree = taxonomy_get_tree($vid);
    if ($tree && count($tree) > 0) {
      $options[$vocabulary->name] = array();
      foreach ($tree as $term) {
        $options[$vocabulary->name][$term->tid] = str_repeat('-', $term->depth) . $term->name;
      }
    }
  }
  return $options;
}