function blockreference_get_block_modules in Block reference 7
Same name and namespace in other branches
- 6 blockreference.module \blockreference_get_block_modules()
Get an array of block modules, where the keys are the module short name and the values are the module name as set in the .info file.
1 call to blockreference_get_block_modules()
- blockreference_field_settings_form in ./
blockreference.module - Implements hook_field_settings_form().
File
- ./
blockreference.module, line 95 - Defines a field type for referencing a block from a node.
Code
function blockreference_get_block_modules() {
$block_modules = array();
// Get current list of modules
$files = drupal_system_listing('/^' . DRUPAL_PHP_FUNCTION_PATTERN . '\\.module$/', 'modules', 'name', 0);
// Get modules that define blocks.
$modules = module_implements('block_info', TRUE);
foreach ($modules as $module) {
if (isset($files[$module])) {
$file =& $files[$module];
// Look for the info file.
$file->info = drupal_parse_info_file(dirname($file->uri) . '/' . $file->name . '.info');
$block_modules[$module] = isset($file->info['name']) ? $file->info['name'] : ucfirst($module);
}
}
return $block_modules;
}