function system_region_list

7.x system.module system_region_list($theme_key, $show = REGIONS_ALL)
6.x system.module system_region_list($theme_key)

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'.

12 calls to system_region_list()
block_admin_configure in drupal-7.x/modules/block/block.admin.inc
Form constructor for the block configuration form.
block_admin_display_form in drupal-7.x/modules/block/block.admin.inc
Form constructor for the main block administration form.
block_page_build in drupal-7.x/modules/block/block.module
Implements hook_page_build().
block_theme_initialize in drupal-7.x/modules/block/block.module
Assigns an initial, default set of blocks for a theme.
dashboard_admin_blocks in drupal-7.x/modules/dashboard/dashboard.module
Page callback: Builds the page for administering dashboard blocks.

... See full list

File

drupal-7.x/modules/system/system.module, line 2689
Configuration system that lets administrators modify the workings of the site.

Code

function system_region_list($theme_key, $show = REGIONS_ALL) {
  $themes = list_themes();
  if (!isset($themes[$theme_key])) {
    return array();
  }

  $list = array();
  $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[$name] = t($label);
    }
  }

  return $list;
}