--- F:\Documents and Settings\lis\My Docs\Drupal\modules\taxonomy_dhtml\taxonomy_dhtml\taxonomy_dhtml.module	Fri Oct 07 23:08:06 2005
+++ W:\home\localhost\drupal\modules\taxonomy_dhtml\taxonomy_dhtml.module	Mon Jan 23 23:29:33 2006
@@ -150,8 +150,11 @@
     while ($node = db_fetch_object($result)) {
       if (module_exist('comment')) {
         $detail = t("Author: %name, comments: %num", array ("%name" => strip_tags(format_name($node)), "%num" => comment_num_all($node->nid)));
-      }
-      $link = l($node->title, "node/$node->nid", array ("title" => $detail, "class" => "dhtml_node"));
+      };
+	  //by EL
+	  $params = array ("title" => $detail, "class" => "dhtml_node");    //
+	  if (variable_get("taxonomy_dhtml_overview_linksnewwindow", 0)) $params['target'] = '_blank';  //
+      $link = l($node->title, "node/$node->nid", $params);
       $term_node = array2object(array ("nid" => $node->nid, "depth" => $term->depth+1, "link" => $link));
       $part1 = array_slice($tree_node, 0, $i+1);
       $part2 = array_slice($tree_node, $i+1, count($tree_node));
@@ -182,17 +185,20 @@
     $old_depth = $term->depth;
     // if children exist, output with proper class and id attributes, else, output item with specified link or default link
     if ($term->depth < $tree[$m+1]->depth) {
-      $link = l(t($term->name), "taxonomy/term/$term->tid/9",
-                array("title" => t($term->description),
+	  $params = array("title" => t($term->description),
                       "class" => "actuator",
-                      "id"    => "actuator$tdhtml_ul"));
+                      "id"    => "actuator$tdhtml_ul");   //
+	  if (variable_get("taxonomy_dhtml_overview_linksnewwindow", 0)) $params['target'] = '_blank';  //
+      $link = l(t($term->name), "taxonomy/term/$term->tid/9", $params); //
       $output .= "<li class=\"menubar\">$link</li>\n";
     }
-    else if ($term->link){
+    else if ($term->link ){  // how to fix ?
       $link = $term->link;
       $output .= "<li>$link</li>\n";
     } else {
-      $link = l(t($term->name), "taxonomy/term/$term->tid/9", array("title" => t($term->description)));
+	  $params = array("title" => t($term->description));
+	  if (variable_get("taxonomy_dhtml_overview_linksnewwindow", 0)) $params['target'] = '_blank';  //
+      $link = l(t($term->name), "taxonomy/term/$term->tid/9",  $params);
       $output .= "<li>$link</li>\n";
     }
   }
@@ -208,6 +214,8 @@
   }
   $output = form_select(t("Omitted vocabularies"), "taxonomy_dhtml_overview_vocab", variable_get("taxonomy_dhtml_overview_vocab", array()), $select, t("Select vocabularies which should be <b>omitted</b> from listings."), "", 1);
   $output .= form_textfield("Number of items", "taxonomy_dhtml_overview_count", variable_get("taxonomy_dhtml_overview_count", 50), 3, 3, t("The number of items to display per vocabulary in the overview page."));
+  // by EL
+  $output .= form_checkbox("Open links in new window", "taxonomy_dhtml_overview_linksnewwindow", 1, variable_get("taxonomy_dhtml_overview_linksnewwindow", 0), t("Open links on taxonomy_dhtml page in new window."));
   return $output;
 }
 
