function system_region_list

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

11 calls to system_region_list()
block_admin_configure in drupal/core/modules/block/block.admin.inc
Form constructor for the block configuration form.
block_admin_display_form in drupal/core/modules/block/block.admin.inc
Form constructor for the main block administration form.
block_page_build in drupal/core/modules/block/block.module
Implements hook_page_build().
block_theme_initialize in drupal/core/modules/block/block.module
Assigns an initial, default set of blocks for a theme.
InfoAlterTest::testSystemInfoAlter in drupal/core/modules/system/lib/Drupal/system/Tests/System/InfoAlterTest.php
Tests that theme .info data is rebuild after enabling a module.

... See full list

File

drupal/core/modules/system/system.module, line 3084
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;
}