You are here

function translation_table_submit_translations in Translation table 6

Same name and namespace in other branches
  1. 7 includes/admin.inc \translation_table_submit_translations()

Submit handler for the translation table.

5 string references to 'translation_table_submit_translations'
content_translation_table_cck_form in modules/content.translation_table.inc
Menu callback; Admin form for CCK translation.
menu_translation_table_menu_form in modules/menu.translation_table.inc
Menu callback; Admin form for menu translation.
node_translation_table_nodetype_form in modules/node.translation_table.inc
Menu callback; Admin form for node type translation.
quicktabs_translation_table_quicktabs_form in modules/quicktabs.translation_table.inc
Menu callback; Admin form for quicktabs translation.
taxonomy_translation_table_taxonomy_form in modules/taxonomy.translation_table.inc
Menu callback; Admin form for taxonomy translation.

File

includes/admin.inc, line 63
The administration interface.

Code

function translation_table_submit_translations($form, &$form_state) {
  switch ($form_state['clicked_button']['#id']) {
    case 'edit-submit':
      $language_list = locale_language_list('language', TRUE);
      if (!empty($form_state['values']['strings'])) {
        foreach ($form_state['values']['strings'] as $lid => $values) {
          foreach ($values as $lang_code => $translation) {
            if (in_array($lang_code, $language_list)) {
              _translation_table_update_translation($lid, $lang_code, $translation);
            }
          }
        }
      }
      break;
  }

  // Redirect to current page.
  $query = isset($_GET['page']) ? array(
    'page' => $_GET['page'],
  ) : array();
  $form_state['redirect'] = array(
    $_GET['q'],
    $query,
  );
}