function ctools_page_alter

Implements hook_page_alter().

Last ditch attempt to remove sidebar regions if the "no blocks" functionality has been activated.

See also

ctools_block_list_alter()

File

./ctools.module, line 803

Code

function ctools_page_alter(&$page) {
    $check = drupal_static('ctools_set_no_blocks', TRUE);
    if (!$check) {
        foreach ($page as $region_id => $region) {
            // @todo -- possibly we can set configuration for this so that users can
            // specify which blocks will not get rendered.
            if (strpos($region_id, 'sidebar') !== FALSE) {
                unset($page[$region_id]);
            }
        }
    }
    $page['#post_render'][] = 'ctools_page_token_processing';
}