function comment_controls
6.x comment.module | comment_controls(&$form_state, $mode = COMMENT_MODE_THREADED_EXPANDED, $order = COMMENT_ORDER_NEWEST_FIRST, $comments_per_page = 50) |
Build a comment control form.
Parameters
$mode: Comment display mode.
$order: Comment order mode.
$comments_per_page: Comments per page.
Related topics
5 string references to 'comment_controls'
- comment_form_alter in drupal-6.x/
modules/ comment/ comment.module - Implementation of hook_form_alter().
- comment_node_type in drupal-6.x/
modules/ comment/ comment.module - Implementation of hook_node_type().
- comment_render in drupal-6.x/
modules/ comment/ comment.module - Renders comment(s).
- comment_theme in drupal-6.x/
modules/ comment/ comment.module - Implementation of hook_theme().
- comment_update_6002 in drupal-6.x/
modules/ comment/ comment.install - Changed comment settings from global to per-node -- copy global settings to all node types.
File
- drupal-6.x/
modules/ comment/ comment.module, line 1610 - Enables users to comment on published content.
Code
function comment_controls(&$form_state, $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;
}