function theme_ds_eval_block in Display Suite 6.2
Same name and namespace in other branches
- 6.3 theme/theme.inc \theme_ds_eval_block()
- 6 theme/theme.inc \theme_ds_eval_block()
Evaluate block field.
Parameters
array $field The field array.:
File
- theme/
theme.inc, line 121 - Theming functions for ds.
Code
function theme_ds_eval_block($field) {
if (isset($field['properties'])) {
list($module, $delta) = explode('|', $field['properties']['block']);
$block = module_invoke($module, 'block', 'view', $delta);
if (!empty($block)) {
switch ($field['properties']['render']) {
case DS_BLOCK_TEMPLATE:
global $theme_key;
if ($block['content']) {
$block = (object) $block;
$block->region = NULL;
$block->module = $module;
$block->delta = $delta;
$block_title = db_result(db_query("SELECT title FROM {blocks} WHERE module = '%s' AND delta = '%s' AND theme = '%s'", $module, $delta, $theme_key));
if (!empty($block_title)) {
$block->subject = $block_title == '<none>' ? '' : check_plain($block_title);
}
$content = theme('block', $block);
}
break;
case DS_BLOCK_TITLE_CONTENT:
$content = '<h2 class="block-title">' . $block['subject'] . '</h2>';
$content .= $block['content'];
break;
case DS_BLOCK_CONTENT:
$content = $block['content'];
break;
}
return $content;
}
}
}