stableversion-3.0
Last change
on this file since 65dadeb was
65dadeb,
checked in by José Gregorio Puentes <jpuentes@…>, 8 años ago
|
se agregaron los archivos de la nueva version del modulo
|
-
Propiedad mode establecida a
100644
|
File size:
872 octetos
|
Línea | |
---|
1 | <?php |
---|
2 | /** |
---|
3 | * A handler to provide proper displays for time intervals. |
---|
4 | * |
---|
5 | * @ingroup views_field_handlers |
---|
6 | */ |
---|
7 | class views_handler_field_time_interval extends views_handler_field { |
---|
8 | function option_definition() { |
---|
9 | $options = parent::option_definition(); |
---|
10 | |
---|
11 | $options['granularity'] = array('default' => 2); |
---|
12 | |
---|
13 | return $options; |
---|
14 | } |
---|
15 | |
---|
16 | function options_form(&$form, &$form_state) { |
---|
17 | parent::options_form($form, $form_state); |
---|
18 | |
---|
19 | $form['granularity'] = array( |
---|
20 | '#type' => 'textfield', |
---|
21 | '#title' => t('Granularity'), |
---|
22 | '#description' => t('How many different units to display in the string.'), |
---|
23 | '#default_value' => $this->options['granularity'], |
---|
24 | ); |
---|
25 | } |
---|
26 | |
---|
27 | function render($values) { |
---|
28 | $value = $values->{$this->field_alias}; |
---|
29 | return format_interval($value, isset($this->options['granularity']) ? $this->options['granularity'] : 2); |
---|
30 | } |
---|
31 | } |
---|
Nota: Vea
TracBrowser
para ayuda de uso del navegador del repositorio.