/[drupal]/contributions/modules/timeline/timeline.views.inc
ViewVC logotype

Contents of /contributions/modules/timeline/timeline.views.inc

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


Revision 1.8 - (show annotations) (download) (as text)
Sat Jul 25 02:14:49 2009 UTC (4 months ago) by xamanu
Branch: MAIN
CVS Tags: HEAD
Changes since 1.7: +0 -0 lines
File MIME type: text/x-php
Bringing HEAD in sync with the DRUPAL-6--2 branch
1 <?php
2 // $Id: timeline.views.inc,v 1.6.2.3.2.4 2009/07/24 02:15:32 xamanu Exp $
3 /**
4 * @file
5 * Views plugins definition for timeline.
6 */
7
8 /**
9 * Implementation of hook_views_style_plugins(). Adds view types to views UI interface.
10 */
11 function timeline_views_plugins() {
12 return array(
13 'style' => array(
14 'timeline' => array(
15 'title' => t('Timeline'),
16 'help' => t('Displays content on a SIMILE Timeline.'),
17 'handler' => 'views_views_plugin_style_timeline',
18 'theme' => 'views_view_timeline',
19 'uses fields' => TRUE,
20 'uses options' => TRUE,
21 'type' => 'normal',
22 'uses row plugin' => TRUE,
23 ),
24 ),
25 );
26 }
27
28
29 /**
30 * Implementation of hook_views_default_views().
31 */
32 function timeline_views_default_views() {
33 $views = array();
34
35 // Add timeline_nodes view.
36 $view = new view;
37 $view->name = 'timeline_nodes';
38 $view->description = 'Example timeline of nodes';
39 $view->tag = '';
40 $view->view_php = '';
41 $view->base_table = 'node';
42 $view->is_cacheable = FALSE;
43 $view->api_version = 2;
44 $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
45 $handler = $view->new_display('default', 'Defaults', 'default');
46 $handler->override_option('fields', array(
47 'created' => array(
48 'label' => 'Post date',
49 'alter' => array(
50 'alter_text' => 0,
51 'text' => '',
52 'make_link' => 0,
53 'path' => '',
54 'link_class' => '',
55 'alt' => '',
56 'prefix' => '',
57 'suffix' => '',
58 'target' => '',
59 'help' => '',
60 'trim' => 0,
61 'max_length' => '',
62 'word_boundary' => 1,
63 'ellipsis' => 1,
64 'strip_tags' => 0,
65 'html' => 0,
66 ),
67 'empty' => '',
68 'hide_empty' => 0,
69 'empty_zero' => 0,
70 'date_format' => 'small',
71 'custom_date_format' => '',
72 'exclude' => 0,
73 'id' => 'created',
74 'table' => 'node',
75 'field' => 'created',
76 'relationship' => 'none',
77 ),
78 'title' => array(
79 'label' => 'Title',
80 'link_to_node' => 0,
81 'exclude' => 0,
82 'id' => 'title',
83 'table' => 'node',
84 'field' => 'title',
85 'relationship' => 'none',
86 ),
87 'body' => array(
88 'id' => 'body',
89 'table' => 'node_revisions',
90 'field' => 'body',
91 ),
92 ));
93 $handler->override_option('sorts', array(
94 'created' => array(
95 'order' => 'ASC',
96 'granularity' => 'second',
97 'id' => 'created',
98 'table' => 'node',
99 'field' => 'created',
100 'relationship' => 'none',
101 ),
102 ));
103 $handler->override_option('filters', array(
104 'status' => array(
105 'operator' => '=',
106 'value' => '1',
107 'group' => '0',
108 'exposed' => FALSE,
109 'expose' => array(
110 'operator' => FALSE,
111 'label' => '',
112 ),
113 'id' => 'status',
114 'table' => 'node',
115 'field' => 'status',
116 'relationship' => 'none',
117 ),
118 ));
119 $handler->override_option('access', array(
120 'type' => 'none',
121 ));
122 $handler->override_option('cache', array(
123 'type' => 'none',
124 ));
125 $handler->override_option('items_per_page', 0);
126 $handler->override_option('style_plugin', 'timeline');
127 $handler->override_option('style_options', array(
128 'grouping' => '',
129 'colors' => array(
130 'values' => '',
131 ),
132 'display' => array(
133 'type' => '0',
134 'width' => '100%',
135 'height' => '400px',
136 'appearance' => array(
137 'theme' => 'ClassicTheme',
138 'bubble_width' => '250',
139 'bubble_height' => '',
140 ),
141 ),
142 'fields' => array(
143 'title' => 'title',
144 'start' => 'created',
145 'end' => 'created',
146 'advanced' => array(
147 'earliestStart' => 'created',
148 'latestEnd' => 'created',
149 ),
150 ),
151 'bands' => array(
152 'band1_unit' => 'week',
153 'band2_unit' => 'month',
154 'focus' => 'today',
155 'focus_custom' => '',
156 ),
157 ));
158 $handler = $view->new_display('page', 'Page', 'page_1');
159 $handler->override_option('path', 'timeline/nodes');
160 $handler->override_option('menu', array(
161 'type' => 'none',
162 'title' => '',
163 'weight' => 0,
164 ));
165 $handler->override_option('tab_options', array(
166 'type' => 'none',
167 'title' => '',
168 'weight' => 0,
169 ));
170 $views[$view->name] = $view;
171
172 return $views;
173 }

  ViewVC Help
Powered by ViewVC 1.1.2