Commit a5e3fac8 authored by catch's avatar catch
Browse files

Issue #1159002 by sun: Show comment field first and before contact info in comment form.

parent aab45ade
...@@ -1711,20 +1711,16 @@ function comment_form($form, &$form_state, Comment $comment) { ...@@ -1711,20 +1711,16 @@ function comment_form($form, &$form_state, Comment $comment) {
$form += $form_state['comment_preview']; $form += $form_state['comment_preview'];
} }
$form['author'] = array(
'#weight' => 10,
);
// Display author information in a fieldset for comment moderators. // Display author information in a fieldset for comment moderators.
if ($is_admin) { if ($is_admin) {
$form['author'] = array( $form['author'] += array(
'#type' => 'fieldset', '#type' => 'fieldset',
'#title' => t('Administration'), '#title' => t('Administration'),
'#collapsible' => TRUE, '#collapsible' => TRUE,
'#collapsed' => TRUE, '#collapsed' => TRUE,
'#weight' => -2,
);
}
else {
// Sets the author form elements above the subject.
$form['author'] = array(
'#weight' => -2,
); );
} }
...@@ -1825,7 +1821,6 @@ function comment_form($form, &$form_state, Comment $comment) { ...@@ -1825,7 +1821,6 @@ function comment_form($form, &$form_state, Comment $comment) {
'#maxlength' => 64, '#maxlength' => 64,
'#default_value' => $comment->subject, '#default_value' => $comment->subject,
'#access' => variable_get('comment_subject_field_' . $node->type, 1) == 1, '#access' => variable_get('comment_subject_field_' . $node->type, 1) == 1,
'#weight' => -1,
); );
// Used for conditional validation of author fields. // Used for conditional validation of author fields.
...@@ -1858,13 +1853,11 @@ function comment_form($form, &$form_state, Comment $comment) { ...@@ -1858,13 +1853,11 @@ function comment_form($form, &$form_state, Comment $comment) {
'#type' => 'submit', '#type' => 'submit',
'#value' => t('Save'), '#value' => t('Save'),
'#access' => ($comment->cid && user_access('administer comments')) || variable_get('comment_preview_' . $node->type, DRUPAL_OPTIONAL) != DRUPAL_REQUIRED || isset($form_state['comment_preview']), '#access' => ($comment->cid && user_access('administer comments')) || variable_get('comment_preview_' . $node->type, DRUPAL_OPTIONAL) != DRUPAL_REQUIRED || isset($form_state['comment_preview']),
'#weight' => 19,
); );
$form['actions']['preview'] = array( $form['actions']['preview'] = array(
'#type' => 'submit', '#type' => 'submit',
'#value' => t('Preview'), '#value' => t('Preview'),
'#access' => (variable_get('comment_preview_' . $node->type, DRUPAL_OPTIONAL) != DRUPAL_DISABLED), '#access' => (variable_get('comment_preview_' . $node->type, DRUPAL_OPTIONAL) != DRUPAL_DISABLED),
'#weight' => 20,
'#submit' => array('comment_form_build_preview'), '#submit' => array('comment_form_build_preview'),
); );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment