tripal_genetic.views_default.inc 7.1 KB

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