You are here

function spaces_dashboard_block_access in Spaces 6.3

Same name and namespace in other branches
  1. 7.3 spaces_dashboard/spaces_dashboard.module \spaces_dashboard_block_access()
  2. 7 spaces_dashboard/spaces_dashboard.module \spaces_dashboard_block_access()

Determine whether this block is accessible for use with the dashboard. Modules should implement hook_spaces_dashboard_block_access_alter() if they would like to implement more complex rules for dashboard block access.

Parameters

$block: A block object with at least the ->module & ->delta properties.

Return value

TRUE if the block may be used. FALSE otherwise.

1 call to spaces_dashboard_block_access()
spaces_dashboard_preprocess_context_block_browser in spaces_dashboard/spaces_dashboard.module
Preprocessor for theme('context_block_browser').

File

spaces_dashboard/spaces_dashboard.module, line 414

Code

function spaces_dashboard_block_access($block, $reset = FALSE) {
  static $access;
  if ((!isset($access) || $reset) && ($plugin = context_get_plugin('reaction', 'block'))) {
    $blocks = $plugin
      ->get_blocks();
    $access = array_fill_keys(array_keys($blocks), 0);
    $access = array_merge($access, variable_get('spaces_dashboard_blocks', array()));
    drupal_alter('spaces_dashboard_block_access', $access);
  }
  return isset($access[$block->bid]) ? (bool) $access[$block->bid] : FALSE;
}