summaryrefslogtreecommitdiff
path: root/modules/comment/comment.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2006-08-22 11:13:04 +0000
committerDries Buytaert <dries@buytaert.net>2006-08-22 11:13:04 +0000
commitc4f1e4ba13905004fdcef814bdba949ec842ce6b (patch)
treec5590b4a059ff7c758d01dd2b6a39e5f3d558aa2 /modules/comment/comment.module
parenta8de1e92d73a673dc7404e5aa82de1df35f834be (diff)
downloadbrdo-c4f1e4ba13905004fdcef814bdba949ec842ce6b.tar.gz
brdo-c4f1e4ba13905004fdcef814bdba949ec842ce6b.tar.bz2
- Patch #76444 by chx, moshe, eaton, angie et al: make it possible to control access to form elements.
Diffstat (limited to 'modules/comment/comment.module')
-rw-r--r--modules/comment/comment.module35
1 files changed, 14 insertions, 21 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index 7aaed2fc7..4bb83df6c 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -281,27 +281,20 @@ function comment_form_alter($form_id, &$form) {
elseif (isset($form['type'])) {
if ($form['type']['#value'] .'_node_form' == $form_id) {
$node = $form['#node'];
- if (user_access('administer comments')) {
- $form['comment_settings'] = array(
- '#type' => 'fieldset',
- '#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')),
- );
- }
- else {
- $form['comment_settings']['comment'] = array(
- '#type' => 'value',
- '#value' => $node->comment,
- );
- }
+ $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')),
+ );
}
}
}