Projet

Général

Profil

Paste
Télécharger (765 octets) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / views / modules / comment / views_handler_filter_comment_user_uid.inc @ 7547bb19

1
<?php
2

    
3
/**
4
 * @file
5
 * Definition of views_handler_filter_comment_user_uid.
6
 */
7

    
8
/**
9
 * Filter handler to accept a user id to check for nodes that user posted or
10
 * commented on.
11
 *
12
 * @ingroup views_filter_handlers
13
 */
14
class views_handler_filter_comment_user_uid extends views_handler_filter_user_name {
15
  function query() {
16
    $this->ensure_my_table();
17

    
18
    $subselect = db_select('comment', 'c');
19
    $subselect->addField('c', 'cid');
20
    $subselect->condition('c.uid', $this->value, $this->operator);
21
    $subselect->where("c.nid = $this->table_alias.nid");
22

    
23
    $condition = db_or()
24
      ->condition("$this->table_alias.uid", $this->value, $this->operator)
25
      ->exists($subselect);
26

    
27
    $this->query->add_where($this->options['group'], $condition);
28
  }
29
}