Attempt to inform user if session has really terminated.
[egate.git] / www / nwi.egw
index b2b7d22..75209c3 100644 (file)
@@ -1,11 +1,11 @@
 <html>
 {
-# $Id: nwi.egw,v 1.1 1996/03/11 17:41:16 adam Exp $
+# $Id: nwi.egw,v 1.4 1996/03/14 11:50:46 adam Exp $
     source ztargets.conf
-    if {[info commands saveState] == ""} {
-        source z39util.tcl
-    }
-    set mMode 1
+
+    set scriptQuery nwi.egw
+    set scriptTarget {}
+    set utilExtension nwiutil.tcl
 
     if {![info exists debug]} {
         if {[lindex $sessionParms 1] == "1"} {
@@ -14,6 +14,9 @@
             set debug 0
         }
     }
+    if {[info commands saveState] == ""} {
+        source z39util.tcl
+    }
     set html3 [lindex $sessionParms 0]
     if {[string length $html3] == 0} {
         if {![info exists env(HTTP_USER_AGENT)]} {
     }
 
     set useIcons 1
-    button-europagate
-    button-new-target 0
+    button-main
+
+    set curSort score
+    set curFormat brief
+    set curEntry {}
 
+    set initSet 0
+    catch {
+        set initSet [lindex $sessionParms 0]
+        if {$initSet < 0} {
+            set initSet 0
+        }
+        if {$initSet} {
+            for {set i 1} {$i <= $hist($initSet,0,host)} {incr i} {
+                lappend curTargets $hist($initSet,$i,host)
+            }
+            set curSort $hist($initSet,sort)
+            set curFormat $hist($initSet,format)
+            set curEntry $hist($initSet,form,entry1)
+        }
+    }
     html {<form action="http:} $env(SCRIPT_NAME)
     html / $sessionId {/msearch.egw/} $setNo {" method=get>} \n
 
-    html "Enter your query:<br>\n"
+    html "<dl>"
+    html {<dt><b>Enter your query</b><dd>}
 
-    html {<input type="text" name="entry1" size=50>}
+    html {<input type="text" name="entry1" size=50 value="}
+    html [join $curEntry] {">}
     html {<input type=submit value="Search"><br>}
 
-    html {and search the following servers:<br>}
+    html {<dt><b>and search the following servers</b><dd>}
 
-    html {<input type="checkbox" name="host"}
-    html { value="nwi.ub2.lu.se/sverige"> Sweden}
-    html {<input type="checkbox" name="host" }
-    html { value="nwi.ub2.lu.se/new_nor_lib"> Norway}
-
-    html "<br>\n"
-
-    html {Display each record in <select name="format">}
-    html "<option>brief\n"
-    html "<option>medium\n"
+    foreach t {
+            {nwi.ub2.lu.se/sverige}
+            {nwi.ub2.lu.se/new_nor_lib} 
+            {localhost:9999/test}
+            {localhost:210/Default}
+        } {
+        html {<input type="checkbox" name="host" }
+        if {[info exists curTargets]} {
+            if {[lsearch -exact $curTargets $t] != -1} {
+                html {checked }
+            }
+        }
+        html {value="} $t {"> } [lindex $targets($t) 0]
+    }
+    catch {unset curTargets}
+    html {<p><dt><b>Display each record in <select name="format"><dd>}
+    if {![string compare $curFormat brief]} {
+        html "<option>brief\n"
+        html "<option>medium\n"
+    } else {
+        html "<option>medium\n"
+        html "<option>brief\n"
+    }
     html "</select> notation"
     html { and sort by <select name="sort">}
-    html "<option>score\n"
-    html "<option>server\n"
-    html "</select><br>\n"
-}
\ No newline at end of file
+    if {![string compare $curSort score]} {
+        html "<option>score\n"
+        html "<option>server\n"
+    } else {
+        html "<option>server\n"
+        html "<option>score\n"
+    }
+    html "</select></b><br></dl>\n"
+
+    set useIcons 0
+    button-main
+
+    catch maintenance
+}
+
+