You are here

function node_prepare in Drupal 6

Same name and namespace in other branches
  1. 4 modules/node.module \node_prepare()
  2. 5 modules/node/node.module \node_prepare()

Apply filters and build the node's standard elements.

3 calls to node_prepare()
blog_view in modules/blog/blog.module
Implementation of hook_view().
node_build_content in modules/node/node.module
Builds a structured array representing the node's content.
node_feed in modules/node/node.module
A generic function for generating RSS feeds from a set of nodes.

File

modules/node/node.module, line 1047
The core that allows content to be submitted to the site. Modules and scripts may programmatically submit nodes using the usual form API pattern.

Code

function node_prepare($node, $teaser = FALSE) {

  // First we'll overwrite the existing node teaser and body with
  // the filtered copies! Then, we'll stick those into the content
  // array and set the read more flag if appropriate.
  $node->readmore = $node->teaser != $node->body;
  if ($teaser == FALSE) {
    $node->body = check_markup($node->body, $node->format, FALSE);
  }
  else {
    $node->teaser = check_markup($node->teaser, $node->format, FALSE);
  }
  $node->content['body'] = array(
    '#value' => $teaser ? $node->teaser : $node->body,
    '#weight' => 0,
  );
  return $node;
}