Attempt to inform user if session has really terminated.
[egate.git] / www / targets.egw
1 <html>
2 {
3 # $Id: targets.egw,v 1.24 1996/03/14 11:50:49 adam Exp $
4     source ztargets.conf
5     if {![info exists debug]} {
6         if {[lindex $sessionParms 1] == "1"} {
7             set debug 1
8         } else {
9             set debug 0
10         }
11     }
12     if {[info commands saveState] == ""} {
13         source z39util.tcl
14     }
15     set html3 [lindex $sessionParms 0]
16     if {[string length $html3] == 0} {
17         if {![info exists env(HTTP_USER_AGENT)]} {
18             set html3 1
19         } elseif {[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 scriptQuery query.egw
34     set scriptTarget targets.egw
35
36     set useIcons 1
37
38     button-main
39     if {[info exists nextSetNo]} {
40         button-view-history
41     }
42     button-define-target
43     html "<h2>Select a target</h2><br>\n"
44     html "<dl>\n"
45
46     if {1} {
47     proc headlineC {h} {
48         html {<dt><h2>} $h \n {</h2>}
49     }
50     proc targetC {t} {
51         global targets
52         global env
53         global sessionId
54
55         html {<dt><b><a href="http:} $env(SCRIPT_NAME) /
56         html "$sessionId/query.egw;/-1+$t" {"> } [lindex $targets($t) 0]
57         html {</a></b>}
58
59         html {<dd>}
60         set desc [lindex $targets($t) 4]
61         if {[string length $desc] > 0} {
62             html "$desc<br>\n"
63         }
64         html "<br>\n"
65     }
66     serverList headlineC targetC
67
68     } else {
69     proc targetsCmp {l r} {
70         global targets
71         return [string compare [string tolower [lindex $targets($l) 0]] \
72                                [string tolower [lindex $targets($r) 0]]]
73     }
74     set tt [array names targets]
75     set tn [lsort -command targetsCmp $tt]
76     foreach t $tn {
77         html {<dt><a href="http:} $env(SCRIPT_NAME) /
78         html "$sessionId/query.egw;/-1+$t" {"> } [lindex $targets($t) 0]
79         html " </a>\n"
80         set desc [lindex $targets($t) 4]
81         if {$desc != ""} {
82             html "<dd>$desc\n"
83         }
84     }
85     }
86     html "</dl><br>\n"
87     set useIcons 0
88     button-main 
89     if {[info exists nextSetNo]} {
90         button-view-history
91     }
92     button-define-target
93 }
94 {
95     catch maintenance
96     global debug
97     if {!$debug} return
98     html "<hr>\n"
99     html "<h3>Debug information</h3>\n"
100     html "sessionId: $sessionId <br>\n"
101     html "sessionParms: $sessionParms <br>\n"
102     foreach n [array names env] {
103         html "env($n) = " $env($n) " <br>\n"
104     }
105 }
106 </body>
107 </html>