tripal_genetic.views.inc 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. <?php
  2. /**
  3. * @file
  4. * This file contains the basic functions for views integration of
  5. * chado/tripal_genetic tables. Supplementary functions can be found in
  6. * ./views/
  7. *
  8. * Documentation on views integration can be found at
  9. * http://views2.logrus.com/doc/html/index.html.
  10. */
  11. /**
  12. * @defgroup tripal_genetic_views Genetic Views Integration
  13. * @ingroup views
  14. */
  15. /**
  16. * Implements hook_views_default_views().
  17. *
  18. * @ingroup tripal_genetic
  19. */
  20. function tripal_genetic_views_default_views() {
  21. $views = array();
  22. if (!module_exists('tripal_views')) {
  23. return $views;
  24. }
  25. // Main default view
  26. $view = new view;
  27. $view->name = 'genotype_listing';
  28. $view->description = 'A listing of observed genotypes and the features displaying them';
  29. $view->tag = 'chado default';
  30. $view->base_table = 'genotype';
  31. $view->core = 6;
  32. $view->api_version = '2';
  33. $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
  34. $handler = $view->new_display('default', 'Defaults', 'default');
  35. $handler->override_option('fields', array(
  36. 'uniquename' => array(
  37. 'label' => 'Uniquename',
  38. 'alter' => array(
  39. 'alter_text' => 0,
  40. 'text' => '',
  41. 'make_link' => 0,
  42. 'path' => '',
  43. 'absolute' => 0,
  44. 'link_class' => '',
  45. 'alt' => '',
  46. 'rel' => '',
  47. 'prefix' => '',
  48. 'suffix' => '',
  49. 'target' => '',
  50. 'help' => '',
  51. 'trim' => 0,
  52. 'max_length' => '',
  53. 'word_boundary' => 1,
  54. 'ellipsis' => 1,
  55. 'html' => 0,
  56. 'strip_tags' => 0,
  57. ),
  58. 'empty' => '',
  59. 'hide_empty' => 0,
  60. 'empty_zero' => 0,
  61. 'hide_alter_empty' => 1,
  62. 'type' => 'separator',
  63. 'separator' => ', ',
  64. 'exclude' => 0,
  65. 'id' => 'uniquename',
  66. 'table' => 'genotype',
  67. 'field' => 'uniquename',
  68. 'relationship' => 'none',
  69. ),
  70. 'name' => array(
  71. 'label' => 'Name',
  72. 'alter' => array(
  73. 'alter_text' => 0,
  74. 'text' => '',
  75. 'make_link' => 0,
  76. 'path' => '',
  77. 'absolute' => 0,
  78. 'link_class' => '',
  79. 'alt' => '',
  80. 'rel' => '',
  81. 'prefix' => '',
  82. 'suffix' => '',
  83. 'target' => '',
  84. 'help' => '',
  85. 'trim' => 0,
  86. 'max_length' => '',
  87. 'word_boundary' => 1,
  88. 'ellipsis' => 1,
  89. 'html' => 0,
  90. 'strip_tags' => 0,
  91. ),
  92. 'empty' => '',
  93. 'hide_empty' => 0,
  94. 'empty_zero' => 0,
  95. 'hide_alter_empty' => 1,
  96. 'type' => 'separator',
  97. 'separator' => ', ',
  98. 'exclude' => 0,
  99. 'id' => 'name',
  100. 'table' => 'genotype',
  101. 'field' => 'name',
  102. 'relationship' => 'none',
  103. ),
  104. 'description' => array(
  105. 'label' => 'Description',
  106. 'alter' => array(
  107. 'alter_text' => 0,
  108. 'text' => '',
  109. 'make_link' => 0,
  110. 'path' => '',
  111. 'absolute' => 0,
  112. 'link_class' => '',
  113. 'alt' => '',
  114. 'rel' => '',
  115. 'prefix' => '',
  116. 'suffix' => '',
  117. 'target' => '',
  118. 'help' => '',
  119. 'trim' => 0,
  120. 'max_length' => '',
  121. 'word_boundary' => 1,
  122. 'ellipsis' => 1,
  123. 'html' => 0,
  124. 'strip_tags' => 0,
  125. ),
  126. 'empty' => '',
  127. 'hide_empty' => 0,
  128. 'empty_zero' => 0,
  129. 'hide_alter_empty' => 1,
  130. 'type' => 'separator',
  131. 'separator' => ', ',
  132. 'exclude' => 0,
  133. 'id' => 'description',
  134. 'table' => 'genotype',
  135. 'field' => 'description',
  136. 'relationship' => 'none',
  137. ),
  138. ));
  139. $handler->override_option('filters', array(
  140. 'uniquename' => array(
  141. 'operator' => '~',
  142. 'value' => '',
  143. 'group' => '0',
  144. 'exposed' => TRUE,
  145. 'expose' => array(
  146. 'use_operator' => 0,
  147. 'operator' => 'uniquename_op',
  148. 'identifier' => 'uniquename',
  149. 'label' => 'Unique Name Contains',
  150. 'remember' => 0,
  151. ),
  152. 'case' => 0,
  153. 'id' => 'uniquename',
  154. 'table' => 'genotype',
  155. 'field' => 'uniquename',
  156. 'relationship' => 'none',
  157. 'agg' => array(
  158. 'records_with' => 1,
  159. 'aggregates_with' => 1,
  160. ),
  161. ),
  162. 'description' => array(
  163. 'operator' => '~',
  164. 'value' => '',
  165. 'group' => '0',
  166. 'exposed' => TRUE,
  167. 'expose' => array(
  168. 'use_operator' => 0,
  169. 'operator' => 'description_op',
  170. 'identifier' => 'description',
  171. 'label' => 'Description Contains',
  172. 'remember' => 0,
  173. ),
  174. 'case' => 0,
  175. 'id' => 'description',
  176. 'table' => 'genotype',
  177. 'field' => 'description',
  178. 'relationship' => 'none',
  179. 'agg' => array(
  180. 'records_with' => 1,
  181. 'aggregates_with' => 1,
  182. ),
  183. ),
  184. 'search_results' => array(
  185. 'operator' => '=',
  186. 'value' => '',
  187. 'group' => '0',
  188. 'exposed' => FALSE,
  189. 'expose' => array(
  190. 'operator' => FALSE,
  191. 'label' => '',
  192. ),
  193. 'id' => 'search_results',
  194. 'table' => 'views',
  195. 'field' => 'search_results',
  196. 'relationship' => 'none',
  197. 'apply_button' => 'Show',
  198. 'no_results_text' => 'Click "Show" to see a list of all genotypes matching the entered criteria. If you leave a any of the criteria blank then the genotypes will be not be filtered based on that field. Furthermore, if you leave all criteria blank then all genotypes will be listed.',
  199. ),
  200. ));
  201. $handler->override_option('access', array(
  202. 'type' => 'perm',
  203. 'perm' => 'access content',
  204. ));
  205. $handler->override_option('cache', array(
  206. 'type' => 'none',
  207. ));
  208. $handler->override_option('title', 'Genotypes Observed');
  209. $handler->override_option('header', 'Click "Show" to see a list of all genotypes matching the entered criteria. If you leave a any of the criteria blank then the genotypes will be not be filtered based on that field. Furthermore, if you leave all criteria blank then all genotypes will be listed.');
  210. $handler->override_option('header_format', '2');
  211. $handler->override_option('header_empty', 0);
  212. $handler->override_option('empty', 'No genotypes match the current criteria.');
  213. $handler->override_option('empty_format', '2');
  214. $handler->override_option('items_per_page', 50);
  215. $handler->override_option('use_pager', '1');
  216. $handler->override_option('style_plugin', 'table');
  217. $handler->override_option('style_options', array(
  218. 'grouping' => '',
  219. 'override' => 1,
  220. 'sticky' => 0,
  221. 'order' => 'asc',
  222. 'summary' => '',
  223. 'columns' => array(
  224. 'uniquename' => 'uniquename',
  225. 'name' => 'name',
  226. 'description' => 'description',
  227. ),
  228. 'info' => array(
  229. 'uniquename' => array(
  230. 'sortable' => 1,
  231. 'separator' => '',
  232. ),
  233. 'name' => array(
  234. 'sortable' => 1,
  235. 'separator' => '',
  236. ),
  237. 'description' => array(
  238. 'sortable' => 1,
  239. 'separator' => '',
  240. ),
  241. ),
  242. 'default' => 'uniquename',
  243. ));
  244. $handler = $view->new_display('page', 'Page', 'page_1');
  245. $handler->override_option('path', 'chado/genotypes');
  246. $handler->override_option('menu', array(
  247. 'type' => 'normal',
  248. 'title' => 'Genotypes',
  249. 'description' => 'A genotype is defined by a collection of features, mutations, balancers, deficiencies, haplotype blocks, or engineered constructs.',
  250. 'weight' => '10',
  251. 'name' => 'navigation',
  252. ));
  253. $handler->override_option('tab_options', array(
  254. 'type' => 'none',
  255. 'title' => '',
  256. 'description' => '',
  257. 'weight' => 0,
  258. 'name' => 'navigation',
  259. ));
  260. $views[$view->name] = $view;
  261. return $views;
  262. }