You are here

function _blockreference_options in Block reference 7.2

Helper to make pretty options from block objects.

2 calls to _blockreference_options()
blockreference_autocomplete in ./blockreference.module
Menu callback for the autocomplete results.
blockreference_options_list in ./blockreference.module
Implements hook_options_list().

File

./blockreference.module, line 374

Code

function _blockreference_options($blocks, $ac_style = FALSE) {
  $options = array();
  foreach ($blocks as $block) {
    $moddelta = $block->module . ':' . $block->delta;
    $label = $block->info;
    $value = $ac_style ? _blockreference_block_string($block) : $moddelta;
    $options[$value] = $label;
  }
  return $options;
}