/[drupal]/drupal/modules/node.module
ViewVC logotype

Diff of /drupal/modules/node.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.641.2.27, Thu Dec 21 23:47:33 2006 UTC revision 1.641.2.28, Mon Jan 1 18:28:34 2007 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: node.module,v 1.641.2.26 2006/12/21 19:22:58 killes Exp $  // $Id: node.module,v 1.641.2.27 2006/12/21 23:47:33 killes Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 1711  function node_form_add_preview($form) { Line 1711  function node_form_add_preview($form) {
1711    if ($op == t('Preview')) {    if ($op == t('Preview')) {
1712      drupal_validate_form($form['form_id']['#value'], $form);      drupal_validate_form($form['form_id']['#value'], $form);
1713      if (!form_get_errors()) {      if (!form_get_errors()) {
1714        // We pass the global $form_values here to preserve changes made during form validation        // Because the node preview may display a form, we must render it
1715        $form['#prefix'] = node_preview((object)$form_values);        // outside the node submission form tags using the #prefix property
1716          // (i.e. to prevent illegally nested forms).
1717          // If the node form already has a #prefix, we must preserve it.
1718          // In this case, we put the preview before the #prefix so we keep
1719          // the #prefix as "close" to the rest of the form as possible,
1720          // for example, to keep a <div> only around the form, not the
1721          // preview. We pass the global $form_values here to preserve
1722          // changes made during form validation.
1723          $preview = node_preview((object)$form_values);
1724          $form['#prefix'] = isset($form['#prefix']) ? $preview . $form['#prefix'] : $preview;
1725      }      }
1726    }    }
1727    if (variable_get('node_preview', 0) && (form_get_errors() || $op != t('Preview'))) {    if (variable_get('node_preview', 0) && (form_get_errors() || $op != t('Preview'))) {

Legend:
Removed from v.1.641.2.27  
changed lines
  Added in v.1.641.2.28

  ViewVC Help
Powered by ViewVC 1.1.2