/[drupal]/contributions/modules/nodecomment/nodecomment.views_default.inc
ViewVC logotype

Contents of /contributions/modules/nodecomment/nodecomment.views_default.inc

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


Revision 1.3 - (show annotations) (download) (as text)
Thu Sep 25 18:08:55 2008 UTC (13 months, 4 weeks ago) by sirkitree
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -17 lines
File MIME type: text/x-php
#312459: patch by Roger López, where node type filter was causing problem. Should take care of a few issues.
1 <?php
2 // $Id: nodecomment.views_default.inc,v 1.2 2008/09/25 17:58:03 sirkitree Exp $
3 /**
4 * @file
5 * Contains default views on behalf of the nodecomment module.
6 */
7
8 /**
9 * Implementation of hook_default_view_views().
10 */
11 function nodecomment_views_default_views() {
12 $view = new view;
13 $view->name = 'nodecomments';
14 $view->description = 'Node comments flat';
15 $view->tag = '';
16 $view->view_php = '';
17 $view->base_table = 'node';
18 $view->is_cacheable = FALSE;
19 $view->api_version = 2;
20 $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
21 $handler = $view->new_display('default', 'nodecomments', 'default');
22 $handler->override_option('relationships', array(
23 'nid' => array(
24 'label' => 'Node',
25 'required' => 0,
26 'id' => 'nid',
27 'table' => 'node_comments',
28 'field' => 'nid',
29 'relationship' => 'none',
30 ),
31 ));
32 $handler->override_option('fields', array(
33 'title' => array(
34 'label' => 'Title',
35 'link_to_node' => 0,
36 'exclude' => 0,
37 'id' => 'title',
38 'table' => 'node',
39 'field' => 'title',
40 'relationship' => 'none',
41 ),
42 'name' => array(
43 'label' => 'Author',
44 'link_to_user' => 1,
45 'exclude' => 0,
46 'id' => 'name',
47 'table' => 'node_comments',
48 'field' => 'name',
49 'relationship' => 'none',
50 ),
51 'thread' => array(
52 'label' => 'Depth',
53 'exclude' => 0,
54 'id' => 'thread',
55 'table' => 'node_comments',
56 'field' => 'thread',
57 'relationship' => 'none',
58 ),
59 ));
60 $handler->override_option('arguments', array(
61 'nid' => array(
62 'default_action' => 'not found',
63 'style_plugin' => 'default_summary',
64 'style_options' => array(),
65 'wildcard' => 'all',
66 'wildcard_substitution' => 'All',
67 'title' => '',
68 'default_argument_type' => 'fixed',
69 'default_argument' => '',
70 'validate_type' => 'none',
71 'validate_fail' => 'not found',
72 'break_phrase' => 0,
73 'not' => 0,
74 'id' => 'nid',
75 'table' => 'node',
76 'field' => 'nid',
77 'relationship' => 'nid',
78 'default_options_div_prefix' => '',
79 'default_argument_user' => 0,
80 'default_argument_fixed' => '',
81 'default_argument_php' => '',
82 'validate_argument_node_type' => array(
83 'comment' => 0,
84 'page' => 0,
85 'story' => 0,
86 ),
87 'validate_argument_node_access' => 0,
88 'validate_argument_nid_type' => 'nid',
89 'validate_argument_vocabulary' => array(),
90 'validate_argument_type' => 'tid',
91 'validate_argument_php' => '',
92 ),
93 ));
94 $handler->override_option('filters', array(
95 'status' => array(
96 'operator' => '=',
97 'value' => 1,
98 'group' => '0',
99 'exposed' => FALSE,
100 'expose' => array(
101 'operator' => FALSE,
102 'label' => '',
103 ),
104 'id' => 'status',
105 'table' => 'node',
106 'field' => 'status',
107 'relationship' => 'none',
108 ),
109 ));
110 $handler->override_option('access', array(
111 'type' => 'none',
112 'role' => array(),
113 'perm' => '',
114 ));
115 $handler->override_option('items_per_page', 0);
116 $handler->override_option('style_options', array(
117 'grouping' => '',
118 ));
119 $handler->override_option('row_plugin', 'node');
120 $handler->override_option('row_options', array(
121 'teaser' => 0,
122 'links' => 1,
123 ));
124 $views[$view->name] = $view;
125
126 $view = new view;
127 $view->name = 'nodecomments_threaded';
128 $view->description = 'Node comments threaded';
129 $view->tag = '';
130 $view->view_php = '';
131 $view->base_table = 'node';
132 $view->is_cacheable = FALSE;
133 $view->api_version = 2;
134 $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
135 $handler = $view->new_display('default', 'nodecomments', 'default');
136 $handler->override_option('relationships', array(
137 'nid' => array(
138 'label' => 'Node',
139 'required' => 0,
140 'id' => 'nid',
141 'table' => 'node_comments',
142 'field' => 'nid',
143 'relationship' => 'none',
144 ),
145 ));
146 $handler->override_option('fields', array(
147 'title' => array(
148 'label' => 'Title',
149 'link_to_node' => 0,
150 'exclude' => 0,
151 'id' => 'title',
152 'table' => 'node',
153 'field' => 'title',
154 'relationship' => 'none',
155 ),
156 'name' => array(
157 'label' => 'Author',
158 'link_to_user' => 1,
159 'exclude' => 0,
160 'id' => 'name',
161 'table' => 'node_comments',
162 'field' => 'name',
163 'relationship' => 'none',
164 ),
165 'thread' => array(
166 'label' => 'Depth',
167 'exclude' => 0,
168 'id' => 'thread',
169 'table' => 'node_comments',
170 'field' => 'thread',
171 'relationship' => 'none',
172 ),
173 ));
174 $handler->override_option('sorts', array(
175 'thread' => array(
176 'order' => 'ASC',
177 'id' => 'thread',
178 'table' => 'node_comments',
179 'field' => 'thread',
180 'relationship' => 'none',
181 ),
182 ));
183 $handler->override_option('arguments', array(
184 'nid' => array(
185 'default_action' => 'not found',
186 'style_plugin' => 'default_summary',
187 'style_options' => array(),
188 'wildcard' => 'all',
189 'wildcard_substitution' => 'All',
190 'title' => '',
191 'default_argument_type' => 'fixed',
192 'default_argument' => '',
193 'validate_type' => 'none',
194 'validate_fail' => 'not found',
195 'break_phrase' => 0,
196 'not' => 0,
197 'id' => 'nid',
198 'table' => 'node',
199 'field' => 'nid',
200 'relationship' => 'nid',
201 'default_options_div_prefix' => '',
202 'default_argument_user' => 0,
203 'default_argument_fixed' => '',
204 'default_argument_php' => '',
205 'validate_argument_node_type' => array(
206 'comment' => 0,
207 'page' => 0,
208 'story' => 0,
209 ),
210 'validate_argument_node_access' => 0,
211 'validate_argument_nid_type' => 'nid',
212 'validate_argument_vocabulary' => array(),
213 'validate_argument_type' => 'tid',
214 'validate_argument_php' => '',
215 ),
216 ));
217 $handler->override_option('filters', array(
218 'status' => array(
219 'operator' => '=',
220 'value' => 1,
221 'group' => '0',
222 'exposed' => FALSE,
223 'expose' => array(
224 'operator' => FALSE,
225 'label' => '',
226 ),
227 'id' => 'status',
228 'table' => 'node',
229 'field' => 'status',
230 'relationship' => 'none',
231 ),
232 'type' => array(
233 'operator' => 'in',
234 'value' => array(
235 'comment' => 'comment',
236 ),
237 'group' => '0',
238 'exposed' => FALSE,
239 'expose' => array(
240 'operator' => FALSE,
241 'label' => '',
242 ),
243 'id' => 'type',
244 'table' => 'node',
245 'field' => 'type',
246 'relationship' => 'none',
247 ),
248 ));
249 $handler->override_option('access', array(
250 'type' => 'none',
251 'role' => array(),
252 'perm' => '',
253 ));
254 $handler->override_option('items_per_page', 0);
255 $handler->override_option('style_plugin', 'nodecomment_threaded');
256 $handler->override_option('row_plugin', 'node');
257 $handler->override_option('row_options', array(
258 'teaser' => 1,
259 'links' => 1,
260 ));
261 $views[$view->name] = $view;
262
263 return $views;
264 }

  ViewVC Help
Powered by ViewVC 1.1.2