You are here

function translation_vocabulary_get_terms in Internationalization 5.2

Same name and namespace in other branches
  1. 5.3 translation/translation.module \translation_vocabulary_get_terms()
  2. 5 translation/translation.module \translation_vocabulary_get_terms()

Returns a list for terms for vocabulary, language

1 call to translation_vocabulary_get_terms()
translation_taxonomy_term_form in translation/translation.module
Produces a vocabulary translation form

File

translation/translation.module, line 866

Code

function translation_vocabulary_get_terms($vid, $lang, $status = 'all') {
  switch ($status) {
    case 'translated':
      $andsql = ' AND trid > 0';
      break;
    case 'untranslated':
      $andsql = ' AND trid = 0';
      break;
    default:
      $andsql = '';
  }
  $result = db_query("SELECT * FROM {term_data} WHERE vid=%d AND language='%s' {$andsql}", $vid, $lang);
  $list = array();
  while ($term = db_fetch_object($result)) {
    $list[$term->tid] = $term->name;
  }
  return $list;
}