8.5.x system.module system_region_list($theme, $show = REGIONS_ALL)
8.0.x system.module system_region_list($theme, $show = REGIONS_ALL)
8.1.x system.module system_region_list($theme, $show = REGIONS_ALL)
8.2.x system.module system_region_list($theme, $show = REGIONS_ALL)
8.3.x system.module system_region_list($theme, $show = REGIONS_ALL)
8.4.x system.module system_region_list($theme, $show = REGIONS_ALL)
8.6.x system.module system_region_list($theme, $show = REGIONS_ALL)
4.7.x system.module system_region_list($theme_key)
5.x system.module system_region_list($theme_key)
6.x system.module system_region_list($theme_key)
7.x system.module system_region_list($theme_key, $show = REGIONS_ALL, $labels = TRUE)

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.

bool $labels: (optional) Boolean to specify whether the human readable machine names should be returned or not. Defaults to TRUE, but calling code can set this to FALSE for better performance, if it only needs machine names.

Return value

array An associative array of regions in the form $region['name'] = 'description' if $labels is set to TRUE, or $region['name'] = 'name', if $labels is set to FALSE.

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

... See full list

File

modules/system/system.module, line 2728
Configuration system that lets administrators modify the workings of the site.

Code

function system_region_list($theme_key, $show = REGIONS_ALL, $labels = TRUE) {
  $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'])) {
      if ($labels) {
        $list[$name] = t($label);
      }
      else {
        $list[$name] = $name;
      }
    }
  }
  return $list;
}