Skip to content

Commit

Permalink
Cache $dropdown_regions array in region preprocess function.
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdicarlo committed Sep 29, 2010
1 parent 2eb19ed commit 153d8fc
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions os_base.module
Expand Up @@ -137,8 +137,13 @@ function os_base_theme_registry_alter(&$theme_registry) {
* Preprocess Zen regions: assign "dropdown-blocks" class to region(s).
*/
function os_base_preprocess_region(&$vars) {
$dropdown_regions = array('header');
drupal_alter('os_base_dropdown_regions_alter', $dropdown_regions);
// determine which regions to use (but just once)
static $dropdown_regions = NULL;
if (!$dropdown_regions) {
$dropdown_regions = array('header');
drupal_alter('os_base_dropdown_regions_alter', $dropdown_regions);
}

if (in_array($vars['region'], $dropdown_regions)) {
$vars['classes_array'][] = 'dropdown-blocks';
}
Expand Down

0 comments on commit 153d8fc

Please sign in to comment.