/[drupal]/contributions/modules/views/plugins/views_plugin_style_summary.inc
ViewVC logotype

Contents of /contributions/modules/views/plugins/views_plugin_style_summary.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download) (as text)
Wed Sep 3 19:21:30 2008 UTC (14 months, 3 weeks ago) by merlinofchaos
Branch: MAIN
CVS Tags: DRUPAL-6--2-7, DRUPAL-6--2-6, DRUPAL-6--2-5, DRUPAL-6--2-4, DRUPAL-6--2-3, DRUPAL-6--2-2, DRUPAL-6--2-1, DRUPAL-6--2-0, DRUPAL-6--3-0-ALPHA1, DRUPAL-6--2-0-RC5, DRUPAL-6--2-0-RC4, DRUPAL-6--2-0-RC3, DRUPAL-6--2-0-RC2, HEAD
Branch point for: DRUPAL-6--2, DRUPAL-6--3, DRUPAL-7--3
File MIME type: text/x-php
Major re-organization of handlers. PLEASE NOTE: This drastically affected the Views module API and until modules are updated to match, they will stop working. Efforts have been made to ensure that this won't cause your site to crash, but that's partly up to the individual module as well.
1 <?php
2 // $Id: comment.views_default.inc,v 1.6 2008/06/10 21:30:43 merlinofchaos Exp $
3 /**
4 * @file
5 * Contains the default summary style plugin, which displays items in an HTML list.
6 */
7
8 /**
9 * The default style plugin for summaries.
10 *
11 * @ingroup views_style_plugins
12 */
13 class views_plugin_style_summary extends views_plugin_style {
14 function option_definition() {
15 $options = parent::option_definition();
16
17 $options['count'] = array('default' => TRUE);
18 $options['override'] = array('default' => FALSE);
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['count'] = array(
32 '#type' => 'checkbox',
33 '#default_value' => !empty($this->options['count']),
34 '#title' => t('Display record count with link'),
35 );
36 $form['override'] = array(
37 '#type' => 'checkbox',
38 '#default_value' => !empty($this->options['override']),
39 '#title' => t('Override number of items to display'),
40 );
41 $form['items_per_page'] = array(
42 '#type' => 'textfield',
43 '#title' => t('Items to display'),
44 '#default_value' => $this->options['items_per_page'],
45 '#process' => array('views_process_dependency'),
46 '#dependency' => array('edit-style-options-override' => array(TRUE)),
47 );
48 }
49
50 function render() {
51 $rows = array();
52 foreach ($this->view->result as $row) {
53 // @todo: Include separator as an option.
54 $rows[] = $row;
55 }
56 return theme($this->theme_functions(), $this->view, $this->options, $rows);
57 }
58 }
59

  ViewVC Help
Powered by ViewVC 1.1.2