Projet

Général

Profil

Révision feca1e4a

Ajouté par Assos Assos il y a plus de 6 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/webform/views/webform_handler_filter_submission_data.inc
11 11
 * @ingroup views_filter_handlers
12 12
 */
13 13
class webform_handler_filter_submission_data extends views_handler_filter_string {
14

  
14 15
  /**
15 16
   * This kind of construct makes it relatively easy for a child class
16 17
   * to add or remove functionality by overriding this function and
17 18
   * adding/removing items from this array.
18 19
   */
19
  function operators() {
20
  public function operators() {
20 21
    $operators = parent::operators();
21 22

  
22 23
    // Add additional operators for date/time ranges.
......
37 38
  }
38 39

  
39 40
  /**
40
   * Build strings from the operators() for 'select' options
41
   * Build strings from the operators() for 'select' options.
41 42
   */
42
  function operator_options($which = 'title') {
43
  public function operator_options($which = 'title') {
43 44
    $options = parent::operator_options($which);
44 45

  
45 46
    // Adjust the exposed filter options based on the component selected.
......
48 49
      $cid = $this->view->relationship[$this->options['relationship']]->options['webform_cid'];
49 50

  
50 51
      if ($nid && $node = $node = node_load($nid)) {
52
        module_load_include('inc', 'webform', 'includes/webform.components');
51 53
        $component = $node->webform['components'][$cid];
52 54
        if (webform_component_feature($component['type'], 'views_range')) {
53 55
          $options['='] = t('Is');
......
62 64
    return $options;
63 65
  }
64 66

  
65
  function operator_values($values = 1) {
67
  /**
68
   *
69
   */
70
  public function operator_values($values = 1) {
66 71
    $options = array();
67 72
    foreach ($this->operators() as $id => $info) {
68 73
      if (isset($info['values']) && $info['values'] == $values) {
......
74 79
  }
75 80

  
76 81
  /**
77
   * Provide a simple textfield for equality
82
   * Provide a simple textfield for equality.
78 83
   */
79
  function value_form(&$form, &$form_state) {
84
  public function value_form(&$form, &$form_state) {
80 85
    // TODO: Adjust the exposed filter form based on component form.
81 86
    return parent::value_form($form, $form_state);
82 87
  }
83 88

  
84
  function op_greater_than($field) {
89
  /**
90
   *
91
   */
92
  public function op_greater_than($field) {
85 93
    $this->query->add_where($this->options['group'], $field, $this->value, '>');
86 94
  }
87 95

  
88
  function op_less_than($field) {
96
  /**
97
   *
98
   */
99
  public function op_less_than($field) {
89 100
    $this->query->add_where($this->options['group'], $field, $this->value, '<');
90 101
  }
102

  
91 103
}

Formats disponibles : Unified diff