~ubuntu-branches/debian/stretch/alpine/stretch

« back to all changes in this revision

Viewing changes to web/cgi/alpine/comview.tcl

  • Committer: Bazaar Package Importer
  • Author(s): Asheesh Laroia
  • Date: 2007-02-17 13:17:42 UTC
  • Revision ID: james.westby@ubuntu.com-20070217131742-99x5c6cpg1pbkdhw
Tags: upstream-0.82+dfsg
ImportĀ upstreamĀ versionĀ 0.82+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!./tclsh
 
2
# $Id: comview.tcl 391 2007-01-25 03:53:59Z mikes@u.washington.edu $
 
3
# ========================================================================
 
4
# Copyright 2006 University of Washington
 
5
#
 
6
# Licensed under the Apache License, Version 2.0 (the "License");
 
7
# you may not use this file except in compliance with the License.
 
8
# You may obtain a copy of the License at
 
9
#
 
10
#     http://www.apache.org/licenses/LICENSE-2.0
 
11
#
 
12
# ========================================================================
 
13
 
 
14
# comview.tcl
 
15
#
 
16
# Purpose:  CGI script to produce the common view commands frame
 
17
 
 
18
# Input:
 
19
set comview_vars {
 
20
  {f_colid      {}      [WPCmd PEFolder isincoming 0]}
 
21
  {f_name       {}      "saved-messages"}
 
22
}
 
23
 
 
24
# inherit global config
 
25
source ./alpine.tcl
 
26
source ./cmdfunc.tcl
 
27
 
 
28
WPEval $comview_vars {
 
29
  cgi_http_head {
 
30
    WPStdHttpHdrs {} 60
 
31
  }
 
32
 
 
33
  cgi_html {
 
34
    cgi_head {
 
35
      if {[info exists _wp(exitonclose)]} {
 
36
        WPExitOnClose top.spec.body
 
37
      }
 
38
 
 
39
      WPStyleSheets
 
40
      cgi_put  "<style type='text/css'>"
 
41
      cgi_put  ".viewop { font-family: arial, sans-serif; font-size: 7pt }"
 
42
      cgi_puts "</style>"
 
43
      if {$_wp(keybindings)} {
 
44
        set kequiv {
 
45
          {{?} {top.location = 'wp.tcl?page=help'}}
 
46
          {{l} {top.location = 'wp.tcl?page=folders'}}
 
47
          {{a} {top.location = 'wp.tcl?page=addrbook'}}
 
48
          {{n} {top.spec.body.location = 'wp.tcl?page=view&bod_next=1'}}
 
49
          {{p} {top.spec.body.location = 'wp.tcl?page=view&bod_prev=1'}}
 
50
          {{i} {top.spec.location = 'fr_index.tcl'}}
 
51
          {{s} {document.saveform.f_name.focus()}}
 
52
          {{d} {document.delform.op[0].click()}}
 
53
          {{u} {document.delform.op[1].click()}}
 
54
          {{r} {document.replform.op.click()}}
 
55
          {{f} {document.forwform.op.click()}}
 
56
        }
 
57
        
 
58
        lappend kequiv [list {c} "top.location = 'wp.tcl?page=compose&oncancel=main.tcl&cid=[WPCmd PEInfo key]'"]
 
59
 
 
60
        if {[WPCmd PEInfo feature enable-full-header-cmd]} {
 
61
          lappend kequiv [list {h} "top.spec.body.location = 'wp.tcl?page=view&fullhdr=flip'"]
 
62
        }
 
63
 
 
64
        set onload "onLoad=[WPTFKeyEquiv $kequiv document.saveform.f_name top.spec.body]"
 
65
      }
 
66
    }
 
67
 
 
68
    cgi_body bgcolor=$_wp(bordercolor) background=[file join $_wp(imagepath) logo $_wp(logodir) back.gif] "style=\"background-repeat: repeat-x\"" $onload {
 
69
      cgi_table class=ops cellpadding=0 cellspacing=0 border=0 width="100%" height=24 {
 
70
        cgi_table_row {
 
71
          cgi_table_data valign=middle align=left nowrap class=viewop {
 
72
            cgi_form $_wp(appdir)/wp method=get target=_top name=replform {
 
73
              cgi_text "page=view" type=hidden notab
 
74
              cgi_text "cid=[WPCmd PEInfo key]" type=hidden notab
 
75
              cgi_text "oncancel=main.tcl" type=hidden notab
 
76
              cgi_text "postpost=fr_main.tcl" type=hidden notab
 
77
 
 
78
              cgi_table border=0 class=ops cellpadding=0 cellspacing=0 class=viewop {
 
79
                cgi_table_row {
 
80
                  cgi_table_data class=viewop rowspan=2 {
 
81
                    # * * * * REPLY * * * *
 
82
                    cgi_submit_button op=Reply class="viewop" "style=\"vertical-align: middle; margin-left: 4\""
 
83
                  }
 
84
                  cgi_table_data class=viewop {
 
85
                    cgi_checkbox "repall=1" style=vertical-align:middle
 
86
                    cgi_put "To All[cgi_nbspace]"
 
87
                  }
 
88
                }
 
89
                cgi_table_row {
 
90
                  cgi_table_data class=viewop rowspan=2 {
 
91
                    cgi_checkbox "reptext=1" checked style=vertical-align:middle
 
92
                    cgi_put "Include text"
 
93
                  }
 
94
                }
 
95
              }
 
96
            }
 
97
          }
 
98
 
 
99
          cgi_table_data valign=middle align=center {
 
100
            cgi_put [cgi_img [WPimg blackdot] width=1 height=26]
 
101
          }
 
102
 
 
103
          cgi_table_data valign=middle align=center nowrap {
 
104
            cgi_form $_wp(appdir)/wp method=get target=_top name=forwform {
 
105
              cgi_text "page=view" type=hidden notab
 
106
              cgi_text "cid=[WPCmd PEInfo key]" type=hidden notab
 
107
              cgi_text "oncancel=main.tcl" type=hidden notab
 
108
              cgi_text "postpost=fr_main.tcl" type=hidden notab
 
109
 
 
110
              # * * * * FORWARD * * * *
 
111
              cgi_submit_button op=Forward class="viewop"
 
112
            }
 
113
          }
 
114
 
 
115
          cgi_table_data valign=middle align=center {
 
116
            cgi_put [cgi_img [WPimg blackdot] width=1 height=26]
 
117
          }
 
118
 
 
119
          cgi_table_data valign=middle align=center nowrap class=viewop {
 
120
            cgi_table class=ops cellpadding=0 cellspacing=0 border=0 class=viewop {
 
121
              cgi_table_row {
 
122
                cgi_table_data class=viewop {
 
123
                  cgi_form $_wp(appdir)/wp method=get target=spec name=saveform  {
 
124
                    cgi_text "page=fr_view" type=hidden notab
 
125
                    cgi_text "cid=[WPCmd PEInfo key]" type=hidden notab
 
126
                    cgi_text "sid=[clock seconds]" type=hidden notab
 
127
 
 
128
                    # * * * * Save * * * *
 
129
                    cgi_submit_button "save=Save" class="viewop"
 
130
                    cgi_put "[cgi_nbspace]to "
 
131
 
 
132
                    cgi_text f_colid=$f_colid type=hidden notab
 
133
                    cgi_text op=save type=hidden notab
 
134
 
 
135
                    cgi_select f_name class=viewop style=vertical-align:middle "onchange=document.saveform.save.click(); return false;" {
 
136
                      foreach {oname oval} [WPTFGetSaveCache] {
 
137
                        cgi_option $oname value=$oval
 
138
                      }
 
139
                    }
 
140
                  }
 
141
                }
 
142
              }
 
143
            }
 
144
          }
 
145
 
 
146
          cgi_table_data valign=middle align=center {
 
147
            cgi_put [cgi_img [WPimg blackdot] width=1 height=26]
 
148
          }
 
149
 
 
150
          cgi_table_data valign=middle align=center nowrap {
 
151
            cgi_form $_wp(appdir)/wp method=get target=_top name=take {
 
152
              cgi_text "page=view" type=hidden notab
 
153
              cgi_text "cid=[WPCmd PEInfo key]" type=hidden notab
 
154
              cgi_submit_button op=Take class="viewop"
 
155
            }
 
156
          }
 
157
 
 
158
          cgi_table_data valign=middle align=center {
 
159
            cgi_put [cgi_img [WPimg blackdot] width=1 height=26]
 
160
          }
 
161
 
 
162
          cgi_table_data valign=middle align=right nowrap {
 
163
            cgi_form $_wp(appdir)/wp method=get target=body name=delform {
 
164
              cgi_text "page=view" type=hidden notab
 
165
              cgi_text "cid=[WPCmd PEInfo key]" type=hidden notab
 
166
 
 
167
              # * * * * UNDELETE * * * *
 
168
              cgi_submit_button op=Delete class="viewop"
 
169
 
 
170
              # * * * * UNDELETE * * * *
 
171
              cgi_submit_button op=Undelete class="viewop" "style=\"margin-right: 4\""
 
172
 
 
173
              # * * * * ANTISPAM * * * *
 
174
              if {([info exists _wp(spamaddr)] && [string length $_wp(spamaddr)])
 
175
                  || ([info exists _wp(spamfolder)] && [string length $_wp(spamfolder)])} {
 
176
                cgi_submit_button "op=Report Spam" class="viewop" "style=\"margin-right: 4; color: white; background-color: black\""
 
177
              }
 
178
            }
 
179
          }
 
180
        }
 
181
      }
 
182
    }
 
183
  }
 
184
}