dashboard_show_block_content

Versions
7
dashboard_show_block_content($module, $delta)

AJAX callback to display the rendered contents of a specific block.

Parameters

$module The block's module name.

$delta The block's delta.

Code

modules/dashboard/dashboard.module, line 297

<?php
function dashboard_show_block_content($module, $delta) {
  drupal_theme_initialize();
  global $theme_key;

  $blocks = array();
  $block_object = db_query("SELECT * FROM {block} WHERE theme = :theme AND module = :module AND delta = :delta", array(
    ":theme" => $theme_key,
    ":module" => $module,
    ":delta" => $delta,
    ))
    ->fetchObject();
  $block_object->enabled = $block_object->page_match = TRUE;
  $blocks[$module . "_" . $delta] = $block_object;
  $block_content = _block_render_blocks($blocks);
  $build = _block_get_renderable_array($block_content);
  $rendered_block = drupal_render($build);
  print $rendered_block;
  drupal_exit();
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.