diff options
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; +} |