Index: modules/comment/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v
retrieving revision 1.583
diff -u -r1.583 comment.module
--- modules/comment/comment.module	11 Sep 2007 14:50:04 -0000	1.583
+++ modules/comment/comment.module	15 Sep 2007 09:35:09 -0000
@@ -51,26 +51,6 @@
 define('COMMENT_ORDER_OLDEST_FIRST', 2);
 
 /**
- * Comment controls should be shown above the comment list.
- */
-define('COMMENT_CONTROLS_ABOVE', 0);
-
-/**
- * Comment controls should be shown below the comment list.
- */
-define('COMMENT_CONTROLS_BELOW', 1);
-
-/**
- * Comment controls should be shown both above and below the comment list.
- */
-define('COMMENT_CONTROLS_ABOVE_BELOW', 2);
-
-/**
- * Comment controls are hidden.
- */
-define('COMMENT_CONTROLS_HIDDEN', 3);
-
-/**
  * Anonymous posters may not enter their contact information.
  */
 define('COMMENT_ANONYMOUS_MAYNOT_CONTACT', 0);
@@ -156,9 +136,6 @@
     'comment_view' => array(
       'arguments' => array('comment' => NULL, 'node' => NULL, 'links' => array(), 'visible' => 1),
     ),
-    'comment_controls' => array(
-      'arguments' => array('form' => NULL),
-    ),
     'comment' => array(
       'template' => 'comment',
       'arguments' => array('comment' => NULL, 'node' => NULL, 'links' => array()),
@@ -580,18 +557,6 @@
     '#description' => t('Default number of comments for each page: more comments are distributed in several pages.'),
   );
 
-  $form['viewing_options']['comment_controls'] = array(
-    '#type' => 'radios',
-    '#title' => t('Comment controls'),
-    '#default_value' => variable_get('comment_controls', COMMENT_CONTROLS_HIDDEN),
-    '#options' => array(
-      t('Display above the comments'),
-      t('Display below the comments'),
-      t('Display above and below the comments'),
-      t('Do not display')),
-    '#description' => t('Position of the comment controls box. The comment controls let the user change the default display mode and display order of comments.'),
-  );
-
   $form['posting_settings'] = array(
     '#type' => 'fieldset',
     '#title' => t('Posting settings'),
@@ -1102,9 +1067,6 @@
         $num_rows = TRUE;
       }
 
-      if ($num_rows && (variable_get('comment_controls', COMMENT_CONTROLS_HIDDEN) == COMMENT_CONTROLS_ABOVE || variable_get('comment_controls', COMMENT_CONTROLS_HIDDEN) == COMMENT_CONTROLS_ABOVE_BELOW)) {
-        $output .= drupal_get_form('comment_controls', $mode, $order, $comments_per_page);
-      }
       $output .= $comments;
 
       for ($i = 0; $i < $divs; $i++) {
@@ -1112,9 +1074,6 @@
       }
       $output .= theme('pager', NULL, $comments_per_page, 0);
 
-      if ($num_rows && (variable_get('comment_controls', COMMENT_CONTROLS_HIDDEN) == COMMENT_CONTROLS_BELOW || variable_get('comment_controls', COMMENT_CONTROLS_HIDDEN) == COMMENT_CONTROLS_ABOVE_BELOW)) {
-        $output .= drupal_get_form('comment_controls', $mode, $order, $comments_per_page);
-      }
     }
 
     // If enabled, show new comment form.
@@ -1794,60 +1753,6 @@
   return $output;
 }
 
-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;
-}
-
-function theme_comment_controls($form) {
-  $output = '<div class="container-inline">';
-  $output .=  drupal_render($form);
-  $output .= '</div>';
-  $output .= '<div class="description">'. t('Select your preferred way to display the comments and click "Save settings" to activate your changes.') .'</div>';
-  return theme('box', t('Comment viewing options'), $output);
-}
-
-function comment_controls_submit($form, &$form_state) {
-  global $user;
-
-  $mode = $form_state['values']['mode'];
-  $order = $form_state['values']['order'];
-  $comments_per_page = $form_state['values']['comments_per_page'];
-
-  if ($user->uid) {
-    $user = user_save($user, array('mode' => $mode, 'sort' => $order, 'comments_per_page' => $comments_per_page));
-  }
-  else {
-    $_SESSION['comment_mode'] = $mode;
-    $_SESSION['comment_sort'] = $order;
-    $_SESSION['comment_comments_per_page'] = $comments_per_page;
-  }
-}
-
 /**
  * Process variables for comment.tpl.php.
  *
@@ -1944,7 +1849,6 @@
   // Provide contextual information.
   $variables['display_mode']  = _comment_get_display_setting('mode');
   $variables['display_order'] = _comment_get_display_setting('sort');
-  $variables['comment_controls_state'] = variable_get('comment_controls', COMMENT_CONTROLS_HIDDEN);
   $variables['template_files'][] = 'comment-wrapper-'. $variables['node']->type;
 }
 
