You are here

function i18n_taxonomy_vocabulary_mode in Internationalization 7

Taxonomy vocabulary settings.

Parameters

$vid: Vocabulary object or vocabulary id.

$mode: Vocabulary mode to compare with.

22 calls to i18n_taxonomy_vocabulary_mode()
i18nTaxonomyTestCase::testTaxonomyTermLocalize in i18n_taxonomy/i18n_taxonomy.test
i18nTaxonomyTestCase::testTaxonomyTermTranslate in i18n_taxonomy/i18n_taxonomy.test
i18n_forum_install in i18n_forum/i18n_forum.install
Implements hook_install().
i18n_forum_mode in i18n_forum/i18n_forum.module
Get forum vocabulary translation mode.
i18n_taxonomy_allowed_values in i18n_taxonomy/i18n_taxonomy.module
Returns the set of valid terms for a taxonomy field.

... See full list

File

i18n_taxonomy/i18n_taxonomy.module, line 1090
i18n taxonomy module

Code

function i18n_taxonomy_vocabulary_mode($vid, $mode = NULL) {
  $modes =& drupal_static(__FUNCTION__);
  if (is_object($vid)) {
    $vid_mode = i18n_object_field($vid, 'i18n_mode', I18N_MODE_NONE);
    return isset($mode) ? $mode & $vid_mode : $vid_mode;
  }
  else {
    if (!isset($modes[$vid])) {
      $modes[$vid] = i18n_object_field(taxonomy_vocabulary_load($vid), 'i18n_mode', I18N_MODE_NONE);
    }
    return isset($mode) ? $mode & $modes[$vid] : $modes[$vid];
  }
}