~ubuntu-branches/debian/squeeze/alpine/squeeze

« back to all changes in this revision

Viewing changes to web/cgi/alpine/queryattach.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: queryattach.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
#  queryattach.tcl
 
15
#
 
16
#  Purpose:  CGI script to generate html form used to ask for 
 
17
#            attachment to composition
 
18
 
 
19
#  Input:
 
20
 
 
21
#  Output:
 
22
#
 
23
#       HTML/CSS data representing the form
 
24
 
 
25
# inherit global config
 
26
source ./alpine.tcl
 
27
source cmdfunc.tcl
 
28
 
 
29
# make sure form's in Unicode
 
30
set charset "UTF-8"
 
31
 
 
32
set query_menu {
 
33
  {
 
34
    {}
 
35
    {
 
36
      {
 
37
        cgi_puts "Get Help"
 
38
      }
 
39
    }
 
40
  }
 
41
  {
 
42
    {expr 0}
 
43
    {
 
44
      {
 
45
        # * * * * OK * * * *
 
46
        cgi_submit_button "attach=Add Attachment" class="navbar"
 
47
      }
 
48
    }
 
49
  }
 
50
  {
 
51
    {expr 0}
 
52
    {
 
53
      {
 
54
        # * * * * CANCEL * * * *
 
55
        cgi_submit_button cancel=Cancel class="navbar"
 
56
      }
 
57
    }
 
58
  }
 
59
  {
 
60
    {expr 0}
 
61
    {
 
62
      {
 
63
        # * * * * Address/Cancel * * * *
 
64
        cgi_submit_button doit=Done class="navbar"
 
65
        cgi_br
 
66
        cgi_select attachop class=navtext {
 
67
          cgi_option "Action..." value=null
 
68
          cgi_option Attach value=attach
 
69
          cgi_option Cancel value=cancel
 
70
        }
 
71
      }
 
72
    }
 
73
  }
 
74
}
 
75
 
 
76
WPEval {} {
 
77
 
 
78
  cgi_http_head {
 
79
    WPStdHttpHdrs "text/html; charset=\"$charset\""
 
80
  }
 
81
 
 
82
  cgi_html {
 
83
    cgi_head {
 
84
      cgi_http_equiv Content-Type "text/html; charset=$charset"
 
85
      WPStdHtmlHdr "Attach"
 
86
      WPStyleSheets
 
87
      cgi_put  "<style type='text/css'>"
 
88
      cgi_put  ".filename       { font-family: Courier, monospace ; font-size: 10pt }"
 
89
      cgi_puts "</style>"
 
90
    }
 
91
 
 
92
    cgi_body BGCOLOR="$_wp(bordercolor)" {
 
93
      cgi_form $_wp(appdir)/wp method=post enctype=multipart/form-data target=_top {
 
94
        cgi_text page=attach type=hidden notab
 
95
        cgi_text cid=[WPCmd PEInfo key] type=hidden notab
 
96
        if {[info exists params]} {
 
97
          foreach p $params {
 
98
            cgi_text "[lindex $p 0]=[lindex $p 1]" type=hidden notab
 
99
          }
 
100
        }
 
101
 
 
102
        cgi_table border=0 cellpadding=0 cellspacing=0 width="100%" height="100%" {
 
103
          cgi_table_row {
 
104
            eval {
 
105
              cgi_table_data $_wp(menuargs) {
 
106
                WPTFCommandMenu query_menu {}
 
107
              }
 
108
            }
 
109
 
 
110
            cgi_table_data align=center valign=top class=dialog {
 
111
              cgi_table border=0 width=75% cellpadding=15 {
 
112
                cgi_table_row {
 
113
                  cgi_table_data align=center {
 
114
                    cgi_puts "To attach a file to your message, enter its path and file name below, or use the [cgi_italic Browse] button to choose the file, then click [cgi_italic "Add Attachment"], or click [cgi_italic Cancel] to return to your composition without attaching anything."
 
115
                  }
 
116
                }
 
117
                cgi_table_row {
 
118
                  cgi_table_data align=center {
 
119
                    cgi_file_button file "accept=*/*" size=30 class=filename
 
120
                  }
 
121
                }
 
122
                cgi_table_row {
 
123
                  cgi_table_data align=center {
 
124
                    cgi_puts "You can also provide a short description to help the message's recipient figure out what the attachment is :"
 
125
                  }
 
126
                }
 
127
                cgi_table_row {
 
128
                  cgi_table_data align=center {
 
129
                    cgi_text description= maxlength=256 size=40 class=filename
 
130
                  }
 
131
                }
 
132
                cgi_table_row {
 
133
                  cgi_table_data align=center {
 
134
                    cgi_submit_button "attach=Add Attachment"
 
135
                    cgi_submit_button cancel=Cancel
 
136
                  }
 
137
                }
 
138
              }
 
139
            }
 
140
          }
 
141
        }
 
142
      }
 
143
    }
 
144
  }
 
145
}