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

Contents of /contributions/modules/views/plugins/views_plugin_display_default.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 display plugin.
6 */
7
8 /**
9 * A plugin to handle defaults on a view.
10 *
11 * @ingroup views_display_plugins
12 */
13 class views_plugin_display_default extends views_plugin_display {
14 /**
15 * Determine if this display is the 'default' display which contains
16 * fallback settings
17 */
18 function is_default_display() { return TRUE; }
19
20 /**
21 * The default execute handler fully renders the view.
22 *
23 * For the simplest use:
24 * @code
25 * $output = $view->execute_display('default', $args);
26 * @endcode
27 *
28 * For more complex usages, a view can be partially built:
29 * @code
30 * $view->set_arguments($args);
31 * $view->build('default'); // Build the query
32 * $view->execute(); // Run the query
33 * $output = $view->render(); // Render the view
34 * @endcode
35 *
36 * If short circuited at any point, look in $view->build_info for
37 * information about the query. After execute, look in $view->result
38 * for the array of objects returned from db_query.
39 *
40 * You can also do:
41 * @code
42 * $view->set_arguments($args);
43 * $output = $view->render('default'); // Render the view
44 * @endcode
45 *
46 * This illustrates that render is smart enough to call build and execute
47 * if these items have not already been accomplished.
48 *
49 * Note that execute also must accomplish other tasks, such
50 * as setting page titles, breadcrumbs, and generating exposed filter
51 * data if necessary.
52 */
53 function execute() {
54 return $this->view->render($this->display->id);
55 }
56 }

  ViewVC Help
Powered by ViewVC 1.1.2