summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-08-11 20:18:28 +0000
committerDries Buytaert <dries@buytaert.net>2009-08-11 20:18:28 +0000
commit36e082ba9165d6583ccbf64fd5441ddc3986693b (patch)
tree138ac1045daaddf9cc9b9045965abb20539aa766 /modules
parent9a34f7a1c2036e0e31e105cbfe6015216561f672 (diff)
downloadbrdo-36e082ba9165d6583ccbf64fd5441ddc3986693b.tar.gz
brdo-36e082ba9165d6583ccbf64fd5441ddc3986693b.tar.bz2
- Patch #541686 by catch: unnecessary query in block_page_alter().
Diffstat (limited to 'modules')
-rw-r--r--modules/block/block.module16
1 files changed, 9 insertions, 7 deletions
diff --git a/modules/block/block.module b/modules/block/block.module
index 48171affa..91f71211b 100644
--- a/modules/block/block.module
+++ b/modules/block/block.module
@@ -237,7 +237,6 @@ function block_page_alter($page) {
// Populate all block regions
$all_regions = system_region_list($theme);
- $visible_regions = system_region_list($theme, REGIONS_VISIBLE);
// Load all region content assigned via blocks.
foreach (array_keys($all_regions) as $region) {
@@ -250,12 +249,15 @@ function block_page_alter($page) {
// Append region description if we are rendering the block admin page.
$item = menu_get_item();
- if ($item['path'] == 'admin/structure/block' && isset($visible_regions[$region])) {
- $description = '<div class="block-region">' . $all_regions[$region] . '</div>';
- $page[$region]['block_description'] = array(
- '#markup' => $description,
- '#weight' => 15,
- );
+ if ($item['path'] == 'admin/structure/block') {
+ $visible_regions = system_region_list($theme, REGIONS_VISIBLE);
+ if (isset($visible_regions[$region])) {
+ $description = '<div class="block-region">' . $all_regions[$region] . '</div>';
+ $page[$region]['block_description'] = array(
+ '#markup' => $description,
+ '#weight' => 15,
+ );
+ }
}
}
}