function _block_class_styles_theme_hook_suggestion in Block Class Styles 7.2
Same name and namespace in other branches
- 7 block_class_styles.module \_block_class_styles_theme_hook_suggestion()
Return the theme_hook_suggestion for a style
Parameters
string $style:
Return value
string
Related topics
2 calls to _block_class_styles_theme_hook_suggestion()
- block_class_styles_admin_settings in ./
block_class_styles.admin.inc - Form builder. Configure my_module.
- block_class_styles_preprocess_block in ./
block_class_styles.module - Implements hook_preprocess_block().
File
- ./
block_class_styles.module, line 460 - Base module file for block_class_styles
Code
function _block_class_styles_theme_hook_suggestion($style) {
static $drupal_static_fast;
if (!isset($drupal_static_fast)) {
$drupal_static_fast['hooks'] =& drupal_static(__FUNCTION__, NULL);
}
$hooks =& $drupal_static_fast['hooks'];
if (!isset($hooks[$style])) {
$suggestions = array();
$suggestions[] = 'block__' . strtolower(str_replace('-', '_', drupal_clean_css_identifier($style)));
if ($classes = block_class_styles_get_css_by_style($style)) {
do {
$hook = implode('__', $classes);
$suggestions[] = 'block__' . strtolower(str_replace('-', '_', drupal_html_class($hook)));
} while (array_pop($classes) && $classes);
}
$hooks[$style] = array_unique($suggestions);
}
return $hooks[$style];
}