1 node.block.inc NodeBlock::getTitle()

Sets block subject on block view.

Overrides Block::getTitle

File

core/modules/node/node.block.inc, line 32
A class that displays a particular node in a block.

Class

NodeBlock
@file A class that displays a particular node in a block.

Code

function getTitle() {
  $title = NULL;

  // Look for and load translated node if translations are available.
  if (module_exists('translation') && !empty($this->settings['translate'])) {
    $node = $this->loadTranslatedNode();
  }
  else {
    $node = node_load($this->settings['nid']);
  }

  if ($this->settings['title_display'] === LAYOUT_TITLE_CUSTOM && $this->settings['title']) {
    $title = check_plain($this->settings['title']);
  }
  elseif ($this->settings['title_display'] === LAYOUT_TITLE_DEFAULT) {
    $title = $node->title;
  }

  if ($title && $this->settings['link_node_title']) {
    $title = l($title, 'node/' . $node->nid);
  }
  else {
    $title = check_plain($title);
  }

  return $title;
}