You are here

function rb_block_block_list_alter in Rules Bonus Pack 7

@file The most basic parts of the Rules mechanisms for affecting blocks goes here.

File

./rb_block.module, line 8
The most basic parts of the Rules mechanisms for affecting blocks goes here.

Code

function rb_block_block_list_alter(&$blocks) {

  // Get any blocks added or modified by Rules Bons: Block.
  $modified_blocks =& drupal_static('rb_block_blocks', array());
  $disabled_blocks =& drupal_static('rb_block_disabled', array());

  // Add/change the modified blocks.
  $blocks = $modified_blocks + $blocks;

  // Remove the disabled blocks.
  foreach ($disabled_blocks as $key => $block) {
    if (isset($blocks[$key])) {
      unset($blocks[$key]);
    }
  }
}