You are here

function featured_content_get_block_title in Featured Content 6

Same name and namespace in other branches
  1. 6.2 featured_content.module \featured_content_get_block_title()
  2. 7.2 featured_content.module \featured_content_get_block_title()
  3. 7 featured_content.module \featured_content_get_block_title()

Get block title based on given title or internal title.

1 call to featured_content_get_block_title()
featured_content_set_page_title in ./featured_content.module
Set page title for more page or rss page.

File

./featured_content.module, line 1040
Featured Content module for created related & featured content blocks.

Code

function featured_content_get_block_title($delta, $add_site_name = FALSE) {
  $results = db_query("SELECT title FROM {blocks} WHERE module='featured_content' AND delta=%d", $delta);
  if (is_numeric($delta) && $results) {
    $row = db_fetch_object($results);
    $block_title = trim($row->title);
    if ($block_title == '' || $block_title == '<none>') {
      $info = module_invoke('featured_content', 'block', 'list');
      if (isset($info[$delta])) {
        $block_title = $info[$delta]['info'];
      }
    }
    if ($add_site_name && trim($block_title)) {
      $site_name = check_plain(variable_get('site_name', ''));
      if ($site_name) {
        $block_title = $site_name . ': ' . $block_title;
      }
    }
  }
  return check_plain($block_title);
}