You are here

function _insert_block_roles in Insert Block 7

Same name and namespace in other branches
  1. 6 insert_block.module \_insert_block_roles()

Helper function to load and cache the block roles.

1 call to _insert_block_roles()
_insert_block in ./insert_block.module

File

./insert_block.module, line 108
Insert blocks into the body of a node

Code

function _insert_block_roles() {

  // Build an array of roles for each block.
  $block_roles =& drupal_static(__FUNCTION__, NULL);
  if (!isset($block_roles)) {
    $block_roles = array();
    $result = db_query('SELECT module, delta, rid FROM {block_role}');
    foreach ($result as $record) {
      $block_roles[$record->module][$record->delta][] = $record->rid;
    }
  }
  return $block_roles;
}