tripal_chado_views.views_default.inc 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  1. <?php
  2. /**
  3. * Describes default views for tripal views integrations
  4. */
  5. /**
  6. * Implements hook_views_default_views().
  7. *
  8. * @ingroup tripal_chado_views
  9. */
  10. function tripal_chado_views_views_default_views() {
  11. $views = array();
  12. $view = tripal_chado_views_defaultview_admin_integrations();
  13. $views[$view->name] = $view;
  14. return $views;
  15. }
  16. /**
  17. * Default integrations administration view
  18. *
  19. * @ingroup tripal_chado_views
  20. */
  21. function tripal_chado_views_defaultview_admin_integrations() {
  22. $view = new view();
  23. $view->name = 'tripal_views_admin_integrations';
  24. $view->description = 'DO NOT DISABLE';
  25. $view->tag = 'tripal admin';
  26. $view->base_table = 'tripal_views';
  27. $view->human_name = 'Tripal Views (Admin)';
  28. $view->core = 7;
  29. $view->api_version = '3.0';
  30. $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
  31. /* Display: Master */
  32. $handler = $view->new_display('default', 'Master', 'default');
  33. $handler->display->display_options['title'] = 'Chado Views Integrations';
  34. $handler->display->display_options['use_more_always'] = FALSE;
  35. $handler->display->display_options['access']['type'] = 'perm';
  36. $handler->display->display_options['access']['perm'] = 'manage tripal_views_integration';
  37. $handler->display->display_options['cache']['type'] = 'none';
  38. $handler->display->display_options['query']['type'] = 'views_query';
  39. $handler->display->display_options['exposed_form']['type'] = 'basic';
  40. $handler->display->display_options['exposed_form']['options']['submit_button'] = 'Filter';
  41. $handler->display->display_options['pager']['type'] = 'full';
  42. $handler->display->display_options['pager']['options']['items_per_page'] = '25';
  43. $handler->display->display_options['style_plugin'] = 'table';
  44. $handler->display->display_options['style_options']['columns'] = array(
  45. 'name' => 'name',
  46. 'table_name' => 'table_name',
  47. 'mv_table' => 'mv_table',
  48. 'comment' => 'comment',
  49. 'base_table' => 'base_table',
  50. 'priority' => 'priority',
  51. );
  52. $handler->display->display_options['style_options']['default'] = '-1';
  53. $handler->display->display_options['style_options']['info'] = array(
  54. 'name' => array(
  55. 'sortable' => 1,
  56. 'default_sort_order' => 'asc',
  57. 'align' => '',
  58. 'separator' => '',
  59. 'empty_column' => 0,
  60. ),
  61. 'table_name' => array(
  62. 'sortable' => 1,
  63. 'default_sort_order' => 'asc',
  64. 'align' => '',
  65. 'separator' => '',
  66. 'empty_column' => 0,
  67. ),
  68. 'mv_table' => array(
  69. 'sortable' => 1,
  70. 'default_sort_order' => 'asc',
  71. 'align' => '',
  72. 'separator' => '',
  73. 'empty_column' => 0,
  74. ),
  75. 'comment' => array(
  76. 'sortable' => 0,
  77. 'default_sort_order' => 'asc',
  78. 'align' => '',
  79. 'separator' => '',
  80. 'empty_column' => 0,
  81. ),
  82. 'base_table' => array(
  83. 'sortable' => 1,
  84. 'default_sort_order' => 'asc',
  85. 'align' => '',
  86. 'separator' => '',
  87. 'empty_column' => 0,
  88. ),
  89. 'priority' => array(
  90. 'sortable' => 1,
  91. 'default_sort_order' => 'asc',
  92. 'align' => '',
  93. 'separator' => '',
  94. 'empty_column' => 0,
  95. ),
  96. );
  97. /* Header: Global: Text area */
  98. $handler->display->display_options['header']['area']['id'] = 'area';
  99. $handler->display->display_options['header']['area']['table'] = 'views';
  100. $handler->display->display_options['header']['area']['field'] = 'area';
  101. $handler->display->display_options['header']['area']['label'] = 'Description';
  102. $handler->display->display_options['header']['area']['empty'] = TRUE;
  103. $handler->display->display_options['header']['area']['content'] = '<p>The following tables are available for integration with Drupal Views. If a table is integrated more than once, then the setup with the lightest priority will be used. For example, if you have created a custom setup with a priority of -5 then that will be used instead of the default setup with priority 10. Priorities range from -10 to +10 where a setup with -10 has greater precedent than any other and +10 has the least.</p>';
  104. $handler->display->display_options['header']['area']['format'] = 'filtered_html';
  105. /* Header: Global: Action Links */
  106. $handler->display->display_options['header']['action_links_area']['id'] = 'action_links_area';
  107. $handler->display->display_options['header']['action_links_area']['table'] = 'views';
  108. $handler->display->display_options['header']['action_links_area']['field'] = 'action_links_area';
  109. $handler->display->display_options['header']['action_links_area']['label'] = 'Add Links';
  110. $handler->display->display_options['header']['action_links_area']['empty'] = TRUE;
  111. $handler->display->display_options['header']['action_links_area']['link-1'] = array(
  112. 'label-1' => 'Add New Integration',
  113. 'path-1' => 'admin/tripal/storage/chado/views-integration/new',
  114. );
  115. $handler->display->display_options['header']['action_links_area']['link-2'] = array(
  116. 'label-2' => 'Import Integration',
  117. 'path-2' => 'admin/tripal/storage/chado/views-integration/import',
  118. );
  119. $handler->display->display_options['header']['action_links_area']['link-3'] = array(
  120. 'label-3' => '',
  121. 'path-3' => '',
  122. );
  123. $handler->display->display_options['header']['action_links_area']['link-4'] = array(
  124. 'label-4' => '',
  125. 'path-4' => '',
  126. );
  127. /* Header: Global: Action Links */
  128. $handler->display->display_options['header']['action_links_area_1']['id'] = 'action_links_area_1';
  129. $handler->display->display_options['header']['action_links_area_1']['table'] = 'views';
  130. $handler->display->display_options['header']['action_links_area_1']['field'] = 'action_links_area';
  131. $handler->display->display_options['header']['action_links_area_1']['label'] = 'Delete Links';
  132. $handler->display->display_options['header']['action_links_area_1']['empty'] = TRUE;
  133. $handler->display->display_options['header']['action_links_area_1']['link-1'] = array(
  134. 'label-1' => 'Delete ALL Integrations',
  135. 'path-1' => 'admin/tripal/storage/chado/views-integration/delete-all/confirm',
  136. );
  137. $handler->display->display_options['header']['action_links_area_1']['link-2'] = array(
  138. 'label-2' => '',
  139. 'path-2' => '',
  140. );
  141. $handler->display->display_options['header']['action_links_area_1']['link-3'] = array(
  142. 'label-3' => '',
  143. 'path-3' => '',
  144. );
  145. $handler->display->display_options['header']['action_links_area_1']['link-4'] = array(
  146. 'label-4' => '',
  147. 'path-4' => '',
  148. );
  149. /* Field: Chado Views Integration: Setup ID */
  150. $handler->display->display_options['fields']['setup_id']['id'] = 'setup_id';
  151. $handler->display->display_options['fields']['setup_id']['table'] = 'tripal_views';
  152. $handler->display->display_options['fields']['setup_id']['field'] = 'setup_id';
  153. $handler->display->display_options['fields']['setup_id']['exclude'] = TRUE;
  154. $handler->display->display_options['fields']['setup_id']['separator'] = '';
  155. /* Field: Chado Views Integration: Name */
  156. $handler->display->display_options['fields']['name']['id'] = 'name';
  157. $handler->display->display_options['fields']['name']['table'] = 'tripal_views';
  158. $handler->display->display_options['fields']['name']['field'] = 'name';
  159. /* Field: Chado Views Integration: Chado Table Name */
  160. $handler->display->display_options['fields']['table_name']['id'] = 'table_name';
  161. $handler->display->display_options['fields']['table_name']['table'] = 'tripal_views';
  162. $handler->display->display_options['fields']['table_name']['field'] = 'table_name';
  163. /* Field: Tripal Materialized Views: Table */
  164. $handler->display->display_options['fields']['mv_table']['id'] = 'mv_table';
  165. $handler->display->display_options['fields']['mv_table']['table'] = 'tripal_mviews';
  166. $handler->display->display_options['fields']['mv_table']['field'] = 'mv_table';
  167. $handler->display->display_options['fields']['mv_table']['label'] = 'Materialized View';
  168. /* Field: Chado Views Integration: Description */
  169. $handler->display->display_options['fields']['comment']['id'] = 'comment';
  170. $handler->display->display_options['fields']['comment']['table'] = 'tripal_views';
  171. $handler->display->display_options['fields']['comment']['field'] = 'comment';
  172. /* Field: Chado Views Integration: Base Table? */
  173. $handler->display->display_options['fields']['base_table']['id'] = 'base_table';
  174. $handler->display->display_options['fields']['base_table']['table'] = 'tripal_views';
  175. $handler->display->display_options['fields']['base_table']['field'] = 'base_table';
  176. $handler->display->display_options['fields']['base_table']['not'] = 0;
  177. /* Field: Chado Views Integration: Priority */
  178. $handler->display->display_options['fields']['priority']['id'] = 'priority';
  179. $handler->display->display_options['fields']['priority']['table'] = 'tripal_views';
  180. $handler->display->display_options['fields']['priority']['field'] = 'priority';
  181. $handler->display->display_options['fields']['priority']['separator'] = '';
  182. /* Field: Global: Custom text */
  183. $handler->display->display_options['fields']['nothing']['id'] = 'nothing';
  184. $handler->display->display_options['fields']['nothing']['table'] = 'views';
  185. $handler->display->display_options['fields']['nothing']['field'] = 'nothing';
  186. $handler->display->display_options['fields']['nothing']['label'] = 'Edit Link';
  187. $handler->display->display_options['fields']['nothing']['exclude'] = TRUE;
  188. $handler->display->display_options['fields']['nothing']['alter']['text'] = 'edit';
  189. $handler->display->display_options['fields']['nothing']['alter']['make_link'] = TRUE;
  190. $handler->display->display_options['fields']['nothing']['alter']['path'] = 'admin/tripal/storage/chado/views-integration/edit/[setup_id]';
  191. /* Field: Global: Custom text */
  192. $handler->display->display_options['fields']['nothing_1']['id'] = 'nothing_1';
  193. $handler->display->display_options['fields']['nothing_1']['table'] = 'views';
  194. $handler->display->display_options['fields']['nothing_1']['field'] = 'nothing';
  195. $handler->display->display_options['fields']['nothing_1']['label'] = 'Delete Link';
  196. $handler->display->display_options['fields']['nothing_1']['exclude'] = TRUE;
  197. $handler->display->display_options['fields']['nothing_1']['alter']['text'] = 'delete';
  198. $handler->display->display_options['fields']['nothing_1']['alter']['make_link'] = TRUE;
  199. $handler->display->display_options['fields']['nothing_1']['alter']['path'] = 'admin/tripal/storage/chado/views-integration/delete/[setup_id]';
  200. /* Field: Global: Custom text */
  201. $handler->display->display_options['fields']['nothing_2']['id'] = 'nothing_2';
  202. $handler->display->display_options['fields']['nothing_2']['table'] = 'views';
  203. $handler->display->display_options['fields']['nothing_2']['field'] = 'nothing';
  204. $handler->display->display_options['fields']['nothing_2']['label'] = 'Export Link';
  205. $handler->display->display_options['fields']['nothing_2']['exclude'] = TRUE;
  206. $handler->display->display_options['fields']['nothing_2']['alter']['text'] = 'export';
  207. $handler->display->display_options['fields']['nothing_2']['alter']['make_link'] = TRUE;
  208. $handler->display->display_options['fields']['nothing_2']['alter']['path'] = 'admin/tripal/storage/chado/views-integration/export/[setup_id]';
  209. /* Field: Global: Custom text */
  210. $handler->display->display_options['fields']['nothing_3']['id'] = 'nothing_3';
  211. $handler->display->display_options['fields']['nothing_3']['table'] = 'views';
  212. $handler->display->display_options['fields']['nothing_3']['field'] = 'nothing';
  213. $handler->display->display_options['fields']['nothing_3']['label'] = '';
  214. $handler->display->display_options['fields']['nothing_3']['alter']['text'] = '[nothing] [nothing_1]<br />
  215. [nothing_2]';
  216. $handler->display->display_options['fields']['nothing_3']['element_class'] = 'short-column';
  217. $handler->display->display_options['fields']['nothing_3']['element_label_class'] = 'short-column';
  218. $handler->display->display_options['fields']['nothing_3']['element_label_colon'] = FALSE;
  219. /* Sort criterion: Chado Views Integration: Chado Table Name */
  220. $handler->display->display_options['sorts']['table_name']['id'] = 'table_name';
  221. $handler->display->display_options['sorts']['table_name']['table'] = 'tripal_views';
  222. $handler->display->display_options['sorts']['table_name']['field'] = 'table_name';
  223. /* Sort criterion: Chado Views Integration: Priority */
  224. $handler->display->display_options['sorts']['priority']['id'] = 'priority';
  225. $handler->display->display_options['sorts']['priority']['table'] = 'tripal_views';
  226. $handler->display->display_options['sorts']['priority']['field'] = 'priority';
  227. /* Filter criterion: Chado Views Integration: Name */
  228. $handler->display->display_options['filters']['name']['id'] = 'name';
  229. $handler->display->display_options['filters']['name']['table'] = 'tripal_views';
  230. $handler->display->display_options['filters']['name']['field'] = 'name';
  231. $handler->display->display_options['filters']['name']['operator'] = 'contains';
  232. $handler->display->display_options['filters']['name']['group'] = 1;
  233. $handler->display->display_options['filters']['name']['exposed'] = TRUE;
  234. $handler->display->display_options['filters']['name']['expose']['operator_id'] = 'name_op';
  235. $handler->display->display_options['filters']['name']['expose']['label'] = 'Integration Name Contains';
  236. $handler->display->display_options['filters']['name']['expose']['operator'] = 'name_op';
  237. $handler->display->display_options['filters']['name']['expose']['identifier'] = 'name';
  238. $handler->display->display_options['filters']['name']['expose']['remember_roles'] = array(
  239. 2 => '2',
  240. 1 => 0,
  241. 3 => 0,
  242. );
  243. /* Filter criterion: Chado Views Integration: Chado Table Name */
  244. $handler->display->display_options['filters']['table_name']['id'] = 'table_name';
  245. $handler->display->display_options['filters']['table_name']['table'] = 'tripal_views';
  246. $handler->display->display_options['filters']['table_name']['field'] = 'table_name';
  247. $handler->display->display_options['filters']['table_name']['group'] = 1;
  248. $handler->display->display_options['filters']['table_name']['exposed'] = TRUE;
  249. $handler->display->display_options['filters']['table_name']['expose']['operator_id'] = 'table_name_op';
  250. $handler->display->display_options['filters']['table_name']['expose']['label'] = 'Chado Table Name';
  251. $handler->display->display_options['filters']['table_name']['expose']['operator'] = 'table_name_op';
  252. $handler->display->display_options['filters']['table_name']['expose']['identifier'] = 'table_name';
  253. $handler->display->display_options['filters']['table_name']['expose']['remember_roles'] = array(
  254. 2 => '2',
  255. 1 => 0,
  256. 3 => 0,
  257. );
  258. /* Filter criterion: Tripal Materialized Views: Table */
  259. $handler->display->display_options['filters']['mv_table']['id'] = 'mv_table';
  260. $handler->display->display_options['filters']['mv_table']['table'] = 'tripal_mviews';
  261. $handler->display->display_options['filters']['mv_table']['field'] = 'mv_table';
  262. $handler->display->display_options['filters']['mv_table']['group'] = 1;
  263. $handler->display->display_options['filters']['mv_table']['exposed'] = TRUE;
  264. $handler->display->display_options['filters']['mv_table']['expose']['operator_id'] = 'mv_table_op';
  265. $handler->display->display_options['filters']['mv_table']['expose']['label'] = 'Materialized View Table Name';
  266. $handler->display->display_options['filters']['mv_table']['expose']['operator'] = 'mv_table_op';
  267. $handler->display->display_options['filters']['mv_table']['expose']['identifier'] = 'mv_table';
  268. $handler->display->display_options['filters']['mv_table']['expose']['remember_roles'] = array(
  269. 2 => '2',
  270. 1 => 0,
  271. 3 => 0,
  272. );
  273. /* Filter criterion: Chado Views Integration: Priority */
  274. $handler->display->display_options['filters']['priority']['id'] = 'priority';
  275. $handler->display->display_options['filters']['priority']['table'] = 'tripal_views';
  276. $handler->display->display_options['filters']['priority']['field'] = 'priority';
  277. $handler->display->display_options['filters']['priority']['group'] = 1;
  278. $handler->display->display_options['filters']['priority']['exposed'] = TRUE;
  279. $handler->display->display_options['filters']['priority']['expose']['operator_id'] = 'priority_op';
  280. $handler->display->display_options['filters']['priority']['expose']['label'] = 'Priority';
  281. $handler->display->display_options['filters']['priority']['expose']['operator'] = 'priority_op';
  282. $handler->display->display_options['filters']['priority']['expose']['identifier'] = 'priority';
  283. $handler->display->display_options['filters']['priority']['expose']['remember_roles'] = array(
  284. 2 => '2',
  285. 1 => 0,
  286. 3 => 0,
  287. );
  288. /* Filter criterion: Chado Views Integration: Base Table? */
  289. $handler->display->display_options['filters']['base_table']['id'] = 'base_table';
  290. $handler->display->display_options['filters']['base_table']['table'] = 'tripal_views';
  291. $handler->display->display_options['filters']['base_table']['field'] = 'base_table';
  292. $handler->display->display_options['filters']['base_table']['value'] = 'All';
  293. $handler->display->display_options['filters']['base_table']['group'] = 1;
  294. $handler->display->display_options['filters']['base_table']['exposed'] = TRUE;
  295. $handler->display->display_options['filters']['base_table']['expose']['operator_id'] = '';
  296. $handler->display->display_options['filters']['base_table']['expose']['label'] = 'Integrates a Base Table?';
  297. $handler->display->display_options['filters']['base_table']['expose']['operator'] = 'base_table_op';
  298. $handler->display->display_options['filters']['base_table']['expose']['identifier'] = 'base_table';
  299. $handler->display->display_options['filters']['base_table']['expose']['remember_roles'] = array(
  300. 2 => '2',
  301. 1 => 0,
  302. 3 => 0,
  303. );
  304. /* Display: Page */
  305. $handler = $view->new_display('page', 'Page', 'page');
  306. $handler->display->display_options['path'] = 'admin/tripal/storage/chado/views-integration';
  307. $handler->display->display_options['menu']['type'] = 'normal';
  308. $handler->display->display_options['menu']['title'] = 'Chado Views Integrations';
  309. $handler->display->display_options['menu']['description'] = 'Integrates Chado tables with Drupal Views for direct access.';
  310. $handler->display->display_options['menu']['weight'] = '-10';
  311. $handler->display->display_options['menu']['name'] = 'management';
  312. $handler->display->display_options['menu']['context'] = 0;
  313. $handler->display->display_options['menu']['context_only_inline'] = 0;
  314. $handler->display->display_options['tab_options']['weight'] = '0';
  315. return $view;
  316. }