summaryrefslogtreecommitdiff
path: root/modules/locale/locale.install
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-05-27 11:45:00 +0000
committerDries Buytaert <dries@buytaert.net>2009-05-27 11:45:00 +0000
commit352a8e43341f85e1c7045f0cde2bb5455d185c7e (patch)
tree0e4bb7402c03e9eff70563c6304bbb388250b716 /modules/locale/locale.install
parent66108c34acf55a5cd38dca6c6e6aeb63dd61c678 (diff)
downloadbrdo-352a8e43341f85e1c7045f0cde2bb5455d185c7e.tar.gz
brdo-352a8e43341f85e1c7045f0cde2bb5455d185c7e.tar.bz2
- Patch #473366 by Berdir: convert locale module to the new database abstraction layer.
Diffstat (limited to 'modules/locale/locale.install')
-rw-r--r--modules/locale/locale.install14
1 files changed, 12 insertions, 2 deletions
diff --git a/modules/locale/locale.install b/modules/locale/locale.install
index 7febbba9a..3eac012f3 100644
--- a/modules/locale/locale.install
+++ b/modules/locale/locale.install
@@ -17,7 +17,17 @@ function locale_install() {
// Create tables.
drupal_install_schema('locale');
- db_query("INSERT INTO {languages} (language, name, native, direction, enabled, weight, javascript) VALUES ('en', 'English', 'English', '0', '1', '0', '')");
+ db_insert('languages')
+ ->fields(array(
+ 'language' => 'en',
+ 'name' => 'English',
+ 'native' => 'English',
+ 'direction' => 0,
+ 'enabled' => 1,
+ 'weight' => 0,
+ 'javascript' => '',
+ ))
+ ->execute();
}
/**
@@ -217,7 +227,7 @@ function locale_uninstall() {
// Delete all JavaScript translation files.
$locale_js_directory = file_create_path(variable_get('locale_js_directory', 'languages'));
$files = db_query('SELECT language, javascript FROM {languages}');
- while ($file = db_fetch_object($files)) {
+ foreach ($files as $file) {
if (!empty($file->javascript)) {
file_unmanaged_delete(file_create_path($locale_js_directory . '/' . $file->language . '_' . $file->javascript . '.js'));
}