tripal_natural_diversity.views.inc 30 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049
  1. <?php
  2. /**
  3. * @file
  4. * This file contains the basic functions for views integration of
  5. * chado/tripal_natural_diversity tables.
  6. *
  7. * Documentation on views integration can be found at
  8. * http://views2.logrus.com/doc/html/index.html.
  9. */
  10. /**
  11. * Implements hook_views_data()
  12. * Purpose: Describe chado/tripal tables & fields to views
  13. *
  14. * @return: a data array which follows the structure outlined in the
  15. * views2 documentation for this hook. Essentially, it's an array of table
  16. * definitions keyed by chado/tripal table name. Each table definition
  17. * includes basic details about the table, fields in that table and
  18. * relationships between that table and others (joins)
  19. */
  20. function tripal_natural_diversity_views_data() {
  21. $data = array();
  22. if (module_exists('tripal_views')) {
  23. $tables = array(
  24. 'nd_experiment',
  25. 'nd_geolocation',
  26. 'nd_protocol',
  27. 'nd_reagent'
  28. );
  29. foreach ($tables as $tablename) {
  30. $priority = 9;
  31. // check to see if the table is integrated. If it is then integrate it's
  32. // corresponding 'chado_[table]' table.
  33. if (!tripal_views_is_integrated($tablename, $priority)) {
  34. $table_integration_array = tripal_views_get_integration_array_for_chado_table($tablename, TRUE, $priority);
  35. // Add specialty handlers
  36. switch ($tablename) {
  37. case 'nd_geolocation':
  38. $table_integration_array['fields']['description']['handlers']['filter']['name'] = 'tripal_views_handler_filter_select_string';
  39. $table_integration_array['fields']['geodetic_datum']['handlers']['filter']['name'] = 'tripal_views_handler_filter_select_string';
  40. $table_integration_array['fields']['latitude']['handlers']['filter']['name'] = 'chado_views_handler_filter_float';
  41. $table_integration_array['fields']['longitude']['handlers']['filter']['name'] = 'chado_views_handler_filter_float';
  42. $table_integration_array['fields']['altitude']['handlers']['filter']['name'] = 'chado_views_handler_filter_float';
  43. break;
  44. }
  45. tripal_views_integration_add_entry($table_integration_array);
  46. }
  47. }
  48. $tables = array(
  49. 'nd_experiment_contact',
  50. 'nd_experiment_dbxref',
  51. 'nd_experiment_genotype',
  52. 'nd_experiment_phenotype',
  53. 'nd_experiment_project',
  54. 'nd_experiment_protocol',
  55. 'nd_experiment_pub',
  56. 'nd_experiment_stock',
  57. 'nd_experiment_stock_dbxref',
  58. 'nd_experiment_stockprop',
  59. 'nd_experimentprop',
  60. 'nd_geolocationprop',
  61. 'nd_protocol_reagent',
  62. 'nd_protocolprop',
  63. 'nd_reagent_relationship',
  64. 'nd_reagentprop'
  65. );
  66. foreach ($tables as $tablename) {
  67. $priority = 9;
  68. if (!tripal_views_is_integrated($tablename, $priority)) {
  69. $table_integration_array = tripal_views_get_integration_array_for_chado_table($tablename, FALSE, $priority);
  70. tripal_views_integration_add_entry($table_integration_array);
  71. }
  72. }
  73. }
  74. return $data;
  75. }
  76. /**
  77. * Implements hook_views_handlers()
  78. * Purpose: Register all custom handlers with views
  79. * where a handler describes either "the type of field",
  80. * "how a field should be filtered", "how a field should be sorted"
  81. *
  82. * @return: An array of handler definitions
  83. */
  84. function tripal_natural_diversity_views_handlers() {
  85. return array(
  86. 'info' => array(
  87. 'path' => drupal_get_path('module', 'tripal_natural_diversity') . '/views/handlers',
  88. ),
  89. 'handlers' => array(
  90. 'views_handler_field_chado_relationship_all' => array(
  91. 'parent' => 'views_handler_field_prerender_list',
  92. ),
  93. 'views_handler_field_chado_relationship_by_type' => array(
  94. 'parent' => 'views_handler_field_prerender_list',
  95. ),
  96. ),
  97. );
  98. }
  99. /**
  100. * Created Default views related to the tables integrated by this module
  101. *
  102. * @ingroup tripal_feature_views
  103. */
  104. function tripal_natural_diversity_views_default_views() {
  105. $views = array();
  106. if (!module_exists('tripal_views')) {
  107. return $views;
  108. }
  109. // Experiment Listing
  110. $view = new view;
  111. $view->name = 'natdiv_experiment_listing';
  112. $view->description = 'A listing of all natural diversity experiments';
  113. $view->tag = 'chado default';
  114. $view->base_table = 'nd_experiment';
  115. $view->core = 6;
  116. $view->api_version = '2';
  117. $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
  118. $handler = $view->new_display('default', 'Defaults', 'default');
  119. $handler->override_option('fields', array(
  120. 'name' => array(
  121. 'label' => 'Type',
  122. 'alter' => array(
  123. 'alter_text' => 0,
  124. 'text' => '',
  125. 'make_link' => 0,
  126. 'path' => '',
  127. 'absolute' => 0,
  128. 'link_class' => '',
  129. 'alt' => '',
  130. 'rel' => '',
  131. 'prefix' => '',
  132. 'suffix' => '',
  133. 'target' => '',
  134. 'help' => '',
  135. 'trim' => 0,
  136. 'max_length' => '',
  137. 'word_boundary' => 1,
  138. 'ellipsis' => 1,
  139. 'html' => 0,
  140. 'strip_tags' => 0,
  141. ),
  142. 'empty' => '',
  143. 'hide_empty' => 0,
  144. 'empty_zero' => 0,
  145. 'hide_alter_empty' => 1,
  146. 'type' => 'separator',
  147. 'separator' => ', ',
  148. 'exclude' => 0,
  149. 'id' => 'name',
  150. 'table' => 'cvterm',
  151. 'field' => 'name',
  152. 'relationship' => 'none',
  153. ),
  154. 'description' => array(
  155. 'label' => 'Location Experiment Performed',
  156. 'alter' => array(
  157. 'alter_text' => 0,
  158. 'text' => '',
  159. 'make_link' => 0,
  160. 'path' => '',
  161. 'absolute' => 0,
  162. 'link_class' => '',
  163. 'alt' => '',
  164. 'rel' => '',
  165. 'prefix' => '',
  166. 'suffix' => '',
  167. 'target' => '',
  168. 'help' => '',
  169. 'trim' => 0,
  170. 'max_length' => '',
  171. 'word_boundary' => 1,
  172. 'ellipsis' => 1,
  173. 'html' => 0,
  174. 'strip_tags' => 0,
  175. ),
  176. 'empty' => '',
  177. 'hide_empty' => 0,
  178. 'empty_zero' => 0,
  179. 'hide_alter_empty' => 1,
  180. 'type' => 'separator',
  181. 'separator' => ', ',
  182. 'exclude' => 0,
  183. 'id' => 'description',
  184. 'table' => 'nd_geolocation',
  185. 'field' => 'description',
  186. 'relationship' => 'none',
  187. ),
  188. ));
  189. $handler->override_option('sorts', array(
  190. 'name' => array(
  191. 'order' => 'ASC',
  192. 'id' => 'name',
  193. 'table' => 'cvterm',
  194. 'field' => 'name',
  195. 'relationship' => 'none',
  196. ),
  197. 'description' => array(
  198. 'order' => 'ASC',
  199. 'id' => 'description',
  200. 'table' => 'nd_geolocation',
  201. 'field' => 'description',
  202. 'relationship' => 'none',
  203. ),
  204. ));
  205. $handler->override_option('filters', array(
  206. 'type_id' => array(
  207. 'operator' => '=',
  208. 'value' => '',
  209. 'group' => '0',
  210. 'exposed' => TRUE,
  211. 'expose' => array(
  212. 'use_operator' => 0,
  213. 'operator' => 'type_id_op',
  214. 'identifier' => 'type_id',
  215. 'label' => 'Experiment Type',
  216. 'remember' => 0,
  217. ),
  218. 'case' => 1,
  219. 'id' => 'type_id',
  220. 'table' => 'nd_experiment',
  221. 'field' => 'type_id',
  222. 'relationship' => 'none',
  223. 'values_form_type' => 'select',
  224. 'multiple' => 1,
  225. 'optional' => 0,
  226. 'show_all' => 0,
  227. 'agg' => array(
  228. 'records_with' => 1,
  229. 'aggregates_with' => 1,
  230. ),
  231. ),
  232. 'description' => array(
  233. 'operator' => '=',
  234. 'value' => array(),
  235. 'group' => '0',
  236. 'exposed' => TRUE,
  237. 'expose' => array(
  238. 'use_operator' => 0,
  239. 'operator' => 'description_op',
  240. 'identifier' => 'geolocation',
  241. 'label' => 'Location Experiment Performed',
  242. 'remember' => 0,
  243. ),
  244. 'case' => 1,
  245. 'id' => 'description',
  246. 'table' => 'nd_geolocation',
  247. 'field' => 'description',
  248. 'relationship' => 'none',
  249. 'agg' => array(
  250. 'records_with' => 1,
  251. 'aggregates_with' => 1,
  252. ),
  253. 'values_form_type' => 'select',
  254. 'multiple' => 1,
  255. 'optional' => 0,
  256. ),
  257. 'search_results' => array(
  258. 'operator' => '=',
  259. 'value' => '',
  260. 'group' => '0',
  261. 'exposed' => FALSE,
  262. 'expose' => array(
  263. 'operator' => FALSE,
  264. 'label' => '',
  265. ),
  266. 'id' => 'search_results',
  267. 'table' => 'views',
  268. 'field' => 'search_results',
  269. 'relationship' => 'none',
  270. 'apply_button' => 'Show',
  271. 'no_results_text' => 'Click "Show" to see a list of all experiments matching the entered criteria. If you leave a any of the criteria blank then the experiments will be not be filtered based on that field. Furthermore, if you leave all criteria blank then all experiments will be listed.',
  272. ),
  273. ));
  274. $handler->override_option('access', array(
  275. 'type' => 'perm',
  276. 'perm' => 'access content',
  277. ));
  278. $handler->override_option('cache', array(
  279. 'type' => 'none',
  280. ));
  281. $handler->override_option('title', 'Natural Diversity Experiments');
  282. $handler->override_option('header', 'Click "Show" to see a list of all experiments matching the entered criteria. If you leave a any of the criteria blank then the experiments will be not be filtered based on that field. Furthermore, if you leave all criteria blank then all experiments will be listed.');
  283. $handler->override_option('header_format', '2');
  284. $handler->override_option('header_empty', 0);
  285. $handler->override_option('empty', 'No natural diversity experiments match the current criteria.');
  286. $handler->override_option('empty_format', '2');
  287. $handler->override_option('items_per_page', 50);
  288. $handler->override_option('use_pager', '1');
  289. $handler->override_option('style_plugin', 'table');
  290. $handler->override_option('style_options', array(
  291. 'grouping' => '',
  292. 'override' => 1,
  293. 'sticky' => 0,
  294. 'order' => 'asc',
  295. 'summary' => '',
  296. 'columns' => array(
  297. 'name' => 'name',
  298. 'description' => 'description',
  299. ),
  300. 'info' => array(
  301. 'name' => array(
  302. 'sortable' => 1,
  303. 'separator' => '',
  304. ),
  305. 'description' => array(
  306. 'sortable' => 1,
  307. 'separator' => '',
  308. ),
  309. ),
  310. 'default' => '-1',
  311. ));
  312. $handler = $view->new_display('page', 'Page', 'page_1');
  313. $handler->override_option('path', 'chado/natdiv_experiments');
  314. $handler->override_option('menu', array(
  315. 'type' => 'normal',
  316. 'title' => 'Natural Diversity Experiments',
  317. 'description' => 'A single assay resulting in a single genotype or phenotype. Multiple assays resulting in an entire experiment should be grouped together as a project.',
  318. 'weight' => '10',
  319. 'name' => 'navigation',
  320. ));
  321. $handler->override_option('tab_options', array(
  322. 'type' => 'none',
  323. 'title' => '',
  324. 'description' => '',
  325. 'weight' => 0,
  326. 'name' => 'navigation',
  327. ));
  328. $views[$view->name] = $view;
  329. // List geolocations
  330. $view = new view;
  331. $view->name = 'geolocation_listing';
  332. $view->description = 'A listing of locations where natural diversity experiments took place.';
  333. $view->tag = 'chado default';
  334. $view->base_table = 'nd_geolocation';
  335. $view->core = 6;
  336. $view->api_version = '2';
  337. $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
  338. $handler = $view->new_display('default', 'Defaults', 'default');
  339. $handler->override_option('fields', array(
  340. 'description' => array(
  341. 'label' => 'Name',
  342. 'alter' => array(
  343. 'alter_text' => 0,
  344. 'text' => '',
  345. 'make_link' => 0,
  346. 'path' => '',
  347. 'absolute' => 0,
  348. 'link_class' => '',
  349. 'alt' => '',
  350. 'rel' => '',
  351. 'prefix' => '',
  352. 'suffix' => '',
  353. 'target' => '',
  354. 'help' => '',
  355. 'trim' => 0,
  356. 'max_length' => '',
  357. 'word_boundary' => 1,
  358. 'ellipsis' => 1,
  359. 'html' => 0,
  360. 'strip_tags' => 0,
  361. ),
  362. 'empty' => '',
  363. 'hide_empty' => 0,
  364. 'empty_zero' => 0,
  365. 'hide_alter_empty' => 1,
  366. 'type' => 'separator',
  367. 'separator' => ', ',
  368. 'exclude' => 0,
  369. 'id' => 'description',
  370. 'table' => 'nd_geolocation',
  371. 'field' => 'description',
  372. 'relationship' => 'none',
  373. ),
  374. 'latitude' => array(
  375. 'label' => 'Latitude',
  376. 'alter' => array(
  377. 'alter_text' => 0,
  378. 'text' => '',
  379. 'make_link' => 0,
  380. 'path' => '',
  381. 'absolute' => 0,
  382. 'link_class' => '',
  383. 'alt' => '',
  384. 'rel' => '',
  385. 'prefix' => '',
  386. 'suffix' => '',
  387. 'target' => '',
  388. 'help' => '',
  389. 'trim' => 0,
  390. 'max_length' => '',
  391. 'word_boundary' => 1,
  392. 'ellipsis' => 1,
  393. 'html' => 0,
  394. 'strip_tags' => 0,
  395. ),
  396. 'empty' => '',
  397. 'hide_empty' => 0,
  398. 'empty_zero' => 0,
  399. 'hide_alter_empty' => 1,
  400. 'type' => 'separator',
  401. 'separator' => ', ',
  402. 'exclude' => 0,
  403. 'id' => 'latitude',
  404. 'table' => 'nd_geolocation',
  405. 'field' => 'latitude',
  406. 'relationship' => 'none',
  407. ),
  408. 'longitude' => array(
  409. 'label' => 'Longitude',
  410. 'alter' => array(
  411. 'alter_text' => 0,
  412. 'text' => '',
  413. 'make_link' => 0,
  414. 'path' => '',
  415. 'absolute' => 0,
  416. 'link_class' => '',
  417. 'alt' => '',
  418. 'rel' => '',
  419. 'prefix' => '',
  420. 'suffix' => '',
  421. 'target' => '',
  422. 'help' => '',
  423. 'trim' => 0,
  424. 'max_length' => '',
  425. 'word_boundary' => 1,
  426. 'ellipsis' => 1,
  427. 'html' => 0,
  428. 'strip_tags' => 0,
  429. ),
  430. 'empty' => '',
  431. 'hide_empty' => 0,
  432. 'empty_zero' => 0,
  433. 'hide_alter_empty' => 1,
  434. 'type' => 'separator',
  435. 'separator' => ', ',
  436. 'exclude' => 0,
  437. 'id' => 'longitude',
  438. 'table' => 'nd_geolocation',
  439. 'field' => 'longitude',
  440. 'relationship' => 'none',
  441. ),
  442. 'altitude' => array(
  443. 'label' => 'Altitude',
  444. 'alter' => array(
  445. 'alter_text' => 0,
  446. 'text' => '',
  447. 'make_link' => 0,
  448. 'path' => '',
  449. 'absolute' => 0,
  450. 'link_class' => '',
  451. 'alt' => '',
  452. 'rel' => '',
  453. 'prefix' => '',
  454. 'suffix' => '',
  455. 'target' => '',
  456. 'help' => '',
  457. 'trim' => 0,
  458. 'max_length' => '',
  459. 'word_boundary' => 1,
  460. 'ellipsis' => 1,
  461. 'html' => 0,
  462. 'strip_tags' => 0,
  463. ),
  464. 'empty' => '',
  465. 'hide_empty' => 0,
  466. 'empty_zero' => 0,
  467. 'hide_alter_empty' => 1,
  468. 'type' => 'separator',
  469. 'separator' => ', ',
  470. 'exclude' => 0,
  471. 'id' => 'altitude',
  472. 'table' => 'nd_geolocation',
  473. 'field' => 'altitude',
  474. 'relationship' => 'none',
  475. ),
  476. 'geodetic_datum' => array(
  477. 'label' => 'Geodetic Datum',
  478. 'alter' => array(
  479. 'alter_text' => 0,
  480. 'text' => '',
  481. 'make_link' => 0,
  482. 'path' => '',
  483. 'absolute' => 0,
  484. 'link_class' => '',
  485. 'alt' => '',
  486. 'rel' => '',
  487. 'prefix' => '',
  488. 'suffix' => '',
  489. 'target' => '',
  490. 'help' => '',
  491. 'trim' => 0,
  492. 'max_length' => '',
  493. 'word_boundary' => 1,
  494. 'ellipsis' => 1,
  495. 'html' => 0,
  496. 'strip_tags' => 0,
  497. ),
  498. 'empty' => '',
  499. 'hide_empty' => 0,
  500. 'empty_zero' => 0,
  501. 'hide_alter_empty' => 1,
  502. 'type' => 'separator',
  503. 'separator' => ', ',
  504. 'exclude' => 0,
  505. 'id' => 'geodetic_datum',
  506. 'table' => 'nd_geolocation',
  507. 'field' => 'geodetic_datum',
  508. 'relationship' => 'none',
  509. ),
  510. ));
  511. $handler->override_option('filters', array(
  512. 'geodetic_datum' => array(
  513. 'operator' => '=',
  514. 'value' => array(),
  515. 'group' => '0',
  516. 'exposed' => TRUE,
  517. 'expose' => array(
  518. 'use_operator' => 0,
  519. 'operator' => 'geodetic_datum_op',
  520. 'identifier' => 'geodetic_datum',
  521. 'label' => 'Geodetic Datum',
  522. 'remember' => 0,
  523. ),
  524. 'case' => 1,
  525. 'id' => 'geodetic_datum',
  526. 'table' => 'nd_geolocation',
  527. 'field' => 'geodetic_datum',
  528. 'relationship' => 'none',
  529. 'agg' => array(
  530. 'records_with' => 1,
  531. 'aggregates_with' => 1,
  532. ),
  533. 'values_form_type' => 'select',
  534. 'multiple' => 1,
  535. 'optional' => 0,
  536. ),
  537. 'latitude' => array(
  538. 'operator' => '=',
  539. 'value' => array(
  540. 'value' => '',
  541. 'min' => '',
  542. 'max' => '',
  543. ),
  544. 'group' => '0',
  545. 'exposed' => TRUE,
  546. 'expose' => array(
  547. 'use_operator' => 1,
  548. 'operator' => 'latitude_op',
  549. 'identifier' => 'latitude',
  550. 'label' => 'Latitude',
  551. 'optional' => 0,
  552. 'remember' => 0,
  553. ),
  554. 'case' => 1,
  555. 'id' => 'latitude',
  556. 'table' => 'nd_geolocation',
  557. 'field' => 'latitude',
  558. 'relationship' => 'none',
  559. 'agg' => array(
  560. 'records_with' => 1,
  561. 'aggregates_with' => 1,
  562. ),
  563. ),
  564. 'longitude' => array(
  565. 'operator' => '=',
  566. 'value' => array(
  567. 'value' => '',
  568. 'min' => '',
  569. 'max' => '',
  570. ),
  571. 'group' => '0',
  572. 'exposed' => TRUE,
  573. 'expose' => array(
  574. 'use_operator' => 1,
  575. 'operator' => 'longitude_op',
  576. 'identifier' => 'longitude',
  577. 'label' => 'Longitude',
  578. 'optional' => 0,
  579. 'remember' => 0,
  580. ),
  581. 'case' => 1,
  582. 'id' => 'longitude',
  583. 'table' => 'nd_geolocation',
  584. 'field' => 'longitude',
  585. 'relationship' => 'none',
  586. 'agg' => array(
  587. 'records_with' => 1,
  588. 'aggregates_with' => 1,
  589. ),
  590. ),
  591. 'altitude' => array(
  592. 'operator' => '=',
  593. 'value' => array(
  594. 'value' => '',
  595. 'min' => '',
  596. 'max' => '',
  597. ),
  598. 'group' => '0',
  599. 'exposed' => TRUE,
  600. 'expose' => array(
  601. 'use_operator' => 1,
  602. 'operator' => 'altitude_op',
  603. 'identifier' => 'altitude',
  604. 'label' => 'Altitude',
  605. 'optional' => 0,
  606. 'remember' => 0,
  607. ),
  608. 'case' => 0,
  609. 'id' => 'altitude',
  610. 'table' => 'nd_geolocation',
  611. 'field' => 'altitude',
  612. 'relationship' => 'none',
  613. 'agg' => array(
  614. 'records_with' => 1,
  615. 'aggregates_with' => 1,
  616. ),
  617. ),
  618. 'description' => array(
  619. 'operator' => '~',
  620. 'value' => '',
  621. 'group' => '0',
  622. 'exposed' => TRUE,
  623. 'expose' => array(
  624. 'use_operator' => 0,
  625. 'operator' => 'description_op',
  626. 'identifier' => 'description',
  627. 'label' => 'Name Contains',
  628. 'remember' => 0,
  629. ),
  630. 'case' => 0,
  631. 'id' => 'description',
  632. 'table' => 'nd_geolocation',
  633. 'field' => 'description',
  634. 'relationship' => 'none',
  635. 'agg' => array(
  636. 'records_with' => 1,
  637. 'aggregates_with' => 1,
  638. ),
  639. 'values_form_type' => 'textfield',
  640. 'multiple' => 0,
  641. 'optional' => 0,
  642. ),
  643. ));
  644. $handler->override_option('access', array(
  645. 'type' => 'perm',
  646. 'perm' => 'access content',
  647. ));
  648. $handler->override_option('cache', array(
  649. 'type' => 'none',
  650. ));
  651. $handler->override_option('title', 'Geographical Locations');
  652. $handler->override_option('header', 'Use the following criteria to limit the locations listed. If you leave a any of the criteria blank then the locations will be not be filtered based on that field.');
  653. $handler->override_option('header_format', '2');
  654. $handler->override_option('header_empty', 0);
  655. $handler->override_option('empty', 'No locations matched the current criteria.');
  656. $handler->override_option('empty_format', '2');
  657. $handler->override_option('items_per_page', 50);
  658. $handler->override_option('use_pager', '1');
  659. $handler->override_option('style_plugin', 'table');
  660. $handler->override_option('style_options', array(
  661. 'grouping' => '',
  662. 'override' => 1,
  663. 'sticky' => 0,
  664. 'order' => 'asc',
  665. 'summary' => '',
  666. 'columns' => array(
  667. 'description' => 'description',
  668. 'latitude' => 'latitude',
  669. 'longitude' => 'longitude',
  670. 'altitude' => 'altitude',
  671. 'geodetic_datum' => 'geodetic_datum',
  672. ),
  673. 'info' => array(
  674. 'description' => array(
  675. 'sortable' => 1,
  676. 'separator' => '',
  677. ),
  678. 'latitude' => array(
  679. 'sortable' => 1,
  680. 'separator' => '',
  681. ),
  682. 'longitude' => array(
  683. 'sortable' => 1,
  684. 'separator' => '',
  685. ),
  686. 'altitude' => array(
  687. 'sortable' => 1,
  688. 'separator' => '',
  689. ),
  690. 'geodetic_datum' => array(
  691. 'sortable' => 1,
  692. 'separator' => '',
  693. ),
  694. ),
  695. 'default' => 'description',
  696. ));
  697. $handler = $view->new_display('page', 'Page', 'page_1');
  698. $handler->override_option('path', 'chado/natdiv_geolocations');
  699. $handler->override_option('menu', array(
  700. 'type' => 'normal',
  701. 'title' => 'Locations',
  702. 'description' => 'Geographical locations in which natural diversity experiments might be performed.',
  703. 'weight' => '10',
  704. 'name' => 'navigation',
  705. ));
  706. $handler->override_option('tab_options', array(
  707. 'type' => 'none',
  708. 'title' => '',
  709. 'description' => '',
  710. 'weight' => 0,
  711. 'name' => 'navigation',
  712. ));
  713. $views[$view->name] = $view;
  714. // List protocols
  715. $view = new view;
  716. $view->name = 'natdiv_protocol_listing';
  717. $view->description = 'A listing of protocols used for natural diversity experiments';
  718. $view->tag = 'chado default';
  719. $view->base_table = 'nd_protocol';
  720. $view->core = 6;
  721. $view->api_version = '2';
  722. $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
  723. $handler = $view->new_display('default', 'Defaults', 'default');
  724. $handler->override_option('fields', array(
  725. 'name' => array(
  726. 'label' => 'Name',
  727. 'alter' => array(
  728. 'alter_text' => 0,
  729. 'text' => '',
  730. 'make_link' => 0,
  731. 'path' => '',
  732. 'absolute' => 0,
  733. 'link_class' => '',
  734. 'alt' => '',
  735. 'rel' => '',
  736. 'prefix' => '',
  737. 'suffix' => '',
  738. 'target' => '',
  739. 'help' => '',
  740. 'trim' => 0,
  741. 'max_length' => '',
  742. 'word_boundary' => 1,
  743. 'ellipsis' => 1,
  744. 'html' => 0,
  745. 'strip_tags' => 0,
  746. ),
  747. 'empty' => '',
  748. 'hide_empty' => 0,
  749. 'empty_zero' => 0,
  750. 'hide_alter_empty' => 1,
  751. 'type' => 'separator',
  752. 'separator' => ', ',
  753. 'exclude' => 0,
  754. 'id' => 'name',
  755. 'table' => 'nd_protocol',
  756. 'field' => 'name',
  757. 'relationship' => 'none',
  758. ),
  759. ));
  760. $handler->override_option('filters', array(
  761. 'name' => array(
  762. 'operator' => '~',
  763. 'value' => '',
  764. 'group' => '0',
  765. 'exposed' => TRUE,
  766. 'expose' => array(
  767. 'use_operator' => 0,
  768. 'operator' => 'name_op',
  769. 'identifier' => 'name',
  770. 'label' => 'Name Contains',
  771. 'remember' => 0,
  772. ),
  773. 'case' => 0,
  774. 'id' => 'name',
  775. 'table' => 'nd_protocol',
  776. 'field' => 'name',
  777. 'relationship' => 'none',
  778. 'agg' => array(
  779. 'records_with' => 1,
  780. 'aggregates_with' => 1,
  781. ),
  782. ),
  783. 'search_results' => array(
  784. 'operator' => '=',
  785. 'value' => '',
  786. 'group' => '0',
  787. 'exposed' => FALSE,
  788. 'expose' => array(
  789. 'operator' => FALSE,
  790. 'label' => '',
  791. ),
  792. 'id' => 'search_results',
  793. 'table' => 'views',
  794. 'field' => 'search_results',
  795. 'relationship' => 'none',
  796. 'apply_button' => 'Show',
  797. 'no_results_text' => 'Click "Show" to see a list of all protocols matching the entered criteria. If you leave a any of the criteria blank then the protocols will be not be filtered based on that field. Furthermore, if you leave all criteria blank then all protocols will be listed.',
  798. ),
  799. ));
  800. $handler->override_option('access', array(
  801. 'type' => 'perm',
  802. 'perm' => 'access content',
  803. ));
  804. $handler->override_option('cache', array(
  805. 'type' => 'none',
  806. ));
  807. $handler->override_option('title', 'Protocols');
  808. $handler->override_option('header', 'Click "Show" to see a list of all protocols matching the entered criteria. If you leave a any of the criteria blank then the protocols will be not be filtered based on that field. Furthermore, if you leave all criteria blank then all protocols will be listed.');
  809. $handler->override_option('header_format', '2');
  810. $handler->override_option('header_empty', 0);
  811. $handler->override_option('empty', 'No protocols match the current criteria.');
  812. $handler->override_option('empty_format', '2');
  813. $handler->override_option('items_per_page', 50);
  814. $handler->override_option('use_pager', '1');
  815. $handler->override_option('style_plugin', 'table');
  816. $handler->override_option('style_options', array(
  817. 'grouping' => '',
  818. 'override' => 1,
  819. 'sticky' => 0,
  820. 'order' => 'asc',
  821. 'summary' => '',
  822. 'columns' => array(
  823. 'name' => 'name',
  824. ),
  825. 'info' => array(
  826. 'name' => array(
  827. 'sortable' => 1,
  828. 'separator' => '',
  829. ),
  830. ),
  831. 'default' => 'name',
  832. ));
  833. $handler = $view->new_display('page', 'Page', 'page_1');
  834. $handler->override_option('path', 'chado/natdiv_protocols');
  835. $handler->override_option('menu', array(
  836. 'type' => 'normal',
  837. 'title' => 'Protocols',
  838. 'description' => 'The protcols used for natural diversity experiments',
  839. 'weight' => '10',
  840. 'name' => 'navigation',
  841. ));
  842. $handler->override_option('tab_options', array(
  843. 'type' => 'none',
  844. 'title' => '',
  845. 'description' => '',
  846. 'weight' => 0,
  847. 'name' => 'navigation',
  848. ));
  849. $views[$view->name] = $view;
  850. // List Reagents
  851. $view = new view;
  852. $view->name = 'natdiv_reagent_listing';
  853. $view->description = 'A listing of reagents used in natural diversity experiments';
  854. $view->tag = 'chado default';
  855. $view->base_table = 'nd_reagent';
  856. $view->core = 6;
  857. $view->api_version = '2';
  858. $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
  859. $handler = $view->new_display('default', 'Defaults', 'default');
  860. $handler->override_option('fields', array(
  861. 'name_1' => array(
  862. 'label' => 'Name',
  863. 'alter' => array(
  864. 'alter_text' => 0,
  865. 'text' => '',
  866. 'make_link' => 0,
  867. 'path' => '',
  868. 'absolute' => 0,
  869. 'link_class' => '',
  870. 'alt' => '',
  871. 'rel' => '',
  872. 'prefix' => '',
  873. 'suffix' => '',
  874. 'target' => '',
  875. 'help' => '',
  876. 'trim' => 0,
  877. 'max_length' => '',
  878. 'word_boundary' => 1,
  879. 'ellipsis' => 1,
  880. 'html' => 0,
  881. 'strip_tags' => 0,
  882. ),
  883. 'empty' => '',
  884. 'hide_empty' => 0,
  885. 'empty_zero' => 0,
  886. 'hide_alter_empty' => 1,
  887. 'type' => 'separator',
  888. 'separator' => ', ',
  889. 'exclude' => 0,
  890. 'id' => 'name_1',
  891. 'table' => 'nd_reagent',
  892. 'field' => 'name',
  893. 'relationship' => 'none',
  894. ),
  895. 'name' => array(
  896. 'label' => 'Type',
  897. 'alter' => array(
  898. 'alter_text' => 0,
  899. 'text' => '',
  900. 'make_link' => 0,
  901. 'path' => '',
  902. 'absolute' => 0,
  903. 'link_class' => '',
  904. 'alt' => '',
  905. 'rel' => '',
  906. 'prefix' => '',
  907. 'suffix' => '',
  908. 'target' => '',
  909. 'help' => '',
  910. 'trim' => 0,
  911. 'max_length' => '',
  912. 'word_boundary' => 1,
  913. 'ellipsis' => 1,
  914. 'html' => 0,
  915. 'strip_tags' => 0,
  916. ),
  917. 'empty' => '',
  918. 'hide_empty' => 0,
  919. 'empty_zero' => 0,
  920. 'hide_alter_empty' => 1,
  921. 'type' => 'separator',
  922. 'separator' => ', ',
  923. 'exclude' => 0,
  924. 'id' => 'name',
  925. 'table' => 'cvterm',
  926. 'field' => 'name',
  927. 'relationship' => 'none',
  928. ),
  929. ));
  930. $handler->override_option('filters', array(
  931. 'type_id' => array(
  932. 'operator' => '=',
  933. 'value' => '',
  934. 'group' => '0',
  935. 'exposed' => TRUE,
  936. 'expose' => array(
  937. 'use_operator' => 0,
  938. 'operator' => 'type_id_op',
  939. 'identifier' => 'type_id',
  940. 'label' => 'Type',
  941. 'remember' => 0,
  942. ),
  943. 'case' => 1,
  944. 'id' => 'type_id',
  945. 'table' => 'nd_reagent',
  946. 'field' => 'type_id',
  947. 'relationship' => 'none',
  948. 'values_form_type' => 'select',
  949. 'multiple' => 1,
  950. 'optional' => 0,
  951. 'show_all' => 0,
  952. 'agg' => array(
  953. 'records_with' => 1,
  954. 'aggregates_with' => 1,
  955. ),
  956. ),
  957. 'search_results' => array(
  958. 'operator' => '=',
  959. 'value' => '',
  960. 'group' => '0',
  961. 'exposed' => FALSE,
  962. 'expose' => array(
  963. 'operator' => FALSE,
  964. 'label' => '',
  965. ),
  966. 'id' => 'search_results',
  967. 'table' => 'views',
  968. 'field' => 'search_results',
  969. 'relationship' => 'none',
  970. 'apply_button' => 'Show',
  971. 'no_results_text' => 'Click "Show" to see a list of all reagents matching the entered criteria. If you leave a any of the criteria blank then the reagents will be not be filtered based on that field. Furthermore, if you leave all criteria blank then all reagents will be listed.',
  972. ),
  973. 'name' => array(
  974. 'operator' => '~',
  975. 'value' => '',
  976. 'group' => '0',
  977. 'exposed' => TRUE,
  978. 'expose' => array(
  979. 'use_operator' => 0,
  980. 'operator' => 'name_op',
  981. 'identifier' => 'name',
  982. 'label' => 'Name Contains',
  983. 'remember' => 0,
  984. ),
  985. 'case' => 0,
  986. 'id' => 'name',
  987. 'table' => 'nd_reagent',
  988. 'field' => 'name',
  989. 'relationship' => 'none',
  990. 'agg' => array(
  991. 'records_with' => 1,
  992. 'aggregates_with' => 1,
  993. ),
  994. ),
  995. ));
  996. $handler->override_option('access', array(
  997. 'type' => 'perm',
  998. 'perm' => 'access content',
  999. ));
  1000. $handler->override_option('cache', array(
  1001. 'type' => 'none',
  1002. ));
  1003. $handler->override_option('title', 'Reagents');
  1004. $handler->override_option('header', 'Click "Show" to see a list of all reagents matching the entered criteria. If you leave a any of the criteria blank then the reagents will be not be filtered based on that field. Furthermore, if you leave all criteria blank then all reagents will be listed.');
  1005. $handler->override_option('header_format', '2');
  1006. $handler->override_option('header_empty', 0);
  1007. $handler->override_option('empty', 'No reagents match the current criteria.');
  1008. $handler->override_option('empty_format', '2');
  1009. $handler->override_option('items_per_page', 50);
  1010. $handler->override_option('use_pager', '1');
  1011. $handler->override_option('style_plugin', 'table');
  1012. $handler = $view->new_display('page', 'Page', 'page_1');
  1013. $handler->override_option('path', 'chado/natdiv_reagents');
  1014. $handler->override_option('menu', array(
  1015. 'type' => 'normal',
  1016. 'title' => 'Reagents',
  1017. 'description' => 'Reagents used in natural diversity experiments',
  1018. 'weight' => '10',
  1019. 'name' => 'navigation',
  1020. ));
  1021. $handler->override_option('tab_options', array(
  1022. 'type' => 'none',
  1023. 'title' => '',
  1024. 'description' => '',
  1025. 'weight' => 0,
  1026. 'name' => 'navigation',
  1027. ));
  1028. $views[$view->name] = $view;
  1029. return $views;
  1030. }