Projet

Général

Profil

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

root / drupal7 / sites / all / modules / views / handlers / views_handler_argument_group_by_numeric.inc @ 7547bb19

1
<?php
2

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

    
8
/**
9
 * Simple handler for arguments using group by.
10
 *
11
 * @ingroup views_argument_handlers
12
 */
13
class views_handler_argument_group_by_numeric extends views_handler_argument  {
14
  function query($group_by = FALSE) {
15
    $this->ensure_my_table();
16
    $field = $this->get_field();
17
    $placeholder = $this->placeholder();
18

    
19
    $this->query->add_having_expression(0, "$field = $placeholder", array($placeholder => $this->argument));
20
  }
21

    
22
  function ui_name($short = FALSE) {
23
    return $this->get_field(parent::ui_name($short));
24
  }
25

    
26
  function get_sort_name() {
27
    return t('Numerical', array(), array('context' => 'Sort order'));
28
  }
29
}