Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed edition of taxonomy translations

  • Loading branch information...
commit 0eaf308f28da2c0c87d47c2775ae2a5133df4cb6 1 parent 59296bf
Jose Reyero authored
View
5 i18n_taxonomy/i18n_taxonomy.admin.inc
@@ -130,11 +130,12 @@ function i18n_taxonomy_translation_term_form_submit($form, &$form_state) {
case t('Delete'):
// Delete old translations for this trid.
- db_update('term_data')
+ db_update('taxonomy_term_data')
->fields(array('trid' => 0))
->condition('trid', $form_state['values']['trid'])
->execute();
drupal_set_message(t('The term translation has been deleted.'));
+ $form_state['redirect'] = 'admin/structure/taxonomy/' . $form_state['values']['vocabulary']->machine_name . '/translation';
break;
}
}
@@ -228,7 +229,7 @@ function i18n_taxonomy_translation_overview($vocabulary) {
$thisrow[] = '--';
}
}
- $thisrow[] = l(t('edit'), "admin/content/taxonomy/$vocabulary->machine_name/translation/edit/$trid");
+ $thisrow[] = l(t('edit'), "admin/structure/taxonomy/$vocabulary->machine_name/translation/edit/$trid");
$rows[] = $thisrow;
}
if ($rows) {
View
26 i18n_taxonomy/i18n_taxonomy.module
@@ -90,6 +90,16 @@ function i18n_taxonomy_menu() {
//'parent' => 'admin/content/taxonomy/%taxonomy_vocabulary',
'file' => 'i18n_taxonomy.admin.inc',
);
+ $items['admin/structure/taxonomy/%taxonomy_vocabulary_machine_name/translation/edit/%i18n_taxonomy_translation'] = array(
+ 'title' => 'Edit translation',
+ 'page callback' => 'drupal_get_form',
+ 'page arguments' => array('i18n_taxonomy_translation_term_form', 3, 6),
+ 'access callback' => '_i18n_taxonomy_translation_tab',
+ 'access arguments' => array(3),
+ 'type' => MENU_CALLBACK,
+ //'parent' => 'admin/content/taxonomy/%taxonomy_vocabulary',
+ 'file' => 'i18n_taxonomy.admin.inc',
+ );
$items['i18n/taxonomy/autocomplete/%taxonomy_vocabulary_machine_name'] = array(
'title' => 'Autocomplete taxonomy',
'page callback' => 'i18n_taxonomy_autocomplete',
@@ -678,7 +688,7 @@ function i18n_taxonomy_translation_load($trid) {
->fields('t')
->condition('trid', $trid)
->execute()
- ->fetchAll(PDO::FETCH_OBJ, 'language');
+ ->fetchAllAssoc('language');
if ($translations) {
return array(
'trid' => $trid,
@@ -688,20 +698,6 @@ function i18n_taxonomy_translation_load($trid) {
}
/**
- * Like nat_get_terms() but without caching.
- */
-function i18n_taxonomy_nat_get_terms($nid) {
- $return = array();
-
- $result = db_query("SELECT td.* FROM {nat} n INNER JOIN {term_data} td USING (tid) WHERE n.nid = %d", $nid);
- while ($term = db_fetch_object($result)) {
- $return[$term->tid] = $term;
- }
-
- return $return;
-}
-
-/**
* Implements hook_nodeapi().
*
* Prepare node for translation.
Please sign in to comment.
Something went wrong with that request. Please try again.