function taxonomy_form_all

6.x taxonomy.module taxonomy_form_all($free_tags = 0)

Generate a set of options for selecting a term from all vocabularies.

File

drupal-6.x/modules/taxonomy/taxonomy.module, line 451
Enables the organization of content into categories.

Code

function taxonomy_form_all($free_tags = 0) {
  $vocabularies = taxonomy_get_vocabularies();
  $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;
}