1 | ###########################################################################
|
---|
2 | #
|
---|
3 | # talkback.pm --
|
---|
4 | # A component of the Greenstone digital library software
|
---|
5 | # from the New Zealand Digital Library Project at the
|
---|
6 | # University of Waikato, New Zealand.
|
---|
7 | #
|
---|
8 | # Copyright (C) 1999 New Zealand Digital Library Project
|
---|
9 | #
|
---|
10 | # This program is free software; you can redistribute it and/or modify
|
---|
11 | # it under the terms of the GNU General Public License as published by
|
---|
12 | # the Free Software Foundation; either version 2 of the License, or
|
---|
13 | # (at your option) any later version.
|
---|
14 | #
|
---|
15 | # This program is distributed in the hope that it will be useful,
|
---|
16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
18 | # GNU General Public License for more details.
|
---|
19 | #
|
---|
20 | # You should have received a copy of the GNU General Public License
|
---|
21 | # along with this program; if not, write to the Free Software
|
---|
22 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
---|
23 | #
|
---|
24 | ###########################################################################
|
---|
25 |
|
---|
26 | package talkback;
|
---|
27 |
|
---|
28 | use strict;
|
---|
29 |
|
---|
30 |
|
---|
31 | sub generate_upload_form
|
---|
32 | {
|
---|
33 | my ($uniq_file) = @_;
|
---|
34 |
|
---|
35 | my $upload_html_form = <<EOF
|
---|
36 |
|
---|
37 | <html>
|
---|
38 | <head>
|
---|
39 | </head>
|
---|
40 | <body>
|
---|
41 | <form name="defaultForm"
|
---|
42 | action="talkback-progressbar.pl"
|
---|
43 | enctype="multipart/form-data" method="post">
|
---|
44 | <input type="hidden" name="yes_upload" value="1" />
|
---|
45 | <input type="hidden" name="process" value="1" />
|
---|
46 |
|
---|
47 | <p>
|
---|
48 | <input type="file" size="50" name="uploadedfile" />
|
---|
49 | <span style="font-size:20pt; font-weight:bold;">→</span>
|
---|
50 | <input type="submit" value="Upload File" />
|
---|
51 | </p>
|
---|
52 |
|
---|
53 | <script language="Javascript">
|
---|
54 | setInterval("check_status(['check_upload__1', 'xx', 'uploadedfile'], ['statusbar']);", '1000');
|
---|
55 | </script>
|
---|
56 |
|
---|
57 | </form>
|
---|
58 |
|
---|
59 |
|
---|
60 | <div id="statusbar"></div>
|
---|
61 | </body>
|
---|
62 | </html>
|
---|
63 |
|
---|
64 | EOF
|
---|
65 | ;
|
---|
66 |
|
---|
67 | return $upload_html_form;
|
---|
68 | }
|
---|
69 |
|
---|
70 | sub generate_upload_form_progressbar
|
---|
71 | {
|
---|
72 | my ($uniq_file) = @_;
|
---|
73 |
|
---|
74 | my $upload_html_form = <<EOF
|
---|
75 |
|
---|
76 | <html>
|
---|
77 | <head>
|
---|
78 | </head>
|
---|
79 | <body>
|
---|
80 |
|
---|
81 |
|
---|
82 | <form name="talkbackUploadPB"
|
---|
83 | action="talkback-progressbar.pl"
|
---|
84 | enctype="multipart/form-data" method="post">
|
---|
85 | <input type="hidden" name="uploadedfile" value="$uniq_file" />
|
---|
86 | <input type="hidden" name="xx" value="$uniq_file" />
|
---|
87 | </form>
|
---|
88 |
|
---|
89 |
|
---|
90 | <script type="text/javascript">
|
---|
91 | setInterval("check_status(['check_upload__1', 'xx', 'uploadedfile'], ['statusbar']);", '1000');
|
---|
92 |
|
---|
93 | </script>
|
---|
94 |
|
---|
95 | <div style="width: 380px;" id="statusbar">status bar:</div>
|
---|
96 | </body>
|
---|
97 | </html>
|
---|
98 |
|
---|
99 | EOF
|
---|
100 | ;
|
---|
101 |
|
---|
102 |
|
---|
103 | return $upload_html_form;
|
---|
104 | }
|
---|
105 |
|
---|
106 |
|
---|
107 |
|
---|
108 |
|
---|
109 | sub generate_done_html
|
---|
110 | {
|
---|
111 | my ($full_filename) = @_;
|
---|
112 |
|
---|
113 | my $done_html = <<EOF
|
---|
114 |
|
---|
115 | <html>
|
---|
116 | <head>
|
---|
117 | </head>
|
---|
118 | <body>
|
---|
119 | <h3>
|
---|
120 | File uploaded.
|
---|
121 | </h3>
|
---|
122 |
|
---|
123 | <hr />
|
---|
124 | <p>
|
---|
125 | <i>Server file: $full_filename</i>
|
---|
126 | </p>
|
---|
127 | </body>
|
---|
128 | </html>
|
---|
129 |
|
---|
130 | EOF
|
---|
131 | ;
|
---|
132 |
|
---|
133 | return $done_html;
|
---|
134 | }
|
---|
135 |
|
---|
136 | sub generate_malformed_args_html
|
---|
137 | {
|
---|
138 | my ($full_filename) = @_;
|
---|
139 |
|
---|
140 | my $done_html = <<EOF
|
---|
141 |
|
---|
142 | <html>
|
---|
143 | <head>
|
---|
144 | </head>
|
---|
145 | <body>
|
---|
146 | <h3>
|
---|
147 | Oops!
|
---|
148 | </h3>
|
---|
149 | <hr />
|
---|
150 | <p>
|
---|
151 | Malformed CGI arguments.
|
---|
152 | </p>
|
---|
153 | </body>
|
---|
154 | </html>
|
---|
155 |
|
---|
156 | EOF
|
---|
157 | ;
|
---|
158 |
|
---|
159 | return $done_html;
|
---|
160 | }
|
---|
161 |
|
---|
162 |
|
---|
163 | 1;
|
---|