You are here

function blocktheme_preprocess_block in Block Theme 8

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

Implements hook_preprocess_block().

File

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

Code

function blocktheme_preprocess_block(&$variables) {
  $form_id = $variables['elements']['#id'];
  if ($custom_block_vars = blocktheme_get_theme_vars($form_id)) {
    $variables['blocktheme'] = blocktheme_get_theme($form_id);
    $variables['blocktheme_vars'] = $custom_block_vars;
    $variables['attributes']['class'][] = blocktheme_get_theme($form_id);
  }
}