function _insert_block_roles in Insert Block 6
Same name and namespace in other branches
- 7 insert_block.module \_insert_block_roles()
 
Helper function to load and cache the block roles.
1 call to _insert_block_roles()
File
- ./
insert_block.module, line 133  - Insert blocks into the body of a node
 
Code
function _insert_block_roles() {
  // Build an array of roles for each block.
  static $block_roles;
  if (!isset($block_roles)) {
    $block_roles = array();
    $result = db_query('SELECT module, delta, rid FROM {blocks_roles}');
    while ($record = db_fetch_object($result)) {
      $block_roles[$record->module][$record->delta][] = $record->rid;
    }
  }
  return $block_roles;
}