Work on HTML3 detection. Tables are used to display history.
[egate.git] / www / targets.egw
1 <html>
2 {
3 # $Id: targets.egw,v 1.19 1996/01/26 17:41:26 adam Exp $
4     source ztargets.conf
5     if {[info commands saveState] == ""} {
6         source z39util.tcl
7     }
8     set mMode 0
9
10     if {![info exists debug]} {
11         if {[lindex $sessionParms 1] == "1"} {
12             set debug 1
13         } else {
14             set debug 0
15         }
16     }
17     set html3 [lindex $sessionParms 0]
18     if {$html3 == ""} {
19         if {[string first Mozilla $env(HTTP_USER_AGENT)] == 0} {
20             set html3 1
21             egw_log debug "New user using Netscape"
22         } else {
23             set html3 0
24             egw_log debug "New user Not using Netscape"
25         }
26     }
27 }
28 <head>
29 <title> Europagate, WWW/Z39.50 Gateway </title>
30 </head>
31 <body>
32 {
33     set useIcons 1
34
35     button-europagate
36     if {[info exists nextSetNo]} {
37         button-view-history 1
38     }
39     button-define-target 0
40     html "<h2>Choose a target</h2><br>\n"
41     html "<dl>\n"
42
43     proc targetsCmp {l r} {
44         global targets
45         return [string compare [string tolower [lindex $targets($l) 0]] \
46                                [string tolower [lindex $targets($r) 0]]]
47     }
48     set tt [array names targets]
49     set tn [lsort -command targetsCmp $tt]
50     foreach t $tn {
51         if {[string index $t 0] == "."} continue
52         html {<dt><a href="http:} $env(SCRIPT_NAME) /
53         html "$sessionId/query.egw;/$t" {"> } [lindex $targets($t) 0] " </a>\n"
54         set desc [lindex $targets($t) 4]
55         if {$desc != ""} {
56             html "<dd>$desc\n"
57         }
58     }
59     html "</dl><br>\n"
60     set useIcons 0
61     button-europagate 
62     if {[info exists nextSetNo]} {
63         button-view-history 1
64     }
65     button-define-target 0
66 }
67 {
68     catch maintenance
69     global debug
70     if {!$debug} return
71     html "<hr>\n"
72     html "<h3>Debug information</h3>\n"
73     html "sessionId: $sessionId <br>\n"
74     html "sessionParms: $sessionParms <br>\n"
75     foreach n [array names env] {
76         html "env($n) = " $env($n) " <br>\n"
77     }
78 }
79 </body>
80 </html>