summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/locale/locale.install19
-rw-r--r--modules/locale/locale.schema21
-rw-r--r--modules/system/system.js6
-rw-r--r--modules/system/system.module6
4 files changed, 37 insertions, 15 deletions
diff --git a/modules/locale/locale.install b/modules/locale/locale.install
index 1d87d6ccc..309e9d57f 100644
--- a/modules/locale/locale.install
+++ b/modules/locale/locale.install
@@ -12,7 +12,7 @@ function locale_install() {
// Create tables.
drupal_install_schema('locale');
- db_query("INSERT INTO {languages} (language, name, native, direction, enabled, weight) VALUES ('en', 'English', 'English', '0', '1', '0')");
+ db_query("INSERT INTO {languages} (language, name, native, direction, enabled, weight, javascript) VALUES ('en', 'English', 'English', '0', '1', '0', '')");
}
/**
@@ -92,6 +92,15 @@ function locale_update_6002() {
}
/**
+ * Adds a column to store the filename of the JavaScript translation file.
+ */
+function locale_update_6003() {
+ $ret = array();
+ db_add_field($rest, 'languages', 'javascript', array('type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => ''));
+ return $ret;
+}
+
+/**
* @} End of "defgroup updates-5.x-to-6.x"
*/
@@ -99,6 +108,14 @@ function locale_update_6002() {
* Implementation of hook_uninstall().
*/
function locale_uninstall() {
+ // Delete all JavaScript translation files
+ $files = db_query('SELECT javascript FROM {languages}');
+ while ($file = db_fetch_object($files)) {
+ if (!empty($file)) {
+ file_delete(file_create_path($file->javascript));
+ }
+ }
+
// Remove tables.
drupal_uninstall_schema('locale');
}
diff --git a/modules/locale/locale.schema b/modules/locale/locale.schema
index f949c7878..6973aeead 100644
--- a/modules/locale/locale.schema
+++ b/modules/locale/locale.schema
@@ -4,16 +4,17 @@
function locale_schema() {
$schema['languages'] = array(
'fields' => array(
- 'language' => array('type' => 'varchar', 'length' => 12, 'not null' => TRUE, 'default' => ''),
- 'name' => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE, 'default' => ''),
- 'native' => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE, 'default' => ''),
- 'direction' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
- 'enabled' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
- 'plurals' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
- 'formula' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''),
- 'domain' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''),
- 'prefix' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''),
- 'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0)
+ 'language' => array('type' => 'varchar', 'length' => 12, 'not null' => TRUE, 'default' => ''),
+ 'name' => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE, 'default' => ''),
+ 'native' => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE, 'default' => ''),
+ 'direction' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
+ 'enabled' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
+ 'plurals' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
+ 'formula' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''),
+ 'domain' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''),
+ 'prefix' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''),
+ 'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
+ 'javascript' => array('type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => ''),
),
'primary key' => array('language'),
);
diff --git a/modules/system/system.js b/modules/system/system.js
index 900d11ac1..808dac7f5 100644
--- a/modules/system/system.js
+++ b/modules/system/system.js
@@ -9,18 +9,18 @@
*/
Drupal.cleanURLsSettingsCheck = function() {
var url = location.pathname +"admin/settings/clean-urls";
- $("#clean-url .description span").html('<div id="testing">'+ Drupal.settings.cleanURL.testing +"</div>");
+ $("#clean-url .description span").html('<div id="testing">'+ Drupal.t('Testing clean URLs...') +"</div>");
$("#clean-url p").hide();
$.ajax({url: location.protocol +"//"+ location.host + url, type: "GET", data: " ", complete: function(response) {
$("#testing").toggle();
if (response.status == 200) {
// Check was successful.
$("#clean-url input.form-radio").attr("disabled", "");
- $("#clean-url .description span").append('<div class="ok">'+ Drupal.settings.cleanURL.success +"</div>");
+ $("#clean-url .description span").append('<div class="ok">'+ Drupal.t('Your server has been successfully tested to support this feature.') +"</div>");
}
else {
// Check failed.
- $("#clean-url .description span").append('<div class="warning">'+ Drupal.settings.cleanURL.failure +"</div>");
+ $("#clean-url .description span").append('<div class="warning">'+ Drupal.t('Your system configuration does not currently support this feature. The <a href="http://drupal.org/node/15365">handbook page on Clean URLs</a> has additional troubleshooting information.') +"</div>");
}
}});
};
diff --git a/modules/system/system.module b/modules/system/system.module
index bf1e7b93b..2ba242e22 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -615,7 +615,6 @@ function system_clean_url_settings() {
if (!variable_get('clean_url', 0)) {
if (strpos(request_uri(), '?q=') !== FALSE) {
- drupal_add_js(array('cleanURL' => array('success' => t('Your server has been successfully tested to support this feature.'), 'failure' => t('Your system configuration does not currently support this feature. The <a href="http://drupal.org/node/15365">handbook page on Clean URLs</a> has additional troubleshooting information.'), 'testing' => t('Testing clean URLs...'))), 'setting');
drupal_add_js(drupal_get_path('module', 'system') .'/system.js', 'module');
drupal_add_js('
// Global Killswitch
@@ -1060,6 +1059,7 @@ function system_theme_default() {
'slogan'
),
'stylesheet' => 'style.css',
+ 'script' => 'script.js',
'screenshot' => 'screenshot.png',
);
}
@@ -1113,6 +1113,10 @@ function system_theme_data() {
if (!empty($themes[$key]->info['stylesheet'])) {
$themes[$key]->info['stylesheet'] = dirname($themes[$key]->filename) .'/'. $themes[$key]->info['stylesheet'];
}
+ // Give the script proper path information.
+ if (!empty($themes[$key]->info['script'])) {
+ $themes[$key]->info['script'] = dirname($themes[$key]->filename) .'/'. $themes[$key]->info['script'];
+ }
// Give the screenshot proper path information.
if (!empty($themes[$key]->info['screenshot'])) {
$themes[$key]->info['screenshot'] = dirname($themes[$key]->filename) .'/'. $themes[$key]->info['screenshot'];