diff --git a/modules/system/system.module b/modules/system/system.module
index 74b806fcdcd6..23c2cb734949 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -572,23 +572,34 @@ function system_site_information_settings() {
}
function system_clean_url_settings() {
- // We check for clean URL support using an image on the client side.
$form['clean_url'] = array(
'#type' => 'radios',
'#title' => t('Clean URLs'),
'#default_value' => variable_get('clean_url', 0),
'#options' => array(t('Disabled'), t('Enabled')),
- '#description' => t('This option makes Drupal emit "clean" URLs (i.e. without ?q=
in the URL.)'),
+ '#description' => t('This option makes Drupal emit "clean" URLs (i.e. without ?q=
in the URL).'),
);
if (!variable_get('clean_url', 0)) {
if (strpos(request_uri(), '?q=') !== FALSE) {
- $form['clean_url']['#description'] .= t(' Before enabling clean URLs, you must perform a test to determine if your server is properly configured. If you are able to see this page again after clicking the "Run the clean URL test" link, the test has succeeded and the radio buttons above will be available. If instead you are directed to a "Page not found" error, you will need to change the configuration of your server. The handbook page on Clean URLs has additional troubleshooting information. !run-test', array('@handbook' => 'http://drupal.org/node/15365', '!run-test' => ''. t('Run the clean URL test') .''));
+ 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 handbook page on Clean URLs 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
+if (Drupal.jsEnabled) {
+ $(document).ready(function() {
+ Drupal.cleanURLsSettingsCheck();
+ });
+}', 'inline');
+
+ $form['clean_url']['#description'] .= ' '. t('Before enabling clean URLs, you must perform a test to determine if your server is properly configured. If you are able to see this page again after clicking the "Run the clean URL test" link, the test has succeeded and the radio buttons above will be available. If instead you are directed to a "Page not found" error, you will need to change the configuration of your server. The handbook page on Clean URLs has additional troubleshooting information.', array('@handbook' => 'http://drupal.org/node/15365')) .'';
+
$form['clean_url']['#disabled'] = TRUE;
+ $form['clean_url']['#prefix'] = '
'. t('Run the clean url test.', array('@clean_url' => base_path() .'admin/settings/clean-urls')) .'