|
@@ -39,6 +39,12 @@ function tripal_db_views_data() {
|
|
foreach ($tables as $tablename) {
|
|
foreach ($tables as $tablename) {
|
|
if (!tripal_views_is_integrated($tablename, 9)) {
|
|
if (!tripal_views_is_integrated($tablename, 9)) {
|
|
$table_integration_array = tripal_views_get_integration_array_for_chado_table($tablename, TRUE);
|
|
$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);
|
|
tripal_views_integration_add_entry($table_integration_array);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -67,16 +73,13 @@ function tripal_db_views_default_views() {
|
|
$views = array();
|
|
$views = array();
|
|
|
|
|
|
// Main default view
|
|
// Main default view
|
|
- // List all cvterms based on cv
|
|
|
|
$view = new view;
|
|
$view = new view;
|
|
- $view = new view;
|
|
+ $view->name = 'dbxref_listing';
|
|
- $view->name = 'all_dbxrefs';
|
|
|
|
$view->description = 'A listing of all database references filtered by database';
|
|
$view->description = 'A listing of all database references filtered by database';
|
|
- $view->tag = 'chado';
|
|
+ $view->tag = 'chado default';
|
|
- $view->view_php = '';
|
|
|
|
$view->base_table = 'dbxref';
|
|
$view->base_table = 'dbxref';
|
|
- $view->is_cacheable = FALSE;
|
|
+ $view->core = 0;
|
|
- $view->api_version = 2;
|
|
+ $view->api_version = '2';
|
|
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
|
|
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
|
|
$handler = $view->new_display('default', 'Defaults', 'default');
|
|
$handler = $view->new_display('default', 'Defaults', 'default');
|
|
$handler->override_option('fields', array(
|
|
$handler->override_option('fields', array(
|
|
@@ -196,18 +199,20 @@ function tripal_db_views_default_views() {
|
|
'field' => 'version',
|
|
'field' => 'version',
|
|
'relationship' => 'none',
|
|
'relationship' => 'none',
|
|
),
|
|
),
|
|
- 'accession_link' => array(
|
|
+ 'urlprefix' => array(
|
|
'label' => 'External Link',
|
|
'label' => 'External Link',
|
|
'alter' => array(
|
|
'alter' => array(
|
|
'alter_text' => 1,
|
|
'alter_text' => 1,
|
|
- 'text' => 'link',
|
|
+ 'text' => '[name]:[accession]',
|
|
'make_link' => 1,
|
|
'make_link' => 1,
|
|
- 'path' => '[accession_link]',
|
|
+ 'path' => '[urlprefix][accession]',
|
|
|
|
+ 'absolute' => 1,
|
|
'link_class' => '',
|
|
'link_class' => '',
|
|
'alt' => '',
|
|
'alt' => '',
|
|
|
|
+ 'rel' => '',
|
|
'prefix' => '',
|
|
'prefix' => '',
|
|
'suffix' => '',
|
|
'suffix' => '',
|
|
- 'target' => '',
|
|
+ 'target' => '_blank',
|
|
'help' => '',
|
|
'help' => '',
|
|
'trim' => 0,
|
|
'trim' => 0,
|
|
'max_length' => '',
|
|
'max_length' => '',
|
|
@@ -219,17 +224,36 @@ function tripal_db_views_default_views() {
|
|
'empty' => '',
|
|
'empty' => '',
|
|
'hide_empty' => 1,
|
|
'hide_empty' => 1,
|
|
'empty_zero' => 0,
|
|
'empty_zero' => 0,
|
|
|
|
+ 'hide_alter_empty' => 1,
|
|
|
|
+ 'type' => 'separator',
|
|
|
|
+ 'separator' => ', ',
|
|
'exclude' => 0,
|
|
'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',
|
|
'table' => 'dbxref',
|
|
- 'field' => 'accession_link',
|
|
+ 'field' => 'accession',
|
|
'relationship' => 'none',
|
|
'relationship' => 'none',
|
|
),
|
|
),
|
|
));
|
|
));
|
|
$handler->override_option('filters', array(
|
|
$handler->override_option('filters', array(
|
|
'name' => array(
|
|
'name' => array(
|
|
'operator' => '=',
|
|
'operator' => '=',
|
|
- 'value' => '<select db>',
|
|
+ 'value' => array(),
|
|
'group' => '0',
|
|
'group' => '0',
|
|
'exposed' => TRUE,
|
|
'exposed' => TRUE,
|
|
'expose' => array(
|
|
'expose' => array(
|
|
@@ -237,7 +261,6 @@ function tripal_db_views_default_views() {
|
|
'operator' => 'name_op',
|
|
'operator' => 'name_op',
|
|
'identifier' => 'db',
|
|
'identifier' => 'db',
|
|
'label' => 'Database',
|
|
'label' => 'Database',
|
|
- 'optional' => 1,
|
|
|
|
'remember' => 0,
|
|
'remember' => 0,
|
|
),
|
|
),
|
|
'case' => 1,
|
|
'case' => 1,
|
|
@@ -245,6 +268,9 @@ function tripal_db_views_default_views() {
|
|
'table' => 'db',
|
|
'table' => 'db',
|
|
'field' => 'name',
|
|
'field' => 'name',
|
|
'relationship' => 'none',
|
|
'relationship' => 'none',
|
|
|
|
+ 'values_form_type' => 'select',
|
|
|
|
+ 'multiple' => 1,
|
|
|
|
+ 'optional' => 0,
|
|
),
|
|
),
|
|
'accession' => array(
|
|
'accession' => array(
|
|
'operator' => 'contains',
|
|
'operator' => 'contains',
|
|
@@ -265,6 +291,22 @@ function tripal_db_views_default_views() {
|
|
'field' => 'accession',
|
|
'field' => 'accession',
|
|
'relationship' => 'none',
|
|
'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(
|
|
$handler->override_option('access', array(
|
|
'type' => 'perm',
|
|
'type' => 'perm',
|
|
@@ -274,6 +316,9 @@ function tripal_db_views_default_views() {
|
|
'type' => 'none',
|
|
'type' => 'none',
|
|
));
|
|
));
|
|
$handler->override_option('title', 'Database References');
|
|
$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', '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('empty_format', '1');
|
|
$handler->override_option('items_per_page', 50);
|
|
$handler->override_option('items_per_page', 50);
|