Browse Source

Improved the taxanomy page

Stephen Ficklin 8 years ago
parent
commit
e64575d83a

+ 4 - 2
tripal_core/api/tripal_core.tripal.api.inc

@@ -137,8 +137,10 @@ function tripal_report_error($type, $severity, $message, $variables = array(), $
 }
 
 /**
- * Display messages to tripal administrators. This can be used instead of
- * drupal_set_message when you want to target tripal administrators.
+ * Display messages to tripal administrators.
+ *
+ * This can be used instead of drupal_set_message when you want to target
+ * tripal administrators.
  *
  * @param $message
  *   The message to be displayed to the tripal administrators

+ 1 - 1
tripal_phylogeny/includes/tripal_phylogeny.admin.inc

@@ -135,7 +135,7 @@ function tripal_phylogeny_default_plots_form($form, &$form_state) {
     '#type' => 'textfield',
     '#title' => 'Interor Node Size',
     '#description' => 'Please specify a size for the interior node size. If set to zero, the node will not appear.',
-    '#default_value' => variable_get('tripal_phylogeny_default_interior_node_size', 1),
+    '#default_value' => variable_get('tripal_phylogeny_default_interior_node_size', 0),
     '#element_validate' => array(
       'element_validate_integer'
     ),

+ 29 - 4
tripal_phylogeny/includes/tripal_phylogeny.taxonomy.inc

@@ -9,11 +9,36 @@ function tripal_phylogeny_taxonomy_view() {
       'name' => 'taxonomy',
     ),
   );
+
+  $message = t('Site administrators:  This page is meant to provide
+      a heirarchical taxonomic tree for all of the organism present
+      in this site.  This may not be useful if you only have a few
+      species. If so, you can turn off this page by disabling this page on
+      the site\'s <a href="@menu">Navigation Menu</a>.  Otherwise, to generate the taxonomy go to this site\'s
+      <a href="@taxloader">NCBI taxonomy loader</a> to import the taxonomy information from NCBI.
+      <br><br>Note: If you add new species to this site, you should rerun the
+        NCBI taxonomy loader to update the view</p>',
+      array(
+        '@menu' => url('admin/structure/menu/manage/navigation'),
+        '@taxloader' => url('admin/tripal/loaders/ncbi_taxonomy_loader'
+      ))
+  );
+  $admin_message = tripal_set_message($message, TRIPAL_INFO, array('return_html' => TRUE));
+
   $phylotree = chado_generate_var('phylotree', $values);
-  $node = new stdClass();
-  $node->phylotree = $phylotree;
+  if ($phylotree) {
+    $node = new stdClass();
+    $node->phylotree = $phylotree;
 
-  return theme('tripal_phylogeny_taxonomic_tree', array('node' => $node));
+    $html =  theme('tripal_phylogeny_taxonomic_tree', array('node' => $node)) .
+      $admin_message;
+    return $html;
+  }
+
+  return array(
+    '#type' => 'markup',
+    '#markup' => t('This site has not yet prepared the taxonomy for viewing.') . $admin_message,
+  );
 }
 /**
  *
@@ -117,7 +142,7 @@ function tripal_phylogeny_ncbi_taxonomy_import($job_id) {
       // Add the taxonomic tree.
       $options = array(
         'name' =>  $site_name . 'Taxonomy Tree',
-        'description' => 'The taxonomic tree of species present on this site.',
+        'description' => 'The taxonomic tree of species present on this site. Click a species name for more details.',
         'leaf_type' => 'taxonomy',
         'analysis_id' => $analysis->analysis_id,
         'tree_file' => '/dev/null',

+ 1 - 1
tripal_phylogeny/theme/tripal_phylogeny.theme.inc

@@ -28,7 +28,7 @@ function tripal_phylogeny_prepare_tree_viewer($phylotree) {
   $options = json_encode(array(
     'phylogram_width' => variable_get('tripal_phylogeny_default_phylogram_width', 350),
     'root_node_size' => variable_get('tripal_phylogeny_default_root_node_size', 3),
-    'interior_node_size' => variable_get('tripal_phylogeny_default_interior_node_size', 1),
+    'interior_node_size' => variable_get('tripal_phylogeny_default_interior_node_size', 0),
     'leaf_node_size' => variable_get('tripal_phylogeny_default_leaf_node_size', 6),
     'skipTicks' => $skip_ticks,
   ));