Răsfoiți Sursa

Added back in the generic vocabulary browser

spficklin 14 ani în urmă
părinte
comite
171730108c
2 a modificat fișierele cu 23 adăugiri și 17 ștergeri
  1. 23 14
      tripal_cv/trees.php
  2. 0 3
      tripal_cv/tripal_cv.module

+ 23 - 14
tripal_cv/trees.php

@@ -216,14 +216,19 @@ function tripal_cv_get_term_children($cvterm_id,$cnt_table = null,
 */
 function tripal_cv_init_browser($cv_id) {
 
-   $content  = "<div id=\"tripal_cv_term_box\" class=\"feature-info-box\">";
-   $content .= "<div class=\"tripal_expandableBox\">";
-   $content .= "<h3>Term Information</h3>";
-   $content .= "</div>";
-   $content .= "<div class=\"tripal_expandableBoxContent\">";
-   $content .= "<div id=\"cvterm_info\"></div></div>";
-   $content .= "<h3>Tree Browser</h3>";
-   $content .= "<div id=\"browser\"</div></div>";
+   $content = "
+        <div id=\"tripal_cv_cvterm_info_box\">
+           <a href=\"#\" onclick=\"$('#tripal_cv_cvterm_info_box').hide()\" style=\"float: right\">Close [X]</a>
+           <h3>Term Information</h3>
+           <div id=\"tripal_cv_cvterm_info\"></div>
+        </div>
+        <div id=\"tripal_ajaxLoading\" style=\"display:none\">
+           <div id=\"loadingText\">Loading...</div>
+           <img src=\"$url\">
+        </div> 
+         <h3>Tree Browser</h3>
+        <div id=\"browser\"</div></div>
+   ";
 
    drupal_json(array('update' => "$content"));
 }
@@ -237,10 +242,12 @@ function tripal_cv_cvterm_info($cvterm_id){
    $tree_id = check_plain($_REQUEST['tree_id']);
 
    // first get any additional information to add to the cvterm
-   $tripal_mod = preg_replace("/^(tripal_.+?)_cv_tree_(.+)$/","$1",$tree_id);
-   if($tripal_mod){
-      $callback = $tripal_mod . "_cvterm_add";
-      $opt = call_user_func_array($callback,array($cvterm_id,$tree_id));
+   if(strcmp($tree_id,'undefined')!=0){
+      $tripal_mod = preg_replace("/^(tripal_.+?)_cv_tree_(.+)$/","$1",$tree_id);
+      if($tripal_mod){
+         $callback = $tripal_mod . "_cvterm_add";
+         $opt = call_user_func_array($callback,array($cvterm_id,$tree_id));
+      }
    }
 
    $sql = "
@@ -284,8 +291,10 @@ function tripal_cv_cvterm_info($cvterm_id){
    ";
 
    // now add in any additional options from a hook
-   foreach ($opt as $key=>$value){
-      $content .= "<tr><th>$key</th><td>$value</td>";
+   if($opt){
+      foreach ($opt as $key=>$value){
+         $content .= "<tr><th>$key</th><td>$value</td>";
+      }
    }
 
    // close out the information table

+ 0 - 3
tripal_cv/tripal_cv.module

@@ -76,14 +76,12 @@ function tripal_cv_menu() {
       'type' => MENU_CALLBACK
    );
    // menu items for working with the CV module tree browser
-   /*
    $items['cv_browser'] = array(
       'title' => t('CV Relationship Browser'),
       'page callback' => 'tripal_cv_show_browser',
       'access arguments' => array('access chado_cv content'),
       'type' => MENU_NORMAL_ITEM
    );
-   */
    $items['tripal_cv_init_browser'] = array(
       'path' => 'tripal_cv_init_browser',
       'title' => t('CV Browser'),
@@ -101,7 +99,6 @@ function tripal_cv_menu() {
       'access arguments' => array('access content'),
       'type' => MENU_CALLBACK
    );
-
    // menu items for working with terms
    $items['tripal_cv_cvterm_info'] = array(
       'path' => 'tripal_cv_cvterm_info',