You are here

function _blockreference_get_block_modules in Block reference 7.2

Return options list of modules that provide blocks, keyed by module machine name.

1 call to _blockreference_get_block_modules()
blockreference_field_instance_settings_form in ./blockreference.field.inc
Implements hook_field_instance_settings_form().

File

./blockreference.module, line 275

Code

function _blockreference_get_block_modules() {
  $modules =& drupal_static(__FUNCTION__);
  if (!$modules) {

    // Get modules that define blocks.
    $modules = module_implements('block_info');
    $modules = array_flip($modules);

    // And get their pretty names.
    $all_modules = system_list('module_enabled');
    foreach ($modules as $machine_name => $foo) {
      $modules[$machine_name] = @$all_modules[$machine_name]->info['name'] ?: $machine_name;
    }
    natcasesort($modules);
  }
  return $modules;
}