? .DS_Store
? 392362-clean-url-install-cleanup.patch
? clean_url_form_04.patch
? clean_url_form_05.patch
? clean_url_settings_00.patch
? clean_url_settings_01.patch
? clean_url_settings_02.patch
? clean_url_settings_03.patch
? clean_url_settings_04.patch
? modules/.DS_Store
? sites/.DS_Store
? sites/default/.DS_Store
? sites/default/files
? sites/default/settings.php
Index: install.php
===================================================================
RCS file: /cvs/drupal/drupal/install.php,v
retrieving revision 1.162
diff -u -p -r1.162 install.php
--- install.php	2 Apr 2009 20:39:44 -0000	1.162
+++ install.php	3 Apr 2009 22:36:27 -0000
@@ -727,7 +727,7 @@ function install_tasks($profile, $task) 
       drupal_add_js('misc/timezone.js');
       // We add these strings as settings because JavaScript translation does not
       // work on install time.
-      drupal_add_js(array('copyFieldValue' => array('edit-site-mail' => array('edit-account-mail')), 'cleanURL' => array('success' => st('Your server has been successfully tested to support this feature.'), 'failure' => st('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' => st('Testing clean URLs...'))), 'setting');
+      drupal_add_js(array('copyFieldValue' => array('edit-site-mail' => array('edit-account-mail'))), 'setting');
       drupal_add_js('
 // Global Killswitch
 if (Drupal.jsEnabled) {
@@ -1042,15 +1042,9 @@ function install_configure_form(&$form_s
   );
 
   $form['server_settings']['clean_url'] = array(
-    '#type' => 'radios',
-    '#title' => st('Clean URLs'),
+    '#type' => 'hidden',
     '#default_value' => 0,
-    '#options' => array(0 => st('Disabled'), 1 => st('Enabled')),
-    '#description' => st('This option makes Drupal emit "clean" URLs (i.e. without <code>?q=</code> in the URL).'),
-    '#disabled' => TRUE,
-    '#prefix' => '<div id="clean-url" class="install">',
-    '#suffix' => '</div>',
-    '#weight' => 10,
+    '#attributes' => array('class' => 'install'),
   );
 
   $form['server_settings']['update_status_module'] = array(
Index: modules/system/system.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.admin.inc,v
retrieving revision 1.131
diff -u -p -r1.131 system.admin.inc
--- modules/system/system.admin.inc	17 Mar 2009 15:26:29 -0000	1.131
+++ modules/system/system.admin.inc	3 Apr 2009 22:36:29 -0000
@@ -1760,36 +1760,67 @@ function system_site_maintenance_setting
 }
 
 /**
- * Form builder; Configure Clean URL settings.
+ * Menu callback; Configure Clean URL settings.
  *
  * @ingroup forms
  * @see system_settings_form()
  */
-function system_clean_url_settings() {
+function system_clean_url_settings_page() {
+  $available = variable_get('clean_url', 0) || strpos(request_uri(), '?q=') === FALSE;
+
+  return drupal_get_form('system_clean_url_settings', $available) . drupal_get_form('system_clean_url_test', $available);
+}
+
+/**
+ * Form builder; clean URL settings.
+ *
+ * @ingroup forms
+ * @see system_clean_url_setings_page()
+ */
+function system_clean_url_settings($form_state, $available) {
   $form['clean_url'] = array(
-    '#type' => 'radios',
-    '#title' => t('Clean URLs'),
-    '#default_value' => 0,
-    '#options' => array(t('Disabled'), t('Enabled')),
-    '#description' => t('This option makes Drupal emit "clean" URLs (i.e. without <code>?q=</code> in the URL).'),
+    '#type' => 'checkbox',
+    '#title' => t('Enable clean URLs'),
+    // The form isn't always run through system_settings_form(), so we have to
+    // set the default value manually.
+    '#default_value' => variable_get('clean_url', 0),
+    '#description' => t('Use URLs like <code>example.com/user</code> instead of <code>example.com/?q=user</code>.'),
   );
 
-  if (!variable_get('clean_url', 0)) {
-    if (strpos(request_uri(), '?q=') !== FALSE) {
-      drupal_add_js(drupal_get_path('module', 'system') . '/system.js');
-
-      $form['clean_url']['#description'] .= ' <span>' . 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 <a href="@handbook">handbook page on Clean URLs</a> has additional troubleshooting information.', array('@handbook' => 'http://drupal.org/node/15365')) . '</span>';
-
-      $form['clean_url']['#disabled'] = TRUE;
-      $form['clean_url']['#prefix'] = '<div id="clean-url">';
-      $form['clean_url']['#suffix'] = '<p>' . t('<a href="@clean_url">Run the clean url test</a>.', array('@clean_url' => base_path() . 'admin/settings/clean-urls')) . '</p></div>';
-    }
-    else {
-      $form['clean_url']['#description'] .= ' <div class="ok">' . t('Your server has been successfully tested to support this feature.') . '</div>';
-    }
+  if (!$available) {
+    drupal_add_js(drupal_get_path('module', 'system') . '/system.js');
+
+    drupal_set_message(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" button, the test has succeeded and the checkbox 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 <a href="@handbook">handbook page on Clean URLs</a> has additional troubleshooting information.', array('@handbook' => 'http://drupal.org/node/15365')), 'warning');
+
+    $form['clean_url']['#disabled'] = TRUE;
+    $form['clean_url']['#description'] .= '<span></span>';
+  }
+  else {
+    // Clean URLs are available.
+    $form = system_settings_form($form, FALSE);
+  }
+
+  return $form;
+}
+
+/**
+ * Form builder; generate a button to check for clean URL availability manually.
+ *
+ * @ingroup forms
+ * @see system_clean_url_setings_page()
+ */
+function system_clean_url_test($form_state, $available) {
+  $form = array();
+
+  if (!$available) {
+    $form['#action'] = 'admin/settings/clean-urls';
+    $form['clean_url_test'] = array(
+      '#type' => 'submit',
+      '#value' => t('Run the clean url test'),
+    );
   }
 
-  return system_settings_form($form, TRUE);
+  return $form;
 }
 
 /**
Index: modules/system/system.js
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.js,v
retrieving revision 1.21
diff -u -p -r1.21 system.js
--- modules/system/system.js	17 Mar 2009 15:26:29 -0000	1.21
+++ modules/system/system.js	3 Apr 2009 22:36:29 -0000
@@ -13,24 +13,20 @@ Drupal.behaviors.cleanURLsSettingsCheck 
     // This behavior attaches by ID, so is only valid once on a page.
     // Also skip if we are on an install page, as Drupal.cleanURLsInstallCheck will handle
     // the processing.
-    if ($("#clean-url.clean-url-processed, #clean-url.install").size()) {
+    if ($(".clean-url-processed, #edit-clean-url.install").size()) {
       return;
     }
     var url = settings.basePath +"admin/settings/clean-urls/check";
-    $("#clean-url .description span").html('<div id="testing">'+ Drupal.t('Testing clean URLs...') +"</div>");
-    $("#clean-url p").hide();
+    $("#edit-clean-url-wrapper .description span").html('<div id="testing">'+ Drupal.t('Testing clean URLs...') +"</div>");
     $.ajax({
       url: location.protocol +"//"+ location.host + url,
       dataType: 'json',
       success: function () {
         // Check was successful.
-        $("#clean-url input.form-radio").attr("disabled", false);
-        $("#clean-url .description span").append('<div class="ok">'+ Drupal.t('Your server has been successfully tested to support this feature.') +"</div>");
-        $("#testing").hide();
+        location = settings.basePath +"admin/settings/clean-urls";
       },
       error: function() {
         // Check failed.
-        $("#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>");
         $("#testing").hide();
       }
     });
@@ -47,8 +43,6 @@ Drupal.behaviors.cleanURLsSettingsCheck 
  */
 Drupal.cleanURLsInstallCheck = function() {
   var url = location.protocol +"//"+ location.host + Drupal.settings.basePath +"admin/settings/clean-urls/check";
-  $("#clean-url .description").append('<span><div id="testing">'+ Drupal.settings.cleanURL.testing +"</div></span>");
-  $("#clean-url.install").css("display", "block");
   // Submit a synchronous request to avoid database errors associated with
   // concurrent requests during install.
   $.ajax({
@@ -57,18 +51,10 @@ Drupal.cleanURLsInstallCheck = function(
     dataType: 'json',
     success: function () {
       // Check was successful.
-      $("#clean-url input.form-radio").attr("disabled", false);
-      $("#clean-url input.form-radio").attr("checked", 1);
-      $("#clean-url .description span").append('<div class="ok">'+ Drupal.settings.cleanURL.success +"</div>");
-      $("#testing").hide();
+      $("#edit-clean-url").attr("value", 1);
     },
-    error: function() {
-      // Check failed.
-      $("#clean-url .description span").append('<div class="warning">'+ Drupal.settings.cleanURL.failure +"</div>");
-      $("#testing").hide();
-    }
   });
-  $("#clean-url").addClass('clean-url-processed');
+  $("#edit-clean-url").addClass('clean-url-processed');
 };
 
 /**
@@ -134,4 +120,4 @@ Drupal.behaviors.poweredByPreview = {
   }
 };
 
-})(jQuery);
\ No newline at end of file
+})(jQuery);
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.676
diff -u -p -r1.676 system.module
--- modules/system/system.module	25 Mar 2009 18:40:50 -0000	1.676
+++ modules/system/system.module	3 Apr 2009 22:36:29 -0000
@@ -701,8 +701,7 @@ function system_menu() {
   $items['admin/settings/clean-urls'] = array(
     'title' => 'Clean URLs',
     'description' => 'Enable or disable clean URLs for your site.',
-    'page callback' => 'drupal_get_form',
-    'page arguments' => array('system_clean_url_settings'),
+    'page callback' => 'system_clean_url_settings_page',
     'access arguments' => array('administer site configuration'),
   );
   $items['admin/settings/clean-urls/check'] = array(
