summaryrefslogtreecommitdiff
path: root/modules/block
diff options
context:
space:
mode:
Diffstat (limited to 'modules/block')
-rw-r--r--modules/block/block.admin.inc4
-rw-r--r--modules/block/block.module9
2 files changed, 7 insertions, 6 deletions
diff --git a/modules/block/block.admin.inc b/modules/block/block.admin.inc
index 852397383..0f80a4b00 100644
--- a/modules/block/block.admin.inc
+++ b/modules/block/block.admin.inc
@@ -34,7 +34,7 @@ function block_admin_display_form(&$form_state, $blocks, $theme = NULL) {
$custom_theme = isset($theme) ? $theme : variable_get('theme_default', 'garland');
drupal_theme_initialize();
- $block_regions = system_region_list($theme_key) + array(BLOCK_REGION_NONE => '<' . t('none') . '>');
+ $block_regions = system_region_list($theme_key, REGIONS_VISIBLE) + array(BLOCK_REGION_NONE => '<' . t('none') . '>');
// Weights range from -delta to +delta, so delta should be at least half
// of the amount of blocks present. This makes sure all blocks in the same
@@ -469,7 +469,7 @@ function block_box_delete_submit($form, &$form_state) {
function template_preprocess_block_admin_display_form(&$variables) {
global $theme_key;
- $block_regions = system_region_list($theme_key);
+ $block_regions = system_region_list($theme_key, REGIONS_VISIBLE);
$variables['block_regions'] = $block_regions + array(BLOCK_REGION_NONE => t('Disabled'));
foreach ($block_regions as $key => $value) {
diff --git a/modules/block/block.module b/modules/block/block.module
index 3ceeb9625..f561685b9 100644
--- a/modules/block/block.module
+++ b/modules/block/block.module
@@ -236,10 +236,11 @@ function block_page_alter($page) {
drupal_theme_initialize();
// Populate all block regions
- $regions = system_region_list($theme);
+ $all_regions = system_region_list($theme);
+ $visible_regions = system_region_list($theme, REGIONS_VISIBLE);
// Load all region content assigned via blocks.
- foreach (array_keys($regions) as $region) {
+ foreach (array_keys($all_regions) as $region) {
// Prevent left and right regions from rendering blocks when 'show_blocks' == FALSE.
if (!empty($page['#show_blocks']) || ($region != 'left' && $region != 'right')) {
// Assign blocks to region.
@@ -249,8 +250,8 @@ function block_page_alter($page) {
// Append region description if we are rendering the block admin page.
$item = menu_get_item();
- if ($item['path'] == 'admin/build/block') {
- $description = '<div class="block-region">' . $regions[$region] . '</div>';
+ if ($item['path'] == 'admin/build/block' && isset($visible_regions[$region])) {
+ $description = '<div class="block-region">' . $all_regions[$region] . '</div>';
$page[$region]['block_description'] = array(
'#markup' => $description,
'#weight' => 15,