source: sipes/modules_contrib/views/plugins/views_plugin_style_summary.inc @ 65dadeb

stableversion-3.0
Last change on this file since 65dadeb was 59029b2, checked in by José Gregorio Puentes <jpuentes@…>, 8 años ago

se actualizo la version del modulo views

  • Propiedad mode establecida a 100644
File size: 2.2 KB
Línea 
1<?php
2/**
3 * @file
4 * Contains the default summary style plugin, which displays items in an HTML list.
5 */
6
7/**
8 * The default style plugin for summaries.
9 *
10 * @ingroup views_style_plugins
11 */
12class views_plugin_style_summary extends views_plugin_style {
13  function option_definition() {
14    $options = parent::option_definition();
15
16    $options['base_path'] = array('default' => '');
17    $options['count'] = array('default' => TRUE, 'bool' => TRUE);
18    $options['override'] = array('default' => FALSE, 'bool' => TRUE);
19    $options['items_per_page'] = array('default' => 25);
20
21    return $options;
22  }
23
24  function query() {
25    if (!empty($this->options['override'])) {
26      $this->view->set_items_per_page(intval($this->options['items_per_page']));
27    }
28  }
29
30  function options_form(&$form, &$form_state) {
31    $form['base_path'] = array(
32      '#type' => 'textfield',
33      '#title' => t('Base path'),
34      '#default_value' => $this->options['base_path'],
35      '#description' => t('Define the base path for links in this summary
36        view, i.e. http://example.com/<strong>your_view_path/archive</strong>.
37        Do not include beginning and ending forward slash. If this value
38        is empty, views will use the first path found as the base path,
39        in page displays, or / if no path could be found.'),
40    );
41    $form['count'] = array(
42      '#type' => 'checkbox',
43      '#default_value' => !empty($this->options['count']),
44      '#title' => t('Display record count with link'),
45    );
46    $form['override'] = array(
47      '#type' => 'checkbox',
48      '#default_value' => !empty($this->options['override']),
49      '#title' => t('Override number of items to display'),
50    );
51    $form['items_per_page'] = array(
52      '#type' => 'textfield',
53      '#title' => t('Items to display'),
54      '#default_value' => $this->options['items_per_page'],
55      '#process' => array('views_process_dependency'),
56      '#dependency' => array('edit-style-options-override' => array(TRUE)),
57    );
58  }
59
60  function render() {
61    $rows = array();
62    foreach ($this->view->result as $row) {
63      // @todo: Include separator as an option.
64      $rows[] = $row;
65    }
66    return theme($this->theme_functions(), $this->view, $this->options, $rows);
67  }
68}
Nota: Vea TracBrowser para ayuda de uso del navegador del repositorio.