Révision b720ea3e
Ajouté par Assos Assos il y a plus de 8 ans
drupal7/sites/all/modules/date/date_views/includes/date_views_filter_handler_simple.inc | ||
---|---|---|
1 | 1 |
<?php |
2 | 2 |
/** |
3 | 3 |
* @file |
4 |
* A standard Views filter for a single date field, using Date API form selectors and sql handling. |
|
4 |
* A standard Views filter for a single date field, |
|
5 |
* using Date API form selectors and sql handling. |
|
5 | 6 |
*/ |
6 | 7 |
|
8 |
// @codingStandardsIgnoreStart |
|
7 | 9 |
class date_views_filter_handler_simple extends views_handler_filter_date { |
8 | 10 |
var $date_handler = NULL; |
9 | 11 |
var $offset = NULL; |
... | ... | |
263 | 265 |
} |
264 | 266 |
|
265 | 267 |
function extra_options_validate($form, &$form_state) { |
266 |
if (!preg_match('/^(?:\-[0-9]{1,4}|[0-9]{4}):(?:[\+|\-][0-9]{1,4}|[0-9]{4})$/', $form_state['values']['options']['year_range'])) {
|
|
268 |
if (!preg_match('/^(?:[\+\-][0-9]{1,4}|[0-9]{4}):(?:[\+\-][0-9]{1,4}|[0-9]{4})$/', $form_state['values']['options']['year_range'])) {
|
|
267 | 269 |
form_error($form['year_range'], t('Date year range must be in the format -9:+9, 2005:2010, -9:2010, or 2005:+9')); |
268 | 270 |
} |
269 | 271 |
} |
... | ... | |
332 | 334 |
* @return |
333 | 335 |
* The form date part element for this instance. |
334 | 336 |
*/ |
335 |
function date_parts_form($form_state, $prefix, $source, $which, $operator_values, $identifier, $relative_id) { |
|
337 |
function date_parts_form(&$form_state, $prefix, $source, $which, $operator_values, $identifier, $relative_id) {
|
|
336 | 338 |
module_load_include('inc', 'date_api', 'date_api_elements'); |
337 | 339 |
switch ($prefix) { |
338 | 340 |
case 'min': |
... | ... | |
379 | 381 |
$form[$prefix]['#dependency'] = array($source => $operator_values); |
380 | 382 |
} |
381 | 383 |
if (!isset($form_state['input'][$identifier][$prefix])) { |
382 |
$form_state['input'][$identifier][$prefix] = $this->value[$prefix]; |
|
384 |
// Ensure these exist. |
|
385 |
foreach ($granularity as $key) { |
|
386 |
$form_state['input'][$identifier][$prefix][$key] = NULL; |
|
387 |
} |
|
383 | 388 |
} |
384 | 389 |
} |
385 | 390 |
else { |
... | ... | |
530 | 535 |
} |
531 | 536 |
|
532 | 537 |
} |
538 |
// @codingStandardsIgnoreEnd |
Formats disponibles : Unified diff
Weekly update of contrib modules