summaryrefslogtreecommitdiff
path: root/modules/comment/comment.pages.inc
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2008-06-03 16:30:20 +0000
committerDries Buytaert <dries@buytaert.net>2008-06-03 16:30:20 +0000
commit3f052180dc7a6576e9976b23e397528ccb4899d3 (patch)
treeb8edeaa1f2f4a309455a713fa605875da0229eea /modules/comment/comment.pages.inc
parentcccf98aaa09e556efcd075534da73774ac144bc0 (diff)
downloadbrdo-3f052180dc7a6576e9976b23e397528ccb4899d3.tar.gz
brdo-3f052180dc7a6576e9976b23e397528ccb4899d3.tar.bz2
- Patch #66264 by boombatower: comment approval displayed on node view of comment. Comes with tests and everything.
Diffstat (limited to 'modules/comment/comment.pages.inc')
-rw-r--r--modules/comment/comment.pages.inc20
1 files changed, 20 insertions, 0 deletions
diff --git a/modules/comment/comment.pages.inc b/modules/comment/comment.pages.inc
index b9cb35d9d..8e4944402 100644
--- a/modules/comment/comment.pages.inc
+++ b/modules/comment/comment.pages.inc
@@ -113,3 +113,23 @@ function comment_reply($node, $pid = NULL) {
return $output;
}
+
+/**
+ * Publish specified comment.
+ *
+ * @param $cid ID of comment to be published.
+ */
+function comment_approve($cid) {
+ // Load the comment whose cid = $cid
+ if ($comment = comment_load($cid)) {
+ $operations = comment_operations('publish');
+ db_query($operations['publish'][1], $cid);
+
+ drupal_set_message(t('Comment approved.'));
+ drupal_goto("node/$comment->nid");
+ }
+ else {
+ drupal_set_message(t('The comment you are approving does not exist.'), 'error');
+ drupal_goto();
+ }
+}