Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed edition of taxonomy translations

  • Loading branch information...
commit 0eaf308f28da2c0c87d47c2775ae2a5133df4cb6 1 parent 59296bf
Jose Reyero authored
5 i18n_taxonomy/i18n_taxonomy.admin.inc
@@ -130,11 +130,12 @@ function i18n_taxonomy_translation_term_form_submit($form, &$form_state) {
130 130
131 131 case t('Delete'):
132 132 // Delete old translations for this trid.
133   - db_update('term_data')
  133 + db_update('taxonomy_term_data')
134 134 ->fields(array('trid' => 0))
135 135 ->condition('trid', $form_state['values']['trid'])
136 136 ->execute();
137 137 drupal_set_message(t('The term translation has been deleted.'));
  138 + $form_state['redirect'] = 'admin/structure/taxonomy/' . $form_state['values']['vocabulary']->machine_name . '/translation';
138 139 break;
139 140 }
140 141 }
@@ -228,7 +229,7 @@ function i18n_taxonomy_translation_overview($vocabulary) {
228 229 $thisrow[] = '--';
229 230 }
230 231 }
231   - $thisrow[] = l(t('edit'), "admin/content/taxonomy/$vocabulary->machine_name/translation/edit/$trid");
  232 + $thisrow[] = l(t('edit'), "admin/structure/taxonomy/$vocabulary->machine_name/translation/edit/$trid");
232 233 $rows[] = $thisrow;
233 234 }
234 235 if ($rows) {
26 i18n_taxonomy/i18n_taxonomy.module
@@ -90,6 +90,16 @@ function i18n_taxonomy_menu() {
90 90 //'parent' => 'admin/content/taxonomy/%taxonomy_vocabulary',
91 91 'file' => 'i18n_taxonomy.admin.inc',
92 92 );
  93 + $items['admin/structure/taxonomy/%taxonomy_vocabulary_machine_name/translation/edit/%i18n_taxonomy_translation'] = array(
  94 + 'title' => 'Edit translation',
  95 + 'page callback' => 'drupal_get_form',
  96 + 'page arguments' => array('i18n_taxonomy_translation_term_form', 3, 6),
  97 + 'access callback' => '_i18n_taxonomy_translation_tab',
  98 + 'access arguments' => array(3),
  99 + 'type' => MENU_CALLBACK,
  100 + //'parent' => 'admin/content/taxonomy/%taxonomy_vocabulary',
  101 + 'file' => 'i18n_taxonomy.admin.inc',
  102 + );
93 103 $items['i18n/taxonomy/autocomplete/%taxonomy_vocabulary_machine_name'] = array(
94 104 'title' => 'Autocomplete taxonomy',
95 105 'page callback' => 'i18n_taxonomy_autocomplete',
@@ -678,7 +688,7 @@ function i18n_taxonomy_translation_load($trid) {
678 688 ->fields('t')
679 689 ->condition('trid', $trid)
680 690 ->execute()
681   - ->fetchAll(PDO::FETCH_OBJ, 'language');
  691 + ->fetchAllAssoc('language');
682 692 if ($translations) {
683 693 return array(
684 694 'trid' => $trid,
@@ -688,20 +698,6 @@ function i18n_taxonomy_translation_load($trid) {
688 698 }
689 699
690 700 /**
691   - * Like nat_get_terms() but without caching.
692   - */
693   -function i18n_taxonomy_nat_get_terms($nid) {
694   - $return = array();
695   -
696   - $result = db_query("SELECT td.* FROM {nat} n INNER JOIN {term_data} td USING (tid) WHERE n.nid = %d", $nid);
697   - while ($term = db_fetch_object($result)) {
698   - $return[$term->tid] = $term;
699   - }
700   -
701   - return $return;
702   -}
703   -
704   -/**
705 701 * Implements hook_nodeapi().
706 702 *
707 703 * Prepare node for translation.

0 comments on commit 0eaf308

Please sign in to comment.
Something went wrong with that request. Please try again.