12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049 |
- <?php
- /**
- * @file
- * This file contains the basic functions for views integration of
- * chado/tripal_natural_diversity tables.
- *
- * Documentation on views integration can be found at
- * http://views2.logrus.com/doc/html/index.html.
- */
- /**
- * Implements hook_views_data()
- * Purpose: Describe chado/tripal tables & fields to views
- *
- * @return: a data array which follows the structure outlined in the
- * views2 documentation for this hook. Essentially, it's an array of table
- * definitions keyed by chado/tripal table name. Each table definition
- * includes basic details about the table, fields in that table and
- * relationships between that table and others (joins)
- */
- function tripal_natural_diversity_views_data() {
- $data = array();
- if (module_exists('tripal_views')) {
- $tables = array(
- 'nd_experiment',
- 'nd_geolocation',
- 'nd_protocol',
- 'nd_reagent'
- );
- foreach ($tables as $tablename) {
- $priority = 9;
- // check to see if the table is integrated. If it is then integrate it's
- // corresponding 'chado_[table]' table.
- if (!tripal_views_is_integrated($tablename, $priority)) {
- $table_integration_array = tripal_views_get_integration_array_for_chado_table($tablename, TRUE, $priority);
- // Add specialty handlers
- switch ($tablename) {
- case 'nd_geolocation':
- $table_integration_array['fields']['description']['handlers']['filter']['name'] = 'tripal_views_handler_filter_select_string';
- $table_integration_array['fields']['geodetic_datum']['handlers']['filter']['name'] = 'tripal_views_handler_filter_select_string';
- $table_integration_array['fields']['latitude']['handlers']['filter']['name'] = 'chado_views_handler_filter_float';
- $table_integration_array['fields']['longitude']['handlers']['filter']['name'] = 'chado_views_handler_filter_float';
- $table_integration_array['fields']['altitude']['handlers']['filter']['name'] = 'chado_views_handler_filter_float';
- break;
- }
- tripal_views_integration_add_entry($table_integration_array);
- }
- }
- $tables = array(
- 'nd_experiment_contact',
- 'nd_experiment_dbxref',
- 'nd_experiment_genotype',
- 'nd_experiment_phenotype',
- 'nd_experiment_project',
- 'nd_experiment_protocol',
- 'nd_experiment_pub',
- 'nd_experiment_stock',
- 'nd_experiment_stock_dbxref',
- 'nd_experiment_stockprop',
- 'nd_experimentprop',
- 'nd_geolocationprop',
- 'nd_protocol_reagent',
- 'nd_protocolprop',
- 'nd_reagent_relationship',
- 'nd_reagentprop'
- );
- foreach ($tables as $tablename) {
- $priority = 9;
- if (!tripal_views_is_integrated($tablename, $priority)) {
- $table_integration_array = tripal_views_get_integration_array_for_chado_table($tablename, FALSE, $priority);
- tripal_views_integration_add_entry($table_integration_array);
- }
- }
- }
- return $data;
- }
- /**
- * Implements hook_views_handlers()
- * Purpose: Register all custom handlers with views
- * where a handler describes either "the type of field",
- * "how a field should be filtered", "how a field should be sorted"
- *
- * @return: An array of handler definitions
- */
- function tripal_natural_diversity_views_handlers() {
- return array(
- 'info' => array(
- 'path' => drupal_get_path('module', 'tripal_natural_diversity') . '/views/handlers',
- ),
- 'handlers' => array(
- 'views_handler_field_chado_relationship_all' => array(
- 'parent' => 'views_handler_field_prerender_list',
- ),
- 'views_handler_field_chado_relationship_by_type' => array(
- 'parent' => 'views_handler_field_prerender_list',
- ),
- ),
- );
- }
- /**
- * Created Default views related to the tables integrated by this module
- *
- * @ingroup tripal_feature_views
- */
- function tripal_natural_diversity_views_default_views() {
- $views = array();
- if (!module_exists('tripal_views')) {
- return $views;
- }
- // Experiment Listing
- $view = new view;
- $view->name = 'natdiv_experiment_listing';
- $view->description = 'A listing of all natural diversity experiments';
- $view->tag = 'chado default';
- $view->base_table = 'nd_experiment';
- $view->core = 6;
- $view->api_version = '2';
- $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
- $handler = $view->new_display('default', 'Defaults', 'default');
- $handler->override_option('fields', array(
- 'name' => array(
- 'label' => 'Type',
- 'alter' => array(
- 'alter_text' => 0,
- 'text' => '',
- 'make_link' => 0,
- 'path' => '',
- 'absolute' => 0,
- 'link_class' => '',
- 'alt' => '',
- 'rel' => '',
- 'prefix' => '',
- 'suffix' => '',
- 'target' => '',
- 'help' => '',
- 'trim' => 0,
- 'max_length' => '',
- 'word_boundary' => 1,
- 'ellipsis' => 1,
- 'html' => 0,
- 'strip_tags' => 0,
- ),
- 'empty' => '',
- 'hide_empty' => 0,
- 'empty_zero' => 0,
- 'hide_alter_empty' => 1,
- 'type' => 'separator',
- 'separator' => ', ',
- 'exclude' => 0,
- 'id' => 'name',
- 'table' => 'cvterm',
- 'field' => 'name',
- 'relationship' => 'none',
- ),
- 'description' => array(
- 'label' => 'Location Experiment Performed',
- 'alter' => array(
- 'alter_text' => 0,
- 'text' => '',
- 'make_link' => 0,
- 'path' => '',
- 'absolute' => 0,
- 'link_class' => '',
- 'alt' => '',
- 'rel' => '',
- 'prefix' => '',
- 'suffix' => '',
- 'target' => '',
- 'help' => '',
- 'trim' => 0,
- 'max_length' => '',
- 'word_boundary' => 1,
- 'ellipsis' => 1,
- 'html' => 0,
- 'strip_tags' => 0,
- ),
- 'empty' => '',
- 'hide_empty' => 0,
- 'empty_zero' => 0,
- 'hide_alter_empty' => 1,
- 'type' => 'separator',
- 'separator' => ', ',
- 'exclude' => 0,
- 'id' => 'description',
- 'table' => 'nd_geolocation',
- 'field' => 'description',
- 'relationship' => 'none',
- ),
- ));
- $handler->override_option('sorts', array(
- 'name' => array(
- 'order' => 'ASC',
- 'id' => 'name',
- 'table' => 'cvterm',
- 'field' => 'name',
- 'relationship' => 'none',
- ),
- 'description' => array(
- 'order' => 'ASC',
- 'id' => 'description',
- 'table' => 'nd_geolocation',
- 'field' => 'description',
- 'relationship' => 'none',
- ),
- ));
- $handler->override_option('filters', array(
- 'type_id' => array(
- 'operator' => '=',
- 'value' => '',
- 'group' => '0',
- 'exposed' => TRUE,
- 'expose' => array(
- 'use_operator' => 0,
- 'operator' => 'type_id_op',
- 'identifier' => 'type_id',
- 'label' => 'Experiment Type',
- 'remember' => 0,
- ),
- 'case' => 1,
- 'id' => 'type_id',
- 'table' => 'nd_experiment',
- 'field' => 'type_id',
- 'relationship' => 'none',
- 'values_form_type' => 'select',
- 'multiple' => 1,
- 'optional' => 0,
- 'show_all' => 0,
- 'agg' => array(
- 'records_with' => 1,
- 'aggregates_with' => 1,
- ),
- ),
- 'description' => array(
- 'operator' => '=',
- 'value' => 'University of Saskatchewan',
- 'group' => '0',
- 'exposed' => TRUE,
- 'expose' => array(
- 'use_operator' => 0,
- 'operator' => 'description_op',
- 'identifier' => 'geolocation',
- 'label' => 'Location Experiment Performed',
- 'remember' => 0,
- ),
- 'case' => 1,
- 'id' => 'description',
- 'table' => 'nd_geolocation',
- 'field' => 'description',
- 'relationship' => 'none',
- 'agg' => array(
- 'records_with' => 1,
- 'aggregates_with' => 1,
- ),
- 'values_form_type' => 'select',
- 'multiple' => 1,
- 'optional' => 0,
- ),
- 'search_results' => array(
- 'operator' => '=',
- 'value' => '',
- 'group' => '0',
- 'exposed' => FALSE,
- 'expose' => array(
- 'operator' => FALSE,
- 'label' => '',
- ),
- 'id' => 'search_results',
- 'table' => 'views',
- 'field' => 'search_results',
- 'relationship' => 'none',
- 'apply_button' => 'Show',
- '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.',
- ),
- ));
- $handler->override_option('access', array(
- 'type' => 'perm',
- 'perm' => 'access content',
- ));
- $handler->override_option('cache', array(
- 'type' => 'none',
- ));
- $handler->override_option('title', 'Natural Diversity Experiments');
- $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.');
- $handler->override_option('header_format', '2');
- $handler->override_option('header_empty', 0);
- $handler->override_option('empty', 'No natural diversity experiments match the current criteria.');
- $handler->override_option('empty_format', '2');
- $handler->override_option('items_per_page', 50);
- $handler->override_option('use_pager', '1');
- $handler->override_option('style_plugin', 'table');
- $handler->override_option('style_options', array(
- 'grouping' => '',
- 'override' => 1,
- 'sticky' => 0,
- 'order' => 'asc',
- 'summary' => '',
- 'columns' => array(
- 'name' => 'name',
- 'description' => 'description',
- ),
- 'info' => array(
- 'name' => array(
- 'sortable' => 1,
- 'separator' => '',
- ),
- 'description' => array(
- 'sortable' => 1,
- 'separator' => '',
- ),
- ),
- 'default' => '-1',
- ));
- $handler = $view->new_display('page', 'Page', 'page_1');
- $handler->override_option('path', 'chado/natdiv_experiments');
- $handler->override_option('menu', array(
- 'type' => 'normal',
- 'title' => 'Natural Diversity Experiments',
- '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.',
- 'weight' => '10',
- 'name' => 'navigation',
- ));
- $handler->override_option('tab_options', array(
- 'type' => 'none',
- 'title' => '',
- 'description' => '',
- 'weight' => 0,
- 'name' => 'navigation',
- ));
- $views[$view->name] = $view;
- // List geolocations
- $view = new view;
- $view->name = 'geolocation_listing';
- $view->description = 'A listing of locations where natural diversity experiments took place.';
- $view->tag = 'chado default';
- $view->base_table = 'nd_geolocation';
- $view->core = 6;
- $view->api_version = '2';
- $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
- $handler = $view->new_display('default', 'Defaults', 'default');
- $handler->override_option('fields', array(
- 'description' => array(
- 'label' => 'Name',
- 'alter' => array(
- 'alter_text' => 0,
- 'text' => '',
- 'make_link' => 0,
- 'path' => '',
- 'absolute' => 0,
- 'link_class' => '',
- 'alt' => '',
- 'rel' => '',
- 'prefix' => '',
- 'suffix' => '',
- 'target' => '',
- 'help' => '',
- 'trim' => 0,
- 'max_length' => '',
- 'word_boundary' => 1,
- 'ellipsis' => 1,
- 'html' => 0,
- 'strip_tags' => 0,
- ),
- 'empty' => '',
- 'hide_empty' => 0,
- 'empty_zero' => 0,
- 'hide_alter_empty' => 1,
- 'type' => 'separator',
- 'separator' => ', ',
- 'exclude' => 0,
- 'id' => 'description',
- 'table' => 'nd_geolocation',
- 'field' => 'description',
- 'relationship' => 'none',
- ),
- 'latitude' => array(
- 'label' => 'Latitude',
- 'alter' => array(
- 'alter_text' => 0,
- 'text' => '',
- 'make_link' => 0,
- 'path' => '',
- 'absolute' => 0,
- 'link_class' => '',
- 'alt' => '',
- 'rel' => '',
- 'prefix' => '',
- 'suffix' => '',
- 'target' => '',
- 'help' => '',
- 'trim' => 0,
- 'max_length' => '',
- 'word_boundary' => 1,
- 'ellipsis' => 1,
- 'html' => 0,
- 'strip_tags' => 0,
- ),
- 'empty' => '',
- 'hide_empty' => 0,
- 'empty_zero' => 0,
- 'hide_alter_empty' => 1,
- 'type' => 'separator',
- 'separator' => ', ',
- 'exclude' => 0,
- 'id' => 'latitude',
- 'table' => 'nd_geolocation',
- 'field' => 'latitude',
- 'relationship' => 'none',
- ),
- 'longitude' => array(
- 'label' => 'Longitude',
- 'alter' => array(
- 'alter_text' => 0,
- 'text' => '',
- 'make_link' => 0,
- 'path' => '',
- 'absolute' => 0,
- 'link_class' => '',
- 'alt' => '',
- 'rel' => '',
- 'prefix' => '',
- 'suffix' => '',
- 'target' => '',
- 'help' => '',
- 'trim' => 0,
- 'max_length' => '',
- 'word_boundary' => 1,
- 'ellipsis' => 1,
- 'html' => 0,
- 'strip_tags' => 0,
- ),
- 'empty' => '',
- 'hide_empty' => 0,
- 'empty_zero' => 0,
- 'hide_alter_empty' => 1,
- 'type' => 'separator',
- 'separator' => ', ',
- 'exclude' => 0,
- 'id' => 'longitude',
- 'table' => 'nd_geolocation',
- 'field' => 'longitude',
- 'relationship' => 'none',
- ),
- 'altitude' => array(
- 'label' => 'Altitude',
- 'alter' => array(
- 'alter_text' => 0,
- 'text' => '',
- 'make_link' => 0,
- 'path' => '',
- 'absolute' => 0,
- 'link_class' => '',
- 'alt' => '',
- 'rel' => '',
- 'prefix' => '',
- 'suffix' => '',
- 'target' => '',
- 'help' => '',
- 'trim' => 0,
- 'max_length' => '',
- 'word_boundary' => 1,
- 'ellipsis' => 1,
- 'html' => 0,
- 'strip_tags' => 0,
- ),
- 'empty' => '',
- 'hide_empty' => 0,
- 'empty_zero' => 0,
- 'hide_alter_empty' => 1,
- 'type' => 'separator',
- 'separator' => ', ',
- 'exclude' => 0,
- 'id' => 'altitude',
- 'table' => 'nd_geolocation',
- 'field' => 'altitude',
- 'relationship' => 'none',
- ),
- 'geodetic_datum' => array(
- 'label' => 'Geodetic Datum',
- 'alter' => array(
- 'alter_text' => 0,
- 'text' => '',
- 'make_link' => 0,
- 'path' => '',
- 'absolute' => 0,
- 'link_class' => '',
- 'alt' => '',
- 'rel' => '',
- 'prefix' => '',
- 'suffix' => '',
- 'target' => '',
- 'help' => '',
- 'trim' => 0,
- 'max_length' => '',
- 'word_boundary' => 1,
- 'ellipsis' => 1,
- 'html' => 0,
- 'strip_tags' => 0,
- ),
- 'empty' => '',
- 'hide_empty' => 0,
- 'empty_zero' => 0,
- 'hide_alter_empty' => 1,
- 'type' => 'separator',
- 'separator' => ', ',
- 'exclude' => 0,
- 'id' => 'geodetic_datum',
- 'table' => 'nd_geolocation',
- 'field' => 'geodetic_datum',
- 'relationship' => 'none',
- ),
- ));
- $handler->override_option('filters', array(
- 'geodetic_datum' => array(
- 'operator' => '=',
- 'value' => array(),
- 'group' => '0',
- 'exposed' => TRUE,
- 'expose' => array(
- 'use_operator' => 0,
- 'operator' => 'geodetic_datum_op',
- 'identifier' => 'geodetic_datum',
- 'label' => 'Geodetic Datum',
- 'remember' => 0,
- ),
- 'case' => 1,
- 'id' => 'geodetic_datum',
- 'table' => 'nd_geolocation',
- 'field' => 'geodetic_datum',
- 'relationship' => 'none',
- 'agg' => array(
- 'records_with' => 1,
- 'aggregates_with' => 1,
- ),
- 'values_form_type' => 'select',
- 'multiple' => 1,
- 'optional' => 0,
- ),
- 'latitude' => array(
- 'operator' => '=',
- 'value' => array(
- 'value' => '',
- 'min' => '',
- 'max' => '',
- ),
- 'group' => '0',
- 'exposed' => TRUE,
- 'expose' => array(
- 'use_operator' => 1,
- 'operator' => 'latitude_op',
- 'identifier' => 'latitude',
- 'label' => 'Latitude',
- 'optional' => 0,
- 'remember' => 0,
- ),
- 'case' => 1,
- 'id' => 'latitude',
- 'table' => 'nd_geolocation',
- 'field' => 'latitude',
- 'relationship' => 'none',
- 'agg' => array(
- 'records_with' => 1,
- 'aggregates_with' => 1,
- ),
- ),
- 'longitude' => array(
- 'operator' => '=',
- 'value' => array(
- 'value' => '',
- 'min' => '',
- 'max' => '',
- ),
- 'group' => '0',
- 'exposed' => TRUE,
- 'expose' => array(
- 'use_operator' => 1,
- 'operator' => 'longitude_op',
- 'identifier' => 'longitude',
- 'label' => 'Longitude',
- 'optional' => 0,
- 'remember' => 0,
- ),
- 'case' => 1,
- 'id' => 'longitude',
- 'table' => 'nd_geolocation',
- 'field' => 'longitude',
- 'relationship' => 'none',
- 'agg' => array(
- 'records_with' => 1,
- 'aggregates_with' => 1,
- ),
- ),
- 'altitude' => array(
- 'operator' => '=',
- 'value' => array(
- 'value' => '',
- 'min' => '',
- 'max' => '',
- ),
- 'group' => '0',
- 'exposed' => TRUE,
- 'expose' => array(
- 'use_operator' => 1,
- 'operator' => 'altitude_op',
- 'identifier' => 'altitude',
- 'label' => 'Altitude',
- 'optional' => 0,
- 'remember' => 0,
- ),
- 'case' => 0,
- 'id' => 'altitude',
- 'table' => 'nd_geolocation',
- 'field' => 'altitude',
- 'relationship' => 'none',
- 'agg' => array(
- 'records_with' => 1,
- 'aggregates_with' => 1,
- ),
- ),
- 'description' => array(
- 'operator' => 'contains',
- 'value' => '',
- 'group' => '0',
- 'exposed' => TRUE,
- 'expose' => array(
- 'use_operator' => 0,
- 'operator' => 'description_op',
- 'identifier' => 'description',
- 'label' => 'Name Contains',
- 'remember' => 0,
- ),
- 'case' => 0,
- 'id' => 'description',
- 'table' => 'nd_geolocation',
- 'field' => 'description',
- 'relationship' => 'none',
- 'agg' => array(
- 'records_with' => 1,
- 'aggregates_with' => 1,
- ),
- 'values_form_type' => 'textfield',
- 'multiple' => 0,
- 'optional' => 0,
- ),
- ));
- $handler->override_option('access', array(
- 'type' => 'perm',
- 'perm' => 'access content',
- ));
- $handler->override_option('cache', array(
- 'type' => 'none',
- ));
- $handler->override_option('title', 'Geographical Locations');
- $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.');
- $handler->override_option('header_format', '2');
- $handler->override_option('header_empty', 0);
- $handler->override_option('empty', 'No locations matched the current criteria.');
- $handler->override_option('empty_format', '2');
- $handler->override_option('items_per_page', 50);
- $handler->override_option('use_pager', '1');
- $handler->override_option('style_plugin', 'table');
- $handler->override_option('style_options', array(
- 'grouping' => '',
- 'override' => 1,
- 'sticky' => 0,
- 'order' => 'asc',
- 'summary' => '',
- 'columns' => array(
- 'description' => 'description',
- 'latitude' => 'latitude',
- 'longitude' => 'longitude',
- 'altitude' => 'altitude',
- 'geodetic_datum' => 'geodetic_datum',
- ),
- 'info' => array(
- 'description' => array(
- 'sortable' => 1,
- 'separator' => '',
- ),
- 'latitude' => array(
- 'sortable' => 1,
- 'separator' => '',
- ),
- 'longitude' => array(
- 'sortable' => 1,
- 'separator' => '',
- ),
- 'altitude' => array(
- 'sortable' => 1,
- 'separator' => '',
- ),
- 'geodetic_datum' => array(
- 'sortable' => 1,
- 'separator' => '',
- ),
- ),
- 'default' => 'description',
- ));
- $handler = $view->new_display('page', 'Page', 'page_1');
- $handler->override_option('path', 'chado/natdiv_geolocations');
- $handler->override_option('menu', array(
- 'type' => 'normal',
- 'title' => 'Locations',
- 'description' => 'Geographical locations in which natural diversity experiments might be performed.',
- 'weight' => '10',
- 'name' => 'navigation',
- ));
- $handler->override_option('tab_options', array(
- 'type' => 'none',
- 'title' => '',
- 'description' => '',
- 'weight' => 0,
- 'name' => 'navigation',
- ));
- $views[$view->name] = $view;
- // List protocols
- $view = new view;
- $view->name = 'natdiv_protocol_listing';
- $view->description = 'A listing of protocols used for natural diversity experiments';
- $view->tag = 'chado default';
- $view->base_table = 'nd_protocol';
- $view->core = 6;
- $view->api_version = '2';
- $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
- $handler = $view->new_display('default', 'Defaults', 'default');
- $handler->override_option('fields', array(
- 'name' => array(
- 'label' => 'Name',
- 'alter' => array(
- 'alter_text' => 0,
- 'text' => '',
- 'make_link' => 0,
- 'path' => '',
- 'absolute' => 0,
- 'link_class' => '',
- 'alt' => '',
- 'rel' => '',
- 'prefix' => '',
- 'suffix' => '',
- 'target' => '',
- 'help' => '',
- 'trim' => 0,
- 'max_length' => '',
- 'word_boundary' => 1,
- 'ellipsis' => 1,
- 'html' => 0,
- 'strip_tags' => 0,
- ),
- 'empty' => '',
- 'hide_empty' => 0,
- 'empty_zero' => 0,
- 'hide_alter_empty' => 1,
- 'type' => 'separator',
- 'separator' => ', ',
- 'exclude' => 0,
- 'id' => 'name',
- 'table' => 'nd_protocol',
- 'field' => 'name',
- 'relationship' => 'none',
- ),
- ));
- $handler->override_option('filters', array(
- 'name' => array(
- 'operator' => 'contains',
- 'value' => '',
- 'group' => '0',
- 'exposed' => TRUE,
- 'expose' => array(
- 'use_operator' => 0,
- 'operator' => 'name_op',
- 'identifier' => 'name',
- 'label' => 'Name Contains',
- 'remember' => 0,
- ),
- 'case' => 0,
- 'id' => 'name',
- 'table' => 'nd_protocol',
- 'field' => 'name',
- 'relationship' => 'none',
- 'agg' => array(
- 'records_with' => 1,
- 'aggregates_with' => 1,
- ),
- ),
- 'search_results' => array(
- 'operator' => '=',
- 'value' => '',
- 'group' => '0',
- 'exposed' => FALSE,
- 'expose' => array(
- 'operator' => FALSE,
- 'label' => '',
- ),
- 'id' => 'search_results',
- 'table' => 'views',
- 'field' => 'search_results',
- 'relationship' => 'none',
- 'apply_button' => 'Show',
- '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.',
- ),
- ));
- $handler->override_option('access', array(
- 'type' => 'perm',
- 'perm' => 'access content',
- ));
- $handler->override_option('cache', array(
- 'type' => 'none',
- ));
- $handler->override_option('title', 'Protocols');
- $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.');
- $handler->override_option('header_format', '2');
- $handler->override_option('header_empty', 0);
- $handler->override_option('empty', 'No protocols match the current criteria.');
- $handler->override_option('empty_format', '2');
- $handler->override_option('items_per_page', 50);
- $handler->override_option('use_pager', '1');
- $handler->override_option('style_plugin', 'table');
- $handler->override_option('style_options', array(
- 'grouping' => '',
- 'override' => 1,
- 'sticky' => 0,
- 'order' => 'asc',
- 'summary' => '',
- 'columns' => array(
- 'name' => 'name',
- ),
- 'info' => array(
- 'name' => array(
- 'sortable' => 1,
- 'separator' => '',
- ),
- ),
- 'default' => 'name',
- ));
- $handler = $view->new_display('page', 'Page', 'page_1');
- $handler->override_option('path', 'chado/natdiv_protocols');
- $handler->override_option('menu', array(
- 'type' => 'normal',
- 'title' => 'Protocols',
- 'description' => 'The protcols used for natural diversity experiments',
- 'weight' => '10',
- 'name' => 'navigation',
- ));
- $handler->override_option('tab_options', array(
- 'type' => 'none',
- 'title' => '',
- 'description' => '',
- 'weight' => 0,
- 'name' => 'navigation',
- ));
- $views[$view->name] = $view;
- // List Reagents
- $view = new view;
- $view->name = 'natdiv_reagent_listing';
- $view->description = 'A listing of reagents used in natural diversity experiments';
- $view->tag = 'chado default';
- $view->base_table = 'nd_reagent';
- $view->core = 6;
- $view->api_version = '2';
- $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
- $handler = $view->new_display('default', 'Defaults', 'default');
- $handler->override_option('fields', array(
- 'name_1' => array(
- 'label' => 'Name',
- 'alter' => array(
- 'alter_text' => 0,
- 'text' => '',
- 'make_link' => 0,
- 'path' => '',
- 'absolute' => 0,
- 'link_class' => '',
- 'alt' => '',
- 'rel' => '',
- 'prefix' => '',
- 'suffix' => '',
- 'target' => '',
- 'help' => '',
- 'trim' => 0,
- 'max_length' => '',
- 'word_boundary' => 1,
- 'ellipsis' => 1,
- 'html' => 0,
- 'strip_tags' => 0,
- ),
- 'empty' => '',
- 'hide_empty' => 0,
- 'empty_zero' => 0,
- 'hide_alter_empty' => 1,
- 'type' => 'separator',
- 'separator' => ', ',
- 'exclude' => 0,
- 'id' => 'name_1',
- 'table' => 'nd_reagent',
- 'field' => 'name',
- 'relationship' => 'none',
- ),
- 'name' => array(
- 'label' => 'Type',
- 'alter' => array(
- 'alter_text' => 0,
- 'text' => '',
- 'make_link' => 0,
- 'path' => '',
- 'absolute' => 0,
- 'link_class' => '',
- 'alt' => '',
- 'rel' => '',
- 'prefix' => '',
- 'suffix' => '',
- 'target' => '',
- 'help' => '',
- 'trim' => 0,
- 'max_length' => '',
- 'word_boundary' => 1,
- 'ellipsis' => 1,
- 'html' => 0,
- 'strip_tags' => 0,
- ),
- 'empty' => '',
- 'hide_empty' => 0,
- 'empty_zero' => 0,
- 'hide_alter_empty' => 1,
- 'type' => 'separator',
- 'separator' => ', ',
- 'exclude' => 0,
- 'id' => 'name',
- 'table' => 'cvterm',
- 'field' => 'name',
- 'relationship' => 'none',
- ),
- ));
- $handler->override_option('filters', array(
- 'type_id' => array(
- 'operator' => '=',
- 'value' => '',
- 'group' => '0',
- 'exposed' => TRUE,
- 'expose' => array(
- 'use_operator' => 0,
- 'operator' => 'type_id_op',
- 'identifier' => 'type_id',
- 'label' => 'Type',
- 'remember' => 0,
- ),
- 'case' => 1,
- 'id' => 'type_id',
- 'table' => 'nd_reagent',
- 'field' => 'type_id',
- 'relationship' => 'none',
- 'values_form_type' => 'select',
- 'multiple' => 1,
- 'optional' => 0,
- 'show_all' => 0,
- 'agg' => array(
- 'records_with' => 1,
- 'aggregates_with' => 1,
- ),
- ),
- 'search_results' => array(
- 'operator' => '=',
- 'value' => '',
- 'group' => '0',
- 'exposed' => FALSE,
- 'expose' => array(
- 'operator' => FALSE,
- 'label' => '',
- ),
- 'id' => 'search_results',
- 'table' => 'views',
- 'field' => 'search_results',
- 'relationship' => 'none',
- 'apply_button' => 'Show',
- '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.',
- ),
- 'name' => array(
- 'operator' => 'contains',
- 'value' => '',
- 'group' => '0',
- 'exposed' => TRUE,
- 'expose' => array(
- 'use_operator' => 0,
- 'operator' => 'name_op',
- 'identifier' => 'name',
- 'label' => 'Name Contains',
- 'remember' => 0,
- ),
- 'case' => 0,
- 'id' => 'name',
- 'table' => 'nd_reagent',
- 'field' => 'name',
- 'relationship' => 'none',
- 'agg' => array(
- 'records_with' => 1,
- 'aggregates_with' => 1,
- ),
- ),
- ));
- $handler->override_option('access', array(
- 'type' => 'perm',
- 'perm' => 'access content',
- ));
- $handler->override_option('cache', array(
- 'type' => 'none',
- ));
- $handler->override_option('title', 'Reagents');
- $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.');
- $handler->override_option('header_format', '2');
- $handler->override_option('header_empty', 0);
- $handler->override_option('empty', 'No reagents match the current criteria.');
- $handler->override_option('empty_format', '2');
- $handler->override_option('items_per_page', 50);
- $handler->override_option('use_pager', '1');
- $handler->override_option('style_plugin', 'table');
- $handler = $view->new_display('page', 'Page', 'page_1');
- $handler->override_option('path', 'chado/natdiv_reagents');
- $handler->override_option('menu', array(
- 'type' => 'normal',
- 'title' => 'Reagents',
- 'description' => 'Reagents used in natural diversity experiments',
- 'weight' => '10',
- 'name' => 'navigation',
- ));
- $handler->override_option('tab_options', array(
- 'type' => 'none',
- 'title' => '',
- 'description' => '',
- 'weight' => 0,
- 'name' => 'navigation',
- ));
- $views[$view->name] = $view;
- return $views;
- }
|