You are here

function i18n_admin_variables_form_submit in Internationalization 6

Admin variables form submission

File

./i18n.admin.inc, line 125
Extended multilanguage administration and module settings UI.

Code

function i18n_admin_variables_form_submit($form, &$form_state) {
  $op = isset($form_state['values']['op']) ? $form_state['values']['op'] : '';
  switch ($op) {
    case t('Clean up variables'):
      if ($variables = i18n_variable()) {
        db_query("DELETE FROM {i18n_variable} WHERE name NOT IN (" . db_placeholders($variables, 'varchar') . ')', $variables);
        break;
      }

    // Intenational no break, if no variables defined delete all
    case t('Delete all translations'):
      db_query("DELETE FROM {i18n_variable}");
      break;
  }

  // Rebuild cache
  cache_clear_all('variables:', 'cache', TRUE);
}