123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263 |
- <?php
- function retrieve_stock_views_data() {
- global $db_url;
- $data = array();
-
-
-
- if(is_array($db_url) and array_key_exists('chado',$db_url)){
- $database = 'chado';
- }
-
- $data['stock']['table']['group'] = t('Chado Stock');
- $data['stock']['table']['base'] = array(
- 'field' => 'stock_id',
- 'title' => t('Chado Stock'),
- 'help' => t('Chado Stocks are a record of any material upon which an experiment can be done. For example, a DNA sample, an individual or a population.'),
- );
- if($database){
- $data['stock']['table']['database'] = $database;
- }
-
- $data['stock']['table']['join'] = array(
- 'organism' => array(
- 'left_field' => 'organism_id',
- 'field' => 'organism_id',
- ),
- );
-
-
- $data['stock']['stock_id'] = array(
- 'title' => 'Stock ID',
- 'help' => 'The primary key of a stock',
- 'field' => array(
- 'handler' => 'views_handler_field_numeric',
- 'click sortable' => TRUE,
- ),
- 'filter' => array(
- 'handler' => 'views_handler_filter_numeric',
- ),
- 'sort' => array(
- 'handler' => 'views_handler_sort',
- ),
- );
-
-
-
-
- if ($database){
- $data['stock']['stock_nid'] = array(
- 'title' => 'Node ID',
- 'help' => 'This is the node ID of this feature. It can be used as a link to the node.',
- 'field' => array(
- 'handler' => 'views_handler_field_computed_stock_nid',
- ),
- );
- }
-
- $data['stock']['uniquename'] = array(
- 'title' => t('Unique Name'),
- 'help' => t('A unique name for this stock.'),
- 'field' => array(
- 'handler' => 'views_handler_field',
- 'click sortable' => TRUE,
- ),
- 'sort' => array(
- 'handler' => 'views_handler_sort',
- ),
- 'filter' => array(
- 'handler' => 'views_handler_filter_string',
- ),
- 'argument' => array(
- 'handler' => 'views_handler_argument_string',
- ),
- );
-
- if (!$database) {
- $data['stock']['uniquename']['field']['handler'] = 'views_handler_field_node_optional';
- }
-
-
- $data['stock']['name'] = array(
- 'title' => t('Name'),
- 'help' => t('The human-readable name of this stock.'),
- 'field' => array(
- 'handler' => 'views_handler_field',
- 'click sortable' => TRUE,
- ),
- 'sort' => array(
- 'handler' => 'views_handler_sort',
- ),
- 'filter' => array(
- 'handler' => 'views_handler_filter_string',
- ),
- 'argument' => array(
- 'handler' => 'views_handler_argument_string',
- ),
- );
-
- if (!$database) {
- $data['stock']['name']['field']['handler'] = 'views_handler_field_node_optional';
- }
-
-
- $data['stock']['description'] = array(
- 'title' => t('Description'),
- 'help' => t('Provides a short description for a given stock.'),
- 'field' => array(
- 'handler' => 'views_handler_field',
- 'click sortable' => TRUE,
- ),
- 'sort' => array(
- 'handler' => 'views_handler_sort',
- ),
- 'filter' => array(
- 'handler' => 'views_handler_filter_string',
- ),
- 'argument' => array(
- 'handler' => 'views_handler_argument_string',
- ),
- );
-
- $data['stock']['is_obsolete'] = array(
- 'title' => t('Is Obsolete'),
- 'help' => t('A yes/no field indicating whether a given stock is obsolete or not.'),
- 'field' => array(
- 'handler' => 'views_handler_field',
- 'click sortable' => TRUE,
- ),
- 'sort' => array(
- 'handler' => 'views_handler_sort',
- ),
- );
-
-
-
- $data['stock']['properties'] = array(
- 'title' => t('Stock Properties'),
- 'help' => t('Properties of the current stock.'),
- 'field' => array(
- 'title' => t('Properties'),
- 'help' => t('Display a given type of properties associated with a stock.'),
- 'handler' => 'views_handler_field_stockprop_by_type',
- ),
- 'filter' => array(
- 'title' => t('Properties'),
- 'help' => t('Filter by a given property type or value.'),
- 'handler' => 'views_handler_filter_stockprop_id',
- ),
- 'argument' => array(
- 'title' => t('Properties'),
- 'help' => t('Allow a property to be supplied in the path'),
- 'handler' => 'views_handler_argument_stockprop_id',
- ),
- );
-
-
-
- $data['stock']['all_properties'] = array(
- 'title' => t('All Stock Properties'),
- 'help' => t('Properties of the current stock.'),
- 'field' => array(
- 'title' => t('All Properties'),
- 'help' => t('Display all properties associated with a stock.'),
- 'handler' => 'views_handler_field_stockprop_all',
- ),
- );
-
-
-
-
- $data['stock']['relationships'] = array(
- 'title' => t('Stock Relationships'),
- 'help' => t('Relationships including the current stock.'),
- 'field' => array(
- 'title' => t('Relationships'),
- 'help' => t('Display a given type of relationships including the current stock.'),
- 'handler' => 'views_handler_field_stockrel_by_type',
- ),
- );
-
-
-
- $data['stock']['all_relationships'] = array(
- 'title' => t('All Stock Relationships'),
- 'help' => t('Relationships including the current stock.'),
- 'field' => array(
- 'title' => t('All Relationships'),
- 'help' => t('Display all relationships including the stock.'),
- 'handler' => 'views_handler_field_stockrel_all',
- ),
- );
-
-
-
-
- $data['stock']['dbxref'] = array(
- 'title' => t('Stock Database References'),
- 'help' => t('Database References associated with the current stock.'),
- 'field' => array(
- 'title' => t('Database References'),
- 'help' => t('Display database references from a given database for the current stock.'),
- 'handler' => 'views_handler_field_stock_dbxref_by_type',
- ),
- 'filter' => array(
- 'title' => t('Database References'),
- 'help' => t('Filter by a given database reference type and/or value.'),
- 'handler' => 'views_handler_filter_stock_dbxref_id',
- ),
- );
-
-
-
- $data['stock']['all_dbxref'] = array(
- 'title' => t('All Stock Database References'),
- 'help' => t('Database References associated with the current stock.'),
- 'field' => array(
- 'title' => t('All Database References'),
- 'help' => t('Display all database references for the current stock.'),
- 'handler' => 'views_handler_field_stock_dbxref_all',
- ),
- );
- return $data;
- }
|