Révision 5d12d676
Ajouté par Assos Assos il y a environ 6 ans
drupal7/sites/all/modules/views/handlers/views_handler_argument_numeric.inc | ||
---|---|---|
6 | 6 |
*/ |
7 | 7 |
|
8 | 8 |
/** |
9 |
* Basic argument handler for arguments that are numeric. Incorporates |
|
10 |
* break_phrase. |
|
9 |
* Basic argument handler for arguments that are numeric. |
|
10 |
* |
|
11 |
* Incorporates break_phrase. |
|
11 | 12 |
* |
12 | 13 |
* @ingroup views_argument_handlers |
13 | 14 |
*/ |
14 | 15 |
class views_handler_argument_numeric extends views_handler_argument { |
16 |
|
|
15 | 17 |
/** |
16 | 18 |
* The operator used for the query: or|and. |
17 | 19 |
* @var string |
18 | 20 |
*/ |
19 |
var $operator;
|
|
21 |
public $operator;
|
|
20 | 22 |
|
21 | 23 |
/** |
22 | 24 |
* The actual value which is used for querying. |
23 | 25 |
* @var array |
24 | 26 |
*/ |
25 |
var $value;
|
|
27 |
public $value;
|
|
26 | 28 |
|
27 |
function option_definition() { |
|
29 |
/** |
|
30 |
* {@inheritdoc} |
|
31 |
*/ |
|
32 |
public function option_definition() { |
|
28 | 33 |
$options = parent::option_definition(); |
29 | 34 |
|
30 | 35 |
$options['break_phrase'] = array('default' => FALSE, 'bool' => TRUE); |
... | ... | |
33 | 38 |
return $options; |
34 | 39 |
} |
35 | 40 |
|
36 |
function options_form(&$form, &$form_state) { |
|
41 |
/** |
|
42 |
* {@inheritdoc} |
|
43 |
*/ |
|
44 |
public function options_form(&$form, &$form_state) { |
|
37 | 45 |
parent::options_form($form, $form_state); |
38 | 46 |
|
39 | 47 |
// allow + for or, , for and |
... | ... | |
54 | 62 |
); |
55 | 63 |
} |
56 | 64 |
|
57 |
function title() { |
|
65 |
/** |
|
66 |
* {@inheritdoc} |
|
67 |
*/ |
|
68 |
public function title() { |
|
58 | 69 |
if (!$this->argument) { |
59 | 70 |
return !empty($this->definition['empty field name']) ? $this->definition['empty field name'] : t('Uncategorized'); |
60 | 71 |
} |
... | ... | |
80 | 91 |
|
81 | 92 |
/** |
82 | 93 |
* Override for specific title lookups. |
94 |
* |
|
83 | 95 |
* @return array |
84 | 96 |
* Returns all titles, if it's just one title it's an array with one entry. |
85 | 97 |
*/ |
86 |
function title_query() { |
|
98 |
public function title_query() {
|
|
87 | 99 |
return $this->value; |
88 | 100 |
} |
89 | 101 |
|
90 |
function query($group_by = FALSE) { |
|
102 |
/** |
|
103 |
* {@inheritdoc} |
|
104 |
*/ |
|
105 |
public function query($group_by = FALSE) { |
|
91 | 106 |
$this->ensure_my_table(); |
92 | 107 |
|
93 | 108 |
if (!empty($this->options['break_phrase'])) { |
... | ... | |
110 | 125 |
} |
111 | 126 |
} |
112 | 127 |
|
113 |
function get_sort_name() { |
|
128 |
/** |
|
129 |
* {@inheritdoc} |
|
130 |
*/ |
|
131 |
public function get_sort_name() { |
|
114 | 132 |
return t('Numerical', array(), array('context' => 'Sort order')); |
115 | 133 |
} |
134 |
|
|
116 | 135 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules