You are here

function blocktheme_preprocess_block in Block Theme 7

Same name and namespace in other branches
  1. 8 blocktheme.module \blocktheme_preprocess_block()
  2. 6 blocktheme.module \blocktheme_preprocess_block()

Implements hook_preprocess_block().

File

./blocktheme.module, line 318
Provides a configuration option to select custom themes for blocks

Code

function blocktheme_preprocess_block(&$variables) {
  if ($custom_block_theme = blocktheme_get_theme($variables['block'])) {
    $variables['blocktheme'] = $custom_block_theme;
    $variables['classes_array'][] = $custom_block_theme;
    $variables['theme_hook_suggestions'][] = 'block__blocktheme__' . str_replace('-', '_', $custom_block_theme);
  }
  if ($custom_block_vars = blocktheme_get_theme_vars($variables['block'])) {
    $variables['blocktheme_vars'] = $custom_block_vars;
  }
}