Sort of targets in multiple-targets selection.
[egate.git] / www / mtargets.egw
index ca6b893..1f81bfa 100644 (file)
@@ -1,49 +1,62 @@
 <html>
 {
-# $Id: mtargets.egw,v 1.11 1996/01/12 16:30:10 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
     }
-}
-<head>
-<title>Europagate, WWW/Z39.50 Gateway</title>
-</head>
-<body>
-{
+    set mMode 1
+
     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"
         }
     }
 }
-<center>
-<img src="/egwgif/button-egw.gif" Alt="EUROPAGATE">
-</center>
-<h2>Choose one or more Z39.50 targets</h2>
+<head>
+<title>Europagate, WWW/Z39.50 Gateway</title>
+</head>
+<body>
 {
+    set useIcons 1
+    button-europagate
+    button-define-target 0
+
+    html "<h2>Choose one or more targets</h2>\n"
     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"}
         html "<br>\n"
     }
     html "</dl>\n"
+    html {<input type="submit" value="Select"></form>} \n
+
+    html "<p>\n"
+    set useIcons 0
+    button-europagate
+    button-define-target 0
 }
-<input type="submit" value="Select">
-</form>
+
 {
     catch maintenance
     if {!$debug} return