summaryrefslogtreecommitdiff
path: root/modules/comment/comment.module
diff options
context:
space:
mode:
Diffstat (limited to 'modules/comment/comment.module')
-rw-r--r--modules/comment/comment.module227
1 files changed, 119 insertions, 108 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index 4e981825f..09fa1801a 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -68,28 +68,24 @@ function comment_help($section) {
<p>To see a common example of how thresholds work, you might visit <a href=\"%slashdot\">Slashdot</a> and view one of their comment boards associated with a story. You can reset the thresholds in their comment control panel.</p>
<h4>Initial comment scores</h4>
- <p>Finally, you may want to enter some <em>initial comment scores</em>. In <a href=\"%comment-initial\">administer &raquo; comments &raquo; initial comment scores</a> you can assign a beginning rating for all comments posted by a particular permission role. If you do not assign any initial scores, Drupal will assign a rating of <strong>0</strong> as the default.</p>", array('%comment-config' => url('admin/system/modules/comment'), '%site-config' => url('admin/system'), '%user-permissions' => url('admin/user/permission'), '%tracker' => url('tracker'), '%download-notify' => 'http://drupal.org/project/releases', '%permission' => url('admin/user/permission'), '%comment-moderation' => url('admin/comment/moderation'), '%comment-votes' => url('admin/comment/moderation/votes'), '%comment-matrix' => url('admin/comment/moderation/matrix'), '%comment-thresholds' => url('admin/comment/moderation/filters'), '%slashdot' => ' http://slashdot.org', '%comment-initial' => url('admin/comment/moderation/roles')));
- case 'admin/system/modules#description':
+ <p>Finally, you may want to enter some <em>initial comment scores</em>. In <a href=\"%comment-initial\">administer &raquo; comments &raquo; initial comment scores</a> you can assign a beginning rating for all comments posted by a particular permission role. If you do not assign any initial scores, Drupal will assign a rating of <strong>0</strong> as the default.</p>", array('%comment-config' => url('admin/settings/comment'), '%site-config' => url('admin'), '%user-permissions' => url('admin/user/permission'), '%tracker' => url('tracker'), '%download-notify' => 'http://drupal.org/project/releases', '%permission' => url('admin/user/permission'), '%comment-moderation' => url('admin/settings/comment'), '%comment-votes' => url('admin/settings/comment/votes'), '%comment-matrix' => url('admin/settings/comment/matrix'), '%comment-thresholds' => url('admin/settings/comment/thresholds'), '%slashdot' => ' http://slashdot.org', '%comment-initial' => url('admin/settings/comment/roles')));
+ case 'admin/modules#description':
return t('Enables user to comment on content (nodes).');
- case 'admin/system/modules/comment':
- return t("Comments can be attached to any node. Below are the settings for comments. The display comes in two types, a \"flat list\" where everything is flush to the left side, and comments come in cronological order, and a \"threaded list\" where comments to other comments are placed immediately below and slightly indented forming an outline. They also come in two styles: \"expanded\", where you see both the title and the contents, and \"collapsed\" where you only see the title. To set the default threshold you first have to set up thresholds in the <a href=\"%threshold\">administer &raquo; comments &raquo; moderation &raquo; thresholds</a> area. Preview comment forces a user to look at their comment by clicking on a \"Preview\" button before they can actually add the comment. If \"New comment form\" is enabled then at the bottom of every comment page there will be a form too add a new comment.", array('%threshold' => url('admin/comment/moderation/filters')));
+ case 'admin/settings/comment':
+ return t("Comments can be attached to any node. Below are the settings for comments. The display comes in two types, a \"flat list\" where everything is flush to the left side, and comments come in cronological order, and a \"threaded list\" where comments to other comments are placed immediately below and slightly indented forming an outline. They also come in two styles: \"expanded\", where you see both the title and the contents, and \"collapsed\" where you only see the title. To set the default threshold you first have to set up thresholds in the <a href=\"%threshold\">administer &raquo; comments &raquo; moderation &raquo; thresholds</a> area. Preview comment forces a user to look at their comment by clicking on a \"Preview\" button before they can actually add the comment. If \"New comment form\" is enabled then at the bottom of every comment page there will be a form too add a new comment.", array('%threshold' => url('admin/settings/comment/thresholds')));
case 'admin/comment':
- return t('Comments let users give feedback to content authors. Here you may review/approve/deny recent comments, and configure moderation if desired.');
- case 'admin/comment/comments':
- return t("Click on <a href=\"%nup\">new or updated comments</a> to see your latest comments, or <a href=\"%queue\">comment approval queue</a> to approve new comments.", array('%nup' => url('admin/comment/comments/0'), '%queue' => url('admin/comment/comments/1')));
- case 'admin/comment/comments/0':
return t("Below is a list of the latest comments posted your site. Click on a subject to see the comment, the author's name to edit the author's user information , \"edit comment\" to edit the comment, and \"delete comment\" to remove the comment.");
- case 'admin/comment/comments/1':
+ case 'admin/comment/approval':
return t("Below is a list of the comments posted to your site that need approval. To approve a comment click on <strong>\"edit comment\"</strong> and then change its <strong>moderation status</strong> to Approved.<br />Click on a subject to see the comment, the author's name to edit the author's user information, \"edit comment\" to edit the comment, and \"delete comment\" to remove the comment.");
- case 'admin/comment/moderation':
- return t("If you have a get a lot of comments, you can enable comment moderation. Once moderation is enabled users can vote on a comment based on dropdown menus. <a href=\"%votes\">Votes</a> sets up the names in the dropdown menu, and the order in which they appear, using weights. <a href=\"%matrix\">Matrix</a> sets up the value of each user's vote, and <a href=\"%threshhold\">threshhold</a> sets up the levels at which a comment will be displayed.", array('%votes' => url('admin/comment/moderation/votes'), '%matrix' => url('admin/comment/moderation/matrix'), '%threshhold' => url('admin/comment/moderation/filters')));
- case 'admin/comment/moderation/votes':
- return t("Here is where you setup the names of each type of vote. Weight lets you set the order of the drop down menu. Click <strong>edit</strong> to edit a current vote weight.<br />Notes: <ul><li>you can have more than one type with the same name. The system does not protect you from this.</li><li>To <strong>delete</strong> a name/weight combiniation go to the <strong>edit</strong> area.</li></ul>");
- case 'admin/comment/moderation/matrix':
+ case 'admin/settings/comment': // TODO: THIS IS NEVER USED
+ return t("If you get a lot of comments, you can enable comment moderation. Once moderation is enabled, users can vote on a comment based on dropdown menus. <a href=\"%votes\">Votes</a> sets up the names in the dropdown menu, and the order in which they appear, using weights. <a href=\"%matrix\">Matrix</a> sets up the value of each user's vote, and <a href=\"%threshhold\">threshhold</a> sets up the levels at which a comment will be displayed.", array('%votes' => url('admin/settings/comment/votes'), '%matrix' => url('admin/settings/comment/matrix'), '%threshhold' => url('admin/settings/comment/thresholds')));
+ case 'admin/settings/comment/votes':
+ return t('Here is where you set up the name of each type of vote. "Weight" lets you set the order of the drop down menu. Click <strong>edit</strong> to edit a current vote weight.<br />Notes: <ul><li>you can have more than one type with the same name. The system does not protect you from this.</li><li>To <strong>delete</strong> a name/weight combiniation go to the <strong>edit</strong> area.</li></ul>');
+ case 'admin/settings/comment/matrix':
return t("Here is where you assign a value to each item in the dropdown menu. This value is added to the vote total, which is then divided by the number of users who have voted and rounded off to the nearest integer.<br />Notes:<ul><li>In order to use comment moderation, every text box on this page should be populated.</li><li>You must assign the <strong>moderate comments</strong> permission to at least one role in order to use this page.</li><li>Every box not filled in will have a value of zero, which will have the effect of <strong>lowering</strong> a comments over all score.</li></ul>");
- case 'admin/comment/moderation/filters':
+ case 'admin/settings/comment/thresholds':
return t("<em>Optional</em> Here you can setup the name and minimum \"cut off\" score to help your users hide comments that they don't want too see. These thresholds appear in the Comment Control Panel. Click \"edit\" to edit the values of an already exsisting threashold. To <strong>delete</strong> a threshold click on \"edit\".");
- case 'admin/comment/moderation/roles':
+ case 'admin/settings/comment/roles':
return t("Here you can setup the <strong>initial</strong> vote value of a comment posted by each user role. This value is used before any other users vote on the comment.<br />Note: Blank entries are valued at zero");
case 'admin/comment/search':
return t("Enter a simple pattern ( '*' maybe used as a wildcard match) to search for a comment. For example, one may search for 'br' and Drupal might return 'bread brakers', 'our daily bread' and 'brenda'.");
@@ -104,9 +100,13 @@ function comment_help_page() {
}
/**
- * Implementation of hook_settings().
+ * Menu callback; presents the comment settings page.
*/
-function comment_settings() {
+function comment_configure() {
+ if ($_POST) {
+ system_settings_save();
+ }
+
$group = form_radios(t('Default display mode'), 'comment_default_mode', variable_get('comment_default_mode', 4), _comment_get_modes(), t('The default view for comments. Expanded views display the body of the comment. Threaded views keep replies together.'));
$group .= form_radios(t('Default display order'), 'comment_default_order', variable_get('comment_default_order', 1), _comment_get_orders(), t('The default sorting for new users and anonymous users while viewing comments. These users may change their view using the comment control panel. For registered users, this change is remembered as a persistent user preference.'));
$group .= form_select(t('Default comments per page'), 'comment_default_per_page', variable_get('comment_default_per_page', '50'), _comment_per_page(), t('Default number of comments for each page: more comments are distributed in several pages.'));
@@ -128,7 +128,7 @@ function comment_settings() {
$output .= form_group(t('Comment moderation settings'), $group);
}
- return $output;
+ print theme('page', system_settings_form($output));
}
/**
@@ -333,7 +333,7 @@ function comment_post($edit) {
module_invoke_all('comment', 'update', $edit);
// Add entry to the watchdog log.
- watchdog('special', t('comment: updated "%comment-subject"', array('%comment-subject' => $edit['subject'])), l(t('view comment'), 'node/view/'. $edit['nid'], NULL, NULL, 'comment-'. $edit['cid']));
+ watchdog('special', t('comment: updated "%comment-subject"', array('%comment-subject' => $edit['subject'])), l(t('view comment'), 'node/'. $edit['nid'], NULL, NULL, 'comment-'. $edit['cid']));
}
else {
// Add the comment to database.
@@ -442,7 +442,7 @@ function comment_post($edit) {
module_invoke_all('comment', 'insert', $edit);
// Add an entry to the watchdog log.
- watchdog('special', t('comment: added "%comment-subject"', array('%comment-subject' => $edit['subject'])), l(t('view comment'), 'node/view/'. $edit['nid'], NULL, NULL, 'comment-'. $edit['cid']));
+ watchdog('special', t('comment: added "%comment-subject"', array('%comment-subject' => $edit['subject'])), l(t('view comment'), 'node/'. $edit['nid'], NULL, NULL, 'comment-'. $edit['cid']));
}
// Clear the cache so an anonymous user can see his comment being added.
@@ -457,7 +457,7 @@ function comment_post($edit) {
}
else {
// Redirect the user to his comment:
- drupal_goto('node/view/'. $edit['nid'] .'#comment-'. $edit['cid']);
+ drupal_goto('node/'. $edit['nid'] .'#comment-'. $edit['cid']);
}
}
else {
@@ -549,7 +549,7 @@ function comment_render($node, $cid = 0) {
if ($comment = db_fetch_object($result)) {
$comment->name = $comment->registered_name ? $comment->registered_name : $comment->name;
- $output .= theme("comment_view", $comment, theme('links', module_invoke_all('link', 'comment', $comment, 1)));
+ $output .= theme('comment_view', $comment, theme('links', module_invoke_all('link', 'comment', $comment, 1)));
}
if ((comment_user_can_moderate($node)) && $user->uid != $comment->uid && !(comment_already_moderated($user->uid, $comment->users))) {
@@ -735,10 +735,10 @@ function comment_link($type, $node = 0, $main = 0) {
$new = comment_num_new($node->nid);
if ($all) {
- $links[] = l(format_plural($all, '1 comment', '%count comments'), "node/view/$node->nid", array('title' => t('Jump to the first comment of this posting.')), NULL, 'comment');
+ $links[] = l(format_plural($all, '1 comment', '%count comments'), "node/$node->nid", array('title' => t('Jump to the first comment of this posting.')), NULL, 'comment');
if ($new) {
- $links[] = l(format_plural($new, '1 new comment', '%count new comments'), "node/view/$node->nid", array('title' => t('Jump to the first new comment of this posting.')), NULL, 'new');
+ $links[] = l(format_plural($new, '1 new comment', '%count new comments'), "node/$node->nid", array('title' => t('Jump to the first new comment of this posting.')), NULL, 'new');
}
}
else {
@@ -772,35 +772,70 @@ function comment_link($type, $node = 0, $main = 0) {
$links = comment_links($node, $main);
}
- if ($type == 'system') {
- $access = user_access('administer comments');
- menu('admin/comment', t('comments'), $access ? 'comment_admin' : MENU_DENIED, 1);
- menu('admin/comment/comments', t('overview'), $access ? 'comment_admin' : MENU_DENIED, 2);
- menu('admin/comment/comments/0', t('new/updated'), $access ? 'comment_admin' : MENU_DENIED, 1);
- menu('admin/comment/comments/1', t('approval queue'), $access ? 'comment_admin' : MENU_DENIED, 2);
- menu('admin/comment/help', t('help'), $access ? 'comment_help_page' : MENU_DENIED, 9);
- menu('admin/comment/edit', t('edit comment'), $access ? 'comment_admin' : MENU_DENIED, 0, MENU_HIDE, MENU_LOCKED);
- menu('admin/comment/delete', t('delete comment'), $access ? 'comment_admin' : MENU_DENIED, 0, MENU_HIDE, MENU_LOCKED);
- if (module_exist('search')) {
- menu('admin/comment/search', t('search'), $access ? 'comment_admin' : MENU_DENIED, 8);
- }
-
- // comment settings:
- $access = user_access('administer comments') && user_access('administer moderation');
- menu('admin/comment/moderation', t('moderation'), $access ? 'comment_admin' : MENU_DENIED, 3);
- menu('admin/comment/moderation/votes', t('votes'), $access ? 'comment_admin' : MENU_DENIED);
- menu('admin/comment/moderation/matrix', t('matrix'), $access ? 'comment_admin' : MENU_DENIED);
- menu('admin/comment/moderation/filters', t('thresholds'), $access ? 'comment_admin' : MENU_DENIED);
- menu('admin/comment/moderation/roles', t('initial scores'), $access ? 'comment_admin' : MENU_DENIED, 6);
-
- menu('comment', t('comments'), 'comment_page', 0, MENU_HIDE, MENU_LOCKED);
- }
-
return $links;
}
/**
- * Menu callback.
+ * Implementation of hook_menu().
+ */
+function comment_menu() {
+ $items = array();
+ $access = user_access('administer comments');
+
+ $items[] = array('path' => 'admin/comment', 'title' => t('comments'),
+ 'callback' => 'comment_admin', 'access' => $access);
+ $items[] = array('path' => 'admin/comment/edit', 'title' => t('edit comment'),
+ 'callback' => 'comment_admin', 'access' => $access,
+ 'type' => MENU_CALLBACK);
+ $items[] = array('path' => 'admin/comment/delete', 'title' => t('delete comment'),
+ 'callback' => 'comment_admin', 'access' => $access,
+ 'type' => MENU_CALLBACK);
+
+ // Tabs:
+ $items[] = array('path' => 'admin/comment/configure', 'title' => t('configure'),
+ 'callback' => 'comment_configure', 'access' => $access,
+ 'type' => MENU_LOCAL_TASK);
+ if (module_exist('search')) {
+ $items[] = array('path' => 'admin/comment/search', 'title' => t('search'),
+ 'callback' => 'comment_admin', 'access' => $access,
+ 'type' => MENU_LOCAL_TASK);
+ }
+
+ // Subtabs:
+ $items[] = array('path' => 'admin/comment/new', 'title' => t('new comments'),
+ 'callback' => 'comment_admin', 'access' => $access,
+ 'type' => MENU_LOCAL_SUBTASK);
+ $items[] = array('path' => 'admin/comment/approval', 'title' => t('approval queue'),
+ 'callback' => 'comment_admin', 'access' => $access,
+ 'type' => MENU_LOCAL_SUBTASK);
+ $items[] = array('path' => 'admin/comment/configure/settings', 'title' => t('settings'),
+ 'callback' => 'comment_configure', 'access' => $access,
+ 'type' => MENU_LOCAL_SUBTASK);
+ $access = user_access('administer comments') && user_access('administer moderation');
+ $items[] = array('path' => 'admin/comment/configure/matrix', 'title' => t('moderation matrix'),
+ 'callback' => 'comment_matrix_settings', 'access' => $access,
+ 'type' => MENU_LOCAL_SUBTASK);
+ $items[] = array('path' => 'admin/comment/configure/thresholds', 'title' => t('moderation thresholds'),
+ 'callback' => 'comment_threshold_settings', 'access' => $access,
+ 'type' => MENU_LOCAL_SUBTASK);
+ $items[] = array('path' => 'admin/comment/configure/votes', 'title' => t('moderation votes'),
+ 'callback' => 'comment_vote_settings', 'access' => $access,
+ 'type' => MENU_LOCAL_SUBTASK,
+ 'weight' => 6);
+ $items[] = array('path' => 'admin/comment/configure/roles', 'title' => t('moderation roles'),
+ 'callback' => 'comment_role_settings', 'access' => $access,
+ 'type' => MENU_LOCAL_SUBTASK,
+ 'weight' => 6);
+
+ $items[] = array('path' => 'comment', 'title' => t('comments'),
+ 'callback' => 'comment_page', 'access' => $access,
+ 'type' => MENU_CALLBACK);
+
+ return $items;
+}
+
+/**
+ * Menu callback; dispatches to the correct comment function.
*/
function comment_page() {
$op = $_POST['op'];
@@ -856,7 +891,7 @@ function comment_node_link($node) {
while ($comment = db_fetch_object($result)) {
$comment->name = $comment->registered_name ? $comment->registered_name : $comment->name;
- $rows[] = array(l($comment->subject, "node/view/$node->nid", NULL, NULL, "comment-$comment->cid"), format_name($comment), l(t('view comment'), "node/view/$node->nid", NULL, NULL, $comment->cid), l(t('edit comment'), "admin/comment/edit/$comment->cid"), l(t('delete comment'), "admin/comment/delete/$comment->cid"));
+ $rows[] = array(l($comment->subject, "node/$node->nid", NULL, NULL, "comment-$comment->cid"), format_name($comment), l(t('view comment'), "node/$node->nid", NULL, NULL, $comment->cid), l(t('edit comment'), "admin/comment/edit/$comment->cid"), l(t('delete comment'), "admin/comment/delete/$comment->cid"));
}
if ($rows) {
@@ -934,7 +969,7 @@ function comment_save($id, $edit) {
drupal_set_message(t('the comment has been saved.'));
}
-function comment_admin_overview($status = 0) {
+function comment_admin_overview() {
$header = array(
array('data' => t('subject'), 'field' => 'subject'),
@@ -944,6 +979,7 @@ function comment_admin_overview($status = 0) {
array('data' => t('operations'), 'colspan' => 2)
);
+ $status = (arg(2) == 'approval') ? 1 : 0;
$sql = 'SELECT c.subject, c.nid, c.cid, c.comment, c.timestamp, c.status, c.name, c.homepage, u.name AS registered_name, u.uid FROM {comments} c INNER JOIN {users} u ON u.uid = c.uid WHERE c.status = '. check_query($status);
$sql .= tablesort_sql($header);
$result = pager_query($sql, 50);
@@ -951,7 +987,7 @@ function comment_admin_overview($status = 0) {
while ($comment = db_fetch_object($result)) {
$comment->name = $comment->registered_name ? $comment->registered_name : $comment->name;
$rows[] = array(
- l($comment->subject, "node/view/$comment->nid/$comment->cid", array('title' => htmlspecialchars(truncate_utf8($comment->comment, 128))), NULL, "comment-$comment->cid") ." ". (node_is_new($comment->nid, $comment->timestamp) ? theme('mark') : ''),
+ l($comment->subject, "node/$comment->nid", array('title' => htmlspecialchars(truncate_utf8($comment->comment, 128))), NULL, "comment-$comment->cid") ." ". (node_is_new($comment->nid, $comment->timestamp) ? theme('mark') : ''),
format_name($comment),
($comment->status == 0 ? t('published') : t('not published')),
format_date($comment->timestamp, 'small'),
@@ -967,7 +1003,11 @@ function comment_admin_overview($status = 0) {
return theme('table', $header, $rows);
}
-function comment_mod_matrix($edit) {
+/**
+ * Menu callback; presents the moderation vote matrix.
+ */
+function comment_matrix_settings() {
+ $edit = $_POST['edit'];
$output .= '<h3>Moderation vote/value matrix</h3>';
@@ -1006,10 +1046,15 @@ function comment_mod_matrix($edit) {
$output .= theme('table', $header, $rows);
$output .= '<br />'. form_submit(t('Submit votes'));
- return form($output);
+ print theme('page', form($output));
}
-function comment_mod_roles($edit) {
+/**
+ * Menu callback; allows admin to set default scores for different roles.
+ */
+function comment_role_settings() {
+
+ $edit = $_POST['edit'];
$output .= '<h3>Initial comment scores</h3>';
@@ -1031,11 +1076,15 @@ function comment_mod_roles($edit) {
$output .= theme('table', $header, $rows);
$output .= '<br />'. form_submit(t('Save scores'));
- return form($output);
+ print theme('page', form($output));
}
-function comment_mod_votes($edit) {
+/**
+ * Menu callback; displays page for assigning names to vote values.
+ */
+function comment_vote_settings() {
$op = $_POST['op'];
+ $edit = $_POST['edit'];
$mid = arg(4);
@@ -1061,7 +1110,7 @@ function comment_mod_votes($edit) {
$result = db_query('SELECT mid, vote, weight FROM {moderation_votes} ORDER BY weight');
while ($vote = db_fetch_object($result)) {
- $rows[] = array($vote->vote, array('data' => $vote->weight, 'align' => 'center'), array('data' => l(t('edit'), "admin/comment/moderation/votes/$vote->mid"), 'align' => 'center'));
+ $rows[] = array($vote->vote, array('data' => $vote->weight, 'align' => 'center'), array('data' => l(t('edit'), "admin/settings/comment/votes/$vote->mid"), 'align' => 'center'));
}
$output .= theme('table', $header, $rows);
@@ -1080,13 +1129,15 @@ function comment_mod_votes($edit) {
$form .= form_submit(t('Add new vote'));
}
- $output .= form($form);
-
- return $output;
+ print theme('page', form($form));
}
-function comment_mod_filters($edit) {
+/**
+ * Menu callback; displays settings for thresholds at which comments are displayed.
+ */
+function comment_threshold_settings() {
$op = $_POST['op'];
+ $edit = $_POST['edit'];
$fid = arg(4);
@@ -1112,7 +1163,7 @@ function comment_mod_filters($edit) {
$result = db_query('SELECT fid, filter, minimum FROM {moderation_filters} ORDER BY minimum');
while ($filter = db_fetch_object($result)) {
- $rows[] = array($filter->filter, array('data' => $filter->minimum, 'align' => 'center'), array('data' => l(t('edit'), "admin/comment/moderation/filters/$filter->fid"), 'align' => 'center'));
+ $rows[] = array($filter->filter, array('data' => $filter->minimum, 'align' => 'center'), array('data' => l(t('edit'), "admin/settings/comment/thresholds/$filter->fid"), 'align' => 'center'));
}
$output .= theme('table', $header, $rows);
@@ -1131,12 +1182,9 @@ function comment_mod_filters($edit) {
$form .= form_submit(t('Add new threshold'));
}
- $output .= form($form);
-
- return $output;
+ print theme('page', form($form));
}
-
function comment_admin() {
$op = $_POST['op'];
$edit = $_POST['edit'];
@@ -1145,10 +1193,6 @@ function comment_admin() {
$op = arg(2);
}
- if ($op == 'moderation') {
- $op = arg(3);
- }
-
switch ($op) {
case 'edit':
$output = comment_admin_edit(arg(3));
@@ -1156,34 +1200,6 @@ function comment_admin() {
case 'search':
$output = search_type('comment', url('admin/comment/search'), $_POST['keys']);
break;
- case 'votes':
- case t('Add new vote'):
- case t('Delete vote'):
- case t('Save vote'):
- if (user_access('administer moderation')) {
- $output = comment_mod_votes($edit);
- }
- break;
- case 'roles':
- case t('Save scores'):
- if (user_access('administer moderation')) {
- $output = comment_mod_roles($edit);
- }
- break;
- case 'matrix':
- case t('Submit votes'):
- if (user_access('administer moderation')) {
- $output = comment_mod_matrix($edit);
- }
- break;
- case 'filters':
- case t('Add new threshold'):
- case t('Delete threshold'):
- case t('Save threshold'):
- if (user_access('administer moderation')) {
- $output = comment_mod_filters($edit);
- }
- break;
case 'delete':
$output = comment_delete(arg(3), 0);
break;
@@ -1192,15 +1208,10 @@ function comment_admin() {
break;
case t('Submit'):
$output = comment_save(check_query(arg(3)), $edit);
- $output .= comment_admin_overview(0);
+ $output .= comment_admin_overview();
break;
default:
- if (arg(3) == 1) {
- $output = comment_admin_overview(1);
- }
- else {
- $output = comment_admin_overview(0);
- }
+ $output = comment_admin_overview();
}
print theme('page', $output);
}
@@ -1649,4 +1660,4 @@ function _comment_per_page() {
return drupal_map_assoc(array(10, 30, 50, 70, 90));
}
-?>
+?> \ No newline at end of file