You are here

rb_block.module in Rules Bonus Pack 7

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

File

rb_block.module
View source
<?php

/**
 * @file
 * The most basic parts of the Rules mechanisms for affecting blocks goes here.
 */
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]);
    }
  }
}

Functions

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