system_region_list

Versions
4.7 – 6
system_region_list($theme_key)
7
system_region_list($theme_key, $show = REGIONS_ALL)

Get a list of available regions from a specified theme.

Parameters

$theme_key The name of a theme.

$show Possible values: REGIONS_ALL or REGIONS_VISIBLE. Visible excludes hidden regions.

Return value

An array of regions in the form $region['name'] = 'description'.

▾ 9 functions call system_region_list()

block_admin_display_form in modules/block/block.admin.inc
Generate main blocks administration form.
block_page_build in modules/block/block.module
Implement hook_page_build().
block_theme_initialize in modules/block/block.module
Assign an initial, default set of blocks for a theme.
system_default_region in modules/system/system.module
Get the name of the default region for a given theme.
system_page_build in modules/system/system.module
Implement hook_page_build().
template_preprocess_block_admin_display_form in modules/block/block.admin.inc
Process variables for block-admin-display.tpl.php.
template_preprocess_page in includes/theme.inc
Preprocess variables for page.tpl.php
_block_compare in modules/block/block.admin.inc
Helper function for sorting blocks on admin/structure/block.
_block_rehash in modules/block/block.module
Update the 'block' DB table with the blocks currently exported by modules.

Code

modules/system/system.module, line 2379

<?php
function system_region_list($theme_key, $show = REGIONS_ALL) {
  $list = &drupal_static(__FUNCTION__, array());

  if (empty($list[$theme_key][$show])) {
    $themes = list_themes();
    $info = $themes[$theme_key]->info;
    // If requested, suppress hidden regions. @see block_admin_display_form().
    foreach ($info['regions'] as $name => $label) {
      if ($show == REGIONS_ALL || !isset($info['regions_hidden']) || !in_array($name, $info['regions_hidden'])) {
        $list[$theme_key][$show][$name] = $label;
      }
    }
  }
  return $list[$theme_key][$show];
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.