diff options
Diffstat (limited to 'includes/common.inc')
-rw-r--r-- | includes/common.inc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/includes/common.inc b/includes/common.inc index e22ce998a..9f8b6a66b 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -3591,6 +3591,28 @@ function drupal_html_id($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"); +} + +/** * Add a JavaScript file, setting or inline code to the page. * * The behavior of this function depends on the parameters it is called with. |