From 859fdb931eafabddf95dade0013dc57ea64b0e0e Mon Sep 17 00:00:00 2001 From: catch Date: Mon, 20 Feb 2012 14:41:29 +0900 Subject: [PATCH] Issue #1373312 by sun: Assign system_main() block to 'content' region and help block to 'help' region by default. --- core/modules/block/block.api.php | 16 +++++++++------- core/modules/system/system.module | 9 ++++++++- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/core/modules/block/block.api.php b/core/modules/block/block.api.php index d33f5942546..e499712441c 100644 --- a/core/modules/block/block.api.php +++ b/core/modules/block/block.api.php @@ -66,14 +66,16 @@ * Most modules do not provide an initial value, and any value provided can * be modified by a user on the block configuration screen. * - 'status': (optional) Initial value for block enabled status. (1 = - * enabled, 0 = disabled). Most modules do not provide an initial value, - * and any value provided can be modified by a user on the block - * configuration screen. + * enabled, 0 = disabled). An initial value for 'region' is required for + * 'status' to take effect. + * Most modules do not provide an initial value, and any value provided can + * be modified by a user on the block configuration screen. * - 'region': (optional) Initial value for theme region within which this - * block is set. Most modules do not provide an initial value, and - * any value provided can be modified by a user on the block configuration - * screen. Note: If you set a region that isn't available in the currently - * enabled theme, the block will be disabled. + * block is set. If the specified region is not available in a theme, the + * block will be disabled. The initial value for 'status' must be enabled or + * the initial region value is ignored. + * Most modules do not provide an initial value, and any value provided can + * be modified by a user on the block configuration screen. * - 'visibility': (optional) Initial value for the visibility flag, which * tells how to interpret the 'pages' value. Possible values are: * - BLOCK_VISIBILITY_NOTLISTED: Show on all pages except listed pages. diff --git a/core/modules/system/system.module b/core/modules/system/system.module index 332e5590044..38c3f55a6e7 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -2035,8 +2035,12 @@ function system_user_timezone(&$form, &$form_state) { function system_block_info() { $blocks['main'] = array( 'info' => t('Main page content'), - // Cached elsewhere. + // Cached elsewhere. 'cache' => DRUPAL_NO_CACHE, + // Auto-enable in 'content' region by default, which always exists. + // @see system_themes_page(), drupal_render_page() + 'region' => 'content', + 'status' => 1, ); $blocks['powered-by'] = array( 'info' => t('Powered by Drupal'), @@ -2047,6 +2051,9 @@ function system_block_info() { 'info' => t('System help'), 'weight' => '5', 'cache' => DRUPAL_NO_CACHE, + // Auto-enable in 'help' region by default, if the theme defines one. + 'region' => 'help', + 'status' => 1, ); // System-defined menu blocks. foreach (menu_list_system_menus() as $menu_name => $title) {