Issue #1373312 by sun: Assign system_main() block to 'content' region and help block...
authorcatch
Mon, 20 Feb 2012 05:41:29 +0000 (14:41 +0900)
committercatch
Mon, 20 Feb 2012 05:41:29 +0000 (14:41 +0900)
core/modules/block/block.api.php
core/modules/system/system.module

index d33f594..e499712 100644 (file)
  *     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.
index 332e559..38c3f55 100644 (file)
@@ -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) {