Index: insert_block.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/insert_block/insert_block.module,v retrieving revision 1.6.2.2 diff -u -p -r1.6.2.2 insert_block.module --- insert_block.module 8 Jan 2009 16:28:52 -0000 1.6.2.2 +++ insert_block.module 25 Feb 2009 23:09:18 -0000 @@ -72,47 +72,22 @@ function insert_block_filter($op, $delta function _insert_block_substitute_tags($text) { if (preg_match_all("/\[block:([^=\\]]+)=?([^\\]]*)?\]/i", $text, $match)) { + $raw_tags = $repl = array(); foreach ($match[2] as $key => $value) { - $raw_tags[] = $match[0][$key]; $module = $match[1][$key]; $delta = $match[2][$key]; - $block = module_invoke($module, 'block', 'view', $delta); + $block = (object) module_invoke($module, 'block', 'view', $delta); + if (isset($block->content)) { + $block->module = $module; + $block->delta = $delta; + $block->region = 'insert_block'; - $repl[] = theme('insert_block_block', $block); + $raw_tags[] = $match[0][$key]; + $repl[] = theme('block', $block); + } } return str_replace($raw_tags, $repl, $text); } return $text; } - -/** - * Implementation of hook_theme(). - */ -function insert_block_theme() { - $themes = array( - 'insert_block_block' => array( - 'arguments' => array('block'), - ), - ); - return $themes; -} - -/** - * Format an included block. - * - * Gets passed the block array to be formatted. By default it includes - * the block subject, if any, and the block's content. - * - * @ingroup themeable - */ -function theme_insert_block_block($block) { - $content = ''; - if (!empty($block['subject'])) { - $content .= '