You are here

function rb_block_block_list in Rules Bonus Pack 7

Helper function that builds a select list of all blocks on the site.

1 string reference to 'rb_block_block_list'
rb_block_rules_action_info in ./rb_block.rules.inc
Implements hook_rules_action_info().

File

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

Code

function rb_block_block_list() {

  // Get the list of blocks.
  global $theme;
  $path = drupal_get_path('module', 'block') . '/block.admin.inc';
  include_once $path;
  $blocks = block_admin_display_prepare_blocks($theme);

  // Format the list as a nice select array, with module and delta as keys.
  $select_list = array();
  foreach ($blocks as $block) {
    $select_list[$block['module'] . '||' . $block['delta']] = $block['info'];
  }
  return $select_list;
}