You are here

function node_prepare in Drupal 5

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

Apply filters and build the node's standard elements.

6 calls to node_prepare()
blog_view in modules/blog/blog.module
Implementation of hook_view().
book_content in modules/book/book.module
Returns the content of a given node. If $teaser if TRUE, returns the teaser rather than full content. Displays the most recently approved revision of a node (if any) unless we have to display this page in the context of the moderation queue.
book_node_visitor_html_pre in modules/book/book.module
Generates printer-friendly HTML for a node. This function is a 'pre-node' visitor function for book_recurse().
forum_view in modules/forum/forum.module
Implementation of hook_view().
node_build_content in modules/node/node.module
Builds a structured array representing the node's content.

... See full list

File

modules/node/node.module, line 760
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 = strlen($node->teaser) < strlen($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;
}