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

8.0.x
catch 2012-04-18 12:23:31 +09:00
parent aab45ade9f
commit a5e3fac8d5
1 changed files with 4 additions and 11 deletions

View File

@ -1711,20 +1711,16 @@ function comment_form($form, &$form_state, Comment $comment) {
$form += $form_state['comment_preview'];
}
$form['author'] = array(
'#weight' => 10,
);
// Display author information in a fieldset for comment moderators.
if ($is_admin) {
$form['author'] = array(
$form['author'] += array(
'#type' => 'fieldset',
'#title' => t('Administration'),
'#collapsible' => 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) {
'#maxlength' => 64,
'#default_value' => $comment->subject,
'#access' => variable_get('comment_subject_field_' . $node->type, 1) == 1,
'#weight' => -1,
);
// Used for conditional validation of author fields.
@ -1858,13 +1853,11 @@ function comment_form($form, &$form_state, Comment $comment) {
'#type' => 'submit',
'#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']),
'#weight' => 19,
);
$form['actions']['preview'] = array(
'#type' => 'submit',
'#value' => t('Preview'),
'#access' => (variable_get('comment_preview_' . $node->type, DRUPAL_OPTIONAL) != DRUPAL_DISABLED),
'#weight' => 20,
'#submit' => array('comment_form_build_preview'),
);