function adaptivetheme_process_block

cis7 process.inc adaptivetheme_process_block(&$vars)
cle7 process.inc adaptivetheme_process_block(&$vars)
elmsmedia7 process.inc adaptivetheme_process_block(&$vars)
icor7 process.inc adaptivetheme_process_block(&$vars)
meedjum_blog7 process.inc adaptivetheme_process_block(&$vars)
mooc7 process.inc adaptivetheme_process_block(&$vars)

Process variables for block.tpl.php

File

sites/all/themes/ulmus/adaptivetheme/at_core/inc/process.inc, line 137
All Process functions for templates and theme fucntions.

Code

function adaptivetheme_process_block(&$vars) {
  // Now we know all the block $tag's, we can generate our wrapper, $tag is
  // set in preprocess. We cant introduce these in preprocess due to attributes
  // and classes not being flattened untill we hit process.
  $vars['outer_prefix'] = '<' . $vars['tag'] . ' id="' . $vars['block_html_id'] . '" class="' . $vars['classes'] . '" ' . $vars['attributes'] . '>';
  $vars['outer_suffix'] = '</' . $vars['tag'] . '>';

  // Block inner attributes
  $vars['block_inner_attributes'] = empty($vars['block_inner_attributes_array']) ? '' : drupal_attributes($vars['block_inner_attributes_array']);

  // Populate the default inner wrappers
  $vars['inner_prefix'] = '<div' . $vars['block_inner_attributes'] . '>';
  $vars['inner_suffix'] = '</div>';

  // Wrap the content variable in a div with attributes
  $vars['content_processed'] = '<div' . $vars['content_attributes'] . '>' . $vars['content'] . '</div>';

  // The menu bar region gets special treatment for the block template
  if ($vars['block']->region === 'menu_bar') {
    $vars['inner_prefix'] = '';
    $vars['inner_suffix'] = '';
    $vars['content_processed'] = $vars['content']; // remove the default wrapper
  }
  // Navigation or menu blocks get special treatment in these regions
  if ($vars['block']->region === 'leaderboard' || $vars['block']->region === 'header') {
    if ($vars['tag'] == 'nav') {
      $vars['content_processed'] = $vars['content']; // remove the default wrapper
    }
  }

  // Some blocks look bad with wrappers so we strip them
  if ($vars['block']->region === 'content') {
    $vars['inner_prefix'] = '';
    $vars['inner_suffix'] = '';
    $vars['content_processed'] = $vars['content'];
  }
  if ($vars['block']->module === 'panels_mini') {
    $vars['inner_prefix'] = '';
    $vars['inner_suffix'] = '';
  }

  // Provide additional suggestions so the block__menu suggestion can be overridden easily
  $vars['theme_hook_suggestions'][] = 'block__' . $vars['block']->region . '__' . $vars['block']->module;
  $vars['theme_hook_suggestions'][] = 'block__' . $vars['block']->region . '__' . $vars['block']->delta;
}