Parcourir la source

Removed old organism and analyses lists as this duplicates are default views and views is easy enough to install if someone wants the list

spficklin il y a 12 ans
Parent
commit
06ed7b835c

+ 9 - 98
tripal_analysis/tripal_analysis.module

@@ -58,14 +58,6 @@ function tripal_analysis_init() {
  * @ingroup tripal_analysis
  */
 function tripal_analysis_menu() {
-  // Display available analyses
-  $items['analyses'] = array(
-      'menu_name' => ('primary-links'), //Enable the 'Analysis' primary link
-      'title' => 'Analyses',
-      'page callback' => 'tripal_analysis_show_analyses',
-      'access arguments' => array('access chado_analysis content'),
-      'type' => MENU_NORMAL_ITEM
-  );
   //Sync analysis
   $items['chado_sync_analyses'] = array(
      'title' => 'Sync Data',
@@ -95,26 +87,6 @@ function tripal_analysis_menu() {
   return $items;
 }
 
-/**
- * Display the summary view of analyses when click on the 'Analyses'
- * primary-link
- *
- * @ingroup tripal_analysis
- */
-function tripal_analysis_show_analyses() {
-  // Show libraries stored in Drupal's {chado_analysis} table
-  $sql = "SELECT COUNT(analysis_id) FROM {chado_analysis}";
-  $no_ana = db_result(db_query($sql));
-  if ($no_ana != 0) {
-    $analyses = get_chado_analyses();
-    return theme('tripal_analysis_analysis_page', $analyses);
-  }
-  else {
-    return t("No analysis available at this time.");
-  }
-
-}
-
 /**
  * Provide information to drupal about the node types that we're creating
  * in this module
@@ -349,39 +321,39 @@ function chado_analysis_form($node) {
   if (!$analysis_id) {
     $analysis_id = $analysis->analysis_id;
   }
-    $analysisname = $node->analysisname;
+  $analysisname = $node->analysisname;
   if (!$analysisname) {
     $analysisname = $analysis->name;
   }
-    $program = $node->program;
+  $program = $node->program;
   if (!$program) {
     $program = $analysis->program;
   }
-    $programversion = $node->programversion;
+  $programversion = $node->programversion;
   if (!$programversion) {
     $programversion = $analysis->programversion;
   }
-    $algorithm = $node->algorithm;
+  $algorithm = $node->algorithm;
   if (!$algorithm) {
     $algorithm = $analysis->algorithm;
   }
-    $sourcename = $node->sourcename;
+  $sourcename = $node->sourcename;
   if (!$sourcename) {
     $sourcename = $analysis->sourcename;
   }
-    $sourceversion = $node->sourceversion;
+  $sourceversion = $node->sourceversion;
   if (!$sourceversion) {
     $sourceversion = $analysis->sourceversion;
   }
-    $sourceuri = $node->sourceuri;
+  $sourceuri = $node->sourceuri;
   if (!$sourceuri) {
     $sourceuri = $analysis->sourceuri;
   }
-    $timeexecuted = $node->timeexecuted;
+  $timeexecuted = $node->timeexecuted;
   if (!$timeexecuted) {
     $timeexecuted = $analysis->timeexecuted;
   }
-    $description = $node->description;
+  $description = $node->description;
   if (!$description) {
     $description = $analysis->description;
   }
@@ -811,9 +783,6 @@ function tripal_analysis_perm() {
  */
 function tripal_analysis_theme() {
   return array(
-    'tripal_analysis_analysis_page' => array(
-         'arguments' => array('analyses'),
-    ),
     'tripal_analysis_base' => array(
        'arguments' => array('node' => NULL),
        'template' => 'tripal_analysis_base',
@@ -893,64 +862,6 @@ function get_chado_analyses() {
   }
 }
 
-/**
- * Theme the List Analysis page
- *
- * @param $analyses
- *   An array of analyses to list
- *
- * @ingroup tripal_analysis
- */
-function theme_tripal_analysis_analysis_page($analyses) {
-
-  $output = "<br />Analyses are listed in the descending order of their execution time.<br /><a id=\"tripal_expandableBox_toggle_button\" onClick=\"toggleExpandableBoxes()\">[-] Collapse All</a>";
-
-  foreach ($analyses as $analysis) {
-    // Prepare information for html output
-    $ana_node_url = url("node/$analysis->node_id");
-    if ($analysis->sourceversion) {
-      $ver = "($analysis->sourceversion)";
-      }
-      $date =  preg_replace("/^(\d+-\d+-\d+) .*/", "$1", $analysis->timeexecuted);
-
-      // Generate html output
-    $output .= "<div class=\"tripal_chado_analysis-info-box\" style=\"padding:5px\">
-                         <div class=\"tripal_expandableBox\">
-                           <h3>$analysis->name ($date)</h3>
-                         </div>
-                         <div class=\"tripal_expandableBoxContent\">
-                           <span>
-                             <table class=\"tripal_chado_analysis_content\">
-                               <tr><td>
-                                 Name: <a href=\"$ana_node_url\">$analysis->name</a>
-                               </td></tr>
-                               <tr><td>
-                                 Program: $analysis->program ($analysis->programversion)
-                               </td></tr>
-                               <tr><td>
-                                 Algorithm: $analysis->algorithm
-                               </td></tr>
-                             <tr><td>
-                                 Source: $analysis->sourcename $ver
-                             </td></tr>
-                             <tr><td>
-                                 Source URI: $analysis->sourceuri
-                               </td></tr>
-                               <tr><td>
-                                 Executed Time:$date
-                               </td></tr>
-                               <tr><td>
-                                 Description: $analysis->description
-                               </td></tr>
-                             </table>
-                           </span>
-                         </div>
-                       </div>";
-  }
-
-  return $output;
-}
-
 /**
  * Remove orphaned drupal nodes or chado analysis
  *

+ 0 - 67
tripal_organism/tripal_organism.module

@@ -96,13 +96,6 @@ function tripal_organism_block($op = 'list', $delta = '0', $edit = array()) {
 function tripal_organism_menu() {
   $items = array();
 
-  $items['organisms'] = array(
-    'menu_name' => ('primary-links'), //Enable the 'Organism' primary link
-    'title' => 'Organisms',
-    'page callback' => 'tripal_organism_show_organisms',
-    'access arguments' => array('access chado_organism content'),
-    'type' => MENU_NORMAL_ITEM
-  );
   // the administative settings menu
   $items['admin/tripal/tripal_organism'] = array(
    'title' => 'Organisms',
@@ -633,9 +626,6 @@ function tripal_organism_admin_validate($form, &$form_state) {
  */
 function tripal_organism_theme() {
   return array(
-    'tripal_organism_organism_page' => array(
-       'arguments' => array('organisms'),
-    ),
     'tripal_organism_base' => array(
        'arguments' => array('node' => NULL),
        'template' => 'tripal_organism_base',
@@ -1071,63 +1061,6 @@ function tripal_organism_help($path, $arg) {
   return $output;
 }
 
-/**
- * Display the summary view of organisms when click on the 'Organisms'
- * primary-link
- *
- * @ingroup tripal_organism
- */
-function tripal_organism_show_organisms() {
-  // Show libraries stored in Drupal's {chado_organism} table
-  $sql = "SELECT COUNT(organism_id) FROM {chado_organism}";
-  $no_orgs = db_result(db_query($sql));
-  if ($no_orgs != 0) {
-    $organisms = get_chado_organisms();
-    return theme('tripal_organism_organism_page', $organisms);
-  }
-  else {
-    return t("No organism exists. Please contact administrators to " .
-             "synchronize organisms.");
-  }
-}
-/**
- *
- * @ingroup tripal_organism
- */
-function theme_tripal_organism_organism_page($organisms) {
-
-  $output = "<br /><a id=\"tripal_expandableBox_toggle_button\" onClick=\"toggleExpandableBoxes()\">[-] Collapse All</a>";
-  foreach ($organisms as $organism) {
-    // Prepare information for html output
-    $org_url = url("node/$organism->node_id");
-
-    // Generate html output
-    $output .= "<div class=\"tripal_chado_organism-info-box\" style=\"padding:5px\">
-                       <div class=\"tripal_expandableBox\">
-                         <h3>$organism->common_name</h3>
-                       </div>
-                       <div class=\"tripal_expandableBoxContent\">
-                         <span>
-                           <table class=\"tripal_chado_analysis_content\">
-                             <tr><td>
-                               Name: <a href=\"$org_url\">$organism->common_name</a>
-                             </td></tr>
-                             <tr><td>
-                               Genus: $organism->genus
-                             </td></tr>
-                             <tr><td>
-                               Species: $organism->species
-                             </td></tr>
-                             <tr><td>
-                               Description: $organism->comment
-                             </td></tr>
-                           </table>
-                         </span>
-                       </div>
-                     </div>";
-  }
-  return $output;
-}
 
 /**
  * This function uses organism_id's of all drupal organism nodes as input and

+ 9 - 18
tripal_stock/tripal_stock.module

@@ -325,27 +325,18 @@ function tripal_stock_show_stocks() {
 function theme_tripal_stock_stock_table(&$stocks) {
 
   // cycle through the stocks and build the stocks page
-  $output = "<div id=\"stocks\">";
-  $output .= '<table>';
-  $output .= "<tr>";
-  $output .= "<th>Name</th>";
-  $output .= "<th>Type</th>";
-  $output .= "<th>Organism</th>";
-  $output .= "<th>Description</th>";
-  $output .= "</tr>";
-
+  $header = array('Name', 'Type','Organism','Description');
+  $rows = array();
   foreach ($stocks as $node) {
     $output .= "<tr>";
-    $output .= "<td>" . l($node->stock->name, "node/" . $node->nid) . "</td>";
-    $output .= "<td>" . $node->stock->type_id->name . "</td>";
-    $output .= "<td nowrap>" . $node->stock->organism_id->common_name . "</td>";
-    $output .= "<td>" . $node->stock->description . "</td>";
-    $output .= "</tr>";
+    $rows[]= array(
+       l($node->stock->name, "node/" . $node->nid),
+       $node->stock->type_id->name,
+       $node->stock->organism_id->common_name,
+       $node->stock->description
+    );
   }
-  $output .= "</table>";
-  $output .= "</div>";
-
-  return $output;
+  return theme('table', $header, $rows);
 }
 
 /**