You are here

function ctools_block_list_alter in Chaos Tool Suite (ctools) 7

Implements hook_block_list_alter().

Used to potentially remove blocks. This exists in order to replicate Drupal 6's "no blocks" functionality.

File

./ctools.module, line 1077
CTools primary module file.

Code

function ctools_block_list_alter(&$blocks) {
  $check = drupal_static('ctools_set_no_blocks', TRUE);
  if (!$check) {
    foreach ($blocks as $block_id => $block) {

      // @todo -- possibly we can set configuration for this so that users can
      // specify which blocks will not get rendered.
      if (strpos($block->region, 'sidebar') !== FALSE) {
        unset($blocks[$block_id]);
      }
    }
  }
}