From ff9b6c611e1e1a804602f6a03692453268ee8076 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Mon, 20 Apr 2009 07:36:34 +0000 Subject: [PATCH] - Patch #427296 by taz88ny: move some code from system.module to bloc.module where it belongs. --- modules/block/block.module | 16 ++++++++++++++++ modules/system/system.admin.inc | 12 ------------ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/modules/block/block.module b/modules/block/block.module index 7abbe2f19cd..a44b910a4c1 100644 --- a/modules/block/block.module +++ b/modules/block/block.module @@ -456,6 +456,22 @@ function block_form_system_performance_settings_alter(&$form, &$form_state) { '#disabled' => count(module_implements('node_grants')), '#description' => t('Note that block caching is inactive when modules defining content access restrictions are enabled.'), ); + + // Check if the "Who's online" block is enabled. + $online_block_enabled = db_select('block') + ->condition('module', 'user') + ->condition('delta', 'online') + ->condition('status', 1) + ->countQuery() + ->execute() + ->fetchField(); + + // If the "Who's online" block is enabled, append some descriptive text to + // the end of the form description. + if ($online_block_enabled) { + $form['page_cache']['cache']['#description'] .= '

' . t('When caching is enabled, anonymous user sessions are only saved to the database when needed, so the "Who\'s online" block does not display the number of anonymous users.') . '

'; + } + } /** diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc index eb15ce009fd..481355b4026 100644 --- a/modules/system/system.admin.inc +++ b/modules/system/system.admin.inc @@ -1296,18 +1296,6 @@ function system_performance_settings() { $description = '

' . t("The normal cache mode is suitable for most sites and does not cause any side effects. The aggressive 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.") . '

'; - // Check if the "Who's online" block is enabled. - $online_block_enabled = db_select('block') - ->condition('module', 'user') - ->condition('delta', 'online') - ->condition('status', 1) - ->countQuery() - ->execute() - ->fetchField(); - if ($online_block_enabled) { - $description .= '

' . t("When caching is enabled, anonymous user sessions are only saved to the database when needed, so the \"Who's online\" block does not display the number of anonymous users.") . '

'; - } - $problem_modules = array_unique(array_merge(module_implements('boot'), module_implements('exit'))); sort($problem_modules);