Projet

Général

Profil

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

root / drupal7 / sites / all / modules / views / modules / profile / views_handler_filter_profile_selection.inc @ 76df55b7

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
  function get_value_options() {
15
    if (isset($this->value_options)) {
16
      return;
17
    }
18

    
19
    $this->value_options = array();
20
    $all_options = profile_views_get_fields();
21
    $field = $all_options[$this->definition['fid']];
22

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