Sort of targets in multiple-targets selection.
[egate.git] / www / mtargets.egw
index 1d5dc32..1f81bfa 100644 (file)
@@ -1,34 +1,36 @@
 <html>
 {
-# $Id: mtargets.egw,v 1.12 1996/01/26 15:50:07 adam Exp $
+# $Id: mtargets.egw,v 1.15 1996/02/19 15:44:59 adam Exp $
     set setNo 1
     source ztargets.conf
     if {[info commands saveState] == ""} {
         source z39util.tcl
     }
     set mMode 1
-}
-<head>
-<title>Europagate, WWW/Z39.50 Gateway</title>
-</head>
-<body>
-{
+
     if {![info exists debug]} {
-        if {[lindex $sessionParms 0] == "1"} {
+        if {[lindex $sessionParms 1] == "1"} {
             set debug 1
         } else {
             set debug 0
         }
     }
-
-    if {![info exists useIcons]} {
-        if {[lindex $sessionParms 1] == "1"} {
-            set useIcons 0
+    set html3 [lindex $sessionParms 0]
+    if {$html3 == ""} {
+        if {[string first Mozilla $env(HTTP_USER_AGENT)] == 0} {
+            set html3 1
+            egw_log debug "New user using Netscape"
         } else {
-            set useIcons 1
+            set html3 0
+            egw_log debug "New user Not using Netscape"
         }
     }
-
+}
+<head>
+<title>Europagate, WWW/Z39.50 Gateway</title>
+</head>
+<body>
+{
     set useIcons 1
     button-europagate
     button-define-target 0
     html {<form action="http:} $env(SCRIPT_NAME)
     html / $sessionId {/mquery.egw/} $setNo {" method=get><br>} \n
     html "<dl>\n"
-    foreach t [array names targets] {
+
+
+
+    proc targetsCmp {l r} {
+        global targets
+        return [string compare [string tolower [lindex $targets($l) 0]] \
+                               [string tolower [lindex $targets($r) 0]]]
+    }
+    set tt [array names targets]
+    set tn [lsort -command targetsCmp $tt]
+    foreach t $tn {
         html {<dt>} [ lindex $targets($t) 0]
         html {<dd>}
         set databases [lindex $targets($t) 1]
 
         set desc [lindex $targets($t) 4]
         if {$desc != ""} {
-            html "<em>$desc</em><br>\n"
+            html "$desc<br>\n"
         }
         foreach d $databases {
             html {<input type="checkbox" name="target"}