function _popup_block in Popup 6.x
Same name and namespace in other branches
- 8 includes/popup.api.inc \_popup_block()
- 7 includes/popup.api.inc \_popup_block()
- 7.x includes/popup.api.inc \_popup_block()
File
- includes/
popup.api.inc, line 322
Code
function _popup_block($attributes, $return = FALSE) {
// Get the block from a module
if ($attributes['module'] && isset($attributes['delta'])) {
$block = module_invoke($attributes['module'], 'block', 'view', $attributes['delta']);
$title = $attributes['title'] ? $attributes['title'] : $block['subject'];
$body = '<div class="block">' . $block['content'] . '</div>';
// or from the block module
}
else {
$block_box = block_box_get($attributes['block']);
$title = $attributes['title'] ? $attributes['title'] : $block_box['info'];
$body = $block_box['body'];
}
if ($return == 'title') {
return $title;
}
if ($return == 'body') {
return $body;
}
return popup_element($title, $body, $attributes);
}