You are here

function clean_markup_blocks_process_block in Clean Markup 7.2

Same name and namespace in other branches
  1. 7.3 modules/clean_markup_blocks/clean_markup_blocks.module \clean_markup_blocks_process_block()

Implements MODULE_process_HOOK().

File

modules/clean_markup_blocks/clean_markup_blocks.module, line 287
Provides clean block markup.

Code

function clean_markup_blocks_process_block(&$vars) {

  // Only output a title if one is set.
  if ($vars['block']->subject) {

    // Render title prefix and suffix.
    $vars['title']['#prefix'] = render($vars['title_prefix']);
    $vars['title']['#suffix'] = render($vars['title_suffix']);

    // Core's block.tpl.php assumes the block subject is a string. While this is
    // a different variable entirely, it's worth being consistent.
    $vars['title'] = render($vars['title']);
  }
  else {
    $vars['title'] = '';
  }

  // Core's block.tpl.php assumes the content is a string (it doesn't call
  // render() on it). Even though we're overriding that tpl file, it's worth
  // being consistent.
  $vars['content'] = render($vars['content']);
}