You are here

function _nodereference_titles in Content Construction Kit (CCK) 6

Same name and namespace in other branches
  1. 6.3 modules/nodereference/nodereference.module \_nodereference_titles()
  2. 6.2 modules/nodereference/nodereference.module \_nodereference_titles()

Helper function for formatters.

Store node titles collected in the curent request.

3 calls to _nodereference_titles()
theme_nodereference_formatter_default in modules/nodereference/nodereference.module
Theme function for 'default' nodereference field formatter.
theme_nodereference_formatter_full_teaser in modules/nodereference/nodereference.module
Proxy theme function for 'full' and 'teaser' nodereference field formatters.
theme_nodereference_formatter_plain in modules/nodereference/nodereference.module
Theme function for 'plain' nodereference field formatter.

File

modules/nodereference/nodereference.module, line 270
Defines a field type for referencing one node from another.

Code

function _nodereference_titles($nid, $known_title = NULL) {
  static $titles = array();
  if (!isset($titles[$nid])) {
    $title = $known_title ? $known_title : db_result(db_query("SELECT title FROM {node} WHERE nid=%d", $nid));
    $titles[$nid] = $title ? $title : '';
  }
  return $titles[$nid];
}