? .DS_Store
? contact_form_perm._00.patch
? contact_form_perm._01.patch
? contact_function_names_00.patch
? contact_submit_button_00.patch
? contact_submit_button_01.patch
? performance_settings_00.patch
? performance_settings_01.patch
? regional_settings_00.patch
? regional_settings_01.patch
? test.patch
? test2.patch
? user_settings_00.patch
? user_settings_01.patch
? modules/.DS_Store
? sites/.DS_Store
? sites/default/files
? sites/default/settings.php
Index: modules/block/block.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/block/block.module,v
retrieving revision 1.329
diff -u -p -r1.329 block.module
--- modules/block/block.module	26 Apr 2009 16:30:28 -0000	1.329
+++ modules/block/block.module	12 May 2009 00:05:23 -0000
@@ -443,22 +443,13 @@ function block_user_validate(&$edit, &$a
  * Implementation of hook_form_FORM_ID_alter().
  */
 function block_form_system_performance_settings_alter(&$form, &$form_state) {
-
-  // Add the block cache fieldset on the performance settings page.
-  $form['block_cache'] = array(
-    '#type' => 'fieldset',
-    '#title' => t('Block cache'),
-    '#description' => t('Enabling the block cache can offer a performance increase for all users by preventing blocks from being reconstructed on each page load. If the page cache is also enabled, performance increases from enabling the block cache will mainly benefit authenticated users.'),
-    '#weight' => 0,
-  );
-
-  $form['block_cache']['block_cache'] = array(
+  $form['caching']['block_cache'] = array(
     '#type' => 'radios',
     '#title' => t('Block cache'),
     '#default_value' => variable_get('block_cache', CACHE_DISABLED),
     '#options' => array(CACHE_DISABLED => t('Disabled'), CACHE_NORMAL => t('Enabled (recommended)')),
     '#disabled' => count(module_implements('node_grants')),
-    '#description' => t('Note that block caching is inactive when modules defining content access restrictions are enabled.'),
+    '#description' => t('Block caching is inactive when modules defining content access restrictions are enabled.'),
   );
 
   // Check if the "Who's online" block is enabled.
Index: modules/system/system.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.admin.inc,v
retrieving revision 1.140
diff -u -p -r1.140 system.admin.inc
--- modules/system/system.admin.inc	3 May 2009 07:35:37 -0000	1.140
+++ modules/system/system.admin.inc	12 May 2009 00:05:24 -0000
@@ -1286,79 +1286,94 @@ function system_logging_settings() {
  * @see system_settings_form()
  */
 function system_performance_settings() {
+  drupal_add_js(drupal_get_path('module', 'system') . '/system.js');
 
-  $description = '<p>' . t("The normal page cache mode is suitable for most sites and does not cause any side effects. The aggressive page cache mode causes Drupal to skip the loading (boot) and unloading (exit) of enabled modules when serving a cached page. This results in an additional performance boost but can cause unwanted side effects.") . '</p>';
-
-  $problem_modules = array_unique(array_merge(module_implements('boot'), module_implements('exit')));
-  sort($problem_modules);
-
-  if (count($problem_modules) > 0) {
-    $description .= '<p>' . t('<strong class="error">The following enabled modules are incompatible with aggressive page caching mode and will not function properly: %modules</strong>', array('%modules' => implode(', ', $problem_modules))) . '.</p>';
-  }
-  else {
-    $description .= '<p>' . t('<strong class="ok">Currently, all enabled modules are compatible with the aggressive page caching policy.</strong> Please note, if you use aggressive page caching and enable new modules, you will need to check this setting again to ensure compatibility.') . '</p>';
-  }
-  $form['page_cache'] = array(
+  $form['caching'] = array(
     '#type' => 'fieldset',
-    '#title' => t('Page cache'),
-    '#description' => t('Enabling the page cache will offer a significant performance boost. Drupal can store and send compressed cached pages requested by <em>anonymous</em> users. By caching a web page, Drupal does not have to construct the page each time it is viewed.'),
+    '#title' => t('Caching'),
     '#weight' => -1,
   );
 
-  $form['page_cache']['cache'] = array(
-    '#type' => 'radios',
-    '#title' => t('Page caching mode'),
-    '#default_value' => variable_get('cache', CACHE_DISABLED),
-    '#options' => array(CACHE_DISABLED => t('Disabled'), CACHE_NORMAL => t('Normal (recommended for production sites, no side effects)'), CACHE_AGGRESSIVE => t('Aggressive (experts only, possible side effects)')),
-    '#description' => $description
-  );
-
   $period = drupal_map_assoc(array(0, 60, 180, 300, 600, 900, 1800, 2700, 3600, 10800, 21600, 32400, 43200, 86400), 'format_interval');
   $period[0] = '<' . t('none') . '>';
-  $form['page_cache']['cache_lifetime'] = array(
+  $form['caching']['cache_lifetime'] = array(
     '#type' => 'select',
     '#title' => t('Minimum cache lifetime'),
     '#default_value' => variable_get('cache_lifetime', 0),
     '#options' => $period,
-    '#description' => t('On high-traffic sites, it may be necessary to enforce a minimum cache lifetime. The minimum cache lifetime is the minimum amount of time that will elapse before the cache is emptied and recreated, and is applied to both page and block caches. A larger minimum cache lifetime offers better performance, but users will not see new content for a longer period of time.')
+    '#description' => t('The minimum amount of time that will elapse before the page and block caches are recreated. A larger minimum cache lifetime offers better performance, but users will not see new content for a longer period of time.')
   );
-  $form['page_cache']['page_compression'] = array(
+
+  $problem_modules = array_unique(array_merge(module_implements('boot'), module_implements('exit')));
+  if (count($problem_modules) > 0) {
+    $module_names = array();
+    foreach ($problem_modules as $module) {
+      $info = drupal_parse_info_file(drupal_get_path('module', $module) . "/$module.info");
+      $module_names[] = $info['name'];
+    }
+    sort($module_names);
+    $description = ' ' . t('<strong class="error">The following enabled modules will not function properly with aggressive caching: %modules</strong>', array('%modules' => implode(', ', $module_names)));
+  }
+  else {
+    $description = ' ' . t('<strong>Note: if you use aggressive page caching and enable new modules, you will need to check this setting again to ensure compatibility.</strong>');
+  }
+  $cache = variable_get('cache', CACHE_DISABLED);
+  $form['caching']['cache'] = array(
     '#type' => 'radios',
+    '#title' => t('Page cache'),
+    '#default_value' => $cache,
+    '#options' => array(CACHE_DISABLED => t('Disabled'), CACHE_NORMAL => t('Normal (recommended)'), CACHE_AGGRESSIVE => t('Aggressive (possible side effects)')),
+    '#description' => t('Pages requested by <em>anonymous</em> users can be cached and sent compressed. Aggressive caching skips the loading (boot) and unloading (exit) of enabled modules when serving a cached page. This results in an additional performance boost but can cause unwanted side effects.') . $description,
+  );
+  $js_hide = $cache == CACHE_DISABLED ? ' class="js-hide"' : '';
+  $form['caching']['page_compression'] = array(
+    '#type' => 'checkbox',
     '#title' => t('Page compression'),
     '#default_value' => variable_get('page_compression', TRUE),
-    '#options' => array(t('Disabled'), t('Enabled')),
-    '#description' => t("By default, Drupal compresses the pages it caches in order to save bandwidth and improve download times. This option should be disabled when using a webserver that performs compression."),
+    '#description' => t("Compress cached pages to save bandwidth and improve download times. This option should be disabled when using a webserver that performs compression."),
+    '#prefix' => '<div id="page-compression-wrapper"' . $js_hide . '>',
+    '#suffix' => '</div>',
   );
 
+  $directory = file_directory_path();
+  $is_writable = is_dir($directory) && is_writable($directory);
+  $public_downloads = (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) == FILE_DOWNLOADS_PUBLIC);
+  $disabled = !$is_writable && !$public_downloads;
+  $disabled_message = '';
+  if(!$is_writable && !$public_downloads) {
+    $disabled_message = ' ' . t('<strong class="error">Please <a href="!file-system">set up</a> the files directory and set the download method to public to make these optimizations available.</strong>', array('!file-system' => url('admin/settings/file-system')));
+  }
+  elseif(!$is_writable) {
+    $disabled_message = ' ' . t('<strong class="error">Please set up the <a href="!file-system">files directory</a> to make these optimizations available.</strong>', array('!file-system' => url('admin/settings/file-system')));
+  }
+  elseif(!$public_downloads) {
+    $disabled_message = ' ' . t('<strong class="error">Please set the <a href="!file-system">download method</a> to public to make these optimizations available.</strong>', array('!file-system' => url('admin/settings/file-system')));
+  }
   $form['bandwidth_optimizations'] = array(
     '#type' => 'fieldset',
     '#title' => t('Bandwidth optimizations'),
-    '#description' => '<p>' . t('Drupal can automatically optimize external resources like CSS and JavaScript, which can reduce both the size and number of requests made to your website. CSS files can be aggregated and compressed into a single file, while JavaScript files are aggregated (but not compressed). These optional optimizations may reduce server load, bandwidth requirements, and page loading times.') . '</p><p>' . t('These options are disabled if you have not set up your files directory, or if your download method is set to private.') . '</p>'
+    '#description' => t('External resources  can automatically be optimized, which can reduce both the size and number of requests made to your website. Note: these options may interfere with theme and module development.') . $disabled_message,
   );
 
-  $directory = file_directory_path();
-  $is_writable = is_dir($directory) && is_writable($directory) && (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) == FILE_DOWNLOADS_PUBLIC);
   $form['bandwidth_optimizations']['preprocess_css'] = array(
-    '#type' => 'radios',
+    '#type' => 'checkbox',
     '#title' => t('Optimize CSS files'),
     '#default_value' => intval(variable_get('preprocess_css', 0) && $is_writable),
-    '#disabled' => !$is_writable,
-    '#options' => array(t('Disabled'), t('Enabled')),
-    '#description' => t('This option can interfere with theme development and should only be enabled in a production environment.'),
+    '#disabled' => $disabled,
+    '#description' => t('Aggregate and compress CSS files into a single file.'),
   );
   $form['bandwidth_optimizations']['preprocess_js'] = array(
-    '#type' => 'radios',
+    '#type' => 'checkbox',
     '#title' => t('Optimize JavaScript files'),
     '#default_value' => intval(variable_get('preprocess_js', 0) && $is_writable),
-    '#disabled' => !$is_writable,
-    '#options' => array(t('Disabled'), t('Enabled')),
-    '#description' => t('This option can interfere with module development and should only be enabled in a production environment.'),
+    '#disabled' => $disabled,
+    '#description' => t('Aggregate JavaScript files.'),
   );
 
   $form['clear_cache'] = array(
     '#type' => 'fieldset',
     '#title' => t('Clear cached data'),
-    '#description' => t('Caching data improves performance, but may cause problems while troubleshooting new modules, themes, or translations, if outdated information has been cached. To refresh all cached data on your site, click the button below. <em>Warning: high-traffic sites will experience performance slowdowns while cached data is rebuilt.</em>'),
+    '#description' => t('Caching data improves performance, but may cause problems while troubleshooting new modules, themes, or translations, if outdated information has been cached. <em>Warning: high-traffic sites will experience performance slowdowns while cached data is rebuilt.</em>'),
   );
 
   $form['clear_cache']['clear'] = array(
@@ -1531,7 +1546,7 @@ function system_regional_settings() {
 
   $form['locale'] = array(
     '#type' => 'fieldset',
-    '#title' => t('Locale settings'),
+    '#title' => t('Locale'),
   );
 
   $form['locale']['site_default_country'] = array(
@@ -1539,65 +1554,63 @@ function system_regional_settings() {
     '#title' => t('Default country'),
     '#default_value' => variable_get('site_default_country', ''),
     '#options' => $countries,
-    '#description' => t('Select the default country for the site.'),
     '#attributes' => array('class' => 'country-detect'),
   );
 
-  $form['locale']['date_default_timezone'] = array(
-    '#type' => 'select',
-    '#title' => t('Default time zone'),
-    '#default_value' => variable_get('date_default_timezone', date_default_timezone_get()),
-    '#options' => $zones,
-    '#description' => t('Select the default time zone for the site.'),
-  );
-
   $form['locale']['date_first_day'] = array(
     '#type' => 'select',
     '#title' => t('First day of week'),
     '#default_value' => variable_get('date_first_day', 0),
     '#options' => array(0 => t('Sunday'), 1 => t('Monday'), 2 => t('Tuesday'), 3 => t('Wednesday'), 4 => t('Thursday'), 5 => t('Friday'), 6 => t('Saturday')),
-    '#description' => t('The first day of the week for calendar views.')
   );
 
   $form['timezone'] = array(
     '#type' => 'fieldset',
-    '#title' => t('User time zones'),
+    '#title' => t('Time zones'),
   );
 
+  $form['timezone']['date_default_timezone'] = array(
+    '#type' => 'select',
+    '#title' => t('Default time zone'),
+    '#default_value' => variable_get('date_default_timezone', date_default_timezone_get()),
+    '#options' => $zones,
+  );
+
+  $configurable_timezones = variable_get('configurable_timezones', 1);
   $form['timezone']['configurable_timezones'] = array(
-    '#type' => 'radios',
-    '#title' => t('User-configurable time zones'),
-    '#default_value' => variable_get('configurable_timezones', 1),
-    '#options' => array(0 => t('Disabled'), 1 => t('Enabled')),
-    '#description' => t('When enabled, users can set their own time zone and dates will be displayed accordingly.')
+    '#type' => 'checkbox',
+    '#title' => t('Users may set their own time zone.'),
+    '#default_value' => $configurable_timezones,
   );
 
-  $form['timezone']['user_default_timezone'] = array(
-    '#type' => 'radios',
-    '#title' => t('User time zone defaults'),
-    '#default_value' => variable_get('user_default_timezone', DRUPAL_USER_TIMEZONE_DEFAULT),
-    '#options' => array(
-      DRUPAL_USER_TIMEZONE_DEFAULT => t('New users will be set to the default time zone at registration.'),
-      DRUPAL_USER_TIMEZONE_EMPTY   => t('New users will get an empty time zone at registration.'),
-      DRUPAL_USER_TIMEZONE_SELECT  => t('New users will select their own time zone at registration.'),
-    ),
-    '#description' => t('Method for setting user time zones at registration when user-configurable time zones are enabled. This only affects the initial time zone setting for a new registration. Users will be able to change their time zone any time they edit their account.')
+  $js_hide = !$configurable_timezones ? ' class="js-hide"' : '';
+  $form['timezone']['configurable_timezones_wrapper'] =  array(
+    '#prefix' => '<div id="empty-timezone-message-wrapper"' . $js_hide . '>',
+    '#suffix' => '</div>',
   );
 
-  $form['timezone']['empty_timezone_message'] = array(
-    '#type' => 'radios',
-    '#title' => t('Empty user time zones'),
+  $form['timezone']['configurable_timezones_wrapper']['empty_timezone_message'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Remind users at login if their time zone is not set.'),
     '#default_value' => variable_get('empty_timezone_message', 0),
+    '#description' => t('Only applied if users may set their own time zone.')
+  );
+
+  $form['timezone']['configurable_timezones_wrapper']['user_default_timezone'] = array(
+    '#type' => 'radios',
+    '#title' => t('Time zone for new users'),
+    '#default_value' => variable_get('user_default_timezone', DRUPAL_USER_TIMEZONE_DEFAULT),
     '#options' => array(
-      0 => t('Ignore empty user time zones.'),
-      1 => t('Remind users at login if their time zone is not set.'),
+      DRUPAL_USER_TIMEZONE_DEFAULT => t('Default time zone.'),
+      DRUPAL_USER_TIMEZONE_EMPTY   => t('Empty time zone.'),
+      DRUPAL_USER_TIMEZONE_SELECT  => t('Users may set their own time zone at registration.'),
     ),
-    '#description' => t('Handling for empty user time zones when user-configurable time zones are enabled. Use this option to help ensure that users set the correct time zone.')
+    '#description' => t('Only applied if users may set their own time zone.')
   );
 
   $form['date_formats'] = array(
     '#type' => 'fieldset',
-    '#title' => t('Formatting'),
+    '#title' => t('Date formats'),
   );
 
   $date_format_short = variable_get('date_format_short', $date_short[1]);
@@ -1609,7 +1622,6 @@ function system_regional_settings() {
     '#attributes' => array('class' => 'date-format'),
     '#default_value' => (isset($date_short_choices[$date_format_short]) ? $date_format_short : 'custom'),
     '#options' => $date_short_choices,
-    '#description' => t('The short format of date display.'),
   );
 
   $default_short_custom = variable_get('date_format_short_custom', (isset($date_short_choices[$date_format_short]) ? $date_format_short : ''));
@@ -1632,7 +1644,6 @@ function system_regional_settings() {
     '#attributes' => array('class' => 'date-format'),
     '#default_value' => (isset($date_medium_choices[$date_format_medium]) ? $date_format_medium : 'custom'),
     '#options' => $date_medium_choices,
-    '#description' => t('The medium sized date display.'),
   );
 
   $default_medium_custom = variable_get('date_format_medium_custom', (isset($date_medium_choices[$date_format_medium]) ? $date_format_medium : ''));
@@ -1655,7 +1666,6 @@ function system_regional_settings() {
     '#attributes' => array('class' => 'date-format'),
     '#default_value' => (isset($date_long_choices[$date_format_long]) ? $date_format_long : 'custom'),
     '#options' => $date_long_choices,
-    '#description' => t('Longer date format used for detailed display.')
   );
 
   $default_long_custom = variable_get('date_format_long_custom', (isset($date_long_choices[$date_format_long]) ? $date_format_long : ''));
Index: modules/system/system.js
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.js,v
retrieving revision 1.24
diff -u -p -r1.24 system.js
--- modules/system/system.js	27 Apr 2009 20:19:38 -0000	1.24
+++ modules/system/system.js	12 May 2009 00:05:24 -0000
@@ -124,4 +124,22 @@ Drupal.behaviors.poweredByPreview = {
   }
 };
 
+ /**
+ * Show/hide settings for page caching depending on whether page caching is
+ * enabled or not.
+ */
+Drupal.behaviors.pageCache = {
+  attach: function (context, settings) {
+    $('#edit-cache-0', context).change(function () {
+      $('#page-compression-wrapper').hide();
+    });
+    $('#edit-cache-1', context).change(function () {
+      $('#page-compression-wrapper').show();
+    });
+    $('#edit-cache-2', context).change(function () {
+      $('#page-compression-wrapper').show();
+    });
+  },
+};
+
 })(jQuery);
