You are here

function rb_block_action_disable_block in Rules Bonus Pack 7

The 'rb_block_action_disable_block' action.

File

./rb_block.rules.inc, line 131
Rules actions to more or disable a Drupal block. Plus some helper functions.

Code

function rb_block_action_disable_block($block) {

  // Get block information.
  $block_info = explode('||', $block);
  $disabled_block = block_load($block_info[0], $block_info[1]);

  // Add the disabled block to a list in Drupal static, to allow it to be found
  // from hook_block_list_alter.
  $disabled_blocks =& drupal_static('rb_block_disabled');
  $disabled_blocks[$disabled_block->bid] = $disabled_block;
}