Переглянути джерело

Added back in 'Search Biological Content' Views

Lacey Sanderson 11 роки тому
батько
коміт
04c169467a

+ 16 - 0
tripal_analysis/tripal_analysis.module

@@ -84,6 +84,22 @@ function tripal_analysis_menu() {
   return $items;
 }
 
+/**
+ * Implements hook_search_biological_data_views().
+ *
+ * Adds the described views to the "Search Biological Data" Page created by Tripal Views
+ */
+function tripal_analysis_search_biological_data_views() {
+  return array(
+    'tripal_analysis_user_analyses' => array(
+      'machine_name' => 'tripal_analysis_user_analyses',
+      'human_name' => 'Analyses',
+      'description' => 'Bioinformatics analyses which often produces features.',
+      'link' => 'chado/analysis'
+    ),
+  );
+}
+
 /**
  * Implements hook_help().
  * Purpose: Adds a help page to the module list

+ 43 - 0
tripal_analysis/tripal_analysis.views_default.inc

@@ -15,6 +15,14 @@
 function tripal_analysis_views_default_views() {
   $views = array();
 
+  // User View ("Search Biological Content")
+  // Remember, if you change the name/path of this view,
+  // you also want to change it's description in tripal_analysis_search_biological_data_views()
+  $view = tripal_analysis_defaultvalue_user_analysis();
+  $view = tripal_views_make_view_compatible_with_external($view);
+  $views[$view->name] = $view;
+
+  // Admin View
   $view = tripal_analysis_defaultvalue_admin_analysis();
   $view = tripal_views_make_view_compatible_with_external($view);
   $views[$view->name] = $view;
@@ -22,6 +30,41 @@ function tripal_analysis_views_default_views() {
   return $views;
 }
 
+/**
+ * Defines the analysis user search default view.
+ *
+ * @ingroup tripal_analysis
+ */
+function tripal_analysis_defaultvalue_user_analysis() {
+
+  // As a shortcut, currently I am copying the admin view and then tweaking it
+  // In thie future this should be replaced by a views export
+  $view = tripal_analysis_defaultvalue_admin_analysis();
+
+  // change some view admin stuff
+  $view->name = 'tripal_analysis_user_analyses';
+  $view->human_name = 'Analysis User Search';
+  $view->description = 'Allows users to search analysis data';
+  $view->tag = 'tripal search';
+
+  // Change the path
+  $view->display['page_1']->display_options['path'] = 'chado/analysis';
+  $view->display['page_1']->display_options['menu']['type'] = 'normal';
+  unset($view->display['page_1']->display_options['tab_options']);
+
+  // Remove edit/delete node
+  unset(
+    $view->display['default']->display_options['fields']['delete_node'],
+    $view->display['default']->display_options['fields']['edit_node'],
+    $view->display['default']->display_options['fields']['nothing']
+  );
+
+  // Remove the admin action links
+  unset($view->display['default']->display_options['header']['action_links_area']);
+
+  return $view;
+}
+
 /**
  * Defines the analysis admin default view.
  *

+ 17 - 1
tripal_contact/tripal_contact.module

@@ -102,6 +102,22 @@ function tripal_contact_menu() {
   return $items;
 }
 
+/**
+ * Implements hook_search_biological_data_views().
+ *
+ * Adds the described views to the "Search Biological Data" Page created by Tripal Views
+ */
+function tripal_contact_search_biological_data_views() {
+  return array(
+    'tripal_contact_user_contacts' => array(
+      'machine_name' => 'tripal_contact_user_contacts',
+      'human_name' => 'Contacts',
+      'description' => 'Information about persons, institutes, groups, organizations, etc.',
+      'link' => 'chado/contact'
+    ),
+  );
+}
+
 /**
  * Implements hook_theme().
  * Register themeing functions for this module
@@ -267,7 +283,7 @@ function tripal_contact_form_alter(&$form, &$form_state, $form_id) {
   if ($form_id == "chado_contact_node_form") {
     // turn of preview button for insert/updates
     $form['actions']['preview']['#access'] = FALSE;
-    
+
     //remove the body field
     unset($form['body']);
   }

+ 48 - 0
tripal_contact/tripal_contact.views_default.inc

@@ -14,6 +14,14 @@
 function tripal_contact_views_default_views() {
   $views = array();
 
+  // User View ("Search Biological Content")
+  // Remember, if you change the name/path of this view,
+  // you also want to change it's description in tripal_contact_search_biological_data_views()
+  $view = tripal_contact_defaultvalue_user_contacts();
+  $view = tripal_views_make_view_compatible_with_external($view);
+  $views[$view->name] = $view;
+
+  // Admin view
   $view = tripal_contact_defaultview_admin_contacts();
   $view = tripal_views_make_view_compatible_with_external($view);
   $views[$view->name] = $view;
@@ -21,6 +29,46 @@ function tripal_contact_views_default_views() {
   return $views;
 }
 
+/**
+ * Defines the contact user search default view.
+ *
+ * @ingroup tripal_contact
+ */
+function tripal_contact_defaultvalue_user_contacts() {
+
+  // As a shortcut, currently I am copying the admin view and then tweaking it
+  // In thie future this should be replaced by a views export
+  $view = tripal_contact_defaultview_admin_contacts();
+
+  // change some view admin stuff
+  $view->name = 'tripal_contact_user_contacts';
+  $view->human_name = 'Contact User Search';
+  $view->description = 'Allows users to search contact data';
+  $view->tag = 'tripal search';
+
+  // Change the path
+  $view->display['page_1']->display_options['path'] = 'chado/contact';
+  $view->display['page_1']->display_options['menu'] = array(
+    'type' => 'normal',
+    'title' => 'Contacts',
+    'description' => 'Contacts can be persons, institutes, groups, or organizations.',
+    'weight' => '-10'
+  );
+  unset($view->display['page_1']->display_options['tab_options']);
+
+  // Remove edit/delete node
+  unset(
+    $view->display['default']->display_options['fields']['delete_node'],
+    $view->display['default']->display_options['fields']['edit_node'],
+    $view->display['default']->display_options['fields']['nothing']
+  );
+
+  // Remove the admin action links
+  unset($view->display['default']->display_options['header']['action_links_area']);
+
+  return $view;
+}
+
 /**
  * Define the default view for contact administration.
  *

+ 19 - 3
tripal_feature/tripal_feature.module

@@ -212,6 +212,22 @@ function tripal_feature_menu() {
   return $items;
 }
 
+/**
+ * Implements hook_search_biological_data_views().
+ *
+ * Adds the described views to the "Search Biological Data" Page created by Tripal Views
+ */
+function tripal_feature_search_biological_data_views() {
+  return array(
+    'tripal_feature_user_features' => array(
+      'machine_name' => 'tripal_feature_user_features',
+      'human_name' => 'Features',
+      'description' => 'A biological sequence or a section of a biological sequence, or a collection of such sections.',
+      'link' => 'chado/feature'
+    ),
+  );
+}
+
 /**
  * Implements hook_theme().
  *
@@ -728,7 +744,7 @@ function tripal_feature_load_organism_feature_counts($organism) {
       $order[] = $feature_type;  // save the order of the these terms
       $where .= " OFC.feature_type = :name$i OR ";
       $args[":name$i"] = rtrim($temp2[0]);
-      
+
       // if the admin specified a new name then store that otherwise use the
       // the default sequence ontology term name
       if(count($temp2) == 2) {
@@ -774,8 +790,8 @@ function tripal_feature_load_organism_feature_counts($organism) {
   foreach ($order as $type) {
     $ordered_types[] = $types[$type];
   }
-  return array( 
-    'types' => $ordered_types, 
+  return array(
+    'types' => $ordered_types,
     'names' => $names
   );
 }

+ 49 - 0
tripal_feature/tripal_feature.views_default.inc

@@ -12,6 +12,14 @@
 function tripal_feature_views_default_views() {
   $views = array();
 
+  // User View ("Search Biological Content")
+  // Remember, if you change the name/path of this view,
+  // you also want to change it's description in tripal_feature_search_biological_data_views()
+  $view = tripal_feature_defaultvalue_user_features();
+  $view = tripal_views_make_view_compatible_with_external($view);
+  $views[$view->name] = $view;
+
+  // Admin view
   $view = tripal_feature_defaultview_admin_features();
   $view = tripal_views_make_view_compatible_with_external($view);
   $views[$view->name] = $view;
@@ -19,6 +27,47 @@ function tripal_feature_views_default_views() {
   return $views;
 }
 
+/**
+ * Defines the feature user search default view.
+ *
+ * @ingroup tripal_feature
+ */
+function tripal_feature_defaultvalue_user_features() {
+
+  // As a shortcut, currently I am copying the admin view and then tweaking it
+  // In thie future this should be replaced by a views export
+  $view = tripal_feature_defaultview_admin_features();
+
+  // change some view admin stuff
+  $view->name = 'tripal_feature_user_feature';
+  $view->human_name = 'Feature User Search';
+  $view->description = 'Allows users to search feature data';
+  $view->tag = 'tripal search';
+
+  // Change the path
+  $view->display['page_1']->display_options['path'] = 'chado/feature';
+  $view->display['page_1']->display_options['menu'] = array(
+    'type' => 'normal',
+    'title' => 'Features',
+    'description' => 'A biological sequence or a section of a biological sequence, or a collection of such sections.',
+    'weight' => '-10'
+  );
+  unset($view->display['page_1']->display_options['tab_options']);
+
+  // Remove edit/delete node
+  unset(
+    $view->display['default']->display_options['fields']['delete_node'],
+    $view->display['default']->display_options['fields']['edit_node'],
+    $view->display['default']->display_options['fields']['nothing']
+  );
+
+  // Remove the admin action links
+  unset($view->display['default']->display_options['header']['action_links_area']);
+  unset($view->display['default']->display_options['header']['action_links_area_1']);
+
+  return $view;
+}
+
 /**
  * The default feature administration view
  *

+ 17 - 1
tripal_featuremap/tripal_featuremap.module

@@ -148,6 +148,22 @@ function tripal_featuremap_menu() {
   return $items;
 }
 
+/**
+ * Implements hook_search_biological_data_views().
+ *
+ * Adds the described views to the "Search Biological Data" Page created by Tripal Views
+ */
+function tripal_featuremap_search_biological_data_views() {
+  return array(
+    'tripal_featuremap_user_featuremaps' => array(
+      'machine_name' => 'tripal_featuremap_user_featuremaps',
+      'human_name' => 'Maps',
+      'description' => 'A map of features from the chado database (e.g. genetic map)',
+      'link' => 'chado/featuremap'
+    ),
+  );
+}
+
 /**
  * Implements hook_views_api().
  *
@@ -217,7 +233,7 @@ function tripal_featuremap_theme($existing, $type, $theme, $path) {
       'variables' =>  array(NULL),
       'path' => "$path/theme/tripal_featuremap",
     ),
-    
+
     // templates for the chado_feature nodes:
     'tripal_feature_featurepos' => array(
       'arguments' => array('node' => NULL),

+ 48 - 0
tripal_featuremap/tripal_featuremap.views_default.inc

@@ -12,6 +12,14 @@
 function tripal_featuremap_views_default_views() {
   $views = array();
 
+  // User View ("Search Biological Content")
+  // Remember, if you change the name/path of this view,
+  // you also want to change it's description in tripal_featuremap_search_biological_data_views()
+  $view = tripal_featuremap_defaultvalue_user_featuremaps();
+  $view = tripal_views_make_view_compatible_with_external($view);
+  $views[$view->name] = $view;
+
+  // Admin view
   $view = tripal_featuremap_defaultview_admin_featuremaps();
   $view = tripal_views_make_view_compatible_with_external($view);
   $views[$view->name] = $view;
@@ -19,6 +27,46 @@ function tripal_featuremap_views_default_views() {
   return $views;
 }
 
+/**
+ * Defines the featuremap user search default view.
+ *
+ * @ingroup tripal_featuremap
+ */
+function tripal_featuremap_defaultvalue_user_featuremaps() {
+
+  // As a shortcut, currently I am copying the admin view and then tweaking it
+  // In thie future this should be replaced by a views export
+  $view = tripal_featuremap_defaultview_admin_featuremaps();
+
+  // change some view admin stuff
+  $view->name = 'tripal_featuremap_user_featuremaps';
+  $view->human_name = 'Feature Map User Search';
+  $view->description = 'Allows users to search feature map data';
+  $view->tag = 'tripal search';
+
+  // Change the path
+  $view->display['page_1']->display_options['path'] = 'chado/featuremap';
+  $view->display['page_1']->display_options['menu'] = array(
+    'type' => 'normal',
+    'title' => 'Maps',
+    'description' => 'A map of features from the chado database (e.g. genetic map)',
+    'weight' => '-10'
+  );
+  unset($view->display['page_1']->display_options['tab_options']);
+
+  // Remove edit/delete node
+  unset(
+    $view->display['default']->display_options['fields']['delete_node'],
+    $view->display['default']->display_options['fields']['edit_node'],
+    $view->display['default']->display_options['fields']['nothing']
+  );
+
+  // Remove the admin action links
+  unset($view->display['default']->display_options['header']['action_links_area']);
+
+  return $view;
+}
+
 /**
  * Describes the default featuremap admin view
  *

+ 16 - 0
tripal_genetic/tripal_genetic.module

@@ -75,6 +75,22 @@ function tripal_genetic_menu() {
   return $items;
 }
 
+/**
+ * Implements hook_search_biological_data_views().
+ *
+ * Adds the described views to the "Search Biological Data" Page created by Tripal Views
+ */
+function tripal_genetic_search_biological_data_views() {
+  return array(
+    'tripal_genetic_user_genotypes' => array(
+      'machine_name' => 'tripal_genetic_user_genotypes',
+      'human_name' => 'Genotypes',
+      'description' => 'Genetic variations such as SNPs, MNPs and indels.',
+      'link' => 'chado/genotype'
+    ),
+  );
+}
+
 /**
  * Implements hook_views_api().
  *

+ 48 - 0
tripal_genetic/tripal_genetic.views_default.inc

@@ -12,6 +12,14 @@
 function tripal_genetic_views_default_views() {
   $views = array();
 
+  // User View ("Search Biological Content")
+  // Remember, if you change the name/path of this view,
+  // you also want to change it's description in tripal_genetic_search_biological_data_views()
+  $view = tripal_genetic_defaultvalue_user_genotypes();
+  $view = tripal_views_make_view_compatible_with_external($view);
+  $views[$view->name] = $view;
+
+  // Admin view
   $view = tripal_genetic_defaultviews_admin_genotypes();
   $view = tripal_views_make_view_compatible_with_external($view);
   $views[$view->name] = $view;
@@ -19,6 +27,46 @@ function tripal_genetic_views_default_views() {
   return $views;
 }
 
+/**
+ * Defines the genetic user search default view.
+ *
+ * @ingroup tripal_genetic
+ */
+function tripal_genetic_defaultvalue_user_genotypes() {
+
+  // As a shortcut, currently I am copying the admin view and then tweaking it
+  // In thie future this should be replaced by a views export
+  $view = tripal_genetic_defaultviews_admin_genotypes();
+
+  // change some view admin stuff
+  $view->name = 'tripal_genetic_user_genotypes';
+  $view->human_name = 'Genotype User Search';
+  $view->description = 'Allows users to search genotype data';
+  $view->tag = 'tripal search';
+
+  // Change the path
+  $view->display['page_1']->display_options['path'] = 'chado/genotype';
+  $view->display['page_1']->display_options['menu'] = array(
+    'type' => 'normal',
+    'title' => 'Genotypes',
+    'description' => 'Genetic variations such as SNPs, MNPs and indels.',
+    'weight' => '-10'
+  );
+  unset($view->display['page_1']->display_options['tab_options']);
+
+  // Remove edit/delete node
+  unset(
+    $view->display['default']->display_options['fields']['delete_node'],
+    $view->display['default']->display_options['fields']['edit_node'],
+    $view->display['default']->display_options['fields']['nothing']
+  );
+
+  // Remove the admin action links
+  unset($view->display['default']->display_options['header']['action_links_area']);
+
+  return $view;
+}
+
 /**
  * Describes the default administration genetic view
  *

+ 16 - 0
tripal_library/tripal_library.module

@@ -113,6 +113,22 @@ function tripal_library_menu() {
   return $items;
 }
 
+/**
+ * Implements hook_search_biological_data_views().
+ *
+ * Adds the described views to the "Search Biological Data" Page created by Tripal Views
+ */
+function tripal_library_search_biological_data_views() {
+  return array(
+    'tripal_library_user_library' => array(
+      'machine_name' => 'tripal_library_user_library',
+      'human_name' => 'Libraries',
+      'description' => 'Biological library including BAC, cDNA, FOSMID, etc.',
+      'link' => 'chado/library'
+    ),
+  );
+}
+
 /**
  * Implements hook_views_api().
  *

+ 48 - 0
tripal_library/tripal_library.views_default.inc

@@ -12,6 +12,14 @@
 function tripal_library_views_default_views() {
   $views = array();
 
+  // User View ("Search Biological Content")
+  // Remember, if you change the name/path of this view,
+  // you also want to change it's description in tripal_library_search_biological_data_views()
+  $view = tripal_library_defaultvalue_user_library();
+  $view = tripal_views_make_view_compatible_with_external($view);
+  $views[$view->name] = $view;
+
+  // Admin view
   $view = tripal_library_admin_defaultviews_library();
   $view = tripal_views_make_view_compatible_with_external($view);
   $views[$view->name] = $view;
@@ -19,6 +27,46 @@ function tripal_library_views_default_views() {
   return $views;
 }
 
+/**
+ * Defines the library user search default view.
+ *
+ * @ingroup tripal_library
+ */
+function tripal_library_defaultvalue_user_library() {
+
+  // As a shortcut, currently I am copying the admin view and then tweaking it
+  // In thie future this should be replaced by a views export
+  $view = tripal_library_admin_defaultviews_library();
+
+  // change some view admin stuff
+  $view->name = 'tripal_library_user_library';
+  $view->human_name = 'Library User Search';
+  $view->description = 'Allows users to search library data';
+  $view->tag = 'tripal search';
+
+  // Change the path
+  $view->display['page_1']->display_options['path'] = 'chado/library';
+  $view->display['page_1']->display_options['menu'] = array(
+    'type' => 'normal',
+    'title' => 'Libraries',
+    'description' => 'Biological library including BAC, cDNA, FOSMID, etc.',
+    'weight' => '-10'
+  );
+  unset($view->display['page_1']->display_options['tab_options']);
+
+  // Remove edit/delete node
+  unset(
+    $view->display['default']->display_options['fields']['delete_node'],
+    $view->display['default']->display_options['fields']['edit_node'],
+    $view->display['default']->display_options['fields']['nothing']
+  );
+
+  // Remove the admin action links
+  unset($view->display['default']->display_options['header']['action_links_area']);
+
+  return $view;
+}
+
 /**
  * Default administration library view
  *

+ 16 - 0
tripal_organism/tripal_organism.module

@@ -118,6 +118,22 @@ function tripal_organism_menu() {
   return $items;
 }
 
+/**
+ * Implements hook_search_biological_data_views().
+ *
+ * Adds the described views to the "Search Biological Data" Page created by Tripal Views
+ */
+function tripal_organism_search_biological_data_views() {
+  return array(
+    'tripal_organism_user_organisms' => array(
+      'machine_name' => 'tripal_organism_user_organisms',
+      'human_name' => 'Organisms',
+      'description' => 'Any living biological entity, such as an animal, plant, fungus, or bacterium.',
+      'link' => 'chado/organism'
+    ),
+  );
+}
+
 /**
  * Implements hook_help().
  * Adds a help page to the module list

+ 48 - 0
tripal_organism/tripal_organism.views_default.inc

@@ -12,6 +12,14 @@
 function tripal_organism_views_default_views() {
   $views = array();
 
+  // User View ("Search Biological Content")
+  // Remember, if you change the name/path of this view,
+  // you also want to change it's description in tripal_organism_search_biological_data_views()
+  $view = tripal_organism_defaultvalue_user_organisms();
+  $view = tripal_views_make_view_compatible_with_external($view);
+  $views[$view->name] = $view;
+
+  // Admin view
   $view = tripal_organism_admin_defaultview_organisms();
   $view = tripal_views_make_view_compatible_with_external($view);
   $views[$view->name] = $view;
@@ -19,6 +27,46 @@ function tripal_organism_views_default_views() {
   return $views;
 }
 
+/**
+ * Defines the organism user search default view.
+ *
+ * @ingroup tripal_organism
+ */
+function tripal_organism_defaultvalue_user_organisms() {
+
+  // As a shortcut, currently I am copying the admin view and then tweaking it
+  // In thie future this should be replaced by a views export
+  $view = tripal_organism_admin_defaultview_organisms();
+
+  // change some view admin stuff
+  $view->name = 'tripal_organism_user_organisms';
+  $view->human_name = 'Organism User Search';
+  $view->description = 'Allows users to search organism data';
+  $view->tag = 'tripal search';
+
+  // Change the path
+  $view->display['page_1']->display_options['path'] = 'chado/organism';
+  $view->display['page_1']->display_options['menu'] = array(
+    'type' => 'normal',
+    'title' => 'Organisms',
+    'description' => 'Any living biological entity, such as an animal, plant, fungus, or bacterium.',
+    'weight' => '-10'
+  );
+  unset($view->display['page_1']->display_options['tab_options']);
+
+  // Remove edit/delete node
+  unset(
+    $view->display['default']->display_options['fields']['delete_node'],
+    $view->display['default']->display_options['fields']['edit_node'],
+    $view->display['default']->display_options['fields']['nothing']
+  );
+
+  // Remove the admin action links
+  unset($view->display['default']->display_options['header']['action_links_area']);
+
+  return $view;
+}
+
 /**
  * Describe the organism administration view.
  *

+ 16 - 0
tripal_phenotype/tripal_phenotype.module

@@ -70,6 +70,22 @@ function tripal_phenotype_menu() {
   return $items;
 }
 
+/**
+ * Implements hook_search_biological_data_views().
+ *
+ * Adds the described views to the "Search Biological Data" Page created by Tripal Views
+ */
+function tripal_phenotype_search_biological_data_views() {
+  return array(
+    'tripal_phenotype_user_phenotypes' => array(
+      'machine_name' => 'tripal_phenotype_user_phenotypes',
+      'human_name' => 'Phenotypes',
+      'description' => 'A controlled sentence describing observable effects of non-wild type function.',
+      'link' => 'chado/phenotype'
+    ),
+  );
+}
+
 /**
  *  Implements hook_theme().
  *

+ 48 - 0
tripal_phenotype/tripal_phenotype.views_default.inc

@@ -12,6 +12,14 @@
 function tripal_phenotype_views_default_views() {
   $views = array();
 
+  // User View ("Search Biological Content")
+  // Remember, if you change the name/path of this view,
+  // you also want to change it's description in tripal_phenotype_search_biological_data_views()
+  $view = tripal_phenotype_defaultvalue_user_phenotypes();
+  $view = tripal_views_make_view_compatible_with_external($view);
+  $views[$view->name] = $view;
+
+  // Admin view
   $view = tripal_phenotype_defaultview_admin_phenotypes();
   $view = tripal_views_make_view_compatible_with_external($view);
   $views[$view->name] = $view;
@@ -19,6 +27,46 @@ function tripal_phenotype_views_default_views() {
   return $views;
 }
 
+/**
+ * Defines the phenotype user search default view.
+ *
+ * @ingroup tripal_phenotype
+ */
+function tripal_phenotype_defaultvalue_user_phenotypes() {
+
+  // As a shortcut, currently I am copying the admin view and then tweaking it
+  // In thie future this should be replaced by a views export
+  $view = tripal_phenotype_defaultview_admin_phenotypes();
+
+  // change some view admin stuff
+  $view->name = 'tripal_phenotype_user_phenotypes';
+  $view->human_name = 'Phenotype User Search';
+  $view->description = 'Allows users to search phenotype data';
+  $view->tag = 'tripal search';
+
+  // Change the path
+  $view->display['page_1']->display_options['path'] = 'chado/phenotype';
+  $view->display['page_1']->display_options['menu'] = array(
+    'type' => 'normal',
+    'title' => 'Phenotypes',
+    'description' => 'A controlled sentence describing observable effects of non-wild type function.',
+    'weight' => '-10'
+  );
+  unset($view->display['page_1']->display_options['tab_options']);
+
+  // Remove edit/delete node
+  unset(
+    $view->display['default']->display_options['fields']['delete_node'],
+    $view->display['default']->display_options['fields']['edit_node'],
+    $view->display['default']->display_options['fields']['nothing']
+  );
+
+  // Remove the admin action links
+  unset($view->display['default']->display_options['header']['action_links_area']);
+
+  return $view;
+}
+
 /**
  * Default phenotype administration view
  *

+ 16 - 0
tripal_project/tripal_project.module

@@ -88,6 +88,22 @@ function tripal_project_menu() {
   return $items;
 }
 
+/**
+ * Implements hook_search_biological_data_views().
+ *
+ * Adds the described views to the "Search Biological Data" Page created by Tripal Views
+ */
+function tripal_project_search_biological_data_views() {
+  return array(
+    'tripal_project_user_projects' => array(
+      'machine_name' => 'tripal_project_user_projects',
+      'human_name' => 'Projects',
+      'description' => 'A project. Can be used for grouping data such as with the natural diversity module data.',
+      'link' => 'chado/project'
+    ),
+  );
+}
+
 /**
  * Implements hook_help().
  * Adds a help page to the module list

+ 48 - 0
tripal_project/tripal_project.views_default.inc

@@ -12,6 +12,14 @@
 function tripal_project_views_default_views() {
   $views = array();
 
+  // User View ("Search Biological Content")
+  // Remember, if you change the name/path of this view,
+  // you also want to change it's description in tripal_project_search_biological_data_views()
+  $view = tripal_project_defaultvalue_user_projects();
+  $view = tripal_views_make_view_compatible_with_external($view);
+  $views[$view->name] = $view;
+
+  // Admin view
   $view = tripal_project_defaultview_admin_projects();
   $view = tripal_views_make_view_compatible_with_external($view);
   $views[$view->name] = $view;
@@ -19,6 +27,46 @@ function tripal_project_views_default_views() {
   return $views;
 }
 
+/**
+ * Defines the project user search default view.
+ *
+ * @ingroup tripal_project
+ */
+function tripal_project_defaultvalue_user_projects() {
+
+  // As a shortcut, currently I am copying the admin view and then tweaking it
+  // In thie future this should be replaced by a views export
+  $view = tripal_project_defaultview_admin_projects();
+
+  // change some view admin stuff
+  $view->name = 'tripal_project_user_projects';
+  $view->human_name = 'Project User Search';
+  $view->description = 'Allows users to search project data';
+  $view->tag = 'tripal search';
+
+  // Change the path
+  $view->display['page_1']->display_options['path'] = 'chado/project';
+  $view->display['page_1']->display_options['menu'] = array(
+    'type' => 'normal',
+    'title' => 'Projects',
+    'description' => 'A project. Can be used for grouping data such as with the natural diversity module data.',
+    'weight' => '-10'
+  );
+  unset($view->display['page_1']->display_options['tab_options']);
+
+  // Remove edit/delete node
+  unset(
+    $view->display['default']->display_options['fields']['delete_node'],
+    $view->display['default']->display_options['fields']['edit_node'],
+    $view->display['default']->display_options['fields']['nothing']
+  );
+
+  // Remove the admin action links
+  unset($view->display['default']->display_options['header']['action_links_area']);
+
+  return $view;
+}
+
 /**
  * Project administration view
  *

+ 16 - 0
tripal_stock/tripal_stock.module

@@ -93,6 +93,22 @@ function tripal_stock_menu() {
   return $items;
 }
 
+/**
+ * Implements hook_search_biological_data_views().
+ *
+ * Adds the described views to the "Search Biological Data" Page created by Tripal Views
+ */
+function tripal_stock_search_biological_data_views() {
+  return array(
+    'tripal_stock_user_stocks' => array(
+      'machine_name' => 'tripal_stock_user_stocks',
+      'human_name' => 'Stocks',
+      'description' => 'A stock is the physical entities of an organism, either living or preserved.',
+      'link' => 'chado/stock'
+    ),
+  );
+}
+
 /**
  * Implements Menu wildcard_load hook
  *

+ 48 - 0
tripal_stock/tripal_stock.views_default.inc

@@ -12,6 +12,14 @@
 function tripal_stock_views_default_views() {
   $views = array();
 
+  // User View ("Search Biological Content")
+  // Remember, if you change the name/path of this view,
+  // you also want to change it's description in tripal_stock_search_biological_data_views()
+  $view = tripal_stock_defaultvalue_user_stocks();
+  $view = tripal_views_make_view_compatible_with_external($view);
+  $views[$view->name] = $view;
+
+  // Admin view
   $view = tripal_stock_defaultview_admin_stocks();
   $view = tripal_views_make_view_compatible_with_external($view);
   $views[$view->name] = $view;
@@ -19,6 +27,46 @@ function tripal_stock_views_default_views() {
   return $views;
 }
 
+/**
+ * Defines the stock user search default view.
+ *
+ * @ingroup tripal_stock
+ */
+function tripal_stock_defaultvalue_user_stocks() {
+
+  // As a shortcut, currently I am copying the admin view and then tweaking it
+  // In thie future this should be replaced by a views export
+  $view = tripal_stock_defaultview_admin_stocks();
+
+  // change some view admin stuff
+  $view->name = 'tripal_stock_user_stocks';
+  $view->human_name = 'Stock User Search';
+  $view->description = 'Allows users to search stock data';
+  $view->tag = 'tripal search';
+
+  // Change the path
+  $view->display['page_1']->display_options['path'] = 'chado/stock';
+  $view->display['page_1']->display_options['menu'] = array(
+    'type' => 'normal',
+    'title' => 'Stocks',
+    'description' => 'A stock is the physical entities of an organism, either living or preserved.',
+    'weight' => '-10'
+  );
+  unset($view->display['page_1']->display_options['tab_options']);
+
+  // Remove edit/delete node
+  unset(
+    $view->display['default']->display_options['fields']['delete_node'],
+    $view->display['default']->display_options['fields']['edit_node'],
+    $view->display['default']->display_options['fields']['nothing']
+  );
+
+  // Remove the admin action links
+  unset($view->display['default']->display_options['header']['action_links_area']);
+
+  return $view;
+}
+
 /**
  * Default stock administration view
  *

+ 55 - 0
tripal_views/theme/tripal_views_search_biological_content.tpl.php

@@ -0,0 +1,55 @@
+<?php
+/**
+ *
+ */
+$biological_views = module_invoke_all('search_biological_data_views');
+$disabled_views = variable_get('views_defaults', array());
+?>
+
+<p>Use the following to search the various types of biological content available by
+this site:</p>
+<DL>
+<?php foreach ($biological_views as $view) { ?>
+  <?php if (!isset($disabled_views[ $view['machine_name'] ]) OR ($disabled_views[ $view['machine_name'] ] == TRUE)) { ?>
+    <DT><?php print l($view['human_name'], $view['link']); ?></DT>
+    <DD><?php print $view['description']; ?></DD>
+<?php }} ?>
+</DL>
+
+<?php
+// How to disable/remove views from this list
+print tripal_set_message(
+  "To remove a view from this list, simply navigate to the Views UI (Adminster ->
+    Structure -> Views; admin/structure/views) and choose 'disable' from the action
+    drop-down to the right of the view you would like to remove.",
+  TRIPAL_INFO,
+  array('return_html' => 1)
+);
+
+// Tell Tripal admin how to add views to this list
+print tripal_set_message(
+  "In order to add views to the above list you need to implement hook_search_biological_data_views().
+    This hook should return an array as follows: <code><pre>array(
+    '[view-machine-name]' => array(
+      'machine_name' => '[view-machine-name]',
+      'human_name' => '[Human-readable title to show in above list]',
+      'description' => '[description to show in above list]',
+      'link' => '[path to the view]'
+    ),
+  );</pre></code>
+  Where you should replace all instructions in square-brackets([]) with the details of your view.",
+  TRIPAL_INFO,
+  array('return_html' => 1)
+);
+
+// Tell Tripal Admin which template to change
+print tripal_set_message(
+  "Administrators, you can customize the way the content above is presented.  Tripal
+    provides a template file for each block of content.  To customize, copy the template
+    file to your site's default theme, edit then " .
+    l('clear the Drupal cache', 'admin/config/development/performance', array('attributes' => array('target' => '_blank'))) .
+    ". Currently, the content above is provided by this template: <br><br>$template_file",
+  TRIPAL_INFO,
+  array('return_html' => 1)
+);
+?>

+ 8 - 0
tripal_views/tripal_views.module

@@ -33,6 +33,8 @@ function tripal_views_menu() {
   $items['chado'] = array(
     'title' => 'Search Biological Data',
     'description' => 'Listings of the various biological data available categorized by type.',
+    'page callback' => 'theme',
+    'page arguments' => array('tripal_views_search_biological_content'),
     'access arguments' => array('access content'),
     'expanded' => TRUE,
     'type' => MENU_NORMAL_ITEM,
@@ -231,6 +233,12 @@ function tripal_views_theme($existing, $type, $theme, $path) {
       'variables' =>  array(NULL),
       'path' => drupal_get_path('module', 'tripal_views') . '/theme'
     ),
+    // search biological content page
+    'tripal_views_search_biological_content' => array(
+      'template' => 'tripal_views_search_biological_content',
+      'variables' =>  array(NULL),
+      'path' => drupal_get_path('module', 'tripal_views') . '/theme'
+    ),
   );
 }