function i18n_taxonomy in Internationalization 5
Same name and namespace in other branches
- 5.3 i18n.module \i18n_taxonomy()
- 5.2 i18n.module \i18n_taxonomy()
Implementation of hook_taxonomy
$edit parameter may be an array or an object !!
File
- ./
i18n.module, line 231 - Internationalization (i18n) module
Code
function i18n_taxonomy($op, $type, $edit = NULL) {
$edit = (array) $edit;
switch ("{$type}/{$op}") {
case 'term/insert':
case 'term/update':
$language = isset($edit['language']) ? $edit['language'] : '';
db_query("UPDATE {term_data} SET language='%s' WHERE tid=%d", $language, $edit['tid']);
break;
case 'vocabulary/insert':
case 'vocabulary/update':
$language = isset($edit['language']) ? $edit['language'] : '';
db_query("UPDATE {vocabulary} SET language='%s' WHERE vid=%d", $language, $edit['vid']);
if ($language && $op == 'update') {
db_query("UPDATE {term_data} SET language='%s' WHERE vid=%d", $edit['language'], $edit['vid']);
drupal_set_message(t('Reset language for all terms.'));
}
break;
}
}