summaryrefslogtreecommitdiff
path: root/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_filter_comment_user_uid.inc
diff options
context:
space:
mode:
authorTorsten Grote <grote@kolabsys.com>2012-08-14 13:29:52 (GMT)
committerTorsten Grote <grote@kolabsys.com>2012-08-14 13:29:52 (GMT)
commit8a7a4f8e58df35a10fda833a9904eb8fd961a1ca (patch)
tree35e2f907372d637f76c0e3c3ac1c0f27f2dc1391 /kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_filter_comment_user_uid.inc
parent146e20fc2d0941a6783641f26b3ea074dc03fc84 (diff)
downloadkolab.org-www-8a7a4f8e58df35a10fda833a9904eb8fd961a1ca.tar.gz
upgrade to drupal 7.15
Diffstat (limited to 'kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_filter_comment_user_uid.inc')
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_filter_comment_user_uid.inc24
1 files changed, 24 insertions, 0 deletions
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_filter_comment_user_uid.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_filter_comment_user_uid.inc
new file mode 100644
index 0000000..4f9e711
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_filter_comment_user_uid.inc
@@ -0,0 +1,24 @@
+<?php
+
+/**
+ * Filter handler to accept a user id to check for nodes that user posted or
+ * commented on.
+ *
+ * @ingroup views_filter_handlers
+ */
+class views_handler_filter_comment_user_uid extends views_handler_filter_user_name {
+ function query() {
+ $this->ensure_my_table();
+
+ $subselect = db_select('comment', 'c');
+ $subselect->addField('c', 'cid');
+ $subselect->condition('c.uid', $this->value, $this->operator);
+ $subselect->where("c.nid = $this->table_alias.nid");
+
+ $condition = db_or()
+ ->condition("$this->table_alias.uid", $this->value, $this->operator)
+ ->exists($subselect);
+
+ $this->query->add_where($this->options['group'], $condition);
+ }
+}