function i18ntaxonomy_vocabulary in Internationalization 6
Taxonomy vocabulary settings.
- If $vid and not $value, returns mode for vid.
- If $vid and $value, sets mode for vid.
- If !$vid and !$value returns all settings.
- If !$vid and $value returns all vids for this mode.
Parameters
$vid: Vocabulary id.
$value: Vocabulary mode.
17 calls to i18ntaxonomy_vocabulary()
- i18ntaxonomy_autocomplete in i18ntaxonomy/
i18ntaxonomy.pages.inc - Helper function for autocompletion.
- i18ntaxonomy_form_all_localize in i18ntaxonomy/
i18ntaxonomy.module - Localize a taxonomy_form_all() kind of control
- i18ntaxonomy_form_alter in i18ntaxonomy/
i18ntaxonomy.module - Implementation of hook_form_alter().
- i18ntaxonomy_help in i18ntaxonomy/
i18ntaxonomy.module - Implementation of hook_help().
- i18ntaxonomy_locale_refresh in i18ntaxonomy/
i18ntaxonomy.module - Refresh strings.
2 string references to 'i18ntaxonomy_vocabulary'
- i18ntaxonomy_uninstall in i18ntaxonomy/
i18ntaxonomy.install - Implementation of hook_uninstall().
- i18ntaxonomy_update_1 in i18ntaxonomy/
i18ntaxonomy.install - Drupal 6 update.
File
- i18ntaxonomy/
i18ntaxonomy.module, line 864 - i18n taxonomy module
Code
function i18ntaxonomy_vocabulary($vid = NULL, $mode = NULL) {
$options = variable_get('i18ntaxonomy_vocabulary', array());
if ($vid && !is_null($mode)) {
$options[$vid] = $mode;
variable_set('i18ntaxonomy_vocabulary', $options);
}
elseif ($vid) {
return array_key_exists($vid, $options) ? $options[$vid] : I18N_TAXONOMY_NONE;
}
elseif (!is_null($mode)) {
return array_keys($options, $mode);
}
else {
return $options;
}
}