You are here

function esi__theme_blocks in ESI: Edge Side Includes 6.2

Replacement for core theme function: thene_blocks

1 string reference to 'esi__theme_blocks'
esi_theme_registry_alter in ./esi.module
Implementation of hook_theme_registry_alter(). Override theme('blocks') to apply our ESI handler.

File

./esi.theme.inc, line 11
Theme handlers for the ESI module.

Code

function esi__theme_blocks($region) {
  $output = '';

  // load our helper file.
  require_once drupal_get_path('module', 'esi') . '/esi.inc';
  if ($list = block_list($region)) {
    foreach ($list as $key => $block) {

      // if ESI's enabled on the block, add an ESI tag instead of block content.
      $config = esi_get_settings($block->module . '_' . $block->delta);
      $output .= $config['scope'] && variable_get('esi_mode', ESI_MODE) ? theme('esi_tag', 'block', $block) : theme('block', $block);
    }
  }

  // Add any content assigned to this region through drupal_set_content() calls.
  $output .= drupal_get_content($region);
  return $output;
}