Projet

Général

Profil

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

root / drupal7 / sites / all / modules / views / modules / node / views_handler_filter_node_uid_revision.inc @ 5d12d676

1
<?php
2

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

    
8
/**
9
 * Filter handler to check for revisions a certain user has created.
10
 *
11
 * @ingroup views_filter_handlers
12
 */
13
class views_handler_filter_node_uid_revision extends views_handler_filter_user_name {
14

    
15
  /**
16
   * {@inheritdoc}
17
   */
18
  public function query($group_by = FALSE) {
19
    $this->ensure_my_table();
20

    
21
    $placeholder = $this->placeholder();
22

    
23
    $args = array_values($this->value);
24

    
25
    $this->query->add_where_expression($this->options['group'], "$this->table_alias.uid IN($placeholder) " . "OR
26
      ((SELECT COUNT(*) FROM {node_revision} nr WHERE nr.uid IN($placeholder) AND nr.nid = $this->table_alias.nid) > 0)", array($placeholder => $args),
27
      $args);
28
  }
29

    
30
}