|
@@ -39,6 +39,12 @@ function tripal_db_views_data() {
|
|
|
foreach ($tables as $tablename) {
|
|
|
if (!tripal_views_is_integrated($tablename, 9)) {
|
|
|
$table_integration_array = tripal_views_get_integration_array_for_chado_table($tablename, TRUE);
|
|
|
+
|
|
|
+ // add specialty handlers
|
|
|
+ if ($tablename == 'db') {
|
|
|
+ $table_integration_array['fields']['name']['handlers']['filter']['name'] = 'views_handler_filter_chado_select_string';
|
|
|
+ }
|
|
|
+
|
|
|
tripal_views_integration_add_entry($table_integration_array);
|
|
|
}
|
|
|
}
|
|
@@ -67,16 +73,13 @@ function tripal_db_views_default_views() {
|
|
|
$views = array();
|
|
|
|
|
|
// Main default view
|
|
|
- // List all cvterms based on cv
|
|
|
$view = new view;
|
|
|
- $view = new view;
|
|
|
- $view->name = 'all_dbxrefs';
|
|
|
+ $view->name = 'dbxref_listing';
|
|
|
$view->description = 'A listing of all database references filtered by database';
|
|
|
- $view->tag = 'chado';
|
|
|
- $view->view_php = '';
|
|
|
+ $view->tag = 'chado default';
|
|
|
$view->base_table = 'dbxref';
|
|
|
- $view->is_cacheable = FALSE;
|
|
|
- $view->api_version = 2;
|
|
|
+ $view->core = 0;
|
|
|
+ $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(
|
|
@@ -196,18 +199,20 @@ function tripal_db_views_default_views() {
|
|
|
'field' => 'version',
|
|
|
'relationship' => 'none',
|
|
|
),
|
|
|
- 'accession_link' => array(
|
|
|
+ 'urlprefix' => array(
|
|
|
'label' => 'External Link',
|
|
|
'alter' => array(
|
|
|
'alter_text' => 1,
|
|
|
- 'text' => 'link',
|
|
|
+ 'text' => '[name]:[accession]',
|
|
|
'make_link' => 1,
|
|
|
- 'path' => '[accession_link]',
|
|
|
+ 'path' => '[urlprefix][accession]',
|
|
|
+ 'absolute' => 1,
|
|
|
'link_class' => '',
|
|
|
'alt' => '',
|
|
|
+ 'rel' => '',
|
|
|
'prefix' => '',
|
|
|
'suffix' => '',
|
|
|
- 'target' => '',
|
|
|
+ 'target' => '_blank',
|
|
|
'help' => '',
|
|
|
'trim' => 0,
|
|
|
'max_length' => '',
|
|
@@ -219,17 +224,36 @@ function tripal_db_views_default_views() {
|
|
|
'empty' => '',
|
|
|
'hide_empty' => 1,
|
|
|
'empty_zero' => 0,
|
|
|
+ 'hide_alter_empty' => 1,
|
|
|
+ 'type' => 'separator',
|
|
|
+ 'separator' => ', ',
|
|
|
'exclude' => 0,
|
|
|
- 'id' => 'accession_link',
|
|
|
+ 'id' => 'urlprefix',
|
|
|
+ 'table' => 'db',
|
|
|
+ 'field' => 'urlprefix',
|
|
|
+ 'relationship' => 'none',
|
|
|
+ ),
|
|
|
+ ));
|
|
|
+ $handler->override_option('sorts', array(
|
|
|
+ 'name' => array(
|
|
|
+ 'order' => 'ASC',
|
|
|
+ 'id' => 'name',
|
|
|
+ 'table' => 'db',
|
|
|
+ 'field' => 'name',
|
|
|
+ 'relationship' => 'none',
|
|
|
+ ),
|
|
|
+ 'accession' => array(
|
|
|
+ 'order' => 'ASC',
|
|
|
+ 'id' => 'accession',
|
|
|
'table' => 'dbxref',
|
|
|
- 'field' => 'accession_link',
|
|
|
+ 'field' => 'accession',
|
|
|
'relationship' => 'none',
|
|
|
),
|
|
|
));
|
|
|
$handler->override_option('filters', array(
|
|
|
'name' => array(
|
|
|
'operator' => '=',
|
|
|
- 'value' => '<select db>',
|
|
|
+ 'value' => array(),
|
|
|
'group' => '0',
|
|
|
'exposed' => TRUE,
|
|
|
'expose' => array(
|
|
@@ -237,7 +261,6 @@ function tripal_db_views_default_views() {
|
|
|
'operator' => 'name_op',
|
|
|
'identifier' => 'db',
|
|
|
'label' => 'Database',
|
|
|
- 'optional' => 1,
|
|
|
'remember' => 0,
|
|
|
),
|
|
|
'case' => 1,
|
|
@@ -245,6 +268,9 @@ function tripal_db_views_default_views() {
|
|
|
'table' => 'db',
|
|
|
'field' => 'name',
|
|
|
'relationship' => 'none',
|
|
|
+ 'values_form_type' => 'select',
|
|
|
+ 'multiple' => 1,
|
|
|
+ 'optional' => 0,
|
|
|
),
|
|
|
'accession' => array(
|
|
|
'operator' => 'contains',
|
|
@@ -265,6 +291,22 @@ function tripal_db_views_default_views() {
|
|
|
'field' => 'accession',
|
|
|
'relationship' => 'none',
|
|
|
),
|
|
|
+ '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 database references matching the entered criteria. If you leave a any of the criteria blank then the database references will be not be filtered based on that field. Furthermore, if you leave all criteria blank then all database references will be listed.',
|
|
|
+ ),
|
|
|
));
|
|
|
$handler->override_option('access', array(
|
|
|
'type' => 'perm',
|
|
@@ -274,6 +316,9 @@ function tripal_db_views_default_views() {
|
|
|
'type' => 'none',
|
|
|
));
|
|
|
$handler->override_option('title', 'Database References');
|
|
|
+ $handler->override_option('header', 'Click "Show" to see a list of all database references matching the entered criteria. If you leave a any of the criteria blank then the database references will be not be filtered based on that field. Furthermore, if you leave all criteria blank then all database references will be listed.');
|
|
|
+ $handler->override_option('header_format', '2');
|
|
|
+ $handler->override_option('header_empty', 0);
|
|
|
$handler->override_option('empty', 'There are no database references matching the above criteria. Please select a database in order to display all references to that database.');
|
|
|
$handler->override_option('empty_format', '1');
|
|
|
$handler->override_option('items_per_page', 50);
|