diff options
author | Dries Buytaert <dries@buytaert.net> | 2008-09-27 20:37:01 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2008-09-27 20:37:01 +0000 |
commit | 9f3d9f11158aec709dac7d67b99ff6fd8c2c634d (patch) | |
tree | 68fc762cb0dd1bdb7b86483c4e12be6aa69dcabc /modules/comment/comment.module | |
parent | 0d84b9184948372469480fa32daab66d37c95df6 (diff) | |
download | brdo-9f3d9f11158aec709dac7d67b99ff6fd8c2c634d.tar.gz brdo-9f3d9f11158aec709dac7d67b99ff6fd8c2c634d.tar.bz2 |
- Patch #161301 by Eaton, Sun, moshe and webchick: make checking for node edit forms easier. DX improvement.
Diffstat (limited to 'modules/comment/comment.module')
-rw-r--r-- | modules/comment/comment.module | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module index f1af2b608..80e9aad2f 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -532,24 +532,22 @@ function comment_form_alter(&$form, $form_state, $form_id) { '#options' => array(t('Display on separate page'), t('Display below post or comments')), ); } - elseif (isset($form['type']) && isset($form['#node'])) { - if ($form['type']['#value'] . '_node_form' == $form_id) { - $node = $form['#node']; - $form['comment_settings'] = array( - '#type' => 'fieldset', - '#access' => user_access('administer comments'), - '#title' => t('Comment settings'), - '#collapsible' => TRUE, - '#collapsed' => TRUE, - '#weight' => 30, - ); - $form['comment_settings']['comment'] = array( - '#type' => 'radios', - '#parents' => array('comment'), - '#default_value' => $node->comment, - '#options' => array(t('Disabled'), t('Read only'), t('Read/Write')), - ); - } + elseif (!empty($form['#node_edit_form'])) { + $node = $form['#node']; + $form['comment_settings'] = array( + '#type' => 'fieldset', + '#access' => user_access('administer comments'), + '#title' => t('Comment settings'), + '#collapsible' => TRUE, + '#collapsed' => TRUE, + '#weight' => 30, + ); + $form['comment_settings']['comment'] = array( + '#type' => 'radios', + '#parents' => array('comment'), + '#default_value' => $node->comment, + '#options' => array(t('Disabled'), t('Read only'), t('Read/Write')), + ); } } |