Advertisement
kwixson

candidates view

May 13th, 2012
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.98 KB | None | 0 0
  1. $view = new view;
  2. $view->name = 'candidates';
  3. $view->description = 'Table view of candidates';
  4. $view->tag = '';
  5. $view->view_php = '';
  6. $view->base_table = 'node';
  7. $view->is_cacheable = FALSE;
  8. $view->api_version = 2;
  9. $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
  10. $handler = $view->new_display('default', 'Defaults', 'default');
  11. $handler->override_option('relationships', array(
  12. 'term_node_tid' => array(
  13. 'label' => 'Election Year',
  14. 'required' => 1,
  15. 'vids' => array(
  16. '2' => 2,
  17. '6' => 0,
  18. '4' => 0,
  19. '1' => 0,
  20. '3' => 0,
  21. '9' => 0,
  22. '7' => 0,
  23. ),
  24. 'id' => 'term_node_tid',
  25. 'table' => 'node',
  26. 'field' => 'term_node_tid',
  27. 'relationship' => 'none',
  28. ),
  29. 'term_node_tid_1' => array(
  30. 'label' => 'Office Type',
  31. 'required' => 1,
  32. 'vids' => array(
  33. '1' => 1,
  34. '6' => 0,
  35. '4' => 0,
  36. '2' => 0,
  37. '3' => 0,
  38. '9' => 0,
  39. '7' => 0,
  40. ),
  41. 'id' => 'term_node_tid_1',
  42. 'table' => 'node',
  43. 'field' => 'term_node_tid',
  44. 'relationship' => 'none',
  45. ),
  46. ));
  47. $handler->override_option('fields', array(
  48. 'field_first_value' => array(
  49. 'label' => 'First Name',
  50. 'alter' => array(
  51. 'alter_text' => 0,
  52. 'text' => '',
  53. 'make_link' => 0,
  54. 'path' => '',
  55. 'link_class' => '',
  56. 'alt' => '',
  57. 'prefix' => '',
  58. 'suffix' => '',
  59. 'target' => '',
  60. 'help' => '',
  61. 'trim' => 0,
  62. 'max_length' => '',
  63. 'word_boundary' => 1,
  64. 'ellipsis' => 1,
  65. 'html' => 0,
  66. 'strip_tags' => 0,
  67. ),
  68. 'empty' => '',
  69. 'hide_empty' => 0,
  70. 'empty_zero' => 0,
  71. 'link_to_node' => 0,
  72. 'label_type' => 'widget',
  73. 'format' => 'default',
  74. 'multiple' => array(
  75. 'group' => TRUE,
  76. 'multiple_number' => '',
  77. 'multiple_from' => '',
  78. 'multiple_reversed' => FALSE,
  79. ),
  80. 'exclude' => 1,
  81. 'id' => 'field_first_value',
  82. 'table' => 'node_data_field_first',
  83. 'field' => 'field_first_value',
  84. 'relationship' => 'none',
  85. ),
  86. 'title' => array(
  87. 'label' => 'Name',
  88. 'alter' => array(
  89. 'alter_text' => 1,
  90. 'text' => '<span class="name">[field_first_value] [title]</span>',
  91. 'make_link' => 0,
  92. 'path' => '',
  93. 'link_class' => '',
  94. 'alt' => '',
  95. 'prefix' => '',
  96. 'suffix' => '',
  97. 'target' => '',
  98. 'help' => '',
  99. 'trim' => 0,
  100. 'max_length' => '',
  101. 'word_boundary' => 1,
  102. 'ellipsis' => 1,
  103. 'html' => 0,
  104. 'strip_tags' => 0,
  105. ),
  106. 'empty' => '',
  107. 'hide_empty' => 0,
  108. 'empty_zero' => 0,
  109. 'link_to_node' => 1,
  110. 'exclude' => 0,
  111. 'id' => 'title',
  112. 'table' => 'node',
  113. 'field' => 'title',
  114. 'relationship' => 'none',
  115. 'override' => array(
  116. 'button' => 'Override',
  117. ),
  118. ),
  119. 'field_office_value' => array(
  120. 'id' => 'field_office_value',
  121. 'table' => 'node_data_field_office',
  122. 'field' => 'field_office_value',
  123. ),
  124. 'tid_1' => array(
  125. 'label' => 'Office Type',
  126. 'alter' => array(
  127. 'alter_text' => 0,
  128. 'text' => '',
  129. 'make_link' => 0,
  130. 'path' => '',
  131. 'link_class' => '',
  132. 'alt' => '',
  133. 'prefix' => '',
  134. 'suffix' => '',
  135. 'target' => '',
  136. 'help' => '',
  137. 'trim' => 0,
  138. 'max_length' => '',
  139. 'word_boundary' => 1,
  140. 'ellipsis' => 1,
  141. 'html' => 0,
  142. 'strip_tags' => 0,
  143. ),
  144. 'empty' => '',
  145. 'hide_empty' => 0,
  146. 'empty_zero' => 0,
  147. 'type' => 'separator',
  148. 'separator' => ', ',
  149. 'link_to_taxonomy' => 1,
  150. 'limit' => 1,
  151. 'vids' => array(
  152. '1' => 1,
  153. '6' => 0,
  154. '4' => 0,
  155. '2' => 0,
  156. '3' => 0,
  157. '9' => 0,
  158. '7' => 0,
  159. ),
  160. 'exclude' => 0,
  161. 'id' => 'tid_1',
  162. 'table' => 'term_node',
  163. 'field' => 'tid',
  164. 'relationship' => 'none',
  165. ),
  166. 'tid' => array(
  167. 'label' => 'Election Year',
  168. 'alter' => array(
  169. 'alter_text' => 0,
  170. 'text' => '',
  171. 'make_link' => 0,
  172. 'path' => '',
  173. 'link_class' => '',
  174. 'alt' => '',
  175. 'prefix' => '',
  176. 'suffix' => '',
  177. 'target' => '',
  178. 'help' => '',
  179. 'trim' => 0,
  180. 'max_length' => '',
  181. 'word_boundary' => 1,
  182. 'ellipsis' => 1,
  183. 'html' => 0,
  184. 'strip_tags' => 0,
  185. ),
  186. 'empty' => '',
  187. 'hide_empty' => 0,
  188. 'empty_zero' => 0,
  189. 'type' => 'separator',
  190. 'separator' => ', ',
  191. 'link_to_taxonomy' => 1,
  192. 'limit' => 1,
  193. 'vids' => array(
  194. '2' => 2,
  195. '6' => 0,
  196. '4' => 0,
  197. '1' => 0,
  198. '3' => 0,
  199. '9' => 0,
  200. '7' => 0,
  201. ),
  202. 'exclude' => 1,
  203. 'id' => 'tid',
  204. 'table' => 'term_node',
  205. 'field' => 'tid',
  206. 'relationship' => 'none',
  207. ),
  208. ));
  209. $handler->override_option('sorts', array(
  210. 'weight' => array(
  211. 'order' => 'ASC',
  212. 'id' => 'weight',
  213. 'table' => 'term_data',
  214. 'field' => 'weight',
  215. 'override' => array(
  216. 'button' => 'Override',
  217. ),
  218. 'relationship' => 'none',
  219. ),
  220. ));
  221. $handler->override_option('filters', array(
  222. 'status' => array(
  223. 'operator' => '=',
  224. 'value' => '1',
  225. 'group' => '0',
  226. 'exposed' => FALSE,
  227. 'expose' => array(
  228. 'operator' => FALSE,
  229. 'label' => '',
  230. ),
  231. 'id' => 'status',
  232. 'table' => 'node',
  233. 'field' => 'status',
  234. 'relationship' => 'none',
  235. ),
  236. 'type' => array(
  237. 'operator' => 'in',
  238. 'value' => array(
  239. 'candidate' => 'candidate',
  240. ),
  241. 'group' => '0',
  242. 'exposed' => FALSE,
  243. 'expose' => array(
  244. 'operator' => FALSE,
  245. 'label' => '',
  246. ),
  247. 'id' => 'type',
  248. 'table' => 'node',
  249. 'field' => 'type',
  250. 'relationship' => 'none',
  251. ),
  252. ));
  253. $handler->override_option('access', array(
  254. 'type' => 'none',
  255. ));
  256. $handler->override_option('cache', array(
  257. 'type' => 'none',
  258. ));
  259. $handler->override_option('items_per_page', 0);
  260. $handler->override_option('distinct', 1);
  261. $handler->override_option('style_plugin', 'table');
  262. $handler->override_option('style_options', array(
  263. 'grouping' => 'tid',
  264. 'override' => 1,
  265. 'sticky' => 0,
  266. 'order' => 'asc',
  267. 'columns' => array(
  268. 'title' => 'title',
  269. 'field_office_value' => 'field_office_value',
  270. 'tid' => 'tid',
  271. ),
  272. 'info' => array(
  273. 'title' => array(
  274. 'sortable' => 0,
  275. 'separator' => '',
  276. ),
  277. 'field_office_value' => array(
  278. 'sortable' => 0,
  279. 'separator' => '',
  280. ),
  281. 'tid' => array(
  282. 'separator' => '',
  283. ),
  284. ),
  285. 'default' => '-1',
  286. ));
  287. $handler = $view->new_display('page', 'Page', 'page_1');
  288. $handler->override_option('path', 'candidates');
  289. $handler->override_option('menu', array(
  290. 'type' => 'none',
  291. 'title' => '',
  292. 'description' => '',
  293. 'weight' => 0,
  294. 'name' => 'navigation',
  295. ));
  296. $handler->override_option('tab_options', array(
  297. 'type' => 'none',
  298. 'title' => '',
  299. 'description' => '',
  300. 'weight' => 0,
  301. 'name' => 'navigation',
  302. ));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement