locale_admin_string

Versions
4.6
locale_admin_string()

Page handler for the string search and administration screen

Code

modules/locale.module, line 426

<?php
function locale_admin_string() {
  include_once 'includes/locale.inc';
  $op = ($_POST['op'] ? $_POST['op'] : arg(3));
  $edit =& $_POST['edit'];

  switch ($op) {
    case t('Delete'):
    case 'delete':
      if($edit['confirm']) {
        $output .= _locale_string_delete(db_escape_string(arg(4)));
        $output .= _locale_string_seek();
        drupal_goto('admin/locale/string/search');
      }
      else {
        $string = db_result(db_query("SELECT source FROM {locales_source} WHERE lid = %d", arg(4)));
        $output = theme('confirm',
                  t('Are you sure you want to delete the following string?'),
                  'admin/locale/string/search',
                  t('This action cannot be undone.'),
                  t('Delete'),
                  t('Cancel'),
                  check_plain($string));
      }
      break;
    case 'edit':
      $output .= _locale_string_edit(db_escape_string(arg(4)));
      $output .= _locale_string_seek();
      break;
    case t('Search'):
    case 'search':
      $output = _locale_string_seek();
      $output .= _locale_string_seek_form();
      break;
    case t('Save translations'):
      $output .= _locale_string_save(db_escape_string(arg(4)));
      drupal_goto('admin/locale/string/search');
      break;
    default:
  }
  print theme('page', $output);
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.