function panels_admin_content_types_block in Panels 5.2
Same name and namespace in other branches
- 6.2 content_types/block.inc \panels_admin_content_types_block()
Return all block content types available.
Modules wanting to make special adjustments the way that panels handles their blocks can implement an extension to the hook_block() family, where the function name is of the form "$module . '_panels_block_info'".
1 string reference to 'panels_admin_content_types_block'
- panels_block_panels_content_types in content_types/
block.inc - Callback function to supply a list of content types.
File
- content_types/
block.inc, line 91
Code
function panels_admin_content_types_block() {
$types = array();
foreach (module_list() as $module) {
$module_blocks = module_invoke($module, 'block', 'list');
if ($module_blocks) {
foreach ($module_blocks as $delta => $block) {
// strip_tags used because it goes through check_plain and that
// just looks bad.
$info = array(
'title' => strip_tags($block['info']),
);
// Ask around for further information by invoking the hook_block() extension.
$function = $module . '_panels_block_info';
if (!function_exists($function)) {
$function = 'panels_default_block_info';
}
$function($module, $delta, $info);
// this check means modules can remove their blocks; particularly useful
// if they offer the block some other way (like we do for views)
if ($info) {
$types["{$module}-{$delta}"] = $info;
}
}
}
}
return $types;
}