diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-07-18 02:36:01 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-07-18 02:36:01 +0000 |
commit | fec2710a44d69ed84e6fc0ec25f78d5c93d30125 (patch) | |
tree | e36b4f1c7a0041fb612043671f4f027681fd7dad /modules/system | |
parent | fb0c7c6df7db1c528237aa07bd094339b1dee55a (diff) | |
download | brdo-fec2710a44d69ed84e6fc0ec25f78d5c93d30125.tar.gz brdo-fec2710a44d69ed84e6fc0ec25f78d5c93d30125.tar.bz2 |
- Patch #511284 by catch, moshe weitzman: add html_top and move the admin toolbar into html_top.
Diffstat (limited to 'modules/system')
-rw-r--r-- | modules/system/system.module | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/modules/system/system.module b/modules/system/system.module index ccfce5370..35a302235 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -72,6 +72,17 @@ define('DRUPAL_OPTIONAL', 1); define('DRUPAL_REQUIRED', 2); /** + * Return only visible regions. @see system_region_list(). + */ +define('REGIONS_VISIBLE', 'visible'); + +/** + * Return all visible regions. @see system_region_list(). + */ +define('REGIONS_ALL', 'all'); + + +/** * Implement hook_help(). */ function system_help($path, $arg) { @@ -1974,18 +1985,34 @@ function system_find_base_theme($themes, $key, $used_keys = array()) { * * @param $theme_key * The name of a theme. + * @param $show + * Possible values: REGIONS_ALL or REGIONS_VISIBLE. Visible excludes hidden + * regions. * @return * An array of regions in the form $region['name'] = 'description'. */ -function system_region_list($theme_key) { +function system_region_list($theme_key, $show = REGIONS_ALL) { $list = &drupal_static(__FUNCTION__, array()); - if (!array_key_exists($theme_key, $list)) { + if (empty($list[$theme_key][$show])) { $info = unserialize(db_query("SELECT info FROM {system} WHERE type = :type AND name = :name", array(':type' => 'theme', ':name' => $theme_key))->fetchField()); - $list[$theme_key] = array_map('t', $info['regions']); + // 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]; +} - return $list[$theme_key]; +/** + * Implement hook_system_info_alter(). + */ +function system_system_info_alter(&$info, $file) { + // Remove page-top from the blocks UI since it is reserved for modules to + // populate from outside the blocks system. + $info['regions_hidden'][] = 'page_top'; } /** |