You are here

function i18ntaxonomy_vocabulary_form in Internationalization 6

Generate a form element for selecting terms from a vocabulary. Translates all translatable strings.

1 call to i18ntaxonomy_vocabulary_form()
i18ntaxonomy_node_form in i18ntaxonomy/i18ntaxonomy.module
Handle node form taxonomy.

File

i18ntaxonomy/i18ntaxonomy.module, line 582
i18n taxonomy module

Code

function i18ntaxonomy_vocabulary_form($vid, $value = 0, $help = NULL) {
  $vocabulary = taxonomy_vocabulary_load($vid);
  $help = $help ? $help : i18nstrings("taxonomy:vocabulary:{$vid}:help", $vocabulary->help);
  if (!$vocabulary->multiple) {
    $blank = $vocabulary->required ? t('- Please choose -') : t('- None selected -');
  }
  else {
    $blank = $vocabulary->required ? 0 : t('- None -');
  }
  $tree = i18ntaxonomy_localize_terms(taxonomy_get_tree($vid));
  return _i18ntaxonomy_term_select(i18ntaxonomy_translate_vocabulary_name($vocabulary), $value, $tree, $help, intval($vocabulary->multiple), $blank);
}