|
Tripal 0.3b
|
00001 <?php 00002 00003 /** 00004 * Purpose: this function returns the portion of the data array 00005 * which describes the cv table, it's fields and any joins between it and other tables 00006 * @see tripal_cv_views_data() --in tripal_cv.views.inc 00007 * 00008 * TABLE: db 00009 * @code 00010 * create table db ( 00011 * db_id serial not null, 00012 * primary key (db_id), 00013 * name varchar(255) not null, 00014 * description varchar(255) null, 00015 * urlprefix varchar(255) null, 00016 * url varchar(255) null, 00017 * constraint db_c1 unique (name) 00018 * ); 00019 * @endcode 00020 * 00021 * @ingroup tripal_db_views 00022 */ 00023 function retrieve_db_views_data() { 00024 00025 // Basic table definition 00026 $data['db']['table'] = array( 00027 'field' => 'db_id', 00028 'group' => 'Chado Database', 00029 'title' => 'Chado Database', 00030 'help' => 'Database Records existing in the Chado Database', 00031 'database' => 'chado' 00032 ); 00033 00034 // Define relationships between this table and others 00035 $data['db']['table']['join'] = array( 00036 'dbxref' => array( 00037 'left_field' => 'db_id', 00038 'field' => 'db_id', 00039 ), 00040 'stock' => array( 00041 'left_table' => 'dbxref', 00042 'left_field' => 'db_id', 00043 'field' => 'db_id', 00044 ), 00045 'cvterm' => array( 00046 'left_table' => 'dbxref', 00047 'left_field' => 'db_id', 00048 'field' => 'db_id', 00049 ), 00050 'feature' => array( 00051 'left_table' => 'dbxref', 00052 'left_field' => 'db_id', 00053 'field' => 'db_id', 00054 ), 00055 ); 00056 00057 // Table Field Definitions---------------------- 00058 // Field: db_id (primary key) 00059 $data['db']['db_id'] = array( 00060 'title' => t('Database ID'), 00061 'help' => t('The primary key of the Database.'), 00062 'field' => array( 00063 'handler' => 'views_handler_field_numeric', 00064 'click sortable' => TRUE, 00065 ), 00066 'filter' => array( 00067 'handler' => 'views_handler_filter_numeric', 00068 ), 00069 'sort' => array( 00070 'handler' => 'views_handler_sort', 00071 ), 00072 ); 00073 00074 // Field: name (varchar 255) 00075 $data['db']['name'] = array( 00076 'title' => 'Name', 00077 'field' => array( 00078 'handler' => 'views_handler_field', 00079 'click sortable' => TRUE, 00080 ), 00081 'sort' => array( 00082 'handler' => 'views_handler_sort', 00083 ), 00084 'filter' => array( 00085 'handler' => 'views_handler_filter_chado_select_string', 00086 ), 00087 'argument' => array( 00088 'handler' => 'views_handler_argument_string', 00089 ), 00090 ); 00091 00092 // Field: description (varchar 255) 00093 $data['db']['description'] = array( 00094 'title' => 'Description', 00095 'field' => array( 00096 'handler' => 'views_handler_field', 00097 'click sortable' => TRUE, 00098 ), 00099 'sort' => array( 00100 'handler' => 'views_handler_sort', 00101 ), 00102 'filter' => array( 00103 'handler' => 'views_handler_filter_string', 00104 ), 00105 'argument' => array( 00106 'handler' => 'views_handler_argument_string', 00107 ), 00108 ); 00109 00110 // Field: urlprefix (varchar 255) 00111 $data['db']['urlprefix'] = array( 00112 'title' => 'URL Prefix', 00113 'help' => 'The url that when concatenated with the accession of a record in this db produces the url to the record in this database.', 00114 'field' => array( 00115 'handler' => 'views_handler_field', 00116 'click sortable' => TRUE, 00117 ), 00118 'sort' => array( 00119 'handler' => 'views_handler_sort', 00120 ), 00121 'filter' => array( 00122 'handler' => 'views_handler_filter_string', 00123 ), 00124 'argument' => array( 00125 'handler' => 'views_handler_argument_string', 00126 ), 00127 ); 00128 00129 // Field: url (varchar 255) 00130 $data['db']['url'] = array( 00131 'title' => 'URL', 00132 'help' => 'The url to the main page of the database', 00133 'field' => array( 00134 'handler' => 'views_handler_field', 00135 'click sortable' => TRUE, 00136 ), 00137 'sort' => array( 00138 'handler' => 'views_handler_sort', 00139 ), 00140 'filter' => array( 00141 'handler' => 'views_handler_filter_string', 00142 ), 00143 'argument' => array( 00144 'handler' => 'views_handler_argument_string', 00145 ), 00146 ); 00147 00148 return $data; 00149 00150 }