location.views_default.inc 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621
  1. <?php
  2. /**
  3. * @file
  4. * Default views for location module.
  5. */
  6. /**
  7. * Implementation of hook_default_view_views().
  8. */
  9. function location_views_default_views() {
  10. $view = new view;
  11. $view->name = 'location_table';
  12. $view->description = 'Node location table.';
  13. $view->tag = '';
  14. $view->view_php = '';
  15. $view->base_table = 'node';
  16. $view->is_cacheable = FALSE;
  17. $view->api_version = 2;
  18. $view->disabled = TRUE;
  19. $handler = $view->new_display('default', 'Defaults', 'default');
  20. $handler->override_option('fields', array(
  21. 'title' => array(
  22. 'label' => 'Title',
  23. 'link_to_node' => 1,
  24. 'exclude' => 0,
  25. 'id' => 'title',
  26. 'table' => 'node',
  27. 'field' => 'title',
  28. 'override' => array(
  29. 'button' => 'Override',
  30. ),
  31. 'relationship' => 'none',
  32. ),
  33. 'street' => array(
  34. 'label' => 'Street',
  35. 'style' => 'both',
  36. 'exclude' => 0,
  37. 'id' => 'street',
  38. 'table' => 'location',
  39. 'field' => 'street',
  40. 'override' => array(
  41. 'button' => 'Override',
  42. ),
  43. 'relationship' => 'none',
  44. ),
  45. 'city' => array(
  46. 'label' => 'City',
  47. 'exclude' => 0,
  48. 'id' => 'city',
  49. 'table' => 'location',
  50. 'field' => 'city',
  51. 'override' => array(
  52. 'button' => 'Override',
  53. ),
  54. 'relationship' => 'none',
  55. ),
  56. 'province' => array(
  57. 'label' => 'Province',
  58. 'style' => 'name',
  59. 'exclude' => 0,
  60. 'id' => 'province',
  61. 'table' => 'location',
  62. 'field' => 'province',
  63. 'relationship' => 'none',
  64. ),
  65. 'postal_code' => array(
  66. 'label' => 'Postal Code',
  67. 'exclude' => 0,
  68. 'id' => 'postal_code',
  69. 'table' => 'location',
  70. 'field' => 'postal_code',
  71. 'override' => array(
  72. 'button' => 'Override',
  73. ),
  74. 'relationship' => 'none',
  75. ),
  76. 'country' => array(
  77. 'label' => 'Country',
  78. 'style' => 'name',
  79. 'exclude' => 0,
  80. 'id' => 'country',
  81. 'table' => 'location',
  82. 'field' => 'country',
  83. 'relationship' => 'none',
  84. ),
  85. ));
  86. $handler->override_option('filters', array(
  87. 'status_extra' => array(
  88. 'operator' => '=',
  89. 'value' => '',
  90. 'group' => '0',
  91. 'exposed' => FALSE,
  92. 'expose' => array(
  93. 'operator' => FALSE,
  94. 'label' => '',
  95. ),
  96. 'id' => 'status_extra',
  97. 'table' => 'node',
  98. 'field' => 'status_extra',
  99. 'override' => array(
  100. 'button' => 'Override',
  101. ),
  102. 'relationship' => 'none',
  103. ),
  104. 'lid' => array(
  105. 'operator' => 'not empty',
  106. 'value' => array(
  107. 'value' => '',
  108. 'min' => '',
  109. 'max' => '',
  110. ),
  111. 'group' => '0',
  112. 'exposed' => FALSE,
  113. 'expose' => array(
  114. 'operator' => FALSE,
  115. 'label' => '',
  116. ),
  117. 'id' => 'lid',
  118. 'table' => 'location',
  119. 'field' => 'lid',
  120. 'relationship' => 'none',
  121. ),
  122. ));
  123. $handler->override_option('access', array(
  124. 'type' => 'perm',
  125. 'perm' => 'view node location table',
  126. ));
  127. $handler->override_option('style_plugin', 'table');
  128. $handler->override_option('style_options', array(
  129. 'grouping' => '',
  130. 'override' => 1,
  131. 'sticky' => 0,
  132. 'order' => 'asc',
  133. 'columns' => array(
  134. 'title' => 'title',
  135. 'street' => 'street',
  136. 'city' => 'city',
  137. 'province' => 'province',
  138. 'postal_code' => 'postal_code',
  139. 'country' => 'country',
  140. ),
  141. 'info' => array(
  142. 'title' => array(
  143. 'sortable' => 1,
  144. 'separator' => '',
  145. ),
  146. 'street' => array(
  147. 'sortable' => 1,
  148. 'separator' => '',
  149. ),
  150. 'city' => array(
  151. 'sortable' => 1,
  152. 'separator' => '',
  153. ),
  154. 'province' => array(
  155. 'sortable' => 1,
  156. 'separator' => '',
  157. ),
  158. 'postal_code' => array(
  159. 'sortable' => 1,
  160. 'separator' => '',
  161. ),
  162. 'country' => array(
  163. 'sortable' => 1,
  164. 'separator' => '',
  165. ),
  166. ),
  167. 'default' => '-1',
  168. ));
  169. $handler = $view->new_display('page', 'Page', 'page_1');
  170. $handler->override_option('path', 'location/views');
  171. $handler->override_option('menu', array(
  172. 'type' => 'normal',
  173. 'title' => 'Location table',
  174. 'weight' => '0',
  175. ));
  176. $handler->override_option('tab_options', array(
  177. 'type' => 'none',
  178. 'title' => '',
  179. 'weight' => 0,
  180. ));
  181. $views[$view->name] = $view;
  182. $view = new view;
  183. $view->name = 'location_directory';
  184. $view->description = 'Location directory filtered by arguments in the url.';
  185. $view->tag = '';
  186. $view->view_php = '';
  187. $view->base_table = 'node';
  188. $view->is_cacheable = FALSE;
  189. $view->api_version = 2;
  190. $view->disabled = TRUE;
  191. $handler = $view->new_display('default', 'Defaults', 'default');
  192. $handler->override_option('fields', array(
  193. 'title' => array(
  194. 'label' => 'Title',
  195. 'link_to_node' => 1,
  196. 'exclude' => 0,
  197. 'id' => 'title',
  198. 'table' => 'node',
  199. 'field' => 'title',
  200. 'relationship' => 'none',
  201. ),
  202. 'street' => array(
  203. 'label' => 'Street',
  204. 'style' => 'both',
  205. 'exclude' => 0,
  206. 'id' => 'street',
  207. 'table' => 'location',
  208. 'field' => 'street',
  209. 'relationship' => 'none',
  210. ),
  211. 'city' => array(
  212. 'label' => 'City',
  213. 'exclude' => 0,
  214. 'id' => 'city',
  215. 'table' => 'location',
  216. 'field' => 'city',
  217. 'relationship' => 'none',
  218. ),
  219. 'province' => array(
  220. 'label' => 'Province',
  221. 'style' => 'name',
  222. 'exclude' => 0,
  223. 'id' => 'province',
  224. 'table' => 'location',
  225. 'field' => 'province',
  226. 'relationship' => 'none',
  227. ),
  228. 'postal_code' => array(
  229. 'label' => 'Postal Code',
  230. 'exclude' => 0,
  231. 'id' => 'postal_code',
  232. 'table' => 'location',
  233. 'field' => 'postal_code',
  234. 'relationship' => 'none',
  235. ),
  236. 'country' => array(
  237. 'label' => 'Country',
  238. 'style' => 'name',
  239. 'exclude' => 0,
  240. 'id' => 'country',
  241. 'table' => 'location',
  242. 'field' => 'country',
  243. 'relationship' => 'none',
  244. ),
  245. ));
  246. $handler->override_option('arguments', array(
  247. 'country' => array(
  248. 'default_action' => 'summary asc',
  249. 'style_plugin' => 'default_summary',
  250. 'style_options' => array(
  251. 'count' => 1,
  252. 'override' => 0,
  253. 'items_per_page' => '25',
  254. ),
  255. 'wildcard' => 'all',
  256. 'wildcard_substitution' => 'All',
  257. 'title' => '%1',
  258. 'default_argument_type' => 'fixed',
  259. 'default_argument' => '',
  260. 'validate_type' => 'none',
  261. 'validate_fail' => 'not found',
  262. 'id' => 'country',
  263. 'table' => 'location',
  264. 'field' => 'country',
  265. 'relationship' => 'none',
  266. 'default_options_div_prefix' => '',
  267. 'default_argument_fixed' => '',
  268. 'default_argument_php' => '',
  269. 'validate_argument_node_type' => array(
  270. 'page' => 0,
  271. 'story' => 0,
  272. ),
  273. 'validate_argument_node_access' => 0,
  274. 'validate_argument_nid_type' => 'nid',
  275. 'validate_argument_php' => '',
  276. ),
  277. 'province' => array(
  278. 'default_action' => 'summary asc',
  279. 'style_plugin' => 'default_summary',
  280. 'style_options' => array(
  281. 'count' => 1,
  282. 'override' => 0,
  283. 'items_per_page' => '25',
  284. ),
  285. 'wildcard' => 'all',
  286. 'wildcard_substitution' => 'All',
  287. 'title' => '%2',
  288. 'default_argument_type' => 'fixed',
  289. 'default_argument' => '',
  290. 'validate_type' => 'none',
  291. 'validate_fail' => 'not found',
  292. 'id' => 'province',
  293. 'table' => 'location',
  294. 'field' => 'province',
  295. 'relationship' => 'none',
  296. 'default_options_div_prefix' => '',
  297. 'default_argument_fixed' => '',
  298. 'default_argument_php' => '',
  299. 'validate_argument_node_type' => array(
  300. 'page' => 0,
  301. 'story' => 0,
  302. ),
  303. 'validate_argument_node_access' => 0,
  304. 'validate_argument_nid_type' => 'nid',
  305. 'validate_argument_php' => '',
  306. ),
  307. 'city' => array(
  308. 'default_action' => 'summary asc',
  309. 'style_plugin' => 'default_summary',
  310. 'style_options' => array(
  311. 'count' => 1,
  312. 'override' => 0,
  313. 'items_per_page' => '25',
  314. ),
  315. 'wildcard' => 'all',
  316. 'wildcard_substitution' => 'All',
  317. 'title' => '%3',
  318. 'default_argument_type' => 'fixed',
  319. 'default_argument' => '',
  320. 'validate_type' => 'none',
  321. 'validate_fail' => 'not found',
  322. 'glossary' => 1,
  323. 'limit' => '1',
  324. 'case' => 'none',
  325. 'path_case' => 'none',
  326. 'transform_dash' => 0,
  327. 'id' => 'city',
  328. 'table' => 'location',
  329. 'field' => 'city',
  330. 'relationship' => 'none',
  331. 'default_options_div_prefix' => '',
  332. 'default_argument_fixed' => '',
  333. 'default_argument_php' => '',
  334. 'validate_argument_node_type' => array(
  335. 'page' => 0,
  336. 'story' => 0,
  337. ),
  338. 'validate_argument_node_access' => 0,
  339. 'validate_argument_nid_type' => 'nid',
  340. 'validate_argument_php' => '',
  341. ),
  342. ));
  343. $handler->override_option('filters', array(
  344. 'status_extra' => array(
  345. 'operator' => '=',
  346. 'value' => '',
  347. 'group' => '0',
  348. 'exposed' => FALSE,
  349. 'expose' => array(
  350. 'operator' => FALSE,
  351. 'label' => '',
  352. ),
  353. 'id' => 'status_extra',
  354. 'table' => 'node',
  355. 'field' => 'status_extra',
  356. 'relationship' => 'none',
  357. ),
  358. 'lid' => array(
  359. 'operator' => 'not empty',
  360. 'value' => array(
  361. 'value' => '',
  362. 'min' => '',
  363. 'max' => '',
  364. ),
  365. 'group' => '0',
  366. 'exposed' => FALSE,
  367. 'expose' => array(
  368. 'operator' => FALSE,
  369. 'label' => '',
  370. ),
  371. 'id' => 'lid',
  372. 'table' => 'location',
  373. 'field' => 'lid',
  374. 'relationship' => 'none',
  375. ),
  376. ));
  377. $handler->override_option('access', array(
  378. 'type' => 'perm',
  379. 'perm' => 'view location directory',
  380. ));
  381. $handler->override_option('style_plugin', 'table');
  382. $handler->override_option('style_options', array(
  383. 'grouping' => '',
  384. 'override' => 1,
  385. 'sticky' => 0,
  386. 'order' => 'asc',
  387. 'columns' => array(
  388. 'title' => 'title',
  389. 'street' => 'street',
  390. 'city' => 'city',
  391. 'province' => 'province',
  392. 'postal_code' => 'postal_code',
  393. 'country' => 'country',
  394. ),
  395. 'info' => array(
  396. 'title' => array(
  397. 'sortable' => 1,
  398. 'separator' => '',
  399. ),
  400. 'street' => array(
  401. 'sortable' => 1,
  402. 'separator' => '',
  403. ),
  404. 'city' => array(
  405. 'sortable' => 1,
  406. 'separator' => '',
  407. ),
  408. 'province' => array(
  409. 'sortable' => 1,
  410. 'separator' => '',
  411. ),
  412. 'postal_code' => array(
  413. 'sortable' => 1,
  414. 'separator' => '',
  415. ),
  416. 'country' => array(
  417. 'sortable' => 1,
  418. 'separator' => '',
  419. ),
  420. ),
  421. 'default' => '-1',
  422. ));
  423. $handler = $view->new_display('page', 'Page', 'page_1');
  424. $handler->override_option('title', 'Locations');
  425. $handler->override_option('path', 'location/directory');
  426. $handler->override_option('menu', array(
  427. 'type' => 'normal',
  428. 'title' => 'Locations',
  429. 'weight' => '0',
  430. ));
  431. $handler->override_option('tab_options', array(
  432. 'type' => 'none',
  433. 'title' => '',
  434. 'weight' => 0,
  435. ));
  436. $views[$view->name] = $view;
  437. $view = new view;
  438. $view->name = 'user_location_table';
  439. $view->description = 'User location table.';
  440. $view->tag = '';
  441. $view->view_php = '';
  442. $view->base_table = 'users';
  443. $view->is_cacheable = FALSE;
  444. $view->api_version = 2;
  445. $view->disabled = TRUE;
  446. $handler = $view->new_display('default', 'Defaults', 'default');
  447. $handler->override_option('fields', array(
  448. 'name' => array(
  449. 'label' => 'Name',
  450. 'link_to_user' => 1,
  451. 'exclude' => 0,
  452. 'id' => 'name',
  453. 'table' => 'users',
  454. 'field' => 'name',
  455. 'override' => array(
  456. 'button' => 'Override',
  457. ),
  458. 'relationship' => 'none',
  459. ),
  460. 'street' => array(
  461. 'label' => 'Street',
  462. 'style' => 'both',
  463. 'exclude' => 0,
  464. 'id' => 'street',
  465. 'table' => 'location',
  466. 'field' => 'street',
  467. 'override' => array(
  468. 'button' => 'Override',
  469. ),
  470. 'relationship' => 'none',
  471. ),
  472. 'city' => array(
  473. 'label' => 'City',
  474. 'exclude' => 0,
  475. 'id' => 'city',
  476. 'table' => 'location',
  477. 'field' => 'city',
  478. 'override' => array(
  479. 'button' => 'Override',
  480. ),
  481. 'relationship' => 'none',
  482. ),
  483. 'province' => array(
  484. 'label' => 'Province',
  485. 'style' => 'name',
  486. 'exclude' => 0,
  487. 'id' => 'province',
  488. 'table' => 'location',
  489. 'field' => 'province',
  490. 'override' => array(
  491. 'button' => 'Override',
  492. ),
  493. 'relationship' => 'none',
  494. ),
  495. 'postal_code' => array(
  496. 'label' => 'Postal Code',
  497. 'exclude' => 0,
  498. 'id' => 'postal_code',
  499. 'table' => 'location',
  500. 'field' => 'postal_code',
  501. 'override' => array(
  502. 'button' => 'Override',
  503. ),
  504. 'relationship' => 'none',
  505. ),
  506. 'country' => array(
  507. 'label' => 'Country',
  508. 'style' => 'name',
  509. 'exclude' => 0,
  510. 'id' => 'country',
  511. 'table' => 'location',
  512. 'field' => 'country',
  513. 'override' => array(
  514. 'button' => 'Override',
  515. ),
  516. 'relationship' => 'none',
  517. ),
  518. ));
  519. $handler->override_option('filters', array(
  520. 'status' => array(
  521. 'operator' => '=',
  522. 'value' => 1,
  523. 'group' => '0',
  524. 'exposed' => FALSE,
  525. 'expose' => array(
  526. 'operator' => FALSE,
  527. 'label' => '',
  528. ),
  529. 'id' => 'status',
  530. 'table' => 'users',
  531. 'field' => 'status',
  532. 'relationship' => 'none',
  533. ),
  534. 'lid' => array(
  535. 'operator' => 'not empty',
  536. 'value' => array(
  537. 'value' => '',
  538. 'min' => '',
  539. 'max' => '',
  540. ),
  541. 'group' => '0',
  542. 'exposed' => FALSE,
  543. 'expose' => array(
  544. 'operator' => FALSE,
  545. 'label' => '',
  546. ),
  547. 'id' => 'lid',
  548. 'table' => 'location',
  549. 'field' => 'lid',
  550. 'relationship' => 'none',
  551. ),
  552. ));
  553. $handler->override_option('access', array(
  554. 'type' => 'perm',
  555. 'perm' => 'view user location table',
  556. ));
  557. $handler->override_option('style_plugin', 'table');
  558. $handler->override_option('style_options', array(
  559. 'grouping' => '',
  560. 'override' => 1,
  561. 'sticky' => 0,
  562. 'order' => 'asc',
  563. 'columns' => array(
  564. 'name' => 'name',
  565. 'street' => 'street',
  566. 'city' => 'city',
  567. 'province' => 'province',
  568. 'postal_code' => 'postal_code',
  569. 'country' => 'country',
  570. ),
  571. 'info' => array(
  572. 'name' => array(
  573. 'sortable' => 1,
  574. 'separator' => '',
  575. ),
  576. 'street' => array(
  577. 'sortable' => 1,
  578. 'separator' => '',
  579. ),
  580. 'city' => array(
  581. 'sortable' => 1,
  582. 'separator' => '',
  583. ),
  584. 'province' => array(
  585. 'sortable' => 1,
  586. 'separator' => '',
  587. ),
  588. 'postal_code' => array(
  589. 'sortable' => 1,
  590. 'separator' => '',
  591. ),
  592. 'country' => array(
  593. 'sortable' => 1,
  594. 'separator' => '',
  595. ),
  596. ),
  597. 'default' => '-1',
  598. ));
  599. $handler = $view->new_display('page', 'Page', 'page_1');
  600. $handler->override_option('path', 'location/users');
  601. $handler->override_option('menu', array(
  602. 'type' => 'normal',
  603. 'title' => 'User location table',
  604. 'weight' => '0',
  605. ));
  606. $handler->override_option('tab_options', array(
  607. 'type' => 'none',
  608. 'title' => '',
  609. 'weight' => 0,
  610. ));
  611. $views[$view->name] = $view;
  612. return $views;
  613. }