Révision 5d12d676
Ajouté par Assos Assos il y a environ 6 ans
drupal7/sites/all/modules/views/plugins/views_plugin_style_summary.inc | ||
---|---|---|
2 | 2 |
|
3 | 3 |
/** |
4 | 4 |
* @file |
5 |
* Contains the default summary style plugin, which displays items in an HTML list.
|
|
5 |
* Definition of views_plugin_style_summary.
|
|
6 | 6 |
*/ |
7 | 7 |
|
8 | 8 |
/** |
... | ... | |
11 | 11 |
* @ingroup views_style_plugins |
12 | 12 |
*/ |
13 | 13 |
class views_plugin_style_summary extends views_plugin_style { |
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['base_path'] = array('default' => ''); |
... | ... | |
22 | 26 |
return $options; |
23 | 27 |
} |
24 | 28 |
|
25 |
function query() { |
|
29 |
/** |
|
30 |
* {@inheritdoc} |
|
31 |
*/ |
|
32 |
public function query() { |
|
26 | 33 |
if (!empty($this->options['override'])) { |
27 | 34 |
$this->view->set_items_per_page(intval($this->options['items_per_page'])); |
28 | 35 |
} |
29 | 36 |
} |
30 | 37 |
|
31 |
function options_form(&$form, &$form_state) { |
|
38 |
/** |
|
39 |
* {@inheritdoc} |
|
40 |
*/ |
|
41 |
public function options_form(&$form, &$form_state) { |
|
32 | 42 |
$form['base_path'] = array( |
33 | 43 |
'#type' => 'textfield', |
34 | 44 |
'#title' => t('Base path'), |
... | ... | |
55 | 65 |
'#title' => t('Items to display'), |
56 | 66 |
'#default_value' => $this->options['items_per_page'], |
57 | 67 |
'#dependency' => array( |
58 |
'edit-options-summary-options-' . str_replace('_', '-', $this->definition['name']) . '-override' => array(1) |
|
68 |
'edit-options-summary-options-' . str_replace('_', '-', $this->definition['name']) . '-override' => array(1),
|
|
59 | 69 |
), |
60 | 70 |
); |
61 | 71 |
} |
62 | 72 |
|
63 |
function render() { |
|
73 |
/** |
|
74 |
* {@inheritdoc} |
|
75 |
*/ |
|
76 |
public function render() { |
|
64 | 77 |
$rows = array(); |
65 | 78 |
foreach ($this->view->result as $row) { |
66 |
// @todo: Include separator as an option.
|
|
79 |
// @todo Include separator as an option. |
|
67 | 80 |
$rows[] = $row; |
68 | 81 |
} |
69 | 82 |
|
70 | 83 |
return theme($this->theme_functions(), array( |
71 | 84 |
'view' => $this->view, |
72 | 85 |
'options' => $this->options, |
73 |
'rows' => $rows |
|
86 |
'rows' => $rows,
|
|
74 | 87 |
)); |
75 | 88 |
} |
89 |
|
|
76 | 90 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules