/** * Display a node preview for display during node creation and editing. * * @param $node * The node object which is being previewed. * * @ingroup themeable */ function nexus_node_preview($node) { $output = '<div class="preview">'; $preview_trimmed_version = FALSE; // Do we need to preview trimmed version of post as well as full version? if (isset($node->teaser) && isset($node->body)) { $teaser = trim($node->teaser); $body = trim(str_replace('<!--break-->', '', $node->body)); // Preview trimmed version if teaser and body will appear different; // also (edge case) if both teaser and body have been specified by the user // and are actually the same. if ($teaser != $body || $body && strpos($node->body, '<!--break-->') === 0) { $preview_trimmed_version = TRUE; } } if ($preview_trimmed_version) { 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.<span class="no-js"> You can insert the delimiter "<!--break-->" (without the quotes) to fine-tune where your post gets split.</span>')); $preview_trimmed_version = t('Preview trimmed version'); $output .= <<<EOT <div class="art-box art-post"> <div class="art-box-body art-post-body"> <div class="art-post-inner art-article"> <div class="art-postcontent"> <h3> \t {$preview_trimmed_version} \t </h3> </div> <div class="cleared"></div> </div> \t\t<div class="cleared"></div> </div> </div> EOT; $output .= node_view(drupal_clone($node), 1, FALSE, 0); $preview_full_version = t('Preview full version'); $output .= <<<EOT <div class="art-box art-post"> <div class="art-box-body art-post-body"> <div class="art-post-inner art-article"> <div class="art-postcontent"> <h3> \t {$preview_full_version} \t </h3> </div> <div class="cleared"></div> </div> \t\t<div class="cleared"></div> </div> </div> EOT; $output .= node_view($node, 0, FALSE, 0); } else { $output .= node_view($node, 0, FALSE, 0); } $output .= "</div>\n"; return $output; }
function drupal_13584_node_preview($node) { $output = '<div class="preview">'; $preview_trimmed_version = FALSE; if (isset($node->teaser) && isset($node->body)) { $teaser = trim($node->teaser); $body = trim(str_replace('<!--break-->', '', $node->body)); if ($teaser != $body || $body && strpos($node->body, '<!--break-->') === 0) { $preview_trimmed_version = TRUE; } } if ($preview_trimmed_version) { 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.<span class="no-js"> You can insert the delimiter "<!--break-->" (without the quotes) to fine-tune where your post gets split.</span>')); $preview_trimmed_version = t('Preview trimmed version'); $output .= <<<EOT <div class="free-templates-lt-box free-templates-lt-post"> <div class="free-templates-lt-box-body free-templates-lt-post-body"> <div class="free-templates-lt-post-inner free-templates-lt-article"> <div class="free-templates-lt-postcontent"> <h3> \t {$preview_trimmed_version} \t </h3> </div> <div class="cleared"></div> </div> \t\t<div class="cleared"></div> </div> </div> EOT; $output .= node_view(drupal_clone($node), 1, FALSE, 0); $preview_full_version = t('Preview full version'); $output .= <<<EOT <div class="free-templates-lt-box free-templates-lt-post"> <div class="free-templates-lt-box-body free-templates-lt-post-body"> <div class="free-templates-lt-post-inner free-templates-lt-article"> <div class="free-templates-lt-postcontent"> <h3> \t {$preview_full_version} \t </h3> </div> <div class="cleared"></div> </div> \t\t<div class="cleared"></div> </div> </div> EOT; $output .= node_view($node, 0, FALSE, 0); } else { $output .= node_view($node, 0, FALSE, 0); } $output .= "</div>\n"; return $output; }