Work on HTML3 detection. Tables are used to display history.
[egate.git] / www / z39util.tcl
index 6860b16..e703062 100644 (file)
@@ -1,5 +1,5 @@
 #
-# $Id: z39util.tcl,v 1.26 1996/01/26 15:50:11 adam Exp $
+# $Id: z39util.tcl,v 1.27 1996/01/26 17:41:26 adam Exp $
 #
 proc saveState {} {
     uplevel #0 {
@@ -949,35 +949,73 @@ proc z39history {} {
     global env
     global sessionId
     global targets
+    global html3
 
     if {![info exists nextSetNo]} {
         return
     }
-    html "<h2>History</h2><dl><br>\n"
+    html "<h2>History</h2><br>\n"
+    if {$html3} {
+        html {<table width=500 border=1><tr>}
+        html {<td align=left><b>Target</b>}
+        html {<td align=left><b>Database</b>}
+        html {<td align=right><b>Hits</b>}
+        html {<td><b>Query</b>}
+        html {<tr>} "\n"
+    } else {
+        html {<dl>} "\n"
+    }
     for {set setNo 1} {$setNo < $nextSetNo} {incr setNo} {
         if {$hist($setNo,scan) > 0} continue
         set host $hist($setNo,host)
-        html {<dt> } [lindex $targets($host) 0]
-        if {[llength [lindex $targets($host) 1]] > 1} {
-            html ": "
-            foreach b $hist($setNo,database) {
-                html " $b"
+        if {$html3} {
+            html {<td align=left>}
+        } else {
+            html {<dt> }
+        }
+        html [lindex $targets($host) 0]
+        if {$html3} {
+            html {<td align=left>} [join $hist($setNo,database)]
+        } else {
+            if {[llength [lindex $targets($host) 1]] > 1} {
+                html ": "
+                foreach b $hist($setNo,database) {
+                    html " $b"
+                }
             }
+            html {. }
+        }
+        if {$html3} {
+            html {<td align=right>}
         }
-        html {. }
-
         if {[info exists hist($setNo,hits)]} {
             html { <a href="http:} $env(SCRIPT_NAME)
             html / $sessionId {/search.egw/} $setNo + 1
             html + $hist($setNo,maxPresent)
-            html {">Result</a>: } $hist($setNo,hits) { hits.}
+            if {1} {
+                html {">} $hist($setNo,hits) {</a>}
+            } else {
+                html {">Result</a>: } $hist($setNo,hits) { hits.}
+            }
         } else {
-            html {Search failed.}
+            if {$html3} {
+                html {Failed}
+            } else {
+                html {Search failed.}
+            }
+        }
+        if {$html3} {
+            html {<td align=left>}
+        } else {
+            html "<dd>\n"
         }
-        html "<dd>\n"
         html { <a href="http:} $env(SCRIPT_NAME)
-        html / $sessionId {/query.egw/} $host + $setNo 
-        html {">Query</a>: }
+        html / $sessionId {/query.egw/} $host + $setNo
+        if {$html3} {
+            html {">}
+        } else {
+            html {">Query</a>: }
+        }
         set op {}
         for {set i 1} {$i <= 3} {incr i} {
             if {[string length $hist($setNo,form,entry$i)] > 0} {
@@ -987,8 +1025,16 @@ proc z39history {} {
                 set op $hist($setNo,form,logic$i)
             }
         }
+        if {$html3} {
+            html {</a><tr>} "\n"
+        }
     }
-    html "</dl>\n"
+    if {$html3} {
+        html {</table><p>}
+    } else {
+        html {</dl>}
+    }
+    html "\n"
 }
 
 proc displayError {msga msgb} {
@@ -1003,10 +1049,11 @@ proc displayError {msga msgb} {
 
 proc button-europagate {} {
     global useIcons
+    html {<a href="http://europagate.dtv.dk/">}
     if {$useIcons} {
         html {<img src="/egwgif/button-egw.gif" alt="Europagate" border=0></a>}
     } else {
-        html {Europagate | }
+        html {Europagate</a> | }
     }
 }