tripal_natural_diversity.views.inc 30 KB

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