Projet

Général

Profil

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

root / drupal7 / sites / all / modules / views / modules / user / views_handler_filter_user_roles.inc @ 4003efde

1
<?php
2

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

    
8
/**
9
 * Filter handler for user roles.
10
 *
11
 * @ingroup views_filter_handlers
12
 */
13
class views_handler_filter_user_roles extends views_handler_filter_many_to_one {
14

    
15
  /**
16
   * {@inheritdoc}
17
   */
18
  public function get_value_options() {
19
    $this->value_options = user_roles(TRUE);
20
    unset($this->value_options[DRUPAL_AUTHENTICATED_RID]);
21
  }
22

    
23
  /**
24
   * Override empty and not empty operator labels to be clearer for user roles.
25
   */
26
  public function operators() {
27
    $operators = parent::operators();
28
    $operators['empty']['title'] = t("Only has the 'authenticated user' role");
29
    $operators['not empty']['title'] = t("Has roles in addition to 'authenticated user'");
30
    return $operators;
31
  }
32

    
33
}