You are here

function autodialog_block_list_alter in Auto-Dialog 7

Implements hook_block_list_alter().

File

./autodialog.module, line 235

Code

function autodialog_block_list_alter(&$blocks) {
  global $language, $theme_key;
  if (!_autodialog_check_request() || variable_get('autodialog_source', 'block') != 'block') {
    return;
  }
  foreach ($blocks as $key => $block) {

    // Any module using this alter should inspect the data before changing it,
    // to ensure it is what they expect.
    if (!isset($block->theme) || !isset($block->status) || $block->theme != $theme_key || $block->status != 1) {

      // This block was added by a contrib module, leave it in the list.
      continue;
    }
    if ($block->module != 'system' && $block->delta != 'main') {
      unset($blocks[$key]);
    }
  }
}