@@ -40,7 +40,7 @@ public function __construct() {
40
40
self ::$ status = '.zip or .gz files found, ready for extraction ' ;
41
41
}
42
42
else {
43
- self ::$ status = '<span style="color:red; font-weight:bold;font-size:120%; ">Error: No .zip or .gz files found.</span> ' ;
43
+ self ::$ status = '<span class="status--ERROR ">Error: No .zip or .gz files found.</span> ' ;
44
44
}
45
45
}
46
46
@@ -87,7 +87,7 @@ public static function extract($archive, $destination) {
87
87
public static function extractZipArchive ($ archive , $ destination ) {
88
88
// Check if webserver supports unzipping.
89
89
if (!class_exists ('ZipArchive ' )) {
90
- self ::$ status = '<span style="color:red; font-weight:bold;font-size:120%; ">Error: Your PHP version does not support unzip functionality.</span> ' ;
90
+ self ::$ status = '<span class="status--ERROR ">Error: Your PHP version does not support unzip functionality.</span> ' ;
91
91
return ;
92
92
}
93
93
@@ -99,14 +99,14 @@ public static function extractZipArchive($archive, $destination) {
99
99
if (is_writeable ($ destination . '/ ' )) {
100
100
$ zip ->extractTo ($ destination );
101
101
$ zip ->close ();
102
- self ::$ status = '<span style="color:green; font-weight:bold;font-size:120%; ">Files unzipped successfully</span> ' ;
102
+ self ::$ status = '<span class="status--OK ">Files unzipped successfully</span> ' ;
103
103
}
104
104
else {
105
- self ::$ status = '<span style="color:red; font-weight:bold;font-size:120%; ">Error: Directory not writeable by webserver.</span> ' ;
105
+ self ::$ status = '<span class="status--ERROR ">Error: Directory not writeable by webserver.</span> ' ;
106
106
}
107
107
}
108
108
else {
109
- self ::$ status = '<span style="color:red; font-weight:bold;font-size:120%; ">Error: Cannot read .zip archive.</span> ' ;
109
+ self ::$ status = '<span class="status--ERROR ">Error: Cannot read .zip archive.</span> ' ;
110
110
}
111
111
}
112
112
@@ -119,7 +119,7 @@ public static function extractZipArchive($archive, $destination) {
119
119
public static function extractGzipFile ($ archive , $ destination ) {
120
120
// Check if zlib is enabled
121
121
if (!function_exists ('gzopen ' )) {
122
- self ::$ status = '<span style="color:red; font-weight:bold;font-size:120%; ">Error: Your PHP has no zlib support enabled.</span> ' ;
122
+ self ::$ status = '<span class="status--ERROR ">Error: Your PHP has no zlib support enabled.</span> ' ;
123
123
return ;
124
124
}
125
125
@@ -135,10 +135,10 @@ public static function extractGzipFile($archive, $destination) {
135
135
136
136
// Check if file was extracted.
137
137
if (file_exists ($ destination . '/ ' . $ filename )) {
138
- self ::$ status = '<span style="color:green; font-weight:bold;font-size:120%; ">File unzipped successfully.</span> ' ;
138
+ self ::$ status = '<span class="status--OK ">File unzipped successfully.</span> ' ;
139
139
}
140
140
else {
141
- self ::$ status = '<span style="color:red; font-weight:bold;font-size:120%; ">Error unzipping file.</span> ' ;
141
+ self ::$ status = '<span class="status--ERROR ">Error unzipping file.</span> ' ;
142
142
}
143
143
144
144
}
@@ -147,6 +147,7 @@ public static function extractGzipFile($archive, $destination) {
147
147
?>
148
148
149
149
<!DOCTYPE html>
150
+ <html>
150
151
<head>
151
152
<title>File Unzipper</title>
152
153
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
@@ -157,8 +158,13 @@ public static function extractGzipFile($archive, $destination) {
157
158
line-height: 150%;
158
159
}
159
160
161
+ label {
162
+ display: block;
163
+ margin-top: 20px;
164
+ }
165
+
160
166
fieldset {
161
- border: 0px solid #000 ;
167
+ border: 0 ;
162
168
}
163
169
164
170
.select {
@@ -174,72 +180,62 @@ public static function extractGzipFile($archive, $destination) {
174
180
border: 1px dotted #DDD;
175
181
}
176
182
183
+ .status--ERROR {
184
+ color: red;
185
+ font-weight: bold;
186
+ font-size: 120%;
187
+ }
188
+
189
+ .status--OK {
190
+ color: green;
191
+ font-weight: bold;
192
+ font-size: 120%
193
+ }
194
+
177
195
.form-field {
178
- border: 2px solid black;
179
- -webkit-border-radius: 10px;
180
- -moz-border-radius: 10px;
181
- border-radius: 10px;
182
- -webkit-box-shadow: rgba(255, 255, 255, 0.4) 0 0px 0, inset rgba(000, 000, 000, 0.7) 0 0px 0px;
183
- -moz-box-shadow: rgba(255, 255, 255, 0.4) 0 0px 0, inset rgba(000, 000, 000, 0.7) 0 0px 0px;
184
- box-shadow: rgba(255, 255, 255, 0.4) 0 0px 0, inset rgba(000, 000, 000, 0.7) 0 0px 0px;
196
+ border: 1px solid #AAA;
185
197
padding: 8px;
186
- margin-bottom: 20px;
187
198
width: 280px;
188
199
}
189
200
201
+ .info {
202
+ margin-top: 0;
203
+ font-size: 80%;
204
+ color: #777;
205
+ }
206
+
190
207
.submit {
191
- -moz-box-shadow: inset 0px 1px 0px 0px #bbdaf7;
192
- -webkit-box-shadow: inset 0px 1px 0px 0px #bbdaf7;
193
- box-shadow: inset 0px 1px 0px 0px #bbdaf7;
194
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #79bbff), color-stop(1, #378de5));
195
- background: -moz-linear-gradient(center top, #79bbff 5%, #378de5 100%);
196
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#79bbff', endColorstr='#378de5');
197
- background-color: #79bbff;
198
- -moz-border-radius: 4px;
199
- -webkit-border-radius: 4px;
200
- border-radius: 4px;
201
- border: 1px solid #84bbf3;
202
- display: inline-block;
208
+ background-color: #378de5;
209
+ border: 0;
203
210
color: #ffffff;
204
- font-family: arial;
205
211
font-size: 15px;
206
- font-weight: bold;
207
212
padding: 10px 24px;
213
+ margin: 20px 0 20px 0;
208
214
text-decoration: none;
209
- text-shadow: 1px 1px 0px #528ecc;
210
215
}
211
216
212
217
.submit:hover {
213
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #378de5), color-stop(1, #79bbff));
214
- background: -moz-linear-gradient(center top, #378de5 5%, #79bbff 100%);
215
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#378de5', endColorstr='#79bbff');
216
- background-color: #378de5;
217
- }
218
-
219
- .submit:active {
220
- position: relative;
221
- top: 1px;
218
+ background-color: #2c6db2;
219
+ cursor: pointer;
222
220
}
223
221
-->
224
222
</style>
225
223
</head>
226
224
<body>
227
225
<h1>Archive Unzipper</h1>
228
- <p>Select .zip archive or .gz file you want to extract:</p>
229
226
<form action="" method="POST">
230
227
<fieldset>
228
+ <label for="zipfile">Select .zip archive or .gz file you want to extract:</label>
231
229
<select name="zipfile" size="1" class="select">
232
230
<?php foreach ($ arc ->zipfiles as $ zip ) {
233
231
echo "<option> $ zip</option> " ;
234
232
}
235
233
?>
236
234
</select>
237
- <br/>
238
- <br/>
235
+ <label for="extpath">Extraction path (optional):</label>
239
236
<input type="text" name="extpath" class="form-field"
240
- placeholder="extraction_path"/>
241
- <label>Optional, if blank current dir will be used.</label>
242
- <br/>
237
+ placeholder="mypath"/>
238
+ <p class="info">Enter extraction path without leading or trailing slashes (e.g. "mypath"). If left blank current directory will be used.</p>
243
239
<input type="submit" name="submit" class="submit" value="Unzip Archive"/>
244
240
</fieldset>
245
241
</form>
0 commit comments