You are here

function theme_node_preview in Drupal 5

Same name and namespace in other branches
  1. 4 modules/node.module \theme_node_preview()
  2. 6 modules/node/node.pages.inc \theme_node_preview()
  3. 7 modules/node/node.pages.inc \theme_node_preview()

Display a node preview for display during node creation and editing.

Parameters

$node: The node object which is being previewed.

1 theme call to theme_node_preview()
node_preview in modules/node/node.module
Generate a node preview.

File

modules/node/node.module, line 2338
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 theme_node_preview($node) {
  $output = '<div class="preview">';
  if ($node->teaser && $node->teaser != $node->body) {
    drupal_set_message(t('The trimmed version of your post shows what your post looks like when promoted to the main page or when exported for syndication. You can insert the delimiter "&lt;!--break--&gt;" (without the quotes) to fine-tune where your post gets split.'));
    $output .= '<h3>' . t('Preview trimmed version') . '</h3>';
    $output .= node_view(drupal_clone($node), 1, FALSE, 0);
    $output .= '<h3>' . t('Preview full version') . '</h3>';
    $output .= node_view($node, 0, FALSE, 0);
  }
  else {
    $output .= node_view($node, 0, FALSE, 0);
  }
  $output .= "</div>\n";
  return $output;
}