Issue #2012836 by tim.plunkett: Replace drupal_region_class() with direct calls to drupal_html_class().

8.0.x
Nathaniel Catchpole 2013-06-11 15:19:03 +01:00
parent 4d85fa44a3
commit 60a1055049
3 changed files with 2 additions and 25 deletions

View File

@ -2790,28 +2790,6 @@ function drupal_html_id($id) {
return $id; return $id;
} }
/**
* Provides a standard HTML class name that identifies a page region.
*
* It is recommended that template preprocess functions apply this class to any
* page region that is output by the theme (Drupal core already handles this in
* the standard template preprocess implementation). Standardizing the class
* names in this way allows modules to implement certain features, such as
* drag-and-drop or dynamic Ajax loading, in a theme-independent way.
*
* @param $region
* The name of the page region (for example, 'page_top' or 'content').
*
* @return
* An HTML class that identifies the region (for example, 'region-page-top'
* or 'region-content').
*
* @see template_preprocess_region()
*/
function drupal_region_class($region) {
return drupal_html_class("region-$region");
}
/** /**
* Adds a JavaScript file, setting, or inline code to the page. * Adds a JavaScript file, setting, or inline code to the page.
* *

View File

@ -3098,7 +3098,6 @@ function template_process_maintenance_page(&$variables) {
* pluggable template engine. Uses the region name to generate a template file * pluggable template engine. Uses the region name to generate a template file
* suggestions. If none are found, the default region.tpl.php is used. * suggestions. If none are found, the default region.tpl.php is used.
* *
* @see drupal_region_class()
* @see region.tpl.php * @see region.tpl.php
*/ */
function template_preprocess_region(&$variables) { function template_preprocess_region(&$variables) {
@ -3107,7 +3106,7 @@ function template_preprocess_region(&$variables) {
$variables['region'] = $variables['elements']['#region']; $variables['region'] = $variables['elements']['#region'];
$variables['attributes']['class'][] = 'region'; $variables['attributes']['class'][] = 'region';
$variables['attributes']['class'][] = drupal_region_class($variables['region']); $variables['attributes']['class'][] = drupal_html_class('region-' . $variables['region']);
$variables['theme_hook_suggestions'][] = 'region__' . $variables['region']; $variables['theme_hook_suggestions'][] = 'region__' . $variables['region'];
} }

View File

@ -875,7 +875,7 @@ function overlay_store_rendered_content($id = NULL, $content = NULL) {
* @see Drupal.overlay.refreshRegions() * @see Drupal.overlay.refreshRegions()
*/ */
function overlay_request_refresh($region) { function overlay_request_refresh($region) {
$class = drupal_region_class($region); $class = drupal_html_class("region-$region");
$_SESSION['overlay_regions_to_refresh'][] = array($class => $region); $_SESSION['overlay_regions_to_refresh'][] = array($class => $region);
} }