function comment_controls in Drupal 4
Same name and namespace in other branches
- 5 modules/comment/comment.module \comment_controls()
- 6 modules/comment/comment.module \comment_controls()
1 call to comment_controls()
- comment_render in modules/
comment.module
3 string references to 'comment_controls'
- comment_configure in modules/
comment.module - Menu callback; presents the comment settings page.
- comment_render in modules/
comment.module - _comment_get_display_setting in modules/
comment.module - Return a current comment display setting
File
- modules/
comment.module, line 1498 - Enables users to comment on published content.
Code
function comment_controls($mode = COMMENT_MODE_THREADED_EXPANDED, $order = COMMENT_ORDER_NEWEST_FIRST, $comments_per_page = 50) {
$form['mode'] = array(
'#type' => 'select',
'#default_value' => $mode,
'#options' => _comment_get_modes(),
'#weight' => 1,
);
$form['order'] = array(
'#type' => 'select',
'#default_value' => $order,
'#options' => _comment_get_orders(),
'#weight' => 2,
);
foreach (_comment_per_page() as $i) {
$options[$i] = t('%a comments per page', array(
'%a' => $i,
));
}
$form['comments_per_page'] = array(
'#type' => 'select',
'#default_value' => $comments_per_page,
'#options' => $options,
'#weight' => 3,
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Save settings'),
'#weight' => 20,
);
return drupal_get_form('comment_controls', $form);
}