function comment_controls in Drupal 5
Same name and namespace in other branches
- 4 modules/comment.module \comment_controls()
- 6 modules/comment/comment.module \comment_controls()
3 string references to 'comment_controls'
- comment_admin_settings in modules/
comment/ comment.module - Menu callback; presents the comment settings page.
- comment_render in modules/
comment/ comment.module - Renders comment(s).
- _comment_get_display_setting in modules/
comment/ comment.module - Return a current comment display setting
File
- modules/
comment/ comment.module, line 1718 - 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 $form;
}