function ctools_block_list_alter

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

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]);
            }
        }
    }
}