tripal_phylogeny.views_default.inc 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. <?php
  2. /**
  3. * @file
  4. * Describe default phylotree views
  5. */
  6. /**
  7. * Implements hook_views_default_views().
  8. *
  9. * @ingroup tripal_legacy_phylogeny
  10. */
  11. function tripal_phylogeny_views_default_views() {
  12. $views = array();
  13. // User View ("Search Biological Content")
  14. // Remember, if you change the name/path of this view, you also want to
  15. // change it's description in tripal_phylogeny_search_biological_data_views()
  16. $view = tripal_phylogeny_defaultvalue_user_phylotrees();
  17. $view = tripal_make_view_compatible_with_external($view);
  18. $views[$view->name] = $view;
  19. /// Admin view
  20. $view = tripal_phylogeny_defaultview_admin_phylotree();
  21. $view = tripal_make_view_compatible_with_external($view);
  22. $views[$view->name] = $view;
  23. return $views;
  24. }
  25. /**
  26. * The default phylotree administration view.
  27. *
  28. * @ingroup tripal_legacy_phylogeny
  29. */
  30. function tripal_phylogeny_defaultview_admin_phylotree() {
  31. $view = new view();
  32. $view->name = 'tripal_phylogeny_admin_phylotree';
  33. $view->description = 'DO NOT DISABLE';
  34. $view->tag = 'tripal admin';
  35. $view->base_table = 'phylotree';
  36. $view->human_name = 'Phylogeny Admin';
  37. $view->core = 0;
  38. $view->api_version = '3.0';
  39. $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
  40. /* Display: phylotree_all */
  41. $handler = $view->new_display('default', 'phylotree_all', 'default');
  42. $handler->display->display_options['title'] = 'Phylogeny';
  43. $handler->display->display_options['use_more_always'] = FALSE;
  44. $handler->display->display_options['access']['type'] = 'perm';
  45. $handler->display->display_options['access']['perm'] = 'access chado_phylotree content';
  46. $handler->display->display_options['cache']['type'] = 'none';
  47. $handler->display->display_options['query']['type'] = 'views_query';
  48. $handler->display->display_options['exposed_form']['type'] = 'basic';
  49. $handler->display->display_options['pager']['type'] = 'full';
  50. $handler->display->display_options['pager']['options']['items_per_page'] = '25';
  51. $handler->display->display_options['style_plugin'] = 'table';
  52. /* Header: Global: Action Links */
  53. $handler->display->display_options['header']['action_links_area']['id'] = 'action_links_area';
  54. $handler->display->display_options['header']['action_links_area']['table'] = 'views';
  55. $handler->display->display_options['header']['action_links_area']['field'] = 'action_links_area';
  56. $handler->display->display_options['header']['action_links_area']['label'] = 'Action Links';
  57. $handler->display->display_options['header']['action_links_area']['link-1'] = array(
  58. 'label-1' => 'Add Phylogenetic Tree',
  59. 'path-1' => 'node/add/chado-phylotree',
  60. );
  61. $handler->display->display_options['header']['action_links_area']['link-2'] = array(
  62. 'label-2' => '',
  63. 'path-2' => '',
  64. );
  65. $handler->display->display_options['header']['action_links_area']['link-3'] = array(
  66. 'label-3' => '',
  67. 'path-3' => '',
  68. );
  69. $handler->display->display_options['header']['action_links_area']['link-4'] = array(
  70. 'label-4' => '',
  71. 'path-4' => '',
  72. );
  73. /* Relationship: Phylotree: Phylotree => Node */
  74. $handler->display->display_options['relationships']['phylotree_id']['id'] = 'phylotree_id';
  75. $handler->display->display_options['relationships']['phylotree_id']['table'] = 'chado_phylotree';
  76. $handler->display->display_options['relationships']['phylotree_id']['field'] = 'phylotree_id';
  77. /* Field: Content: Nid */
  78. $handler->display->display_options['fields']['nid']['id'] = 'nid';
  79. $handler->display->display_options['fields']['nid']['table'] = 'node';
  80. $handler->display->display_options['fields']['nid']['field'] = 'nid';
  81. $handler->display->display_options['fields']['nid']['relationship'] = 'phylotree_id';
  82. $handler->display->display_options['fields']['nid']['exclude'] = TRUE;
  83. /* Field: Chado Phylotree: Phylotree Id */
  84. $handler->display->display_options['fields']['phylotree_id']['id'] = 'phylotree_id';
  85. $handler->display->display_options['fields']['phylotree_id']['table'] = 'phylotree';
  86. $handler->display->display_options['fields']['phylotree_id']['field'] = 'phylotree_id';
  87. $handler->display->display_options['fields']['phylotree_id']['exclude'] = TRUE;
  88. /* Field: Chado Phylotree: Name */
  89. $handler->display->display_options['fields']['name']['id'] = 'name';
  90. $handler->display->display_options['fields']['name']['table'] = 'phylotree';
  91. $handler->display->display_options['fields']['name']['field'] = 'name';
  92. $handler->display->display_options['fields']['name']['label'] = 'Tree Name';
  93. $handler->display->display_options['fields']['name']['alter']['make_link'] = TRUE;
  94. $handler->display->display_options['fields']['name']['alter']['path'] = 'node/[nid]';
  95. /* Field: Chado Phylotree: Phylotree Id */
  96. $handler->display->display_options['fields']['phylotree_id_1']['id'] = 'phylotree_id_1';
  97. $handler->display->display_options['fields']['phylotree_id_1']['table'] = 'phylotree';
  98. $handler->display->display_options['fields']['phylotree_id_1']['field'] = 'phylotree_id';
  99. $handler->display->display_options['fields']['phylotree_id_1']['exclude'] = TRUE;
  100. /* Field: Chado Analysis: Name */
  101. $handler->display->display_options['fields']['name_1']['id'] = 'name_1';
  102. $handler->display->display_options['fields']['name_1']['table'] = 'analysis';
  103. $handler->display->display_options['fields']['name_1']['field'] = 'name';
  104. $handler->display->display_options['fields']['name_1']['label'] = 'Analysis';
  105. /* Field: Chado Cvterm: Name */
  106. $handler->display->display_options['fields']['name_2']['id'] = 'name_2';
  107. $handler->display->display_options['fields']['name_2']['table'] = 'cvterm';
  108. $handler->display->display_options['fields']['name_2']['field'] = 'name';
  109. $handler->display->display_options['fields']['name_2']['label'] = 'Leaf Node Type';
  110. /* Field: Chado Phylotree: Comment */
  111. $handler->display->display_options['fields']['comment']['id'] = 'comment';
  112. $handler->display->display_options['fields']['comment']['table'] = 'phylotree';
  113. $handler->display->display_options['fields']['comment']['field'] = 'comment';
  114. $handler->display->display_options['fields']['comment']['label'] = 'Description';
  115. /* Sort criterion: Chado Phylotree: Name */
  116. $handler->display->display_options['sorts']['name']['id'] = 'name';
  117. $handler->display->display_options['sorts']['name']['table'] = 'phylotree';
  118. $handler->display->display_options['sorts']['name']['field'] = 'name';
  119. /* Filter criterion: Chado Phylotree: Name */
  120. $handler->display->display_options['filters']['name_1']['id'] = 'name_1';
  121. $handler->display->display_options['filters']['name_1']['table'] = 'phylotree';
  122. $handler->display->display_options['filters']['name_1']['field'] = 'name';
  123. $handler->display->display_options['filters']['name_1']['group'] = 1;
  124. $handler->display->display_options['filters']['name_1']['exposed'] = TRUE;
  125. $handler->display->display_options['filters']['name_1']['expose']['operator_id'] = 'name_1_op';
  126. $handler->display->display_options['filters']['name_1']['expose']['label'] = 'Tree Name';
  127. $handler->display->display_options['filters']['name_1']['expose']['description'] = 'Provide the name of a phylogenetic tree';
  128. $handler->display->display_options['filters']['name_1']['expose']['use_operator'] = TRUE;
  129. $handler->display->display_options['filters']['name_1']['expose']['operator'] = 'name_1_op';
  130. $handler->display->display_options['filters']['name_1']['expose']['identifier'] = 'name_1';
  131. $handler->display->display_options['filters']['name_1']['expose']['remember_roles'] = array(
  132. 2 => '2',
  133. 1 => 0,
  134. 3 => 0,
  135. );
  136. $handler->display->display_options['filters']['name_1']['max_length'] = '40';
  137. /* Display: Page */
  138. $handler = $view->new_display('page', 'Page', 'page');
  139. $handler->display->display_options['path'] = 'admin/tripal/legacy/tripal_phylogeny/phylotree';
  140. $handler->display->display_options['menu']['type'] = 'default tab';
  141. $handler->display->display_options['menu']['title'] = 'Trees';
  142. $handler->display->display_options['menu']['weight'] = '0';
  143. $handler->display->display_options['menu']['context'] = 0;
  144. $handler->display->display_options['menu']['context_only_inline'] = 0;
  145. $handler->display->display_options['tab_options']['weight'] = '0';
  146. return $view;
  147. }
  148. /**
  149. * Defines the phylotree user search default view.
  150. *
  151. * @ingroup tripal_legacy_phylogeny
  152. */
  153. function tripal_phylogeny_defaultvalue_user_phylotrees() {
  154. $view = new view();
  155. $view->name = 'tripal_phylogeny_user_phylotree';
  156. $view->description = 'Allows users to search phylotree data';
  157. $view->tag = 'tripal search';
  158. $view->base_table = 'phylotree_count';
  159. $view->human_name = 'Phylogeny User Search';
  160. $view->core = 0;
  161. $view->api_version = '3.0';
  162. $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
  163. /* Display: phylotrees_all */
  164. $handler = $view->new_display('default', 'phylotrees_all', 'default');
  165. $handler->display->display_options['title'] = 'Phylogeny User Search';
  166. $handler->display->display_options['use_more_always'] = FALSE;
  167. $handler->display->display_options['access']['type'] = 'perm';
  168. $handler->display->display_options['access']['perm'] = 'access chado_phylotree content';
  169. $handler->display->display_options['cache']['type'] = 'none';
  170. $handler->display->display_options['query']['type'] = 'views_query';
  171. $handler->display->display_options['exposed_form']['type'] = 'basic';
  172. $handler->display->display_options['pager']['type'] = 'full';
  173. $handler->display->display_options['pager']['options']['items_per_page'] = '15';
  174. $handler->display->display_options['pager']['options']['offset'] = '0';
  175. $handler->display->display_options['pager']['options']['id'] = '0';
  176. $handler->display->display_options['pager']['options']['quantity'] = '9';
  177. $handler->display->display_options['style_plugin'] = 'table';
  178. /* Header: Global: Text area */
  179. $handler->display->display_options['header']['area']['id'] = 'area';
  180. $handler->display->display_options['header']['area']['table'] = 'views';
  181. $handler->display->display_options['header']['area']['field'] = 'area';
  182. $handler->display->display_options['header']['area']['empty'] = TRUE;
  183. $handler->display->display_options['header']['area']['content'] = 'Search for a gene family by submitting annotation terms, PFAM IDs, or GO terms in the "Tree Description" field (e.g.cytochrome, IPR008914, homeobox leucine zipper, or GO:0003677) ... or by "Family ID" (e.g. 54689426; these IDs correspond to the Phytozome v10 gene families).
  184. ';
  185. $handler->display->display_options['header']['area']['format'] = 'filtered_html';
  186. /* Header: Global: Result summary */
  187. $handler->display->display_options['header']['result']['id'] = 'result';
  188. $handler->display->display_options['header']['result']['table'] = 'views';
  189. $handler->display->display_options['header']['result']['field'] = 'result';
  190. /* Footer: Global: Result summary */
  191. $handler->display->display_options['footer']['result']['id'] = 'result';
  192. $handler->display->display_options['footer']['result']['table'] = 'views';
  193. $handler->display->display_options['footer']['result']['field'] = 'result';
  194. $handler->display->display_options['footer']['result']['content'] = 'Displaying @start - @end of @total records found.';
  195. /* Field: phylotree_count: Family ID */
  196. $handler->display->display_options['fields']['phylotree_name']['id'] = 'phylotree_name';
  197. $handler->display->display_options['fields']['phylotree_name']['table'] = 'phylotree_count';
  198. $handler->display->display_options['fields']['phylotree_name']['field'] = 'phylotree_name';
  199. /* Field: phylotree_count: Description */
  200. $handler->display->display_options['fields']['phylotree_comment']['id'] = 'phylotree_comment';
  201. $handler->display->display_options['fields']['phylotree_comment']['table'] = 'phylotree_count';
  202. $handler->display->display_options['fields']['phylotree_comment']['field'] = 'phylotree_comment';
  203. /* Field: phylotree_count: Total count */
  204. $handler->display->display_options['fields']['total_count']['id'] = 'total_count';
  205. $handler->display->display_options['fields']['total_count']['table'] = 'phylotree_count';
  206. $handler->display->display_options['fields']['total_count']['field'] = 'total_count';
  207. /* Filter criterion: phylotree_count: Family ID */
  208. $handler->display->display_options['filters']['phylotree_name']['id'] = 'phylotree_name';
  209. $handler->display->display_options['filters']['phylotree_name']['table'] = 'phylotree_count';
  210. $handler->display->display_options['filters']['phylotree_name']['field'] = 'phylotree_name';
  211. $handler->display->display_options['filters']['phylotree_name']['exposed'] = TRUE;
  212. $handler->display->display_options['filters']['phylotree_name']['expose']['operator_id'] = 'phylotree_name_op';
  213. $handler->display->display_options['filters']['phylotree_name']['expose']['label'] = 'Family ID';
  214. $handler->display->display_options['filters']['phylotree_name']['expose']['use_operator'] = TRUE;
  215. $handler->display->display_options['filters']['phylotree_name']['expose']['operator'] = 'phylotree_name_op';
  216. $handler->display->display_options['filters']['phylotree_name']['expose']['identifier'] = 'phylotree_name';
  217. $handler->display->display_options['filters']['phylotree_name']['expose']['remember_roles'] = array(
  218. 2 => '2',
  219. 1 => 0,
  220. 4 => 0,
  221. );
  222. $handler->display->display_options['filters']['phylotree_name']['max_length'] = '40';
  223. /* Filter criterion: phylotree_count: Description */
  224. $handler->display->display_options['filters']['phylotree_comment']['id'] = 'phylotree_comment';
  225. $handler->display->display_options['filters']['phylotree_comment']['table'] = 'phylotree_count';
  226. $handler->display->display_options['filters']['phylotree_comment']['field'] = 'phylotree_comment';
  227. $handler->display->display_options['filters']['phylotree_comment']['operator'] = 'allwords';
  228. $handler->display->display_options['filters']['phylotree_comment']['exposed'] = TRUE;
  229. $handler->display->display_options['filters']['phylotree_comment']['expose']['operator_id'] = 'phylotree_comment_op';
  230. $handler->display->display_options['filters']['phylotree_comment']['expose']['label'] = 'Tree Description';
  231. $handler->display->display_options['filters']['phylotree_comment']['expose']['use_operator'] = TRUE;
  232. $handler->display->display_options['filters']['phylotree_comment']['expose']['operator'] = 'phylotree_comment_op';
  233. $handler->display->display_options['filters']['phylotree_comment']['expose']['identifier'] = 'phylotree_comment';
  234. $handler->display->display_options['filters']['phylotree_comment']['expose']['remember_roles'] = array(
  235. 2 => '2',
  236. 1 => 0,
  237. 4 => 0,
  238. );
  239. $handler->display->display_options['filters']['phylotree_comment']['max_length'] = '40';
  240. /* Filter criterion: phylotree_count: Total count */
  241. $handler->display->display_options['filters']['total_count']['id'] = 'total_count';
  242. $handler->display->display_options['filters']['total_count']['table'] = 'phylotree_count';
  243. $handler->display->display_options['filters']['total_count']['field'] = 'total_count';
  244. $handler->display->display_options['filters']['total_count']['exposed'] = TRUE;
  245. $handler->display->display_options['filters']['total_count']['expose']['operator_id'] = 'total_count_op';
  246. $handler->display->display_options['filters']['total_count']['expose']['label'] = 'Total count';
  247. $handler->display->display_options['filters']['total_count']['expose']['use_operator'] = TRUE;
  248. $handler->display->display_options['filters']['total_count']['expose']['operator'] = 'total_count_op';
  249. $handler->display->display_options['filters']['total_count']['expose']['identifier'] = 'total_count';
  250. $handler->display->display_options['filters']['total_count']['expose']['remember_roles'] = array(
  251. 2 => '2',
  252. 1 => 0,
  253. 4 => 0,
  254. );
  255. /* Display: Phylogeny */
  256. $handler = $view->new_display('page', 'Phylogeny', 'page');
  257. $handler->display->display_options['path'] = 'chado/phylotree';
  258. $handler->display->display_options['menu']['type'] = 'normal';
  259. $handler->display->display_options['menu']['title'] = 'Phylogeny';
  260. $handler->display->display_options['menu']['description'] = 'Gene trees, species trees, etc.';
  261. $handler->display->display_options['menu']['weight'] = '-10';
  262. return $view;
  263. }