summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Siemssen2011-04-20 11:29:18 (GMT)
committer Sebastian Siemssen2011-04-20 11:29:18 (GMT)
commitd8758977600dd646083a6bce5b0ba70fbd558cd8 (patch)
tree4ac4e1dcef9da869737b2e050239b42f5ad4d89a
parent15e006fc647176ff6b964c4bc3866096dde5dc92 (diff)
Improved preprocess_page slightly.
-rw-r--r--alpha/preprocess/preprocess-page.inc38
1 files changed, 18 insertions, 20 deletions
diff --git a/alpha/preprocess/preprocess-page.inc b/alpha/preprocess/preprocess-page.inc
index e34e9e2..9d3a0d1 100644
--- a/alpha/preprocess/preprocess-page.inc
+++ b/alpha/preprocess/preprocess-page.inc
@@ -13,28 +13,26 @@ function alpha_alpha_preprocess_page(&$vars) {
$zone_regions = array();
foreach ($regions as $region => $item) {
- if ($item['enabled']) {
- if (!empty($vars['page'][$region]) || $settings['debug']['block']) {
- $zone_regions[$item['zone']][$region] = $vars['page'][$region];
- $zone_regions[$item['zone']][$region]['#region'] = $region;
- $zone_regions[$item['zone']][$region]['#data'] = $item;
- $zone_regions[$item['zone']][$region]['#page'] = &$vars;
- $zone_regions[$item['zone']][$region]['#sorted'] = FALSE;
- $zone_regions[$item['zone']][$region]['#weight'] = (int) $item['weight'];
-
- if ($settings['debug']['block']) {
- $zone_regions[$item['zone']][$region]['alpha_debug_'. $region] = alpha_debug_block($region, $item['name']);
- $zone_regions[$item['zone']][$region]['#theme_wrappers'] = array('region');
- }
-
- $children = element_children($zone_regions[$item['zone']][$region]);
- if (!empty($children)) {
- $zone_regions[$item['zone']][$region][array_pop($children)]['#block']->last = TRUE;
- }
+ if ($item['enabled'] && (!empty($vars['page'][$region]) || $settings['debug']['block'])) {
+ $zone_regions[$item['zone']][$region] = $vars['page'][$region];
+ $zone_regions[$item['zone']][$region]['#region'] = $region;
+ $zone_regions[$item['zone']][$region]['#data'] = $item;
+ $zone_regions[$item['zone']][$region]['#page'] = &$vars;
+ $zone_regions[$item['zone']][$region]['#sorted'] = FALSE;
+ $zone_regions[$item['zone']][$region]['#weight'] = (int) $item['weight'];
+
+ if ($settings['debug']['block']) {
+ $zone_regions[$item['zone']][$region]['alpha_debug_'. $region] = alpha_debug_block($region, $item['name']);
+ $zone_regions[$item['zone']][$region]['#theme_wrappers'] = array('region');
}
- unset($vars['page'][$region]);
- }
+ $children = element_children($zone_regions[$item['zone']][$region]);
+ if (!empty($children)) {
+ $zone_regions[$item['zone']][$region][array_pop($children)]['#block']->last = TRUE;
+ }
+ }
+
+ unset($vars['page'][$region]);
}
foreach ($zones as $zone => $item) {