diff options
-rw-r--r-- | modules/comment/comment.module | 16 | ||||
-rw-r--r-- | modules/node/node.pages.inc | 12 |
2 files changed, 14 insertions, 14 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 8fd0e1ab4..dc217aca6 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -1312,17 +1312,17 @@ function comment_form(&$form_state, $edit, $title = NULL) { $form['nid'] = array('#type' => 'value', '#value' => $edit['nid']); $form['uid'] = array('#type' => 'value', '#value' => !empty($edit['uid']) ? $edit['uid'] : NULL); - $form['preview'] = array('#type' => 'button', '#value' => t('Preview comment'), '#weight' => 19); - $form['#token'] = 'comment'. $edit['nid'] . (isset($edit['pid']) ? $edit['pid'] : ''); - - // Only show post button if preview is optional or if we are in preview mode. - // We show the post button in preview mode even if there are form errors so that + // Only show save button if preview is optional or if we are in preview mode. + // We show the save button in preview mode even if there are form errors so that // optional form elements (e.g., captcha) can be updated in preview mode. - if (!form_get_errors() && ((variable_get('comment_preview_'. $node->type, COMMENT_PREVIEW_REQUIRED) == COMMENT_PREVIEW_OPTIONAL) || ($op == t('Preview comment')) || ($op == t('Post comment')))) { - $form['submit'] = array('#type' => 'submit', '#value' => t('Post comment'), '#weight' => 20); + if (!form_get_errors() && ((variable_get('comment_preview_'. $node->type, COMMENT_PREVIEW_REQUIRED) == COMMENT_PREVIEW_OPTIONAL) || ($op == t('Preview')) || ($op == t('Save')))) { + $form['submit'] = array('#type' => 'submit', '#value' => t('Save'), '#weight' => 19); } + + $form['preview'] = array('#type' => 'button', '#value' => t('Preview'), '#weight' => 20); + $form['#token'] = 'comment'. $edit['nid'] . (isset($edit['pid']) ? $edit['pid'] : ''); - if ($op == t('Preview comment')) { + if ($op == t('Preview')) { $form['#after_build'] = array('comment_form_add_preview'); } diff --git a/modules/node/node.pages.inc b/modules/node/node.pages.inc index 8b994a4f7..fc916669c 100644 --- a/modules/node/node.pages.inc +++ b/modules/node/node.pages.inc @@ -225,17 +225,17 @@ function node_form(&$form_state, $node) { // Add the buttons. $form['buttons'] = array(); - $form['buttons']['preview'] = array( + $form['buttons']['submit'] = array( '#type' => 'submit', - '#value' => t('Preview'), + '#value' => t('Save'), '#weight' => 5, - '#submit' => array('node_form_build_preview'), + '#submit' => array('node_form_submit'), ); - $form['buttons']['submit'] = array( + $form['buttons']['preview'] = array( '#type' => 'submit', - '#value' => t('Save'), + '#value' => t('Preview'), '#weight' => 10, - '#submit' => array('node_form_submit'), + '#submit' => array('node_form_build_preview'), ); if (!empty($node->nid) && node_access('delete', $node)) { $form['buttons']['delete'] = array( |