diff options
Diffstat (limited to 'modules/system')
-rw-r--r-- | modules/system/system.admin.inc | 7 | ||||
-rw-r--r-- | modules/system/system.install | 4 | ||||
-rw-r--r-- | modules/system/system.module | 9 |
3 files changed, 17 insertions, 3 deletions
diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc index e352a60dc..a9f040f96 100644 --- a/modules/system/system.admin.inc +++ b/modules/system/system.admin.inc @@ -179,7 +179,9 @@ function system_themes_form() { } else { // Ensure this theme is compatible with this version of core. - if (!isset($theme->info['core']) || $theme->info['core'] != DRUPAL_CORE_COMPATIBILITY) { + // Require the 'content' region to make sure the main page + // content has a common place in all themes. + if (!isset($theme->info['core']) || ($theme->info['core'] != DRUPAL_CORE_COMPATIBILITY) || (!isset($theme->info['regions']['content']))) { $incompatible_core[] = $theme->name; } if (version_compare(phpversion(), $theme->info['php']) < 0) { @@ -1882,7 +1884,8 @@ function system_batch_page() { elseif (isset($output)) { // Force a page without blocks or messages to // display a list of collected messages later. - $page = drupal_get_page($output); + drupal_set_page_content($output); + $page = element_info('page'); $page['#show_blocks'] = FALSE; $page['#show_messages'] = FALSE; return $page; diff --git a/modules/system/system.install b/modules/system/system.install index 9b8ab44d3..d0246fbc8 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -3347,7 +3347,7 @@ function system_update_7020() { } /** - * Add help block to the help region, migrate custom variables to blocks. + * Add new blocks to new regions, migrate custom variables to blocks. */ function system_update_7021() { $ret = array(); @@ -3359,6 +3359,8 @@ function system_update_7021() { $themes_with_blocks[] = $theme->name; // Add new system generated help block. $ret[] = update_sql("INSERT INTO {block} (module, delta, theme, status, weight, region, pages, cache) VALUES ('system', 'help', '" . $theme->name . "', 1, 0, 'help', '', 1)"); + // Add new system generated main page content block. + $ret[] = update_sql("INSERT INTO {block} (module, delta, theme, status, weight, region, pages, cache) VALUES ('system', 'main', '" . $theme->name . "', 1, 0, 'content', '', -1)"); } // Migrate contact form information. diff --git a/modules/system/system.module b/modules/system/system.module index 3f7c8521b..017c43473 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -878,6 +878,11 @@ function system_user_timezone(&$edit, &$form) { * Implementation of hook_block_list(). */ function system_block_list() { + $blocks['main'] = array( + 'info' => t('Main page content'), + // Cached elsewhere. + 'cache' => BLOCK_NO_CACHE, + ); $blocks['powered-by'] = array( 'info' => t('Powered by Drupal'), 'weight' => '10', @@ -946,6 +951,10 @@ function system_block_save($delta = '', $edit = NULL) { function system_block_view($delta = '') { $block = array(); switch ($delta) { + case 'main': + $block['subject'] = NULL; + $block['content'] = drupal_set_page_content(); + return $block; case 'powered-by': $image_path = 'misc/' . variable_get('drupal_badge_color', 'powered-blue') . '-' . variable_get('drupal_badge_size', '80x15') . '.png'; $block['subject'] = NULL; |