comparison includes/locale.inc @ 7:fff6d4c8c043 6.3

Drupal 6.3
author Franck Deroche <webmaster@defr.org>
date Tue, 23 Dec 2008 14:30:28 +0100
parents c1f4ac30525a
children 589fb7c02327
comparison
equal deleted inserted replaced
6:2cfdc3c92142 7:fff6d4c8c043
1 <?php 1 <?php
2 // $Id: locale.inc,v 1.174 2008/01/09 21:36:13 goba Exp $ 2 // $Id: locale.inc,v 1.174.2.1 2008/07/09 21:48:28 goba Exp $
3 3
4 /** 4 /**
5 * @file 5 * @file
6 * Administration functions for locale.module. 6 * Administration functions for locale.module.
7 */ 7 */
866 * @defgroup locale-translate-delete Translation delete interface. 866 * @defgroup locale-translate-delete Translation delete interface.
867 * @{ 867 * @{
868 */ 868 */
869 869
870 /** 870 /**
871 * Delete a language string. 871 * String deletion confirmation page.
872 */ 872 */
873 function locale_translate_delete($lid) { 873 function locale_translate_delete_page($lid) {
874 db_query('DELETE FROM {locales_source} WHERE lid = %d', $lid); 874 if ($source = db_fetch_object(db_query('SELECT * FROM {locales_source} WHERE lid = %d', $lid))) {
875 db_query('DELETE FROM {locales_target} WHERE lid = %d', $lid); 875 return drupal_get_form('locale_translate_delete_form', $source);
876 }
877 else {
878 return drupal_not_found();
879 }
880 }
881
882 /**
883 * User interface for the string deletion confirmation screen.
884 */
885 function locale_translate_delete_form(&$form_state, $source) {
886 $form['lid'] = array('#type' => 'value', '#value' => $source->lid);
887 return confirm_form($form, t('Are you sure you want to delete the string "%source"?', array('%source' => $source->source)), 'admin/build/translate/search', t('Deleting the string will remove all translations of this string in all languages. This action cannot be undone.'), t('Delete'), t('Cancel'));
888 }
889
890 /**
891 * Process string deletion submissions.
892 */
893 function locale_translate_delete_form_submit($form, &$form_state) {
894 db_query('DELETE FROM {locales_source} WHERE lid = %d', $form_state['values']['lid']);
895 db_query('DELETE FROM {locales_target} WHERE lid = %d', $form_state['values']['lid']);
876 // Force JavaScript translation file recreation for all languages. 896 // Force JavaScript translation file recreation for all languages.
877 _locale_invalidate_js(); 897 _locale_invalidate_js();
878 cache_clear_all('locale:', 'cache', TRUE); 898 cache_clear_all('locale:', 'cache', TRUE);
879 drupal_set_message(t('The string has been removed.')); 899 drupal_set_message(t('The string has been removed.'));
880 drupal_goto('admin/build/translate/search'); 900 $form_state['redirect'] = 'admin/build/translate/search';
881 } 901 }
882 /** 902 /**
883 * @} End of "locale-translate-delete" 903 * @} End of "locale-translate-delete"
884 */ 904 */
885 905