diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-10-05 02:43:01 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-10-05 02:43:01 +0000 |
commit | 93eb8b341392b5a04488d0d3a0a9d8136da6a2cf (patch) | |
tree | c89749ab99ae2c368be24221b4603a9d4886f69e /includes | |
parent | 03f9a31663c2aa8e1e62f7c8ee8d8eefbb1444db (diff) | |
download | brdo-93eb8b341392b5a04488d0d3a0a9d8136da6a2cf.tar.gz brdo-93eb8b341392b5a04488d0d3a0a9d8136da6a2cf.tar.bz2 |
#60552 by JohnAlbin: Added Add region.tpl.php for all regions in themes.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/common.inc | 4 | ||||
-rw-r--r-- | includes/theme.inc | 19 |
2 files changed, 23 insertions, 0 deletions
diff --git a/includes/common.inc b/includes/common.inc index e6630ca79..ba1218d46 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -4808,6 +4808,10 @@ function drupal_common_theme() { 'install_page' => array( 'arguments' => array('content' => NULL), ), + 'region' => array( + 'arguments' => array('elements' => NULL), + 'template' => 'region', + ), 'task_list' => array( 'arguments' => array('items' => NULL, 'active' => NULL), ), diff --git a/includes/theme.inc b/includes/theme.inc index 73fdf8575..20571c178 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -2404,3 +2404,22 @@ function template_preprocess_maintenance_page(&$variables) { $variables['template_file'] = 'maintenance-page-offline'; } } + +/** + * Preprocess variables for region.tpl.php + * + * Prepare the values passed to the theme_region function to be passed into a + * pluggable template engine. Uses the region name to generate a template file + * suggestions. If none are found, the default region.tpl.php is used. + * + * @see region.tpl.php + */ +function template_preprocess_region(&$variables) { + // Create the $content variable that templates expect. + $variables['content'] = $variables['elements']['#children']; + $variables['region'] = $variables['elements']['#region']; + + $region = 'region-' . str_replace('_', '-', $variables['region']); + $variables['classes_array'][] = $region; + $variables['template_files'][] = $region; +} |