Projet

Général

Profil

Révision 8be7bf84

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

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/views/handlers/views_handler_argument_string.inc
38 38
    $options['path_case'] = array('default' => 'none');
39 39
    $options['transform_dash'] = array('default' => FALSE, 'bool' => TRUE);
40 40
    $options['break_phrase'] = array('default' => FALSE, 'bool' => TRUE);
41
    $options['not'] = array('default' => FALSE, 'bool' => TRUE);
41 42

  
42 43
    if (!empty($this->definition['many to one'])) {
43 44
      $options['add_table'] = array('default' => FALSE, 'bool' => TRUE);
......
132 133
      '#default_value' => !empty($this->options['break_phrase']),
133 134
      '#fieldset' => 'more',
134 135
    );
136
    $form['not'] = array(
137
      '#type' => 'checkbox',
138
      '#title' => t('Exclude'),
139
      '#description' => t('If selected, the numbers entered for the filter will be excluded rather than limiting the view.'),
140
      '#default_value' => !empty($this->options['not']),
141
      '#fieldset' => 'more',
142
    );
135 143
  }
136 144

  
137 145
  /**
......
207 215
    }
208 216

  
209 217
    if (count($this->value) > 1) {
210
      $operator = 'IN';
218
      $operator = empty($this->options['not']) ? 'IN' : 'NOT IN';
211 219
      $argument = $this->value;
212 220
    }
213 221
    else {
214
      $operator = '=';
222
      $operator = empty($this->options['not']) ? '=' : '!=';
215 223
    }
216 224

  
217 225
    if ($formula) {
218 226
      $placeholder = $this->placeholder();
219
      if ($operator == 'IN') {
220
        $field .= " IN($placeholder)";
221
      }
222
      else {
223
        $field .= ' = ' . $placeholder;
227
      if (count($this->value) > 1) {
228
        $placeholder = "($placeholder)";
224 229
      }
230
      $field .= " $operator $placeholder";
225 231
      $placeholders = array(
226 232
        $placeholder => $argument,
227 233
      );

Formats disponibles : Unified diff