function _esi__get_block in ESI: Edge Side Includes 6.2
Get the themed HTML for a particular block
Parameters
$theme: The name of the theme: "garland".
String $region: The name of the region the block is in: e.g. "left"
String $module:
String $delta:
1 call to _esi__get_block()
- esi__block_handler in ./
esi.module - Menu handler for ESIs
File
- ./
esi.inc, line 110 - Helper functions for the ESI module.
Code
function _esi__get_block($theme, $region, $module, $delta) {
$block = db_fetch_object(db_query("SELECT * FROM {blocks} WHERE module = '%s' AND delta = '%s' AND theme = '%s'", $module, $delta, $theme));
$block->context = $region;
$block->status = 1;
$array = module_invoke($block->module, 'block', 'view', $block->delta);
if (isset($array) && is_array($array)) {
foreach ($array as $k => $v) {
$block->{$k} = $v;
}
}
if (!empty($block->title)) {
// Check plain here to allow module generated titles to keep any markup.
$block->subject = $block->title == '<none>' ? '' : check_plain($block->title);
}
if (!isset($block->subject)) {
$block->subject = '';
}
return $block;
}