You are here

function ctools_block_content_type_admin_info in Chaos Tool Suite (ctools) 7

Same name and namespace in other branches
  1. 6 plugins/content_types/block/block.inc \ctools_block_content_type_admin_info()

Output function for the 'block' content type. Outputs a block based on the module and delta supplied in the configuration.

File

plugins/content_types/block/block.inc, line 231
Provide Drupal blocks as content.

Code

function ctools_block_content_type_admin_info($subtype, $conf) {
  list($module, $delta) = _ctools_block_get_module_delta($subtype, $conf);
  $block = (object) module_invoke($module, 'block_view', $delta);
  if (!empty($block)) {

    // Sanitize the block because <script> tags can hose javascript up:
    if (!empty($block->content)) {
      $block->content = filter_xss_admin(render($block->content));
    }
    if (!empty($block->subject)) {
      $block->title = $block->subject;
    }
    elseif (empty($block->title)) {
      $block->title = t('No title');
    }
    return $block;
  }
}