You are here

function _nodeblock_block_title in Nodeblock 7

Helper function to get the Node Block block title.

1 call to _nodeblock_block_title()
nodeblock_node_load in ./nodeblock.module
Implements hook_node_load().

File

./nodeblock.module, line 502
Enables use of specified node types as custom blocks.

Code

function _nodeblock_block_title($node, $langcode) {
  $block_title = '';
  if (nodeblock_type_enabled($node->type) && isset($node->nodeblock)) {
    $block_title_field = nodeblock_type_node_override_block_title_field($node->type);
    if ($block_title_field == 'nodeblock') {
      $block_title = isset($node->nodeblock['block_title']) ? $node->nodeblock['block_title'] : _nodeblock_node_title($node, $langcode);
    }
    else {
      $values = isset($node->{$block_title_field}[$langcode][0]['value']) ? $node->{$block_title_field}[$langcode][0]['value'] : NULL;
      $block_title = $values ?: ($node->nid ? '' : _nodeblock_node_title($node, $langcode));
    }
  }
  return $block_title;
}