Projet

Général

Profil

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

root / drupal7 / sites / all / modules / views / modules / profile / views_handler_filter_profile_selection.inc @ 5d12d676

1
<?php
2

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

    
8
/**
9
 * Filter by a selection widget in the profile.
10
 *
11
 * @ingroup views_filter_handlers
12
 */
13
class views_handler_filter_profile_selection extends views_handler_filter_in_operator {
14

    
15
  /**
16
   * {@inheritdoc}
17
   */
18
  public function get_value_options() {
19
    if (isset($this->value_options)) {
20
      return;
21
    }
22

    
23
    $this->value_options = array();
24
    $all_options = profile_views_get_fields();
25
    $field = $all_options[$this->definition['fid']];
26

    
27
    $lines = preg_split("/[,\n\r]/", $field->options);
28
    foreach ($lines as $line) {
29
      if ($line = trim($line)) {
30
        $this->value_options[$line] = $line;
31
      }
32
    }
33
  }
34

    
35
}