stableversion-3.0
Last change
on this file since 177a560 was
177a560,
checked in by José Gregorio Puentes <jpuentes@…>, 8 años ago
|
se agrego el directorio de modulos contribuidos de drupal
|
-
Propiedad mode establecida a
100755
|
File size:
856 octetos
|
Línea | |
---|
1 | <?php |
---|
2 | // $Id: views_customfield_handler_field_rownumber.inc,v 1.1.2.6 2009/04/01 10:24:23 casey Exp $ |
---|
3 | |
---|
4 | /** |
---|
5 | * @file |
---|
6 | * Contains the 'customfield' rownumber field handler. |
---|
7 | */ |
---|
8 | |
---|
9 | /** |
---|
10 | * Field handler to provide a rownumber. |
---|
11 | */ |
---|
12 | class views_customfield_handler_field_rownumber extends views_handler_field { |
---|
13 | var $rownumber; |
---|
14 | |
---|
15 | function init(&$view, $options) { |
---|
16 | parent::init($view, $options); |
---|
17 | |
---|
18 | $this->rownumbers = 0; |
---|
19 | } |
---|
20 | |
---|
21 | function query() { |
---|
22 | // Override parent::query() and don't alter query. |
---|
23 | $this->field_alias = 'customfield_rownumber_'. $this->position; |
---|
24 | } |
---|
25 | |
---|
26 | function render($values) { |
---|
27 | if ($this->view->pager['use_pager']) { |
---|
28 | return ++$this->rownumbers + ($this->view->pager['current_page'] * $this->view->pager['items_per_page']) + $this->view->pager['offset']; |
---|
29 | }else { |
---|
30 | return ++$this->rownumbers; |
---|
31 | } |
---|
32 | } |
---|
33 | } |
---|
Nota: Vea
TracBrowser
para ayuda de uso del navegador del repositorio.