--- plugins/content_types/block/block.inc.orig 2010-03-04 13:16:31.000000000 -0600 +++ plugins/content_types/block/block.inc 2010-07-15 17:56:51.000000000 -0500 @@ -19,10 +19,22 @@ function ctools_block_ctools_content_typ // And this is just the administrative title. // All our callbacks are named according to the standard pattern and can be deduced. 'title' => t('Block'), + 'content type' => 'ctools_block_content_type_content_type', ); } /** + * Return the block content types with the specified $subtype_id. + */ +function ctools_block_content_type_content_type($subtype_id) { + list($module, $delta) = explode('-', $subtype_id, 2); + $module_blocks = module_invoke($module, 'block', 'list'); + if (isset($module_blocks[$delta])) { + return _ctools_block_content_type_content_type($module, $delta, $module_blocks[$delta]); + } +} + +/** * Return all block content types available. * * Modules wanting to make special adjustments the way that CTools handles their blocks @@ -35,19 +47,7 @@ function ctools_block_content_type_conte $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 . '_ctools_block_info'; - if (!function_exists($function)) { - $function = 'ctools_default_block_info'; - } - $function($module, $delta, $info); - + $info = _ctools_block_content_type_content_type($module, $delta, $block); // 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) { @@ -60,6 +60,26 @@ function ctools_block_content_type_conte } /** + * Return an info array for a specific block. + */ +function _ctools_block_content_type_content_type($module, $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 . '_ctools_block_info'; + if (!function_exists($function)) { + $function = 'ctools_default_block_info'; + } + $function($module, $delta, $info); + + return $info; +} + +/** * Output function for the 'block' content type. Outputs a block * based on the module and delta supplied in the configuration. */