summaryrefslogtreecommitdiff
path: root/web/cgi/alpine/1.0/queryattach.tcl
blob: 9cd7028c482a77bc18e7a3e422de0546f76392ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#!./tclsh
# $Id: queryattach.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
# ========================================================================
# Copyright 2006 University of Washington
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# ========================================================================

#  queryattach.tcl
#
#  Purpose:  CGI script to generate html form used to ask for 
#            attachment to composition

#  Input:

#  Output:
#
#	HTML/CSS data representing the form

# inherit global config
source ./alpine.tcl
source cmdfunc.tcl

# make sure form's in Unicode
set charset "UTF-8"

set query_menu {
  {
    {}
    {
      {
	cgi_puts "Get Help"
      }
    }
  }
  {
    {expr 0}
    {
      {
	# * * * * OK * * * *
	cgi_submit_button "attach=Add Attachment" class="navbar"
      }
    }
  }
  {
    {expr 0}
    {
      {
	# * * * * CANCEL * * * *
	cgi_submit_button cancel=Cancel class="navbar"
      }
    }
  }
  {
    {expr 0}
    {
      {
	# * * * * Address/Cancel * * * *
	cgi_submit_button doit=Done class="navbar"
	cgi_br
	cgi_select attachop class=navtext {
	  cgi_option "Action..." value=null
	  cgi_option Attach value=attach
	  cgi_option Cancel value=cancel
	}
      }
    }
  }
}

WPEval {} {

  cgi_http_head {
    WPStdHttpHdrs "text/html; charset=\"$charset\""
  }

  cgi_html {
    cgi_head {
      cgi_http_equiv Content-Type "text/html; charset=$charset"
      WPStdHtmlHdr "Attach"
      WPStyleSheets
      cgi_put  "<style type='text/css'>"
      cgi_put  ".filename	{ font-family: Courier, monospace ; font-size: 10pt }"
      cgi_puts "</style>"
    }

    cgi_body BGCOLOR="$_wp(bordercolor)" {
      cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=post enctype=multipart/form-data target=_top {
	cgi_text page=attach type=hidden notab
	cgi_text cid=[WPCmd PEInfo key] type=hidden notab
	if {[info exists params]} {
	  foreach p $params {
	    cgi_text "[lindex $p 0]=[lindex $p 1]" type=hidden notab
	  }
	}

	cgi_table border=0 cellpadding=0 cellspacing=0 width="100%" height="100%" {
	  cgi_table_row {
	    eval {
	      cgi_table_data $_wp(menuargs) {
		WPTFCommandMenu query_menu {}
	      }
	    }

	    cgi_table_data align=center valign=top class=dialog {
	      cgi_table border=0 width=75% cellpadding=15 {
		cgi_table_row {
		  cgi_table_data align=center {
		    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."
		  }
		}
		cgi_table_row {
		  cgi_table_data align=center {
		    cgi_file_button file "accept=*/*" size=30 class=filename
		  }
		}
		cgi_table_row {
		  cgi_table_data align=center {
		    cgi_puts "You can also provide a short description to help the message's recipient figure out what the attachment is :"
		  }
		}
		cgi_table_row {
		  cgi_table_data align=center {
		    cgi_text description= maxlength=256 size=40 class=filename
		  }
		}
		cgi_table_row {
		  cgi_table_data align=center {
		    cgi_submit_button "attach=Add Attachment"
		    cgi_submit_button cancel=Cancel
		  }
		}
	      }
	    }
	  }
	}
      }
    }
  }
}