diff --git a/insert_block.module b/insert_block.module index 5363385..9917a50 100644 --- a/insert_block.module +++ b/insert_block.module @@ -49,9 +49,11 @@ function _insert_block($text, $filter, $format) { $module = $match[1][$key]; $delta = $match[2][$key]; - $block = module_invoke($module, 'block_view', $delta); - - $repl[] = theme('insert_block_block', array('block' => $block)); + // see comments on http://api.drupal.org/api/drupal/developer--theme.php/function/theme_block/7 + $block = block_load($module, $delta); + $block_content = _block_render_blocks(array($block)); + $build = _block_get_renderable_array($block_content); + $repl[] = drupal_render($build); } return str_replace($raw_tags, $repl, $text); } @@ -70,35 +72,4 @@ function _insert_block_tips($filter, $format, $long = FALSE) { return t('You may use [block:module=delta] tags to display the contents of block delta for module module.', array("@insert_block_help" => url("filter/tips/$format->format", array('fragment' => 'filter-insert_block')))); } -} - -/** - * Implementation of hook_theme(). - */ -function insert_block_theme() { - $themes = array( - 'insert_block_block' => array( - 'variables' => array('block' => NULL), - ), - ); - 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($vars) { - $content = ''; - if (!empty($vars['block']['subject'])) { - $content .= '