You are here

function i18ntaxonomy_form in Internationalization 5.2

Same name and namespace in other branches
  1. 5.3 contrib/i18ntaxonomy.module \i18ntaxonomy_form()
  2. 5 contrib/i18ntaxonomy.module \i18ntaxonomy_form()

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

1 call to i18ntaxonomy_form()
i18ntaxonomy_form_alter in contrib/i18ntaxonomy.module
Implementation of hook_form_alter().

File

contrib/i18ntaxonomy.module, line 179
Internationalization (i18n) package - taxonomy term translation

Code

function i18ntaxonomy_form($vid, $value = 0, $help = NULL, $name = 'taxonomy') {
  $vocabulary = taxonomy_get_vocabulary($vid);
  $help = $vocabulary->help ? t($vocabulary->help) : '';
  if ($vocabulary->required) {
    $blank = 0;
  }
  else {
    $blank = '<' . t('none') . '>';
  }
  return _i18ntaxonomy_term_select(t(check_plain($vocabulary->name)), $name, $value, $vid, $help, intval($vocabulary->multiple), $blank);
}