Révision 5d12d676
Ajouté par Assos Assos il y a environ 6 ans
drupal7/sites/all/modules/views/handlers/views_handler_field_time_interval.inc | ||
---|---|---|
11 | 11 |
* @ingroup views_field_handlers |
12 | 12 |
*/ |
13 | 13 |
class views_handler_field_time_interval extends views_handler_field { |
14 |
function option_definition() { |
|
14 |
|
|
15 |
/** |
|
16 |
* {@inheritdoc} |
|
17 |
*/ |
|
18 |
public function option_definition() { |
|
15 | 19 |
$options = parent::option_definition(); |
16 | 20 |
|
17 | 21 |
$options['granularity'] = array('default' => 2); |
... | ... | |
19 | 23 |
return $options; |
20 | 24 |
} |
21 | 25 |
|
22 |
function options_form(&$form, &$form_state) { |
|
26 |
/** |
|
27 |
* {@inheritdoc} |
|
28 |
*/ |
|
29 |
public function options_form(&$form, &$form_state) { |
|
23 | 30 |
parent::options_form($form, $form_state); |
24 | 31 |
|
25 | 32 |
$form['granularity'] = array( |
... | ... | |
30 | 37 |
); |
31 | 38 |
} |
32 | 39 |
|
33 |
function render($values) { |
|
40 |
/** |
|
41 |
* {@inheritdoc} |
|
42 |
*/ |
|
43 |
public function render($values) { |
|
34 | 44 |
$value = $values->{$this->field_alias}; |
35 | 45 |
return format_interval($value, isset($this->options['granularity']) ? $this->options['granularity'] : 2); |
36 | 46 |
} |
47 |
|
|
37 | 48 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules