summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-04-05 12:31:57 +0000
committerDries Buytaert <dries@buytaert.net>2009-04-05 12:31:57 +0000
commitb658330d2820c7a46b4f79256c1f8aebb1d26c3e (patch)
tree7f348e44a07415ac1175c26389add2f4fc093d60 /modules
parent1067fbaa304196c137709518aceec0aa89d93538 (diff)
downloadbrdo-b658330d2820c7a46b4f79256c1f8aebb1d26c3e.tar.gz
brdo-b658330d2820c7a46b4f79256c1f8aebb1d26c3e.tar.bz2
- Patch #424252 by swentel: move block cache settings from system module to block module now block module is optional.
Diffstat (limited to 'modules')
-rw-r--r--modules/block/block.module23
-rw-r--r--modules/system/system.admin.inc16
2 files changed, 24 insertions, 15 deletions
diff --git a/modules/block/block.module b/modules/block/block.module
index e04dca400..7abbe2f19 100644
--- a/modules/block/block.module
+++ b/modules/block/block.module
@@ -436,6 +436,29 @@ function block_user_validate(&$edit, &$account, $category = NULL) {
}
/**
+ * Implementation of hook_form_FORM_ID_form_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(
+ '#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.'),
+ );
+}
+
+/**
* Return all blocks in the specified region for the current user.
*
* @param $region
diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc
index 8b9a844d5..c99cff5e2 100644
--- a/modules/system/system.admin.inc
+++ b/modules/system/system.admin.inc
@@ -1322,6 +1322,7 @@ function system_performance_settings() {
'#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.'),
+ '#weight' => -1,
);
$form['page_cache']['cache'] = array(
@@ -1349,21 +1350,6 @@ function system_performance_settings() {
'#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."),
);
- $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.'),
- );
-
- $form['block_cache']['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.'),
- );
-
$form['bandwidth_optimizations'] = array(
'#type' => 'fieldset',
'#title' => t('Bandwidth optimizations'),