Version Description
- full redesign of the upload algorithm to become more robust
- added improved server-side handling of large files
- plugin shortcodes can be edited using the Shortcode Composer
- added visual editor button on the plugin to enable administrators to change the plugin settings easily
- corrected bug causing sometimes database overloads
- slight improvements of subfolder option
- improvements to avoid code breaking in ajax calls when there are php warnings or echo from Wordpress environment or other plugins
- improvements and bug fixes in uploader when classic (no AJAX) upload is selected
- eliminated php warnings in shortcode composer
- corrected bug that was not correctly downloading files from the plugin's File Browser
- added better security when downloading files from the plugin's File Browser
- fixed bug not correctly showing the user that uploaded a file in the plugin's File Browser
- use of curl to perform server http requests was replaced by native php because some web servers do not have CURL installed
- corrected bug in shortcode composer where userdata fields were not shown in variables drop down
- added feature that prevents page closing if an upload is on progress
- added forcefilename attribute to avoid filename sanitization
- added ftppassivemode attribute for enabling FTP passive mode when FTP method is used for uploading
- added ftpfilepermissions attribute for defining the permissions of the uploaded file, when using FTP method
- javascript and css files are minified for faster loading
Download this release
Release Info
Developer | nickboss |
Plugin | WordPress File Upload |
Version | 2.6.0 |
Comparing to | |
See all releases |
Code changes from version 2.5.5 to 2.6.0
- css/wordpress_file_upload_adminstyle.css +1 -944
- css/wordpress_file_upload_reset.css +1 -47
- css/wordpress_file_upload_style.css +1 -728
- css/wordpress_file_upload_style_safe.css +1 -229
- images/pencil.svg +6 -0
- js/getElementsByClassName-1.0.1.js +1 -78
- js/json2.js +1 -480
- js/wordpress_file_upload_adminfunctions.js +2 -1781
- js/wordpress_file_upload_functions.js +2 -1391
- languages/wordpress-file-upload-fr_FR.mo +0 -0
- languages/wordpress-file-upload-fr_FR.po +164 -86
- languages/wordpress-file-upload.pot +143 -91
- lib/wfu_admin.php +142 -4
- lib/wfu_admin_browser.php +19 -4
- lib/wfu_admin_composer.php +44 -9
- lib/wfu_ajaxactions.php +153 -56
- lib/wfu_attributes.php +42 -0
- lib/wfu_constants.php +21 -1
- lib/wfu_functions.php +148 -18
- lib/wfu_io.php +15 -5
- lib/wfu_message.php +4 -4
- lib/wfu_processfiles.php +59 -33
- readme.txt +38 -5
- wfu_file_downloader.php +63 -0
- wfu_response.php +0 -1
- wordpress_file_upload.php +23 -6
css/wordpress_file_upload_adminstyle.css
CHANGED
@@ -1,944 +1 @@
|
|
1 |
-
div.wfu_shortcode_container
|
2 |
-
{
|
3 |
-
display: inline-block;
|
4 |
-
position: relative;
|
5 |
-
width: 50%;
|
6 |
-
padding: 0;
|
7 |
-
margin: 0;
|
8 |
-
background: none;
|
9 |
-
border: none;
|
10 |
-
}
|
11 |
-
|
12 |
-
textarea.wfu_shortcode
|
13 |
-
{
|
14 |
-
width: 100%;
|
15 |
-
}
|
16 |
-
|
17 |
-
div.wfu_container
|
18 |
-
{
|
19 |
-
margin-top: 10px;
|
20 |
-
}
|
21 |
-
|
22 |
-
div.wfu_help_container
|
23 |
-
{
|
24 |
-
display: inline-block;
|
25 |
-
position: relative;
|
26 |
-
top: 4px;
|
27 |
-
padding: 0;
|
28 |
-
margin: 0;
|
29 |
-
background: none;
|
30 |
-
border: none;
|
31 |
-
}
|
32 |
-
|
33 |
-
div.wfu_help_container img
|
34 |
-
{
|
35 |
-
visibility: hidden;
|
36 |
-
}
|
37 |
-
|
38 |
-
table.wfu_main_table th:hover div.wfu_help_container img
|
39 |
-
{
|
40 |
-
visibility: visible;
|
41 |
-
}
|
42 |
-
|
43 |
-
table.wfu_inner_table th:hover div.wfu_help_container img
|
44 |
-
{
|
45 |
-
visibility: visible;
|
46 |
-
}
|
47 |
-
|
48 |
-
div.wfu_restore_container
|
49 |
-
{
|
50 |
-
display: inline-block;
|
51 |
-
position: relative;
|
52 |
-
top: 4px;
|
53 |
-
padding: 0;
|
54 |
-
margin: 0;
|
55 |
-
background: none;
|
56 |
-
border: none;
|
57 |
-
}
|
58 |
-
|
59 |
-
div.wfu_restore_container img
|
60 |
-
{
|
61 |
-
visibility: hidden;
|
62 |
-
}
|
63 |
-
|
64 |
-
table.wfu_main_table th:hover div.wfu_restore_container img
|
65 |
-
{
|
66 |
-
visibility: visible;
|
67 |
-
}
|
68 |
-
|
69 |
-
table.wfu_inner_table th:hover div.wfu_restore_container img
|
70 |
-
{
|
71 |
-
visibility: visible;
|
72 |
-
}
|
73 |
-
|
74 |
-
div.wfu_td_div
|
75 |
-
{
|
76 |
-
display: block;
|
77 |
-
position: relative;
|
78 |
-
width: 100%;
|
79 |
-
height: 100%;
|
80 |
-
padding: 0;
|
81 |
-
margin: 0;
|
82 |
-
background: none;
|
83 |
-
border: none;
|
84 |
-
}
|
85 |
-
|
86 |
-
div.wfu_container input.wfu_long_text { width: 100%; }
|
87 |
-
div.wfu_container input.wfu_short_text { width: 60px; }
|
88 |
-
div.wfu_container input { width: 200px; }
|
89 |
-
div.wfu_container input[type="checkbox"] { width: auto; }
|
90 |
-
|
91 |
-
table.wfu_main_table { table-layout: fixed; }
|
92 |
-
|
93 |
-
table.wfu_inner_table { }
|
94 |
-
|
95 |
-
table.wfu_main_table tr:nth-child(odd) { background-color: #f4f4f4; }
|
96 |
-
|
97 |
-
table.wfu_main_table tr:nth-child(even) { background-color: transparent; }
|
98 |
-
|
99 |
-
table.wfu_main_table table.wfu_inner_table tr { background-color: transparent; }
|
100 |
-
|
101 |
-
table.wfu_main_table th { width: 17%; }
|
102 |
-
|
103 |
-
table.wfu_main_table td:nth-child(2) { width: 33%; }
|
104 |
-
|
105 |
-
table.wfu_main_table td:nth-child(3) { width: 50%; }
|
106 |
-
|
107 |
-
table.wfu_main_table table.wfu_inner_table th { width: 34%; }
|
108 |
-
|
109 |
-
table.wfu_main_table table.wfu_inner_table td:nth-child(2) { width: 66%; }
|
110 |
-
|
111 |
-
table.wfu_main_table tr.wfu_subcategory { background-color: #ddd; }
|
112 |
-
|
113 |
-
table.wfu_main_table tr.wfu_subcategory > th { padding-top: 0; padding-bottom: 0; }
|
114 |
-
|
115 |
-
select.wfu_variable
|
116 |
-
{
|
117 |
-
padding: 0px;
|
118 |
-
margin: 0px;
|
119 |
-
height: auto;
|
120 |
-
font-size: smaller;
|
121 |
-
background-color: #ddd;
|
122 |
-
border: 1px solid #ccc;
|
123 |
-
color: rgb(51, 51, 51);
|
124 |
-
-webkit-border-radius: 5px;
|
125 |
-
-moz-border-radius: 5px;
|
126 |
-
-khtml-border-radius: 5px;
|
127 |
-
border-radius: 5px;
|
128 |
-
-webkit-touch-callout: none;
|
129 |
-
-webkit-user-select: none;
|
130 |
-
-khtml-user-select: none;
|
131 |
-
-moz-user-select: none;
|
132 |
-
-ms-user-select: none;
|
133 |
-
user-select: none;
|
134 |
-
cursor: default;
|
135 |
-
}
|
136 |
-
|
137 |
-
span.wfu_variable
|
138 |
-
{
|
139 |
-
padding: 1px;
|
140 |
-
margin: 0px;
|
141 |
-
font-size: smaller;
|
142 |
-
background-color: #ddd;
|
143 |
-
border: 1px solid #ccc;
|
144 |
-
color: rgb(51, 51, 51);
|
145 |
-
-webkit-border-radius: 5px;
|
146 |
-
-moz-border-radius: 5px;
|
147 |
-
-khtml-border-radius: 5px;
|
148 |
-
border-radius: 5px;
|
149 |
-
-webkit-touch-callout: none;
|
150 |
-
-webkit-user-select: none;
|
151 |
-
-khtml-user-select: none;
|
152 |
-
-moz-user-select: none;
|
153 |
-
-ms-user-select: none;
|
154 |
-
user-select: none;
|
155 |
-
cursor: default;
|
156 |
-
}
|
157 |
-
|
158 |
-
span.wfu_ptext_span
|
159 |
-
{
|
160 |
-
display: inline-block;
|
161 |
-
width: 60px;
|
162 |
-
}
|
163 |
-
|
164 |
-
select.wfu_select_folders
|
165 |
-
{
|
166 |
-
height: auto;
|
167 |
-
min-width: 75%;
|
168 |
-
}
|
169 |
-
|
170 |
-
div.wfu_subfolders_inner_shadow
|
171 |
-
{
|
172 |
-
position: absolute;
|
173 |
-
width: 100%;
|
174 |
-
height: 100%;
|
175 |
-
padding: 0;
|
176 |
-
margin: 0;
|
177 |
-
border: none;
|
178 |
-
background-color: rgba(255,255,255,0.8);
|
179 |
-
}
|
180 |
-
|
181 |
-
option.wfu_select_folders_option_default
|
182 |
-
{
|
183 |
-
color: blue;
|
184 |
-
}
|
185 |
-
|
186 |
-
div.wfu_subfolder_nav_container
|
187 |
-
{
|
188 |
-
width: 40px;
|
189 |
-
margin: 0;
|
190 |
-
padding: 0;
|
191 |
-
border: none;
|
192 |
-
background: none;
|
193 |
-
display: inline-block;
|
194 |
-
vertical-align: top;
|
195 |
-
}
|
196 |
-
|
197 |
-
table.wfu_subfolder_nav
|
198 |
-
{
|
199 |
-
table-layout: fixed;
|
200 |
-
width: 100%;
|
201 |
-
margin: 0;
|
202 |
-
padding: 0;
|
203 |
-
border: none;
|
204 |
-
background: none;
|
205 |
-
border-spacing: 1px;
|
206 |
-
}
|
207 |
-
|
208 |
-
table.wfu_subfolder_nav tr
|
209 |
-
{
|
210 |
-
margin: 0;
|
211 |
-
padding: 0;
|
212 |
-
border: none;
|
213 |
-
background: none;
|
214 |
-
}
|
215 |
-
|
216 |
-
table.wfu_subfolder_nav td
|
217 |
-
{
|
218 |
-
margin: 0;
|
219 |
-
padding: 0;
|
220 |
-
border: none;
|
221 |
-
background: none;
|
222 |
-
font-size: small;
|
223 |
-
line-height: 1;
|
224 |
-
text-align: center;
|
225 |
-
}
|
226 |
-
|
227 |
-
table.wfu_subfolder_nav button.button
|
228 |
-
{
|
229 |
-
margin: 0;
|
230 |
-
padding: 0;
|
231 |
-
width: 17px;
|
232 |
-
font-size: smaller;
|
233 |
-
height: 18px;
|
234 |
-
line-height: 1;
|
235 |
-
color: black;
|
236 |
-
font-weight: bold;
|
237 |
-
}
|
238 |
-
|
239 |
-
table.wfu_subfolder_nav button.button:disabled
|
240 |
-
{
|
241 |
-
color: silver;
|
242 |
-
}
|
243 |
-
|
244 |
-
.button.wfu_subfolder_nav_pressed, .button.wfu_subfolder_nav_pressed:hover, .button.wfu_subfolder_nav_pressed:focus
|
245 |
-
{
|
246 |
-
background: royalblue;
|
247 |
-
}
|
248 |
-
|
249 |
-
div.wfu_subfolder_tools_container
|
250 |
-
{
|
251 |
-
width: 75%;
|
252 |
-
margin: 0;
|
253 |
-
padding: 0;
|
254 |
-
border: none;
|
255 |
-
background: none;
|
256 |
-
}
|
257 |
-
|
258 |
-
table.wfu_subfolder_tools
|
259 |
-
{
|
260 |
-
table-layout: fixed;
|
261 |
-
width: 100%;
|
262 |
-
margin: 0;
|
263 |
-
padding: 0;
|
264 |
-
border: none;
|
265 |
-
background: none;
|
266 |
-
}
|
267 |
-
|
268 |
-
table.wfu_subfolder_tools tr
|
269 |
-
{
|
270 |
-
margin: 0;
|
271 |
-
padding: 0;
|
272 |
-
border: none;
|
273 |
-
background: none;
|
274 |
-
}
|
275 |
-
|
276 |
-
table.wfu_subfolder_tools td
|
277 |
-
{
|
278 |
-
margin: 0;
|
279 |
-
padding: 0;
|
280 |
-
border: none;
|
281 |
-
background: none;
|
282 |
-
font-size: smaller;
|
283 |
-
}
|
284 |
-
|
285 |
-
table.wfu_subfolder_tools td div
|
286 |
-
{
|
287 |
-
margin: 0;
|
288 |
-
padding: 0;
|
289 |
-
border: none;
|
290 |
-
background: none;
|
291 |
-
position: relative;
|
292 |
-
}
|
293 |
-
|
294 |
-
table.wfu_subfolder_tools label
|
295 |
-
{
|
296 |
-
display: block;
|
297 |
-
padding: 0;
|
298 |
-
margin: 0;
|
299 |
-
line-height: 1;
|
300 |
-
}
|
301 |
-
|
302 |
-
table.wfu_subfolder_tools input
|
303 |
-
{
|
304 |
-
width: 100%;
|
305 |
-
padding: 0;
|
306 |
-
margin: 0;
|
307 |
-
}
|
308 |
-
|
309 |
-
table.wfu_subfolder_tools input:disabled
|
310 |
-
{
|
311 |
-
width: 100%;
|
312 |
-
padding: 0;
|
313 |
-
margin: 0;
|
314 |
-
color: silver;
|
315 |
-
}
|
316 |
-
|
317 |
-
table.wfu_subfolder_tools button.button
|
318 |
-
{
|
319 |
-
margin: 0;
|
320 |
-
padding: 1px 0 0 0;
|
321 |
-
width: 17px;
|
322 |
-
font-size: smaller;
|
323 |
-
height: 17px;
|
324 |
-
line-height: 1;
|
325 |
-
position: absolute;
|
326 |
-
bottom: 2px;
|
327 |
-
}
|
328 |
-
|
329 |
-
table.wfu_subfolder_tools button.button:disabled
|
330 |
-
{
|
331 |
-
color: silver;
|
332 |
-
}
|
333 |
-
|
334 |
-
table.wfu_subfolder_tools button.button:disabled img
|
335 |
-
{
|
336 |
-
opacity: 0.4;
|
337 |
-
}
|
338 |
-
|
339 |
-
.wfu_subfolder_tools_disabled
|
340 |
-
{
|
341 |
-
color: silver;
|
342 |
-
}
|
343 |
-
|
344 |
-
table.wfu_subfolder_tools td div.wfu_subfolders_browser_container
|
345 |
-
{
|
346 |
-
position: absolute;
|
347 |
-
width: 150px;
|
348 |
-
height: 150px;
|
349 |
-
margin: 0;
|
350 |
-
padding: 0;
|
351 |
-
z-index: 100;
|
352 |
-
border: 1px solid silver;
|
353 |
-
box-shadow: 1px 1px 2px;
|
354 |
-
background-color: white;
|
355 |
-
font-size: inherit;
|
356 |
-
}
|
357 |
-
|
358 |
-
table.wfu_subfolder_tools td div.wfu_subfolders_browser_container table
|
359 |
-
{
|
360 |
-
table-layout: fixed;
|
361 |
-
width: 100%;
|
362 |
-
height: 100%;
|
363 |
-
border: none;
|
364 |
-
background: #eee;
|
365 |
-
margin: 0;
|
366 |
-
padding: 0;
|
367 |
-
border-spacing: 0;
|
368 |
-
font-size: inherit;
|
369 |
-
}
|
370 |
-
|
371 |
-
table.wfu_subfolder_tools td div.wfu_subfolders_browser_container tr
|
372 |
-
{
|
373 |
-
border: none;
|
374 |
-
background: none;
|
375 |
-
margin: 0;
|
376 |
-
padding: 0;
|
377 |
-
font-size: inherit;
|
378 |
-
}
|
379 |
-
|
380 |
-
table.wfu_subfolder_tools td div.wfu_subfolders_browser_container td
|
381 |
-
{
|
382 |
-
border: none;
|
383 |
-
background: none;
|
384 |
-
margin: 0;
|
385 |
-
padding: 2px;
|
386 |
-
line-height: 0;
|
387 |
-
overflow: hidden;
|
388 |
-
font-size: inherit;
|
389 |
-
}
|
390 |
-
|
391 |
-
table.wfu_subfolder_tools td div.wfu_subfolders_browser_container td div
|
392 |
-
{
|
393 |
-
position: relative;
|
394 |
-
border: none;
|
395 |
-
background: none;
|
396 |
-
margin: 0;
|
397 |
-
padding: 0;
|
398 |
-
width: 100%;
|
399 |
-
height: 100%;
|
400 |
-
display: inline-block;
|
401 |
-
line-height: 1;
|
402 |
-
}
|
403 |
-
|
404 |
-
table.wfu_subfolder_tools td div.wfu_subfolders_browser_container td div button.button
|
405 |
-
{
|
406 |
-
font-size: inherit;
|
407 |
-
line-height: 1;
|
408 |
-
height: 17px;
|
409 |
-
padding: 4px;
|
410 |
-
position: relative;
|
411 |
-
width: auto;
|
412 |
-
margin: 0;
|
413 |
-
bottom: auto;
|
414 |
-
}
|
415 |
-
|
416 |
-
table.wfu_subfolder_tools td div.wfu_subfolders_browser_container select
|
417 |
-
{
|
418 |
-
width: 100%;
|
419 |
-
height: 100%;
|
420 |
-
top: 0;
|
421 |
-
bottom: 0;
|
422 |
-
position: absolute;
|
423 |
-
margin: 0;
|
424 |
-
}
|
425 |
-
|
426 |
-
table.wfu_subfolder_tools td div.wfu_subfolders_browser_container label
|
427 |
-
{
|
428 |
-
color: #222;
|
429 |
-
font-weight: bold;
|
430 |
-
position: absolute;
|
431 |
-
top: 0;
|
432 |
-
bottom: 0;
|
433 |
-
height: 10px;
|
434 |
-
margin: auto;
|
435 |
-
}
|
436 |
-
|
437 |
-
table.wfu_subfolder_tools td div.wfu_subfolders_browser_container td div button.button.wfu_folder_browser_cancel
|
438 |
-
{
|
439 |
-
width: 17px;
|
440 |
-
height: 17px;
|
441 |
-
position: absolute;
|
442 |
-
right: 0px;
|
443 |
-
top: 0px;
|
444 |
-
margin: 0;
|
445 |
-
padding: 0;
|
446 |
-
}
|
447 |
-
|
448 |
-
table.wfu_subfolder_tools td div.wfu_subfolders_browser_container td div div.wfu_folder_browser_loading_container
|
449 |
-
{
|
450 |
-
position: absolute;
|
451 |
-
width: 100%;
|
452 |
-
height: 100%;
|
453 |
-
top: 0;
|
454 |
-
bottom: 0;
|
455 |
-
margin: 0;
|
456 |
-
padding: 0;
|
457 |
-
background-color: rgba(255,255,255,0.9);
|
458 |
-
text-align: center;
|
459 |
-
}
|
460 |
-
|
461 |
-
table.wfu_subfolder_tools td div.wfu_subfolders_browser_container td div div.wfu_folder_browser_loading_container label
|
462 |
-
{
|
463 |
-
position: relative;
|
464 |
-
display: block;
|
465 |
-
}
|
466 |
-
|
467 |
-
table.wfu_subfolder_tools td div.wfu_subfolders_browser_container td div div.wfu_folder_browser_loading_container img
|
468 |
-
{
|
469 |
-
position: relative;
|
470 |
-
}
|
471 |
-
|
472 |
-
.button.wfu_folder_browser_cancel img
|
473 |
-
{
|
474 |
-
vertical-align: top;
|
475 |
-
margin-top: 2px;
|
476 |
-
}
|
477 |
-
|
478 |
-
div.wfu_mchecklist_container
|
479 |
-
{
|
480 |
-
display: inline-block;
|
481 |
-
border: 1px solid #ddd;
|
482 |
-
border-radius: 4px;
|
483 |
-
padding: 4px;
|
484 |
-
}
|
485 |
-
|
486 |
-
div.wfu_mchecklist_item
|
487 |
-
{
|
488 |
-
display: inline-block;
|
489 |
-
}
|
490 |
-
|
491 |
-
div.wfu_mchecklist_item label
|
492 |
-
{
|
493 |
-
vertical-align: baseline;
|
494 |
-
margin-left: 4px;
|
495 |
-
cursor: default;
|
496 |
-
}
|
497 |
-
|
498 |
-
div.wfu_mchecklist_item input:disabled + label
|
499 |
-
{
|
500 |
-
color: gray;
|
501 |
-
}
|
502 |
-
|
503 |
-
div.wfu_mchecklist_item div
|
504 |
-
{
|
505 |
-
margin-left: 4px;
|
506 |
-
}
|
507 |
-
|
508 |
-
div.wfu_mchecklist_item:hover img
|
509 |
-
{
|
510 |
-
visibility: visible;
|
511 |
-
}
|
512 |
-
|
513 |
-
div.wfu_mchecklist_checkall
|
514 |
-
{
|
515 |
-
display: inline-block;
|
516 |
-
vertical-align: top;
|
517 |
-
margin: 0px 0px 0px 10px;
|
518 |
-
}
|
519 |
-
|
520 |
-
div.wfu_rolelist_checkall
|
521 |
-
{
|
522 |
-
display: inline-block;
|
523 |
-
vertical-align: top;
|
524 |
-
margin: 0px 0px 0px 10px;
|
525 |
-
}
|
526 |
-
|
527 |
-
div.wfu_shadow
|
528 |
-
{
|
529 |
-
position: absolute;
|
530 |
-
width: 100%;
|
531 |
-
height: 100%;
|
532 |
-
left: 0;
|
533 |
-
top: 0;
|
534 |
-
margin: 0;
|
535 |
-
padding: 0;
|
536 |
-
background-color: white;
|
537 |
-
z-index: 10;
|
538 |
-
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=60)";
|
539 |
-
filter: alpha(opacity=60);
|
540 |
-
-moz-opacity: 0.6;
|
541 |
-
-khtml-opacity: 0.6;
|
542 |
-
opacity: 0.6;
|
543 |
-
}
|
544 |
-
|
545 |
-
table.wfu_main_table tr:nth-child(odd) div.wfu_shadow { background-color: #f4f4f4; }
|
546 |
-
|
547 |
-
div.wfu_onoff_container_on, div.wfu_onoff_container_off
|
548 |
-
{
|
549 |
-
display: inline-block;
|
550 |
-
position: relative;
|
551 |
-
padding: 2px;
|
552 |
-
border: 1px solid #aaa;
|
553 |
-
-webkit-border-radius: 3px;
|
554 |
-
-moz-border-radius: 3px;
|
555 |
-
-khtml-border-radius: 3px;
|
556 |
-
border-radius: 3px;
|
557 |
-
background: rgb(6,109,171);
|
558 |
-
background: -moz-linear-gradient(top, rgba(6,109,171,1) 0%, rgba(197,222,234,1) 100%);
|
559 |
-
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(6,109,171,1)), color-stop(100%,rgba(197,222,234,1)));
|
560 |
-
background: -webkit-linear-gradient(top, rgba(6,109,171,1) 0%,rgba(197,222,234,1) 100%);
|
561 |
-
background: -o-linear-gradient(top, rgba(6,109,171,1) 0%,rgba(197,222,234,1) 100%);
|
562 |
-
background: -ms-linear-gradient(top, rgba(6,109,171,1) 0%,rgba(197,222,234,1) 100%);
|
563 |
-
background: linear-gradient(to bottom, rgba(6,109,171,1) 0%,rgba(197,222,234,1) 100%);
|
564 |
-
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#066dab', endColorstr='#c5deea',GradientType=0 );
|
565 |
-
}
|
566 |
-
|
567 |
-
span.wfu_onoff_text
|
568 |
-
{
|
569 |
-
width: 30px;
|
570 |
-
display: inline-block;
|
571 |
-
text-align: center;
|
572 |
-
color: #FFF;
|
573 |
-
}
|
574 |
-
|
575 |
-
div.wfu_onoff_slider
|
576 |
-
{
|
577 |
-
position: absolute;
|
578 |
-
margin: 0;
|
579 |
-
width: 31px;
|
580 |
-
top: 0px;
|
581 |
-
bottom: 0px;
|
582 |
-
border: 1px solid #fff;
|
583 |
-
-webkit-border-radius: 2px;
|
584 |
-
-moz-border-radius: 2px;
|
585 |
-
-khtml-border-radius: 2px;
|
586 |
-
border-radius: 2px;
|
587 |
-
-moz-box-shadow: 0px 0px 2px;
|
588 |
-
-webkit-box-shadow: 0px 0px 2px;
|
589 |
-
box-shadow: 0px 0px 2px;
|
590 |
-
background: rgb(204,204,204);
|
591 |
-
background: -moz-linear-gradient(top, rgba(204,204,204,1) 0%, rgba(255,255,255,1) 100%);
|
592 |
-
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(204,204,204,1)), color-stop(100%,rgba(255,255,255,1)));
|
593 |
-
background: -webkit-linear-gradient(top, rgba(204,204,204,1) 0%,rgba(255,255,255,1) 100%);
|
594 |
-
background: -o-linear-gradient(top, rgba(204,204,204,1) 0%,rgba(255,255,255,1) 100%);
|
595 |
-
background: -ms-linear-gradient(top, rgba(204,204,204,1) 0%,rgba(255,255,255,1) 100%);
|
596 |
-
background: linear-gradient(to bottom, rgba(204,204,204,1) 0%,rgba(255,255,255,1) 100%);
|
597 |
-
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#cccccc', endColorstr='#ffffff',GradientType=0 );
|
598 |
-
}
|
599 |
-
|
600 |
-
div.wfu_onoff_container_on div.wfu_onoff_slider
|
601 |
-
{
|
602 |
-
left: 50%;
|
603 |
-
/* -webkit-animation: set_on 0.1s linear;
|
604 |
-
-moz-animation: set_on 0.1s linear;
|
605 |
-
-o-animation: set_on 0.1s linear;
|
606 |
-
animation: set_on 0.1s linear; */
|
607 |
-
}
|
608 |
-
|
609 |
-
div.wfu_onoff_container_off div.wfu_onoff_slider
|
610 |
-
{
|
611 |
-
left: 0%;
|
612 |
-
/* -webkit-animation: set_on 0.1s linear reverse;
|
613 |
-
-moz-animation: set_on 0.1s linear reverse;
|
614 |
-
-o-animation: set_on 0.1s linear reverse;
|
615 |
-
animation: set_on 0.1s linear reverse; */
|
616 |
-
}
|
617 |
-
|
618 |
-
@-webkit-keyframes set_on { from { left: 0%; } to { left: 50%; } }
|
619 |
-
@-moz-keyframes set_on { from { left: 0%; } to { left: 50%; } }
|
620 |
-
@-o-keyframes set_on { from { left: 0%; } to { left: 50%; } }
|
621 |
-
@keyframes set_on { from { left: 0%; } to { left: 50%; } }
|
622 |
-
|
623 |
-
div.wfu_placements_wrapper
|
624 |
-
{
|
625 |
-
display: block;
|
626 |
-
position: relative;
|
627 |
-
margin: 0;
|
628 |
-
padding: 0;
|
629 |
-
background: none;
|
630 |
-
border: none;
|
631 |
-
}
|
632 |
-
|
633 |
-
div.wfu_placements_container
|
634 |
-
{
|
635 |
-
display: inline-block;
|
636 |
-
position: relative;
|
637 |
-
width: 100%;
|
638 |
-
height: 300px;
|
639 |
-
background-color: white;
|
640 |
-
border: 1px solid #ccc;
|
641 |
-
-webkit-border-radius: 3px;
|
642 |
-
-moz-border-radius: 3px;
|
643 |
-
-khtml-border-radius: 3px;
|
644 |
-
border-radius: 3px;
|
645 |
-
padding: 0;
|
646 |
-
overflow: scroll;
|
647 |
-
font-size: 0;
|
648 |
-
line-height: 0;
|
649 |
-
white-space: nowrap;
|
650 |
-
}
|
651 |
-
|
652 |
-
div.wfu_componentlist_container
|
653 |
-
{
|
654 |
-
display: inline-block;
|
655 |
-
position: absolute;
|
656 |
-
width: auto;
|
657 |
-
height: auto;
|
658 |
-
top: 0;
|
659 |
-
left: 100%;
|
660 |
-
background: none;
|
661 |
-
border: none;
|
662 |
-
margin: 0 0 0 20px;
|
663 |
-
padding: 0;
|
664 |
-
z-index: 1;
|
665 |
-
white-space: nowrap;
|
666 |
-
}
|
667 |
-
|
668 |
-
div.wfu_component_box_container
|
669 |
-
{
|
670 |
-
display: inline-block;
|
671 |
-
position: relative;
|
672 |
-
width: 80px;
|
673 |
-
height: 30px;
|
674 |
-
background-color: transparent;
|
675 |
-
border: 1px solid transparent;
|
676 |
-
padding: 4px;
|
677 |
-
margin: 0;
|
678 |
-
cursor: default;
|
679 |
-
}
|
680 |
-
|
681 |
-
div.wfu_component_box_base
|
682 |
-
{
|
683 |
-
display: block;
|
684 |
-
position: absolute;
|
685 |
-
width: 80px;
|
686 |
-
height: 30px;
|
687 |
-
left: -1px;
|
688 |
-
top: -1px;
|
689 |
-
background-color: #ddd;
|
690 |
-
border: 1px solid #bbb;
|
691 |
-
-webkit-border-radius: 3px;
|
692 |
-
-moz-border-radius: 3px;
|
693 |
-
-khtml-border-radius: 3px;
|
694 |
-
border-radius: 3px;
|
695 |
-
padding: 4px;
|
696 |
-
cursor: default;
|
697 |
-
font-size: 12px;
|
698 |
-
line-height: 1;
|
699 |
-
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=40)";
|
700 |
-
filter: alpha(opacity=40);
|
701 |
-
-moz-opacity: 0.4;
|
702 |
-
-khtml-opacity: 0.4;
|
703 |
-
opacity: 0.4;
|
704 |
-
white-space: normal;
|
705 |
-
}
|
706 |
-
|
707 |
-
div.wfu_component_box
|
708 |
-
{
|
709 |
-
display: inline-block;
|
710 |
-
position: relative;
|
711 |
-
width: 80px;
|
712 |
-
height: 30px;
|
713 |
-
background-color: #ddd;
|
714 |
-
border: 1px solid #bbb;
|
715 |
-
-webkit-border-radius: 3px;
|
716 |
-
-moz-border-radius: 3px;
|
717 |
-
-khtml-border-radius: 3px;
|
718 |
-
border-radius: 3px;
|
719 |
-
padding: 4px;
|
720 |
-
cursor: default;
|
721 |
-
font-size: 12px;
|
722 |
-
line-height: 1;
|
723 |
-
z-index: 1;
|
724 |
-
white-space: normal;
|
725 |
-
}
|
726 |
-
|
727 |
-
div.wfu_inbase
|
728 |
-
{
|
729 |
-
display: block;
|
730 |
-
position: absolute;
|
731 |
-
left: -1px;
|
732 |
-
top: -1px;
|
733 |
-
}
|
734 |
-
|
735 |
-
div.wfu_component_box:hover
|
736 |
-
{
|
737 |
-
background-color: #eee;
|
738 |
-
border: 1px solid #bbb;
|
739 |
-
}
|
740 |
-
|
741 |
-
div.wfu_component_box_selected
|
742 |
-
{
|
743 |
-
background-color: #aaa;
|
744 |
-
border: 1px solid #bbb;
|
745 |
-
}
|
746 |
-
|
747 |
-
div.wfu_component_box_dragged
|
748 |
-
{
|
749 |
-
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=40)";
|
750 |
-
filter: alpha(opacity=40);
|
751 |
-
-moz-opacity: 0.4;
|
752 |
-
-khtml-opacity: 0.4;
|
753 |
-
opacity: 0.4;
|
754 |
-
}
|
755 |
-
|
756 |
-
div.wfu_component_separator_ver
|
757 |
-
{
|
758 |
-
display: inline-block;
|
759 |
-
position: relative;
|
760 |
-
width: 8px;
|
761 |
-
height: 26px;
|
762 |
-
background-color: transparent;
|
763 |
-
border: 1px solid transparent;
|
764 |
-
margin: 6px -8px;
|
765 |
-
padding: 0 8px;
|
766 |
-
cursor: default;
|
767 |
-
z-index: 1;
|
768 |
-
}
|
769 |
-
|
770 |
-
div.wfu_component_separator_hor
|
771 |
-
{
|
772 |
-
display: block;
|
773 |
-
position: relative;
|
774 |
-
width: 100%;
|
775 |
-
height: 8px;
|
776 |
-
background-color: transparent;
|
777 |
-
border: 1px solid transparent;
|
778 |
-
margin: -8px 0;
|
779 |
-
padding: 8px 0;
|
780 |
-
cursor: default;
|
781 |
-
z-index: 1;
|
782 |
-
}
|
783 |
-
|
784 |
-
div.wfu_component_bar_hor
|
785 |
-
{
|
786 |
-
position: absolute;
|
787 |
-
width: auto;
|
788 |
-
height: 4px;
|
789 |
-
left: 10px;
|
790 |
-
right: 0;
|
791 |
-
background-color: silver;
|
792 |
-
border: none;
|
793 |
-
margin: 11px 0 0 0;
|
794 |
-
padding: 0;
|
795 |
-
display: none;
|
796 |
-
}
|
797 |
-
|
798 |
-
div.wfu_component_bar_ver
|
799 |
-
{
|
800 |
-
position: absolute;
|
801 |
-
width: 4px;
|
802 |
-
height: 40px;
|
803 |
-
background-color: silver;
|
804 |
-
border: none;
|
805 |
-
margin: -6px 0 0 11px;
|
806 |
-
padding: 0;
|
807 |
-
display: none;
|
808 |
-
}
|
809 |
-
|
810 |
-
div.wfu_componentlist_dragdrop
|
811 |
-
{
|
812 |
-
position: absolute;
|
813 |
-
width: 100%;
|
814 |
-
height: 100%;
|
815 |
-
left: 0;
|
816 |
-
top: 0;
|
817 |
-
background-color: #f8f8f8;
|
818 |
-
border: 4px dashed #aaa;
|
819 |
-
-webkit-box-sizing: border-box;
|
820 |
-
-moz-box-sizing: border-box;
|
821 |
-
box-sizing: border-box;
|
822 |
-
margin: 0;
|
823 |
-
padding: 0;
|
824 |
-
z-index: 2;
|
825 |
-
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=70)";
|
826 |
-
filter: alpha(opacity=70);
|
827 |
-
-moz-opacity: 0.7;
|
828 |
-
-khtml-opacity: 0.7;
|
829 |
-
opacity: 0.7;
|
830 |
-
}
|
831 |
-
|
832 |
-
div.wfu_componentlist_dragdrop_dragover
|
833 |
-
{
|
834 |
-
border: 4px dashed #555;
|
835 |
-
}
|
836 |
-
|
837 |
-
div.wfu_userdata_container
|
838 |
-
{
|
839 |
-
display: block;
|
840 |
-
position: relative;
|
841 |
-
width: 100%;
|
842 |
-
height: 100%;
|
843 |
-
padding: 0;
|
844 |
-
margin: 0;
|
845 |
-
background: none;
|
846 |
-
border: none;
|
847 |
-
}
|
848 |
-
|
849 |
-
div.wfu_userdata_action
|
850 |
-
{
|
851 |
-
display: inline-block;
|
852 |
-
position: relative;
|
853 |
-
top: 2px;
|
854 |
-
width: 16px;
|
855 |
-
height: 16px;
|
856 |
-
padding: 0;
|
857 |
-
margin: 0;
|
858 |
-
background: none;
|
859 |
-
text-align: center;
|
860 |
-
border: 1px solid transparent;
|
861 |
-
-webkit-border-radius: 3px;
|
862 |
-
-moz-border-radius: 3px;
|
863 |
-
-khtml-border-radius: 3px;
|
864 |
-
border-radius: 3px;
|
865 |
-
}
|
866 |
-
|
867 |
-
div.wfu_userdata_action:hover { border: 1px solid #aaa; }
|
868 |
-
|
869 |
-
div.wfu_userdata_action.wfu_userdata_action_disabled:hover { border: 1px solid transparent; }
|
870 |
-
|
871 |
-
div.wfu_userdata_action > img { width: 12px; height: 12px; }
|
872 |
-
|
873 |
-
div.wfu_userdata_action_disabled > img
|
874 |
-
{
|
875 |
-
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=40)";
|
876 |
-
filter: alpha(opacity=40);
|
877 |
-
-moz-opacity: 0.4;
|
878 |
-
-khtml-opacity: 0.4;
|
879 |
-
opacity: 0.4;
|
880 |
-
}
|
881 |
-
|
882 |
-
div.wfu_userdata_line
|
883 |
-
{
|
884 |
-
display: block;
|
885 |
-
position: relative;
|
886 |
-
padding: 0;
|
887 |
-
margin: 0;
|
888 |
-
background: none;
|
889 |
-
border: none;
|
890 |
-
white-space: nowrap;
|
891 |
-
}
|
892 |
-
|
893 |
-
/* ColorPicker Styles */
|
894 |
-
div.wfu_color_container
|
895 |
-
{
|
896 |
-
display: block;
|
897 |
-
position: relative;
|
898 |
-
padding: 0;
|
899 |
-
margin: 0;
|
900 |
-
background: none;
|
901 |
-
border: none;
|
902 |
-
white-space: nowrap;
|
903 |
-
z-index: 1;
|
904 |
-
}
|
905 |
-
input[type="text"].wp-color-picker { width: 75px; }
|
906 |
-
input[type="button"].wp-picker-clear { width: 62px; }
|
907 |
-
|
908 |
-
/* Shortcode Styles */
|
909 |
-
span.wfu_save_label
|
910 |
-
{
|
911 |
-
background-color: aliceblue;
|
912 |
-
color: limegreen;
|
913 |
-
border-radius: 6px;
|
914 |
-
padding: 1px 2px;
|
915 |
-
box-shadow: 1px 1px 1px;
|
916 |
-
font-size: smaller;
|
917 |
-
opacity: 0;
|
918 |
-
}
|
919 |
-
|
920 |
-
span.wfu_save_label_fail
|
921 |
-
{
|
922 |
-
background-color: beige;
|
923 |
-
color: lightcoral;
|
924 |
-
border-radius: 6px;
|
925 |
-
padding: 1px 2px;
|
926 |
-
box-shadow: 1px 1px 1px;
|
927 |
-
font-size: smaller;
|
928 |
-
opacity: 0;
|
929 |
-
}
|
930 |
-
|
931 |
-
div.wfu_global_dialog_container
|
932 |
-
{
|
933 |
-
position: fixed;
|
934 |
-
width: 100%;
|
935 |
-
height: 100%;
|
936 |
-
top: 0;
|
937 |
-
left: 0;
|
938 |
-
margin: 0;
|
939 |
-
padding: 0;
|
940 |
-
border: none;
|
941 |
-
background: none;
|
942 |
-
z-index: 1;
|
943 |
-
display: none;
|
944 |
-
}
|
1 |
+
div.wfu_shortcode_container{display:inline-block;position:relative;width:50%;padding:0;margin:0;background:0 0;border:none}textarea.wfu_shortcode{width:100%}div.wfu_container{margin-top:10px}div.wfu_help_container{display:inline-block;position:relative;top:4px;padding:0;margin:0;background:0 0;border:none}div.wfu_help_container img{visibility:hidden}table.wfu_inner_table th:hover div.wfu_help_container img,table.wfu_main_table th:hover div.wfu_help_container img{visibility:visible}div.wfu_restore_container{display:inline-block;position:relative;top:4px;padding:0;margin:0;background:0 0;border:none}div.wfu_restore_container img{visibility:hidden}table.wfu_inner_table th:hover div.wfu_restore_container img,table.wfu_main_table th:hover div.wfu_restore_container img{visibility:visible}div.wfu_td_div{display:block;position:relative;width:100%;height:100%;padding:0;margin:0;background:0 0;border:none}div.wfu_container input.wfu_long_text{width:100%}div.wfu_container input.wfu_short_text{width:60px}div.wfu_container input{width:200px}div.wfu_container input[type=checkbox]{width:auto}table.wfu_main_table{table-layout:fixed}table.wfu_main_table tr:nth-child(odd){background-color:#f4f4f4}table.wfu_main_table table.wfu_inner_table tr,table.wfu_main_table tr:nth-child(even){background-color:transparent}table.wfu_main_table th{width:17%}table.wfu_main_table td:nth-child(2){width:33%}table.wfu_main_table td:nth-child(3){width:50%}table.wfu_main_table table.wfu_inner_table th{width:34%}table.wfu_main_table table.wfu_inner_table td:nth-child(2){width:66%}table.wfu_main_table tr.wfu_subcategory{background-color:#ddd}table.wfu_main_table tr.wfu_subcategory>th{padding-top:0;padding-bottom:0}select.wfu_variable{padding:0;margin:0;height:auto;font-size:smaller;background-color:#ddd;border:1px solid #ccc;color:#333;-webkit-border-radius:5px;-moz-border-radius:5px;-khtml-border-radius:5px;border-radius:5px;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}span.wfu_variable{padding:1px;margin:0;font-size:smaller;background-color:#ddd;border:1px solid #ccc;color:#333;-webkit-border-radius:5px;-moz-border-radius:5px;-khtml-border-radius:5px;border-radius:5px;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}span.wfu_ptext_span{display:inline-block;width:60px}select.wfu_select_folders{height:auto;min-width:75%}select.wfu_select_folders_empty{font-style:italic;color:silver}div.wfu_subfolders_inner_shadow{position:absolute;width:100%;height:100%;padding:0;margin:0;border:none;background-color:rgba(255,255,255,.8)}option.wfu_select_folders_option_default{color:#00f}div.wfu_subfolder_nav_container{width:40px;margin:0;padding:0;border:none;background:0 0;display:inline-block;vertical-align:top}table.wfu_subfolder_nav{table-layout:fixed;width:100%;margin:0;padding:0;border:none;background:0 0;border-spacing:1px}table.wfu_subfolder_nav tr{margin:0;padding:0;border:none;background:0 0}table.wfu_subfolder_nav td{margin:0;padding:0;border:none;background:0 0;font-size:small;line-height:1;text-align:center}table.wfu_subfolder_nav button.button{margin:0;padding:0;width:17px;font-size:smaller;height:18px;line-height:1;color:#000;font-weight:700}table.wfu_subfolder_nav button.button:disabled{color:silver}.button.wfu_subfolder_nav_pressed,.button.wfu_subfolder_nav_pressed:focus,.button.wfu_subfolder_nav_pressed:hover{background:#4169e1}div.wfu_subfolder_tools_container{width:75%;margin:0;padding:0;border:none;background:0 0}table.wfu_subfolder_tools{table-layout:fixed;width:100%;margin:0;padding:0;border:none;background:0 0}table.wfu_subfolder_tools tr{margin:0;padding:0;border:none;background:0 0}table.wfu_subfolder_tools td{margin:0;padding:0;border:none;background:0 0;font-size:smaller}table.wfu_subfolder_tools td div{margin:0;padding:0;border:none;background:0 0;position:relative}table.wfu_subfolder_tools label{display:block;padding:0;margin:0;line-height:1}table.wfu_subfolder_tools input{width:100%;padding:0;margin:0}table.wfu_subfolder_tools input:disabled{width:100%;padding:0;margin:0;color:silver}table.wfu_subfolder_tools button.button{margin:0;padding:1px 0 0;width:17px;font-size:smaller;height:17px;line-height:1;position:absolute;bottom:2px}table.wfu_subfolder_tools button.button:disabled{color:silver}table.wfu_subfolder_tools button.button:disabled img{opacity:.4}.wfu_subfolder_tools_disabled{color:silver}table.wfu_subfolder_tools td div.wfu_subfolders_browser_container{position:absolute;width:150px;height:150px;margin:0;padding:0;z-index:100;border:1px solid silver;box-shadow:1px 1px 2px;background-color:#fff;font-size:inherit}table.wfu_subfolder_tools td div.wfu_subfolders_browser_container table{table-layout:fixed;width:100%;height:100%;border:none;background:#eee;margin:0;padding:0;border-spacing:0;font-size:inherit}table.wfu_subfolder_tools td div.wfu_subfolders_browser_container tr{border:none;background:0 0;margin:0;padding:0;font-size:inherit}table.wfu_subfolder_tools td div.wfu_subfolders_browser_container td{border:none;background:0 0;margin:0;padding:2px;line-height:0;overflow:hidden;font-size:inherit}table.wfu_subfolder_tools td div.wfu_subfolders_browser_container td div{position:relative;border:none;background:0 0;margin:0;padding:0;width:100%;height:100%;display:inline-block;line-height:1}table.wfu_subfolder_tools td div.wfu_subfolders_browser_container td div button.button{font-size:inherit;line-height:1;height:17px;padding:4px;position:relative;width:auto;margin:0;bottom:auto}table.wfu_subfolder_tools td div.wfu_subfolders_browser_container select{width:100%;height:100%;top:0;bottom:0;position:absolute;margin:0}table.wfu_subfolder_tools td div.wfu_subfolders_browser_container label{color:#222;font-weight:700;position:absolute;top:0;bottom:0;height:10px;margin:auto}table.wfu_subfolder_tools td div.wfu_subfolders_browser_container td div button.button.wfu_folder_browser_cancel{width:17px;height:17px;position:absolute;right:0;top:0;margin:0;padding:0}table.wfu_subfolder_tools td div.wfu_subfolders_browser_container td div div.wfu_folder_browser_loading_container{position:absolute;width:100%;height:100%;top:0;bottom:0;margin:0;padding:0;background-color:rgba(255,255,255,.9);text-align:center}table.wfu_subfolder_tools td div.wfu_subfolders_browser_container td div div.wfu_folder_browser_loading_container label{position:relative;display:block}table.wfu_subfolder_tools td div.wfu_subfolders_browser_container td div div.wfu_folder_browser_loading_container img{position:relative}.button.wfu_folder_browser_cancel img{vertical-align:top;margin-top:2px}div.wfu_mchecklist_container{display:inline-block;border:1px solid #ddd;border-radius:4px;padding:4px}div.wfu_mchecklist_item{display:inline-block}div.wfu_mchecklist_item label{vertical-align:baseline;margin-left:4px;cursor:default}div.wfu_mchecklist_item input:disabled+label{color:gray}div.wfu_mchecklist_item div{margin-left:4px}div.wfu_mchecklist_item:hover img{visibility:visible}div.wfu_mchecklist_checkall,div.wfu_rolelist_checkall{display:inline-block;vertical-align:top;margin:0 0 0 10px}div.wfu_shadow{position:absolute;width:100%;height:100%;left:0;top:0;margin:0;padding:0;background-color:#fff;z-index:10;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=60)";filter:alpha(opacity=60);-moz-opacity:.6;-khtml-opacity:.6;opacity:.6}table.wfu_main_table tr:nth-child(odd) div.wfu_shadow{background-color:#f4f4f4}div.wfu_onoff_container_off,div.wfu_onoff_container_on{display:inline-block;position:relative;padding:2px;border:1px solid #aaa;-webkit-border-radius:3px;-moz-border-radius:3px;-khtml-border-radius:3px;border-radius:3px;background:#066dab;background:-moz-linear-gradient(top,rgba(6,109,171,1) 0,rgba(197,222,234,1) 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,rgba(6,109,171,1)),color-stop(100%,rgba(197,222,234,1)));background:-webkit-linear-gradient(top,rgba(6,109,171,1) 0,rgba(197,222,234,1) 100%);background:-o-linear-gradient(top,rgba(6,109,171,1) 0,rgba(197,222,234,1) 100%);background:-ms-linear-gradient(top,rgba(6,109,171,1) 0,rgba(197,222,234,1) 100%);background:linear-gradient(to bottom,rgba(6,109,171,1) 0,rgba(197,222,234,1) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#066dab', endColorstr='#c5deea', GradientType=0)}span.wfu_onoff_text{width:30px;display:inline-block;text-align:center;color:#FFF}div.wfu_onoff_slider{position:absolute;margin:0;width:31px;top:0;bottom:0;border:1px solid #fff;-webkit-border-radius:2px;-moz-border-radius:2px;-khtml-border-radius:2px;border-radius:2px;-moz-box-shadow:0 0 2px;-webkit-box-shadow:0 0 2px;box-shadow:0 0 2px;background:#ccc;background:-moz-linear-gradient(top,rgba(204,204,204,1) 0,rgba(255,255,255,1) 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,rgba(204,204,204,1)),color-stop(100%,rgba(255,255,255,1)));background:-webkit-linear-gradient(top,rgba(204,204,204,1) 0,rgba(255,255,255,1) 100%);background:-o-linear-gradient(top,rgba(204,204,204,1) 0,rgba(255,255,255,1) 100%);background:-ms-linear-gradient(top,rgba(204,204,204,1) 0,rgba(255,255,255,1) 100%);background:linear-gradient(to bottom,rgba(204,204,204,1) 0,rgba(255,255,255,1) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#cccccc', endColorstr='#ffffff', GradientType=0)}div.wfu_onoff_container_on div.wfu_onoff_slider{left:50%}div.wfu_onoff_container_off div.wfu_onoff_slider{left:0}@-webkit-keyframes set_on{from{left:0}to{left:50%}}@-moz-keyframes set_on{from{left:0}to{left:50%}}@-o-keyframes set_on{from{left:0}to{left:50%}}@keyframes set_on{from{left:0}to{left:50%}}div.wfu_placements_wrapper{display:block;position:relative;margin:0;padding:0;background:0 0;border:none}div.wfu_placements_container{display:inline-block;position:relative;width:100%;height:300px;background-color:#fff;border:1px solid #ccc;-webkit-border-radius:3px;-moz-border-radius:3px;-khtml-border-radius:3px;border-radius:3px;padding:0;overflow:scroll;font-size:0;line-height:0;white-space:nowrap}div.wfu_componentlist_container{display:inline-block;position:absolute;width:auto;height:auto;top:0;left:100%;background:0 0;border:none;margin:0 0 0 20px;padding:0;z-index:1;white-space:nowrap}div.wfu_component_box_container{display:inline-block;position:relative;width:80px;height:30px;background-color:transparent;border:1px solid transparent;padding:4px;margin:0;cursor:default}div.wfu_component_box_base{display:block;position:absolute;width:80px;height:30px;left:-1px;top:-1px;background-color:#ddd;border:1px solid #bbb;-webkit-border-radius:3px;-moz-border-radius:3px;-khtml-border-radius:3px;border-radius:3px;padding:4px;cursor:default;font-size:12px;line-height:1;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=40)";filter:alpha(opacity=40);-moz-opacity:.4;-khtml-opacity:.4;opacity:.4;white-space:normal}div.wfu_component_box{display:inline-block;position:relative;width:80px;height:30px;background-color:#ddd;border:1px solid #bbb;-webkit-border-radius:3px;-moz-border-radius:3px;-khtml-border-radius:3px;border-radius:3px;padding:4px;cursor:default;font-size:12px;line-height:1;z-index:1;white-space:normal}div.wfu_inbase{display:block;position:absolute;left:-1px;top:-1px}div.wfu_component_box:hover{background-color:#eee;border:1px solid #bbb}div.wfu_component_box_selected{background-color:#aaa;border:1px solid #bbb}div.wfu_component_box_dragged{-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=40)";filter:alpha(opacity=40);-moz-opacity:.4;-khtml-opacity:.4;opacity:.4}div.wfu_component_separator_ver{display:inline-block;position:relative;width:8px;height:26px;background-color:transparent;border:1px solid transparent;margin:6px -8px;padding:0 8px;cursor:default;z-index:1}div.wfu_component_separator_hor{display:block;position:relative;width:100%;height:8px;background-color:transparent;border:1px solid transparent;margin:-8px 0;padding:8px 0;cursor:default;z-index:1}div.wfu_component_bar_hor{position:absolute;width:auto;height:4px;left:10px;right:0;background-color:silver;border:none;margin:11px 0 0;padding:0;display:none}div.wfu_component_bar_ver{position:absolute;width:4px;height:40px;background-color:silver;border:none;margin:-6px 0 0 11px;padding:0;display:none}div.wfu_componentlist_dragdrop{position:absolute;width:100%;height:100%;left:0;top:0;background-color:#f8f8f8;border:4px dashed #aaa;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;z-index:2;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=70)";filter:alpha(opacity=70);-moz-opacity:.7;-khtml-opacity:.7;opacity:.7}div.wfu_componentlist_dragdrop_dragover{border:4px dashed #555}div.wfu_userdata_container{display:block;position:relative;width:100%;height:100%;padding:0;margin:0;background:0 0;border:none}div.wfu_userdata_action{display:inline-block;position:relative;top:2px;width:16px;height:16px;padding:0;margin:0;background:0 0;text-align:center;border:1px solid transparent;-webkit-border-radius:3px;-moz-border-radius:3px;-khtml-border-radius:3px;border-radius:3px}div.wfu_userdata_action:hover{border:1px solid #aaa}div.wfu_userdata_action.wfu_userdata_action_disabled:hover{border:1px solid transparent}div.wfu_userdata_action>img{width:12px;height:12px}div.wfu_userdata_action_disabled>img{-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=40)";filter:alpha(opacity=40);-moz-opacity:.4;-khtml-opacity:.4;opacity:.4}div.wfu_userdata_line{display:block;position:relative;padding:0;margin:0;background:0 0;border:none;white-space:nowrap}div.wfu_color_container{display:block;position:relative;padding:0;margin:0;background:0 0;border:none;white-space:nowrap;z-index:1}input[type=text].wp-color-picker{width:75px}input[type=button].wp-picker-clear{width:62px}span.wfu_save_label{background-color:#f0f8ff;color:#32cd32;border-radius:6px;padding:1px 2px;box-shadow:1px 1px 1px;font-size:smaller;opacity:0}span.wfu_save_label_fail{background-color:beige;color:#f08080;border-radius:6px;padding:1px 2px;box-shadow:1px 1px 1px;font-size:smaller;opacity:0}div.wfu_global_dialog_container{position:fixed;width:100%;height:100%;top:0;left:0;margin:0;padding:0;border:none;background:0 0;z-index:1;display:none}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
css/wordpress_file_upload_reset.css
CHANGED
@@ -1,47 +1 @@
|
|
1 |
-
|
2 |
-
* Eric Meyer's Reset CSS v2.0 (http://meyerweb.com/eric/tools/css/reset/)
|
3 |
-
* http://cssreset.com
|
4 |
-
*/
|
5 |
-
html, body, div, span, applet, object, iframe,
|
6 |
-
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
7 |
-
a, abbr, acronym, address, big, cite, code,
|
8 |
-
del, dfn, em, img, ins, kbd, q, s, samp,
|
9 |
-
small, strike, strong, sub, sup, tt, var,
|
10 |
-
b, u, i, center,
|
11 |
-
dl, dt, dd, ol, ul, li,
|
12 |
-
fieldset, form, label, legend,
|
13 |
-
table, caption, tbody, tfoot, thead, tr, th, td,
|
14 |
-
article, aside, canvas, details, embed,
|
15 |
-
figure, figcaption, footer, header, hgroup,
|
16 |
-
menu, nav, output, ruby, section, summary,
|
17 |
-
time, mark, audio, video {
|
18 |
-
margin: 0;
|
19 |
-
padding: 0;
|
20 |
-
border: 0;
|
21 |
-
font-size: 100%;
|
22 |
-
/* font: inherit;*/
|
23 |
-
vertical-align: baseline;
|
24 |
-
}
|
25 |
-
/* HTML5 display-role reset for older browsers */
|
26 |
-
article, aside, details, figcaption, figure,
|
27 |
-
footer, header, hgroup, menu, nav, section {
|
28 |
-
display: block;
|
29 |
-
}
|
30 |
-
body {
|
31 |
-
line-height: 1;
|
32 |
-
}
|
33 |
-
ol, ul {
|
34 |
-
list-style: none;
|
35 |
-
}
|
36 |
-
blockquote, q {
|
37 |
-
quotes: none;
|
38 |
-
}
|
39 |
-
blockquote:before, blockquote:after,
|
40 |
-
q:before, q:after {
|
41 |
-
content: '';
|
42 |
-
content: none;
|
43 |
-
}
|
44 |
-
table {
|
45 |
-
border-collapse: collapse;
|
46 |
-
border-spacing: 0;
|
47 |
-
}
|
1 |
+
a,abbr,acronym,address,applet,article,aside,audio,b,big,blockquote,body,canvas,caption,center,cite,code,dd,del,details,dfn,div,dl,dt,em,embed,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,html,i,iframe,img,ins,kbd,label,legend,li,mark,menu,nav,object,ol,output,p,pre,q,ruby,s,samp,section,small,span,strike,strong,sub,summary,sup,table,tbody,td,tfoot,th,thead,time,tr,tt,u,ul,var,video{margin:0;padding:0;border:0;font-size:100%;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:after,blockquote:before,q:after,q:before{content:'';content:none}table{border-collapse:collapse;border-spacing:0}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
css/wordpress_file_upload_style.css
CHANGED
@@ -1,728 +1 @@
|
|
1 |
-
/* File Textbox Styles */
|
2 |
-
input[type="text"].file_input_textbox
|
3 |
-
{
|
4 |
-
position: relative;
|
5 |
-
width: 150px;
|
6 |
-
height: 25px;
|
7 |
-
margin: 0px;
|
8 |
-
padding: 0px;
|
9 |
-
border: 1px solid;
|
10 |
-
border-color: #BBBBBB;
|
11 |
-
background-color: white;
|
12 |
-
color: black;
|
13 |
-
}
|
14 |
-
|
15 |
-
input[type="text"].file_input_textbox:disabled
|
16 |
-
{
|
17 |
-
position: relative;
|
18 |
-
width: 150px;
|
19 |
-
height: 25px;
|
20 |
-
margin: 0px;
|
21 |
-
padding: 0px;
|
22 |
-
border: 1px solid;
|
23 |
-
border-color: #BBBBBB;
|
24 |
-
background-color: white;
|
25 |
-
color: silver;
|
26 |
-
}
|
27 |
-
|
28 |
-
input[type="text"].file_input_textbox_nofile
|
29 |
-
{
|
30 |
-
position: relative;
|
31 |
-
width: 150px;
|
32 |
-
height: 25px;
|
33 |
-
margin: 0px;
|
34 |
-
padding: 0px;
|
35 |
-
border: 1px solid;
|
36 |
-
border-color: #BBBBBB;
|
37 |
-
background-color: red;
|
38 |
-
color: black;
|
39 |
-
}
|
40 |
-
|
41 |
-
/* Upload Form and Button Styles */
|
42 |
-
form.file_input_uploadform
|
43 |
-
{
|
44 |
-
position: relative;
|
45 |
-
width: 100px;
|
46 |
-
height: 27px;
|
47 |
-
overflow: hidden;
|
48 |
-
margin: 0px;
|
49 |
-
padding: 0px;
|
50 |
-
}
|
51 |
-
|
52 |
-
input[type="button"].file_input_button
|
53 |
-
{
|
54 |
-
width: 100px;
|
55 |
-
height: 27px;
|
56 |
-
position: absolute;
|
57 |
-
top: 0px;
|
58 |
-
margin: 0px;
|
59 |
-
padding: 0px;
|
60 |
-
background-color: #EEEEEE;
|
61 |
-
color: #555555;
|
62 |
-
/* background-attachment: scroll; */
|
63 |
-
background-image: url("../images/white-grad-active.png");
|
64 |
-
background-position: left top;
|
65 |
-
background-repeat: repeat-x;
|
66 |
-
border-style: solid;
|
67 |
-
border-width: 1px;
|
68 |
-
border-color: #BBBBBB;
|
69 |
-
-webkit-border-radius: 2px;
|
70 |
-
-moz-border-radius: 2px;
|
71 |
-
-khtml-border-radius: 2px;
|
72 |
-
border-radius: 2px;
|
73 |
-
}
|
74 |
-
|
75 |
-
input[type="button"].file_input_button_hover
|
76 |
-
{
|
77 |
-
width: 100px;
|
78 |
-
height: 27px;
|
79 |
-
position: absolute;
|
80 |
-
top: 0px;
|
81 |
-
margin: 0px;
|
82 |
-
padding: 0px;
|
83 |
-
background-color: #EEEEEE;
|
84 |
-
color: #111111;
|
85 |
-
/* background-attachment: scroll; */
|
86 |
-
background-image: url("../images/white-grad-active.png");
|
87 |
-
background-position: left top;
|
88 |
-
background-repeat: repeat-x;
|
89 |
-
border-style: solid;
|
90 |
-
border-width: 1px;
|
91 |
-
border-color: #333333;
|
92 |
-
-webkit-border-radius: 2px;
|
93 |
-
-moz-border-radius: 2px;
|
94 |
-
-khtml-border-radius: 2px;
|
95 |
-
border-radius: 2px;
|
96 |
-
}
|
97 |
-
|
98 |
-
input[type="button"].file_input_button:disabled, input[type="button"].file_input_button_hover:disabled
|
99 |
-
{
|
100 |
-
width: 100px;
|
101 |
-
height: 27px;
|
102 |
-
position: absolute;
|
103 |
-
top: 0px;
|
104 |
-
margin: 0px;
|
105 |
-
padding: 0px;
|
106 |
-
background-color: #EEEEEE;
|
107 |
-
color: silver;
|
108 |
-
/* background-attachment: scroll; */
|
109 |
-
background-image: url("../images/white-grad-active.png");
|
110 |
-
background-position: left top;
|
111 |
-
background-repeat: repeat-x;
|
112 |
-
border-style: solid;
|
113 |
-
border-width: 1px;
|
114 |
-
border-color: #BBBBBB;
|
115 |
-
-webkit-border-radius: 2px;
|
116 |
-
-moz-border-radius: 2px;
|
117 |
-
-khtml-border-radius: 2px;
|
118 |
-
border-radius: 2px;
|
119 |
-
}
|
120 |
-
|
121 |
-
input[type="button"].file_input_submit
|
122 |
-
{
|
123 |
-
width: 100px;
|
124 |
-
height: 27px;
|
125 |
-
position: relative;
|
126 |
-
margin: 0px;
|
127 |
-
padding: 0px;
|
128 |
-
background-color: #EEEEEE;
|
129 |
-
color: #555555;
|
130 |
-
/* background-attachment: scroll; */
|
131 |
-
background-image: url("../images/white-grad-active.png");
|
132 |
-
background-position: left top;
|
133 |
-
background-repeat: repeat-x;
|
134 |
-
border-style: solid;
|
135 |
-
border-width: 1px;
|
136 |
-
border-color: #BBBBBB;
|
137 |
-
-webkit-border-radius: 2px;
|
138 |
-
-moz-border-radius: 2px;
|
139 |
-
-khtml-border-radius: 2px;
|
140 |
-
border-radius: 2px;
|
141 |
-
}
|
142 |
-
|
143 |
-
input[type="button"].file_input_submit:hover, input[type="button"].file_input_submit:focus
|
144 |
-
{
|
145 |
-
width: 100px;
|
146 |
-
height: 27px;
|
147 |
-
position: relative;
|
148 |
-
margin: 0px;
|
149 |
-
padding: 0px;
|
150 |
-
background-color: #EEEEEE;
|
151 |
-
color: #111111;
|
152 |
-
/* background-attachment: scroll; */
|
153 |
-
background-image: url("../images/white-grad-active.png");
|
154 |
-
background-position: left top;
|
155 |
-
background-repeat: repeat-x;
|
156 |
-
border-style: solid;
|
157 |
-
border-width: 1px;
|
158 |
-
border-color: #333333;
|
159 |
-
-webkit-border-radius: 2px;
|
160 |
-
-moz-border-radius: 2px;
|
161 |
-
-khtml-border-radius: 2px;
|
162 |
-
border-radius: 2px;
|
163 |
-
}
|
164 |
-
|
165 |
-
input[type="button"].file_input_submit:disabled
|
166 |
-
{
|
167 |
-
width: 100px;
|
168 |
-
height: 27px;
|
169 |
-
position: relative;
|
170 |
-
margin: 0px;
|
171 |
-
padding: 0px;
|
172 |
-
background-color: #EEEEEE;
|
173 |
-
color: silver;
|
174 |
-
/* background-attachment: scroll; */
|
175 |
-
background-image: url("../images/white-grad-active.png");
|
176 |
-
background-position: left top;
|
177 |
-
background-repeat: repeat-x;
|
178 |
-
border-style: solid;
|
179 |
-
border-width: 1px;
|
180 |
-
border-color: #BBBBBB;
|
181 |
-
-webkit-border-radius: 2px;
|
182 |
-
-moz-border-radius: 2px;
|
183 |
-
-khtml-border-radius: 2px;
|
184 |
-
border-radius: 2px;
|
185 |
-
}
|
186 |
-
|
187 |
-
input[type="file"].file_input_hidden
|
188 |
-
{
|
189 |
-
font-size: 45px;
|
190 |
-
position: absolute;
|
191 |
-
right: 0px;
|
192 |
-
top: 0px;
|
193 |
-
margin: 0px;
|
194 |
-
padding: 0px;
|
195 |
-
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
|
196 |
-
filter: alpha(opacity=0);
|
197 |
-
-moz-opacity: 0;
|
198 |
-
-khtml-opacity: 0;
|
199 |
-
opacity: 0;
|
200 |
-
}
|
201 |
-
|
202 |
-
/* Simple Progressbar Styles */
|
203 |
-
div.file_progress_bar
|
204 |
-
{
|
205 |
-
display: block;
|
206 |
-
position: relative;
|
207 |
-
width: auto;
|
208 |
-
border: 1px solid #333333;
|
209 |
-
margin: 0;
|
210 |
-
padding: 4px;
|
211 |
-
}
|
212 |
-
|
213 |
-
div.file_progress_inner
|
214 |
-
{
|
215 |
-
display: block;
|
216 |
-
width: 100%;
|
217 |
-
height: 6px;
|
218 |
-
margin: 0;
|
219 |
-
padding: 0;
|
220 |
-
border: 1px solid silver;
|
221 |
-
background-color: white;
|
222 |
-
}
|
223 |
-
|
224 |
-
img.file_progress_imagesafe
|
225 |
-
{
|
226 |
-
width: 100%;
|
227 |
-
height: 6px;
|
228 |
-
}
|
229 |
-
|
230 |
-
span.file_progress_noanimation
|
231 |
-
{
|
232 |
-
display: block;
|
233 |
-
width: 0%;
|
234 |
-
height: 6px;
|
235 |
-
margin: 0;
|
236 |
-
padding: 0;
|
237 |
-
border-style: none;
|
238 |
-
background-color: rgb(43,194,83);
|
239 |
-
position: relative;
|
240 |
-
overflow: hidden;
|
241 |
-
}
|
242 |
-
|
243 |
-
span.file_progress_progressive
|
244 |
-
{
|
245 |
-
display: block;
|
246 |
-
width: auto;
|
247 |
-
height: 6px;
|
248 |
-
margin: 0;
|
249 |
-
padding: 0;
|
250 |
-
border-style: none;
|
251 |
-
background-color: rgb(43,194,83);
|
252 |
-
position: relative;
|
253 |
-
overflow: hidden;
|
254 |
-
}
|
255 |
-
|
256 |
-
span.file_progress_shuffle
|
257 |
-
{
|
258 |
-
display: block;
|
259 |
-
width: 25%;
|
260 |
-
height: 6px;
|
261 |
-
margin: 0;
|
262 |
-
padding: 0;
|
263 |
-
border-style: none;
|
264 |
-
background-color: rgb(43,194,83);
|
265 |
-
position: relative;
|
266 |
-
-webkit-animation: shuffle 1s linear infinite alternate;
|
267 |
-
-moz-animation: shuffle 1s linear infinite alternate;
|
268 |
-
-o-animation: shuffle 1s linear infinite alternate;
|
269 |
-
animation: shuffle 1s linear infinite alternate;
|
270 |
-
overflow: hidden;
|
271 |
-
}
|
272 |
-
|
273 |
-
span.file_progress_progressive:after
|
274 |
-
{
|
275 |
-
content: "";
|
276 |
-
position: absolute;
|
277 |
-
top: 0;
|
278 |
-
left: 0;
|
279 |
-
bottom: 0;
|
280 |
-
right: 0;
|
281 |
-
background-image: -webkit-gradient(linear, 0 0, 100% 100%, color-stop(.25, rgba(255, 255, 255, .2)), color-stop(.25, transparent), color-stop(.5, transparent), color-stop(.5, rgba(255, 255, 255, .2)), color-stop(.75, rgba(255, 255, 255, .2)), color-stop(.75, transparent), to(transparent) );
|
282 |
-
background-image: -moz-linear-gradient( -45deg, rgba(255, 255, 255, .2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .2) 50%, rgba(255, 255, 255, .2) 75%, transparent 75%, transparent );
|
283 |
-
z-index: 1;
|
284 |
-
-webkit-background-size: 30px 30px;
|
285 |
-
-moz-background-size: 30px 30px;
|
286 |
-
background-size: 30px 30px;
|
287 |
-
-webkit-animation: lengthen 2s linear infinite;
|
288 |
-
-moz-animation: lengthen 2s linear infinite;
|
289 |
-
-o-animation: lengthen 2s linear infinite;
|
290 |
-
animation: lengthen 2s linear infinite;
|
291 |
-
overflow: hidden;
|
292 |
-
}
|
293 |
-
|
294 |
-
@-webkit-keyframes shuffle { from { left: 0%; } to { left: 75%; } }
|
295 |
-
|
296 |
-
@-moz-keyframes shuffle { from { left: 0%; } to { left: 75%; } }
|
297 |
-
|
298 |
-
@-o-keyframes shuffle { from { left: 0%; } to { left: 75%; } }
|
299 |
-
|
300 |
-
@keyframes shuffle { from { left: 0%; } to { left: 75%; } }
|
301 |
-
|
302 |
-
@-webkit-keyframes lengthen { from { background-position: 0 0; } to { background-position: 30px 30px; } }
|
303 |
-
|
304 |
-
@-moz-keyframes lengthen { from { background-position: 0 0; } to { background-position: 30px 30px; } }
|
305 |
-
|
306 |
-
@-o-keyframes lengthen { from { background-position: 0 0; } to { background-position: 30px 30px; } }
|
307 |
-
|
308 |
-
@keyframes lengthen { from { background-position: 0 0; } to { background-position: 30px 30px; } }
|
309 |
-
|
310 |
-
/* SImple Message Styles */
|
311 |
-
span.file_messagebox_inner
|
312 |
-
{
|
313 |
-
display: block;
|
314 |
-
width: 340px;
|
315 |
-
margin: 0px;
|
316 |
-
font-size: small;
|
317 |
-
padding: 10px;
|
318 |
-
border-style: solid;
|
319 |
-
border-width: 1px;
|
320 |
-
border-color: #D3D3D3;
|
321 |
-
background-color: #F5F5F5;
|
322 |
-
color: black;
|
323 |
-
line-height: 1.2;
|
324 |
-
}
|
325 |
-
|
326 |
-
/* General Styles */
|
327 |
-
div.file_div_clean
|
328 |
-
{
|
329 |
-
display: table;
|
330 |
-
position: relative;
|
331 |
-
margin: 0px;
|
332 |
-
padding: 0px;
|
333 |
-
border-style: none;
|
334 |
-
background: none;
|
335 |
-
color: black;
|
336 |
-
line-height: 1;
|
337 |
-
}
|
338 |
-
|
339 |
-
div.file_space_clean
|
340 |
-
{
|
341 |
-
display: block;
|
342 |
-
margin: 0 0 2px 0;
|
343 |
-
padding: 0px;
|
344 |
-
border-style: none;
|
345 |
-
background: none;
|
346 |
-
color: black;
|
347 |
-
}
|
348 |
-
|
349 |
-
table.file_table_clean
|
350 |
-
{
|
351 |
-
margin: 0px;
|
352 |
-
padding: 0px;
|
353 |
-
border: none;
|
354 |
-
border-spacing: 0px;
|
355 |
-
background: none;
|
356 |
-
color: black;
|
357 |
-
width: auto;
|
358 |
-
}
|
359 |
-
|
360 |
-
td.file_td_clean
|
361 |
-
{
|
362 |
-
margin: 0px;
|
363 |
-
padding: 0px;
|
364 |
-
border: none;
|
365 |
-
border-spacing: 0px;
|
366 |
-
background: none;
|
367 |
-
color: black;
|
368 |
-
vertical-align: middle;
|
369 |
-
}
|
370 |
-
|
371 |
-
span.file_item_clean
|
372 |
-
{
|
373 |
-
margin: 0px;
|
374 |
-
padding: 0px;
|
375 |
-
border-style: none;
|
376 |
-
background: none;
|
377 |
-
color: black;
|
378 |
-
}
|
379 |
-
|
380 |
-
select.file_item_clean
|
381 |
-
{
|
382 |
-
margin: 0px;
|
383 |
-
padding: 0px;
|
384 |
-
height: 25px;
|
385 |
-
border-style: none;
|
386 |
-
background: none;
|
387 |
-
color: black;
|
388 |
-
}
|
389 |
-
|
390 |
-
select.file_item_clean:disabled
|
391 |
-
{
|
392 |
-
margin: 0px;
|
393 |
-
padding: 0px;
|
394 |
-
height: 25px;
|
395 |
-
border-style: none;
|
396 |
-
background: none;
|
397 |
-
color: silver;
|
398 |
-
}
|
399 |
-
|
400 |
-
select.file_item_clean option
|
401 |
-
{
|
402 |
-
background: white;
|
403 |
-
color: black;
|
404 |
-
}
|
405 |
-
|
406 |
-
span.file_title_clean
|
407 |
-
{
|
408 |
-
margin: 0px;
|
409 |
-
padding: 0px;
|
410 |
-
border-style: none;
|
411 |
-
background: none;
|
412 |
-
color: black;
|
413 |
-
}
|
414 |
-
|
415 |
-
/* Userdata styles */
|
416 |
-
div.file_userdata_container
|
417 |
-
{
|
418 |
-
margin: 0;
|
419 |
-
padding: 0;
|
420 |
-
white-space: nowrap;
|
421 |
-
}
|
422 |
-
|
423 |
-
label.file_userdata_label
|
424 |
-
{
|
425 |
-
margin: 0;
|
426 |
-
width: 40%;
|
427 |
-
}
|
428 |
-
|
429 |
-
input[type="text"].file_userdata_message, input[type="text"].file_userdata_message_required
|
430 |
-
{
|
431 |
-
width: 60%;
|
432 |
-
height: 25px;
|
433 |
-
margin: 0px;
|
434 |
-
padding: 0px;
|
435 |
-
border: 1px solid;
|
436 |
-
border-color: #BBBBBB;
|
437 |
-
background: none;
|
438 |
-
color: black;
|
439 |
-
}
|
440 |
-
|
441 |
-
input[type="text"].file_userdata_message:disabled, input[type="text"].file_userdata_message_required:disabled
|
442 |
-
{
|
443 |
-
width: 60%;
|
444 |
-
height: 25px;
|
445 |
-
margin: 0px;
|
446 |
-
padding: 0px;
|
447 |
-
border: 1px solid;
|
448 |
-
border-color: #BBBBBB;
|
449 |
-
background: none;
|
450 |
-
color: silver;
|
451 |
-
}
|
452 |
-
|
453 |
-
input[type="text"].file_userdata_message_required_empty
|
454 |
-
{
|
455 |
-
width: 60%;
|
456 |
-
height: 25px;
|
457 |
-
margin: 0px;
|
458 |
-
padding: 0px;
|
459 |
-
border: 1px solid;
|
460 |
-
border-color: #BBBBBB;
|
461 |
-
background-color: red;
|
462 |
-
color: black;
|
463 |
-
}
|
464 |
-
|
465 |
-
/* Message Block Styles */
|
466 |
-
table.file_messageblock_table
|
467 |
-
{
|
468 |
-
margin: 0;
|
469 |
-
padding: 0;
|
470 |
-
border: none;
|
471 |
-
}
|
472 |
-
|
473 |
-
tr.file_messageblock_header_tr
|
474 |
-
{
|
475 |
-
}
|
476 |
-
|
477 |
-
td.file_messageblock_header_td
|
478 |
-
{
|
479 |
-
border: 1px solid #dddddd;
|
480 |
-
margin: 0;
|
481 |
-
padding: 0;
|
482 |
-
}
|
483 |
-
|
484 |
-
div.file_messageblock_header
|
485 |
-
{
|
486 |
-
margin: 0;
|
487 |
-
padding: 2px;
|
488 |
-
}
|
489 |
-
|
490 |
-
label.file_messageblock_header_label
|
491 |
-
{
|
492 |
-
font-weight: bold;
|
493 |
-
font-size: 12px;
|
494 |
-
line-height: 1;
|
495 |
-
}
|
496 |
-
|
497 |
-
td.file_messageblock_arrow_td
|
498 |
-
{
|
499 |
-
border: 1px solid #dddddd;
|
500 |
-
margin: 0;
|
501 |
-
padding: 0;
|
502 |
-
width: 20px;
|
503 |
-
vertical-align: middle;
|
504 |
-
}
|
505 |
-
|
506 |
-
div.file_messageblock_header_arrow_up
|
507 |
-
{
|
508 |
-
width: 0;
|
509 |
-
height: 0;
|
510 |
-
border-left: 5px solid transparent;
|
511 |
-
border-right: 5px solid transparent;
|
512 |
-
border-bottom: 5px solid #555555;
|
513 |
-
margin: 5px 1px 1px 5px;
|
514 |
-
/* ie6 height fix */
|
515 |
-
font-size: 0;
|
516 |
-
line-height: 0;
|
517 |
-
/* ie6 transparent fix */
|
518 |
-
_border-right-color: pink;
|
519 |
-
_border-left-color: pink;
|
520 |
-
_filter: chroma(color=pink);
|
521 |
-
}
|
522 |
-
|
523 |
-
div.file_messageblock_header_arrow_down
|
524 |
-
{
|
525 |
-
width: 0;
|
526 |
-
height: 0;
|
527 |
-
border-left: 5px solid transparent;
|
528 |
-
border-right: 5px solid transparent;
|
529 |
-
border-top: 5px solid #555555;
|
530 |
-
margin: 5px 1px 1px 5px;
|
531 |
-
/* ie6 height fix */
|
532 |
-
font-size: 0;
|
533 |
-
line-height: 0;
|
534 |
-
/* ie6 transparent fix */
|
535 |
-
_border-right-color: pink;
|
536 |
-
_border-left-color: pink;
|
537 |
-
_filter: chroma(color=pink);
|
538 |
-
}
|
539 |
-
|
540 |
-
tr.file_messageblock_subheader_tr
|
541 |
-
{
|
542 |
-
}
|
543 |
-
|
544 |
-
td.file_messageblock_subheader_td
|
545 |
-
{
|
546 |
-
margin: 0;
|
547 |
-
padding: 0;
|
548 |
-
border: 1px solid #dddddd;
|
549 |
-
}
|
550 |
-
|
551 |
-
div.file_messageblock_subheader_message
|
552 |
-
{
|
553 |
-
margin: 0;
|
554 |
-
padding: 2px;
|
555 |
-
background: none;
|
556 |
-
}
|
557 |
-
|
558 |
-
label.file_messageblock_subheader_messagelabel
|
559 |
-
{
|
560 |
-
font-weight: normal;
|
561 |
-
font-size: 12px;
|
562 |
-
line-height: 1;
|
563 |
-
}
|
564 |
-
|
565 |
-
div.file_messageblock_subheader_adminmessage
|
566 |
-
{
|
567 |
-
margin: 0;
|
568 |
-
padding: 2px;
|
569 |
-
background-color: #F7F7F7;
|
570 |
-
overflow: scroll;
|
571 |
-
}
|
572 |
-
|
573 |
-
label.file_messageblock_subheader_debugmessage_label
|
574 |
-
{
|
575 |
-
margin: 0;
|
576 |
-
padding: 0;
|
577 |
-
background: none;
|
578 |
-
border: none;
|
579 |
-
font-weight: bold;
|
580 |
-
}
|
581 |
-
|
582 |
-
div.file_messageblock_subheader_debugmessage_container
|
583 |
-
{
|
584 |
-
margin: 0 0 0 20px;
|
585 |
-
padding: 0px;
|
586 |
-
background: none;
|
587 |
-
border: none;
|
588 |
-
font-size: 10px;
|
589 |
-
}
|
590 |
-
|
591 |
-
label.file_messageblock_subheader_adminmessagelabel
|
592 |
-
{
|
593 |
-
font-weight: normal;
|
594 |
-
font-size: 12px;
|
595 |
-
font-style: italic;
|
596 |
-
line-height: 1;
|
597 |
-
}
|
598 |
-
|
599 |
-
tr.file_messageblock_fileheader_tr
|
600 |
-
{
|
601 |
-
}
|
602 |
-
|
603 |
-
td.file_messageblock_filenumber_td
|
604 |
-
{
|
605 |
-
width: 30px;
|
606 |
-
margin: 0;
|
607 |
-
padding: 2px;
|
608 |
-
text-align: center;
|
609 |
-
vertical-align: middle;
|
610 |
-
font-weight: bold;
|
611 |
-
font-size: 11px;
|
612 |
-
line-height: 1;
|
613 |
-
border: 1px solid #dddddd;
|
614 |
-
}
|
615 |
-
|
616 |
-
td.file_messageblock_fileheader_td
|
617 |
-
{
|
618 |
-
margin: 0;
|
619 |
-
padding: 0;
|
620 |
-
border: 1px solid #dddddd;
|
621 |
-
}
|
622 |
-
|
623 |
-
div.file_messageblock_fileheader
|
624 |
-
{
|
625 |
-
margin: 0;
|
626 |
-
padding: 2px;
|
627 |
-
}
|
628 |
-
|
629 |
-
label.file_messageblock_fileheader_label
|
630 |
-
{
|
631 |
-
font-weight: bold;
|
632 |
-
font-size: 11px;
|
633 |
-
line-height: 1;
|
634 |
-
}
|
635 |
-
|
636 |
-
td.file_messageblock_filearrow_td
|
637 |
-
{
|
638 |
-
border: 1px solid #dddddd;
|
639 |
-
margin: 0;
|
640 |
-
padding: 0;
|
641 |
-
width: 20px;
|
642 |
-
border: 1px solid #dddddd;
|
643 |
-
vertical-align: middle;
|
644 |
-
}
|
645 |
-
|
646 |
-
div.file_messageblock_file_arrow_up
|
647 |
-
{
|
648 |
-
width: 0;
|
649 |
-
height: 0;
|
650 |
-
border-left: 4px solid transparent;
|
651 |
-
border-right: 4px solid transparent;
|
652 |
-
border-bottom: 4px solid #555555;
|
653 |
-
margin: 5px 1px 1px 6px;
|
654 |
-
/* ie6 height fix */
|
655 |
-
font-size: 0;
|
656 |
-
line-height: 0;
|
657 |
-
/* ie6 transparent fix */
|
658 |
-
_border-right-color: pink;
|
659 |
-
_border-left-color: pink;
|
660 |
-
_filter: chroma(color=pink);
|
661 |
-
}
|
662 |
-
|
663 |
-
div.file_messageblock_file_arrow_down
|
664 |
-
{
|
665 |
-
width: 0;
|
666 |
-
height: 0;
|
667 |
-
border-left: 4px solid transparent;
|
668 |
-
border-right: 4px solid transparent;
|
669 |
-
border-top: 4px solid #555555;
|
670 |
-
margin: 5px 1px 1px 6px;
|
671 |
-
/* ie6 height fix */
|
672 |
-
font-size: 0;
|
673 |
-
line-height: 0;
|
674 |
-
/* ie6 transparent fix */
|
675 |
-
_border-right-color: pink;
|
676 |
-
_border-left-color: pink;
|
677 |
-
_filter: chroma(color=pink);
|
678 |
-
}
|
679 |
-
|
680 |
-
tr.file_messageblock_filesubheader_tr
|
681 |
-
{
|
682 |
-
}
|
683 |
-
|
684 |
-
td.file_messageblock_filesubheaderempty_td
|
685 |
-
{
|
686 |
-
width: 30px;
|
687 |
-
margin: 0;
|
688 |
-
padding: 0;
|
689 |
-
border: 1px solid #dddddd;
|
690 |
-
}
|
691 |
-
|
692 |
-
td.file_messageblock_filesubheader_td
|
693 |
-
{
|
694 |
-
margin: 0;
|
695 |
-
padding: 0;
|
696 |
-
border: 1px solid #dddddd;
|
697 |
-
}
|
698 |
-
|
699 |
-
div.file_messageblock_filesubheader_message
|
700 |
-
{
|
701 |
-
margin: 0;
|
702 |
-
padding: 2px;
|
703 |
-
background: none;
|
704 |
-
}
|
705 |
-
|
706 |
-
label.file_messageblock_filesubheader_messagelabel
|
707 |
-
{
|
708 |
-
font-weight: normal;
|
709 |
-
font-size: 11px;
|
710 |
-
line-height: 1;
|
711 |
-
}
|
712 |
-
|
713 |
-
div.file_messageblock_filesubheader_adminmessage
|
714 |
-
{
|
715 |
-
margin: 0;
|
716 |
-
padding: 2px;
|
717 |
-
background-color: #F7F7F7;
|
718 |
-
}
|
719 |
-
|
720 |
-
label.file_messageblock_filesubheader_adminmessagelabel
|
721 |
-
{
|
722 |
-
font-weight: normal;
|
723 |
-
font-size: 11px;
|
724 |
-
font-style: italic;
|
725 |
-
line-height: 1;
|
726 |
-
}
|
727 |
-
|
728 |
-
|
1 |
+
input[type=text].file_input_textbox{position:relative;width:150px;height:25px;margin:0;padding:0;border:1px solid;border-color:#BBB;background-color:#fff;color:#000}input[type=text].file_input_textbox:disabled{position:relative;width:150px;height:25px;margin:0;padding:0;border:1px solid;border-color:#BBB;background-color:#fff;color:silver}input[type=text].file_input_textbox_nofile{position:relative;width:150px;height:25px;margin:0;padding:0;border:1px solid;border-color:#BBB;background-color:red;color:#000}form.file_input_uploadform{position:relative;width:100px;height:27px;overflow:hidden;margin:0;padding:0}input[type=button].file_input_button{width:100px;height:27px;position:absolute;top:0;margin:0;padding:0;background-color:#EEE;color:#555;background-image:url(../images/white-grad-active.png);background-position:left top;background-repeat:repeat-x;border-style:solid;border-width:1px;border-color:#BBB;-webkit-border-radius:2px;-moz-border-radius:2px;-khtml-border-radius:2px;border-radius:2px}input[type=button].file_input_button_hover{width:100px;height:27px;position:absolute;top:0;margin:0;padding:0;background-color:#EEE;color:#111;background-image:url(../images/white-grad-active.png);background-position:left top;background-repeat:repeat-x;border-style:solid;border-width:1px;border-color:#333;-webkit-border-radius:2px;-moz-border-radius:2px;-khtml-border-radius:2px;border-radius:2px}input[type=button].file_input_button:disabled,input[type=button].file_input_button_hover:disabled{width:100px;height:27px;position:absolute;top:0;margin:0;padding:0;background-color:#EEE;color:silver;background-image:url(../images/white-grad-active.png);background-position:left top;background-repeat:repeat-x;border-style:solid;border-width:1px;border-color:#BBB;-webkit-border-radius:2px;-moz-border-radius:2px;-khtml-border-radius:2px;border-radius:2px}input[type=button].file_input_submit{width:100px;height:27px;position:relative;margin:0;padding:0;background-color:#EEE;color:#555;background-image:url(../images/white-grad-active.png);background-position:left top;background-repeat:repeat-x;border-style:solid;border-width:1px;border-color:#BBB;-webkit-border-radius:2px;-moz-border-radius:2px;-khtml-border-radius:2px;border-radius:2px}input[type=button].file_input_submit:focus,input[type=button].file_input_submit:hover{width:100px;height:27px;position:relative;margin:0;padding:0;background-color:#EEE;color:#111;background-image:url(../images/white-grad-active.png);background-position:left top;background-repeat:repeat-x;border-style:solid;border-width:1px;border-color:#333;-webkit-border-radius:2px;-moz-border-radius:2px;-khtml-border-radius:2px;border-radius:2px}input[type=button].file_input_submit:disabled{width:100px;height:27px;position:relative;margin:0;padding:0;background-color:#EEE;color:silver;background-image:url(../images/white-grad-active.png);background-position:left top;background-repeat:repeat-x;border-style:solid;border-width:1px;border-color:#BBB;-webkit-border-radius:2px;-moz-border-radius:2px;-khtml-border-radius:2px;border-radius:2px}input[type=file].file_input_hidden{font-size:45px;position:absolute;right:0;top:0;margin:0;padding:0;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";filter:alpha(opacity=0);-moz-opacity:0;-khtml-opacity:0;opacity:0}div.file_progress_bar{display:block;position:relative;width:auto;border:1px solid #333;margin:0;padding:4px}div.file_progress_inner{display:block;width:100%;height:6px;margin:0;padding:0;border:1px solid silver;background-color:#fff}img.file_progress_imagesafe{width:100%;height:6px}span.file_progress_noanimation{display:block;width:0;height:6px;margin:0;padding:0;border-style:none;background-color:#2bc253;position:relative;overflow:hidden}span.file_progress_progressive{display:block;width:auto;height:6px;margin:0;padding:0;border-style:none;background-color:#2bc253;position:relative;overflow:hidden}span.file_progress_shuffle{display:block;width:25%;height:6px;margin:0;padding:0;border-style:none;background-color:#2bc253;position:relative;-webkit-animation:shuffle 1s linear infinite alternate;-moz-animation:shuffle 1s linear infinite alternate;-o-animation:shuffle 1s linear infinite alternate;animation:shuffle 1s linear infinite alternate;overflow:hidden}span.file_progress_progressive:after{content:"";position:absolute;top:0;left:0;bottom:0;right:0;background-image:-webkit-gradient(linear,0 0,100% 100%,color-stop(.25,rgba(255,255,255,.2)),color-stop(.25,transparent),color-stop(.5,transparent),color-stop(.5,rgba(255,255,255,.2)),color-stop(.75,rgba(255,255,255,.2)),color-stop(.75,transparent),to(transparent));background-image:-moz-linear-gradient(-45deg,rgba(255,255,255,.2) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.2) 50%,rgba(255,255,255,.2) 75%,transparent 75%,transparent);z-index:1;-webkit-background-size:30px 30px;-moz-background-size:30px 30px;background-size:30px 30px;-webkit-animation:lengthen 2s linear infinite;-moz-animation:lengthen 2s linear infinite;-o-animation:lengthen 2s linear infinite;animation:lengthen 2s linear infinite;overflow:hidden}@-webkit-keyframes shuffle{from{left:0}to{left:75%}}@-moz-keyframes shuffle{from{left:0}to{left:75%}}@-o-keyframes shuffle{from{left:0}to{left:75%}}@keyframes shuffle{from{left:0}to{left:75%}}@-webkit-keyframes lengthen{from{background-position:0 0}to{background-position:30px 30px}}@-moz-keyframes lengthen{from{background-position:0 0}to{background-position:30px 30px}}@-o-keyframes lengthen{from{background-position:0 0}to{background-position:30px 30px}}@keyframes lengthen{from{background-position:0 0}to{background-position:30px 30px}}span.file_messagebox_inner{display:block;width:340px;margin:0;font-size:small;padding:10px;border-style:solid;border-width:1px;border-color:#D3D3D3;background-color:#F5F5F5;color:#000;line-height:1.2}div.file_div_clean{display:table;position:relative;margin:0;padding:0;border-style:none;background:0 0;color:#000;line-height:1}div.file_space_clean{display:block;margin:0 0 2px;padding:0;border-style:none;background:0 0;color:#000}table.file_table_clean{margin:0;padding:0;border:none;border-spacing:0;background:0 0;color:#000;width:auto}td.file_td_clean{margin:0;padding:0;border:none;border-spacing:0;background:0 0;color:#000;vertical-align:middle}span.file_item_clean{margin:0;padding:0;border-style:none;background:0 0;color:#000}select.file_item_clean{margin:0;padding:0;height:25px;border-style:none;background:0 0;color:#000}select.file_item_clean:disabled{margin:0;padding:0;height:25px;border-style:none;background:0 0;color:silver}select.file_item_clean option{background:#fff;color:#000}span.file_title_clean{margin:0;padding:0;border-style:none;background:0 0;color:#000}div.file_userdata_container{margin:0;padding:0;white-space:nowrap}label.file_userdata_label{margin:0;width:40%}input[type=text].file_userdata_message,input[type=text].file_userdata_message_required{width:60%;height:25px;margin:0;padding:0;border:1px solid;border-color:#BBB;background:0 0;color:#000}input[type=text].file_userdata_message:disabled,input[type=text].file_userdata_message_required:disabled{width:60%;height:25px;margin:0;padding:0;border:1px solid;border-color:#BBB;background:0 0;color:silver}input[type=text].file_userdata_message_required_empty{width:60%;height:25px;margin:0;padding:0;border:1px solid;border-color:#BBB;background-color:red;color:#000}table.file_messageblock_table{margin:0;padding:0;border:none}td.file_messageblock_header_td{border:1px solid #ddd;margin:0;padding:0}div.file_messageblock_header{margin:0;padding:2px}label.file_messageblock_header_label{font-weight:700;font-size:12px;line-height:1}td.file_messageblock_arrow_td{border:1px solid #ddd;margin:0;padding:0;width:20px;vertical-align:middle}div.file_messageblock_header_arrow_up{width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-bottom:5px solid #555;margin:5px 1px 1px 5px;font-size:0;line-height:0}div.file_messageblock_header_arrow_down{width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #555;margin:5px 1px 1px 5px;font-size:0;line-height:0}td.file_messageblock_subheader_td{margin:0;padding:0;border:1px solid #ddd}div.file_messageblock_subheader_message{margin:0;padding:2px;background:0 0}label.file_messageblock_subheader_messagelabel{font-weight:400;font-size:12px;line-height:1}div.file_messageblock_subheader_adminmessage{margin:0;padding:2px;background-color:#F7F7F7;overflow:scroll}label.file_messageblock_subheader_debugmessage_label{margin:0;padding:0;background:0 0;border:none;font-weight:700}div.file_messageblock_subheader_debugmessage_container{margin:0 0 0 20px;padding:0;background:0 0;border:none;font-size:10px}label.file_messageblock_subheader_adminmessagelabel{font-weight:400;font-size:12px;font-style:italic;line-height:1}td.file_messageblock_filenumber_td{width:30px;margin:0;padding:2px;text-align:center;vertical-align:middle;font-weight:700;font-size:11px;line-height:1;border:1px solid #ddd}td.file_messageblock_fileheader_td{margin:0;padding:0;border:1px solid #ddd}div.file_messageblock_fileheader{margin:0;padding:2px}label.file_messageblock_fileheader_label{font-weight:700;font-size:11px;line-height:1}td.file_messageblock_filearrow_td{margin:0;padding:0;width:20px;border:1px solid #ddd;vertical-align:middle}div.file_messageblock_file_arrow_up{width:0;height:0;border-left:4px solid transparent;border-right:4px solid transparent;border-bottom:4px solid #555;margin:5px 1px 1px 6px;font-size:0;line-height:0}div.file_messageblock_file_arrow_down{width:0;height:0;border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid #555;margin:5px 1px 1px 6px;font-size:0;line-height:0}td.file_messageblock_filesubheaderempty_td{width:30px;margin:0;padding:0;border:1px solid #ddd}td.file_messageblock_filesubheader_td{margin:0;padding:0;border:1px solid #ddd}div.file_messageblock_filesubheader_message{margin:0;padding:2px;background:0 0}label.file_messageblock_filesubheader_messagelabel{font-weight:400;font-size:11px;line-height:1}div.file_messageblock_filesubheader_adminmessage{margin:0;padding:2px;background-color:#F7F7F7}label.file_messageblock_filesubheader_adminmessagelabel{font-weight:400;font-size:11px;font-style:italic;line-height:1}div.wfu_overlay_editor{width:18px;height:18px;padding:2px;box-shadow:1px 1px 2px #aaa;position:absolute;z-index:2;display:none;background-color:#fff}.wfu_container:hover div.wfu_overlay_editor{display:block}div.wfu_overlay_editor:hover{background-color:#ff0}button.wfu_overlay_editor_button,button.wfu_overlay_editor_button:focus{background:0 0;border:none;margin:0;padding:0;width:100;height:100%;outline:0}div.wfu_overlay_container{position:absolute;width:100%;height:100%;top:0;left:0;margin:0;padding:0;background-color:rgba(255,255,255,.7);z-index:2;display:none}table.wfu_overlay_table,table.wfu_overlay_table td,table.wfu_overlay_table tr{border:none;margin:0;padding:0;background:0 0;width:100%;height:100%}table.wfu_overlay_table td{text-align:center;vertical-align:middle}div.wfu_overlay_container_inner{position:absolute;width:100%;height:100%;top:0;left:0;margin:0;padding:0;background:0 0}div.wfu_overlay_container label{margin-left:4px}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
css/wordpress_file_upload_style_safe.css
CHANGED
@@ -1,229 +1 @@
|
|
1 |
-
|
2 |
-
input.file_input_textbox
|
3 |
-
{
|
4 |
-
position: relative;
|
5 |
-
width: 150px;
|
6 |
-
height: 25px;
|
7 |
-
margin: 0px;
|
8 |
-
padding: 0px;
|
9 |
-
border: 1px solid;
|
10 |
-
border-color: #BBBBBB;
|
11 |
-
background-color: white;
|
12 |
-
color: black;
|
13 |
-
}
|
14 |
-
|
15 |
-
input.file_input_textbox:disabled
|
16 |
-
{
|
17 |
-
position: relative;
|
18 |
-
width: 150px;
|
19 |
-
height: 25px;
|
20 |
-
margin: 0px;
|
21 |
-
padding: 0px;
|
22 |
-
border: 1px solid;
|
23 |
-
border-color: #BBBBBB;
|
24 |
-
background-color: white;
|
25 |
-
color: silver;
|
26 |
-
}
|
27 |
-
|
28 |
-
input.file_input_textbox_nofile
|
29 |
-
{
|
30 |
-
position: relative;
|
31 |
-
width: 150px;
|
32 |
-
height: 25px;
|
33 |
-
margin: 0px;
|
34 |
-
padding: 0px;
|
35 |
-
border: 1px solid;
|
36 |
-
border-color: #BBBBBB;
|
37 |
-
background-color: red;
|
38 |
-
color: black;
|
39 |
-
}
|
40 |
-
|
41 |
-
/* Upload Form and Button Styles */
|
42 |
-
input.file_input_button
|
43 |
-
{
|
44 |
-
width: 100px;
|
45 |
-
height: 27px;
|
46 |
-
position: absolute;
|
47 |
-
top: 0px;
|
48 |
-
margin: 0px;
|
49 |
-
padding: 0px;
|
50 |
-
background-color: #EEEEEE;
|
51 |
-
color: #555555;
|
52 |
-
/* background-attachment: scroll; */
|
53 |
-
background-image: url("../images/white-grad-active.png");
|
54 |
-
background-position: left top;
|
55 |
-
background-repeat: repeat-x;
|
56 |
-
border-style: solid;
|
57 |
-
border-width: 1px;
|
58 |
-
border-color: #BBBBBB;
|
59 |
-
-webkit-border-radius: 2px;
|
60 |
-
-moz-border-radius: 2px;
|
61 |
-
-khtml-border-radius: 2px;
|
62 |
-
border-radius: 2px;
|
63 |
-
}
|
64 |
-
|
65 |
-
input.file_input_button_hover
|
66 |
-
{
|
67 |
-
width: 100px;
|
68 |
-
height: 27px;
|
69 |
-
position: absolute;
|
70 |
-
top: 0px;
|
71 |
-
margin: 0px;
|
72 |
-
padding: 0px;
|
73 |
-
background-color: #EEEEEE;
|
74 |
-
color: #111111;
|
75 |
-
/* background-attachment: scroll; */
|
76 |
-
background-image: url("../images/white-grad-active.png");
|
77 |
-
background-position: left top;
|
78 |
-
background-repeat: repeat-x;
|
79 |
-
border-style: solid;
|
80 |
-
border-width: 1px;
|
81 |
-
border-color: #333333;
|
82 |
-
-webkit-border-radius: 2px;
|
83 |
-
-moz-border-radius: 2px;
|
84 |
-
-khtml-border-radius: 2px;
|
85 |
-
border-radius: 2px;
|
86 |
-
}
|
87 |
-
|
88 |
-
input.file_input_button:disabled, input.file_input_button_hover:disabled
|
89 |
-
{
|
90 |
-
width: 100px;
|
91 |
-
height: 27px;
|
92 |
-
position: absolute;
|
93 |
-
top: 0px;
|
94 |
-
margin: 0px;
|
95 |
-
padding: 0px;
|
96 |
-
background-color: #EEEEEE;
|
97 |
-
color: silver;
|
98 |
-
/* background-attachment: scroll; */
|
99 |
-
background-image: url("../images/white-grad-active.png");
|
100 |
-
background-position: left top;
|
101 |
-
background-repeat: repeat-x;
|
102 |
-
border-style: solid;
|
103 |
-
border-width: 1px;
|
104 |
-
border-color: #BBBBBB;
|
105 |
-
-webkit-border-radius: 2px;
|
106 |
-
-moz-border-radius: 2px;
|
107 |
-
-khtml-border-radius: 2px;
|
108 |
-
border-radius: 2px;
|
109 |
-
}
|
110 |
-
|
111 |
-
input.file_input_submit
|
112 |
-
{
|
113 |
-
width: 100px;
|
114 |
-
height: 27px;
|
115 |
-
position: relative;
|
116 |
-
margin: 0px;
|
117 |
-
padding: 0px;
|
118 |
-
background-color: #EEEEEE;
|
119 |
-
color: #555555;
|
120 |
-
/* background-attachment: scroll; */
|
121 |
-
background-image: url("../images/white-grad-active.png");
|
122 |
-
background-position: left top;
|
123 |
-
background-repeat: repeat-x;
|
124 |
-
border-style: solid;
|
125 |
-
border-width: 1px;
|
126 |
-
border-color: #BBBBBB;
|
127 |
-
-webkit-border-radius: 2px;
|
128 |
-
-moz-border-radius: 2px;
|
129 |
-
-khtml-border-radius: 2px;
|
130 |
-
border-radius: 2px;
|
131 |
-
}
|
132 |
-
|
133 |
-
input.file_input_submit:hover, input.file_input_submit:focus
|
134 |
-
{
|
135 |
-
width: 100px;
|
136 |
-
height: 27px;
|
137 |
-
position: relative;
|
138 |
-
margin: 0px;
|
139 |
-
padding: 0px;
|
140 |
-
background-color: #EEEEEE;
|
141 |
-
color: #111111;
|
142 |
-
/* background-attachment: scroll; */
|
143 |
-
background-image: url("../images/white-grad-active.png");
|
144 |
-
background-position: left top;
|
145 |
-
background-repeat: repeat-x;
|
146 |
-
border-style: solid;
|
147 |
-
border-width: 1px;
|
148 |
-
border-color: #333333;
|
149 |
-
-webkit-border-radius: 2px;
|
150 |
-
-moz-border-radius: 2px;
|
151 |
-
-khtml-border-radius: 2px;
|
152 |
-
border-radius: 2px;
|
153 |
-
}
|
154 |
-
|
155 |
-
input.file_input_submit:disabled
|
156 |
-
{
|
157 |
-
width: 100px;
|
158 |
-
height: 27px;
|
159 |
-
position: relative;
|
160 |
-
margin: 0px;
|
161 |
-
padding: 0px;
|
162 |
-
background-color: #EEEEEE;
|
163 |
-
color: silver;
|
164 |
-
/* background-attachment: scroll; */
|
165 |
-
background-image: url("../images/white-grad-active.png");
|
166 |
-
background-position: left top;
|
167 |
-
background-repeat: repeat-x;
|
168 |
-
border-style: solid;
|
169 |
-
border-width: 1px;
|
170 |
-
border-color: #BBBBBB;
|
171 |
-
-webkit-border-radius: 2px;
|
172 |
-
-moz-border-radius: 2px;
|
173 |
-
-khtml-border-radius: 2px;
|
174 |
-
border-radius: 2px;
|
175 |
-
}
|
176 |
-
|
177 |
-
input.file_input_hidden
|
178 |
-
{
|
179 |
-
font-size: 45px;
|
180 |
-
position: absolute;
|
181 |
-
right: 0px;
|
182 |
-
top: 0px;
|
183 |
-
margin: 0px;
|
184 |
-
padding: 0px;
|
185 |
-
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
|
186 |
-
filter: alpha(opacity=0);
|
187 |
-
-moz-opacity: 0;
|
188 |
-
-khtml-opacity: 0;
|
189 |
-
opacity: 0;
|
190 |
-
}
|
191 |
-
|
192 |
-
/* Userdata styles */
|
193 |
-
input.file_userdata_message, input.file_userdata_message_required
|
194 |
-
{
|
195 |
-
width: 60%;
|
196 |
-
height: 25px;
|
197 |
-
margin: 0px;
|
198 |
-
padding: 0px;
|
199 |
-
border: 1px solid;
|
200 |
-
border-color: #BBBBBB;
|
201 |
-
background: none;
|
202 |
-
color: black;
|
203 |
-
}
|
204 |
-
|
205 |
-
input.file_userdata_message:disabled, input.file_userdata_message_required:disabled
|
206 |
-
{
|
207 |
-
width: 60%;
|
208 |
-
height: 25px;
|
209 |
-
margin: 0px;
|
210 |
-
padding: 0px;
|
211 |
-
border: 1px solid;
|
212 |
-
border-color: #BBBBBB;
|
213 |
-
background: none;
|
214 |
-
color: silver;
|
215 |
-
}
|
216 |
-
|
217 |
-
input.file_userdata_message_required_empty
|
218 |
-
{
|
219 |
-
width: 60%;
|
220 |
-
height: 25px;
|
221 |
-
margin: 0px;
|
222 |
-
padding: 0px;
|
223 |
-
border: 1px solid;
|
224 |
-
border-color: #BBBBBB;
|
225 |
-
background-color: red;
|
226 |
-
color: black;
|
227 |
-
}
|
228 |
-
|
229 |
-
|
1 |
+
input.file_input_textbox{position:relative;width:150px;height:25px;margin:0;padding:0;border:1px solid;border-color:#BBB;background-color:#fff;color:#000}input.file_input_textbox:disabled{position:relative;width:150px;height:25px;margin:0;padding:0;border:1px solid;border-color:#BBB;background-color:#fff;color:silver}input.file_input_textbox_nofile{position:relative;width:150px;height:25px;margin:0;padding:0;border:1px solid;border-color:#BBB;background-color:red;color:#000}input.file_input_button{width:100px;height:27px;position:absolute;top:0;margin:0;padding:0;background-color:#EEE;color:#555;background-image:url(../images/white-grad-active.png);background-position:left top;background-repeat:repeat-x;border-style:solid;border-width:1px;border-color:#BBB;-webkit-border-radius:2px;-moz-border-radius:2px;-khtml-border-radius:2px;border-radius:2px}input.file_input_button_hover{width:100px;height:27px;position:absolute;top:0;margin:0;padding:0;background-color:#EEE;color:#111;background-image:url(../images/white-grad-active.png);background-position:left top;background-repeat:repeat-x;border-style:solid;border-width:1px;border-color:#333;-webkit-border-radius:2px;-moz-border-radius:2px;-khtml-border-radius:2px;border-radius:2px}input.file_input_button:disabled,input.file_input_button_hover:disabled{width:100px;height:27px;position:absolute;top:0;margin:0;padding:0;background-color:#EEE;color:silver;background-image:url(../images/white-grad-active.png);background-position:left top;background-repeat:repeat-x;border-style:solid;border-width:1px;border-color:#BBB;-webkit-border-radius:2px;-moz-border-radius:2px;-khtml-border-radius:2px;border-radius:2px}input.file_input_submit{width:100px;height:27px;position:relative;margin:0;padding:0;background-color:#EEE;color:#555;background-image:url(../images/white-grad-active.png);background-position:left top;background-repeat:repeat-x;border-style:solid;border-width:1px;border-color:#BBB;-webkit-border-radius:2px;-moz-border-radius:2px;-khtml-border-radius:2px;border-radius:2px}input.file_input_submit:focus,input.file_input_submit:hover{width:100px;height:27px;position:relative;margin:0;padding:0;background-color:#EEE;color:#111;background-image:url(../images/white-grad-active.png);background-position:left top;background-repeat:repeat-x;border-style:solid;border-width:1px;border-color:#333;-webkit-border-radius:2px;-moz-border-radius:2px;-khtml-border-radius:2px;border-radius:2px}input.file_input_submit:disabled{width:100px;height:27px;position:relative;margin:0;padding:0;background-color:#EEE;color:silver;background-image:url(../images/white-grad-active.png);background-position:left top;background-repeat:repeat-x;border-style:solid;border-width:1px;border-color:#BBB;-webkit-border-radius:2px;-moz-border-radius:2px;-khtml-border-radius:2px;border-radius:2px}input.file_input_hidden{font-size:45px;position:absolute;right:0;top:0;margin:0;padding:0;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";filter:alpha(opacity=0);-moz-opacity:0;-khtml-opacity:0;opacity:0}input.file_userdata_message,input.file_userdata_message_required{width:60%;height:25px;margin:0;padding:0;border:1px solid;border-color:#BBB;background:0 0;color:#000}input.file_userdata_message:disabled,input.file_userdata_message_required:disabled{width:60%;height:25px;margin:0;padding:0;border:1px solid;border-color:#BBB;background:0 0;color:silver}input.file_userdata_message_required_empty{width:60%;height:25px;margin:0;padding:0;border:1px solid;border-color:#BBB;background-color:red;color:#000}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
images/pencil.svg
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8"?>
|
2 |
+
<!-- Generated by IcoMoon.io -->
|
3 |
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
4 |
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32" viewBox="0 0 32 32">
|
5 |
+
<path d="M27 0c2.761 0 5 2.239 5 5 0 1.126-0.372 2.164-1 3l-2 2-7-7 2-2c0.836-0.628 1.874-1 3-1zM2 23l-2 9 9-2 18.5-18.5-7-7-18.5 18.5zM22.362 11.362l-14 14-1.724-1.724 14-14 1.724 1.724z" fill="#444444"></path>
|
6 |
+
</svg>
|
js/getElementsByClassName-1.0.1.js
CHANGED
@@ -1,78 +1 @@
|
|
1 |
-
|
2 |
-
Developed by Robert Nyman, http://www.robertnyman.com
|
3 |
-
Code/licensing: http://code.google.com/p/getelementsbyclassname/
|
4 |
-
*/
|
5 |
-
var getElementsByClassName = function (className, tag, elm){
|
6 |
-
if (document.getElementsByClassName) {
|
7 |
-
getElementsByClassName = function (className, tag, elm) {
|
8 |
-
elm = elm || document;
|
9 |
-
var elements = elm.getElementsByClassName(className),
|
10 |
-
nodeName = (tag)? new RegExp("\\b" + tag + "\\b", "i") : null,
|
11 |
-
returnElements = [],
|
12 |
-
current;
|
13 |
-
for(var i=0, il=elements.length; i<il; i+=1){
|
14 |
-
current = elements[i];
|
15 |
-
if(!nodeName || nodeName.test(current.nodeName)) {
|
16 |
-
returnElements.push(current);
|
17 |
-
}
|
18 |
-
}
|
19 |
-
return returnElements;
|
20 |
-
};
|
21 |
-
}
|
22 |
-
else if (document.evaluate) {
|
23 |
-
getElementsByClassName = function (className, tag, elm) {
|
24 |
-
tag = tag || "*";
|
25 |
-
elm = elm || document;
|
26 |
-
var classes = className.split(" "),
|
27 |
-
classesToCheck = "",
|
28 |
-
xhtmlNamespace = "http://www.w3.org/1999/xhtml",
|
29 |
-
namespaceResolver = (document.documentElement.namespaceURI === xhtmlNamespace)? xhtmlNamespace : null,
|
30 |
-
returnElements = [],
|
31 |
-
elements,
|
32 |
-
node;
|
33 |
-
for(var j=0, jl=classes.length; j<jl; j+=1){
|
34 |
-
classesToCheck += "[contains(concat(' ', @class, ' '), ' " + classes[j] + " ')]";
|
35 |
-
}
|
36 |
-
try {
|
37 |
-
elements = document.evaluate(".//" + tag + classesToCheck, elm, namespaceResolver, 0, null);
|
38 |
-
}
|
39 |
-
catch (e) {
|
40 |
-
elements = document.evaluate(".//" + tag + classesToCheck, elm, null, 0, null);
|
41 |
-
}
|
42 |
-
while ((node = elements.iterateNext())) {
|
43 |
-
returnElements.push(node);
|
44 |
-
}
|
45 |
-
return returnElements;
|
46 |
-
};
|
47 |
-
}
|
48 |
-
else {
|
49 |
-
getElementsByClassName = function (className, tag, elm) {
|
50 |
-
tag = tag || "*";
|
51 |
-
elm = elm || document;
|
52 |
-
var classes = className.split(" "),
|
53 |
-
classesToCheck = [],
|
54 |
-
elements = (tag === "*" && elm.all)? elm.all : elm.getElementsByTagName(tag),
|
55 |
-
current,
|
56 |
-
returnElements = [],
|
57 |
-
match;
|
58 |
-
for(var k=0, kl=classes.length; k<kl; k+=1){
|
59 |
-
classesToCheck.push(new RegExp("(^|\\s)" + classes[k] + "(\\s|$)"));
|
60 |
-
}
|
61 |
-
for(var l=0, ll=elements.length; l<ll; l+=1){
|
62 |
-
current = elements[l];
|
63 |
-
match = false;
|
64 |
-
for(var m=0, ml=classesToCheck.length; m<ml; m+=1){
|
65 |
-
match = classesToCheck[m].test(current.className);
|
66 |
-
if (!match) {
|
67 |
-
break;
|
68 |
-
}
|
69 |
-
}
|
70 |
-
if (match) {
|
71 |
-
returnElements.push(current);
|
72 |
-
}
|
73 |
-
}
|
74 |
-
return returnElements;
|
75 |
-
};
|
76 |
-
}
|
77 |
-
return getElementsByClassName(className, tag, elm);
|
78 |
-
};
|
1 |
+
var getElementsByClassName=function(e,t,n){return(getElementsByClassName=document.getElementsByClassName?function(e,t,n){n=n||document;for(var l,a=n.getElementsByClassName(e),s=t?new RegExp("\\b"+t+"\\b","i"):null,u=[],m=0,o=a.length;o>m;m+=1)l=a[m],(!s||s.test(l.nodeName))&&u.push(l);return u}:document.evaluate?function(e,t,n){t=t||"*",n=n||document;for(var l,a,s=e.split(" "),u="",m="http://www.w3.org/1999/xhtml",o=document.documentElement.namespaceURI===m?m:null,r=[],c=0,g=s.length;g>c;c+=1)u+="[contains(concat(' ', @class, ' '), ' "+s[c]+" ')]";try{l=document.evaluate(".//"+t+u,n,o,0,null)}catch(h){l=document.evaluate(".//"+t+u,n,null,0,null)}for(;a=l.iterateNext();)r.push(a);return r}:function(e,t,n){t=t||"*",n=n||document;for(var l,a,s=e.split(" "),u=[],m="*"===t&&n.all?n.all:n.getElementsByTagName(t),o=[],r=0,c=s.length;c>r;r+=1)u.push(new RegExp("(^|\\s)"+s[r]+"(\\s|$)"));for(var g=0,h=m.length;h>g;g+=1){l=m[g],a=!1;for(var d=0,f=u.length;f>d&&(a=u[d].test(l.className),a);d+=1);a&&o.push(l)}return o})(e,t,n)};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/json2.js
CHANGED
@@ -1,480 +1 @@
|
|
1 |
-
|
2 |
-
http://www.JSON.org/json2.js
|
3 |
-
2011-02-23
|
4 |
-
|
5 |
-
Public Domain.
|
6 |
-
|
7 |
-
NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
|
8 |
-
|
9 |
-
See http://www.JSON.org/js.html
|
10 |
-
|
11 |
-
|
12 |
-
This code should be minified before deployment.
|
13 |
-
See http://javascript.crockford.com/jsmin.html
|
14 |
-
|
15 |
-
USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
|
16 |
-
NOT CONTROL.
|
17 |
-
|
18 |
-
|
19 |
-
This file creates a global JSON object containing two methods: stringify
|
20 |
-
and parse.
|
21 |
-
|
22 |
-
JSON.stringify(value, replacer, space)
|
23 |
-
value any JavaScript value, usually an object or array.
|
24 |
-
|
25 |
-
replacer an optional parameter that determines how object
|
26 |
-
values are stringified for objects. It can be a
|
27 |
-
function or an array of strings.
|
28 |
-
|
29 |
-
space an optional parameter that specifies the indentation
|
30 |
-
of nested structures. If it is omitted, the text will
|
31 |
-
be packed without extra whitespace. If it is a number,
|
32 |
-
it will specify the number of spaces to indent at each
|
33 |
-
level. If it is a string (such as '\t' or ' '),
|
34 |
-
it contains the characters used to indent at each level.
|
35 |
-
|
36 |
-
This method produces a JSON text from a JavaScript value.
|
37 |
-
|
38 |
-
When an object value is found, if the object contains a toJSON
|
39 |
-
method, its toJSON method will be called and the result will be
|
40 |
-
stringified. A toJSON method does not serialize: it returns the
|
41 |
-
value represented by the name/value pair that should be serialized,
|
42 |
-
or undefined if nothing should be serialized. The toJSON method
|
43 |
-
will be passed the key associated with the value, and this will be
|
44 |
-
bound to the value
|
45 |
-
|
46 |
-
For example, this would serialize Dates as ISO strings.
|
47 |
-
|
48 |
-
Date.prototype.toJSON = function (key) {
|
49 |
-
function f(n) {
|
50 |
-
// Format integers to have at least two digits.
|
51 |
-
return n < 10 ? '0' + n : n;
|
52 |
-
}
|
53 |
-
|
54 |
-
return this.getUTCFullYear() + '-' +
|
55 |
-
f(this.getUTCMonth() + 1) + '-' +
|
56 |
-
f(this.getUTCDate()) + 'T' +
|
57 |
-
f(this.getUTCHours()) + ':' +
|
58 |
-
f(this.getUTCMinutes()) + ':' +
|
59 |
-
f(this.getUTCSeconds()) + 'Z';
|
60 |
-
};
|
61 |
-
|
62 |
-
You can provide an optional replacer method. It will be passed the
|
63 |
-
key and value of each member, with this bound to the containing
|
64 |
-
object. The value that is returned from your method will be
|
65 |
-
serialized. If your method returns undefined, then the member will
|
66 |
-
be excluded from the serialization.
|
67 |
-
|
68 |
-
If the replacer parameter is an array of strings, then it will be
|
69 |
-
used to select the members to be serialized. It filters the results
|
70 |
-
such that only members with keys listed in the replacer array are
|
71 |
-
stringified.
|
72 |
-
|
73 |
-
Values that do not have JSON representations, such as undefined or
|
74 |
-
functions, will not be serialized. Such values in objects will be
|
75 |
-
dropped; in arrays they will be replaced with null. You can use
|
76 |
-
a replacer function to replace those with JSON values.
|
77 |
-
JSON.stringify(undefined) returns undefined.
|
78 |
-
|
79 |
-
The optional space parameter produces a stringification of the
|
80 |
-
value that is filled with line breaks and indentation to make it
|
81 |
-
easier to read.
|
82 |
-
|
83 |
-
If the space parameter is a non-empty string, then that string will
|
84 |
-
be used for indentation. If the space parameter is a number, then
|
85 |
-
the indentation will be that many spaces.
|
86 |
-
|
87 |
-
Example:
|
88 |
-
|
89 |
-
text = JSON.stringify(['e', {pluribus: 'unum'}]);
|
90 |
-
// text is '["e",{"pluribus":"unum"}]'
|
91 |
-
|
92 |
-
|
93 |
-
text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
|
94 |
-
// text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
|
95 |
-
|
96 |
-
text = JSON.stringify([new Date()], function (key, value) {
|
97 |
-
return this[key] instanceof Date ?
|
98 |
-
'Date(' + this[key] + ')' : value;
|
99 |
-
});
|
100 |
-
// text is '["Date(---current time---)"]'
|
101 |
-
|
102 |
-
|
103 |
-
JSON.parse(text, reviver)
|
104 |
-
This method parses a JSON text to produce an object or array.
|
105 |
-
It can throw a SyntaxError exception.
|
106 |
-
|
107 |
-
The optional reviver parameter is a function that can filter and
|
108 |
-
transform the results. It receives each of the keys and values,
|
109 |
-
and its return value is used instead of the original value.
|
110 |
-
If it returns what it received, then the structure is not modified.
|
111 |
-
If it returns undefined then the member is deleted.
|
112 |
-
|
113 |
-
Example:
|
114 |
-
|
115 |
-
// Parse the text. Values that look like ISO date strings will
|
116 |
-
// be converted to Date objects.
|
117 |
-
|
118 |
-
myData = JSON.parse(text, function (key, value) {
|
119 |
-
var a;
|
120 |
-
if (typeof value === 'string') {
|
121 |
-
a =
|
122 |
-
/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
|
123 |
-
if (a) {
|
124 |
-
return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
|
125 |
-
+a[5], +a[6]));
|
126 |
-
}
|
127 |
-
}
|
128 |
-
return value;
|
129 |
-
});
|
130 |
-
|
131 |
-
myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {
|
132 |
-
var d;
|
133 |
-
if (typeof value === 'string' &&
|
134 |
-
value.slice(0, 5) === 'Date(' &&
|
135 |
-
value.slice(-1) === ')') {
|
136 |
-
d = new Date(value.slice(5, -1));
|
137 |
-
if (d) {
|
138 |
-
return d;
|
139 |
-
}
|
140 |
-
}
|
141 |
-
return value;
|
142 |
-
});
|
143 |
-
|
144 |
-
|
145 |
-
This is a reference implementation. You are free to copy, modify, or
|
146 |
-
redistribute.
|
147 |
-
*/
|
148 |
-
|
149 |
-
/*jslint evil: true, strict: false, regexp: false */
|
150 |
-
|
151 |
-
/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,
|
152 |
-
call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
|
153 |
-
getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,
|
154 |
-
lastIndex, length, parse, prototype, push, replace, slice, stringify,
|
155 |
-
test, toJSON, toString, valueOf
|
156 |
-
*/
|
157 |
-
|
158 |
-
|
159 |
-
// Create a JSON object only if one does not already exist. We create the
|
160 |
-
// methods in a closure to avoid creating global variables.
|
161 |
-
|
162 |
-
var JSON;
|
163 |
-
if (!JSON) {
|
164 |
-
JSON = {};
|
165 |
-
}
|
166 |
-
|
167 |
-
(function () {
|
168 |
-
"use strict";
|
169 |
-
|
170 |
-
function f(n) {
|
171 |
-
// Format integers to have at least two digits.
|
172 |
-
return n < 10 ? '0' + n : n;
|
173 |
-
}
|
174 |
-
|
175 |
-
if (typeof Date.prototype.toJSON !== 'function') {
|
176 |
-
|
177 |
-
Date.prototype.toJSON = function (key) {
|
178 |
-
|
179 |
-
return isFinite(this.valueOf()) ?
|
180 |
-
this.getUTCFullYear() + '-' +
|
181 |
-
f(this.getUTCMonth() + 1) + '-' +
|
182 |
-
f(this.getUTCDate()) + 'T' +
|
183 |
-
f(this.getUTCHours()) + ':' +
|
184 |
-
f(this.getUTCMinutes()) + ':' +
|
185 |
-
f(this.getUTCSeconds()) + 'Z' : null;
|
186 |
-
};
|
187 |
-
|
188 |
-
String.prototype.toJSON =
|
189 |
-
Number.prototype.toJSON =
|
190 |
-
Boolean.prototype.toJSON = function (key) {
|
191 |
-
return this.valueOf();
|
192 |
-
};
|
193 |
-
}
|
194 |
-
|
195 |
-
var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
|
196 |
-
escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
|
197 |
-
gap,
|
198 |
-
indent,
|
199 |
-
meta = { // table of character substitutions
|
200 |
-
'\b': '\\b',
|
201 |
-
'\t': '\\t',
|
202 |
-
'\n': '\\n',
|
203 |
-
'\f': '\\f',
|
204 |
-
'\r': '\\r',
|
205 |
-
'"' : '\\"',
|
206 |
-
'\\': '\\\\'
|
207 |
-
},
|
208 |
-
rep;
|
209 |
-
|
210 |
-
|
211 |
-
function quote(string) {
|
212 |
-
|
213 |
-
// If the string contains no control characters, no quote characters, and no
|
214 |
-
// backslash characters, then we can safely slap some quotes around it.
|
215 |
-
// Otherwise we must also replace the offending characters with safe escape
|
216 |
-
// sequences.
|
217 |
-
|
218 |
-
escapable.lastIndex = 0;
|
219 |
-
return escapable.test(string) ? '"' + string.replace(escapable, function (a) {
|
220 |
-
var c = meta[a];
|
221 |
-
return typeof c === 'string' ? c :
|
222 |
-
'\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
|
223 |
-
}) + '"' : '"' + string + '"';
|
224 |
-
}
|
225 |
-
|
226 |
-
|
227 |
-
function str(key, holder) {
|
228 |
-
|
229 |
-
// Produce a string from holder[key].
|
230 |
-
|
231 |
-
var i, // The loop counter.
|
232 |
-
k, // The member key.
|
233 |
-
v, // The member value.
|
234 |
-
length,
|
235 |
-
mind = gap,
|
236 |
-
partial,
|
237 |
-
value = holder[key];
|
238 |
-
|
239 |
-
// If the value has a toJSON method, call it to obtain a replacement value.
|
240 |
-
|
241 |
-
if (value && typeof value === 'object' &&
|
242 |
-
typeof value.toJSON === 'function') {
|
243 |
-
value = value.toJSON(key);
|
244 |
-
}
|
245 |
-
|
246 |
-
// If we were called with a replacer function, then call the replacer to
|
247 |
-
// obtain a replacement value.
|
248 |
-
|
249 |
-
if (typeof rep === 'function') {
|
250 |
-
value = rep.call(holder, key, value);
|
251 |
-
}
|
252 |
-
|
253 |
-
// What happens next depends on the value's type.
|
254 |
-
|
255 |
-
switch (typeof value) {
|
256 |
-
case 'string':
|
257 |
-
return quote(value);
|
258 |
-
|
259 |
-
case 'number':
|
260 |
-
|
261 |
-
// JSON numbers must be finite. Encode non-finite numbers as null.
|
262 |
-
|
263 |
-
return isFinite(value) ? String(value) : 'null';
|
264 |
-
|
265 |
-
case 'boolean':
|
266 |
-
case 'null':
|
267 |
-
|
268 |
-
// If the value is a boolean or null, convert it to a string. Note:
|
269 |
-
// typeof null does not produce 'null'. The case is included here in
|
270 |
-
// the remote chance that this gets fixed someday.
|
271 |
-
|
272 |
-
return String(value);
|
273 |
-
|
274 |
-
// If the type is 'object', we might be dealing with an object or an array or
|
275 |
-
// null.
|
276 |
-
|
277 |
-
case 'object':
|
278 |
-
|
279 |
-
// Due to a specification blunder in ECMAScript, typeof null is 'object',
|
280 |
-
// so watch out for that case.
|
281 |
-
|
282 |
-
if (!value) {
|
283 |
-
return 'null';
|
284 |
-
}
|
285 |
-
|
286 |
-
// Make an array to hold the partial results of stringifying this object value.
|
287 |
-
|
288 |
-
gap += indent;
|
289 |
-
partial = [];
|
290 |
-
|
291 |
-
// Is the value an array?
|
292 |
-
|
293 |
-
if (Object.prototype.toString.apply(value) === '[object Array]') {
|
294 |
-
|
295 |
-
// The value is an array. Stringify every element. Use null as a placeholder
|
296 |
-
// for non-JSON values.
|
297 |
-
|
298 |
-
length = value.length;
|
299 |
-
for (i = 0; i < length; i += 1) {
|
300 |
-
partial[i] = str(i, value) || 'null';
|
301 |
-
}
|
302 |
-
|
303 |
-
// Join all of the elements together, separated with commas, and wrap them in
|
304 |
-
// brackets.
|
305 |
-
|
306 |
-
v = partial.length === 0 ? '[]' : gap ?
|
307 |
-
'[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']' :
|
308 |
-
'[' + partial.join(',') + ']';
|
309 |
-
gap = mind;
|
310 |
-
return v;
|
311 |
-
}
|
312 |
-
|
313 |
-
// If the replacer is an array, use it to select the members to be stringified.
|
314 |
-
|
315 |
-
if (rep && typeof rep === 'object') {
|
316 |
-
length = rep.length;
|
317 |
-
for (i = 0; i < length; i += 1) {
|
318 |
-
if (typeof rep[i] === 'string') {
|
319 |
-
k = rep[i];
|
320 |
-
v = str(k, value);
|
321 |
-
if (v) {
|
322 |
-
partial.push(quote(k) + (gap ? ': ' : ':') + v);
|
323 |
-
}
|
324 |
-
}
|
325 |
-
}
|
326 |
-
} else {
|
327 |
-
|
328 |
-
// Otherwise, iterate through all of the keys in the object.
|
329 |
-
|
330 |
-
for (k in value) {
|
331 |
-
if (Object.prototype.hasOwnProperty.call(value, k)) {
|
332 |
-
v = str(k, value);
|
333 |
-
if (v) {
|
334 |
-
partial.push(quote(k) + (gap ? ': ' : ':') + v);
|
335 |
-
}
|
336 |
-
}
|
337 |
-
}
|
338 |
-
}
|
339 |
-
|
340 |
-
// Join all of the member texts together, separated with commas,
|
341 |
-
// and wrap them in braces.
|
342 |
-
|
343 |
-
v = partial.length === 0 ? '{}' : gap ?
|
344 |
-
'{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}' :
|
345 |
-
'{' + partial.join(',') + '}';
|
346 |
-
gap = mind;
|
347 |
-
return v;
|
348 |
-
}
|
349 |
-
}
|
350 |
-
|
351 |
-
// If the JSON object does not yet have a stringify method, give it one.
|
352 |
-
|
353 |
-
if (typeof JSON.stringify !== 'function') {
|
354 |
-
JSON.stringify = function (value, replacer, space) {
|
355 |
-
|
356 |
-
// The stringify method takes a value and an optional replacer, and an optional
|
357 |
-
// space parameter, and returns a JSON text. The replacer can be a function
|
358 |
-
// that can replace values, or an array of strings that will select the keys.
|
359 |
-
// A default replacer method can be provided. Use of the space parameter can
|
360 |
-
// produce text that is more easily readable.
|
361 |
-
|
362 |
-
var i;
|
363 |
-
gap = '';
|
364 |
-
indent = '';
|
365 |
-
|
366 |
-
// If the space parameter is a number, make an indent string containing that
|
367 |
-
// many spaces.
|
368 |
-
|
369 |
-
if (typeof space === 'number') {
|
370 |
-
for (i = 0; i < space; i += 1) {
|
371 |
-
indent += ' ';
|
372 |
-
}
|
373 |
-
|
374 |
-
// If the space parameter is a string, it will be used as the indent string.
|
375 |
-
|
376 |
-
} else if (typeof space === 'string') {
|
377 |
-
indent = space;
|
378 |
-
}
|
379 |
-
|
380 |
-
// If there is a replacer, it must be a function or an array.
|
381 |
-
// Otherwise, throw an error.
|
382 |
-
|
383 |
-
rep = replacer;
|
384 |
-
if (replacer && typeof replacer !== 'function' &&
|
385 |
-
(typeof replacer !== 'object' ||
|
386 |
-
typeof replacer.length !== 'number')) {
|
387 |
-
throw new Error('JSON.stringify');
|
388 |
-
}
|
389 |
-
|
390 |
-
// Make a fake root object containing our value under the key of ''.
|
391 |
-
// Return the result of stringifying the value.
|
392 |
-
|
393 |
-
return str('', {'': value});
|
394 |
-
};
|
395 |
-
}
|
396 |
-
|
397 |
-
|
398 |
-
// If the JSON object does not yet have a parse method, give it one.
|
399 |
-
|
400 |
-
if (typeof JSON.parse !== 'function') {
|
401 |
-
JSON.parse = function (text, reviver) {
|
402 |
-
|
403 |
-
// The parse method takes a text and an optional reviver function, and returns
|
404 |
-
// a JavaScript value if the text is a valid JSON text.
|
405 |
-
|
406 |
-
var j;
|
407 |
-
|
408 |
-
function walk(holder, key) {
|
409 |
-
|
410 |
-
// The walk method is used to recursively walk the resulting structure so
|
411 |
-
// that modifications can be made.
|
412 |
-
|
413 |
-
var k, v, value = holder[key];
|
414 |
-
if (value && typeof value === 'object') {
|
415 |
-
for (k in value) {
|
416 |
-
if (Object.prototype.hasOwnProperty.call(value, k)) {
|
417 |
-
v = walk(value, k);
|
418 |
-
if (v !== undefined) {
|
419 |
-
value[k] = v;
|
420 |
-
} else {
|
421 |
-
delete value[k];
|
422 |
-
}
|
423 |
-
}
|
424 |
-
}
|
425 |
-
}
|
426 |
-
return reviver.call(holder, key, value);
|
427 |
-
}
|
428 |
-
|
429 |
-
|
430 |
-
// Parsing happens in four stages. In the first stage, we replace certain
|
431 |
-
// Unicode characters with escape sequences. JavaScript handles many characters
|
432 |
-
// incorrectly, either silently deleting them, or treating them as line endings.
|
433 |
-
|
434 |
-
text = String(text);
|
435 |
-
cx.lastIndex = 0;
|
436 |
-
if (cx.test(text)) {
|
437 |
-
text = text.replace(cx, function (a) {
|
438 |
-
return '\\u' +
|
439 |
-
('0000' + a.charCodeAt(0).toString(16)).slice(-4);
|
440 |
-
});
|
441 |
-
}
|
442 |
-
|
443 |
-
// In the second stage, we run the text against regular expressions that look
|
444 |
-
// for non-JSON patterns. We are especially concerned with '()' and 'new'
|
445 |
-
// because they can cause invocation, and '=' because it can cause mutation.
|
446 |
-
// But just to be safe, we want to reject all unexpected forms.
|
447 |
-
|
448 |
-
// We split the second stage into 4 regexp operations in order to work around
|
449 |
-
// crippling inefficiencies in IE's and Safari's regexp engines. First we
|
450 |
-
// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we
|
451 |
-
// replace all simple value tokens with ']' characters. Third, we delete all
|
452 |
-
// open brackets that follow a colon or comma or that begin the text. Finally,
|
453 |
-
// we look to see that the remaining characters are only whitespace or ']' or
|
454 |
-
// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
|
455 |
-
|
456 |
-
if (/^[\],:{}\s]*$/
|
457 |
-
.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')
|
458 |
-
.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')
|
459 |
-
.replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
|
460 |
-
|
461 |
-
// In the third stage we use the eval function to compile the text into a
|
462 |
-
// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
|
463 |
-
// in JavaScript: it can begin a block or an object literal. We wrap the text
|
464 |
-
// in parens to eliminate the ambiguity.
|
465 |
-
|
466 |
-
j = eval('(' + text + ')');
|
467 |
-
|
468 |
-
// In the optional fourth stage, we recursively walk the new structure, passing
|
469 |
-
// each name/value pair to a reviver function for possible transformation.
|
470 |
-
|
471 |
-
return typeof reviver === 'function' ?
|
472 |
-
walk({'': j}, '') : j;
|
473 |
-
}
|
474 |
-
|
475 |
-
// If the text is not JSON parseable, then a SyntaxError is thrown.
|
476 |
-
|
477 |
-
throw new SyntaxError('JSON.parse');
|
478 |
-
};
|
479 |
-
}
|
480 |
-
}());
|
1 |
+
var JSON;JSON||(JSON={}),function(){"use strict";function f(t){return 10>t?"0"+t:t}function quote(t){return escapable.lastIndex=0,escapable.test(t)?'"'+t.replace(escapable,function(t){var e=meta[t];return"string"==typeof e?e:"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+t+'"'}function str(t,e){var r,n,o,f,u,i=gap,p=e[t];switch(p&&"object"==typeof p&&"function"==typeof p.toJSON&&(p=p.toJSON(t)),"function"==typeof rep&&(p=rep.call(e,t,p)),typeof p){case"string":return quote(p);case"number":return isFinite(p)?String(p):"null";case"boolean":case"null":return String(p);case"object":if(!p)return"null";if(gap+=indent,u=[],"[object Array]"===Object.prototype.toString.apply(p)){for(f=p.length,r=0;f>r;r+=1)u[r]=str(r,p)||"null";return o=0===u.length?"[]":gap?"[\n"+gap+u.join(",\n"+gap)+"\n"+i+"]":"["+u.join(",")+"]",gap=i,o}if(rep&&"object"==typeof rep)for(f=rep.length,r=0;f>r;r+=1)"string"==typeof rep[r]&&(n=rep[r],o=str(n,p),o&&u.push(quote(n)+(gap?": ":":")+o));else for(n in p)Object.prototype.hasOwnProperty.call(p,n)&&(o=str(n,p),o&&u.push(quote(n)+(gap?": ":":")+o));return o=0===u.length?"{}":gap?"{\n"+gap+u.join(",\n"+gap)+"\n"+i+"}":"{"+u.join(",")+"}",gap=i,o}}"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;"function"!=typeof JSON.stringify&&(JSON.stringify=function(t,e,r){var n;if(gap="",indent="","number"==typeof r)for(n=0;r>n;n+=1)indent+=" ";else"string"==typeof r&&(indent=r);if(rep=e,e&&"function"!=typeof e&&("object"!=typeof e||"number"!=typeof e.length))throw new Error("JSON.stringify");return str("",{"":t})}),"function"!=typeof JSON.parse&&(JSON.parse=function(text,reviver){function walk(t,e){var r,n,o=t[e];if(o&&"object"==typeof o)for(r in o)Object.prototype.hasOwnProperty.call(o,r)&&(n=walk(o,r),void 0!==n?o[r]=n:delete o[r]);return reviver.call(t,e,o)}var j;if(text=String(text),cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(t){return"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/wordpress_file_upload_adminfunctions.js
CHANGED
@@ -1,1781 +1,2 @@
|
|
1 |
-
var DraggedItem = null;
|
2 |
-
var ShortcodeNextSave = 0;
|
3 |
-
var ShortcodeTimeOut = null;
|
4 |
-
var ShortcodeString = "";
|
5 |
-
|
6 |
-
jQuery(document).ready(function($){
|
7 |
-
$('.wfu_color_field').wpColorPicker({
|
8 |
-
change: function(event, ui) {
|
9 |
-
event.target.value = ui.color.toString();
|
10 |
-
if (event.target.name == "wfu_text_elements") wfu_update_text_value(event);
|
11 |
-
else if (event.target.name == "wfu_triplecolor_elements") wfu_update_triplecolor_value(event);
|
12 |
-
}
|
13 |
-
});
|
14 |
-
});
|
15 |
-
|
16 |
-
function wfu_admin_activate_tab(key) {
|
17 |
-
var tabs = document.getElementById("wfu_tab_container");
|
18 |
-
var tab, tabkey;
|
19 |
-
for (var i = 0; i < tabs.childNodes.length; i++) {
|
20 |
-
tab = tabs.childNodes[i];
|
21 |
-
if (tab.nodeType === 1) {
|
22 |
-
tabkey = tab.id.substr(8);
|
23 |
-
if (tab.className.indexOf("nav-tab-active") > -1) {
|
24 |
-
tab.className = "nav-tab";
|
25 |
-
document.getElementById("wfu_container_" + tabkey).style.display = "none";
|
26 |
-
}
|
27 |
-
}
|
28 |
-
}
|
29 |
-
document.getElementById("wfu_tab_" + key).className = "nav-tab nav-tab-active";
|
30 |
-
document.getElementById("wfu_container_" + key).style.display = "block";
|
31 |
-
}
|
32 |
-
|
33 |
-
function wfu_admin_onoff_clicked(key) {
|
34 |
-
var onoff = document.getElementById("wfu_attribute_" + key);
|
35 |
-
var container = document.getElementById("wfu_wrapper");
|
36 |
-
var shadows = document.getElementsByClassName("wfu_shadow_" + key, "div", container);
|
37 |
-
var shadows_inv = document.getElementsByClassName("wfu_shadow_" + key + "_inv", "div", container);
|
38 |
-
var status = (onoff.className.substr(onoff.className.length - 2) == "on");
|
39 |
-
status = !status;
|
40 |
-
if (status) {
|
41 |
-
document.getElementById("wfu_attribute_value_" + key).value = "true";
|
42 |
-
onoff.className = "wfu_onoff_container_on";
|
43 |
-
for (var i = 0; i < shadows.length; i++) shadows[i].style.display = "none";
|
44 |
-
for (var i = 0; i < shadows_inv.length; i++) shadows_inv[i].style.display = "block";
|
45 |
-
}
|
46 |
-
else {
|
47 |
-
document.getElementById("wfu_attribute_value_" + key).value = "false";
|
48 |
-
onoff.className = "wfu_onoff_container_off";
|
49 |
-
for (var i = 0; i < shadows.length; i++) shadows[i].style.display = "block";
|
50 |
-
for (var i = 0; i < shadows_inv.length; i++) shadows_inv[i].style.display = "none";
|
51 |
-
}
|
52 |
-
wfu_generate_shortcode();
|
53 |
-
if (key == "userdata") wfu_update_userfield_variables();
|
54 |
-
}
|
55 |
-
|
56 |
-
function wfu_admin_radio_clicked(key) {
|
57 |
-
var radios = document.getElementsByName("wfu_radioattribute_" + key);
|
58 |
-
var container = document.getElementById("wfu_wrapper");
|
59 |
-
var shadows = document.getElementsByClassName("wfu_shadow_" + key, "div", container);
|
60 |
-
var shadows_inv = document.getElementsByClassName("wfu_shadow_" + key + "_inv", "div", container);
|
61 |
-
var val = "";
|
62 |
-
for (i = 0; i < radios.length; i++)
|
63 |
-
if (radios[i].checked) val = radios[i].value;
|
64 |
-
var status = (val.substr(0, 1) == "*");
|
65 |
-
if (status) {
|
66 |
-
val = val.substr(1);
|
67 |
-
for (var i = 0; i < shadows.length; i++) shadows[i].style.display = "none";
|
68 |
-
for (var i = 0; i < shadows_inv.length; i++) shadows_inv[i].style.display = "block";
|
69 |
-
}
|
70 |
-
else {
|
71 |
-
for (var i = 0; i < shadows.length; i++) shadows[i].style.display = "block";
|
72 |
-
for (var i = 0; i < shadows_inv.length; i++) shadows_inv[i].style.display = "none";
|
73 |
-
}
|
74 |
-
document.getElementById("wfu_attribute_value_" + key).value = val;
|
75 |
-
wfu_generate_shortcode();
|
76 |
-
}
|
77 |
-
|
78 |
-
function wfu_addEventHandler(obj, evt, handler) {
|
79 |
-
if(obj.addEventListener) {
|
80 |
-
// W3C method
|
81 |
-
obj.addEventListener(evt, handler, false);
|
82 |
-
}
|
83 |
-
else if(obj.attachEvent) {
|
84 |
-
// IE method.
|
85 |
-
obj.attachEvent('on'+evt, handler);
|
86 |
-
}
|
87 |
-
else {
|
88 |
-
// Old school method.
|
89 |
-
obj['on'+evt] = handler;
|
90 |
-
}
|
91 |
-
}
|
92 |
-
|
93 |
-
function wfu_attach_separator_dragdrop_events() {
|
94 |
-
var container = document.getElementById('wfu_placements_container');
|
95 |
-
var item;
|
96 |
-
for (var i = 0; i < container.childNodes.length; i++) {
|
97 |
-
item = container.childNodes[i];
|
98 |
-
if (item.className == "wfu_component_separator_hor" || item.className == "wfu_component_separator_ver") {
|
99 |
-
wfu_addEventHandler(item, 'dragenter', wfu_separator_dragenter);
|
100 |
-
wfu_addEventHandler(item, 'dragover', wfu_default_dragover);
|
101 |
-
wfu_addEventHandler(item, 'dragleave', wfu_separator_dragleave);
|
102 |
-
wfu_addEventHandler(item, 'drop', wfu_separator_drop);
|
103 |
-
}
|
104 |
-
}
|
105 |
-
}
|
106 |
-
|
107 |
-
function wfu_Attach_Admin_DragDrop_Events() {
|
108 |
-
if (window.FileReader) {
|
109 |
-
var container = document.getElementById('wfu_placements_container');
|
110 |
-
var available_container = document.getElementById('wfu_componentlist_container');
|
111 |
-
var item;
|
112 |
-
for (var i = 0; i < container.childNodes.length; i++) {
|
113 |
-
item = container.childNodes[i];
|
114 |
-
if (item.className == "wfu_component_box") {
|
115 |
-
wfu_addEventHandler(item, 'dragstart', wfu_component_dragstart);
|
116 |
-
wfu_addEventHandler(item, 'dragend', wfu_component_dragend);
|
117 |
-
}
|
118 |
-
}
|
119 |
-
for (var i = 0; i < available_container.childNodes.length; i++) {
|
120 |
-
item = available_container.childNodes[i];
|
121 |
-
if (item.className == "wfu_component_box_container") {
|
122 |
-
for (var ii = 0; ii < item.childNodes.length; ii++) {
|
123 |
-
if (item.childNodes[ii].className == "wfu_component_box wfu_inbase") {
|
124 |
-
wfu_addEventHandler(item.childNodes[ii], 'dragstart', wfu_component_dragstart);
|
125 |
-
wfu_addEventHandler(item.childNodes[ii], 'dragend', wfu_component_dragend);
|
126 |
-
}
|
127 |
-
}
|
128 |
-
}
|
129 |
-
}
|
130 |
-
item = document.getElementById('wfu_componentlist_dragdrop');
|
131 |
-
wfu_addEventHandler(item, 'dragenter', wfu_componentlist_dragenter);
|
132 |
-
wfu_addEventHandler(item, 'dragover', wfu_default_dragover);
|
133 |
-
wfu_addEventHandler(item, 'dragleave', wfu_componentlist_dragleave);
|
134 |
-
wfu_addEventHandler(item, 'drop', wfu_componentlist_drop);
|
135 |
-
wfu_attach_separator_dragdrop_events();
|
136 |
-
}
|
137 |
-
}
|
138 |
-
|
139 |
-
function wfu_componentlist_dragenter(e) {
|
140 |
-
e = e || window.event;
|
141 |
-
if (e.preventDefault) { e.preventDefault(); }
|
142 |
-
if (!DraggedItem) return false;
|
143 |
-
var item = document.getElementById('wfu_componentlist_dragdrop');
|
144 |
-
if (item.className.indexOf("wfu_componentlist_dragdrop_dragover") == -1)
|
145 |
-
item.className += " wfu_componentlist_dragdrop_dragover";
|
146 |
-
return false;
|
147 |
-
}
|
148 |
-
|
149 |
-
function wfu_componentlist_dragleave(e) {
|
150 |
-
e = e || window.event;
|
151 |
-
if (e.preventDefault) { e.preventDefault(); }
|
152 |
-
if (!DraggedItem) return false;
|
153 |
-
var item = document.getElementById('wfu_componentlist_dragdrop');
|
154 |
-
item.className = item.className.replace(" wfu_componentlist_dragdrop_dragover", "");
|
155 |
-
return false;
|
156 |
-
}
|
157 |
-
|
158 |
-
function wfu_componentlist_drop(e) {
|
159 |
-
e = e || window.event;
|
160 |
-
if (e.preventDefault) { e.preventDefault(); }
|
161 |
-
var component = e.dataTransfer.getData("Component");
|
162 |
-
if (!component) return false;
|
163 |
-
//move dragged component to base
|
164 |
-
var item = document.getElementById('wfu_component_box_' + component);
|
165 |
-
item.className = "wfu_component_box wfu_inbase";
|
166 |
-
item.style.display = "block";
|
167 |
-
document.getElementById('wfu_component_box_container_' + component).appendChild(item);
|
168 |
-
//recreate placements panel
|
169 |
-
var placements = wfu_admin_recreate_placements_text(null, "");
|
170 |
-
wfu_admin_recreate_placements_panel(placements);
|
171 |
-
document.getElementById("wfu_attribute_value_placements").value = placements;
|
172 |
-
wfu_generate_shortcode();
|
173 |
-
return false;
|
174 |
-
}
|
175 |
-
|
176 |
-
function wfu_separator_dragenter(e) {
|
177 |
-
e = e || window.event;
|
178 |
-
if (e.preventDefault) { e.preventDefault(); }
|
179 |
-
if (!DraggedItem) return false;
|
180 |
-
if (e.target.className == "wfu_component_separator_hor") {
|
181 |
-
var bar = document.getElementById('wfu_component_bar_hor');
|
182 |
-
bar.style.top = e.target.offsetTop + "px";
|
183 |
-
bar.style.display = "block";
|
184 |
-
}
|
185 |
-
else if (e.target.className == "wfu_component_separator_ver") {
|
186 |
-
var bar = document.getElementById('wfu_component_bar_ver');
|
187 |
-
bar.style.top = e.target.offsetTop + "px";
|
188 |
-
bar.style.left = e.target.offsetLeft + "px";
|
189 |
-
bar.style.display = "block";
|
190 |
-
}
|
191 |
-
return false;
|
192 |
-
}
|
193 |
-
|
194 |
-
function wfu_default_dragover(e) {
|
195 |
-
e = e || window.event;
|
196 |
-
if (e.preventDefault) { e.preventDefault(); }
|
197 |
-
return false;
|
198 |
-
}
|
199 |
-
|
200 |
-
function wfu_separator_dragleave(e) {
|
201 |
-
e = e || window.event;
|
202 |
-
if (e.preventDefault) { e.preventDefault(); }
|
203 |
-
if (!DraggedItem) return false;
|
204 |
-
if (e.target.className == "wfu_component_separator_hor") {
|
205 |
-
var bar = document.getElementById('wfu_component_bar_hor');
|
206 |
-
bar.style.display = "none";
|
207 |
-
}
|
208 |
-
else if (e.target.className == "wfu_component_separator_ver") {
|
209 |
-
var bar = document.getElementById('wfu_component_bar_ver');
|
210 |
-
bar.style.display = "none";
|
211 |
-
}
|
212 |
-
return false;
|
213 |
-
}
|
214 |
-
|
215 |
-
function wfu_separator_drop(e) {
|
216 |
-
e = e || window.event;
|
217 |
-
if (e.preventDefault) { e.preventDefault(); }
|
218 |
-
var component = e.dataTransfer.getData("Component");
|
219 |
-
if (!component) return false;
|
220 |
-
//first move dragged component to base otherwise we may lose it during recreation of placements panel
|
221 |
-
var item = document.getElementById('wfu_component_box_' + component);
|
222 |
-
item.style.display = "none";
|
223 |
-
item.className = "wfu_component_box wfu_inbase";
|
224 |
-
document.getElementById('wfu_component_box_container_' + component).appendChild(item);
|
225 |
-
//recreate placements panel
|
226 |
-
var placements = wfu_admin_recreate_placements_text(e.target, component);
|
227 |
-
wfu_admin_recreate_placements_panel(placements);
|
228 |
-
document.getElementById("wfu_attribute_value_placements").value = placements;
|
229 |
-
wfu_generate_shortcode();
|
230 |
-
return false;
|
231 |
-
}
|
232 |
-
|
233 |
-
function wfu_component_dragstart(e) {
|
234 |
-
e = e || window.event;
|
235 |
-
e.dataTransfer.setData("Component", e.target.id.replace("wfu_component_box_", ""));
|
236 |
-
if (e.target.className.indexOf("wfu_component_box_dragged") == -1) {
|
237 |
-
e.target.className += " wfu_component_box_dragged";
|
238 |
-
DraggedItem = e.target;
|
239 |
-
}
|
240 |
-
e.target.style.zIndex = 3;
|
241 |
-
var item = document.getElementById('wfu_componentlist_dragdrop');
|
242 |
-
item.className = "wfu_componentlist_dragdrop wfu_componentlist_dragdrop_dragover";
|
243 |
-
item.style.display = "block";
|
244 |
-
return false;
|
245 |
-
}
|
246 |
-
|
247 |
-
function wfu_component_dragend(e) {
|
248 |
-
e = e || window.event;
|
249 |
-
DraggedItem = null;
|
250 |
-
e.target.style.zIndex = 1;
|
251 |
-
var item = document.getElementById('wfu_componentlist_dragdrop');
|
252 |
-
item.style.display = "none";
|
253 |
-
item.className = "wfu_componentlist_dragdrop";
|
254 |
-
e.target.className = e.target.className.replace(" wfu_component_box_dragged", "");
|
255 |
-
document.getElementById('wfu_component_bar_ver').style.display = "none";
|
256 |
-
document.getElementById('wfu_component_bar_hor').style.display = "none";
|
257 |
-
return false;
|
258 |
-
}
|
259 |
-
|
260 |
-
function wfu_admin_recreate_placements_text(place, new_component) {
|
261 |
-
function add_item(component) {
|
262 |
-
if (placements != "") placements += delim;
|
263 |
-
placements += component;
|
264 |
-
delim = "";
|
265 |
-
}
|
266 |
-
|
267 |
-
var container = document.getElementById('wfu_placements_container');
|
268 |
-
var delim = "";
|
269 |
-
var placements = "";
|
270 |
-
var component = "";
|
271 |
-
for (var i = 0; i < container.childNodes.length; i++) {
|
272 |
-
item = container.childNodes[i];
|
273 |
-
if (item.className == "wfu_component_separator_ver") {
|
274 |
-
if (delim == "" ) delim = "+";
|
275 |
-
if (item == place) { add_item(new_component); delim = "+"; }
|
276 |
-
}
|
277 |
-
else if (item.className == "wfu_component_separator_hor") {
|
278 |
-
delim = "/";
|
279 |
-
if (item == place) { add_item(new_component); delim = "/"; }
|
280 |
-
}
|
281 |
-
else if (item.className == "wfu_component_box") add_item(item.id.replace("wfu_component_box_", ""));
|
282 |
-
}
|
283 |
-
return placements;
|
284 |
-
}
|
285 |
-
|
286 |
-
function wfu_admin_recreate_placements_panel(placements_text) {
|
287 |
-
var container = document.getElementById('wfu_placements_container');
|
288 |
-
var item, placements, sections;
|
289 |
-
var itemname = "";
|
290 |
-
for (var i = 0; i < container.childNodes.length; i++) {
|
291 |
-
item = container.childNodes[i];
|
292 |
-
if (item.className == "wfu_component_box") {
|
293 |
-
itemname = item.id.replace("wfu_component_box_", "");
|
294 |
-
item.style.display = "inline-block";
|
295 |
-
item.className = "wfu_component_box wfu_inbase";
|
296 |
-
document.getElementById('wfu_component_box_container_' + itemname).appendChild(item);
|
297 |
-
}
|
298 |
-
}
|
299 |
-
container.innerHTML = "";
|
300 |
-
placements = placements_text.split("/");
|
301 |
-
for (var i = 0; i < placements.length; i++) {
|
302 |
-
item = document.createElement("DIV");
|
303 |
-
item.className = "wfu_component_separator_hor";
|
304 |
-
item.setAttribute("draggable", true);
|
305 |
-
container.appendChild(item);
|
306 |
-
item = document.createElement("DIV");
|
307 |
-
item.className = "wfu_component_separator_ver";
|
308 |
-
item.setAttribute("draggable", true);
|
309 |
-
container.appendChild(item);
|
310 |
-
sections = placements[i].split("+");
|
311 |
-
for (var ii = 0; ii < sections.length; ii++) {
|
312 |
-
item = document.getElementById('wfu_component_box_' + sections[ii]);
|
313 |
-
if (item) {
|
314 |
-
container.appendChild(item);
|
315 |
-
item.className = "wfu_component_box";
|
316 |
-
item.style.display = "inline-block";
|
317 |
-
item = document.createElement("DIV");
|
318 |
-
item.className = "wfu_component_separator_ver";
|
319 |
-
item.setAttribute("draggable", true);
|
320 |
-
container.appendChild(item);
|
321 |
-
}
|
322 |
-
}
|
323 |
-
}
|
324 |
-
item = document.createElement("DIV");
|
325 |
-
item.className = "wfu_component_separator_hor";
|
326 |
-
item.setAttribute("draggable", true);
|
327 |
-
container.appendChild(item);
|
328 |
-
item = document.createElement("DIV");
|
329 |
-
item.id = "wfu_component_bar_hor";
|
330 |
-
item.className = "wfu_component_bar_hor";
|
331 |
-
container.appendChild(item);
|
332 |
-
item = document.createElement("DIV");
|
333 |
-
item.id = "wfu_component_bar_ver";
|
334 |
-
item.className = "wfu_component_bar_ver";
|
335 |
-
container.appendChild(item);
|
336 |
-
wfu_attach_separator_dragdrop_events();
|
337 |
-
}
|
338 |
-
|
339 |
-
function wfu_subfolders_input_changed(e) {
|
340 |
-
e = e || window.event;
|
341 |
-
var item = e.target;
|
342 |
-
var key = item.id.replace("wfu_subfolders_path_", "");
|
343 |
-
key = key.replace("wfu_subfolders_label_", "");
|
344 |
-
|
345 |
-
var list = document.getElementById('wfu_attribute_' + key);
|
346 |
-
if (list.selectedIndex < 0 ) return;
|
347 |
-
var tools_path = document.getElementById('wfu_subfolders_path_' + key);
|
348 |
-
var tools_label = document.getElementById('wfu_subfolders_label_' + key);
|
349 |
-
var tools_ok = document.getElementById('wfu_subfolders_ok_' + key);
|
350 |
-
var old_path_value, old_label_value;
|
351 |
-
var isnewitem = (document.getElementById('wfu_subfolders_isnewitem_' + key).value == "1");
|
352 |
-
if (isnewitem) {
|
353 |
-
old_path_value = "";
|
354 |
-
old_label_value = "";
|
355 |
-
}
|
356 |
-
else {
|
357 |
-
var items = list.data;
|
358 |
-
item = items[list.selectedIndex];
|
359 |
-
old_path_value = item.path;
|
360 |
-
old_label_value = item.label;
|
361 |
-
}
|
362 |
-
if (tools_path.value == old_path_value && tools_label.value == old_label_value) {
|
363 |
-
tools_ok.disabled = true;
|
364 |
-
if (!isnewitem) wfu_subfolders_update_nav(key);
|
365 |
-
}
|
366 |
-
else {
|
367 |
-
tools_ok.disabled = false;
|
368 |
-
var navs = document.getElementsByName('wfu_subfolder_nav_' + key);
|
369 |
-
for (var i = 0; i < navs.length; i++) navs[i].disabled = true;
|
370 |
-
}
|
371 |
-
}
|
372 |
-
|
373 |
-
function wfu_subfolders_up_clicked(key) {
|
374 |
-
var list = document.getElementById('wfu_attribute_' + key);
|
375 |
-
if (list.selectedIndex < 0 ) return;
|
376 |
-
var items = list.data;
|
377 |
-
item = items[list.selectedIndex];
|
378 |
-
// find previous sibling
|
379 |
-
var prevind = item.index - 1;
|
380 |
-
if (prevind < 0) return;
|
381 |
-
var prevpos = -1;
|
382 |
-
var curind = list.selectedIndex - 1;
|
383 |
-
while (curind >= 0) {
|
384 |
-
if (items[curind].level == item.level && items[curind].index == prevind) {
|
385 |
-
prevpos = curind;
|
386 |
-
break;
|
387 |
-
}
|
388 |
-
else curind --;
|
389 |
-
}
|
390 |
-
if (prevpos == -1) return;
|
391 |
-
// find number of children
|
392 |
-
var children_count = 0;
|
393 |
-
curind = list.selectedIndex + 1;
|
394 |
-
while (curind < items.length) {
|
395 |
-
if (items[curind].level > item.level) {
|
396 |
-
children_count ++;
|
397 |
-
curind ++;
|
398 |
-
}
|
399 |
-
else break;
|
400 |
-
}
|
401 |
-
// update list indices
|
402 |
-
items[prevpos].index = item.index;
|
403 |
-
item.index = prevind;
|
404 |
-
// restructure data list
|
405 |
-
list.data = items.slice(0, prevpos).concat(items.slice(list.selectedIndex, list.selectedIndex + 1 + children_count)).
|
406 |
-
concat(items.slice(prevpos, list.selectedIndex)).concat(items.slice(list.selectedIndex + 1 + children_count));
|
407 |
-
// update option contents to match list
|
408 |
-
var val = wfu_update_subfolder_list(key);
|
409 |
-
// move current selection to new position
|
410 |
-
list.selectedIndex = prevpos;
|
411 |
-
// update tool and nav items
|
412 |
-
wfu_subfolders_update_toolnav(key);
|
413 |
-
// update shortcode
|
414 |
-
item = list;
|
415 |
-
if (val !== item.oldVal) {
|
416 |
-
item.oldVal = val;
|
417 |
-
document.getElementById("wfu_attribute_value_" + key).value = val;
|
418 |
-
wfu_generate_shortcode();
|
419 |
-
}
|
420 |
-
}
|
421 |
-
|
422 |
-
function wfu_subfolders_down_clicked(key) {
|
423 |
-
var list = document.getElementById('wfu_attribute_' + key);
|
424 |
-
if (list.selectedIndex < 0 ) return;
|
425 |
-
var items = list.data;
|
426 |
-
item = items[list.selectedIndex];
|
427 |
-
// find next sibling
|
428 |
-
var nextind = item.index + 1;
|
429 |
-
var nextpos = -1;
|
430 |
-
curind = list.selectedIndex + 1;
|
431 |
-
while (curind < items.length) {
|
432 |
-
if (items[curind].level == item.level) {
|
433 |
-
nextpos = curind;
|
434 |
-
break;
|
435 |
-
}
|
436 |
-
else if (items[curind].level < item.level) break;
|
437 |
-
else curind ++;
|
438 |
-
}
|
439 |
-
if (nextpos == -1) return;
|
440 |
-
// find number of children of next
|
441 |
-
var next_children_count = 0;
|
442 |
-
curind = nextpos + 1;
|
443 |
-
while (curind < items.length) {
|
444 |
-
if (items[curind].level > item.level) {
|
445 |
-
next_children_count ++;
|
446 |
-
curind ++;
|
447 |
-
}
|
448 |
-
else break;
|
449 |
-
}
|
450 |
-
// update list indices
|
451 |
-
items[nextpos].index = item.index;
|
452 |
-
item.index = nextind;
|
453 |
-
// restructure data list
|
454 |
-
list.data = items.slice(0, list.selectedIndex).concat(items.slice(nextpos, nextpos + 1 + next_children_count)).
|
455 |
-
concat(items.slice(list.selectedIndex, nextpos)).concat(items.slice(nextpos + 1 + next_children_count));
|
456 |
-
// update option contents to match list
|
457 |
-
var val = wfu_update_subfolder_list(key);
|
458 |
-
// move current selection to new position
|
459 |
-
list.selectedIndex = list.selectedIndex + next_children_count + 1;
|
460 |
-
// update tool and nav items
|
461 |
-
wfu_subfolders_update_toolnav(key);
|
462 |
-
// update shortcode
|
463 |
-
item = list;
|
464 |
-
if (val !== item.oldVal) {
|
465 |
-
item.oldVal = val;
|
466 |
-
document.getElementById("wfu_attribute_value_" + key).value = val;
|
467 |
-
wfu_generate_shortcode();
|
468 |
-
}
|
469 |
-
}
|
470 |
-
|
471 |
-
function wfu_subfolders_left_clicked(key) {
|
472 |
-
var list = document.getElementById('wfu_attribute_' + key);
|
473 |
-
if (list.selectedIndex < 0 ) return;
|
474 |
-
var items = list.data;
|
475 |
-
item = items[list.selectedIndex];
|
476 |
-
// find and reduce level of children
|
477 |
-
curind = list.selectedIndex + 1;
|
478 |
-
while (curind < items.length) {
|
479 |
-
if (items[curind].level > item.level) {
|
480 |
-
items[curind].level --;
|
481 |
-
curind ++;
|
482 |
-
}
|
483 |
-
else break;
|
484 |
-
}
|
485 |
-
item.level --;
|
486 |
-
// update option contents to match list
|
487 |
-
var val = wfu_update_subfolder_list(key);
|
488 |
-
// update list indices
|
489 |
-
list.data = wfu_decode_subfolder_list(key);
|
490 |
-
// update tool and nav items
|
491 |
-
wfu_subfolders_update_toolnav(key);
|
492 |
-
// update shortcode
|
493 |
-
item = list;
|
494 |
-
if (val !== item.oldVal) {
|
495 |
-
item.oldVal = val;
|
496 |
-
document.getElementById("wfu_attribute_value_" + key).value = val;
|
497 |
-
wfu_generate_shortcode();
|
498 |
-
}
|
499 |
-
}
|
500 |
-
|
501 |
-
function wfu_subfolders_right_clicked(key) {
|
502 |
-
var list = document.getElementById('wfu_attribute_' + key);
|
503 |
-
if (list.selectedIndex < 0 ) return;
|
504 |
-
var items = list.data;
|
505 |
-
item = items[list.selectedIndex];
|
506 |
-
// find and increase level of children
|
507 |
-
curind = list.selectedIndex + 1;
|
508 |
-
while (curind < items.length) {
|
509 |
-
if (items[curind].level > item.level) {
|
510 |
-
items[curind].level ++;
|
511 |
-
curind ++;
|
512 |
-
}
|
513 |
-
else break;
|
514 |
-
}
|
515 |
-
item.level ++;
|
516 |
-
// update option contents to match list
|
517 |
-
var val = wfu_update_subfolder_list(key);
|
518 |
-
// update list indices
|
519 |
-
list.data = wfu_decode_subfolder_list(key);
|
520 |
-
// update tool and nav items
|
521 |
-
wfu_subfolders_update_toolnav(key);
|
522 |
-
// update shortcode
|
523 |
-
item = list;
|
524 |
-
if (val !== item.oldVal) {
|
525 |
-
item.oldVal = val;
|
526 |
-
document.getElementById("wfu_attribute_value_" + key).value = val;
|
527 |
-
wfu_generate_shortcode();
|
528 |
-
}
|
529 |
-
}
|
530 |
-
|
531 |
-
function wfu_subfolders_def_clicked(key) {
|
532 |
-
var list = document.getElementById('wfu_attribute_' + key);
|
533 |
-
if (list.selectedIndex < 0 ) return;
|
534 |
-
var items = list.data;
|
535 |
-
item = items[list.selectedIndex];
|
536 |
-
if (item.default) item.default = false;
|
537 |
-
else {
|
538 |
-
for (var i = 0; i < items.length; i++)
|
539 |
-
items[i].default = false;
|
540 |
-
item.default = true;
|
541 |
-
}
|
542 |
-
// update option contents to match list
|
543 |
-
var val = wfu_update_subfolder_list(key);
|
544 |
-
// update tool and nav items
|
545 |
-
wfu_subfolders_update_toolnav(key);
|
546 |
-
// update shortcode
|
547 |
-
item = list;
|
548 |
-
if (val !== item.oldVal) {
|
549 |
-
item.oldVal = val;
|
550 |
-
document.getElementById("wfu_attribute_value_" + key).value = val;
|
551 |
-
wfu_generate_shortcode();
|
552 |
-
}
|
553 |
-
}
|
554 |
-
|
555 |
-
function wfu_subfolders_ok_clicked(key) {
|
556 |
-
var list = document.getElementById('wfu_attribute_' + key);
|
557 |
-
if (list.selectedIndex < 0 ) return;
|
558 |
-
var tools_path = document.getElementById('wfu_subfolders_path_' + key);
|
559 |
-
var tools_label = document.getElementById('wfu_subfolders_label_' + key);
|
560 |
-
if (tools_path.value == "" || tools_label.value == "") {
|
561 |
-
alert("Path or label cannot be empty!");
|
562 |
-
return;
|
563 |
-
}
|
564 |
-
var items = list.data;
|
565 |
-
var isnewitem = (document.getElementById('wfu_subfolders_isnewitem_' + key).value == "1");
|
566 |
-
if (isnewitem) {
|
567 |
-
var newlevel = parseInt(document.getElementById('wfu_subfolders_newitemlevel_' + key).value);
|
568 |
-
var newitem = {label:tools_label.value, path:tools_path.value, level:newlevel, default:false};
|
569 |
-
var newpos = parseInt(document.getElementById('wfu_subfolders_newitemindex_' + key).value);
|
570 |
-
if (newpos >= items.length) items.push(newitem);
|
571 |
-
else items.splice(newpos, 0, newitem);
|
572 |
-
}
|
573 |
-
else {
|
574 |
-
item = items[list.selectedIndex];
|
575 |
-
item.path = tools_path.value;
|
576 |
-
item.label = tools_label.value;
|
577 |
-
}
|
578 |
-
// update option contents to match list
|
579 |
-
var val = wfu_update_subfolder_list(key);
|
580 |
-
// update list indices
|
581 |
-
list.data = wfu_decode_subfolder_list(key);
|
582 |
-
// update tool and nav items
|
583 |
-
wfu_subfolders_update_toolnav(key);
|
584 |
-
// update shortcode
|
585 |
-
item = list;
|
586 |
-
if (val !== item.oldVal) {
|
587 |
-
item.oldVal = val;
|
588 |
-
document.getElementById("wfu_attribute_value_" + key).value = val;
|
589 |
-
wfu_generate_shortcode();
|
590 |
-
}
|
591 |
-
}
|
592 |
-
|
593 |
-
function wfu_subfolders_del_clicked(key) {
|
594 |
-
var list = document.getElementById('wfu_attribute_' + key);
|
595 |
-
if (list.selectedIndex < 0 ) return;
|
596 |
-
var items = list.data;
|
597 |
-
item = items[list.selectedIndex];
|
598 |
-
// find number of children
|
599 |
-
var children_count = 0;
|
600 |
-
curind = list.selectedIndex + 1;
|
601 |
-
while (curind < items.length) {
|
602 |
-
if (items[curind].level > item.level) {
|
603 |
-
children_count ++;
|
604 |
-
curind ++;
|
605 |
-
}
|
606 |
-
else break;
|
607 |
-
}
|
608 |
-
if (children_count > 0)
|
609 |
-
if (!confirm("Children items will be deleted as well. Proceed?")) return;
|
610 |
-
// remove items from list
|
611 |
-
items.splice(list.selectedIndex, 1 + children_count);
|
612 |
-
// update option contents to match list
|
613 |
-
var val = wfu_update_subfolder_list(key);
|
614 |
-
// update list indices
|
615 |
-
list.data = wfu_decode_subfolder_list(key);
|
616 |
-
// update tool and nav items
|
617 |
-
wfu_subfolders_update_toolnav(key);
|
618 |
-
// update shortcode
|
619 |
-
item = list;
|
620 |
-
if (val !== item.oldVal) {
|
621 |
-
item.oldVal = val;
|
622 |
-
document.getElementById("wfu_attribute_value_" + key).value = val;
|
623 |
-
wfu_generate_shortcode();
|
624 |
-
}
|
625 |
-
}
|
626 |
-
|
627 |
-
function wfu_subfolders_add_clicked(key) {
|
628 |
-
var list = document.getElementById('wfu_attribute_' + key);
|
629 |
-
if (list.selectedIndex < 0 ) return;
|
630 |
-
var items = list.data;
|
631 |
-
var curpos = list.selectedIndex;
|
632 |
-
item = items[curpos];
|
633 |
-
var opts = list.options;
|
634 |
-
var opt = document.createElement("option");
|
635 |
-
opt.value = "";
|
636 |
-
opt.innerHTML = "";
|
637 |
-
opts.add(opt, curpos);
|
638 |
-
list.selectedIndex = curpos;
|
639 |
-
|
640 |
-
var tools_container = document.getElementById('wfu_subfolder_tools_' + key);
|
641 |
-
var tools_path = document.getElementById('wfu_subfolders_path_' + key);
|
642 |
-
var tools_label = document.getElementById('wfu_subfolders_label_' + key);
|
643 |
-
var tools_ok = document.getElementById('wfu_subfolders_ok_' + key);
|
644 |
-
var tools_browse = document.getElementById('wfu_subfolders_browse_' + key);
|
645 |
-
tools_container.className = "wfu_subfolder_tools_container";
|
646 |
-
tools_label.disabled = false;
|
647 |
-
tools_ok.disabled = true;
|
648 |
-
document.getElementById('wfu_subfolders_isnewitem_' + key).value = "1";
|
649 |
-
document.getElementById('wfu_subfolders_newitemindex_' + key).value = curpos;
|
650 |
-
document.getElementById('wfu_subfolders_newitemlevel_' + key).value = item.level;
|
651 |
-
document.getElementById('wfu_subfolders_newitemlevel2_' + key).value = "";
|
652 |
-
tools_path.disabled = (item.level == 0);
|
653 |
-
tools_browse.disabled = (item.level == 0);
|
654 |
-
if (item.level == 0) {
|
655 |
-
tools_path.value = "{root}";
|
656 |
-
tools_label.value = "{upload folder}";
|
657 |
-
}
|
658 |
-
else {
|
659 |
-
tools_path.value = "";
|
660 |
-
tools_label.value = "";
|
661 |
-
}
|
662 |
-
var navs = document.getElementsByName('wfu_subfolder_nav_' + key);
|
663 |
-
for (var i = 0; i < navs.length; i++) navs[i].disabled = true;
|
664 |
-
}
|
665 |
-
|
666 |
-
function wfu_subfolders_browse_clicked(key) {
|
667 |
-
var xhr = wfu_GetHttpRequestObject();
|
668 |
-
if (xhr == null) return;
|
669 |
-
var fd = null;
|
670 |
-
try {
|
671 |
-
var fd = new FormData();
|
672 |
-
}
|
673 |
-
catch(e) {}
|
674 |
-
if (fd == null) return;
|
675 |
-
|
676 |
-
var container = document.getElementById('wfu_global_dialog_container');
|
677 |
-
var dialog = document.getElementById('wfu_subfolders_browser_' + key);
|
678 |
-
var btn = document.getElementById('wfu_subfolders_browse_' + key);
|
679 |
-
var shadow = document.getElementById('wfu_subfolders_inner_shadow_' + key);
|
680 |
-
var msgcont = document.getElementById('wfu_subfolders_browser_msgcont_' + key);
|
681 |
-
var msg = document.getElementById('wfu_subfolders_browser_msg_' + key);
|
682 |
-
var img = document.getElementById('wfu_subfolders_browser_img_' + key);
|
683 |
-
var ok = document.getElementById('wfu_subfolders_browser_ok_' + key);
|
684 |
-
var list = document.getElementById('wfu_subfolders_browser_list_' + key);
|
685 |
-
|
686 |
-
while (list.options.length > 0) list.options.remove(0);
|
687 |
-
ok.disabled = true;
|
688 |
-
ok.onclick = function() {wfu_folder_browser_cancel_clicked(key);}
|
689 |
-
msg.innerHTML = "loading folder contents...";
|
690 |
-
img.style.display = "inline";
|
691 |
-
msgcont.style.display = "block";
|
692 |
-
container.style.display = "block";
|
693 |
-
dialog.style.display = "block";
|
694 |
-
dialog.style.left = (btn.offsetLeft + btn.offsetWidth - dialog.offsetWidth) + 'px';
|
695 |
-
dialog.style.top = (btn.offsetTop + btn.offsetHeight - dialog.offsetHeight) + 'px';
|
696 |
-
shadow.style.display = "block";
|
697 |
-
container.onclick = function() {wfu_folder_browser_cancel_clicked(key)};
|
698 |
-
|
699 |
-
var path = document.getElementById('wfu_attribute_uploadpath').value;
|
700 |
-
if (path.substr(path.length - 1) == "/") path = path.substr(0, path.length - 1);
|
701 |
-
var paths = wfu_get_relative_path(key).split(",");
|
702 |
-
var path1 = path + paths[0];
|
703 |
-
if (path1.substr(0) != "/") path1 = "/" + path1;
|
704 |
-
var path2 = "";
|
705 |
-
if (paths.length == 2) path2 = paths[1];
|
706 |
-
|
707 |
-
fd.append("action", "wfu_ajax_action_read_subfolders");
|
708 |
-
fd.append("folder1", wfu_plugin_encode_string(path1));
|
709 |
-
fd.append("folder2", wfu_plugin_encode_string(path2));
|
710 |
-
xhr.key = key;
|
711 |
-
xhr.addEventListener("load", wfu_readfolderComplete, false);
|
712 |
-
xhr.addEventListener("error", wfu_readfolderFailed, false);
|
713 |
-
xhr.addEventListener("abort", wfu_readfolderCanceled, false);
|
714 |
-
|
715 |
-
xhr.open("POST", AdminParams.wfu_ajax_url);
|
716 |
-
xhr.send(fd);
|
717 |
-
}
|
718 |
-
|
719 |
-
function wfu_readfolderComplete(evt) {
|
720 |
-
var key = evt.target.key;
|
721 |
-
var msgcont = document.getElementById('wfu_subfolders_browser_msgcont_' + key);
|
722 |
-
var msg = document.getElementById('wfu_subfolders_browser_msg_' + key);
|
723 |
-
var img = document.getElementById('wfu_subfolders_browser_img_' + key);
|
724 |
-
var list = document.getElementById('wfu_subfolders_browser_list_' + key);
|
725 |
-
var ok = document.getElementById('wfu_subfolders_browser_ok_' + key);
|
726 |
-
var tools_path = document.getElementById('wfu_subfolders_path_' + key);
|
727 |
-
var tools_label = document.getElementById('wfu_subfolders_label_' + key);
|
728 |
-
|
729 |
-
var txt = evt.target.responseText;
|
730 |
-
if (txt != -1) {
|
731 |
-
var pos = txt.indexOf(":");
|
732 |
-
var txt_header = txt.substr(0, pos);
|
733 |
-
var txt_value = txt.substr(pos + 1, txt.length - pos - 1);
|
734 |
-
if (txt_header == 'success') {
|
735 |
-
var filelist = wfu_plugin_decode_string(txt_value);
|
736 |
-
var flist = filelist.split(",");
|
737 |
-
var fcount = 0;
|
738 |
-
var opt;
|
739 |
-
for (var i = 0; i < flist.length; i++) {
|
740 |
-
if (flist[i] != "") {
|
741 |
-
opt = document.createElement("option");
|
742 |
-
opt.value = flist[i];
|
743 |
-
opt.innerHTML = flist[i].replace("*", " ");
|
744 |
-
list.add(opt);
|
745 |
-
fcount ++;
|
746 |
-
}
|
747 |
-
}
|
748 |
-
if (fcount == 0) {
|
749 |
-
opt = document.createElement("option");
|
750 |
-
opt.value = "";
|
751 |
-
opt.innerHTML = "{empty}";
|
752 |
-
opt.disabled = true;
|
753 |
-
list.add(opt);
|
754 |
-
}
|
755 |
-
list.selectedIndex = -1;
|
756 |
-
ok.onclick = function() {
|
757 |
-
var val = list.options[list.selectedIndex].value;
|
758 |
-
var level = parseInt(document.getElementById('wfu_subfolders_newitemlevel_' + key).value);
|
759 |
-
if (val.substr(0, 1) == "*" || level == 0) {
|
760 |
-
document.getElementById('wfu_subfolders_newitemlevel_' + key).value = level + 1;
|
761 |
-
if (level > 0) val = val.substr(1);
|
762 |
-
}
|
763 |
-
tools_path.value = val;
|
764 |
-
tools_label.value = val;
|
765 |
-
wfu_folder_browser_cancel_clicked(key);
|
766 |
-
wfu_subfolders_ok_clicked(key);
|
767 |
-
}
|
768 |
-
msgcont.style.display = "none";
|
769 |
-
}
|
770 |
-
else if (txt_header == 'error') {
|
771 |
-
msg.innerHTML = txt_value;
|
772 |
-
img.style.display = "none";
|
773 |
-
ok.disabled = false;
|
774 |
-
}
|
775 |
-
else {
|
776 |
-
msg.innerHTML = 'Unknown error';
|
777 |
-
img.style.display = "none";
|
778 |
-
ok.disabled = false;
|
779 |
-
}
|
780 |
-
}
|
781 |
-
}
|
782 |
-
|
783 |
-
function wfu_readfolderFailed(evt) {
|
784 |
-
var key = evt.target.key;
|
785 |
-
var msg = document.getElementById('wfu_subfolders_browser_msg_' + key);
|
786 |
-
var img = document.getElementById('wfu_subfolders_browser_img_' + key);
|
787 |
-
var ok = document.getElementById('wfu_subfolders_browser_ok_' + key);
|
788 |
-
msg.innerHTML = 'Unknown error';
|
789 |
-
img.style.display = "none";
|
790 |
-
ok.disabled = false;
|
791 |
-
}
|
792 |
-
|
793 |
-
function wfu_readfolderCanceled(evt) {
|
794 |
-
var key = evt.target.key;
|
795 |
-
var msg = document.getElementById('wfu_subfolders_browser_msg_' + key);
|
796 |
-
var img = document.getElementById('wfu_subfolders_browser_img_' + key);
|
797 |
-
var ok = document.getElementById('wfu_subfolders_browser_ok_' + key);
|
798 |
-
msg.innerHTML = 'Unknown error';
|
799 |
-
img.style.display = "none";
|
800 |
-
ok.disabled = false;
|
801 |
-
}
|
802 |
-
|
803 |
-
function wfu_subfolders_browser_list_changed(key) {
|
804 |
-
var list = document.getElementById('wfu_subfolders_browser_list_' + key);
|
805 |
-
var ok = document.getElementById('wfu_subfolders_browser_ok_' + key);
|
806 |
-
ok.disabled = (list.selectedIndex < 0);
|
807 |
-
}
|
808 |
-
|
809 |
-
function wfu_folder_browser_cancel_clicked(key) {
|
810 |
-
var container = document.getElementById('wfu_global_dialog_container');
|
811 |
-
var dialog = document.getElementById('wfu_subfolders_browser_' + key);
|
812 |
-
var btn = document.getElementById('wfu_subfolders_browse_' + key);
|
813 |
-
var shadow = document.getElementById('wfu_subfolders_inner_shadow_' + key);
|
814 |
-
|
815 |
-
container.onclick = null;
|
816 |
-
shadow.style.display = "none";
|
817 |
-
dialog.style.display = "none";
|
818 |
-
container.style.display = "none";
|
819 |
-
}
|
820 |
-
|
821 |
-
function wfu_get_relative_path(key) {
|
822 |
-
var list = document.getElementById('wfu_attribute_' + key);
|
823 |
-
if (list.selectedIndex < 0) return;
|
824 |
-
var items = list.data;
|
825 |
-
var isnewitem = (document.getElementById('wfu_subfolders_isnewitem_' + key).value == "1");
|
826 |
-
var level;
|
827 |
-
if (isnewitem) level = parseInt(document.getElementById('wfu_subfolders_newitemlevel_' + key).value);
|
828 |
-
else level = items[list.selectedIndex].level;
|
829 |
-
var relpath = "/";
|
830 |
-
var curpos = list.selectedIndex - 1;
|
831 |
-
var curlevel = level;
|
832 |
-
while (curpos >= 0 && curlevel > 1) {
|
833 |
-
if (items[curpos].level < curlevel) {
|
834 |
-
relpath = "/" + items[curpos].path + relpath;
|
835 |
-
curlevel = items[curpos].level;
|
836 |
-
}
|
837 |
-
curpos --;
|
838 |
-
}
|
839 |
-
if (isnewitem && document.getElementById('wfu_subfolders_newitemlevel2_' + key).value == "1" && level > 0 && list.selectedIndex > 0)
|
840 |
-
relpath += "," + items[list.selectedIndex - 1].path;
|
841 |
-
|
842 |
-
return relpath;
|
843 |
-
}
|
844 |
-
|
845 |
-
function wfu_subfolders_changed(key) {
|
846 |
-
wfu_update_subfolder_list(key);
|
847 |
-
wfu_subfolders_update_toolnav(key);
|
848 |
-
}
|
849 |
-
|
850 |
-
function wfu_subfolders_update_toolnav(key) {
|
851 |
-
var list = document.getElementById('wfu_attribute_' + key);
|
852 |
-
var items, item, ind, nextind, prevlevel;
|
853 |
-
var tools_container = document.getElementById('wfu_subfolder_tools_' + key);
|
854 |
-
var tools_path = document.getElementById('wfu_subfolders_path_' + key);
|
855 |
-
var tools_label = document.getElementById('wfu_subfolders_label_' + key);
|
856 |
-
var tools_ok = document.getElementById('wfu_subfolders_ok_' + key);
|
857 |
-
var tools_browse = document.getElementById('wfu_subfolders_browse_' + key);
|
858 |
-
document.getElementById('wfu_subfolders_isnewitem_' + key).value = "";
|
859 |
-
document.getElementById('wfu_subfolders_newitemindex_' + key).value = "";
|
860 |
-
document.getElementById('wfu_subfolders_newitemlevel_' + key).value = "";
|
861 |
-
document.getElementById('wfu_subfolders_newitemlevel2_' + key).value = "";
|
862 |
-
if (list.data == null) {
|
863 |
-
items = wfu_decode_subfolder_list(key);
|
864 |
-
list.data = items;
|
865 |
-
}
|
866 |
-
else items = list.data;
|
867 |
-
if (list.selectedIndex < 0) {
|
868 |
-
tools_container.className = "wfu_subfolder_tools_container wfu_subfolder_tools_disabled";
|
869 |
-
tools_path.disabled = true;
|
870 |
-
tools_label.disabled = true;
|
871 |
-
tools_ok.disabled = true;
|
872 |
-
tools_browse.disabled = true;
|
873 |
-
tools_label.value = "";
|
874 |
-
tools_path.value = "";
|
875 |
-
}
|
876 |
-
else if (list.selectedIndex >= list.options.length - 1) {
|
877 |
-
tools_container.className = "wfu_subfolder_tools_container";
|
878 |
-
tools_label.disabled = false;
|
879 |
-
tools_ok.disabled = true;
|
880 |
-
document.getElementById('wfu_subfolders_isnewitem_' + key).value = "1";
|
881 |
-
document.getElementById('wfu_subfolders_newitemindex_' + key).value = items.length;
|
882 |
-
var level;
|
883 |
-
if (items.length == 0) level = 0;
|
884 |
-
else if (items[items.length - 1].level == 0) level = 1;
|
885 |
-
else level = items[items.length - 1].level;
|
886 |
-
document.getElementById('wfu_subfolders_newitemlevel_' + key).value = level;
|
887 |
-
document.getElementById('wfu_subfolders_newitemlevel2_' + key).value = "1";
|
888 |
-
tools_path.disabled = (level == 0);
|
889 |
-
tools_browse.disabled = false;
|
890 |
-
if (level == 0) {
|
891 |
-
tools_path.value = "{root}";
|
892 |
-
tools_label.value = "{upload folder}";
|
893 |
-
}
|
894 |
-
else {
|
895 |
-
tools_path.value = "";
|
896 |
-
tools_label.value = "";
|
897 |
-
}
|
898 |
-
}
|
899 |
-
else {
|
900 |
-
tools_container.className = "wfu_subfolder_tools_container";
|
901 |
-
tools_label.disabled = false;
|
902 |
-
tools_ok.disabled = true;
|
903 |
-
item = items[list.selectedIndex];
|
904 |
-
tools_path.disabled = (item.level == 0);
|
905 |
-
tools_browse.disabled = (item.level == 0);
|
906 |
-
tools_label.value = item.label;
|
907 |
-
tools_path.value = item.path;
|
908 |
-
}
|
909 |
-
var navs = document.getElementsByName('wfu_subfolder_nav_' + key);
|
910 |
-
if (list.selectedIndex < 0 || list.selectedIndex >= list.options.length - 1) {
|
911 |
-
for (var i = 0; i < navs.length; i++) navs[i].disabled = true;
|
912 |
-
}
|
913 |
-
else {
|
914 |
-
wfu_subfolders_update_nav(key);
|
915 |
-
}
|
916 |
-
}
|
917 |
-
|
918 |
-
function wfu_subfolders_update_nav(key) {
|
919 |
-
var list = document.getElementById('wfu_attribute_' + key);
|
920 |
-
var navs_up = document.getElementById('wfu_subfolders_up_' + key);
|
921 |
-
var navs_down = document.getElementById('wfu_subfolders_down_' + key);
|
922 |
-
var navs_left = document.getElementById('wfu_subfolders_left_' + key);
|
923 |
-
var navs_right = document.getElementById('wfu_subfolders_right_' + key);
|
924 |
-
var navs_add = document.getElementById('wfu_subfolders_add_' + key);
|
925 |
-
var navs_def = document.getElementById('wfu_subfolders_def_' + key);
|
926 |
-
var navs_del = document.getElementById('wfu_subfolders_del_' + key);
|
927 |
-
var items = list.data;
|
928 |
-
var item = items[list.selectedIndex];
|
929 |
-
navs_up.disabled = (item.index <= 0);
|
930 |
-
ind = list.selectedIndex + 1;
|
931 |
-
nextind = 0;
|
932 |
-
while (ind < items.length) {
|
933 |
-
if (items[ind].level == item.level) {
|
934 |
-
nextind = items[ind].index;
|
935 |
-
break;
|
936 |
-
}
|
937 |
-
else if (items[ind].level < item.level) break;
|
938 |
-
else ind ++;
|
939 |
-
}
|
940 |
-
navs_down.disabled = (item.level == 0 || nextind == 0);
|
941 |
-
navs_left.disabled = ((list.selectedIndex == 0 && item.level < 1) || (list.selectedIndex > 0 && item.level <= 1));
|
942 |
-
if (list.selectedIndex >= 1) prevlevel = items[list.selectedIndex - 1].level;
|
943 |
-
else prevlevel = 0;
|
944 |
-
navs_right.disabled = (item.level - prevlevel > 0);
|
945 |
-
navs_add.disabled = (item.level == 0);
|
946 |
-
navs_def.disabled = false;
|
947 |
-
navs_def.className = "button" + (item.default ? " wfu_subfolder_nav_pressed" : "");
|
948 |
-
navs_del.disabled = false;
|
949 |
-
}
|
950 |
-
|
951 |
-
function wfu_decode_subfolder(data) {
|
952 |
-
var ret = {label:"", path:"", level:0, default:false};
|
953 |
-
data = data.trim();
|
954 |
-
var star_count = 0;
|
955 |
-
var is_default = false;
|
956 |
-
while (star_count < data.length) {
|
957 |
-
if (data.substr(star_count, 1) == "*") star_count ++;
|
958 |
-
else break;
|
959 |
-
}
|
960 |
-
data = data.substr(star_count, data.length - star_count);
|
961 |
-
if (data.substr(0, 1) == '&') {
|
962 |
-
data = data.substr(1);
|
963 |
-
is_default = true;
|
964 |
-
}
|
965 |
-
ret.level = star_count;
|
966 |
-
ret.default = is_default;
|
967 |
-
var data_raw = data.split('/');
|
968 |
-
if (data_raw.length == 1) {
|
969 |
-
ret.path = data_raw[0];
|
970 |
-
ret.label = data_raw[0];
|
971 |
-
}
|
972 |
-
else if (data_raw.length > 1) {
|
973 |
-
ret.path = data_raw[0];
|
974 |
-
ret.label = data_raw[1];
|
975 |
-
}
|
976 |
-
if (star_count == 0) {
|
977 |
-
ret.path = "{root}";
|
978 |
-
if (ret.label == "") ret.label = "{upload folder}";
|
979 |
-
}
|
980 |
-
return ret;
|
981 |
-
}
|
982 |
-
|
983 |
-
function wfu_decode_subfolder_list(key) {
|
984 |
-
var opts = document.getElementById('wfu_attribute_' + key).options;
|
985 |
-
var list = Array();
|
986 |
-
var dir_levels = ['root'];
|
987 |
-
var last_index = [0];
|
988 |
-
var subfolder_path;
|
989 |
-
var prev_level = -1;
|
990 |
-
for (var i = 0; i < opts.length - 1; i++) {
|
991 |
-
list.push(wfu_decode_subfolder(wfu_plugin_decode_string(opts[i].value)));
|
992 |
-
if (dir_levels.length > list[i].level) dir_levels[list[i].level] = list[i].path;
|
993 |
-
else dir_levels.push(list[i].path);
|
994 |
-
subfolder_path = "";
|
995 |
-
for ( j = 1; j <= list[i].level; j++) {
|
996 |
-
subfolder_path += dir_levels[j] + '/';
|
997 |
-
}
|
998 |
-
list[i].fullpath = subfolder_path;
|
999 |
-
if (last_index.length <= list[i].level) last_index.push(0);
|
1000 |
-
if (list[i].level > prev_level) list[i].index = 0;
|
1001 |
-
else list[i].index = last_index[list[i].level] + 1;
|
1002 |
-
last_index[list[i].level] = list[i].index;
|
1003 |
-
prev_level = list[i].level;
|
1004 |
-
}
|
1005 |
-
return list;
|
1006 |
-
}
|
1007 |
-
|
1008 |
-
function wfu_update_subfolder_list(key) {
|
1009 |
-
var opts = document.getElementById('wfu_attribute_' + key).options;
|
1010 |
-
var list = document.getElementById('wfu_attribute_' + key);
|
1011 |
-
var items = list.data;
|
1012 |
-
if (items == null) return;
|
1013 |
-
var value_raw, text_raw;
|
1014 |
-
var global_raw = "";
|
1015 |
-
opts.length = items.length + 1;
|
1016 |
-
for (var i = 0; i < items.length; i ++) {
|
1017 |
-
value_raw = "";
|
1018 |
-
text_raw = "";
|
1019 |
-
for (j = 0; j < items[i].level; j ++) {
|
1020 |
-
value_raw += "*";
|
1021 |
-
text_raw += " ";
|
1022 |
-
}
|
1023 |
-
if (items[i].default) {
|
1024 |
-
value_raw += "&";
|
1025 |
-
opts[i].className = "wfu_select_folders_option_default";
|
1026 |
-
}
|
1027 |
-
else opts[i].className = "";
|
1028 |
-
value_raw += items[i].path + '/' + items[i].label;
|
1029 |
-
text_raw += items[i].label;
|
1030 |
-
opts[i].value = wfu_plugin_encode_string(value_raw);
|
1031 |
-
opts[i].innerHTML = text_raw;
|
1032 |
-
if (global_raw != "") global_raw += ",";
|
1033 |
-
global_raw += value_raw;
|
1034 |
-
}
|
1035 |
-
opts[items.length].value = "";
|
1036 |
-
opts[items.length].innerHTML = "";
|
1037 |
-
return global_raw;
|
1038 |
-
}
|
1039 |
-
|
1040 |
-
function wfu_userdata_edit_field(line, label, required) {
|
1041 |
-
var item;
|
1042 |
-
for (var i = 0; i < line.childNodes.length; i ++) {
|
1043 |
-
item = line.childNodes[i];
|
1044 |
-
if (item.tagName == "INPUT") {
|
1045 |
-
if (item.type == "text") {
|
1046 |
-
item.value = label;
|
1047 |
-
wfu_attach_element_handlers(item, wfu_update_userfield_value);
|
1048 |
-
}
|
1049 |
-
else if (item.type == "checkbox") {
|
1050 |
-
item.checked = required;
|
1051 |
-
}
|
1052 |
-
}
|
1053 |
-
else if (item.tagName == "DIV") item.className = "wfu_userdata_action";
|
1054 |
-
}
|
1055 |
-
}
|
1056 |
-
|
1057 |
-
function wfu_userdata_add_field(obj) {
|
1058 |
-
var line = obj.parentNode;
|
1059 |
-
var newline = line.cloneNode(true);
|
1060 |
-
wfu_userdata_edit_field(newline, "", false);
|
1061 |
-
line.parentNode.insertBefore(newline, line.nextSibling);
|
1062 |
-
}
|
1063 |
-
|
1064 |
-
function wfu_userdata_remove_field(obj) {
|
1065 |
-
var line = obj.parentNode;
|
1066 |
-
var container = line.parentNode;
|
1067 |
-
var first = null;
|
1068 |
-
for (var i = 0; i < container.childNodes.length; i++)
|
1069 |
-
if (container.childNodes[i].nodeType === 1) {
|
1070 |
-
first = container.childNodes[i];
|
1071 |
-
break;
|
1072 |
-
}
|
1073 |
-
if (line != first) {
|
1074 |
-
line.parentNode.removeChild(line);
|
1075 |
-
for (var i = 0; i < first.childNodes.length; i++)
|
1076 |
-
if (first.childNodes[i].nodeType === 1) {
|
1077 |
-
wfu_update_userfield_value({target:first.childNodes[i]});
|
1078 |
-
break;
|
1079 |
-
}
|
1080 |
-
}
|
1081 |
-
}
|
1082 |
-
|
1083 |
-
function wfu_generate_shortcode() {
|
1084 |
-
var defaults = document.getElementById("wfu_attribute_defaults");
|
1085 |
-
var values = document.getElementById("wfu_attribute_values");
|
1086 |
-
var item;
|
1087 |
-
var attribute = "";
|
1088 |
-
var value = "";
|
1089 |
-
var shortcode_full = "[wordpress_file_upload";
|
1090 |
-
var shortcode = "";
|
1091 |
-
for (var i = 0; i < defaults.childNodes.length; i++) {
|
1092 |
-
item = defaults.childNodes[i];
|
1093 |
-
if (item.nodeType === 1) {
|
1094 |
-
attribute = item.id.replace("wfu_attribute_default_", "");
|
1095 |
-
value = document.getElementById("wfu_attribute_value_" + attribute).value;
|
1096 |
-
if (item.value != value)
|
1097 |
-
shortcode += " " + attribute + "=\"" + value + "\"";
|
1098 |
-
}
|
1099 |
-
}
|
1100 |
-
shortcode_full += shortcode + "]";
|
1101 |
-
|
1102 |
-
document.getElementById("wfu_shortcode").value = shortcode_full;
|
1103 |
-
ShortcodeString = shortcode.substr(1);
|
1104 |
-
|
1105 |
-
wfu_schedule_save_shortcode();
|
1106 |
-
}
|
1107 |
-
|
1108 |
-
function wfu_update_text_value(e) {
|
1109 |
-
e = e || window.event;
|
1110 |
-
var item = e.target;
|
1111 |
-
var attribute = item.id.replace("wfu_attribute_", "");
|
1112 |
-
var val = item.value;
|
1113 |
-
//encode some characters not allowed in shortcode, such as line breaks, double quotes (") and brackets ([])
|
1114 |
-
val = val.replace(/(\r\n|\n|\r)/gm,"%n%");
|
1115 |
-
val = val.replace(/\"/gm,"%dq%");
|
1116 |
-
val = val.replace(/\[/gm,"%brl%");
|
1117 |
-
val = val.replace(/\]/gm,"%brr%");
|
1118 |
-
if (val !== item.oldVal) {
|
1119 |
-
item.oldVal = val;
|
1120 |
-
document.getElementById("wfu_attribute_value_" + attribute).value = val;
|
1121 |
-
wfu_generate_shortcode();
|
1122 |
-
}
|
1123 |
-
}
|
1124 |
-
|
1125 |
-
function wfu_update_triplecolor_value(e) {
|
1126 |
-
e = e || window.event;
|
1127 |
-
var item = e.target;
|
1128 |
-
var attribute = item.id.replace("wfu_attribute_", "");
|
1129 |
-
attribute = attribute.replace("_color", "");
|
1130 |
-
attribute = attribute.replace("_bgcolor", "");
|
1131 |
-
attribute = attribute.replace("_borcolor", "");
|
1132 |
-
item = document.getElementById("wfu_attribute_" + attribute + "_color");
|
1133 |
-
var val = item.value + "," +
|
1134 |
-
document.getElementById("wfu_attribute_" + attribute + "_bgcolor").value + "," +
|
1135 |
-
document.getElementById("wfu_attribute_" + attribute + "_borcolor").value;
|
1136 |
-
if (val !== item.oldVal) {
|
1137 |
-
item.oldVal = val;
|
1138 |
-
document.getElementById("wfu_attribute_value_" + attribute).value = val;
|
1139 |
-
wfu_generate_shortcode();
|
1140 |
-
}
|
1141 |
-
}
|
1142 |
-
|
1143 |
-
function wfu_update_dimension_value(e) {
|
1144 |
-
e = e || window.event;
|
1145 |
-
var item = e.target;
|
1146 |
-
var attribute = item.name.replace("wfu_dimension_elements_", "");
|
1147 |
-
var group = document.getElementsByName(item.name);
|
1148 |
-
item = group[0];
|
1149 |
-
var val = "";
|
1150 |
-
var dimname = "";
|
1151 |
-
for (var i = 0; i < group.length; i++) {
|
1152 |
-
dimname = group[i].id.replace("wfu_attribute_" + attribute + "_", "");
|
1153 |
-
if (val != "" && group[i].value != "") val += ", ";
|
1154 |
-
if (group[i].value != "") val += dimname + ":" + group[i].value;
|
1155 |
-
}
|
1156 |
-
if (val !== item.oldVal) {
|
1157 |
-
item.oldVal = val;
|
1158 |
-
document.getElementById("wfu_attribute_value_" + attribute).value = val;
|
1159 |
-
wfu_generate_shortcode();
|
1160 |
-
}
|
1161 |
-
}
|
1162 |
-
|
1163 |
-
function wfu_update_ptext_value(e) {
|
1164 |
-
e = e || window.event;
|
1165 |
-
var item = e.target;
|
1166 |
-
var attribute = item.id.replace("wfu_attribute_", "");
|
1167 |
-
attribute = attribute.substr(2);
|
1168 |
-
var singular = document.getElementById("wfu_attribute_s_" + attribute).value;
|
1169 |
-
var plural = document.getElementById("wfu_attribute_p_" + attribute).value;
|
1170 |
-
var val = singular + "/" + plural;
|
1171 |
-
if (val !== item.oldVal) {
|
1172 |
-
item.oldVal = val;
|
1173 |
-
document.getElementById("wfu_attribute_value_" + attribute).value = val;
|
1174 |
-
}
|
1175 |
-
wfu_generate_shortcode();
|
1176 |
-
}
|
1177 |
-
|
1178 |
-
function wfu_update_mchecklist_value(attribute) {
|
1179 |
-
var value = "";
|
1180 |
-
var mchecklist = document.getElementById("wfu_attribute_" + attribute);
|
1181 |
-
var checkall = document.getElementById("wfu_attribute_" + attribute + "_all");
|
1182 |
-
if (checkall.checked) {
|
1183 |
-
jQuery("#wfu_attribute_" + attribute + " input").prop('disabled', true);
|
1184 |
-
jQuery("#wfu_attribute_" + attribute + " input").prop('checked', true);
|
1185 |
-
value = "all";
|
1186 |
-
}
|
1187 |
-
else {
|
1188 |
-
jQuery("#wfu_attribute_" + attribute + " input").prop('disabled', false);
|
1189 |
-
jQuery("#wfu_attribute_" + attribute + " input").each(function() {
|
1190 |
-
if (jQuery(this).prop('checked'))
|
1191 |
-
value += "," + jQuery(this).next().html();
|
1192 |
-
});
|
1193 |
-
value = value.substr(1);
|
1194 |
-
}
|
1195 |
-
document.getElementById("wfu_attribute_value_" + attribute).value = value;
|
1196 |
-
wfu_generate_shortcode();
|
1197 |
-
}
|
1198 |
-
|
1199 |
-
function wfu_update_rolelist_value(attribute) {
|
1200 |
-
var value = "";
|
1201 |
-
var rolelist = document.getElementById("wfu_attribute_" + attribute);
|
1202 |
-
var checkall = document.getElementById("wfu_attribute_" + attribute + "_all");
|
1203 |
-
if (checkall.checked) {
|
1204 |
-
rolelist.disabled = true;
|
1205 |
-
value = "all";
|
1206 |
-
}
|
1207 |
-
else {
|
1208 |
-
rolelist.disabled = false;
|
1209 |
-
var options = rolelist.options;
|
1210 |
-
for (var i = 0; i < options.length; i++)
|
1211 |
-
if (options[i].selected) {
|
1212 |
-
if (value != "") value += ",";
|
1213 |
-
value += options[i].value;
|
1214 |
-
}
|
1215 |
-
}
|
1216 |
-
document.getElementById("wfu_attribute_value_" + attribute).value = value;
|
1217 |
-
wfu_generate_shortcode();
|
1218 |
-
}
|
1219 |
-
|
1220 |
-
function wfu_update_userfield_value(e) {
|
1221 |
-
e = e || window.event;
|
1222 |
-
var item = e.target;
|
1223 |
-
var line = item.parentNode;
|
1224 |
-
var container = line.parentNode;
|
1225 |
-
var fieldval = "";
|
1226 |
-
var fieldreq = false;
|
1227 |
-
var val = "";
|
1228 |
-
for (var i = 0; i < container.childNodes.length; i++) {
|
1229 |
-
line = container.childNodes[i];
|
1230 |
-
if (line.tagName === "DIV") {
|
1231 |
-
for (var j = 0; j < line.childNodes.length; j++)
|
1232 |
-
if (line.childNodes[j].tagName == "INPUT") {
|
1233 |
-
if (line.childNodes[j].type == "text") {
|
1234 |
-
fieldval = line.childNodes[j].value;
|
1235 |
-
if (i == 0) item = line.childNodes[j];
|
1236 |
-
}
|
1237 |
-
else if (line.childNodes[j].type == "checkbox")
|
1238 |
-
fieldreq = line.childNodes[j].checked;
|
1239 |
-
}
|
1240 |
-
if (val != "" && fieldval != "") val += "/";
|
1241 |
-
if (fieldval != "" && fieldreq) val += "*";
|
1242 |
-
if (fieldval != "") val += fieldval;
|
1243 |
-
}
|
1244 |
-
}
|
1245 |
-
if (val !== item.oldVal) {
|
1246 |
-
item.oldVal = val;
|
1247 |
-
document.getElementById("wfu_attribute_value_userdatalabel").value = val;
|
1248 |
-
wfu_generate_shortcode();
|
1249 |
-
wfu_update_userfield_variables();
|
1250 |
-
}
|
1251 |
-
}
|
1252 |
-
|
1253 |
-
function wfu_update_userfield_variables() {
|
1254 |
-
var userdata = document.getElementById("wfu_attribute_value_userdatalabel").value;
|
1255 |
-
var container = document.getElementById("wfu_wrapper");
|
1256 |
-
var shadows = document.getElementsByClassName("wfu_shadow_userdata", "div", container);
|
1257 |
-
var selects = document.getElementsByName("wfu_userfield_select");
|
1258 |
-
for (var i = 0; i < selects.length; i++) selects[i].style.display = "none";
|
1259 |
-
if (shadows.length == 0) return;
|
1260 |
-
if (shadows[0].style.display == "block") return;
|
1261 |
-
|
1262 |
-
var options_str = '<option style="display:none;">%userdataXXX%</option>';
|
1263 |
-
var userfields = userdata.split("/");
|
1264 |
-
var field = "";
|
1265 |
-
for (var i = 1; i <= userfields.length; i++) {
|
1266 |
-
field = userfields[i - 1];
|
1267 |
-
if (field[0] == "*") field = field.substr(1);
|
1268 |
-
options_str += '<option value="%userdata' + i + '%">' + i + ': ' + field + '</option>';
|
1269 |
-
}
|
1270 |
-
for (var i = 0; i < selects.length; i++) {
|
1271 |
-
selects[i].innerHTML = options_str;
|
1272 |
-
selects[i].style.display = "inline-block";
|
1273 |
-
}
|
1274 |
-
}
|
1275 |
-
|
1276 |
-
function wfu_attach_element_handlers(item, handler) {
|
1277 |
-
var elem_events = ['DOMAttrModified', 'textInput', 'input', 'change', 'keypress', 'paste', 'focus', 'propertychange'];
|
1278 |
-
for (var i = 0; i < elem_events.length; i++)
|
1279 |
-
wfu_addEventHandler(item, elem_events[i], handler);
|
1280 |
-
}
|
1281 |
-
|
1282 |
-
function wfu_Attach_Admin_Events() {
|
1283 |
-
wfu_generate_shortcode();
|
1284 |
-
wfu_update_userfield_variables();
|
1285 |
-
wfu_Attach_Admin_DragDrop_Events();
|
1286 |
-
var text_elements = document.getElementsByName("wfu_text_elements");
|
1287 |
-
for (var i = 0; i < text_elements.length; i++) wfu_attach_element_handlers(text_elements[i], wfu_update_text_value);
|
1288 |
-
var ptext_elements = document.getElementsByName("wfu_ptext_elements");
|
1289 |
-
for (var i = 0; i < ptext_elements.length; i++) wfu_attach_element_handlers(ptext_elements[i], wfu_update_ptext_value);
|
1290 |
-
var triplecolor_elements = document.getElementsByName("wfu_triplecolor_elements");
|
1291 |
-
for (var i = 0; i < triplecolor_elements.length; i++) wfu_attach_element_handlers(triplecolor_elements[i], wfu_update_triplecolor_value);
|
1292 |
-
var dimension_elements = document.getElementsByName("wfu_dimension_elements_widths");
|
1293 |
-
for (var i = 0; i < dimension_elements.length; i++) wfu_attach_element_handlers(dimension_elements[i], wfu_update_dimension_value);
|
1294 |
-
dimension_elements = document.getElementsByName("wfu_dimension_elements_heights");
|
1295 |
-
for (var i = 0; i < dimension_elements.length; i++) wfu_attach_element_handlers(dimension_elements[i], wfu_update_dimension_value);
|
1296 |
-
var userfield_elements = document.getElementsByName("wfu_userfield_elements");
|
1297 |
-
for (var i = 0; i < userfield_elements.length; i++) wfu_attach_element_handlers(userfield_elements[i], wfu_update_userfield_value);
|
1298 |
-
var subfolder_input_elements = document.getElementsByName("wfu_subfolder_tools_input");
|
1299 |
-
for (var i = 0; i < subfolder_input_elements.length; i++) wfu_attach_element_handlers(subfolder_input_elements[i], wfu_subfolders_input_changed);
|
1300 |
-
}
|
1301 |
-
|
1302 |
-
|
1303 |
-
function wfu_insert_variable(obj) {
|
1304 |
-
var attr = obj.className.replace("wfu_variable wfu_variable_", "");
|
1305 |
-
var inp = document.getElementById("wfu_attribute_" + attr);
|
1306 |
-
var pos = inp.selectionStart;
|
1307 |
-
var prevval = inp.value;
|
1308 |
-
inp.value = prevval.substr(0, pos) + obj.innerHTML + prevval.substr(pos);
|
1309 |
-
wfu_update_text_value({target:inp});
|
1310 |
-
}
|
1311 |
-
|
1312 |
-
function wfu_insert_userfield_variable(obj) {
|
1313 |
-
var attr = obj.className.replace("wfu_variable wfu_variable_", "");
|
1314 |
-
var inp = document.getElementById("wfu_attribute_" + attr);
|
1315 |
-
var pos = inp.selectionStart;
|
1316 |
-
var prevval = inp.value;
|
1317 |
-
inp.value = prevval.substr(0, pos) + obj.value + prevval.substr(pos);
|
1318 |
-
obj.value = "%userdataXXX%";
|
1319 |
-
wfu_update_text_value({target:inp});
|
1320 |
-
}
|
1321 |
-
|
1322 |
-
//wfu_GetHttpRequestObject: function that returns XMLHttpRequest object for various browsers
|
1323 |
-
function wfu_GetHttpRequestObject() {
|
1324 |
-
var xhr = null;
|
1325 |
-
try {
|
1326 |
-
xhr = new XMLHttpRequest();
|
1327 |
-
}
|
1328 |
-
catch(e) {
|
1329 |
-
try {
|
1330 |
-
xhr = new ActiveXObject("Msxml2.XMLHTTP");
|
1331 |
-
}
|
1332 |
-
catch (e2) {
|
1333 |
-
try {
|
1334 |
-
xhr = new ActiveXObject("Microsoft.XMLHTTP");
|
1335 |
-
}
|
1336 |
-
catch (e) {}
|
1337 |
-
}
|
1338 |
-
}
|
1339 |
-
if (xhr == null && window.createRequest) {
|
1340 |
-
try {
|
1341 |
-
xmlhttp = window.createRequest();
|
1342 |
-
}
|
1343 |
-
catch (e) {}
|
1344 |
-
|
1345 |
-
}
|
1346 |
-
return xhr;
|
1347 |
-
}
|
1348 |
-
|
1349 |
-
//wfu_plugin_encode_string: function that encodes a decoded string
|
1350 |
-
function wfu_plugin_encode_string(str) {
|
1351 |
-
var i = 0;
|
1352 |
-
var newstr = "";
|
1353 |
-
var num;
|
1354 |
-
var hex = "";
|
1355 |
-
for (i = 0; i < str.length; i++) {
|
1356 |
-
num = str.charCodeAt(i);
|
1357 |
-
if (num >= 2048) num = (((num & 16773120) | 917504) << 4) + (((num & 4032) | 8192) << 2) + ((num & 63) | 128);
|
1358 |
-
else if (num >= 128) num = (((num & 65472) | 12288) << 2) + ((num & 63) | 128);
|
1359 |
-
hex = num.toString(16);
|
1360 |
-
if (hex.length == 1 || hex.length == 3 || hex.length == 5) hex = "0" + hex;
|
1361 |
-
newstr += hex;
|
1362 |
-
}
|
1363 |
-
return newstr;
|
1364 |
-
}
|
1365 |
-
|
1366 |
-
//wfu_plugin_decode_string: function that decodes an encoded string
|
1367 |
-
function wfu_plugin_decode_string(str) {
|
1368 |
-
var i = 0;
|
1369 |
-
var newstr = "";
|
1370 |
-
var num, val;
|
1371 |
-
while (i < str.length) {
|
1372 |
-
num = parseInt(str.substr(i, 2), 16);
|
1373 |
-
if (num < 128) val = num;
|
1374 |
-
else if (num < 224) val = ((num & 31) << 6) + (parseInt(str.substr((i += 2), 2), 16) & 63);
|
1375 |
-
else val = ((num & 15) << 12) + ((parseInt(str.substr((i += 2), 2), 16) & 63) << 6) + (parseInt(str.substr((i += 2), 2), 16) & 63);
|
1376 |
-
newstr += String.fromCharCode(val);
|
1377 |
-
i += 2;
|
1378 |
-
}
|
1379 |
-
return newstr;
|
1380 |
-
}
|
1381 |
-
|
1382 |
-
function wfu_schedule_save_shortcode() {
|
1383 |
-
var d = new Date();
|
1384 |
-
var dt = ShortcodeNextSave - d.getTime();
|
1385 |
-
if (ShortcodeTimeOut != null) {
|
1386 |
-
clearTimeout(ShortcodeTimeOut);
|
1387 |
-
ShortcodeTimeOut = null;
|
1388 |
-
}
|
1389 |
-
if (dt <= 0) wfu_save_shortcode();
|
1390 |
-
else ShortcodeTimeOut = setTimeout(function() {wfu_save_shortcode();}, dt);
|
1391 |
-
}
|
1392 |
-
|
1393 |
-
function wfu_save_shortcode() {
|
1394 |
-
var xhr = wfu_GetHttpRequestObject();
|
1395 |
-
if (xhr == null) return;
|
1396 |
-
|
1397 |
-
//send request using AJAX
|
1398 |
-
var url = AdminParams.wfu_ajax_url;
|
1399 |
-
params = new Array(2);
|
1400 |
-
params[0] = new Array(2);
|
1401 |
-
params[0][0] = 'action';
|
1402 |
-
params[0][1] = 'wfu_ajax_action_save_shortcode';
|
1403 |
-
params[1] = new Array(2);
|
1404 |
-
params[1][0] = 'shortcode';
|
1405 |
-
params[1][1] = wfu_plugin_encode_string(ShortcodeString);
|
1406 |
-
|
1407 |
-
var parameters = '';
|
1408 |
-
for (var i = 0; i < params.length; i++) {
|
1409 |
-
parameters += (i > 0 ? "&" : "") + params[i][0] + "=" + encodeURI(params[i][1]);
|
1410 |
-
}
|
1411 |
-
|
1412 |
-
var d = new Date();
|
1413 |
-
ShortcodeNextSave = d.getTime() + 5000;
|
1414 |
-
|
1415 |
-
xhr.open("POST", url, true);
|
1416 |
-
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
1417 |
-
// xhr.setRequestHeader("Content-length", parameters.length);
|
1418 |
-
// xhr.setRequestHeader("Connection", "close");
|
1419 |
-
xhr.onreadystatechange = function() {
|
1420 |
-
if ( xhr.readyState == 4 ) {
|
1421 |
-
if ( xhr.status == 200 ) {
|
1422 |
-
if (xhr.responseText.substr(0, 22) == "save_shortcode_success") {
|
1423 |
-
document.getElementById("wfu_save_label").innerHTML = "saved";
|
1424 |
-
document.getElementById("wfu_save_label").className = "wfu_save_label";
|
1425 |
-
document.getElementById("wfu_save_label").style.opacity = 1;
|
1426 |
-
wfu_fadeout_element(300);
|
1427 |
-
ShortcodeNextSave = d.getTime() + 1000;
|
1428 |
-
if (ShortcodeTimeOut != null) wfu_schedule_save_shortcode();
|
1429 |
-
}
|
1430 |
-
else {
|
1431 |
-
document.getElementById("wfu_save_label").innerHTML = "not saved";
|
1432 |
-
document.getElementById("wfu_save_label").className = "wfu_save_label_fail";
|
1433 |
-
document.getElementById("wfu_save_label").style.opacity = 1;
|
1434 |
-
wfu_fadeout_element(300);
|
1435 |
-
}
|
1436 |
-
}
|
1437 |
-
}
|
1438 |
-
};
|
1439 |
-
xhr.send(parameters);
|
1440 |
-
}
|
1441 |
-
|
1442 |
-
function wfu_adjust_opacity(opacity) {
|
1443 |
-
document.getElementById("wfu_save_label").style.opacity = opacity;
|
1444 |
-
}
|
1445 |
-
|
1446 |
-
function wfu_fadeout_element(interval) {
|
1447 |
-
var reps = 20.0;
|
1448 |
-
var op = 0.0;
|
1449 |
-
for (var i = 0; i < reps; i++) {
|
1450 |
-
op = 1.0 - i / reps;
|
1451 |
-
setTimeout('wfu_adjust_opacity("' + op.toString() + '")', i * interval / reps);
|
1452 |
-
}
|
1453 |
-
|
1454 |
-
setTimeout('wfu_adjust_opacity("0.0")', i * interval / reps);
|
1455 |
-
}
|
1456 |
-
|
1457 |
-
function wfu_apply_value(attribute, type, value) {
|
1458 |
-
if (type == "onoff") {
|
1459 |
-
document.getElementById("wfu_attribute_" + attribute).className = "wfu_onoff_container_" + (value != "true" ? "on" : "off");
|
1460 |
-
wfu_admin_onoff_clicked(attribute);
|
1461 |
-
}
|
1462 |
-
else if (type == "text" || type == "ltext" || type == "integer" || type == "float" || type == "mtext" || type == "color" ) {
|
1463 |
-
var item = document.getElementById("wfu_attribute_" + attribute);
|
1464 |
-
//decode some characters not allowed in shortcode, such as line breaks, double quotes (") and brackets ([])
|
1465 |
-
value = value.replace(/\%n\%/gm,"\n");
|
1466 |
-
value = value.replace(/\%dq\%/gm,"\"");
|
1467 |
-
value = value.replace(/\%brl\%/gm,"[");
|
1468 |
-
value = value.replace(/\%brr\%/gm,"]");
|
1469 |
-
if (type == "color") {
|
1470 |
-
var rgb = colourNameToHex(value);
|
1471 |
-
if (!rgb) rgb = value;
|
1472 |
-
jQuery('#wfu_attribute_' + attribute).wpColorPicker('color', rgb);
|
1473 |
-
}
|
1474 |
-
item.value = value;
|
1475 |
-
wfu_update_text_value({target:item});
|
1476 |
-
}
|
1477 |
-
else if (type == "placements") {
|
1478 |
-
wfu_admin_recreate_placements_panel(value);
|
1479 |
-
document.getElementById("wfu_attribute_value_placements").value = value;
|
1480 |
-
wfu_generate_shortcode();
|
1481 |
-
}
|
1482 |
-
else if (type == "radio") {
|
1483 |
-
var radios = document.getElementsByName("wfu_radioattribute_" + attribute);
|
1484 |
-
for (var i = 0; i < radios.length; i++)
|
1485 |
-
radios[i].checked = (radios[i].value == value || ("*" + radios[i].value) == value);
|
1486 |
-
wfu_admin_radio_clicked(attribute);
|
1487 |
-
}
|
1488 |
-
else if (type == "ptext" ) {
|
1489 |
-
//decode some characters not allowed in shortcode, such as line breaks, double quotes (") and brackets ([])
|
1490 |
-
value = value.replace(/\%n\%/gm,"\n");
|
1491 |
-
value = value.replace(/\%dq\%/gm,"\"");
|
1492 |
-
value = value.replace(/\%brl\%/gm,"[");
|
1493 |
-
value = value.replace(/\%brr\%/gm,"]");
|
1494 |
-
var parts = value.split("/");
|
1495 |
-
var singular = parts.length < 1 ? "" : parts[0];
|
1496 |
-
var plural = parts.length < 2 ? singular : parts[1];
|
1497 |
-
var item1 = document.getElementById("wfu_attribute_s_" + attribute);
|
1498 |
-
item1.value = singular;
|
1499 |
-
var item2 = document.getElementById("wfu_attribute_p_" + attribute);
|
1500 |
-
item2.value = plural;
|
1501 |
-
wfu_update_ptext_value({target:item1});
|
1502 |
-
wfu_update_ptext_value({target:item2});
|
1503 |
-
}
|
1504 |
-
else if (type == "mchecklist" ) {
|
1505 |
-
value = value.toLowerCase();
|
1506 |
-
if (value == "all") document.getElementById("wfu_attribute_" + attribute + "_all").checked = true;
|
1507 |
-
else {
|
1508 |
-
document.getElementById("wfu_attribute_" + attribute + "_all").checked = false;
|
1509 |
-
var items = value.split(",");
|
1510 |
-
for (var i = 0; i < items.length; i++) items[i] = items[i].trim();
|
1511 |
-
jQuery("#wfu_attribute_" + attribute + " input").each(function() {
|
1512 |
-
jQuery(this).prop('checked', (items.indexOf(jQuery(this).next().html()) > -1));
|
1513 |
-
});
|
1514 |
-
}
|
1515 |
-
wfu_update_mchecklist_value(attribute);
|
1516 |
-
}
|
1517 |
-
else if (type == "rolelist" ) {
|
1518 |
-
value = value.toLowerCase();
|
1519 |
-
if (value == "all") document.getElementById("wfu_attribute_" + attribute + "_all").checked = true;
|
1520 |
-
else {
|
1521 |
-
document.getElementById("wfu_attribute_" + attribute + "_all").checked = false;
|
1522 |
-
var roles = value.split(",");
|
1523 |
-
for (var i = 0; i < roles.length; i++) roles[i] = roles[i].trim();
|
1524 |
-
var item = document.getElementById("wfu_attribute_" + attribute);
|
1525 |
-
for (var i = 0; i < item.options.length; i++)
|
1526 |
-
item.options[i].selected = (roles.indexOf(item.options[i].value) > -1);
|
1527 |
-
}
|
1528 |
-
wfu_update_rolelist_value(attribute);
|
1529 |
-
}
|
1530 |
-
else if (type == "dimensions" ) {
|
1531 |
-
var dims = value.split(",");
|
1532 |
-
var details, nam, val, item;
|
1533 |
-
var group = document.getElementsByName("wfu_dimension_elements_" + attribute);
|
1534 |
-
for (var i = 0; i < group.length; i++) group[i].value = "";
|
1535 |
-
for (var i = 0; i < dims.length; i++) {
|
1536 |
-
details = dims[i].split(":", 2);
|
1537 |
-
nam = details.length < 1 ? "" : details[0];
|
1538 |
-
val = details.length < 2 ? nam : details[1];
|
1539 |
-
item = document.getElementById("wfu_attribute_" + attribute + "_" + nam.trim());
|
1540 |
-
if (item) item.value = val.trim();
|
1541 |
-
}
|
1542 |
-
item = group[0];
|
1543 |
-
wfu_update_dimension_value({target:item});
|
1544 |
-
}
|
1545 |
-
else if (type == "userfields") {
|
1546 |
-
var fields_arr = value.split("/");
|
1547 |
-
var is_req;
|
1548 |
-
var fields = Array();
|
1549 |
-
for (var i = 0; i < fields_arr.length; i++) {
|
1550 |
-
is_req = (fields_arr[i].substr(0, 1) == "*");
|
1551 |
-
if (is_req) fields_arr[i] = fields_arr[i].substr(1);
|
1552 |
-
if (fields_arr[i] != "") fields.push({name:fields_arr[i], required:is_req});
|
1553 |
-
}
|
1554 |
-
var container = document.getElementById("wfu_attribute_" + attribute);
|
1555 |
-
var first = null;
|
1556 |
-
var remove_array = Array();
|
1557 |
-
for (var i = 0; i < container.childNodes.length; i++)
|
1558 |
-
if (container.childNodes[i].nodeType === 1) {
|
1559 |
-
if (first == null) first = container.childNodes[i];
|
1560 |
-
else remove_array.push(container.childNodes[i]);
|
1561 |
-
}
|
1562 |
-
for (var i = 0; i < remove_array.length; i++) container.removeChild(remove_array[i]);
|
1563 |
-
wfu_userdata_edit_field(first, "", false);
|
1564 |
-
|
1565 |
-
var newline;
|
1566 |
-
var prevline = first;
|
1567 |
-
for (var i = 0; i < fields.length; i++) {
|
1568 |
-
if (i == 0) wfu_userdata_edit_field(first, fields[i].name, fields[i].required);
|
1569 |
-
else {
|
1570 |
-
newline = prevline.cloneNode(true);
|
1571 |
-
wfu_userdata_edit_field(newline, fields[i].name, fields[i].required);
|
1572 |
-
container.insertBefore(newline, prevline.nextSibling);
|
1573 |
-
prevline = newline;
|
1574 |
-
}
|
1575 |
-
}
|
1576 |
-
var item;
|
1577 |
-
for (var i = 0; i < first.childNodes.length; i++) {
|
1578 |
-
item = first.childNodes[i];
|
1579 |
-
if (item.tagName == "INPUT") break;
|
1580 |
-
}
|
1581 |
-
wfu_update_userfield_value({target:item});
|
1582 |
-
}
|
1583 |
-
else if (type == "color-triplet") {
|
1584 |
-
var colors = value.split(",");
|
1585 |
-
for (var i = 0; i < colors.length; i++) colors[i] = colors[i].trim();
|
1586 |
-
if (colors.length == 2) colors = [colors[0], colors[1], "#000000"];
|
1587 |
-
else if (colors.length == 1) colors = [colors[0], "#FFFFFF", "#000000"];
|
1588 |
-
else if (colors.length < 3) colors = ["#000000", "#FFFFFF", "#000000"];
|
1589 |
-
var rgb = colourNameToHex(colors[0]);
|
1590 |
-
if (!rgb) rgb = colors[0];
|
1591 |
-
jQuery('#wfu_attribute_' + attribute + "_color").wpColorPicker('color', rgb);
|
1592 |
-
var item = document.getElementById("wfu_attribute_" + attribute + "_color");
|
1593 |
-
item.value = colors[0];
|
1594 |
-
rgb = colourNameToHex(colors[1]);
|
1595 |
-
if (!rgb) rgb = colors[1];
|
1596 |
-
jQuery('#wfu_attribute_' + attribute + "_bgcolor").wpColorPicker('color', rgb);
|
1597 |
-
document.getElementById("wfu_attribute_" + attribute + "_bgcolor").value = colors[1];
|
1598 |
-
rgb = colourNameToHex(colors[2]);
|
1599 |
-
if (!rgb) rgb = colors[2];
|
1600 |
-
jQuery('#wfu_attribute_' + attribute + "_borcolor").wpColorPicker('color', rgb);
|
1601 |
-
document.getElementById("wfu_attribute_" + attribute + "_borcolor").value = colors[2];
|
1602 |
-
wfu_update_triplecolor_value({target:item});
|
1603 |
-
}
|
1604 |
-
else if (type == "folderlist") {
|
1605 |
-
var items = wfu_parse_folderlist_js(value);
|
1606 |
-
var opts = document.getElementById('wfu_attribute_' + attribute).options;
|
1607 |
-
while (opts.length > 0) opts.remove(0);
|
1608 |
-
var opt, subfolder, subfolder_raw, text, stars, subvalue;
|
1609 |
-
for (var i = 0; i < items.path.length; i++) {
|
1610 |
-
subfolder = items.path[i];
|
1611 |
-
if (subfolder.substr(subfolder.length, 1) == '/') subfolder = subfolder.substr(0, subfolder.length - 1);
|
1612 |
-
subfolder_raw = subfolder.split("/");
|
1613 |
-
subfolder = subfolder_raw[subfolder_raw.length - 1];
|
1614 |
-
stars = parseInt(items.level[i]);
|
1615 |
-
text = "";
|
1616 |
-
subvalue = "";
|
1617 |
-
for (var j = 0; j < stars; j++) {
|
1618 |
-
text += " ";
|
1619 |
-
subvalue += "*";
|
1620 |
-
}
|
1621 |
-
text += items.label[i];
|
1622 |
-
if (items.default[i]) subvalue += "&";
|
1623 |
-
if (subfolder == "") subvalue += "{root}/" + items.label[i];
|
1624 |
-
else subvalue += subfolder + items.label[i];
|
1625 |
-
|
1626 |
-
opt = document.createElement("option");
|
1627 |
-
if (items.default[i]) opt.className = "wfu_select_folders_option_default";
|
1628 |
-
else opt.className = "";
|
1629 |
-
opt.value = wfu_plugin_encode_string(subvalue);
|
1630 |
-
opt.innerHTML = text;
|
1631 |
-
opts.add(opt);
|
1632 |
-
}
|
1633 |
-
opt = document.createElement("option");
|
1634 |
-
opt.value = "";
|
1635 |
-
opt.innerHTML = "";
|
1636 |
-
opts.add(opt);
|
1637 |
-
var list = document.getElementById('wfu_attribute_' + attribute);
|
1638 |
-
// update list indices
|
1639 |
-
list.data = wfu_decode_subfolder_list(attribute);
|
1640 |
-
// update tool and nav items
|
1641 |
-
wfu_subfolders_update_toolnav(attribute);
|
1642 |
-
// update shortcode
|
1643 |
-
item = list;
|
1644 |
-
if (value !== item.oldVal) {
|
1645 |
-
item.oldVal = value;
|
1646 |
-
document.getElementById("wfu_attribute_value_" + attribute).value = value;
|
1647 |
-
wfu_generate_shortcode();
|
1648 |
-
}
|
1649 |
-
}
|
1650 |
-
}
|
1651 |
-
|
1652 |
-
function wfu_parse_folderlist_js(list) {
|
1653 |
-
var ret = Object();
|
1654 |
-
ret.path = Array();
|
1655 |
-
ret.label = Array();
|
1656 |
-
ret.level = Array();
|
1657 |
-
ret.default = Array();
|
1658 |
-
|
1659 |
-
var subfolders = list.split(",");
|
1660 |
-
if (subfolders.length == 0) return ret;
|
1661 |
-
if (subfolders.length == 1 && subfolders[0].trim() == "") return ret;
|
1662 |
-
var dir_levels = ["root"];
|
1663 |
-
var prev_level = 0;
|
1664 |
-
var level0_count = 0;
|
1665 |
-
var _default = -1;
|
1666 |
-
var subfolder, star_count, start_spaces, is_default, subfolder_dir, subfolder_label, subfolder_path;
|
1667 |
-
for (var i = 0; i < subfolders.length; i++) {
|
1668 |
-
subfolder = subfolders[i].trim();
|
1669 |
-
star_count = 0;
|
1670 |
-
start_spaces = "";
|
1671 |
-
is_default = false;
|
1672 |
-
// check for folder level
|
1673 |
-
while (star_count < subfolder.length) {
|
1674 |
-
if ( subfolder.substr(star_count, 1) == "*" ) {
|
1675 |
-
star_count ++;
|
1676 |
-
start_spaces += " ";
|
1677 |
-
}
|
1678 |
-
else break;
|
1679 |
-
}
|
1680 |
-
if (star_count - prev_level <= 1 && (star_count > 0 || level0_count == 0)) {
|
1681 |
-
subfolder = subfolder.substr(star_count, subfolder.length - star_count);
|
1682 |
-
// check for default value
|
1683 |
-
if (subfolder.substr(0, 1) == '&') {
|
1684 |
-
subfolder = subfolder.substr(1);
|
1685 |
-
is_default = true;
|
1686 |
-
}
|
1687 |
-
//split item in folder path and folder name
|
1688 |
-
subfolder_items = subfolder.split("/");
|
1689 |
-
if (subfolder_items.length < 2) subfolder_items.push("");
|
1690 |
-
if (subfolder_items[1] != "") {
|
1691 |
-
subfolder_dir = subfolder_items[0];
|
1692 |
-
subfolder_label = subfolder_items[1];
|
1693 |
-
}
|
1694 |
-
else {
|
1695 |
-
subfolder_dir = subfolder;
|
1696 |
-
subfolder_label = subfolder;
|
1697 |
-
}
|
1698 |
-
if (subfolder_dir != "") {
|
1699 |
-
// set is_default flag to true only for the first default item
|
1700 |
-
if (is_default && _default == -1) _default = ret.path.length;
|
1701 |
-
else is_default = false;
|
1702 |
-
// set flag that root folder has been included (so that it is not included it again)
|
1703 |
-
if (star_count == 0) level0_count = 1;
|
1704 |
-
if (dir_levels.length > star_count) dir_levels[star_count] = subfolder_dir;
|
1705 |
-
else dir_levels.push(subfolder_dir);
|
1706 |
-
subfolder_path = "";
|
1707 |
-
for (var i_count = 1; i_count <= star_count; i_count++) {
|
1708 |
-
subfolder_path += dir_levels[i_count] + '/';
|
1709 |
-
}
|
1710 |
-
ret.path.push(subfolder_path);
|
1711 |
-
ret.label.push(subfolder_label);
|
1712 |
-
ret.level.push(star_count);
|
1713 |
-
ret.default.push(is_default);
|
1714 |
-
prev_level = star_count;
|
1715 |
-
}
|
1716 |
-
}
|
1717 |
-
}
|
1718 |
-
|
1719 |
-
return ret;
|
1720 |
-
}
|
1721 |
-
|
1722 |
-
function colourNameToHex(colour)
|
1723 |
-
{
|
1724 |
-
var colours = {"aliceblue":"#f0f8ff","antiquewhite":"#faebd7","aqua":"#00ffff","aquamarine":"#7fffd4","azure":"#f0ffff",
|
1725 |
-
"beige":"#f5f5dc","bisque":"#ffe4c4","black":"#000000","blanchedalmond":"#ffebcd","blue":"#0000ff","blueviolet":"#8a2be2","brown":"#a52a2a","burlywood":"#deb887",
|
1726 |
-
"cadetblue":"#5f9ea0","chartreuse":"#7fff00","chocolate":"#d2691e","coral":"#ff7f50","cornflowerblue":"#6495ed","cornsilk":"#fff8dc","crimson":"#dc143c","cyan":"#00ffff",
|
1727 |
-
"darkblue":"#00008b","darkcyan":"#008b8b","darkgoldenrod":"#b8860b","darkgray":"#a9a9a9","darkgreen":"#006400","darkkhaki":"#bdb76b","darkmagenta":"#8b008b","darkolivegreen":"#556b2f",
|
1728 |
-
"darkorange":"#ff8c00","darkorchid":"#9932cc","darkred":"#8b0000","darksalmon":"#e9967a","darkseagreen":"#8fbc8f","darkslateblue":"#483d8b","darkslategray":"#2f4f4f","darkturquoise":"#00ced1",
|
1729 |
-
"darkviolet":"#9400d3","deeppink":"#ff1493","deepskyblue":"#00bfff","dimgray":"#696969","dodgerblue":"#1e90ff",
|
1730 |
-
"firebrick":"#b22222","floralwhite":"#fffaf0","forestgreen":"#228b22","fuchsia":"#ff00ff",
|
1731 |
-
"gainsboro":"#dcdcdc","ghostwhite":"#f8f8ff","gold":"#ffd700","goldenrod":"#daa520","gray":"#808080","green":"#008000","greenyellow":"#adff2f",
|
1732 |
-
"honeydew":"#f0fff0","hotpink":"#ff69b4",
|
1733 |
-
"indianred ":"#cd5c5c","indigo ":"#4b0082","ivory":"#fffff0","khaki":"#f0e68c",
|
1734 |
-
"lavender":"#e6e6fa","lavenderblush":"#fff0f5","lawngreen":"#7cfc00","lemonchiffon":"#fffacd","lightblue":"#add8e6","lightcoral":"#f08080","lightcyan":"#e0ffff","lightgoldenrodyellow":"#fafad2",
|
1735 |
-
"lightgrey":"#d3d3d3","lightgreen":"#90ee90","lightpink":"#ffb6c1","lightsalmon":"#ffa07a","lightseagreen":"#20b2aa","lightskyblue":"#87cefa","lightslategray":"#778899","lightsteelblue":"#b0c4de",
|
1736 |
-
"lightyellow":"#ffffe0","lime":"#00ff00","limegreen":"#32cd32","linen":"#faf0e6",
|
1737 |
-
"magenta":"#ff00ff","maroon":"#800000","mediumaquamarine":"#66cdaa","mediumblue":"#0000cd","mediumorchid":"#ba55d3","mediumpurple":"#9370d8","mediumseagreen":"#3cb371","mediumslateblue":"#7b68ee",
|
1738 |
-
"mediumspringgreen":"#00fa9a","mediumturquoise":"#48d1cc","mediumvioletred":"#c71585","midnightblue":"#191970","mintcream":"#f5fffa","mistyrose":"#ffe4e1","moccasin":"#ffe4b5",
|
1739 |
-
"navajowhite":"#ffdead","navy":"#000080",
|
1740 |
-
"oldlace":"#fdf5e6","olive":"#808000","olivedrab":"#6b8e23","orange":"#ffa500","orangered":"#ff4500","orchid":"#da70d6",
|
1741 |
-
"palegoldenrod":"#eee8aa","palegreen":"#98fb98","paleturquoise":"#afeeee","palevioletred":"#d87093","papayawhip":"#ffefd5","peachpuff":"#ffdab9","peru":"#cd853f","pink":"#ffc0cb","plum":"#dda0dd","powderblue":"#b0e0e6","purple":"#800080",
|
1742 |
-
"red":"#ff0000","rosybrown":"#bc8f8f","royalblue":"#4169e1",
|
1743 |
-
"saddlebrown":"#8b4513","salmon":"#fa8072","sandybrown":"#f4a460","seagreen":"#2e8b57","seashell":"#fff5ee","sienna":"#a0522d","silver":"#c0c0c0","skyblue":"#87ceeb","slateblue":"#6a5acd","slategray":"#708090","snow":"#fffafa","springgreen":"#00ff7f","steelblue":"#4682b4",
|
1744 |
-
"tan":"#d2b48c","teal":"#008080","thistle":"#d8bfd8","tomato":"#ff6347","turquoise":"#40e0d0",
|
1745 |
-
"violet":"#ee82ee",
|
1746 |
-
"wheat":"#f5deb3","white":"#ffffff","whitesmoke":"#f5f5f5",
|
1747 |
-
"yellow":"#ffff00","yellowgreen":"#9acd32"
|
1748 |
-
};
|
1749 |
-
|
1750 |
-
if (typeof colours[colour.toLowerCase()] != 'undefined')
|
1751 |
-
return colours[colour.toLowerCase()];
|
1752 |
-
|
1753 |
-
return false;
|
1754 |
-
}
|
1755 |
-
|
1756 |
-
function wfu_download_file(ajaxurl_enc, filepath_enc, dataid) {
|
1757 |
-
var url = wfu_plugin_decode_string(ajaxurl_enc) + '?action=wfu_ajax_action_download_file&file=' + filepath_enc + '&dataid=' + dataid;
|
1758 |
-
var IF = document.getElementById("wfu_download_frame");
|
1759 |
-
IF.src = url;
|
1760 |
-
}
|
1761 |
-
|
1762 |
-
function wfu_filedetails_userdata_changed(e) {
|
1763 |
-
var userdata_elements = document.getElementsByName("wfu_filedetails_userdata");
|
1764 |
-
var def, subm;
|
1765 |
-
var changed = false;
|
1766 |
-
for (var i = 0; i < userdata_elements.length; i++) {
|
1767 |
-
def = document.getElementById(userdata_elements[i].id.replace("wfu_filedetails_userdata_value_", "wfu_filedetails_userdata_default_"));
|
1768 |
-
subm = document.getElementById(userdata_elements[i].id.replace("wfu_filedetails_userdata_value_", "wfu_filedetails_userdata_"));
|
1769 |
-
subm.value = userdata_elements[i].value;
|
1770 |
-
if (userdata_elements[i].value != def.value) {
|
1771 |
-
changed = true;
|
1772 |
-
break;
|
1773 |
-
}
|
1774 |
-
}
|
1775 |
-
document.getElementById("dp_filedetails_submit_fields").disabled = !changed;
|
1776 |
-
}
|
1777 |
-
|
1778 |
-
function wfu_Attach_FileDetails_Admin_Events() {
|
1779 |
-
var userdata_elements = document.getElementsByName("wfu_filedetails_userdata");
|
1780 |
-
for (var i = 0; i < userdata_elements.length; i++) wfu_attach_element_handlers(userdata_elements[i], wfu_filedetails_userdata_changed);
|
1781 |
-
}
|
1 |
+
function wfu_admin_activate_tab(e){for(var t,a,l=document.getElementById("wfu_tab_container"),n=0;n<l.childNodes.length;n++)t=l.childNodes[n],1===t.nodeType&&(a=t.id.substr(8),t.className.indexOf("nav-tab-active")>-1&&(t.className="nav-tab",document.getElementById("wfu_container_"+a).style.display="none"));document.getElementById("wfu_tab_"+e).className="nav-tab nav-tab-active",document.getElementById("wfu_container_"+e).style.display="block"}function wfu_admin_onoff_clicked(e){var t=document.getElementById("wfu_attribute_"+e),a=document.getElementById("wfu_wrapper"),l=document.getElementsByClassName("wfu_shadow_"+e,"div",a),n=document.getElementsByClassName("wfu_shadow_"+e+"_inv","div",a),d="on"==t.className.substr(t.className.length-2);if(d=!d){document.getElementById("wfu_attribute_value_"+e).value="true",t.className="wfu_onoff_container_on";for(var r=0;r<l.length;r++)l[r].style.display="none";for(var r=0;r<n.length;r++)n[r].style.display="block"}else{document.getElementById("wfu_attribute_value_"+e).value="false",t.className="wfu_onoff_container_off";for(var r=0;r<l.length;r++)l[r].style.display="block";for(var r=0;r<n.length;r++)n[r].style.display="none"}wfu_generate_shortcode(),"userdata"==e&&wfu_update_userfield_variables()}function wfu_admin_radio_clicked(e){var t=document.getElementsByName("wfu_radioattribute_"+e),a=document.getElementById("wfu_wrapper"),l=document.getElementsByClassName("wfu_shadow_"+e,"div",a),n=document.getElementsByClassName("wfu_shadow_"+e+"_inv","div",a),d="";for(o=0;o<t.length;o++)t[o].checked&&(d=t[o].value);var r="*"==d.substr(0,1);if(r){d=d.substr(1);for(var o=0;o<l.length;o++)l[o].style.display="none";for(var o=0;o<n.length;o++)n[o].style.display="block"}else{for(var o=0;o<l.length;o++)l[o].style.display="block";for(var o=0;o<n.length;o++)n[o].style.display="none"}document.getElementById("wfu_attribute_value_"+e).value=d,wfu_generate_shortcode()}function wfu_addEventHandler(e,t,a){e.addEventListener?e.addEventListener(t,a,!1):e.attachEvent?e.attachEvent("on"+t,a):e["on"+t]=a}function wfu_attach_separator_dragdrop_events(){for(var e,t=document.getElementById("wfu_placements_container"),a=0;a<t.childNodes.length;a++)e=t.childNodes[a],("wfu_component_separator_hor"==e.className||"wfu_component_separator_ver"==e.className)&&(wfu_addEventHandler(e,"dragenter",wfu_separator_dragenter),wfu_addEventHandler(e,"dragover",wfu_default_dragover),wfu_addEventHandler(e,"dragleave",wfu_separator_dragleave),wfu_addEventHandler(e,"drop",wfu_separator_drop))}function wfu_Attach_Admin_DragDrop_Events(){if(window.FileReader){for(var e,t=document.getElementById("wfu_placements_container"),a=document.getElementById("wfu_componentlist_container"),l=0;l<t.childNodes.length;l++)e=t.childNodes[l],"wfu_component_box"==e.className&&(wfu_addEventHandler(e,"dragstart",wfu_component_dragstart),wfu_addEventHandler(e,"dragend",wfu_component_dragend));for(var l=0;l<a.childNodes.length;l++)if(e=a.childNodes[l],"wfu_component_box_container"==e.className)for(var n=0;n<e.childNodes.length;n++)"wfu_component_box wfu_inbase"==e.childNodes[n].className&&(wfu_addEventHandler(e.childNodes[n],"dragstart",wfu_component_dragstart),wfu_addEventHandler(e.childNodes[n],"dragend",wfu_component_dragend));e=document.getElementById("wfu_componentlist_dragdrop"),wfu_addEventHandler(e,"dragenter",wfu_componentlist_dragenter),wfu_addEventHandler(e,"dragover",wfu_default_dragover),wfu_addEventHandler(e,"dragleave",wfu_componentlist_dragleave),wfu_addEventHandler(e,"drop",wfu_componentlist_drop),wfu_attach_separator_dragdrop_events()}}function wfu_componentlist_dragenter(e){if(e=e||window.event,e.preventDefault&&e.preventDefault(),!DraggedItem)return!1;var t=document.getElementById("wfu_componentlist_dragdrop");return-1==t.className.indexOf("wfu_componentlist_dragdrop_dragover")&&(t.className+=" wfu_componentlist_dragdrop_dragover"),!1}function wfu_componentlist_dragleave(e){if(e=e||window.event,e.preventDefault&&e.preventDefault(),!DraggedItem)return!1;var t=document.getElementById("wfu_componentlist_dragdrop");return t.className=t.className.replace(" wfu_componentlist_dragdrop_dragover",""),!1}function wfu_componentlist_drop(e){e=e||window.event,e.preventDefault&&e.preventDefault();var t=e.dataTransfer.getData("Component");if(!t)return!1;var a=document.getElementById("wfu_component_box_"+t);a.className="wfu_component_box wfu_inbase",a.style.display="block",document.getElementById("wfu_component_box_container_"+t).appendChild(a);var l=wfu_admin_recreate_placements_text(null,"");return wfu_admin_recreate_placements_panel(l),document.getElementById("wfu_attribute_value_placements").value=l,wfu_generate_shortcode(),!1}function wfu_separator_dragenter(e){if(e=e||window.event,e.preventDefault&&e.preventDefault(),!DraggedItem)return!1;if("wfu_component_separator_hor"==e.target.className){var t=document.getElementById("wfu_component_bar_hor");t.style.top=e.target.offsetTop+"px",t.style.display="block"}else if("wfu_component_separator_ver"==e.target.className){var t=document.getElementById("wfu_component_bar_ver");t.style.top=e.target.offsetTop+"px",t.style.left=e.target.offsetLeft+"px",t.style.display="block"}return!1}function wfu_default_dragover(e){return e=e||window.event,e.preventDefault&&e.preventDefault(),!1}function wfu_separator_dragleave(e){if(e=e||window.event,e.preventDefault&&e.preventDefault(),!DraggedItem)return!1;if("wfu_component_separator_hor"==e.target.className){var t=document.getElementById("wfu_component_bar_hor");t.style.display="none"}else if("wfu_component_separator_ver"==e.target.className){var t=document.getElementById("wfu_component_bar_ver");t.style.display="none"}return!1}function wfu_separator_drop(e){e=e||window.event,e.preventDefault&&e.preventDefault();var t=e.dataTransfer.getData("Component");if(!t)return!1;var a=document.getElementById("wfu_component_box_"+t);a.style.display="none",a.className="wfu_component_box wfu_inbase",document.getElementById("wfu_component_box_container_"+t).appendChild(a);var l=wfu_admin_recreate_placements_text(e.target,t);return wfu_admin_recreate_placements_panel(l),document.getElementById("wfu_attribute_value_placements").value=l,wfu_generate_shortcode(),!1}function wfu_component_dragstart(e){e=e||window.event,e.dataTransfer.setData("Component",e.target.id.replace("wfu_component_box_","")),-1==e.target.className.indexOf("wfu_component_box_dragged")&&(e.target.className+=" wfu_component_box_dragged",DraggedItem=e.target),e.target.style.zIndex=3;var t=document.getElementById("wfu_componentlist_dragdrop");return t.className="wfu_componentlist_dragdrop wfu_componentlist_dragdrop_dragover",t.style.display="block",!1}function wfu_component_dragend(e){e=e||window.event,DraggedItem=null,e.target.style.zIndex=1;var t=document.getElementById("wfu_componentlist_dragdrop");return t.style.display="none",t.className="wfu_componentlist_dragdrop",e.target.className=e.target.className.replace(" wfu_component_box_dragged",""),document.getElementById("wfu_component_bar_ver").style.display="none",document.getElementById("wfu_component_bar_hor").style.display="none",!1}function wfu_admin_recreate_placements_text(e,t){function a(e){""!=d&&(d+=n),d+=e,n=""}for(var l=document.getElementById("wfu_placements_container"),n="",d="",r=0;r<l.childNodes.length;r++)item=l.childNodes[r],"wfu_component_separator_ver"==item.className?(""==n&&(n="+"),item==e&&(a(t),n="+")):"wfu_component_separator_hor"==item.className?(n="/",item==e&&(a(t),n="/")):"wfu_component_box"==item.className&&a(item.id.replace("wfu_component_box_",""));return d}function wfu_admin_recreate_placements_panel(e){for(var t,a,l,n=document.getElementById("wfu_placements_container"),d="",r=0;r<n.childNodes.length;r++)t=n.childNodes[r],"wfu_component_box"==t.className&&(d=t.id.replace("wfu_component_box_",""),t.style.display="inline-block",t.className="wfu_component_box wfu_inbase",document.getElementById("wfu_component_box_container_"+d).appendChild(t));n.innerHTML="",a=e.split("/");for(var r=0;r<a.length;r++){t=document.createElement("DIV"),t.className="wfu_component_separator_hor",t.setAttribute("draggable",!0),n.appendChild(t),t=document.createElement("DIV"),t.className="wfu_component_separator_ver",t.setAttribute("draggable",!0),n.appendChild(t),l=a[r].split("+");for(var o=0;o<l.length;o++)t=document.getElementById("wfu_component_box_"+l[o]),t&&(n.appendChild(t),t.className="wfu_component_box",t.style.display="inline-block",t=document.createElement("DIV"),t.className="wfu_component_separator_ver",t.setAttribute("draggable",!0),n.appendChild(t))}t=document.createElement("DIV"),t.className="wfu_component_separator_hor",t.setAttribute("draggable",!0),n.appendChild(t),t=document.createElement("DIV"),t.id="wfu_component_bar_hor",t.className="wfu_component_bar_hor",n.appendChild(t),t=document.createElement("DIV"),t.id="wfu_component_bar_ver",t.className="wfu_component_bar_ver",n.appendChild(t),wfu_attach_separator_dragdrop_events()}function wfu_subfolders_input_changed(e){e=e||window.event;var t=e.target,a=t.id.replace("wfu_subfolders_path_","");a=a.replace("wfu_subfolders_label_","");var l=document.getElementById("wfu_attribute_"+a);if(!(l.selectedIndex<0)){var n,d,r=document.getElementById("wfu_subfolders_path_"+a),o=document.getElementById("wfu_subfolders_label_"+a),u=document.getElementById("wfu_subfolders_ok_"+a),_="1"==document.getElementById("wfu_subfolders_isnewitem_"+a).value;if(_)n="",d="";else{var s=l.data;t=s[l.selectedIndex],n=t.path,d=t.label}if(r.value==n&&o.value==d)u.disabled=!0,_||wfu_subfolders_update_nav(a);else{u.disabled=!1;for(var f=document.getElementsByName("wfu_subfolder_nav_"+a),i=0;i<f.length;i++)f[i].disabled=!0}}}function wfu_subfolders_up_clicked(e){var t=document.getElementById("wfu_attribute_"+e);if(!(t.selectedIndex<0)){var a=t.data;item=a[t.selectedIndex];var l=item.index-1;if(!(0>l)){for(var n=-1,d=t.selectedIndex-1;d>=0;){if(a[d].level==item.level&&a[d].index==l){n=d;break}d--}if(-1!=n){var r=0;for(d=t.selectedIndex+1;d<a.length&&a[d].level>item.level;)r++,d++;a[n].index=item.index,item.index=l,t.data=a.slice(0,n).concat(a.slice(t.selectedIndex,t.selectedIndex+1+r)).concat(a.slice(n,t.selectedIndex)).concat(a.slice(t.selectedIndex+1+r));var o=wfu_update_subfolder_list(e);t.selectedIndex=n,wfu_subfolders_update_toolnav(e),item=t,o!==item.oldVal&&(item.oldVal=o,document.getElementById("wfu_attribute_value_"+e).value=o,wfu_generate_shortcode())}}}}function wfu_subfolders_down_clicked(e){var t=document.getElementById("wfu_attribute_"+e);if(!(t.selectedIndex<0)){var a=t.data;item=a[t.selectedIndex];var l=item.index+1,n=-1;for(curind=t.selectedIndex+1;curind<a.length;){if(a[curind].level==item.level){n=curind;break}if(a[curind].level<item.level)break;curind++}if(-1!=n){var d=0;for(curind=n+1;curind<a.length&&a[curind].level>item.level;)d++,curind++;a[n].index=item.index,item.index=l,t.data=a.slice(0,t.selectedIndex).concat(a.slice(n,n+1+d)).concat(a.slice(t.selectedIndex,n)).concat(a.slice(n+1+d));var r=wfu_update_subfolder_list(e);t.selectedIndex=t.selectedIndex+d+1,wfu_subfolders_update_toolnav(e),item=t,r!==item.oldVal&&(item.oldVal=r,document.getElementById("wfu_attribute_value_"+e).value=r,wfu_generate_shortcode())}}}function wfu_subfolders_left_clicked(e){var t=document.getElementById("wfu_attribute_"+e);if(!(t.selectedIndex<0)){var a=t.data;for(item=a[t.selectedIndex],curind=t.selectedIndex+1;curind<a.length&&a[curind].level>item.level;)a[curind].level--,curind++;item.level--;var l=wfu_update_subfolder_list(e);t.data=wfu_decode_subfolder_list(e),wfu_subfolders_update_toolnav(e),item=t,l!==item.oldVal&&(item.oldVal=l,document.getElementById("wfu_attribute_value_"+e).value=l,wfu_generate_shortcode())}}function wfu_subfolders_right_clicked(e){var t=document.getElementById("wfu_attribute_"+e);if(!(t.selectedIndex<0)){var a=t.data;for(item=a[t.selectedIndex],curind=t.selectedIndex+1;curind<a.length&&a[curind].level>item.level;)a[curind].level++,curind++;item.level++;var l=wfu_update_subfolder_list(e);t.data=wfu_decode_subfolder_list(e),wfu_subfolders_update_toolnav(e),item=t,l!==item.oldVal&&(item.oldVal=l,document.getElementById("wfu_attribute_value_"+e).value=l,wfu_generate_shortcode())}}function wfu_subfolders_def_clicked(e){var t=document.getElementById("wfu_attribute_"+e);if(!(t.selectedIndex<0)){var a=t.data;if(item=a[t.selectedIndex],item.default)item.default=!1;else{for(var l=0;l<a.length;l++)a[l].default=!1;item.default=!0}var n=wfu_update_subfolder_list(e);wfu_subfolders_update_toolnav(e),item=t,n!==item.oldVal&&(item.oldVal=n,document.getElementById("wfu_attribute_value_"+e).value=n,wfu_generate_shortcode())}}function wfu_subfolders_ok_clicked(e){var t=document.getElementById("wfu_attribute_"+e);if(!(t.selectedIndex<0)){var a=document.getElementById("wfu_subfolders_path_"+e),l=document.getElementById("wfu_subfolders_label_"+e);if(""==a.value||""==l.value)return void alert("Path or label cannot be empty!");var n=t.data,d="1"==document.getElementById("wfu_subfolders_isnewitem_"+e).value;if(d){var r=parseInt(document.getElementById("wfu_subfolders_newitemlevel_"+e).value),o={label:l.value,path:a.value,level:r,"default":!1},u=parseInt(document.getElementById("wfu_subfolders_newitemindex_"+e).value);u>=n.length?n.push(o):n.splice(u,0,o)}else item=n[t.selectedIndex],item.path=a.value,item.label=l.value;var _=wfu_update_subfolder_list(e);t.data=wfu_decode_subfolder_list(e),wfu_subfolders_update_toolnav(e),item=t,_!==item.oldVal&&(item.oldVal=_,document.getElementById("wfu_attribute_value_"+e).value=_,wfu_generate_shortcode())}}function wfu_subfolders_del_clicked(e){var t=document.getElementById("wfu_attribute_"+e);if(!(t.selectedIndex<0)){var a=t.data;item=a[t.selectedIndex];var l=0;for(curind=t.selectedIndex+1;curind<a.length&&a[curind].level>item.level;)l++,curind++;if(!(l>0)||confirm("Children items will be deleted as well. Proceed?")){a.splice(t.selectedIndex,1+l);var n=wfu_update_subfolder_list(e);t.data=wfu_decode_subfolder_list(e),wfu_subfolders_update_toolnav(e),item=t,n!==item.oldVal&&(item.oldVal=n,document.getElementById("wfu_attribute_value_"+e).value=n,wfu_generate_shortcode())}}}function wfu_subfolders_add_clicked(e){var t=document.getElementById("wfu_attribute_"+e);if(!(t.selectedIndex<0)){var a=t.data,l=t.selectedIndex;item=a[l];var n=t.options,d=document.createElement("option");d.value="",d.innerHTML="",n.add(d,l),t.selectedIndex=l;var r=document.getElementById("wfu_subfolder_tools_"+e),o=document.getElementById("wfu_subfolders_path_"+e),u=document.getElementById("wfu_subfolders_label_"+e),_=document.getElementById("wfu_subfolders_ok_"+e),s=document.getElementById("wfu_subfolders_browse_"+e);r.className="wfu_subfolder_tools_container",u.disabled=!1,_.disabled=!0,document.getElementById("wfu_subfolders_isnewitem_"+e).value="1",document.getElementById("wfu_subfolders_newitemindex_"+e).value=l,document.getElementById("wfu_subfolders_newitemlevel_"+e).value=item.level,document.getElementById("wfu_subfolders_newitemlevel2_"+e).value="",o.disabled=0==item.level,s.disabled=0==item.level,0==item.level?(o.value="{root}",u.value="{upload folder}"):(o.value="",u.value="");for(var f=document.getElementsByName("wfu_subfolder_nav_"+e),i=0;i<f.length;i++)f[i].disabled=!0}}function wfu_subfolders_browse_clicked(e){var t=wfu_GetHttpRequestObject();if(null!=t){var a=null;try{var a=new FormData}catch(l){}if(null!=a){for(var n=document.getElementById("wfu_global_dialog_container"),d=document.getElementById("wfu_subfolders_browser_"+e),r=document.getElementById("wfu_subfolders_browse_"+e),o=document.getElementById("wfu_subfolders_inner_shadow_"+e),u=document.getElementById("wfu_subfolders_browser_msgcont_"+e),_=document.getElementById("wfu_subfolders_browser_msg_"+e),s=document.getElementById("wfu_subfolders_browser_img_"+e),f=document.getElementById("wfu_subfolders_browser_ok_"+e),i=document.getElementById("wfu_subfolders_browser_list_"+e);i.options.length>0;)i.options.remove(0);f.disabled=!0,f.onclick=function(){wfu_folder_browser_cancel_clicked(e)},_.innerHTML="loading folder contents...",s.style.display="inline",u.style.display="block",n.style.display="block",d.style.display="block",d.style.left=r.offsetLeft+r.offsetWidth-d.offsetWidth+"px",d.style.top=r.offsetTop+r.offsetHeight-d.offsetHeight+"px",o.style.display="block",n.onclick=function(){wfu_folder_browser_cancel_clicked(e)};var c=document.getElementById("wfu_attribute_uploadpath").value;"/"==c.substr(c.length-1)&&(c=c.substr(0,c.length-1));var m=wfu_get_relative_path(e).split(","),w=c+m[0];"/"!=w.substr(0)&&(w="/"+w);var p="";2==m.length&&(p=m[1]),a.append("action","wfu_ajax_action_read_subfolders"),a.append("folder1",wfu_plugin_encode_string(w)),a.append("folder2",wfu_plugin_encode_string(p)),t.key=e,t.addEventListener("load",wfu_readfolderComplete,!1),t.addEventListener("error",wfu_readfolderFailed,!1),t.addEventListener("abort",wfu_readfolderCanceled,!1),t.open("POST",AdminParams.wfu_ajax_url),t.send(a)}}}function wfu_readfolderComplete(e){var t=e.target.key,a=document.getElementById("wfu_subfolders_browser_msgcont_"+t),l=document.getElementById("wfu_subfolders_browser_msg_"+t),n=document.getElementById("wfu_subfolders_browser_img_"+t),d=document.getElementById("wfu_subfolders_browser_list_"+t),r=document.getElementById("wfu_subfolders_browser_ok_"+t),o=document.getElementById("wfu_subfolders_path_"+t),u=document.getElementById("wfu_subfolders_label_"+t),_=e.target.responseText;if(-1!=_){var s="wfu_read_subfolders:",f=e.target.responseText.indexOf(s);-1==f&&(f=e.target.responseText.length);var i=(e.target.responseText.substr(0,f),e.target.responseText.substr(f+s.length,e.target.responseText.length-f-s.length));f=i.indexOf(":");var c=i.substr(0,f);if(txt_value=i.substr(f+1,i.length-f-1),"success"==c){for(var m,w=wfu_plugin_decode_string(txt_value),p=w.split(","),g=0,v=0;v<p.length;v++)""!=p[v]&&(m=document.createElement("option"),m.value=p[v],m.innerHTML=p[v].replace("*"," "),d.add(m),g++);0==g&&(m=document.createElement("option"),m.value="",m.innerHTML="{empty}",m.disabled=!0,d.add(m)),d.selectedIndex=-1,r.onclick=function(){var e=d.options[d.selectedIndex].value,a=parseInt(document.getElementById("wfu_subfolders_newitemlevel_"+t).value);("*"==e.substr(0,1)||0==a)&&(document.getElementById("wfu_subfolders_newitemlevel_"+t).value=a+1,a>0&&(e=e.substr(1))),o.value=e,u.value=e,wfu_folder_browser_cancel_clicked(t),wfu_subfolders_ok_clicked(t)},a.style.display="none"}else"error"==c?(l.innerHTML=txt_value,n.style.display="none",r.disabled=!1):(l.innerHTML="Unknown error",n.style.display="none",r.disabled=!1)}}function wfu_readfolderFailed(e){var t=e.target.key,a=document.getElementById("wfu_subfolders_browser_msg_"+t),l=document.getElementById("wfu_subfolders_browser_img_"+t),n=document.getElementById("wfu_subfolders_browser_ok_"+t);a.innerHTML="Unknown error",l.style.display="none",n.disabled=!1}function wfu_readfolderCanceled(e){var t=e.target.key,a=document.getElementById("wfu_subfolders_browser_msg_"+t),l=document.getElementById("wfu_subfolders_browser_img_"+t),n=document.getElementById("wfu_subfolders_browser_ok_"+t);a.innerHTML="Unknown error",l.style.display="none",n.disabled=!1}function wfu_subfolders_browser_list_changed(e){var t=document.getElementById("wfu_subfolders_browser_list_"+e),a=document.getElementById("wfu_subfolders_browser_ok_"+e);a.disabled=t.selectedIndex<0}function wfu_folder_browser_cancel_clicked(e){var t=document.getElementById("wfu_global_dialog_container"),a=document.getElementById("wfu_subfolders_browser_"+e),l=(document.getElementById("wfu_subfolders_browse_"+e),document.getElementById("wfu_subfolders_inner_shadow_"+e));t.onclick=null,l.style.display="none",a.style.display="none",t.style.display="none"}function wfu_get_relative_path(e){var t=document.getElementById("wfu_attribute_"+e);if(!(t.selectedIndex<0)){var a,l=t.data,n="1"==document.getElementById("wfu_subfolders_isnewitem_"+e).value;a=n?parseInt(document.getElementById("wfu_subfolders_newitemlevel_"+e).value):l[t.selectedIndex].level;for(var d="/",r=t.selectedIndex-1,o=a;r>=0&&o>1;)l[r].level<o&&(d="/"+l[r].path+d,o=l[r].level),r--;return n&&"1"==document.getElementById("wfu_subfolders_newitemlevel2_"+e).value&&a>0&&t.selectedIndex>0&&(d+=","+l[t.selectedIndex-1].path),d}}function wfu_subfolders_changed(e){wfu_update_subfolder_list(e),wfu_subfolders_update_toolnav(e)}function wfu_subfolders_update_toolnav(e){var t,a,l=document.getElementById("wfu_attribute_"+e),n=document.getElementById("wfu_subfolder_tools_"+e),d=document.getElementById("wfu_subfolders_path_"+e),r=document.getElementById("wfu_subfolders_label_"+e),o=document.getElementById("wfu_subfolders_ok_"+e),u=document.getElementById("wfu_subfolders_browse_"+e);if(document.getElementById("wfu_subfolders_isnewitem_"+e).value="",document.getElementById("wfu_subfolders_newitemindex_"+e).value="",document.getElementById("wfu_subfolders_newitemlevel_"+e).value="",document.getElementById("wfu_subfolders_newitemlevel2_"+e).value="",null==l.data?(t=wfu_decode_subfolder_list(e),l.data=t):t=l.data,0===l.data.length?(l.className="wfu_select_folders wfu_select_folders_empty",l.options[0].innerHTML="press here"):l.className="wfu_select_folders",l.selectedIndex<0)n.className="wfu_subfolder_tools_container wfu_subfolder_tools_disabled",d.disabled=!0,r.disabled=!0,o.disabled=!0,u.disabled=!0,r.value="",d.value="";else if(l.selectedIndex>=l.options.length-1){n.className="wfu_subfolder_tools_container",r.disabled=!1,o.disabled=!0,document.getElementById("wfu_subfolders_isnewitem_"+e).value="1",document.getElementById("wfu_subfolders_newitemindex_"+e).value=t.length;var _;_=0==t.length?0:0==t[t.length-1].level?1:t[t.length-1].level,document.getElementById("wfu_subfolders_newitemlevel_"+e).value=_,document.getElementById("wfu_subfolders_newitemlevel2_"+e).value="1",d.disabled=0==_,u.disabled=!1,0==_?(d.value="{root}",r.value="{upload folder}"):(d.value="",r.value="")}else n.className="wfu_subfolder_tools_container",r.disabled=!1,o.disabled=!0,a=t[l.selectedIndex],d.disabled=0==a.level,u.disabled=0==a.level,r.value=a.label,d.value=a.path;var s=document.getElementsByName("wfu_subfolder_nav_"+e);if(l.selectedIndex<0||l.selectedIndex>=l.options.length-1)for(var f=0;f<s.length;f++)s[f].disabled=!0;else wfu_subfolders_update_nav(e)}function wfu_subfolders_update_nav(e){var t=document.getElementById("wfu_attribute_"+e),a=document.getElementById("wfu_subfolders_up_"+e),l=document.getElementById("wfu_subfolders_down_"+e),n=document.getElementById("wfu_subfolders_left_"+e),d=document.getElementById("wfu_subfolders_right_"+e),r=document.getElementById("wfu_subfolders_add_"+e),o=document.getElementById("wfu_subfolders_def_"+e),u=document.getElementById("wfu_subfolders_del_"+e),_=t.data,s=_[t.selectedIndex];for(a.disabled=s.index<=0,ind=t.selectedIndex+1,nextind=0;ind<_.length;){if(_[ind].level==s.level){nextind=_[ind].index;break}if(_[ind].level<s.level)break;ind++}l.disabled=0==s.level||0==nextind,n.disabled=0==t.selectedIndex&&s.level<1||t.selectedIndex>0&&s.level<=1,prevlevel=t.selectedIndex>=1?_[t.selectedIndex-1].level:0,d.disabled=s.level-prevlevel>0,r.disabled=0==s.level,o.disabled=!1,o.className="button"+(s.default?" wfu_subfolder_nav_pressed":""),u.disabled=!1}function wfu_decode_subfolder(e){var t={label:"",path:"",level:0,"default":!1};e=e.trim();for(var a=0,l=!1;a<e.length&&"*"==e.substr(a,1);)a++;e=e.substr(a,e.length-a),"&"==e.substr(0,1)&&(e=e.substr(1),l=!0),t.level=a,t.default=l;var n=e.split("/");return 1==n.length?(t.path=n[0],t.label=n[0]):n.length>1&&(t.path=n[0],t.label=n[1]),0==a&&(t.path="{root}",""==t.label&&(t.label="{upload folder}")),t}function wfu_decode_subfolder_list(e){for(var t,a=document.getElementById("wfu_attribute_"+e).options,l=Array(),n=["root"],d=[0],r=-1,o=0;o<a.length-1;o++){for(l.push(wfu_decode_subfolder(wfu_plugin_decode_string(a[o].value))),n.length>l[o].level?n[l[o].level]=l[o].path:n.push(l[o].path),t="",j=1;j<=l[o].level;j++)t+=n[j]+"/";l[o].fullpath=t,d.length<=l[o].level&&d.push(0),l[o].index=l[o].level>r?0:d[l[o].level]+1,d[l[o].level]=l[o].index,r=l[o].level}return l}function wfu_update_subfolder_list(e){var t=document.getElementById("wfu_attribute_"+e).options,a=document.getElementById("wfu_attribute_"+e),l=a.data;if(null!=l){var n,d,r="";t.length=l.length+1;for(var o=0;o<l.length;o++){for(n="",d="",j=0;j<l[o].level;j++)n+="*",d+=" ";l[o].default?(n+="&",t[o].className="wfu_select_folders_option_default"):t[o].className="",n+=l[o].path+"/"+l[o].label,d+=l[o].label,t[o].value=wfu_plugin_encode_string(n),t[o].innerHTML=d,""!=r&&(r+=","),r+=n}return t[l.length].value="",t[l.length].innerHTML="",r}}function wfu_userdata_edit_field(e,t,a){for(var l,n=0;n<e.childNodes.length;n++)l=e.childNodes[n],"INPUT"==l.tagName?"text"==l.type?(l.value=t,wfu_attach_element_handlers(l,wfu_update_userfield_value)):"checkbox"==l.type&&(l.checked=a):"DIV"==l.tagName&&(l.className="wfu_userdata_action")}function wfu_userdata_add_field(e){var t=e.parentNode,a=t.cloneNode(!0);wfu_userdata_edit_field(a,"",!1),t.parentNode.insertBefore(a,t.nextSibling)}function wfu_userdata_remove_field(e){for(var t=e.parentNode,a=t.parentNode,l=null,n=0;n<a.childNodes.length;n++)if(1===a.childNodes[n].nodeType){l=a.childNodes[n];break}if(t!=l){t.parentNode.removeChild(t);for(var n=0;n<l.childNodes.length;n++)if(1===l.childNodes[n].nodeType){wfu_update_userfield_value({target:l.childNodes[n]});break}}}function wfu_generate_shortcode(){for(var e,t=document.getElementById("wfu_attribute_defaults"),a=(document.getElementById("wfu_attribute_values"),""),l="",n="[wordpress_file_upload",d="",r=0;r<t.childNodes.length;r++)e=t.childNodes[r],1===e.nodeType&&(a=e.id.replace("wfu_attribute_default_",""),l=document.getElementById("wfu_attribute_value_"+a).value,e.value!=l&&(d+=" "+a+'="'+l+'"'));n+=d+"]",document.getElementById("wfu_shortcode").value=n,ShortcodeString=d.substr(1),document.getElementById("wfu_update_shortcode")&&(document.getElementById("wfu_update_shortcode").disabled=wfu_plugin_encode_string(n)==document.getElementById("wfu_shortcode_original_enc").value),Autosave&&wfu_schedule_save_shortcode()}function wfu_update_text_value(e){e=e||window.event;var t=e.target,a=t.id.replace("wfu_attribute_",""),l=t.value;l=l.replace(/(\r\n|\n|\r)/gm,"%n%"),l=l.replace(/\"/gm,"%dq%"),l=l.replace(/\[/gm,"%brl%"),l=l.replace(/\]/gm,"%brr%"),l!==t.oldVal&&(t.oldVal=l,document.getElementById("wfu_attribute_value_"+a).value=l,wfu_generate_shortcode())}function wfu_update_triplecolor_value(e){e=e||window.event;var t=e.target,a=t.id.replace("wfu_attribute_","");a=a.replace("_color",""),a=a.replace("_bgcolor",""),a=a.replace("_borcolor",""),t=document.getElementById("wfu_attribute_"+a+"_color");var l=t.value+","+document.getElementById("wfu_attribute_"+a+"_bgcolor").value+","+document.getElementById("wfu_attribute_"+a+"_borcolor").value;l!==t.oldVal&&(t.oldVal=l,document.getElementById("wfu_attribute_value_"+a).value=l,wfu_generate_shortcode())}function wfu_update_dimension_value(e){e=e||window.event;var t=e.target,a=t.name.replace("wfu_dimension_elements_",""),l=document.getElementsByName(t.name);t=l[0];for(var n="",d="",r=0;r<l.length;r++)d=l[r].id.replace("wfu_attribute_"+a+"_",""),""!=n&&""!=l[r].value&&(n+=", "),""!=l[r].value&&(n+=d+":"+l[r].value);n!==t.oldVal&&(t.oldVal=n,document.getElementById("wfu_attribute_value_"+a).value=n,wfu_generate_shortcode())}function wfu_update_ptext_value(e){e=e||window.event;var t=e.target,a=t.id.replace("wfu_attribute_","");a=a.substr(2);var l=document.getElementById("wfu_attribute_s_"+a).value,n=document.getElementById("wfu_attribute_p_"+a).value,d=l+"/"+n;d!==t.oldVal&&(t.oldVal=d,document.getElementById("wfu_attribute_value_"+a).value=d),wfu_generate_shortcode()}function wfu_update_mchecklist_value(e){var t="",a=(document.getElementById("wfu_attribute_"+e),document.getElementById("wfu_attribute_"+e+"_all"));a.checked?(jQuery("#wfu_attribute_"+e+" input").prop("disabled",!0),jQuery("#wfu_attribute_"+e+" input").prop("checked",!0),t="all"):(jQuery("#wfu_attribute_"+e+" input").prop("disabled",!1),jQuery("#wfu_attribute_"+e+" input").each(function(){jQuery(this).prop("checked")&&(t+=","+jQuery(this).next().html())}),t=t.substr(1)),document.getElementById("wfu_attribute_value_"+e).value=t,wfu_generate_shortcode()}function wfu_update_rolelist_value(e){var t="",a=document.getElementById("wfu_attribute_"+e),l=document.getElementById("wfu_attribute_"+e+"_all");if(l.checked)a.disabled=!0,t="all";else{a.disabled=!1;for(var n=a.options,d=0;d<n.length;d++)n[d].selected&&(""!=t&&(t+=","),t+=n[d].value)}document.getElementById("wfu_attribute_value_"+e).value=t,wfu_generate_shortcode()}function wfu_update_userfield_value(e){e=e||window.event;for(var t=e.target,a=t.parentNode,l=a.parentNode,n="",d=!1,r="",o=0;o<l.childNodes.length;o++)if(a=l.childNodes[o],"DIV"===a.tagName){for(var u=0;u<a.childNodes.length;u++)"INPUT"==a.childNodes[u].tagName&&("text"==a.childNodes[u].type?(n=a.childNodes[u].value,0==o&&(t=a.childNodes[u])):"checkbox"==a.childNodes[u].type&&(d=a.childNodes[u].checked));""!=r&&""!=n&&(r+="/"),""!=n&&d&&(r+="*"),""!=n&&(r+=n)}r!==t.oldVal&&(t.oldVal=r,document.getElementById("wfu_attribute_value_userdatalabel").value=r,wfu_generate_shortcode(),wfu_update_userfield_variables())}function wfu_update_userfield_variables(){for(var e=document.getElementById("wfu_attribute_value_userdatalabel").value,t=document.getElementById("wfu_wrapper"),a=document.getElementsByClassName("wfu_shadow_userdata","div",t),l=document.getElementsByName("wfu_userfield_select"),n=0;n<l.length;n++)l[n].style.display="none";if(0!=a.length&&"block"!=a[0].style.display){for(var d='<option style="display:none;">%userdataXXX%</option>',r=e.split("/"),o="",n=1;n<=r.length;n++)o=r[n-1],"*"==o[0]&&(o=o.substr(1)),d+='<option value="%userdata'+n+'%">'+n+": "+o+"</option>";for(var n=0;n<l.length;n++)l[n].innerHTML=d,l[n].style.display="inline-block"}}function wfu_attach_element_handlers(e,t){for(var a=["DOMAttrModified","textInput","input","change","keypress","paste","focus","propertychange"],l=0;l<a.length;l++)wfu_addEventHandler(e,a[l],t)}function wfu_Attach_Admin_Events(e){Autosave=e,wfu_generate_shortcode(),wfu_update_userfield_variables(),wfu_Attach_Admin_DragDrop_Events();for(var t=document.getElementsByName("wfu_text_elements"),a=0;a<t.length;a++)wfu_attach_element_handlers(t[a],wfu_update_text_value);for(var l=document.getElementsByName("wfu_ptext_elements"),a=0;a<l.length;a++)wfu_attach_element_handlers(l[a],wfu_update_ptext_value);for(var n=document.getElementsByName("wfu_triplecolor_elements"),a=0;a<n.length;a++)wfu_attach_element_handlers(n[a],wfu_update_triplecolor_value);for(var d=document.getElementsByName("wfu_dimension_elements_widths"),a=0;a<d.length;a++)wfu_attach_element_handlers(d[a],wfu_update_dimension_value);d=document.getElementsByName("wfu_dimension_elements_heights");for(var a=0;a<d.length;a++)wfu_attach_element_handlers(d[a],wfu_update_dimension_value);for(var r=document.getElementsByName("wfu_userfield_elements"),a=0;a<r.length;a++)wfu_attach_element_handlers(r[a],wfu_update_userfield_value);for(var o=document.getElementsByName("wfu_subfolder_tools_input"),a=0;a<o.length;a++)wfu_attach_element_handlers(o[a],wfu_subfolders_input_changed);""!=document.getElementById("wfu_shortcode_postid").value&&setTimeout(function(){wfu_check_page_obsolescence()},CheckObsolescenceTimeOut)}function wfu_insert_variable(e){var t=e.className.replace("wfu_variable wfu_variable_",""),a=document.getElementById("wfu_attribute_"+t),l=a.selectionStart,n=a.value;a.value=n.substr(0,l)+e.innerHTML+n.substr(l),wfu_update_text_value({target:a})}function wfu_insert_userfield_variable(e){var t=e.className.replace("wfu_variable wfu_variable_",""),a=document.getElementById("wfu_attribute_"+t),l=a.selectionStart,n=a.value;a.value=n.substr(0,l)+e.value+n.substr(l),e.value="%userdataXXX%",wfu_update_text_value({target:a})
|
2 |
+
}function wfu_GetHttpRequestObject(){var e=null;try{e=new XMLHttpRequest}catch(t){try{e=new ActiveXObject("Msxml2.XMLHTTP")}catch(a){try{e=new ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}}if(null==e&&window.createRequest)try{xmlhttp=window.createRequest()}catch(t){}return e}function wfu_plugin_encode_string(e){var t,a=0,l="",n="";for(a=0;a<e.length;a++)t=e.charCodeAt(a),t>=2048?t=((16773120&t|917504)<<4)+((4032&t|8192)<<2)+(63&t|128):t>=128&&(t=((65472&t|12288)<<2)+(63&t|128)),n=t.toString(16),(1==n.length||3==n.length||5==n.length)&&(n="0"+n),l+=n;return l}function wfu_plugin_decode_string(e){for(var t,a,l=0,n="";l<e.length;)t=parseInt(e.substr(l,2),16),a=128>t?t:224>t?((31&t)<<6)+(63&parseInt(e.substr(l+=2,2),16)):((15&t)<<12)+((63&parseInt(e.substr(l+=2,2),16))<<6)+(63&parseInt(e.substr(l+=2,2),16)),n+=String.fromCharCode(a),l+=2;return n}function wfu_schedule_save_shortcode(){var e=new Date,t=ShortcodeNextSave-e.getTime();null!=ShortcodeTimeOut&&(clearTimeout(ShortcodeTimeOut),ShortcodeTimeOut=null),0>=t?wfu_save_shortcode():ShortcodeTimeOut=setTimeout(function(){wfu_save_shortcode()},t)}function wfu_check_page_obsolescence(){PageObsolete||PageUpdating||""==document.getElementById("wfu_shortcode_postid").value}function wfu_save_shortcode(){if(!PageObsolete){var e=wfu_GetHttpRequestObject();if(null!=e){PageUpdating=!0,document.getElementById("wfu_update_failed_message").style.display="none";var t=AdminParams.wfu_ajax_url;params=new Array(6),params[0]=new Array(2),params[0][0]="action",params[0][1]="wfu_ajax_action_save_shortcode",params[1]=new Array(2),params[1][0]="shortcode",params[1][1]=wfu_plugin_encode_string(ShortcodeString),params[2]=new Array(2),params[2][0]="shortcode_original",params[2][1]=document.getElementById("wfu_shortcode_original_enc").value,params[3]=new Array(2),params[3][0]="post_id",params[3][1]=document.getElementById("wfu_shortcode_postid").value,params[4]=new Array(2),params[4][0]="post_hash",params[4][1]=document.getElementById("wfu_shortcode_posthash").value,params[5]=new Array(2),params[5][0]="shortcode_position",params[5][1]=document.getElementById("wfu_shortcode_position").value;for(var a="",l=0;l<params.length;l++)a+=(l>0?"&":"")+params[l][0]+"="+encodeURI(params[l][1]);var n=new Date;Autosave?ShortcodeNextSave=n.getTime()+5e3:document.getElementById("wfu_update_shortcode")&&(document.getElementById("wfu_update_shortcode_wait").style.display="inline"),e.open("POST",t,!0),e.setRequestHeader("Content-type","application/x-www-form-urlencoded"),e.onreadystatechange=function(){if(4==e.readyState&&200==e.status){PageUpdating=!1;var t="wfu_save_shortcode:",a=e.responseText.indexOf(t);-1==a&&(a=e.responseText.length);var l=(e.responseText.substr(0,a),e.responseText.substr(a+t.length,e.responseText.length-a-t.length));a=l.indexOf(":");var d=l.substr(0,a);txt_value=l.substr(a+1,l.length-a-1),"success"==d?(Autosave?(document.getElementById("wfu_save_label").innerHTML="saved",document.getElementById("wfu_save_label").className="wfu_save_label",document.getElementById("wfu_save_label").style.opacity=1,wfu_fadeout_element(300),ShortcodeNextSave=n.getTime()+1e3,null!=ShortcodeTimeOut&&wfu_schedule_save_shortcode()):document.getElementById("wfu_update_shortcode")&&(document.getElementById("wfu_update_shortcode_wait").style.display="none",document.getElementById("wfu_update_shortcode").disabled=!0,window.plugin_window&&window.plugin_window.location.reload(!0)),""!=document.getElementById("wfu_shortcode_postid").value&&(document.getElementById("wfu_shortcode_original_enc").value=wfu_plugin_encode_string("[wordpress_file_upload "+ShortcodeString+"]"),document.getElementById("wfu_shortcode_posthash").value=txt_value,setTimeout(function(){wfu_check_page_obsolescence()},CheckObsolescenceTimeOut))):(Autosave&&(document.getElementById("wfu_save_label").innerHTML="not saved",document.getElementById("wfu_save_label").className="wfu_save_label_fail",document.getElementById("wfu_save_label").style.opacity=1,wfu_fadeout_element(300)),"fail"==d&&("post_modified"==txt_value?(PageObsolete=!0,document.getElementById("wfu_update_shortcode")&&(document.getElementById("wfu_update_shortcode").disabled=!0),document.getElementById("wfu_update_rejected_message").style.display="block"):document.getElementById("wfu_update_failed_message").style.display="block"))}},e.send(a)}}}function wfu_adjust_opacity(e){document.getElementById("wfu_save_label").style.opacity=e}function wfu_fadeout_element(e){for(var t=20,a=0,l=0;t>l;l++)a=1-l/t,setTimeout('wfu_adjust_opacity("'+a.toString()+'")',l*e/t);setTimeout('wfu_adjust_opacity("0.0")',l*e/t)}function wfu_apply_value(e,t,a){if("onoff"==t)document.getElementById("wfu_attribute_"+e).className="wfu_onoff_container_"+("true"!=a?"on":"off"),wfu_admin_onoff_clicked(e);else if("text"==t||"ltext"==t||"integer"==t||"float"==t||"mtext"==t||"color"==t){var l=document.getElementById("wfu_attribute_"+e);if(a=a.replace(/\%n\%/gm,"\n"),a=a.replace(/\%dq\%/gm,'"'),a=a.replace(/\%brl\%/gm,"["),a=a.replace(/\%brr\%/gm,"]"),"color"==t){var n=colourNameToHex(a);n||(n=a),jQuery("#wfu_attribute_"+e).wpColorPicker("color",n)}l.value=a,wfu_update_text_value({target:l})}else if("placements"==t)wfu_admin_recreate_placements_panel(a),document.getElementById("wfu_attribute_value_placements").value=a,wfu_generate_shortcode();else if("radio"==t){for(var d=document.getElementsByName("wfu_radioattribute_"+e),r=0;r<d.length;r++)d[r].checked=d[r].value==a||"*"+d[r].value==a;wfu_admin_radio_clicked(e)}else if("ptext"==t){a=a.replace(/\%n\%/gm,"\n"),a=a.replace(/\%dq\%/gm,'"'),a=a.replace(/\%brl\%/gm,"["),a=a.replace(/\%brr\%/gm,"]");var o=a.split("/"),u=o.length<1?"":o[0],_=o.length<2?u:o[1],s=document.getElementById("wfu_attribute_s_"+e);s.value=u;var f=document.getElementById("wfu_attribute_p_"+e);f.value=_,wfu_update_ptext_value({target:s}),wfu_update_ptext_value({target:f})}else if("mchecklist"==t){if(a=a.toLowerCase(),"all"==a)document.getElementById("wfu_attribute_"+e+"_all").checked=!0;else{document.getElementById("wfu_attribute_"+e+"_all").checked=!1;for(var i=a.split(","),r=0;r<i.length;r++)i[r]=i[r].trim();jQuery("#wfu_attribute_"+e+" input").each(function(){jQuery(this).prop("checked",i.indexOf(jQuery(this).next().html())>-1)})}wfu_update_mchecklist_value(e)}else if("rolelist"==t){if(a=a.toLowerCase(),"all"==a)document.getElementById("wfu_attribute_"+e+"_all").checked=!0;else{document.getElementById("wfu_attribute_"+e+"_all").checked=!1;for(var c=a.split(","),r=0;r<c.length;r++)c[r]=c[r].trim();for(var l=document.getElementById("wfu_attribute_"+e),r=0;r<l.options.length;r++)l.options[r].selected=c.indexOf(l.options[r].value)>-1}wfu_update_rolelist_value(e)}else if("dimensions"==t){for(var m,w,p,l,g=a.split(","),v=document.getElementsByName("wfu_dimension_elements_"+e),r=0;r<v.length;r++)v[r].value="";for(var r=0;r<g.length;r++)m=g[r].split(":",2),w=m.length<1?"":m[0],p=m.length<2?w:m[1],l=document.getElementById("wfu_attribute_"+e+"_"+w.trim()),l&&(l.value=p.trim());l=v[0],wfu_update_dimension_value({target:l})}else if("userfields"==t){for(var b,h=a.split("/"),y=Array(),r=0;r<h.length;r++)b="*"==h[r].substr(0,1),b&&(h[r]=h[r].substr(1)),""!=h[r]&&y.push({name:h[r],required:b});for(var I=document.getElementById("wfu_attribute_"+e),E=null,B=Array(),r=0;r<I.childNodes.length;r++)1===I.childNodes[r].nodeType&&(null==E?E=I.childNodes[r]:B.push(I.childNodes[r]));for(var r=0;r<B.length;r++)I.removeChild(B[r]);wfu_userdata_edit_field(E,"",!1);for(var x,N=E,r=0;r<y.length;r++)0==r?wfu_userdata_edit_field(E,y[r].name,y[r].required):(x=N.cloneNode(!0),wfu_userdata_edit_field(x,y[r].name,y[r].required),I.insertBefore(x,N.nextSibling),N=x);for(var l,r=0;r<E.childNodes.length&&(l=E.childNodes[r],"INPUT"!=l.tagName);r++);wfu_update_userfield_value({target:l})}else if("color-triplet"==t){for(var k=a.split(","),r=0;r<k.length;r++)k[r]=k[r].trim();2==k.length?k=[k[0],k[1],"#000000"]:1==k.length?k=[k[0],"#FFFFFF","#000000"]:k.length<3&&(k=["#000000","#FFFFFF","#000000"]);var n=colourNameToHex(k[0]);n||(n=k[0]),jQuery("#wfu_attribute_"+e+"_color").wpColorPicker("color",n);var l=document.getElementById("wfu_attribute_"+e+"_color");l.value=k[0],n=colourNameToHex(k[1]),n||(n=k[1]),jQuery("#wfu_attribute_"+e+"_bgcolor").wpColorPicker("color",n),document.getElementById("wfu_attribute_"+e+"_bgcolor").value=k[1],n=colourNameToHex(k[2]),n||(n=k[2]),jQuery("#wfu_attribute_"+e+"_borcolor").wpColorPicker("color",n),document.getElementById("wfu_attribute_"+e+"_borcolor").value=k[2],wfu_update_triplecolor_value({target:l})}else if("folderlist"==t){for(var i=wfu_parse_folderlist_js(a),T=document.getElementById("wfu_attribute_"+e).options;T.length>0;)T.remove(0);for(var H,A,j,O,C,D,r=0;r<i.path.length;r++){A=i.path[r],"/"==A.substr(A.length,1)&&(A=A.substr(0,A.length-1)),j=A.split("/"),A=j[j.length-1],C=parseInt(i.level[r]),O="",D="";for(var S=0;C>S;S++)O+=" ",D+="*";O+=i.label[r],i.default[r]&&(D+="&"),D+=""==A?"{root}/"+i.label[r]:A+i.label[r],H=document.createElement("option"),H.className=i.default[r]?"wfu_select_folders_option_default":"",H.value=wfu_plugin_encode_string(D),H.innerHTML=O,T.add(H)}H=document.createElement("option"),H.value="",H.innerHTML="",T.add(H);var L=document.getElementById("wfu_attribute_"+e);L.data=wfu_decode_subfolder_list(e),wfu_subfolders_update_toolnav(e),l=L,a!==l.oldVal&&(l.oldVal=a,document.getElementById("wfu_attribute_value_"+e).value=a,wfu_generate_shortcode())}}function wfu_parse_folderlist_js(e){var t=Object();t.path=Array(),t.label=Array(),t.level=Array(),t.default=Array();var a=e.split(",");if(0==a.length)return t;if(1==a.length&&""==a[0].trim())return t;for(var l,n,d,r,o,u,_,s=["root"],f=0,i=0,c=-1,m=0;m<a.length;m++){for(l=a[m].trim(),n=0,d="",r=!1;n<l.length&&"*"==l.substr(n,1);)n++,d+=" ";if(1>=n-f&&(n>0||0==i)&&(l=l.substr(n,l.length-n),"&"==l.substr(0,1)&&(l=l.substr(1),r=!0),subfolder_items=l.split("/"),subfolder_items.length<2&&subfolder_items.push(""),""!=subfolder_items[1]?(o=subfolder_items[0],u=subfolder_items[1]):(o=l,u=l),""!=o)){r&&-1==c?c=t.path.length:r=!1,0==n&&(i=1),s.length>n?s[n]=o:s.push(o),_="";for(var w=1;n>=w;w++)_+=s[w]+"/";t.path.push(_),t.label.push(u),t.level.push(n),t.default.push(r),f=n}}return t}function colourNameToHex(e){var t={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c","indigo ":"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};return"undefined"!=typeof t[e.toLowerCase()]?t[e.toLowerCase()]:!1}function wfu_download_file(e,t,a){var l=wfu_GetHttpRequestObject();if(null!=l){var n=AdminParams.wfu_ajax_url;params=new Array(3),params[0]=new Array(2),params[0][0]="action",params[0][1]="wfu_ajax_action_download_file_invoker",params[1]=new Array(2),params[1][0]="file",params[1][1]=e,params[2]=new Array(2),params[2][0]="nonce",params[2][1]=a;for(var d="",r=0;r<params.length;r++)d+=(r>0?"&":"")+params[r][0]+"="+encodeURI(params[r][1]);l.open("POST",n,!0),l.setRequestHeader("Content-type","application/x-www-form-urlencoded"),l.onreadystatechange=function(){if(4==l.readyState&&200==l.status){var a="wfu_ajax_action_download_file_invoker:",n=l.responseText.indexOf(a);-1==n&&(n=l.responseText.length);var d=(l.responseText.substr(0,n),l.responseText.substr(n+a.length,l.responseText.length-n-a.length));n=d.indexOf(":");var r=d.substr(0,n);if(txt_value=d.substr(n+1,d.length-n-1),"wfu_download_id;"==r.substr(0,16)){var o=r.substr(16),u=document.getElementById("wfu_file_download_container_"+t);u.innerHTML=txt_value,setTimeout("wfu_download_file_monitor('"+e+"', "+t+", '"+o+"')",100)}}},l.send(d)}}function wfu_download_file_monitor(e,t,a){var l=wfu_GetHttpRequestObject();if(null!=l){var n=AdminParams.wfu_ajax_url;params=new Array(3),params[0]=new Array(2),params[0][0]="action",params[0][1]="wfu_ajax_action_download_file_monitor",params[1]=new Array(2),params[1][0]="file",params[1][1]=e,params[2]=new Array(2),params[2][0]="id",params[2][1]=a;for(var d="",r=0;r<params.length;r++)d+=(r>0?"&":"")+params[r][0]+"="+encodeURI(params[r][1]);l.open("POST",n,!0),l.setRequestHeader("Content-type","application/x-www-form-urlencoded"),l.onreadystatechange=function(){if(4==l.readyState&&200==l.status){var a="wfu_ajax_action_download_file_monitor:",n=l.responseText.indexOf(a);-1==n&&(n=l.responseText.length);var d=(l.responseText.substr(0,n),l.responseText.substr(n+a.length,l.responseText.length-n-a.length));n=d.indexOf(":");var r=d.substr(0,n);if(txt_value=d.substr(n+1,d.length-n-1),"repeat"!=r){var o=document.getElementById("wfu_file_download_container_"+t);o.innerHTML=""}else"repeat"==r&&setTimeout("wfu_download_file_monitor('"+e+"', "+t+", '"+txt_value+"')",100)}},l.send(d)}}function wfu_file_downloaded_monitor(e,t,a,l){var n=wfu_GetHttpRequestObject();if(null!=n){var d=AdminParams.wfu_ajax_url;params=new Array(4),params[0]=new Array(2),params[0][0]="action",params[0][1]="wfu_ajax_action_download_file_invoker",params[1]=new Array(2),params[1][0]="file",params[1][1]=e,params[2]=new Array(2),params[2][0]="dataid",params[2][1]=t,params[3]=new Array(2),params[3][0]="nonce",params[3][1]=l;for(var r="",o=0;o<params.length;o++)r+=(o>0?"&":"")+params[o][0]+"="+encodeURI(params[o][1]);n.open("POST",d,!0),n.setRequestHeader("Content-type","application/x-www-form-urlencoded"),n.onreadystatechange=function(){if(4==n.readyState&&200==n.status){var e="wfu_ajax_action_download_file_invoker:",t=n.responseText.indexOf(e);-1==t&&(t=n.responseText.length);var l=(n.responseText.substr(0,t),n.responseText.substr(t+e.length,n.responseText.length-t-e.length)),d=document.getElementById("wfu_file_download_container_"+a),r=function(){console.log(d.children[0].contentWindow.document),d.children[0].contentWindow&&console.log(),setTimeout(r,100)};d.innerHTML=l,r()}},n.send(r)}}function wfu_filedetails_userdata_changed(){for(var e,t,a=document.getElementsByName("wfu_filedetails_userdata"),l=!1,n=0;n<a.length;n++)if(e=document.getElementById(a[n].id.replace("wfu_filedetails_userdata_value_","wfu_filedetails_userdata_default_")),t=document.getElementById(a[n].id.replace("wfu_filedetails_userdata_value_","wfu_filedetails_userdata_")),t.value=a[n].value,a[n].value!=e.value){l=!0;break}document.getElementById("dp_filedetails_submit_fields").disabled=!l}function wfu_Attach_FileDetails_Admin_Events(){for(var e=document.getElementsByName("wfu_filedetails_userdata"),t=0;t<e.length;t++)wfu_attach_element_handlers(e[t],wfu_filedetails_userdata_changed)}var DraggedItem=null,ShortcodeNextSave=0,ShortcodeTimeOut=null,ShortcodeString="",Autosave=!1,PageObsolete=!1,PageUpdating=!1,CheckObsolescenceTimeOut=5e3;jQuery(document).ready(function(e){e(".wfu_color_field").wpColorPicker({change:function(e,t){e.target.value=t.color.toString(),"wfu_text_elements"==e.target.name?wfu_update_text_value(e):"wfu_triplecolor_elements"==e.target.name&&wfu_update_triplecolor_value(e)}})});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/wordpress_file_upload_functions.js
CHANGED
@@ -1,1391 +1,2 @@
|
|
1 |
-
GlobalData = {};
|
2 |
-
UploadStates = {};
|
3 |
-
GlobalData.filestatematch = {};
|
4 |
-
GlobalData.filestatematch.success = [0, 1, 2, 2];
|
5 |
-
GlobalData.filestatematch.warning = [1, 1, 2, 2];
|
6 |
-
GlobalData.filestatematch.error1 = [3, 3, 2, 3];
|
7 |
-
GlobalData.filestatematch.error2 = [2, 2, 2, 3];
|
8 |
-
wfu_Check_Browser_Capabilities();
|
9 |
-
//console.log(wfu_BrowserCaps);
|
10 |
-
|
11 |
-
//wfu_Initialize_Consts: function to initialize constants passed from plugin to javascript
|
12 |
-
function wfu_Initialize_Consts(consts) {
|
13 |
-
if (typeof GlobalData.consts != "undefined") return;
|
14 |
-
GlobalData.consts = new Object();
|
15 |
-
var consts_arr = consts.split(";");
|
16 |
-
var const_arr;
|
17 |
-
for (var i = 0; i < consts_arr.length; i++) {
|
18 |
-
const_txt = consts_arr[i].split(":");
|
19 |
-
GlobalData.consts[wfu_plugin_decode_string(const_txt[0])] = wfu_plugin_decode_string(const_txt[1]);
|
20 |
-
}
|
21 |
-
}
|
22 |
-
|
23 |
-
//wfu_Check_Browser_Capabilities: function that checks if browser supports HTML5, iframes and AJAX
|
24 |
-
function wfu_Check_Browser_Capabilities() {
|
25 |
-
if (typeof wfu_BrowserCaps != "undefined") return;
|
26 |
-
wfu_BrowserCaps = new Object();
|
27 |
-
//check AJAX
|
28 |
-
var xmlhttp = wfu_GetHttpRequestObject();
|
29 |
-
wfu_BrowserCaps.supportsAJAX = ( xmlhttp != null );
|
30 |
-
//check Upload Progress
|
31 |
-
wfu_BrowserCaps.supportsUploadProgress = !! (xmlhttp && ('upload' in xmlhttp) && ('onprogress' in xmlhttp.upload));
|
32 |
-
//check HTML5
|
33 |
-
var fd = null;
|
34 |
-
try {
|
35 |
-
var fd = new FormData();
|
36 |
-
}
|
37 |
-
catch(e) {}
|
38 |
-
wfu_BrowserCaps.supportsHTML5 = ( fd != null );
|
39 |
-
//check IFRAME
|
40 |
-
var e = document.createElement("iframe");
|
41 |
-
wfu_BrowserCaps.supportsIFRAME = ( e != null );
|
42 |
-
//check Drag and Drop
|
43 |
-
wfu_BrowserCaps.supportsDRAGDROP = (window.FileReader);
|
44 |
-
//check animation
|
45 |
-
wfu_BrowserCaps.supportsAnimation = wfu_check_animation();
|
46 |
-
//check if browser is Safari
|
47 |
-
wfu_BrowserCaps.isSafari = (navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1);
|
48 |
-
}
|
49 |
-
|
50 |
-
//wfu_check_animation: function that checks if CSS3 animation is supported
|
51 |
-
function wfu_check_animation() {
|
52 |
-
var animation = false,
|
53 |
-
animationstring = 'animation',
|
54 |
-
keyframeprefix = '',
|
55 |
-
domPrefixes = 'Webkit Moz O ms Khtml'.split(' '),
|
56 |
-
pfx = '';
|
57 |
-
|
58 |
-
var elm = document.createElement('DIV');
|
59 |
-
|
60 |
-
if( elm.style.animationName ) { animation = true; }
|
61 |
-
|
62 |
-
if( animation === false ) {
|
63 |
-
for( var i = 0; i < domPrefixes.length; i++ ) {
|
64 |
-
if( elm.style[ domPrefixes[i] + 'AnimationName' ] !== undefined ) {
|
65 |
-
pfx = domPrefixes[ i ];
|
66 |
-
animationstring = pfx + 'Animation';
|
67 |
-
keyframeprefix = '-' + pfx.toLowerCase() + '-';
|
68 |
-
animation = true;
|
69 |
-
break;
|
70 |
-
}
|
71 |
-
}
|
72 |
-
}
|
73 |
-
return animation;
|
74 |
-
}
|
75 |
-
|
76 |
-
/* function to join two or more strings using a delimeter */
|
77 |
-
function wfu_join_strings(delimeter) {
|
78 |
-
var args = [].slice.call(arguments);
|
79 |
-
var str = "";
|
80 |
-
var delim = "";
|
81 |
-
for (var i = 1; i < args.length; i++) {
|
82 |
-
if (str == "" || args[i] == "" ) delim = "";
|
83 |
-
else delim = delimeter;
|
84 |
-
str += delim + args[i];
|
85 |
-
}
|
86 |
-
return str;
|
87 |
-
}
|
88 |
-
|
89 |
-
//wfu_plugin_decode_string: function that decodes an encoded string
|
90 |
-
function wfu_plugin_decode_string(str) {
|
91 |
-
var i = 0;
|
92 |
-
var newstr = "";
|
93 |
-
var num, val;
|
94 |
-
while (i < str.length) {
|
95 |
-
num = parseInt(str.substr(i, 2), 16);
|
96 |
-
if (num < 128) val = num;
|
97 |
-
else if (num < 224) val = ((num & 31) << 6) + (parseInt(str.substr((i += 2), 2), 16) & 63);
|
98 |
-
else val = ((num & 15) << 12) + ((parseInt(str.substr((i += 2), 2), 16) & 63) << 6) + (parseInt(str.substr((i += 2), 2), 16) & 63);
|
99 |
-
newstr += String.fromCharCode(val);
|
100 |
-
i += 2;
|
101 |
-
}
|
102 |
-
return newstr;
|
103 |
-
}
|
104 |
-
|
105 |
-
//wfu_plugin_encode_string: function that encodes a decoded string
|
106 |
-
function wfu_plugin_encode_string(str) {
|
107 |
-
var i = 0;
|
108 |
-
var newstr = "";
|
109 |
-
var hex = "";
|
110 |
-
for (i = 0; i < str.length; i++) {
|
111 |
-
num = str.charCodeAt(i);
|
112 |
-
if (num >= 2048) num = (((num & 16773120) | 917504) << 4) + (((num & 4032) | 8192) << 2) + ((num & 63) | 128);
|
113 |
-
else if (num >= 128) num = (((num & 65472) | 12288) << 2) + ((num & 63) | 128);
|
114 |
-
hex = num.toString(16);
|
115 |
-
if (hex.length == 1 || hex.length == 3 || hex.length == 5) hex = "0" + hex;
|
116 |
-
newstr += hex;
|
117 |
-
}
|
118 |
-
return newstr;
|
119 |
-
}
|
120 |
-
|
121 |
-
//wfu_randomString: generate a random string with a length of len characters
|
122 |
-
function wfu_randomString(len) {
|
123 |
-
var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
|
124 |
-
var string_length = len;
|
125 |
-
var randomstring = '';
|
126 |
-
for (var i = 0; i < string_length; i++) {
|
127 |
-
var rnum = Math.floor(Math.random() * chars.length);
|
128 |
-
randomstring += chars.substring(rnum, rnum + 1);
|
129 |
-
}
|
130 |
-
return randomstring;
|
131 |
-
}
|
132 |
-
|
133 |
-
//wfu_addEventHandler: attach event handler to element (cross-browser compatible)
|
134 |
-
function wfu_addEventHandler(obj, evt, handler) {
|
135 |
-
if(obj.addEventListener) {
|
136 |
-
// W3C method
|
137 |
-
obj.addEventListener(evt, handler, false);
|
138 |
-
}
|
139 |
-
else if(obj.attachEvent) {
|
140 |
-
// IE method.
|
141 |
-
obj.attachEvent('on'+evt, handler);
|
142 |
-
}
|
143 |
-
else {
|
144 |
-
// Old school method.
|
145 |
-
obj['on'+evt] = handler;
|
146 |
-
}
|
147 |
-
}
|
148 |
-
|
149 |
-
//wfu_GetHttpRequestObject: function that returns XMLHttpRequest object for various browsers
|
150 |
-
function wfu_GetHttpRequestObject() {
|
151 |
-
var xhr = null;
|
152 |
-
try {
|
153 |
-
xhr = new XMLHttpRequest();
|
154 |
-
}
|
155 |
-
catch(e) {
|
156 |
-
try {
|
157 |
-
xhr = new ActiveXObject("Msxml2.XMLHTTP");
|
158 |
-
}
|
159 |
-
catch (e2) {
|
160 |
-
try {
|
161 |
-
xhr = new ActiveXObject("Microsoft.XMLHTTP");
|
162 |
-
}
|
163 |
-
catch (e) {}
|
164 |
-
}
|
165 |
-
}
|
166 |
-
if (xhr == null && window.createRequest) {
|
167 |
-
try {
|
168 |
-
xmlhttp = window.createRequest();
|
169 |
-
}
|
170 |
-
catch (e) {}
|
171 |
-
}
|
172 |
-
return xhr;
|
173 |
-
}
|
174 |
-
|
175 |
-
//wfu_filedetails_showhide: function to show or hide file messages
|
176 |
-
function wfu_filedetails_showhide(sid, fileid, show) {
|
177 |
-
var item1 = document.getElementById('wfu_messageblock_arrow_' + sid + '_' + fileid);
|
178 |
-
var item2 = document.getElementById('wfu_messageblock_arrow_' + sid + '_up_' + fileid);
|
179 |
-
var item3 = document.getElementById('wfu_messageblock_arrow_' + sid + '_down_' + fileid);
|
180 |
-
var item4 = document.getElementById('wfu_messageblock_subheader_' + sid + '_' + fileid);
|
181 |
-
var item5 = document.getElementById('wfu_messageblock_header_' + sid + '_state_' + fileid);
|
182 |
-
if (show) {
|
183 |
-
item2.style.display = "";
|
184 |
-
item3.style.display = "none";
|
185 |
-
item4.style.display = "";
|
186 |
-
item5.value = "";
|
187 |
-
}
|
188 |
-
else {
|
189 |
-
item2.style.display = "none";
|
190 |
-
item3.style.display = "";
|
191 |
-
item4.style.display = "none";
|
192 |
-
item5.value = "none";
|
193 |
-
}
|
194 |
-
}
|
195 |
-
|
196 |
-
//wfu_get_file_ids: function to get an array with ids of files already uploaded
|
197 |
-
function wfu_get_file_ids(sid) {
|
198 |
-
var message_table = document.getElementById('wfu_messageblock_' + sid);
|
199 |
-
var next_block = document.getElementById('wfu_messageblock_subheader_' + sid).nextSibling;
|
200 |
-
var prefix = 'wfu_messageblock_' + sid + '_';
|
201 |
-
var file_ids = [];
|
202 |
-
while (next_block != null) {
|
203 |
-
if (next_block.nodeType === 1 && next_block.id.substr(0, prefix.length) == prefix)
|
204 |
-
file_ids.push(next_block.id.substr(next_block.id.lastIndexOf("_") + 1));
|
205 |
-
next_block = next_block.nextSibling;
|
206 |
-
}
|
207 |
-
return file_ids;
|
208 |
-
}
|
209 |
-
|
210 |
-
//wfu_filedetails_toggle: function to toggle file messages visibility
|
211 |
-
function wfu_filedetails_toggle(sid, fileid) {
|
212 |
-
var item1 = document.getElementById('wfu_messageblock_arrow_' + sid + '_' + fileid);
|
213 |
-
var item2 = document.getElementById('wfu_messageblock_arrow_' + sid + '_up_' + fileid);
|
214 |
-
wfu_filedetails_showhide(sid, fileid, item2.style.display == "none");
|
215 |
-
}
|
216 |
-
|
217 |
-
//wfu_headerdetails_showhide: function to show or hide header messages and upload results for each uploaded file
|
218 |
-
function wfu_headerdetails_showhide(sid, show) {
|
219 |
-
var item1 = document.getElementById('wfu_messageblock_arrow_' + sid);
|
220 |
-
var item2 = document.getElementById('wfu_messageblock_arrow_' + sid + '_up');
|
221 |
-
var item3 = document.getElementById('wfu_messageblock_arrow_' + sid + '_down');
|
222 |
-
var item4 = document.getElementById('wfu_messageblock_subheader_' + sid);
|
223 |
-
var item5 = document.getElementById('wfu_messageblock_subheader_' + sid + '_message');
|
224 |
-
var item6 = document.getElementById('wfu_messageblock_subheader_' + sid + '_adminmessage');
|
225 |
-
var item7 = document.getElementById('wfu_messageblock_header_' + sid + '_state');
|
226 |
-
var file_ids = wfu_get_file_ids(sid);
|
227 |
-
if (show) {
|
228 |
-
item2.style.display = "";
|
229 |
-
item3.style.display = "none";
|
230 |
-
if ( item5.style.display != "none" || item6.style.display != "none" ) item4.style.display = "";
|
231 |
-
item7.value = "";
|
232 |
-
for (var i = 0; i < file_ids.length; i++) {
|
233 |
-
document.getElementById('wfu_messageblock_' + sid + '_' + file_ids[i]).style.display = "";
|
234 |
-
document.getElementById('wfu_messageblock_subheader_' + sid + '_' + file_ids[i]).style.display = document.getElementById('wfu_messageblock_header_' + sid + '_state_' + file_ids[i]).value;
|
235 |
-
}
|
236 |
-
}
|
237 |
-
else {
|
238 |
-
item2.style.display = "none";
|
239 |
-
item3.style.display = "";
|
240 |
-
item4.style.display = "none";
|
241 |
-
item7.value = "none";
|
242 |
-
for (var i = 0; i < file_ids.length; i++) {
|
243 |
-
document.getElementById('wfu_messageblock_' + sid + '_' + file_ids[i]).style.display = "none";
|
244 |
-
document.getElementById('wfu_messageblock_subheader_' + sid + '_' + file_ids[i]).style.display = "none";
|
245 |
-
}
|
246 |
-
}
|
247 |
-
}
|
248 |
-
|
249 |
-
//wfu_headerdetails_toggle: function to toggle header messages and file results visibility
|
250 |
-
function wfu_headerdetails_toggle(sid) {
|
251 |
-
var item1 = document.getElementById('wfu_messageblock_arrow_' + sid);
|
252 |
-
var item2 = document.getElementById('wfu_messageblock_arrow_' + sid + '_up');
|
253 |
-
wfu_headerdetails_showhide(sid, item2.style.display == "none");
|
254 |
-
}
|
255 |
-
|
256 |
-
|
257 |
-
//wfu_selectbutton_changed: function that executes when files have been selected
|
258 |
-
function wfu_selectbutton_changed(sid, usefilearray) {
|
259 |
-
//if browser cannot handle HTML5 AJAX requests then deactivate use of array to store uploaded files
|
260 |
-
if (!wfu_BrowserCaps.supportsAJAX || !wfu_BrowserCaps.supportsHTML5) usefilearray = 0;
|
261 |
-
|
262 |
-
var inputfile = document.getElementById("upfile_" + sid);
|
263 |
-
var farr = inputfile.files;
|
264 |
-
//fix in case files attribute is not supported
|
265 |
-
if (!farr) { if (inputfile.value) farr = [{name:inputfile.value}]; else farr = []; }
|
266 |
-
//update textbox with filename of the file to be uploaded
|
267 |
-
var ftext = document.getElementById("fileName_" + sid);
|
268 |
-
if (ftext) ftext.value = inputfile.value.replace(/c:\\fakepath\\/i, "");
|
269 |
-
//if use of array is possible to store filelist, then create it and append selected files
|
270 |
-
if (usefilearray == 1) {
|
271 |
-
if (typeof inputfile.filearray == "undefined") {
|
272 |
-
inputfile.filearray = Array();
|
273 |
-
}
|
274 |
-
for (var i = 0; i < farr.length; i++) {
|
275 |
-
inputfile.filearray.push(farr[i]);
|
276 |
-
}
|
277 |
-
}
|
278 |
-
}
|
279 |
-
|
280 |
-
//wfu_selectbutton_clicked: function that executes when select button is clicked
|
281 |
-
function wfu_selectbutton_clicked(sid) {
|
282 |
-
var message_container = document.getElementById("wordpress_file_upload_message_" + sid);
|
283 |
-
if (message_container) message_container.style.display = "none";
|
284 |
-
wfu_reset_message(sid);
|
285 |
-
document.getElementById("upfile_" + sid).value = "";
|
286 |
-
var ftext = document.getElementById("fileName_" + sid);
|
287 |
-
if (ftext) {
|
288 |
-
ftext.value = "";
|
289 |
-
ftext.className = "file_input_textbox";
|
290 |
-
}
|
291 |
-
}
|
292 |
-
|
293 |
-
//wfu_selectsubdir_check: function that checks if a subdirectory has been selected (when askforsubfolder is on)
|
294 |
-
function wfu_selectsubdir_check(sid) {
|
295 |
-
var sel = document.getElementById("selectsubdir_" + sid);
|
296 |
-
if (!sel) return true;
|
297 |
-
document.getElementById('hiddeninput_' + sid).value = sel.selectedIndex;
|
298 |
-
if (sel.selectedIndex == 0) {
|
299 |
-
sel.style.backgroundColor = 'red';
|
300 |
-
return false;
|
301 |
-
}
|
302 |
-
else {
|
303 |
-
sel.style.backgroundColor = 'transparent';
|
304 |
-
sel.options[0].style.display = "none";
|
305 |
-
return true;
|
306 |
-
}
|
307 |
-
}
|
308 |
-
|
309 |
-
//wfu_Redirect: function to redirect to another url
|
310 |
-
function wfu_Redirect(link) {
|
311 |
-
window.location = link;
|
312 |
-
}
|
313 |
-
|
314 |
-
//wfu_loadStrat: function to start upload of file
|
315 |
-
function wfu_loadStart(evt) {
|
316 |
-
}
|
317 |
-
|
318 |
-
//wfu_uploadProgress: function to update progress bar
|
319 |
-
function wfu_uploadProgress(evt, sid, xhrid, debugmode) {
|
320 |
-
if (debugmode && typeof this.xhr == "undefined") {
|
321 |
-
console.log("total="+evt.total+", loaded="+evt.loaded);
|
322 |
-
console.log(this);
|
323 |
-
}
|
324 |
-
var this_xhr = GlobalData[sid].xhrs[xhrid];
|
325 |
-
var percentComplete = 0;
|
326 |
-
var delta = 0;
|
327 |
-
var simplebar = document.getElementById('progressbar_' + sid + '_animation');
|
328 |
-
if (evt.lengthComputable) {
|
329 |
-
this_xhr.sizeloaded = evt.loaded;
|
330 |
-
if (this_xhr.size < evt.total && evt.total > 0) {
|
331 |
-
delta = evt.total - this_xhr.size;
|
332 |
-
this_xhr.size += delta;
|
333 |
-
for (var i = 0; i < GlobalData[sid].xhrs.length; i++)
|
334 |
-
if (GlobalData[sid].xhrs[i].file_id == this_xhr.file_id) {
|
335 |
-
GlobalData[sid].xhrs[i].totalsize += delta;
|
336 |
-
}
|
337 |
-
}
|
338 |
-
if (simplebar) {
|
339 |
-
var total = 0;
|
340 |
-
var totalloaded = 0;
|
341 |
-
var totals = [];
|
342 |
-
for (var i = 0; i < GlobalData[sid].xhrs.length; i++)
|
343 |
-
totals[GlobalData[sid].xhrs[i].file_id] = 0;
|
344 |
-
for (var i = 0; i < GlobalData[sid].xhrs.length; i++)
|
345 |
-
totals[GlobalData[sid].xhrs[i].file_id] = Math.max(GlobalData[sid].xhrs[i].totalsize, totals[GlobalData[sid].xhrs[i].file_id]);
|
346 |
-
for (var i = 0; i < totals.length; i++)
|
347 |
-
if (typeof totals[i] != "undefined") total += totals[i];
|
348 |
-
for (var i = 0; i < GlobalData[sid].xhrs.length; i++)
|
349 |
-
totalloaded += GlobalData[sid].xhrs[i].sizeloaded;
|
350 |
-
// percentComplete = Math.round((totalloaded + evt.loaded - this_xhr.sizeloaded) * 100 / total);
|
351 |
-
percentComplete = Math.round(totalloaded * 100 / total);
|
352 |
-
simplebar.style.width = percentComplete.toString() + '%';
|
353 |
-
}
|
354 |
-
// this_xhr.sizeloaded = evt.loaded;
|
355 |
-
}
|
356 |
-
else {
|
357 |
-
if (simplebar) simplebar.style.width = '0%';
|
358 |
-
}
|
359 |
-
}
|
360 |
-
|
361 |
-
/* wfu_notify_WPFilebase: function to notify WPFilebase plugin about file changes */
|
362 |
-
function wfu_notify_WPFilebase(params_index, session_token) {
|
363 |
-
var xhr = wfu_GetHttpRequestObject();
|
364 |
-
if (xhr == null) {
|
365 |
-
//alternative way of sending GET request using IFRAME, in case AJAX is disabled
|
366 |
-
var i = document.createElement("iframe");
|
367 |
-
i.style.display = "none";
|
368 |
-
i.src = GlobalData.consts.ajax_url + "?action=wfu_ajax_action_notify_wpfilebase¶ms_index=" + params_index + "&session_token=" + session_token;
|
369 |
-
document.body.appendChild(i);
|
370 |
-
return;
|
371 |
-
}
|
372 |
-
|
373 |
-
var url = GlobalData.consts.ajax_url;
|
374 |
-
params = new Array(3);
|
375 |
-
params[0] = new Array(2);
|
376 |
-
params[0][0] = 'action';
|
377 |
-
params[0][1] = 'wfu_ajax_action_notify_wpfilebase';
|
378 |
-
params[1] = new Array(2);
|
379 |
-
params[1][0] = 'params_index';
|
380 |
-
params[1][1] = params_index;
|
381 |
-
params[2] = new Array(2);
|
382 |
-
params[2][0] = 'session_token';
|
383 |
-
params[2][1] = session_token;
|
384 |
-
|
385 |
-
var parameters = '';
|
386 |
-
for (var i = 0; i < params.length; i++) {
|
387 |
-
parameters += (i > 0 ? "&" : "") + params[i][0] + "=" + encodeURI(params[i][1]);
|
388 |
-
}
|
389 |
-
|
390 |
-
xhr.open("POST", url, true);
|
391 |
-
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
392 |
-
// xhr.setRequestHeader("Content-length", parameters.length);
|
393 |
-
// xhr.setRequestHeader("Connection", "close");
|
394 |
-
xhr.onreadystatechange = function() {}
|
395 |
-
xhr.send(parameters);
|
396 |
-
}
|
397 |
-
|
398 |
-
/* wfu_send_email_notification: function to send notification message as ajax request */
|
399 |
-
function wfu_send_email_notification(sid, unique_id, params_index, session_token, notify_only_filename_list, notify_target_path_list, notify_attachment_list, debugmode, is_admin) {
|
400 |
-
var xhr = wfu_GetHttpRequestObject();
|
401 |
-
if (xhr == null) {
|
402 |
-
// error sending email
|
403 |
-
return;
|
404 |
-
}
|
405 |
-
|
406 |
-
var url = GlobalData.consts.ajax_url;
|
407 |
-
var userdata_count = wfu_get_userdata_count(sid);
|
408 |
-
params = new Array(7 + userdata_count);
|
409 |
-
params[0] = new Array(2);
|
410 |
-
params[0][0] = 'action';
|
411 |
-
params[0][1] = 'wfu_ajax_action_send_email_notification';
|
412 |
-
params[1] = new Array(2);
|
413 |
-
params[1][0] = 'params_index';
|
414 |
-
params[1][1] = params_index;
|
415 |
-
params[2] = new Array(2);
|
416 |
-
params[2][0] = 'session_token';
|
417 |
-
params[2][1] = session_token;
|
418 |
-
params[3] = new Array(2);
|
419 |
-
params[3][0] = 'only_filename_list';
|
420 |
-
params[3][1] = notify_only_filename_list;
|
421 |
-
params[4] = new Array(2);
|
422 |
-
params[4][0] = 'target_path_list';
|
423 |
-
params[4][1] = notify_target_path_list;
|
424 |
-
params[5] = new Array(2);
|
425 |
-
params[5][0] = 'attachment_list';
|
426 |
-
params[5][1] = notify_attachment_list;
|
427 |
-
params[6] = new Array(2);
|
428 |
-
params[6][0] = 'unique_id';
|
429 |
-
params[6][1] = unique_id;
|
430 |
-
for (var i = 0; i < userdata_count; i++) {
|
431 |
-
params[7 + i] = new Array(2);
|
432 |
-
params[7 + i][0] = 'userdata_' + i;
|
433 |
-
params[7 + i][1] = wfu_plugin_encode_string(document.getElementById('hiddeninput_' + sid + '_userdata_' + i).value);
|
434 |
-
}
|
435 |
-
|
436 |
-
var parameters = '';
|
437 |
-
for (var i = 0; i < params.length; i++) {
|
438 |
-
parameters += (i > 0 ? "&" : "") + params[i][0] + "=" + encodeURI(params[i][1]);
|
439 |
-
}
|
440 |
-
|
441 |
-
var d = new Date();
|
442 |
-
xhr.shortcode_id = sid;
|
443 |
-
xhr.requesttype = "email";
|
444 |
-
xhr.file_id = 0;
|
445 |
-
xhr.unique_id = unique_id;
|
446 |
-
xhr.debugmode = debugmode;
|
447 |
-
xhr.is_admin = is_admin;
|
448 |
-
xhr.params_index = params_index;
|
449 |
-
xhr.session_token = session_token;
|
450 |
-
xhr.finish_time = d.getTime() + parseInt(GlobalData.consts.max_time_limit) * 1000;
|
451 |
-
xhr.fail_colors = GlobalData.consts.fail_colors;
|
452 |
-
xhr.error_message_header = "";
|
453 |
-
xhr.error_message_failed = GlobalData.consts.message_failed;
|
454 |
-
xhr.error_message_cancelled = GlobalData.consts.message_cancelled;
|
455 |
-
xhr.error_adminmessage_unknown = "";
|
456 |
-
|
457 |
-
xhr.open("POST", url, true);
|
458 |
-
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
459 |
-
// xhr.setRequestHeader("Content-length", parameters.length);
|
460 |
-
// xhr.setRequestHeader("Connection", "close");
|
461 |
-
xhr.addEventListener("load", wfu_uploadComplete, false);
|
462 |
-
xhr.addEventListener("error", wfu_uploadFailed, false);
|
463 |
-
xhr.addEventListener("abort", wfu_uploadCanceled, false);
|
464 |
-
|
465 |
-
xhr.send(parameters);
|
466 |
-
}
|
467 |
-
|
468 |
-
//wfu_format_debug_data: function to format and prepare debug data for output
|
469 |
-
function wfu_format_debug_data(data, title) {
|
470 |
-
output = '<label class="file_messageblock_subheader_debugmessage_label">';
|
471 |
-
output += 'Debug Data' + title;
|
472 |
-
output += '</label>';
|
473 |
-
output += '<div class="file_messageblock_subheader_debugmessage_container">';
|
474 |
-
output += data;
|
475 |
-
output += '</div>';
|
476 |
-
return output;
|
477 |
-
}
|
478 |
-
|
479 |
-
//wfu_uploadComplete: function that is called after successfull file upload
|
480 |
-
function wfu_uploadComplete(evt) {
|
481 |
-
var sid = this.shortcode_id;
|
482 |
-
var i = this.file_id;
|
483 |
-
var last = false;
|
484 |
-
var upload_params = "";
|
485 |
-
var safe_params = "";
|
486 |
-
var file_status = "unknown";
|
487 |
-
var debug_data = "";
|
488 |
-
var success_txt = "wfu_fileupload_success:";
|
489 |
-
var result_data = evt.target.responseText;
|
490 |
-
//process response from server
|
491 |
-
if (evt.target.responseText != -1) {
|
492 |
-
var txt = evt.target.responseText;
|
493 |
-
var pos = txt.indexOf(success_txt);
|
494 |
-
if ( pos > -1 ) {
|
495 |
-
//extract parts of response text
|
496 |
-
if (this.debugmode == "true") debug_data = txt.substr(0, pos);
|
497 |
-
result_data = txt.substr(pos + success_txt.length);
|
498 |
-
pos = result_data.indexOf(":");
|
499 |
-
safe_params = result_data.substr(0, pos);
|
500 |
-
upload_params = result_data.substr(pos + 1);
|
501 |
-
}
|
502 |
-
//format debug data, if they exist
|
503 |
-
if (debug_data != "") {
|
504 |
-
var title = "";
|
505 |
-
if (this.requesttype == "fileupload") title = ' - File: ' + this.file_id;
|
506 |
-
else if (this.requesttype == "email") title = ' - Email Notification';
|
507 |
-
debug_data = wfu_format_debug_data(debug_data, title);
|
508 |
-
}
|
509 |
-
//extract file status from safe params if they exist
|
510 |
-
if (safe_params != "") {
|
511 |
-
var safe_parts = safe_params.split(";");
|
512 |
-
//for ajax uploads there should be only one file processed each time
|
513 |
-
if (parseInt(safe_parts[2]) == 1) {
|
514 |
-
var filedata = safe_parts[3].split(",");
|
515 |
-
file_status = wfu_plugin_decode_string(filedata[0]);
|
516 |
-
}
|
517 |
-
}
|
518 |
-
}
|
519 |
-
//if the response text does not contain upload data then fill the Params structure with the minimum required error info
|
520 |
-
if (upload_params == "" || safe_params == "") {
|
521 |
-
var error_colors = this.fail_colors.split(",");
|
522 |
-
var Params = wfu_Initialize_Params();
|
523 |
-
Params.general.shortcode_id = sid;
|
524 |
-
Params.general.unique_id = this.unique_id;
|
525 |
-
Params.general.state = 7; //it indicates that no files were uploaded
|
526 |
-
Params.general.files_count = (this.requesttype == "fileupload") ? 1 : 0;
|
527 |
-
Params.general.upload_finish_time = this.finish_time;
|
528 |
-
Params.general.fail_message = GlobalData.consts.message_unknown;
|
529 |
-
Params.general.fail_admin_message = wfu_join_strings("<br />", this.error_adminmessage_unknown, this.requesttype + ":" + result_data);
|
530 |
-
if (Params.general.files_count > 0) {
|
531 |
-
Params[0] = {};
|
532 |
-
Params[0]['color'] = error_colors[0];
|
533 |
-
Params[0]['bgcolor'] = error_colors[1];
|
534 |
-
Params[0]['borcolor'] = error_colors[2];
|
535 |
-
Params[0]['message_type'] = "error";
|
536 |
-
file_status = "error";
|
537 |
-
Params[0]['header'] = this.error_message_header;
|
538 |
-
Params[0]['message'] = GlobalData.consts.message_timelimit;
|
539 |
-
Params[0]['admin_messages'] = this.is_admin == "true" ? GlobalData.consts.message_admin_timelimit : "";
|
540 |
-
}
|
541 |
-
else Params.general.admin_messages.other = this.is_admin == "true" ? GlobalData.consts.message_admin_timelimit : "";
|
542 |
-
//check if we have a failed upload probably due to exceeded upload time limit
|
543 |
-
if (Params.general.upload_finish_time > 0) {
|
544 |
-
var d = new Date();
|
545 |
-
if (d.getTime() < Params.general.upload_finish_time) {
|
546 |
-
if (Params.general.files_count > 0) {
|
547 |
-
Params[0]['message'] = Params.general.fail_message;
|
548 |
-
Params[0]['admin_messages'] = this.is_admin == "true" ? Params.general.fail_admin_message : "";
|
549 |
-
}
|
550 |
-
else Params.general.admin_messages.other = this.is_admin == "true" ? Params.general.fail_admin_message : "";
|
551 |
-
}
|
552 |
-
}
|
553 |
-
}
|
554 |
-
if (upload_params == "" || safe_params == "") {
|
555 |
-
// upload_params is passed as object, so no need to pass a safe_output string
|
556 |
-
last = wfu_ProcessUploadComplete(sid, this.file_id, Params, this.unique_id, this.params_index, this.session_token, "", [this.debugmode, debug_data, this.is_admin], this.requesttype);
|
557 |
-
}
|
558 |
-
else {
|
559 |
-
last = wfu_ProcessUploadComplete(sid, this.file_id, upload_params, this.unique_id, this.params_index, this.session_token, safe_params, [this.debugmode, debug_data, this.is_admin], this.requesttype);
|
560 |
-
}
|
561 |
-
if (last) {
|
562 |
-
wfu_unlock_upload(evt.target.shortcode_id);
|
563 |
-
wfu_hide_simple_progressbar(sid);
|
564 |
-
wfu_clear(evt.target.shortcode_id);
|
565 |
-
}
|
566 |
-
if (evt.target.return_status)
|
567 |
-
return file_status;
|
568 |
-
}
|
569 |
-
|
570 |
-
// wfu_ProcessUploadComplete: function to perform actions after successfull upload
|
571 |
-
function wfu_ProcessUploadComplete(sid, file_id, upload_params, unique_id, params_index, session_token, safe_output, debug_data, request_type) {
|
572 |
-
// initial checks to process or not the data
|
573 |
-
if (!sid || sid < 0) return;
|
574 |
-
if (upload_params == null || upload_params == "") return;
|
575 |
-
if (unique_id == "") return;
|
576 |
-
if (unique_id != "no-ajax" && !GlobalData[sid]) return;
|
577 |
-
|
578 |
-
var do_redirect = false;
|
579 |
-
|
580 |
-
if (typeof upload_params === "string") {
|
581 |
-
// if upload_params is a string, then it comes from a normal upload process and must be decoded
|
582 |
-
upload_params = wfu_plugin_decode_string(upload_params.replace(/^\s+|\s+$/g,""));
|
583 |
-
var Params = null;
|
584 |
-
try { Params = JSON.parse(upload_params); }
|
585 |
-
catch(e) {}
|
586 |
-
if (Params == null) {
|
587 |
-
// JSON parse error that does not allow to read the parameters of the upload. The safe output string will be used in place.
|
588 |
-
var safe_parts = safe_output.split(";");
|
589 |
-
Params = wfu_Initialize_Params();
|
590 |
-
Params.general.shortcode_id = sid;
|
591 |
-
Params.general.unique_id = unique_id;
|
592 |
-
Params.general.state = safe_parts[0];
|
593 |
-
// upload state cannot be 4, because we have json warnings
|
594 |
-
if (Params.general.state == 4) Params.general.state++;
|
595 |
-
var default_colors = safe_parts[1].split(",");
|
596 |
-
var filedata = "";
|
597 |
-
var error_jsonparse_filemessage = GlobalData.consts.jsonparse_filemessage;
|
598 |
-
var error_jsonparse_message = GlobalData.consts.jsonparse_message;
|
599 |
-
var error_jsonparse_adminmessage = GlobalData.consts.jsonparse_adminmessage;
|
600 |
-
Params.general.files_count = parseInt(safe_parts[2]);
|
601 |
-
for (var i = 0; i < Params.general.files_count; i++) {
|
602 |
-
Params[i] = {};
|
603 |
-
Params[i]['color'] = default_colors[0];
|
604 |
-
Params[i]['bgcolor'] = default_colors[1];
|
605 |
-
Params[i]['borcolor'] = default_colors[2];
|
606 |
-
filedata = safe_parts[i + 3].split(",");
|
607 |
-
Params[i]['message_type'] = wfu_plugin_decode_string(filedata[0]);
|
608 |
-
Params[i]['header'] = wfu_plugin_decode_string(filedata[1]);
|
609 |
-
if (Params[i]['message_type'] == "success") {
|
610 |
-
Params[i]['header'] += error_jsonparse_filemessage;
|
611 |
-
Params[i]['message_type'] = "warning";
|
612 |
-
}
|
613 |
-
Params[i]['message'] = wfu_join_strings("<br />", error_jsonparse_message, wfu_plugin_decode_string(filedata[2]));
|
614 |
-
Params[i]['admin_messages'] = wfu_join_strings("<br />", error_jsonparse_adminmessage, wfu_plugin_decode_string(filedata[3]));
|
615 |
-
}
|
616 |
-
}
|
617 |
-
}
|
618 |
-
// include case for results returned straight as object in case of error or wait state
|
619 |
-
else if (typeof upload_params === "object") var Params = upload_params;
|
620 |
-
else return;
|
621 |
-
|
622 |
-
var message_table = document.getElementById('wfu_messageblock_' + sid);
|
623 |
-
|
624 |
-
// initialize UploadStates object, if not already initialized and if message box is activated
|
625 |
-
// UploadStates object contain information about formatting of messages depending on upload state
|
626 |
-
var UploadStates_Ok = true;
|
627 |
-
if (!UploadStates[sid] && message_table) {
|
628 |
-
var upload_states = document.getElementById('wfu_messageblock_header_' + sid + '_states').value;
|
629 |
-
upload_states = wfu_plugin_decode_string(upload_states.replace(/^\s+|\s+$/g,""));
|
630 |
-
UploadStates[sid] = null;
|
631 |
-
try { UploadStates[sid] = JSON.parse(upload_states); }
|
632 |
-
catch(e) {}
|
633 |
-
if (UploadStates[sid] == null) {
|
634 |
-
// JSON parse error that does not allow to show and style accordingly the header message. A generic JSON parse error message will be shown
|
635 |
-
UploadStates_Ok = false;
|
636 |
-
}
|
637 |
-
}
|
638 |
-
|
639 |
-
// pass upload parameters to GlobalData object, which is used to configure the message contents
|
640 |
-
if (!GlobalData[sid]) GlobalData[sid] = Object();
|
641 |
-
var G = GlobalData[sid];
|
642 |
-
// in case of no-ajax method, simply pass upload parameters to GlobalData object
|
643 |
-
if (unique_id == "no-ajax") {
|
644 |
-
G.last = false;
|
645 |
-
G.unique_id = "";
|
646 |
-
G.files_count = Params.general.files_count;
|
647 |
-
if (Params.general.state == 0) Params.general.files_count = 0;
|
648 |
-
G.files_processed = Params.general.files_count;
|
649 |
-
if (UploadStates_Ok) G.upload_state = Params.general.state;
|
650 |
-
// if UploadStates could not be parsed, then set header state to JSON error (state 10)
|
651 |
-
else G.upload_state = 10;
|
652 |
-
G.message = Params.general.message;
|
653 |
-
G.update_wpfilebase = Params.general.update_wpfilebase;
|
654 |
-
G.redirect_link = Params.general.redirect_link;
|
655 |
-
G.notify_only_filename_list = ""; //in the case of no-ajax method, email notification has already been executed by php, so it is suppressed here
|
656 |
-
G.notify_target_path_list = "";
|
657 |
-
G.notify_attachment_list = "";
|
658 |
-
G.admin_messages = {};
|
659 |
-
G.admin_messages.wpfilebase = Params.general.admin_messages.wpfilebase;
|
660 |
-
G.admin_messages.notify = Params.general.admin_messages.notify;
|
661 |
-
G.admin_messages.redirect = Params.general.admin_messages.redirect;
|
662 |
-
G.admin_messages.debug = debug_data[1];
|
663 |
-
G.admin_messages.other = Params.general.admin_messages.other;
|
664 |
-
G.errors = {};
|
665 |
-
G.errors.wpfilebase = Params.general.errors.wpfilebase;
|
666 |
-
G.errors.notify = Params.general.errors.notify;
|
667 |
-
G.errors.redirect = Params.general.errors.redirect;
|
668 |
-
G.current_size = 0;
|
669 |
-
G.total_size = 0;
|
670 |
-
}
|
671 |
-
else {
|
672 |
-
if (G.unique_id == "" || G.unique_id != unique_id || G.unique_id != Params.general.unique_id) return;
|
673 |
-
if (G.last) return;
|
674 |
-
if (Params.general.files_count == 0 && Params[0]) {
|
675 |
-
if (Params[0].message_type == "error") {
|
676 |
-
//notify that file has finished by setting files_count to 1
|
677 |
-
Params.general.files_count = 1;
|
678 |
-
}
|
679 |
-
}
|
680 |
-
var file_status = "";
|
681 |
-
for (var i = 0; i < Params.general.files_count; i++) {
|
682 |
-
// define new upload state based on the status of current file
|
683 |
-
if (Params[i].message_type == "error" && G.files_processed == 0) file_status = "error1";
|
684 |
-
else if (Params[i].message_type == "error" && G.files_processed > 0) file_status = "error2";
|
685 |
-
else file_status = Params[i].message_type;
|
686 |
-
G.upload_state = GlobalData.filestatematch[file_status][G.upload_state];
|
687 |
-
}
|
688 |
-
// if UploadStates could not be parsed, then set header state to JSON error (state 10)
|
689 |
-
if (!UploadStates_Ok) G.upload_state = 10;
|
690 |
-
G.files_processed += Params.general.files_count;
|
691 |
-
G.message = wfu_join_strings("<br />", G.message, Params.general.message);
|
692 |
-
if (G.update_wpfilebase == "") G.update_wpfilebase = Params.general.update_wpfilebase;
|
693 |
-
if (!request_type || (request_type && request_type != "email")) G.redirect_link = Params.general.redirect_link;
|
694 |
-
G.notify_only_filename_list = wfu_join_strings(", ", G.notify_only_filename_list, Params.general.notify_only_filename_list);
|
695 |
-
G.notify_target_path_list = wfu_join_strings(", ", G.notify_target_path_list, Params.general.notify_target_path_list);
|
696 |
-
G.notify_attachment_list = wfu_join_strings(",", G.notify_attachment_list, Params.general.notify_attachment_list);
|
697 |
-
G.admin_messages.debug = wfu_join_strings("<br />", G.admin_messages.debug, debug_data[1]);
|
698 |
-
G.admin_messages.other = wfu_join_strings("<br />", G.admin_messages.other, Params.general.admin_messages.other);
|
699 |
-
if (G.admin_messages.wpfilebase == "") G.admin_messages.wpfilebase = Params.general.admin_messages.wpfilebase;
|
700 |
-
if (G.admin_messages.notify == "") G.admin_messages.notify = Params.general.admin_messages.notify;
|
701 |
-
if (G.admin_messages.redirect == "") G.admin_messages.redirect = Params.general.admin_messages.redirect;
|
702 |
-
if (G.errors.wpfilebase == "") G.errors.wpfilebase = Params.general.errors.wpfilebase;
|
703 |
-
if (G.errors.notify == "") G.errors.notify = Params.general.errors.notify;
|
704 |
-
if (G.errors.redirect == "") G.errors.redirect = Params.general.errors.redirect;
|
705 |
-
}
|
706 |
-
// adjust upload parameters if this is the last combined call to this function
|
707 |
-
if (G.files_processed == G.files_count) {
|
708 |
-
G.last = true;
|
709 |
-
// prepare and execute actions related to WPFilebase, email notifications and redirection if this is the last call
|
710 |
-
if (G.update_wpfilebase != "") {
|
711 |
-
G.admin_messages.wpfilebase = "";
|
712 |
-
// wfu_notify_WPFilebase(G.update_wpfilebase);
|
713 |
-
wfu_notify_WPFilebase(params_index, session_token);
|
714 |
-
}
|
715 |
-
if (G.notify_only_filename_list != "") {
|
716 |
-
G.admin_messages.notify = "";
|
717 |
-
wfu_send_email_notification(sid, unique_id, params_index, session_token, G.notify_only_filename_list, G.notify_target_path_list, G.notify_attachment_list, debug_data[0], debug_data[2]);
|
718 |
-
// in email notification we declare that this is not the last call, because we wait for a last answer from email sending result
|
719 |
-
G.last = false;
|
720 |
-
G.notify_only_filename_list = ""; //reset this variable so that repetitive email messages are not sent
|
721 |
-
}
|
722 |
-
if (G.errors.redirect != "") G.redirect_link = "";
|
723 |
-
if (G.redirect_link != "" && G.last) {
|
724 |
-
// if redirection is executed, then set upload state to redirecting...
|
725 |
-
G.upload_state = 11;
|
726 |
-
do_redirect = true;
|
727 |
-
// wfu_Redirect(G.redirect_link);
|
728 |
-
}
|
729 |
-
}
|
730 |
-
|
731 |
-
// last adjustment of header messages due to json parse error of UploadState or debug messages
|
732 |
-
var nonadmin_message = G.message;
|
733 |
-
|
734 |
-
var admin_message = wfu_join_strings("<br />",
|
735 |
-
G.admin_messages.other,
|
736 |
-
G.admin_messages.wpfilebase,
|
737 |
-
G.admin_messages.notify,
|
738 |
-
G.admin_messages.redirect,
|
739 |
-
G.admin_messages.debug);
|
740 |
-
if (!UploadStates_Ok) {
|
741 |
-
var error_jsonparse_headermessage = GlobalData.consts.jsonparse_headermessage;
|
742 |
-
var error_jsonparse_headeradminmessage = GlobalData.consts.jsonparse_headeradminmessage;
|
743 |
-
nonadmin_message = wfu_join_strings("<br />", error_jsonparse_headermessage, nonadmin_message);
|
744 |
-
admin_message = wfu_join_strings("<br />", error_jsonparse_headeradminmessage, admin_message);
|
745 |
-
}
|
746 |
-
|
747 |
-
if (G.last) {
|
748 |
-
// update upload state
|
749 |
-
if (G.files_count == 0) G.upload_state = 8;
|
750 |
-
else if (G.upload_state < 4) G.upload_state += 4;
|
751 |
-
// final adjust of upload state because admin messages may have been modified
|
752 |
-
var admin_messages_exist = (G.admin_messages.wpfilebase != "" || G.admin_messages.notify != "" || G.admin_messages.redirect != "" || G.admin_messages.other != "");
|
753 |
-
if (G.upload_state == 4 && admin_message != "") G.upload_state ++;
|
754 |
-
else if (G.upload_state == 5 && !admin_message == "" && nonadmin_message == "") G.upload_state --;
|
755 |
-
}
|
756 |
-
|
757 |
-
// if (typeof console != "undefined") {
|
758 |
-
// console.log(Params);
|
759 |
-
// var GG = G;
|
760 |
-
// console.log(GG);
|
761 |
-
// }
|
762 |
-
|
763 |
-
// section to update message box, executed only if message box is activated
|
764 |
-
if (message_table) {
|
765 |
-
var subheader_state = document.getElementById('wfu_messageblock_header_' + sid + '_state');
|
766 |
-
var single_file_shown = (G.files_count == 1 && nonadmin_message == "" && admin_message == "" && G.last && !do_redirect);
|
767 |
-
// adjust header if must be shown
|
768 |
-
if (single_file_shown) {
|
769 |
-
document.getElementById('wfu_messageblock_header_' + sid).style.display = "none";
|
770 |
-
}
|
771 |
-
else {
|
772 |
-
document.getElementById('wfu_messageblock_header_' + sid).style.display = "";
|
773 |
-
var header_container = document.getElementById('wfu_messageblock_header_' + sid + '_container');
|
774 |
-
if (UploadStates_Ok) {
|
775 |
-
var suffix = "";
|
776 |
-
if (G.files_count == 1 && (G.upload_state == 5 || G.upload_state == 7)) suffix = "_singlefile";
|
777 |
-
header_container.innerHTML = UploadStates[sid]["State" + G.upload_state + suffix];
|
778 |
-
}
|
779 |
-
else {
|
780 |
-
header_container.innerHTML = "";
|
781 |
-
var safe_container = document.getElementById('wfu_messageblock_header_' + sid + '_safecontainer');
|
782 |
-
header_container.innerHTML = safe_container.innerHTML.replace(/_safe/g, "");
|
783 |
-
}
|
784 |
-
|
785 |
-
// adjust subheader message
|
786 |
-
var subheader_show = false;
|
787 |
-
if (nonadmin_message != "") {
|
788 |
-
document.getElementById('wfu_messageblock_subheader_' + sid + '_message').style.display = "";
|
789 |
-
document.getElementById('wfu_messageblock_subheader_' + sid + '_messagelabel').innerHTML = nonadmin_message;
|
790 |
-
subheader_show = true;
|
791 |
-
}
|
792 |
-
else
|
793 |
-
document.getElementById('wfu_messageblock_subheader_' + sid + '_message').style.display = "none";
|
794 |
-
|
795 |
-
// adjust subheader admin message
|
796 |
-
if (admin_message != "") {
|
797 |
-
document.getElementById('wfu_messageblock_subheader_' + sid + '_adminmessage').style.display = "";
|
798 |
-
document.getElementById('wfu_messageblock_subheader_' + sid + '_adminmessagelabel').innerHTML = admin_message;
|
799 |
-
subheader_show = true;
|
800 |
-
}
|
801 |
-
else
|
802 |
-
document.getElementById('wfu_messageblock_subheader_' + sid + '_adminmessage').style.display = "none";
|
803 |
-
|
804 |
-
// adjust subheader
|
805 |
-
if (subheader_show)
|
806 |
-
document.getElementById('wfu_messageblock_subheader_' + sid).style.display = subheader_state.value;
|
807 |
-
else
|
808 |
-
document.getElementById('wfu_messageblock_subheader_' + sid).style.display = "none";
|
809 |
-
|
810 |
-
// adjust header arrow
|
811 |
-
if (subheader_show || G.files_processed > 0) {
|
812 |
-
header_container.colSpan = 2;
|
813 |
-
document.getElementById('wfu_messageblock_arrow_' + sid).style.display = "";
|
814 |
-
}
|
815 |
-
else {
|
816 |
-
document.getElementById('wfu_messageblock_arrow_' + sid).style.display = "none";
|
817 |
-
header_container.colSpan = 3;
|
818 |
-
}
|
819 |
-
}
|
820 |
-
var next_block = document.getElementById('wfu_messageblock_subheader_' + sid);
|
821 |
-
var next_block_id = 0;
|
822 |
-
|
823 |
-
// insert file blocks
|
824 |
-
var file_block = null;
|
825 |
-
var file_template_container = document.getElementById('wfu_messageblock_' + sid + '_filetemplate');
|
826 |
-
var file_contents = "";
|
827 |
-
var door = document.getElementById('wfu_messageblock_' + sid + '_door');
|
828 |
-
var ii = 0;
|
829 |
-
var headerspan = 1;
|
830 |
-
var subheaderspan = 2;
|
831 |
-
var file_template = wfu_plugin_decode_string(file_template_container.value.replace(/^\s+|\s+$/g,""));
|
832 |
-
for (var i = 0; i < Params.general.files_count; i++) {
|
833 |
-
ii = i + file_id;
|
834 |
-
// replace template variables with file data
|
835 |
-
file_contents = file_template.replace(/\[file_id\]/g, ii);
|
836 |
-
file_contents = file_contents.replace(/\[filenumber_display\]/g, "");
|
837 |
-
file_contents = file_contents.replace(/\[fileheader_color\]/g, Params[i].color);
|
838 |
-
file_contents = file_contents.replace(/\[fileheader_bgcolor\]/g, Params[i].bgcolor);
|
839 |
-
file_contents = file_contents.replace(/\[fileheader_borcolor\]/g, Params[i].borcolor);
|
840 |
-
file_contents = file_contents.replace(/\[fileheader_message\]/g, Params[i].header);
|
841 |
-
file_contents = file_contents.replace(/\[filesubheadermessage_display\]/g, "style=\"display:none;\"");
|
842 |
-
file_contents = file_contents.replace(/\[filesubheader_message\]/g, Params[i].message);
|
843 |
-
file_contents = file_contents.replace(/\[filesubheaderadminmessage_display\]/g, "style=\"display:none;\"");
|
844 |
-
file_contents = file_contents.replace(/\[filesubheader_adminmessage\]/g, Params[i].admin_messages);
|
845 |
-
// put file contents to temp div element to convert them to HTML elements
|
846 |
-
file_contents = "<table><tbody>" + file_contents + "</tbody></table>"; //IE6 fix: door is a div element so that innerHTML is writable
|
847 |
-
door.innerHTML = file_contents;
|
848 |
-
// post process created file block to adjust visibility of its contents
|
849 |
-
headerspan = 1;
|
850 |
-
subheaderspan = 2;
|
851 |
-
subheader_show = false;
|
852 |
-
file_block = document.getElementById('wfu_messageblock_' + sid + '_' + ii);
|
853 |
-
if (G.files_count == 1) {
|
854 |
-
document.getElementById('wfu_messageblock_' + sid + '_filenumber_' + ii).style.display = "none";
|
855 |
-
document.getElementById('wfu_messageblock_subheader_' + sid + '_fileempty_' + ii).style.display = "none";
|
856 |
-
if (single_file_shown) file_block.style.display = "";
|
857 |
-
else file_block.style.display = subheader_state.value;
|
858 |
-
headerspan ++;
|
859 |
-
subheaderspan ++;
|
860 |
-
}
|
861 |
-
else file_block.style.display = subheader_state.value;
|
862 |
-
if (Params[i].message != "") {
|
863 |
-
document.getElementById('wfu_messageblock_subheader_' + sid + '_message_' + ii).style.display = "";
|
864 |
-
subheader_show = true;
|
865 |
-
}
|
866 |
-
if (Params[i].admin_messages != "") {
|
867 |
-
document.getElementById('wfu_messageblock_subheader_' + sid + '_adminmessage_' + ii).style.display = "";
|
868 |
-
subheader_show = true;
|
869 |
-
}
|
870 |
-
if (!subheader_show) {
|
871 |
-
document.getElementById('wfu_messageblock_arrow_' + sid + '_' + ii).style.display = "none";
|
872 |
-
headerspan ++;
|
873 |
-
}
|
874 |
-
document.getElementById('wfu_messageblock_header_' + sid + '_container_' + ii).colSpan = headerspan;
|
875 |
-
document.getElementById('wfu_messageblock_subheader_' + sid + '_container_' + ii).colSpan = subheaderspan;
|
876 |
-
// move file block inside message block
|
877 |
-
while (next_block_id < ii) {
|
878 |
-
next_block = next_block.nextSibling;
|
879 |
-
if (next_block == null) break;
|
880 |
-
if (next_block.nodeType === 1) next_block_id = next_block.id.substr(next_block.id.lastIndexOf("_") + 1);
|
881 |
-
}
|
882 |
-
message_table.tBodies[0].insertBefore(file_block, next_block);
|
883 |
-
next_block = file_block.nextSibling;
|
884 |
-
file_block = document.getElementById('wfu_messageblock_subheader_' + sid + '_' + ii);
|
885 |
-
message_table.tBodies[0].insertBefore(file_block, next_block);
|
886 |
-
next_block = file_block;
|
887 |
-
next_block_id = ii;
|
888 |
-
}
|
889 |
-
if (single_file_shown) document.getElementById('wfu_messageblock_' + sid + '_1').style.display = "";
|
890 |
-
message_table.style.display = "";
|
891 |
-
document.getElementById('wordpress_file_upload_message_' + sid).style.display = "";
|
892 |
-
}
|
893 |
-
if (do_redirect) wfu_Redirect(G.redirect_link);
|
894 |
-
|
895 |
-
return G.last;
|
896 |
-
}
|
897 |
-
|
898 |
-
//wfu_uploadFailed: function that is called if uploading fails
|
899 |
-
function wfu_uploadFailed(evt) {
|
900 |
-
// alert(this.error_message_failed);
|
901 |
-
}
|
902 |
-
|
903 |
-
//wfu_uploadCanceled: function that is called if uploading is cancelled
|
904 |
-
function wfu_uploadCanceled(evt) {
|
905 |
-
// alert(this.error_message_cancelled);
|
906 |
-
}
|
907 |
-
|
908 |
-
//wfu_Initialize_Params: function that creates an object with default parameters used for generation of message box
|
909 |
-
function wfu_Initialize_Params() {
|
910 |
-
var params = {};
|
911 |
-
params.version = "full";
|
912 |
-
params.general = {};
|
913 |
-
params.general.shortcode_id = 0;
|
914 |
-
params.general.unique_id = "";
|
915 |
-
params.general.state = 0;
|
916 |
-
params.general.files_count = 0;
|
917 |
-
params.general.update_wpfilebase = "";
|
918 |
-
params.general.redirect_link = "";
|
919 |
-
params.general.upload_finish_time = 0;
|
920 |
-
params.general.message = "";
|
921 |
-
params.general.message_type = "";
|
922 |
-
params.general.admin_messages = {};
|
923 |
-
params.general.admin_messages.wpfilebase = "";
|
924 |
-
params.general.admin_messages.notify = "";
|
925 |
-
params.general.admin_messages.redirect = "";
|
926 |
-
params.general.admin_messages.other = "";
|
927 |
-
params.general.errors = {};
|
928 |
-
params.general.errors.wpfilebase = "";
|
929 |
-
params.general.errors.notify = "";
|
930 |
-
params.general.errors.redirect = "";
|
931 |
-
params.general.color = "";
|
932 |
-
params.general.bgcolor = "";
|
933 |
-
params.general.borcolor = "";
|
934 |
-
params.general.notify_only_filename_list = "";
|
935 |
-
params.general.notify_target_path_list = "";
|
936 |
-
params.general.notify_attachment_list = "";
|
937 |
-
params.general.fail_message = "";
|
938 |
-
params.general.fail_admin_message = "";
|
939 |
-
|
940 |
-
return params;
|
941 |
-
}
|
942 |
-
|
943 |
-
//wfu_redirect_to_classic: function that switches to classic functionality (HTML upload form) if HTML5 is not supported
|
944 |
-
function wfu_redirect_to_classic(sid, session_token, flag, adminerrorcode) {
|
945 |
-
|
946 |
-
//check if file has been selected or not
|
947 |
-
if (wfu_filesselected(sid) == 0) return;
|
948 |
-
|
949 |
-
//check if a subfolder has been selected (in case askforsubfolders is on)
|
950 |
-
if (!wfu_selectsubdir_check(sid)) return;
|
951 |
-
|
952 |
-
// check if there are empty user data fields that are required
|
953 |
-
if (!wfu_check_required_userdata(sid)) return;
|
954 |
-
|
955 |
-
wfu_redirect_to_classic_cont(sid, session_token, flag, adminerrorcode, [""]);
|
956 |
-
}
|
957 |
-
|
958 |
-
//wfu_redirect_to_classic_cont: function thatinforms the page to process the file after reloading, informs the page if this is a redirection from HTML5 to classic functionality and submits the file
|
959 |
-
function wfu_redirect_to_classic_cont(sid, session_token, flag, adminerrorcode, other_params) {
|
960 |
-
var process_function = function(responseText) {
|
961 |
-
if (responseText.indexOf("wfu_response_success:") > -1) {
|
962 |
-
// show message in wait for upload state
|
963 |
-
var Params = wfu_Initialize_Params();
|
964 |
-
Params.general.shortcode_id = sid;
|
965 |
-
Params.general.unique_id = "";
|
966 |
-
Params.general.files_count = wfu_filesselected(sid);
|
967 |
-
wfu_ProcessUploadComplete(sid, 0, Params, "no-ajax", "", session_token, "", ["false", "", "false"]);
|
968 |
-
|
969 |
-
if (flag == 1) {
|
970 |
-
var suffice = "";
|
971 |
-
document.getElementById('upfile_' + sid).name = 'uploadedfile_' + sid + '_redirected' + suffice;
|
972 |
-
}
|
973 |
-
if (adminerrorcode > 0) document.getElementById('adminerrorcodes_' + sid).value = adminerrorcode;
|
974 |
-
else document.getElementById('adminerrorcodes_' + sid).value = "";
|
975 |
-
document.getElementById('upfile_' + sid).disabled = false;
|
976 |
-
// set the unique identifier of the current upload
|
977 |
-
document.getElementById('uniqueuploadid_' + sid).value = wfu_randomString(20);
|
978 |
-
document.getElementById('uploadform_' + sid).submit();
|
979 |
-
}
|
980 |
-
}
|
981 |
-
|
982 |
-
var pass_params = "";
|
983 |
-
var d = new Date();
|
984 |
-
var url = GlobalData.consts.response_url + "?shortcode_id=" + sid + "&start_time=" + d.getTime() + "&session_token=" + session_token + pass_params;
|
985 |
-
|
986 |
-
// disable controls
|
987 |
-
wfu_lock_upload(sid);
|
988 |
-
|
989 |
-
//dispatch of GET request using AJAX asynchronous call
|
990 |
-
var xmlhttp = wfu_GetHttpRequestObject();
|
991 |
-
if (xmlhttp == null) {
|
992 |
-
//alternative way of sending GET request using IFRAME, in case AJAX is disabled
|
993 |
-
var i = document.createElement("iframe");
|
994 |
-
if (i) {
|
995 |
-
i.style.display = "none";
|
996 |
-
i.src = url;
|
997 |
-
document.body.appendChild(i);
|
998 |
-
i.onload = function() {
|
999 |
-
process_function(i.contentDocument.body.innerHTML);
|
1000 |
-
}
|
1001 |
-
return;
|
1002 |
-
}
|
1003 |
-
else {
|
1004 |
-
return;
|
1005 |
-
}
|
1006 |
-
}
|
1007 |
-
|
1008 |
-
xmlhttp.open("GET", url, true);
|
1009 |
-
xmlhttp.onreadystatechange=function() {
|
1010 |
-
if (xmlhttp.readyState==4) {
|
1011 |
-
if ( xmlhttp.status == 200 ) {
|
1012 |
-
process_function(xmlhttp.responseText);
|
1013 |
-
}
|
1014 |
-
}
|
1015 |
-
}
|
1016 |
-
xmlhttp.send(null);
|
1017 |
-
}
|
1018 |
-
|
1019 |
-
|
1020 |
-
function wfu_filesselected(sid) {
|
1021 |
-
var inputfile = document.getElementById("upfile_" + sid);
|
1022 |
-
var ftext = document.getElementById("fileName_" + sid);
|
1023 |
-
var farr = inputfile.files;
|
1024 |
-
//fix in case files attribute is not supported
|
1025 |
-
if (!farr) { if (inputfile.value) farr = [{name:inputfile.value}]; else farr = []; }
|
1026 |
-
if (typeof inputfile.filearray != "undefined") farr = inputfile.filearray;
|
1027 |
-
|
1028 |
-
if (farr.length == 0) {
|
1029 |
-
if (ftext) {
|
1030 |
-
ftext.value = GlobalData.consts.nofilemessage;
|
1031 |
-
ftext.className = "file_input_textbox_nofile";
|
1032 |
-
}
|
1033 |
-
}
|
1034 |
-
return farr.length;
|
1035 |
-
}
|
1036 |
-
|
1037 |
-
//wfu_check_required_userdata: check if there are required user fields that are empty
|
1038 |
-
function wfu_check_required_userdata(sid) {
|
1039 |
-
var userdata_count = wfu_get_userdata_count(sid);
|
1040 |
-
var req_empty = false;
|
1041 |
-
for (var i = 0; i < userdata_count; i++) {
|
1042 |
-
var msg_hid = document.getElementById('hiddeninput_' + sid + '_userdata_' + i);
|
1043 |
-
var msg = document.getElementById('userdata_' + sid + '_message_' + i);
|
1044 |
-
var req_class = "file_userdata_message_required";
|
1045 |
-
if (msg.className.substr(0, req_class.length) == req_class && msg_hid.value == "") {
|
1046 |
-
msg.className = req_class + "_empty";
|
1047 |
-
msg.value = GlobalData.consts.userdata_empty;
|
1048 |
-
req_empty = true;
|
1049 |
-
}
|
1050 |
-
}
|
1051 |
-
return !req_empty;
|
1052 |
-
}
|
1053 |
-
|
1054 |
-
//wfu_HTML5UploadFile: function that is called if the plugin is not using classic functionality
|
1055 |
-
function wfu_HTML5UploadFile(sid, JSONtext, session_token) {
|
1056 |
-
//redirect to classic if AJAX is not supported
|
1057 |
-
if (!wfu_BrowserCaps.supportsAJAX) {
|
1058 |
-
wfu_redirect_to_classic(sid, session_token, 1, 1);
|
1059 |
-
return;
|
1060 |
-
}
|
1061 |
-
//redirect to classic if HTML5 is not supported
|
1062 |
-
if (!wfu_BrowserCaps.supportsHTML5) {
|
1063 |
-
wfu_redirect_to_classic(sid, session_token, 1, 2);
|
1064 |
-
return;
|
1065 |
-
}
|
1066 |
-
//get plugin params and redirect to classic if JSON decoding fails
|
1067 |
-
JSONtext = wfu_plugin_decode_string(JSONtext.replace(/^\s+|\s+$/g,""));
|
1068 |
-
var JSONobj = null;
|
1069 |
-
try {
|
1070 |
-
JSONobj = JSON.parse(JSONtext);
|
1071 |
-
}
|
1072 |
-
catch(e) {}
|
1073 |
-
if (JSONobj == null) {
|
1074 |
-
wfu_redirect_to_classic(sid, session_token, 1, 3);
|
1075 |
-
return;
|
1076 |
-
}
|
1077 |
-
var xhr = wfu_GetHttpRequestObject();
|
1078 |
-
if (xhr == null) return;
|
1079 |
-
|
1080 |
-
//check if file has been selected or not
|
1081 |
-
var numfiles = wfu_filesselected(sid);
|
1082 |
-
if (numfiles == 0) return;
|
1083 |
-
|
1084 |
-
//check if a subfolder has been selected (in case askforsubfolders is on)
|
1085 |
-
if (!wfu_selectsubdir_check(sid)) return;
|
1086 |
-
|
1087 |
-
//calculate number of passes from number of files
|
1088 |
-
var numpasses = numfiles;
|
1089 |
-
//reconsider numpasses and include also the check passes
|
1090 |
-
numpasses += numpasses;
|
1091 |
-
|
1092 |
-
// check if there are empty user data fields that are required
|
1093 |
-
if (!wfu_check_required_userdata(sid)) return;
|
1094 |
-
|
1095 |
-
wfu_HTML5UploadFile_cont(sid, JSONobj, session_token, [""]);
|
1096 |
-
}
|
1097 |
-
|
1098 |
-
function wfu_HTML5UploadFile_cont(sid, JSONobj, session_token, other_params) {
|
1099 |
-
//inner function sendfile sends file data to the server using ajax
|
1100 |
-
function sendfile(ind, file, only_check, force_close_connection) {
|
1101 |
-
//initialize return status, used in case of synchronous call
|
1102 |
-
ret_status = true;
|
1103 |
-
// initialise AJAX and FormData objects
|
1104 |
-
var xhr = wfu_GetHttpRequestObject();
|
1105 |
-
var xhr_close_connection = wfu_GetHttpRequestObject();
|
1106 |
-
if (xhr == null || xhr_close_connection == null) return;
|
1107 |
-
var fd = null;
|
1108 |
-
var fd_close_connection = null;
|
1109 |
-
try {
|
1110 |
-
var fd = new FormData();
|
1111 |
-
var fd_close_connection = new FormData();
|
1112 |
-
}
|
1113 |
-
catch(e) {}
|
1114 |
-
if (fd == null || fd_close_connection == null) return;
|
1115 |
-
|
1116 |
-
// define POST parameters
|
1117 |
-
if (!only_check) fd.append("uploadedfile_" + sid + suffice, file);
|
1118 |
-
fd.append("uploadedfile_" + sid + "_index", ind);
|
1119 |
-
fd.append("uploadedfile_" + sid + "_name", wfu_plugin_encode_string(farr[ind].name));
|
1120 |
-
fd.append("uploadedfile_" + sid + "_size", farr[ind].size);
|
1121 |
-
fd.append("action", "wfu_ajax_action");
|
1122 |
-
fd.append("uniqueuploadid_" + sid, unique_upload_id);
|
1123 |
-
fd.append("params_index", JSONobj.params_index);
|
1124 |
-
fd.append("subdir_sel_index", subdir_sel_index);
|
1125 |
-
if (only_check) fd.append("only_check", "1");
|
1126 |
-
else fd.append("only_check", "0");
|
1127 |
-
fd.append("session_token", session_token);
|
1128 |
-
fd.append("unique_id", rand_str);
|
1129 |
-
var userdata_count = wfu_get_userdata_count(sid);
|
1130 |
-
for (var ii = 0; ii < userdata_count; ii++)
|
1131 |
-
fd.append("hiddeninput_" + sid + "_userdata_" + ii, document.getElementById('hiddeninput_' + sid + '_userdata_' + ii).value);
|
1132 |
-
|
1133 |
-
// define variables
|
1134 |
-
var xhrid = GlobalData[sid].xhrs.push(xhr) - 1;
|
1135 |
-
var d = new Date();
|
1136 |
-
xhr.shortcode_id = sid;
|
1137 |
-
xhr.requesttype = "fileupload";
|
1138 |
-
xhr.file_id = ind + 1;
|
1139 |
-
if (only_check) {
|
1140 |
-
xhr.size = 0;
|
1141 |
-
xhr.totalsize = 0;
|
1142 |
-
}
|
1143 |
-
else {
|
1144 |
-
xhr.size = file.size;
|
1145 |
-
xhr.totalsize = farr[ind].size;
|
1146 |
-
}
|
1147 |
-
xhr.sizeloaded = 0;
|
1148 |
-
xhr.unique_id = rand_str;
|
1149 |
-
xhr.params_index = JSONobj.params_index;
|
1150 |
-
xhr.session_token = session_token;
|
1151 |
-
xhr.debugmode = JSONobj.debugmode;
|
1152 |
-
xhr.is_admin = JSONobj.is_admin;
|
1153 |
-
xhr.finish_time = d.getTime() + parseInt(GlobalData.consts.max_time_limit) * 1000;
|
1154 |
-
xhr.fail_colors = JSONobj.fail_colors;
|
1155 |
-
// xhr.error_message_header = GlobalData.consts.message_header.replace(/%username%/g, "no data");
|
1156 |
-
xhr.error_message_header = JSONobj.error_header.replace(/%username%/g, "no data");
|
1157 |
-
xhr.error_message_header = xhr.error_message_header.replace(/%useremail%/g, "no data");
|
1158 |
-
xhr.error_message_header = xhr.error_message_header.replace(/%filename%/g, farr[ind].name);
|
1159 |
-
xhr.error_message_header = xhr.error_message_header.replace(/%filepath%/g, farr[ind].name);
|
1160 |
-
xhr.error_message_failed = GlobalData.consts.message_failed;
|
1161 |
-
xhr.error_message_cancelled = GlobalData.consts.message_cancelled;
|
1162 |
-
xhr.error_adminmessage_unknown = GlobalData.consts.adminmessage_unknown.replace(/%username%/g, "no data");
|
1163 |
-
xhr.error_adminmessage_unknown = xhr.error_adminmessage_unknown.replace(/%useremail%/g, "no data");
|
1164 |
-
xhr.error_adminmessage_unknown = xhr.error_adminmessage_unknown.replace(/%filename%/g, farr[ind].name);
|
1165 |
-
xhr.error_adminmessage_unknown = xhr.error_adminmessage_unknown.replace(/%filepath%/g, farr[ind].name);
|
1166 |
-
//when using Safari a synchronous call must be executed before upload to close previous connection,
|
1167 |
-
//in order to address an issue of Safari with file caching
|
1168 |
-
if (force_close_connection) {
|
1169 |
-
fd_close_connection.append("action", "wfu_ajax_action");
|
1170 |
-
fd_close_connection.append("params_index", JSONobj.params_index);
|
1171 |
-
fd_close_connection.append("session_token", session_token);
|
1172 |
-
fd_close_connection.append("force_connection_close", "1");
|
1173 |
-
xhr_close_connection.open("POST", GlobalData.consts.ajax_url, false);
|
1174 |
-
xhr_close_connection.send(fd_close_connection);
|
1175 |
-
ret_status = (xhr_close_connection.responseText == "success");
|
1176 |
-
}
|
1177 |
-
if (ret_status) {
|
1178 |
-
if (!only_check) {
|
1179 |
-
xhr.upload.xhr = xhr;
|
1180 |
-
xhr.upload.dummy = 1;
|
1181 |
-
// event listeners
|
1182 |
-
xhr.upload.addEventListener("loadstart", wfu_loadStart, false);
|
1183 |
-
xhr.upload.addEventListener("progress", new Function("evt", "wfu_uploadProgress(evt, " + sid + ", " + xhrid + ", " + JSONobj.debugmode + ");"), false);
|
1184 |
-
xhr.addEventListener("load", wfu_uploadComplete, false);
|
1185 |
-
xhr.addEventListener("error", wfu_uploadFailed, false);
|
1186 |
-
xhr.addEventListener("abort", wfu_uploadCanceled, false);
|
1187 |
-
|
1188 |
-
xhr.open("POST", GlobalData.consts.ajax_url, true);
|
1189 |
-
xhr.send(fd);
|
1190 |
-
}
|
1191 |
-
else {
|
1192 |
-
xhr.addEventListener("load", function(evt) {
|
1193 |
-
evt = {target:{responseText:evt.target.responseText, shortcode_id:sid, return_status:true}};
|
1194 |
-
var file_status = wfu_uploadComplete.call(xhr, evt);
|
1195 |
-
ret_status = (file_status == "success" || file_status == "warning");
|
1196 |
-
if (ret_status) {
|
1197 |
-
sendfile(ind, file, false, false);
|
1198 |
-
}
|
1199 |
-
}, false);
|
1200 |
-
xhr.open("POST", GlobalData.consts.ajax_url, true);
|
1201 |
-
xhr.send(fd);
|
1202 |
-
}
|
1203 |
-
}
|
1204 |
-
else {
|
1205 |
-
var evt = {target:{responseText:"", shortcode_id:sid}};
|
1206 |
-
wfu_uploadComplete.call(xhr, evt);
|
1207 |
-
}
|
1208 |
-
inc ++;
|
1209 |
-
return ret_status;
|
1210 |
-
}
|
1211 |
-
//inner function process_next_file prepares and dispatches files in a sequential manner,
|
1212 |
-
//every function is executed from its previous using timeouts in order to allow rendering
|
1213 |
-
//of graphics in between, such as progress bars
|
1214 |
-
function process_next_file() {
|
1215 |
-
sendfile(i, farr[i], true, false);
|
1216 |
-
//continue to next file, if exists
|
1217 |
-
i++;
|
1218 |
-
if(i < farr.length) setTimeout(process_next_file, 100);
|
1219 |
-
}
|
1220 |
-
// get index of subdirectory if subdirectory dropdown list is activated
|
1221 |
-
var subdir_sel_index = -1;
|
1222 |
-
if (document.getElementById('selectsubdir_' + sid) != null)
|
1223 |
-
subdir_sel_index = document.getElementById('selectsubdir_' + sid).selectedIndex;
|
1224 |
-
|
1225 |
-
// get file list
|
1226 |
-
var inputfile = document.getElementById("upfile_" + sid);
|
1227 |
-
var farr = inputfile.files;
|
1228 |
-
// fix in case files attribute is not supported
|
1229 |
-
if (!farr) { if (inputfile.value) farr = [{name:inputfile.value}]; else farr = []; }
|
1230 |
-
if (typeof inputfile.filearray != "undefined") farr = inputfile.filearray;
|
1231 |
-
var suffice = "";
|
1232 |
-
// set the unique identifier of the current upload
|
1233 |
-
var unique_upload_id = wfu_randomString(20);
|
1234 |
-
/* initialize global object to hold dynamic upload status during upload */
|
1235 |
-
var rand_str = wfu_randomString(10);
|
1236 |
-
GlobalData[sid] = {};
|
1237 |
-
GlobalData[sid].unique_id = rand_str;
|
1238 |
-
GlobalData[sid].last = false;
|
1239 |
-
GlobalData[sid].files_count = farr.length;
|
1240 |
-
GlobalData[sid].files_processed = 0;
|
1241 |
-
GlobalData[sid].upload_state = 0;
|
1242 |
-
GlobalData[sid].message = "";
|
1243 |
-
GlobalData[sid].update_wpfilebase = "";
|
1244 |
-
GlobalData[sid].redirect_link = "";
|
1245 |
-
GlobalData[sid].notify_only_filename_list = "";
|
1246 |
-
GlobalData[sid].notify_target_path_list = "";
|
1247 |
-
GlobalData[sid].notify_attachment_list = "";
|
1248 |
-
GlobalData[sid].admin_messages = {};
|
1249 |
-
GlobalData[sid].admin_messages.wpfilebase = "";
|
1250 |
-
GlobalData[sid].admin_messages.notify = "";
|
1251 |
-
GlobalData[sid].admin_messages.redirect = "";
|
1252 |
-
GlobalData[sid].admin_messages.debug = "";
|
1253 |
-
GlobalData[sid].admin_messages.other = "";
|
1254 |
-
GlobalData[sid].errors = {};
|
1255 |
-
GlobalData[sid].errors.wpfilebase = "";
|
1256 |
-
GlobalData[sid].errors.notify = "";
|
1257 |
-
GlobalData[sid].errors.redirect = "";
|
1258 |
-
GlobalData[sid].xhrs = Array();
|
1259 |
-
|
1260 |
-
wfu_show_simple_progressbar(JSONobj.shortcode_id, "progressive");
|
1261 |
-
|
1262 |
-
// show message in wait for upload state
|
1263 |
-
var Params = wfu_Initialize_Params();
|
1264 |
-
Params.general.shortcode_id = sid;
|
1265 |
-
Params.general.unique_id = rand_str;
|
1266 |
-
wfu_ProcessUploadComplete(sid, 0, Params, rand_str, JSONobj.params_index, session_token, "", ["false", "", "false"]);
|
1267 |
-
|
1268 |
-
var inc = 0;
|
1269 |
-
var ret_status = true;
|
1270 |
-
var i = 0;
|
1271 |
-
var fprops = [];
|
1272 |
-
setTimeout(process_next_file, 100);
|
1273 |
-
}
|
1274 |
-
|
1275 |
-
//wfu_get_userdata_count: get number of userdata fields
|
1276 |
-
function wfu_get_userdata_count(sid) {
|
1277 |
-
var fields_count = 0;
|
1278 |
-
while (document.getElementById('userdata_' + sid + '_' + fields_count)) fields_count ++;
|
1279 |
-
return fields_count;
|
1280 |
-
}
|
1281 |
-
|
1282 |
-
function wfu_lock_upload(sid) {
|
1283 |
-
var textbox = document.getElementById('fileName_' + sid);
|
1284 |
-
if (textbox) textbox.disabled = true;
|
1285 |
-
document.getElementById('input_' + sid).disabled = true;
|
1286 |
-
document.getElementById('upfile_' + sid).disabled = true;
|
1287 |
-
var subdir = document.getElementById('selectsubdir_' + sid);
|
1288 |
-
if (subdir) subdir.disabled = true;
|
1289 |
-
var upload = document.getElementById('upload_' + sid);
|
1290 |
-
if (upload) upload.disabled = true;
|
1291 |
-
var userdata_count = wfu_get_userdata_count(sid);
|
1292 |
-
for (var i = 0; i < userdata_count; i++)
|
1293 |
-
document.getElementById('userdata_' + sid + '_message_' + i).disabled = true;
|
1294 |
-
}
|
1295 |
-
|
1296 |
-
function wfu_unlock_upload(sid) {
|
1297 |
-
var textbox = document.getElementById('fileName_' + sid);
|
1298 |
-
if (textbox) textbox.disabled = false;
|
1299 |
-
document.getElementById('input_' + sid).disabled = false;
|
1300 |
-
document.getElementById('upfile_' + sid).disabled = false;
|
1301 |
-
var subdir = document.getElementById('selectsubdir_' + sid);
|
1302 |
-
if (subdir) subdir.disabled = false;
|
1303 |
-
var upload = document.getElementById('upload_' + sid);
|
1304 |
-
if (upload) upload.disabled = false;
|
1305 |
-
var userdata_count = wfu_get_userdata_count(sid);
|
1306 |
-
for (var i = 0; i < userdata_count; i++)
|
1307 |
-
document.getElementById('userdata_' + sid + '_message_' + i).disabled = false;
|
1308 |
-
}
|
1309 |
-
|
1310 |
-
function wfu_clear(sid) {
|
1311 |
-
document.getElementById("uploadform_" + sid).reset();
|
1312 |
-
var textbox = document.getElementById('fileName_' + sid);
|
1313 |
-
if (textbox) {
|
1314 |
-
textbox.value = '';
|
1315 |
-
textbox.className = 'file_input_textbox';
|
1316 |
-
}
|
1317 |
-
var subdir = document.getElementById('selectsubdir_' + sid);
|
1318 |
-
if (subdir) subdir.selectedIndex = parseInt(document.getElementById('selectsubdirdefault_' + sid).value);
|
1319 |
-
var userdata_count = wfu_get_userdata_count(sid);
|
1320 |
-
for (var i = 0; i < userdata_count; i++) {
|
1321 |
-
document.getElementById('userdata_' + sid + '_message_' + i).value = "";
|
1322 |
-
document.getElementById('hiddeninput_' + sid + '_userdata_' + i).value = "";
|
1323 |
-
}
|
1324 |
-
}
|
1325 |
-
|
1326 |
-
function wfu_reset_message(sid) {
|
1327 |
-
var message_table = document.getElementById('wfu_messageblock_' + sid);
|
1328 |
-
if (message_table) {
|
1329 |
-
// reset header
|
1330 |
-
document.getElementById('wfu_messageblock_header_' + sid).style.display = "";
|
1331 |
-
var header_container = document.getElementById('wfu_messageblock_header_' + sid + '_container');
|
1332 |
-
if (UploadStates[sid]) header_container.innerHTML = UploadStates[sid]["State0"];
|
1333 |
-
document.getElementById('wfu_messageblock_header_' + sid + '_state').value = "none";
|
1334 |
-
document.getElementById('wfu_messageblock_arrow_' + sid).style.display = "none";
|
1335 |
-
header_container.colSpan = 3;
|
1336 |
-
// reset subheader
|
1337 |
-
document.getElementById('wfu_messageblock_subheader_' + sid + '_messagelabel').innerHTML = "";
|
1338 |
-
document.getElementById('wfu_messageblock_subheader_' + sid + '_adminmessagelabel').innerHTML = "";
|
1339 |
-
document.getElementById('wfu_messageblock_subheader_' + sid).style.display = "none";
|
1340 |
-
document.getElementById('wfu_messageblock_subheader_' + sid + '_message').style.display = "none";
|
1341 |
-
document.getElementById('wfu_messageblock_subheader_' + sid + '_adminmessage').style.display = "none";
|
1342 |
-
// reset files
|
1343 |
-
var file_array = wfu_get_file_ids(sid);
|
1344 |
-
for (var i = 1; i <= file_array.length; i++) {
|
1345 |
-
message_table.tBodies[0].removeChild(document.getElementById('wfu_messageblock_' + sid + '_' + i));
|
1346 |
-
message_table.tBodies[0].removeChild(document.getElementById('wfu_messageblock_subheader_' + sid + '_' + i));
|
1347 |
-
}
|
1348 |
-
}
|
1349 |
-
}
|
1350 |
-
|
1351 |
-
|
1352 |
-
function wfu_show_simple_progressbar(sid, effect) {
|
1353 |
-
|
1354 |
-
var bar = document.getElementById('progressbar_' + sid + '_animation');
|
1355 |
-
var barsafe = document.getElementById('progressbar_' + sid + '_imagesafe');
|
1356 |
-
if (bar) {
|
1357 |
-
if (effect == "progressive") {
|
1358 |
-
bar.style.width = "0%";
|
1359 |
-
bar.className = "file_progress_progressive";
|
1360 |
-
barsafe.style.display = "none";
|
1361 |
-
bar.style.display = "block";
|
1362 |
-
}
|
1363 |
-
else if (wfu_BrowserCaps.supportsAnimation) {
|
1364 |
-
bar.style.width = "25%";
|
1365 |
-
bar.className = "file_progress_shuffle";
|
1366 |
-
barsafe.style.display = "none";
|
1367 |
-
bar.style.display = "block";
|
1368 |
-
}
|
1369 |
-
else {
|
1370 |
-
bar.style.width = "0%";
|
1371 |
-
bar.className = "file_progress_noanimation";
|
1372 |
-
bar.style.display = "none";
|
1373 |
-
barsafe.style.display = "block";
|
1374 |
-
}
|
1375 |
-
document.getElementById('wordpress_file_upload_progressbar_' + sid).style.display = "block";
|
1376 |
-
}
|
1377 |
-
}
|
1378 |
-
|
1379 |
-
function wfu_hide_simple_progressbar(sid) {
|
1380 |
-
var bar = document.getElementById('progressbar_' + sid + '_animation');
|
1381 |
-
var barsafe = document.getElementById('progressbar_' + sid + '_imagesafe');
|
1382 |
-
if (bar) {
|
1383 |
-
document.getElementById('wordpress_file_upload_progressbar_' + sid).style.display = "none";
|
1384 |
-
bar.style.width = "0%";
|
1385 |
-
bar.className = "file_progress_noanimation";
|
1386 |
-
barsafe.style.display = "none";
|
1387 |
-
bar.style.display = "block";
|
1388 |
-
}
|
1389 |
-
}
|
1390 |
-
|
1391 |
-
|
1 |
+
function wfu_Initialize_Consts(e){if("undefined"==typeof GlobalData.consts){GlobalData.consts=new Object;for(var a=e.split(";"),t=0;t<a.length;t++)const_txt=a[t].split(":"),GlobalData.consts[wfu_plugin_decode_string(const_txt[0])]=wfu_plugin_decode_string(const_txt[1])}}function wfu_install_unload_hook(){window.onbeforeunload=wfu_unload_hook}function wfu_unload_hook(){return""!=GlobalData.UploadInProgressString.trim()?GlobalData.consts.wfu_pageexit_prompt:void 0}function wfu_Check_Browser_Capabilities(){if("undefined"==typeof wfu_BrowserCaps){wfu_BrowserCaps=new Object;var e=wfu_GetHttpRequestObject();wfu_BrowserCaps.supportsAJAX=null!=e,wfu_BrowserCaps.supportsUploadProgress=!!(e&&"upload"in e&&"onprogress"in e.upload);var a=null;try{var a=new FormData}catch(t){}wfu_BrowserCaps.supportsHTML5=null!=a;var t=document.createElement("iframe");wfu_BrowserCaps.supportsIFRAME=null!=t,wfu_BrowserCaps.supportsDRAGDROP=window.FileReader?!0:!1,wfu_BrowserCaps.supportsAnimation=wfu_check_animation(),wfu_BrowserCaps.isSafari=Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>0}}function wfu_check_animation(){var e=!1,a="animation",t="",s="Webkit Moz O ms Khtml".split(" "),n="",r=document.createElement("DIV");if(r.style.animationName&&(e=!0),e===!1)for(var l=0;l<s.length;l++)if(void 0!==r.style[s[l]+"AnimationName"]){n=s[l],a=n+"Animation",t="-"+n.toLowerCase()+"-",e=!0;break}return e}function wfu_join_strings(e){for(var a=[].slice.call(arguments),t="",s="",n=1;n<a.length;n++)s=""==t||""==a[n]?"":e,t+=s+a[n];return t}function wfu_plugin_decode_string(e){for(var a,t,s=0,n="";s<e.length;)a=parseInt(e.substr(s,2),16),t=128>a?a:224>a?((31&a)<<6)+(63&parseInt(e.substr(s+=2,2),16)):((15&a)<<12)+((63&parseInt(e.substr(s+=2,2),16))<<6)+(63&parseInt(e.substr(s+=2,2),16)),n+=String.fromCharCode(t),s+=2;return n}function wfu_plugin_encode_string(e){var a=0,t="",s="";for(a=0;a<e.length;a++)num=e.charCodeAt(a),num>=2048?num=((16773120&num|917504)<<4)+((4032&num|8192)<<2)+(63&num|128):num>=128&&(num=((65472&num|12288)<<2)+(63&num|128)),s=num.toString(16),(1==s.length||3==s.length||5==s.length)&&(s="0"+s),t+=s;return t}function wfu_randomString(e){for(var a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",t=e,s="",n=0;t>n;n++){var r=Math.floor(Math.random()*a.length);s+=a.substring(r,r+1)}return s}function wfu_addEventHandler(e,a,t){e.addEventListener?e.addEventListener(a,t,!1):e.attachEvent?e.attachEvent("on"+a,t):e["on"+a]=t}function wfu_GetHttpRequestObject(){var e=null;try{e=new XMLHttpRequest}catch(a){try{e=new ActiveXObject("Msxml2.XMLHTTP")}catch(t){try{e=new ActiveXObject("Microsoft.XMLHTTP")}catch(a){}}}if(null==e&&window.createRequest)try{xmlhttp=window.createRequest()}catch(a){}return e}function wfu_filedetails_showhide(e,a,t){var s=(document.getElementById("wfu_messageblock_arrow_"+e+"_"+a),document.getElementById("wfu_messageblock_arrow_"+e+"_up_"+a)),n=document.getElementById("wfu_messageblock_arrow_"+e+"_down_"+a),r=document.getElementById("wfu_messageblock_subheader_"+e+"_"+a),l=document.getElementById("wfu_messageblock_header_"+e+"_state_"+a);t?(s.style.display="",n.style.display="none",r.style.display="",l.value=""):(s.style.display="none",n.style.display="",r.style.display="none",l.value="none")}function wfu_get_file_ids(e){for(var a=(document.getElementById("wfu_messageblock_"+e),document.getElementById("wfu_messageblock_subheader_"+e).nextSibling),t="wfu_messageblock_"+e+"_",s=[];null!=a;)1===a.nodeType&&a.id.substr(0,t.length)==t&&s.push(a.id.substr(a.id.lastIndexOf("_")+1)),a=a.nextSibling;return s}function wfu_filedetails_toggle(e,a){var t=(document.getElementById("wfu_messageblock_arrow_"+e+"_"+a),document.getElementById("wfu_messageblock_arrow_"+e+"_up_"+a));wfu_filedetails_showhide(e,a,"none"==t.style.display)}function wfu_headerdetails_showhide(e,a){var t=(document.getElementById("wfu_messageblock_arrow_"+e),document.getElementById("wfu_messageblock_arrow_"+e+"_up")),s=document.getElementById("wfu_messageblock_arrow_"+e+"_down"),n=document.getElementById("wfu_messageblock_subheader_"+e),r=document.getElementById("wfu_messageblock_subheader_"+e+"_message"),l=document.getElementById("wfu_messageblock_subheader_"+e+"_adminmessage"),o=document.getElementById("wfu_messageblock_header_"+e+"_state"),i=wfu_get_file_ids(e);if(a){t.style.display="",s.style.display="none",("none"!=r.style.display||"none"!=l.style.display)&&(n.style.display=""),o.value="";for(var _=0;_<i.length;_++)document.getElementById("wfu_messageblock_"+e+"_"+i[_]).style.display="",document.getElementById("wfu_messageblock_subheader_"+e+"_"+i[_]).style.display=document.getElementById("wfu_messageblock_header_"+e+"_state_"+i[_]).value}else{t.style.display="none",s.style.display="",n.style.display="none",o.value="none";for(var _=0;_<i.length;_++)document.getElementById("wfu_messageblock_"+e+"_"+i[_]).style.display="none",document.getElementById("wfu_messageblock_subheader_"+e+"_"+i[_]).style.display="none"}}function wfu_headerdetails_toggle(e){var a=(document.getElementById("wfu_messageblock_arrow_"+e),document.getElementById("wfu_messageblock_arrow_"+e+"_up"));wfu_headerdetails_showhide(e,"none"==a.style.display)}function wfu_selectbutton_changed(e,a){wfu_BrowserCaps.supportsAJAX&&wfu_BrowserCaps.supportsHTML5||(a=0);var t=document.getElementById("upfile_"+e),s=t.files;s||(s=t.value?[{name:t.value}]:[]);var n=document.getElementById("fileName_"+e);if(n&&(n.value=t.value.replace(/c:\\fakepath\\/i,"")),1==a){"undefined"==typeof t.filearray&&(t.filearray=Array());for(var r=0;r<s.length;r++)t.filearray.push(s[r])}}function wfu_selectbutton_clicked(e){var a=document.getElementById("wordpress_file_upload_message_"+e);a&&(a.style.display="none"),wfu_reset_message(e),document.getElementById("upfile_"+e).value="";var t=document.getElementById("fileName_"+e);t&&(t.value="",t.className="file_input_textbox")}function wfu_selectsubdir_check(e){var a=document.getElementById("selectsubdir_"+e);return a?(document.getElementById("hiddeninput_"+e).value=a.selectedIndex,0==a.selectedIndex?(a.style.backgroundColor="red",!1):(a.style.backgroundColor="transparent",a.options[0].style.display="none",!0)):!0}function wfu_Redirect(e){window.location=e}function wfu_loadStart(){}function wfu_uploadProgress(e,a,t,s){s&&"undefined"==typeof this.xhr&&(console.log("total="+e.total+", loaded="+e.loaded),console.log(e));var n=GlobalData[a].xhrs[t],r=0,l=0,o=document.getElementById("progressbar_"+a+"_animation");if(e.lengthComputable){if(n.sizeloaded=e.loaded,n.size<e.total&&e.total>0){l=e.total-n.size,n.deltasize+=l,n.size+=l;for(var i=0;i<GlobalData[a].xhrs.length;i++)GlobalData[a].xhrs[i].file_id==n.file_id&&(GlobalData[a].xhrs[i].totalsize+=l)}if(o){for(var _=0,d=0,u=[],i=0;i<GlobalData[a].xhrs.length;i++)u[GlobalData[a].xhrs[i].file_id]=0;for(var i=0;i<GlobalData[a].xhrs.length;i++)u[GlobalData[a].xhrs[i].file_id]=Math.max(GlobalData[a].xhrs[i].totalsize,u[GlobalData[a].xhrs[i].file_id]);for(var i=0;i<u.length;i++)"undefined"!=typeof u[i]&&(_+=u[i]);for(var i=0;i<GlobalData[a].xhrs.length;i++)d+=GlobalData[a].xhrs[i].sizeloaded;r=Math.round(100*d/_),o.style.width=r.toString()+"%"}}else o&&(o.style.width="0%")}function wfu_notify_WPFilebase(e,a){var t=wfu_GetHttpRequestObject();if(null==t){var s=document.createElement("iframe");return s.style.display="none",s.src=GlobalData.consts.ajax_url+"?action=wfu_ajax_action_notify_wpfilebase¶ms_index="+e+"&session_token="+a,void document.body.appendChild(s)}var n=GlobalData.consts.ajax_url;params=new Array(3),params[0]=new Array(2),params[0][0]="action",params[0][1]="wfu_ajax_action_notify_wpfilebase",params[1]=new Array(2),params[1][0]="params_index",params[1][1]=e,params[2]=new Array(2),params[2][0]="session_token",params[2][1]=a;for(var r="",s=0;s<params.length;s++)r+=(s>0?"&":"")+params[s][0]+"="+encodeURI(params[s][1]);t.open("POST",n,!0),t.setRequestHeader("Content-type","application/x-www-form-urlencoded"),t.onreadystatechange=function(){},t.send(r)}function wfu_send_email_notification(e,a,t,s,n,r,l,o,i){var _=wfu_GetHttpRequestObject();if(null!=_){var d=GlobalData.consts.ajax_url,u=wfu_get_userdata_count(e);params=new Array(7+u),params[0]=new Array(2),params[0][0]="action",params[0][1]="wfu_ajax_action_send_email_notification",params[1]=new Array(2),params[1][0]="params_index",params[1][1]=t,params[2]=new Array(2),params[2][0]="session_token",params[2][1]=s,params[3]=new Array(2),params[3][0]="only_filename_list",params[3][1]=n,params[4]=new Array(2),params[4][0]="target_path_list",params[4][1]=r,params[5]=new Array(2),params[5][0]="attachment_list",params[5][1]=l,params[6]=new Array(2),params[6][0]="unique_id",params[6][1]=a;for(var m=0;u>m;m++)params[7+m]=new Array(2),params[7+m][0]="userdata_"+m,params[7+m][1]=wfu_plugin_encode_string(document.getElementById("hiddeninput_"+e+"_userdata_"+m).value);for(var c="",m=0;m<params.length;m++)c+=(m>0?"&":"")+params[m][0]+"="+encodeURI(params[m][1]);var g=new Date;_.xhrid=-1,_.shortcode_id=e,_.requesttype="email",_.file_id=0,_.loading=!1,_.aborted=!1,_.unique_id=a,_.debugmode=o,_.is_admin=i,_.params_index=t,_.session_token=s,_.start_time=g.getTime(),_.end_time=_.start_time,_.finish_time=_.start_time+1e3*parseInt(GlobalData.consts.max_time_limit),_.fail_colors=GlobalData.consts.fail_colors,_.error_message_header="",_.error_message_failed=GlobalData.consts.message_failed,_.error_message_cancelled=GlobalData.consts.message_cancelled,_.error_adminmessage_unknown="",_.open("POST",d,!0),_.setRequestHeader("Content-type","application/x-www-form-urlencoded"),_.addEventListener("load",wfu_uploadComplete,!1),_.addEventListener("error",wfu_uploadFailed,!1),_.addEventListener("abort",wfu_uploadCanceled,!1),_.send(c)}}function wfu_format_debug_data(e,a){return output='<label class="file_messageblock_subheader_debugmessage_label">',output+="Debug Data"+a,output+="</label>",output+='<div class="file_messageblock_subheader_debugmessage_container">',output+=e,output+="</div>"}function wfu_uploadComplete(e){var a=new Date,t=this.shortcode_id,s=(this.file_id,!1),n="",r="",l="unknown",o="",i="wfu_fileupload_success:";this.loading=!1,this.end_time=a.getTime();var _=e.target.responseText,d=_,u="error";if(-1!=_&&_.indexOf("force_errorabort_code")>-1&&(u="errorabort",_=_.replace("force_errorabort_code","")),-1!=_){var m=_.indexOf(i);if(m>-1&&("true"==this.debugmode&&(o=_.substr(0,m)),d=_.substr(m+i.length),m=d.indexOf(":"),r=d.substr(0,m),n=d.substr(m+1)),""!=o){var c="";"fileupload"==this.requesttype?c=" - File: "+this.file_id:"email"==this.requesttype&&(c=" - Email Notification"),o=wfu_format_debug_data(o,c)}if(""!=r){var g=r.split(";");if(1==parseInt(g[2])){var f=g[3].split(",");l=wfu_plugin_decode_string(f[0])}}}if(""==n||""==r){var p=this.fail_colors.split(","),y=wfu_Initialize_Params();y.general.shortcode_id=t,y.general.unique_id=this.unique_id,y.general.state=7,y.general.files_count="fileupload"==this.requesttype?1:0,y.general.upload_finish_time=this.finish_time,y.general.fail_message=GlobalData.consts.message_unknown,y.general.fail_admin_message=wfu_join_strings("<br />",this.error_adminmessage_unknown,this.requesttype+":"+d),y.general.files_count>0?(y[0]={},y[0].color=p[0],y[0].bgcolor=p[1],y[0].borcolor=p[2],y[0].message_type=u,l=u,y[0].header=this.error_message_header,y[0].message=GlobalData.consts.message_timelimit,y[0].admin_messages="true"==this.is_admin?GlobalData.consts.message_admin_timelimit:""):y.general.admin_messages.other="true"==this.is_admin?GlobalData.consts.message_admin_timelimit:"",y.general.upload_finish_time>0&&a.getTime()<y.general.upload_finish_time&&(y.general.files_count>0?(y[0].message=y.general.fail_message,y[0].admin_messages="true"==this.is_admin?y.general.fail_admin_message:""):y.general.admin_messages.other="true"==this.is_admin?y.general.fail_admin_message:"")}return s=""==n||""==r?wfu_ProcessUploadComplete(t,this.file_id,y,this.unique_id,this.params_index,this.session_token,"",[this.debugmode,o,this.is_admin],this.requesttype):wfu_ProcessUploadComplete(t,this.file_id,n,this.unique_id,this.params_index,this.session_token,r,[this.debugmode,o,this.is_admin],this.requesttype),s&&(wfu_unlock_upload(e.target.shortcode_id),wfu_hide_simple_progressbar(t),wfu_clear(e.target.shortcode_id)),e.target.return_status?l:void 0}function wfu_ProcessUploadComplete(e,a,t,s,n,r,l,o,i){if(e&&!(0>e)&&null!=t&&""!=t&&""!=s&&("no-ajax"==s||GlobalData[e])){var _=!1;if("string"==typeof t){t=wfu_plugin_decode_string(t.replace(/^\s+|\s+$/g,""));var d=null;try{d=JSON.parse(t)}catch(u){}if(null==d){var m=l.split(";");d=wfu_Initialize_Params(),d.general.shortcode_id=e,d.general.unique_id=s,d.general.state=m[0],4==d.general.state&&d.general.state++;var c=m[1].split(","),g="",f=GlobalData.consts.jsonparse_filemessage,p=GlobalData.consts.jsonparse_message,y=GlobalData.consts.jsonparse_adminmessage;d.general.files_count=parseInt(m[2]);for(var w=0;w<d.general.files_count;w++)d[w]={},d[w].color=c[0],d[w].bgcolor=c[1],d[w].borcolor=c[2],g=m[w+3].split(","),d[w].message_type=wfu_plugin_decode_string(g[0]),d[w].header=wfu_plugin_decode_string(g[1]),"success"==d[w].message_type&&(d[w].header+=f,d[w].message_type="warning"),d[w].message=wfu_join_strings("<br />",p,wfu_plugin_decode_string(g[2])),d[w].admin_messages=wfu_join_strings("<br />",y,wfu_plugin_decode_string(g[3]))}}else{if("object"!=typeof t)return;var d=t}for(w=0;d[w];)d[w].message_type&&"error"==d[w].message_type.substr(0,5)&&(d[w].message_type=d[w].message_type.substr(0,5)),w++;var b=document.getElementById("wfu_messageblock_"+e),h=!0;if(!UploadStates[e]&&b){var v=document.getElementById("wfu_messageblock_header_"+e+"_states").value;v=wfu_plugin_decode_string(v.replace(/^\s+|\s+$/g,"")),UploadStates[e]=null;try{UploadStates[e]=JSON.parse(v)}catch(u){}null==UploadStates[e]&&(h=!1)}GlobalData[e]||(GlobalData[e]=Object());var I=GlobalData[e];if("no-ajax"==s)I.last=!1,I.unique_id="",I.files_count=d.general.files_count,0==d.general.state&&(d.general.files_count=0),I.files_processed=d.general.files_count,I.upload_state=h?d.general.state:10,I.message=d.general.message,I.update_wpfilebase=d.general.update_wpfilebase,I.redirect_link=d.general.redirect_link,I.notify_only_filename_list="",I.notify_target_path_list="",I.notify_attachment_list="",I.admin_messages={},I.admin_messages.wpfilebase=d.general.admin_messages.wpfilebase,I.admin_messages.notify=d.general.admin_messages.notify,I.admin_messages.redirect=d.general.admin_messages.redirect,I.admin_messages.debug=o[1],I.admin_messages.other=d.general.admin_messages.other,I.errors={},I.errors.wpfilebase=d.general.errors.wpfilebase,I.errors.notify=d.general.errors.notify,I.errors.redirect=d.general.errors.redirect,I.current_size=0,I.total_size=0;else{if(""==I.unique_id||I.unique_id!=s||I.unique_id!=d.general.unique_id)return;if(I.last)return;0==d.general.files_count&&d[0]&&"error"==d[0].message_type&&(d.general.files_count=1);for(var E="",w=0;w<d.general.files_count;w++)E="error"==d[w].message_type&&0==I.files_processed?"error1":"error"==d[w].message_type&&I.files_processed>0?"error2":d[w].message_type,I.upload_state=GlobalData.filestatematch[E][I.upload_state];h||(I.upload_state=10),I.files_processed+=d.general.files_count,I.message=wfu_join_strings("<br />",I.message,d.general.message),""==I.update_wpfilebase&&(I.update_wpfilebase=d.general.update_wpfilebase),(!i||i&&"email"!=i)&&(I.redirect_link=d.general.redirect_link),I.notify_only_filename_list=wfu_join_strings(", ",I.notify_only_filename_list,d.general.notify_only_filename_list),I.notify_target_path_list=wfu_join_strings(", ",I.notify_target_path_list,d.general.notify_target_path_list),I.notify_attachment_list=wfu_join_strings(",",I.notify_attachment_list,d.general.notify_attachment_list),I.admin_messages.debug=wfu_join_strings("<br />",I.admin_messages.debug,o[1]),I.admin_messages.other=wfu_join_strings("<br />",I.admin_messages.other,d.general.admin_messages.other),""==I.admin_messages.wpfilebase&&(I.admin_messages.wpfilebase=d.general.admin_messages.wpfilebase),""==I.admin_messages.notify&&(I.admin_messages.notify=d.general.admin_messages.notify),""==I.admin_messages.redirect&&(I.admin_messages.redirect=d.general.admin_messages.redirect),""==I.errors.wpfilebase&&(I.errors.wpfilebase=d.general.errors.wpfilebase),""==I.errors.notify&&(I.errors.notify=d.general.errors.notify),""==I.errors.redirect&&(I.errors.redirect=d.general.errors.redirect)}I.files_processed==I.files_count&&(I.last=!0,""!=I.update_wpfilebase&&(I.admin_messages.wpfilebase="",wfu_notify_WPFilebase(n,r)),""!=I.notify_only_filename_list&&(I.admin_messages.notify="",wfu_send_email_notification(e,s,n,r,I.notify_only_filename_list,I.notify_target_path_list,I.notify_attachment_list,o[0],o[2]),I.last=!1,I.notify_only_filename_list=""),I.last&&(wfu_notify_server_upload_ended(s,n,r),GlobalData.UploadInProgressString=GlobalData.UploadInProgressString.replace(new RegExp("\\["+s+"\\]","g"),"")),""!=I.errors.redirect&&(I.redirect_link=""),""!=I.redirect_link&&I.last&&""==GlobalData.UploadInProgressString.trim()&&(I.upload_state=11,_=!0));var B=I.message,k=wfu_join_strings("<br />",I.admin_messages.other,I.admin_messages.wpfilebase,I.admin_messages.notify,I.admin_messages.redirect,I.admin_messages.debug);if(!h){var x=GlobalData.consts.jsonparse_headermessage,D=GlobalData.consts.jsonparse_headeradminmessage;B=wfu_join_strings("<br />",x,B),k=wfu_join_strings("<br />",D,k)}if(I.last){0==I.files_count?I.upload_state=8:I.upload_state<4&&(I.upload_state+=4);{""!=I.admin_messages.wpfilebase||""!=I.admin_messages.notify||""!=I.admin_messages.redirect||""!=I.admin_messages.other}4==I.upload_state&&""!=k?I.upload_state++:5==I.upload_state&&""==!k&&""==B&&I.upload_state--}if(b){var G=document.getElementById("wfu_messageblock_header_"+e+"_state"),T=1==I.files_count&&""==B&&""==k&&I.last&&!_;if(T)document.getElementById("wfu_messageblock_header_"+e).style.display="none";else{document.getElementById("wfu_messageblock_header_"+e).style.display="";var j=document.getElementById("wfu_messageblock_header_"+e+"_container");if(h){var q="";1!=I.files_count||5!=I.upload_state&&7!=I.upload_state||(q="_singlefile"),j.innerHTML=UploadStates[e]["State"+I.upload_state+q]}else{j.innerHTML="";var C=document.getElementById("wfu_messageblock_header_"+e+"_safecontainer");j.innerHTML=C.innerHTML.replace(/_safe/g,"")}var S=!1;""!=B?(document.getElementById("wfu_messageblock_subheader_"+e+"_message").style.display="",document.getElementById("wfu_messageblock_subheader_"+e+"_messagelabel").innerHTML=B,S=!0):document.getElementById("wfu_messageblock_subheader_"+e+"_message").style.display="none",""!=k?(document.getElementById("wfu_messageblock_subheader_"+e+"_adminmessage").style.display="",document.getElementById("wfu_messageblock_subheader_"+e+"_adminmessagelabel").innerHTML=k,S=!0):document.getElementById("wfu_messageblock_subheader_"+e+"_adminmessage").style.display="none",document.getElementById("wfu_messageblock_subheader_"+e).style.display=S?G.value:"none",S||I.files_processed>0?(j.colSpan=2,document.getElementById("wfu_messageblock_arrow_"+e).style.display=""):(document.getElementById("wfu_messageblock_arrow_"+e).style.display="none",j.colSpan=3)}for(var A=document.getElementById("wfu_messageblock_subheader_"+e),O=0,H=null,L=document.getElementById("wfu_messageblock_"+e+"_filetemplate"),P="",M=document.getElementById("wfu_messageblock_"+e+"_door"),U=0,R=1,z=2,N=wfu_plugin_decode_string(L.value.replace(/^\s+|\s+$/g,"")),w=0;w<d.general.files_count;w++){for(U=w+a,P=N.replace(/\[file_id\]/g,U),P=P.replace(/\[filenumber_display\]/g,""),P=P.replace(/\[fileheader_color\]/g,d[w].color),P=P.replace(/\[fileheader_bgcolor\]/g,d[w].bgcolor),P=P.replace(/\[fileheader_borcolor\]/g,d[w].borcolor),P=P.replace(/\[fileheader_message\]/g,d[w].header),P=P.replace(/\[filesubheadermessage_display\]/g,'style="display:none;"'),P=P.replace(/\[filesubheader_message\]/g,d[w].message),P=P.replace(/\[filesubheaderadminmessage_display\]/g,'style="display:none;"'),P=P.replace(/\[filesubheader_adminmessage\]/g,d[w].admin_messages),P="<table><tbody>"+P+"</tbody></table>",M.innerHTML=P,R=1,z=2,S=!1,H=document.getElementById("wfu_messageblock_"+e+"_"+U),1==I.files_count?(document.getElementById("wfu_messageblock_"+e+"_filenumber_"+U).style.display="none",document.getElementById("wfu_messageblock_subheader_"+e+"_fileempty_"+U).style.display="none",H.style.display=T?"":G.value,R++,z++):H.style.display=G.value,""!=d[w].message&&(document.getElementById("wfu_messageblock_subheader_"+e+"_message_"+U).style.display="",S=!0),""!=d[w].admin_messages&&(document.getElementById("wfu_messageblock_subheader_"+e+"_adminmessage_"+U).style.display="",S=!0),S||(document.getElementById("wfu_messageblock_arrow_"+e+"_"+U).style.display="none",R++),document.getElementById("wfu_messageblock_header_"+e+"_container_"+U).colSpan=R,document.getElementById("wfu_messageblock_subheader_"+e+"_container_"+U).colSpan=z;U>O&&(A=A.nextSibling,null!=A);)1===A.nodeType&&(O=A.id.substr(A.id.lastIndexOf("_")+1));b.tBodies[0].insertBefore(H,A),A=H.nextSibling,H=document.getElementById("wfu_messageblock_subheader_"+e+"_"+U),b.tBodies[0].insertBefore(H,A),A=H,O=U}T&&(document.getElementById("wfu_messageblock_"+e+"_1").style.display=""),b.style.display="",document.getElementById("wordpress_file_upload_message_"+e).style.display=""}return _&&wfu_Redirect(I.redirect_link),I.last}}function wfu_uploadFailed(e,a){a&&(console.log("failure report following"),console.log(e));var t=e.target,s={target:{responseText:"",shortcode_id:t.shortcode_id}};wfu_uploadComplete.call(t,s)}function wfu_uploadCanceled(){}function wfu_notify_server_upload_ended(e,a,t){var s=wfu_GetHttpRequestObject();if(null!=s){var n=GlobalData.consts.ajax_url;params=new Array(5),params[0]=new Array(2),params[0][0]="action",params[0][1]="wfu_ajax_action",params[1]=new Array(2),params[1][0]="unique_id",params[1][1]=e,params[2]=new Array(2),params[2][0]="params_index",params[2][1]=a,params[3]=new Array(2),params[3][0]="session_token",params[3][1]=t,params[4]=new Array(2),params[4][0]="upload_finished",params[4][1]=1;for(var r="",l=0;l<params.length;l++)r+=(l>0?"&":"")+params[l][0]+"="+encodeURI(params[l][1]);s.open("POST",n,!0),s.setRequestHeader("Content-type","application/x-www-form-urlencoded"),s.onreadystatechange=function(){4==s.readyState&&200==s.status},s.send(r)}}function wfu_Initialize_Params(){var e={};return e.version="full",e.general={},e.general.shortcode_id=0,e.general.unique_id="",e.general.state=0,e.general.files_count=0,e.general.update_wpfilebase="",e.general.redirect_link="",e.general.upload_finish_time=0,e.general.message="",e.general.message_type="",e.general.admin_messages={},e.general.admin_messages.wpfilebase="",e.general.admin_messages.notify="",e.general.admin_messages.redirect="",e.general.admin_messages.other="",e.general.errors={},e.general.errors.wpfilebase="",e.general.errors.notify="",e.general.errors.redirect="",e.general.color="",e.general.bgcolor="",e.general.borcolor="",e.general.notify_only_filename_list="",e.general.notify_target_path_list="",e.general.notify_attachment_list="",e.general.fail_message="",e.general.fail_admin_message="",e}function wfu_redirect_to_classic(e,a,t,s){0!=wfu_filesselected(e)&&wfu_selectsubdir_check(e)&&wfu_check_required_userdata(e)&&wfu_redirect_to_classic_cont(e,a,t,s,[""])}function wfu_redirect_to_classic_cont(e,a,t,s){var n=function(n){if(n.indexOf("wfu_response_success:")>-1){var r=wfu_Initialize_Params();if(r.general.shortcode_id=e,r.general.unique_id="",r.general.files_count=wfu_filesselected(e),wfu_ProcessUploadComplete(e,0,r,"no-ajax","",a,"",["false","","false"]),1==t){var l="";document.getElementById("upfile_"+e).name="uploadedfile_"+e+"_redirected"+l}document.getElementById("adminerrorcodes_"+e).value=s>0?s:"",document.getElementById("upfile_"+e).disabled=!1,document.getElementById("uniqueuploadid_"+e).value=wfu_randomString(20),GlobalData.UploadInProgressString+="["+document.getElementById("uniqueuploadid_"+e).value+"]",document.getElementById("uploadform_"+e).submit()}},r="",l=new Date,o=GlobalData.consts.response_url+"?shortcode_id="+e+"&start_time="+l.getTime()+"&session_token="+a+r;wfu_lock_upload(e);var i=wfu_GetHttpRequestObject();if(null==i){var _=document.createElement("iframe");return _?(_.style.display="none",_.src=o,document.body.appendChild(_),void(_.onload=function(){n(_.contentDocument.body.innerHTML)})):void 0}i.open("GET",o,!0),i.onreadystatechange=function(){4==i.readyState&&200==i.status&&n(i.responseText)},i.send(null)}function wfu_filesselected(e){var a=document.getElementById("upfile_"+e),t=document.getElementById("fileName_"+e),s=a.files;return s||(s=a.value?[{name:a.value}]:[]),"undefined"!=typeof a.filearray&&(s=a.filearray),0==s.length&&t&&(t.value=GlobalData.consts.nofilemessage,t.className="file_input_textbox_nofile"),s.length}function wfu_check_required_userdata(e){for(var a=wfu_get_userdata_count(e),t=!1,s=0;a>s;s++){var n=document.getElementById("hiddeninput_"+e+"_userdata_"+s),r=document.getElementById("userdata_"+e+"_message_"+s),l="file_userdata_message_required";r.className.substr(0,l.length)==l&&""==n.value&&(r.className=l+"_empty",r.value=GlobalData.consts.userdata_empty,t=!0)}return!t}function wfu_HTML5UploadFile(e,a,t){if(!wfu_BrowserCaps.supportsAJAX)return void wfu_redirect_to_classic(e,t,1,1);if(!wfu_BrowserCaps.supportsHTML5)return void wfu_redirect_to_classic(e,t,1,2);a=wfu_plugin_decode_string(a.replace(/^\s+|\s+$/g,""));var s=null;try{s=JSON.parse(a)}catch(n){}if(null==s)return void wfu_redirect_to_classic(e,t,1,3);var r=wfu_GetHttpRequestObject();if(null!=r){var l=wfu_filesselected(e);if(0!=l&&wfu_selectsubdir_check(e)){var o=l;o+=o,wfu_check_required_userdata(e)&&wfu_HTML5UploadFile_cont(e,s,t,[""])}}}function wfu_HTML5UploadFile_cont(e,a,t){function s(r,d,c,g){m=!0;var f=wfu_GetHttpRequestObject(),p=wfu_GetHttpRequestObject();if(null!=f&&null!=p){var y=null,w=null;try{var y=new FormData,w=new FormData}catch(b){}if(null!=y&&null!=w){c||y.append("uploadedfile_"+e+o,d),y.append("uploadedfile_"+e+"_index",r),y.append("uploadedfile_"+e+"_name",wfu_plugin_encode_string(l[r].name)),y.append("uploadedfile_"+e+"_size",l[r].size),y.append("action","wfu_ajax_action"),y.append("uniqueuploadid_"+e,_),y.append("params_index",a.params_index),y.append("subdir_sel_index",n),c?y.append("only_check","1"):y.append("only_check","0"),y.append("session_token",t),y.append("unique_id",i);for(var h=wfu_get_userdata_count(e),v=0;h>v;v++)y.append("hiddeninput_"+e+"_userdata_"+v,document.getElementById("hiddeninput_"+e+"_userdata_"+v).value);var I=GlobalData[e].xhrs.push(f)-1,E=new Date;if(f.xhrid=I,f.shortcode_id=e,f.requesttype="fileupload",f.file_id=r+1,c?(f.size=0,f.totalsize=0,f.loading=!1):(f.size=d.size,f.totalsize=l[r].size,f.loading=!0),f.deltasize=0,f.sizeloaded=0,f.aborted=!1,f.unique_id=i,f.params_index=a.params_index,f.session_token=t,f.debugmode=a.debugmode,f.is_admin=a.is_admin,f.start_time=E.getTime(),f.end_time=f.start_time,f.finish_time=f.start_time+1e3*parseInt(GlobalData.consts.max_time_limit),f.fail_colors=a.fail_colors,f.error_message_header=a.error_header.replace(/%username%/g,"no data"),f.error_message_header=f.error_message_header.replace(/%useremail%/g,"no data"),f.error_message_header=f.error_message_header.replace(/%filename%/g,l[r].name),f.error_message_header=f.error_message_header.replace(/%filepath%/g,l[r].name),f.error_message_failed=GlobalData.consts.message_failed,f.error_message_cancelled=GlobalData.consts.message_cancelled,f.error_adminmessage_unknown=GlobalData.consts.adminmessage_unknown.replace(/%username%/g,"no data"),f.error_adminmessage_unknown=f.error_adminmessage_unknown.replace(/%useremail%/g,"no data"),f.error_adminmessage_unknown=f.error_adminmessage_unknown.replace(/%filename%/g,l[r].name),f.error_adminmessage_unknown=f.error_adminmessage_unknown.replace(/%filepath%/g,l[r].name),g){w.append("action","wfu_ajax_action"),w.append("params_index",a.params_index),w.append("session_token",t),w.append("force_connection_close","1"),p.open("POST",GlobalData.consts.ajax_url,!1);try{p.send(w)}catch(B){}m="success"==p.responseText}if(m)c?(f.addEventListener("load",function(a){a={target:{responseText:a.target.responseText,shortcode_id:e,return_status:!0}};var t=wfu_uploadComplete.call(f,a);m="success"==t||"warning"==t,m&&s(r,d,!1,!1)},!1),f.addEventListener("error",function(){},!1),f.open("POST",GlobalData.consts.ajax_url,!0),f.send(y)):(f.upload.xhr=f,f.upload.dummy=1,f.upload.addEventListener("loadstart",wfu_loadStart,!1),f.upload.addEventListener("progress",new Function("evt","wfu_uploadProgress(evt, "+e+", "+I+", "+a.debugmode+");"),!1),f.addEventListener("load",wfu_uploadComplete,!1),f.addEventListener("error",new Function("evt","wfu_uploadFailed(evt, "+a.debugmode+");"),!1),f.addEventListener("abort",wfu_uploadCanceled,!1),f.open("POST",GlobalData.consts.ajax_url,!0),f.send(y));else{var k={target:{responseText:"",shortcode_id:e}};wfu_uploadComplete.call(f,k)}return u++,m}}}var n=-1;null!=document.getElementById("selectsubdir_"+e)&&(n=document.getElementById("selectsubdir_"+e).selectedIndex);var r=document.getElementById("upfile_"+e),l=r.files;l||(l=r.value?[{name:r.value}]:[]),"undefined"!=typeof r.filearray&&(l=r.filearray);var o="",i=wfu_randomString(10),_=i;GlobalData.UploadInProgressString+="["+i+"]",GlobalData[e]={},GlobalData[e].unique_id=i,GlobalData[e].last=!1,GlobalData[e].files_count=1,GlobalData[e].files_processed=0,GlobalData[e].upload_state=0,GlobalData[e].message="",GlobalData[e].update_wpfilebase="",GlobalData[e].redirect_link="",GlobalData[e].notify_only_filename_list="",GlobalData[e].notify_target_path_list="",GlobalData[e].notify_attachment_list="",GlobalData[e].admin_messages={},GlobalData[e].admin_messages.wpfilebase="",GlobalData[e].admin_messages.notify="",GlobalData[e].admin_messages.redirect="",GlobalData[e].admin_messages.debug="",GlobalData[e].admin_messages.other="",GlobalData[e].errors={},GlobalData[e].errors.wpfilebase="",GlobalData[e].errors.notify="",GlobalData[e].errors.redirect="",GlobalData[e].xhrs=Array(),wfu_show_simple_progressbar(a.shortcode_id,"progressive");var d=wfu_Initialize_Params();d.general.shortcode_id=e,d.general.unique_id=i,wfu_ProcessUploadComplete(e,0,d,i,a.params_index,t,"",["false","","false"]);var u=0,m=!0,c=0;s(c,l[c],!0,!1)}function wfu_get_userdata_count(e){for(var a=0;document.getElementById("userdata_"+e+"_"+a);)a++;return a}function wfu_lock_upload(e){var a=document.getElementById("fileName_"+e);a&&(a.disabled=!0),document.getElementById("input_"+e).disabled=!0,document.getElementById("upfile_"+e).disabled=!0;var t=document.getElementById("selectsubdir_"+e);t&&(t.disabled=!0);var s=document.getElementById("upload_"+e);s&&(s.disabled=!0);for(var n=wfu_get_userdata_count(e),r=0;n>r;r++)document.getElementById("userdata_"+e+"_message_"+r).disabled=!0}function wfu_unlock_upload(e){var a=document.getElementById("fileName_"+e);a&&(a.disabled=!1),document.getElementById("input_"+e).disabled=!1,document.getElementById("upfile_"+e).disabled=!1;var t=document.getElementById("selectsubdir_"+e);t&&(t.disabled=!1);var s=document.getElementById("upload_"+e);s&&(s.disabled=!1);for(var n=wfu_get_userdata_count(e),r=0;n>r;r++)document.getElementById("userdata_"+e+"_message_"+r).disabled=!1}function wfu_clear(e){document.getElementById("uploadform_"+e).reset();var a=document.getElementById("fileName_"+e);a&&(a.value="",a.className="file_input_textbox");var t=document.getElementById("selectsubdir_"+e);t&&(t.selectedIndex=parseInt(document.getElementById("selectsubdirdefault_"+e).value));for(var s=wfu_get_userdata_count(e),n=0;s>n;n++)document.getElementById("userdata_"+e+"_message_"+n).value="",document.getElementById("hiddeninput_"+e+"_userdata_"+n).value=""}function wfu_reset_message(e){var a=document.getElementById("wfu_messageblock_"+e);if(a){document.getElementById("wfu_messageblock_header_"+e).style.display="";
|
2 |
+
var t=document.getElementById("wfu_messageblock_header_"+e+"_container");UploadStates[e]&&(t.innerHTML=UploadStates[e].State0),document.getElementById("wfu_messageblock_header_"+e+"_state").value="none",document.getElementById("wfu_messageblock_arrow_"+e).style.display="none",t.colSpan=3,document.getElementById("wfu_messageblock_subheader_"+e+"_messagelabel").innerHTML="",document.getElementById("wfu_messageblock_subheader_"+e+"_adminmessagelabel").innerHTML="",document.getElementById("wfu_messageblock_subheader_"+e).style.display="none",document.getElementById("wfu_messageblock_subheader_"+e+"_message").style.display="none",document.getElementById("wfu_messageblock_subheader_"+e+"_adminmessage").style.display="none";for(var s=wfu_get_file_ids(e),n=1;n<=s.length;n++)a.tBodies[0].removeChild(document.getElementById("wfu_messageblock_"+e+"_"+n)),a.tBodies[0].removeChild(document.getElementById("wfu_messageblock_subheader_"+e+"_"+n))}}function wfu_show_simple_progressbar(e,a){var t=document.getElementById("progressbar_"+e+"_animation"),s=document.getElementById("progressbar_"+e+"_imagesafe");t&&("progressive"==a?(t.style.width="0%",t.className="file_progress_progressive",s.style.display="none",t.style.display="block"):wfu_BrowserCaps.supportsAnimation?(t.style.width="25%",t.className="file_progress_shuffle",s.style.display="none",t.style.display="block"):(t.style.width="0%",t.className="file_progress_noanimation",t.style.display="none",s.style.display="block"),document.getElementById("wordpress_file_upload_progressbar_"+e).style.display="block")}function wfu_hide_simple_progressbar(e){var a=document.getElementById("progressbar_"+e+"_animation"),t=document.getElementById("progressbar_"+e+"_imagesafe");a&&(document.getElementById("wordpress_file_upload_progressbar_"+e).style.display="none",a.style.width="0%",a.className="file_progress_noanimation",t.style.display="none",a.style.display="block")}function wfu_invoke_shortcode_editor(e,a,t){for(var s=document.getElementsByTagName("BUTTON"),n=0,r=null,l=0;l<s.length;l++)s[l].parentNode&&s[l].parentNode.id=="wordpress_file_upload_editor_"+e&&(r=s[l],n++);if(0!=n){if(n>1)return void alert(GlobalData.consts.same_pluginid);var o=wfu_GetHttpRequestObject();if(null!=o){r.parentNode.style.display="none",document.getElementById("wordpress_file_upload_overlay_"+e).style.display="block";var i=GlobalData.consts.ajax_url;params=new Array(4),params[0]=new Array(2),params[0][0]="action",params[0][1]="wfu_ajax_action_edit_shortcode",params[1]=new Array(2),params[1][0]="upload_id",params[1][1]=e,params[2]=new Array(2),params[2][0]="post_id",params[2][1]=a,params[3]=new Array(2),params[3][0]="post_hash",params[3][1]=t;for(var _="",l=0;l<params.length;l++)_+=(l>0?"&":"")+params[l][0]+"="+encodeURI(params[l][1]);o.open("POST",i,!0),o.setRequestHeader("Content-type","application/x-www-form-urlencoded"),o.onreadystatechange=function(){if(4==o.readyState&&200==o.status){document.getElementById("wordpress_file_upload_overlay_"+e).style.display="none",r.parentNode.removeAttribute("style");var a="wfu_edit_shortcode:",t=o.responseText.indexOf(a);-1==t&&(t=o.responseText.length);var s=(o.responseText.substr(0,t),o.responseText.substr(t+a.length,o.responseText.length-t-a.length));t=s.indexOf(":");var n=s.substr(0,t);if(txt_value=s.substr(t+1,s.length-t-1),"success"==n){var l=window.open(wfu_plugin_decode_string(txt_value),"_blank");l.plugin_window=window}else"check_page_obsolete"==n&&alert(txt_value)}},o.send(_)}}}GlobalData={},UploadStates={},GlobalData.filestatematch={},GlobalData.filestatematch.success=[0,1,2,2],GlobalData.filestatematch.warning=[1,1,2,2],GlobalData.filestatematch.error1=[3,3,2,3],GlobalData.filestatematch.error2=[2,2,2,3],GlobalData.UploadInProgressString="",wfu_Check_Browser_Capabilities();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
languages/wordpress-file-upload-fr_FR.mo
CHANGED
Binary file
|
languages/wordpress-file-upload-fr_FR.po
CHANGED
@@ -2,8 +2,8 @@ msgid ""
|
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: Wordpress File Upload\n"
|
4 |
"Report-Msgid-Bugs-To: \n"
|
5 |
-
"POT-Creation-Date:
|
6 |
-
"PO-Revision-Date:
|
7 |
"Last-Translator: nickboss <nickboss@iptanus.com>\n"
|
8 |
"Language-Team: \n"
|
9 |
"Language: fr_FR\n"
|
@@ -12,7 +12,7 @@ msgstr ""
|
|
12 |
"Content-Transfer-Encoding: 8bit\n"
|
13 |
"X-Poedit-KeywordsList: __;gettext;gettext_noop\n"
|
14 |
"X-Poedit-Basepath: ../\n"
|
15 |
-
"X-Generator: Poedit 1.
|
16 |
"X-Poedit-SearchPath-0: .\n"
|
17 |
|
18 |
#: lib/wfu_constants.php:7
|
@@ -27,11 +27,11 @@ msgstr "Sélectionner un fichier"
|
|
27 |
msgid "Upload File"
|
28 |
msgstr "Envoyer de fichier"
|
29 |
|
30 |
-
#: lib/wfu_constants.php:
|
31 |
msgid "File Upload Notification"
|
32 |
msgstr "Notification d'envoi de fichier"
|
33 |
|
34 |
-
#: lib/wfu_constants.php:
|
35 |
msgid ""
|
36 |
"Dear Recipient,%n%%n% This is an automatic delivery message to notify you "
|
37 |
"that a new file has been uploaded.%n%%n%Best Regards"
|
@@ -39,30 +39,30 @@ msgstr ""
|
|
39 |
"Cher Destinataire,%n%%n% Ceci est un message envoyé automatiquement pour "
|
40 |
"vous prevenir qu'un nouveau fichier a été uploadé. %n%%n%Cordialement"
|
41 |
|
42 |
-
#: lib/wfu_constants.php:
|
43 |
#, fuzzy, php-format
|
44 |
msgid "File %filename% uploaded successfully"
|
45 |
msgstr "Le fichier %filename% a été correctement envoyé"
|
46 |
|
47 |
-
#: lib/wfu_constants.php:
|
48 |
#, fuzzy, php-format
|
49 |
msgid "File %filename% uploaded successfully but with warnings"
|
50 |
msgstr ""
|
51 |
"Le fichier %filename% a été envoyé avec succès mais avec des avertissements"
|
52 |
|
53 |
-
#: lib/wfu_constants.php:
|
54 |
msgid "File %filename% not uploaded"
|
55 |
msgstr "Le fichier %filename% n'a pas été envoyé"
|
56 |
|
57 |
-
#: lib/wfu_constants.php:
|
58 |
msgid "File %filename% is being uploaded"
|
59 |
msgstr "Le fichier %filename% est en cours d'envoi"
|
60 |
|
61 |
-
#: lib/wfu_constants.php:
|
62 |
msgid "Your message"
|
63 |
msgstr "Votre message"
|
64 |
|
65 |
-
#: lib/wfu_constants.php:
|
66 |
msgid ""
|
67 |
"Error. Could not resolve ftp target filedir. Check the domain in 'ftpinfo' "
|
68 |
"attribute."
|
@@ -70,13 +70,13 @@ msgstr ""
|
|
70 |
"Erreur. Impossible d'atteindre le repertoire ftp de destination. Vérifier le "
|
71 |
"domaine dans l'attribut 'ftpinfo'."
|
72 |
|
73 |
-
#: lib/wfu_constants.php:
|
74 |
msgid "Error. Invalid ftp information. Check 'ftpinfo' attribute."
|
75 |
msgstr ""
|
76 |
"Erreur. Les informations de ftp sont invalides. Vérifier le domaine dans "
|
77 |
"l'attribut 'ftpinfo'."
|
78 |
|
79 |
-
#: lib/wfu_constants.php:
|
80 |
msgid ""
|
81 |
"Error. Could not extract ftp information from 'ftpinfo' attribute. Check its "
|
82 |
"syntax."
|
@@ -84,7 +84,7 @@ msgstr ""
|
|
84 |
"Erreur. Impossible d'obtenir les informations dans l'attribut 'ftpinfo'. "
|
85 |
"Vérifez sa syntax."
|
86 |
|
87 |
-
#: lib/wfu_constants.php:
|
88 |
msgid ""
|
89 |
"Error. Could not resolve ftp target filename. Check the domain in 'ftpinfo' "
|
90 |
"attribute."
|
@@ -92,7 +92,7 @@ msgstr ""
|
|
92 |
"Erreur. Impossible de résoudre le nom de fichier de destination ftp. "
|
93 |
"Vérifiez le domaine dans l'attribut 'ftpinfo'."
|
94 |
|
95 |
-
#: lib/wfu_constants.php:
|
96 |
msgid ""
|
97 |
"Error. The upload size limit of PHP directive upload_max_filesize is "
|
98 |
"preventing the upload of big files.\n"
|
@@ -102,7 +102,7 @@ msgstr ""
|
|
102 |
"upload_max_filesize, empêche l'envoi de gros fichier.\n"
|
103 |
"La limite de la directive PHP upload_max_filesize est de :"
|
104 |
|
105 |
-
#: lib/wfu_constants.php:
|
106 |
msgid ""
|
107 |
"The upload time limit of PHP directive max_input_time is preventing the "
|
108 |
"upload of big files.\n"
|
@@ -112,7 +112,7 @@ msgstr ""
|
|
112 |
"l'envoi de gros fichier.\n"
|
113 |
"La limite de la directive PHP max_input_time est de :"
|
114 |
|
115 |
-
#: lib/wfu_constants.php:
|
116 |
msgid ""
|
117 |
"Error. Permission denied to write to target folder.\n"
|
118 |
"Check and correct read/write permissions of target folder."
|
@@ -121,28 +121,32 @@ msgstr ""
|
|
121 |
"Vérifiez et corrigez les permission en lecture/ecriture du repertoire de "
|
122 |
"destination."
|
123 |
|
124 |
-
#: lib/wfu_constants.php:
|
125 |
msgid "Targer folder doesn't exist."
|
126 |
msgstr "Le répertoire de destination n'existe pas."
|
127 |
|
128 |
-
#: lib/wfu_constants.php:
|
129 |
msgid "Upload failed! Missing a temporary folder."
|
130 |
msgstr "Envoi impossible! Il manque un répertoire temporaire."
|
131 |
|
132 |
-
#: lib/wfu_constants.php:
|
133 |
msgid "Upload failed! Permission denied to write to target folder."
|
134 |
msgstr ""
|
135 |
"Envoi impossible! Permission refusée dans le répertoire de destination."
|
136 |
|
137 |
-
#: lib/wfu_constants.php:
|
138 |
msgid "File not allowed."
|
139 |
msgstr "Type de fichier non autorisé."
|
140 |
|
141 |
-
#: lib/wfu_constants.php:
|
142 |
msgid "The uploaded file exceeds the file size limit."
|
143 |
msgstr "La taille du fichier est supérieure à la taille limite."
|
144 |
|
145 |
-
#: lib/wfu_constants.php:
|
|
|
|
|
|
|
|
|
146 |
msgid ""
|
147 |
"Upload failed! The uploaded file exceeds the file size limit of the server. "
|
148 |
"Please contact the administrator."
|
@@ -150,7 +154,7 @@ msgstr ""
|
|
150 |
"Envoi impossible! La taille du fichier excède la taille limite du serveur. "
|
151 |
"Merci de contacter l'administrateur."
|
152 |
|
153 |
-
#: lib/wfu_constants.php:
|
154 |
msgid ""
|
155 |
"Upload failed! The duration of the upload exceeded the time limit of the "
|
156 |
"server. Please contact the administrator."
|
@@ -158,7 +162,7 @@ msgstr ""
|
|
158 |
"Envoi impossible! La durée maximum d'envoi sur le serveur excède la durée "
|
159 |
"limite du serveur. Merci de contacter l'administrateur."
|
160 |
|
161 |
-
#: lib/wfu_constants.php:
|
162 |
msgid ""
|
163 |
"Upload failed! The uploaded file exceeds the MAX_FILE_SIZE directive that "
|
164 |
"was specified in the HTML form."
|
@@ -166,19 +170,19 @@ msgstr ""
|
|
166 |
"Envoi impossible! La taille du fichier excède la directive MAX_FILE_SIZE "
|
167 |
"spécifiée dans le formulaire HTML."
|
168 |
|
169 |
-
#: lib/wfu_constants.php:
|
170 |
msgid "Upload failed! The uploaded file was only partially uploaded."
|
171 |
msgstr "Envoi impossible! Le fichier à été partiellement envoyé."
|
172 |
|
173 |
-
#: lib/wfu_constants.php:
|
174 |
msgid "Upload failed! No file was uploaded."
|
175 |
msgstr "Envoi impossible! Le fichier n'a pas été envoyé."
|
176 |
|
177 |
-
#: lib/wfu_constants.php:
|
178 |
msgid "Upload failed! Failed to write file to disk."
|
179 |
msgstr "Envoi impossible! Impossible d'écrire sur le fichier sur le disque."
|
180 |
|
181 |
-
#: lib/wfu_constants.php:
|
182 |
msgid ""
|
183 |
"Upload failed! Error occured while moving temporary file. Please contact "
|
184 |
"administrator."
|
@@ -186,7 +190,7 @@ msgstr ""
|
|
186 |
"Envoi impossible! Une erreur est survenue lors du déplacement du fichier "
|
187 |
"temporaire. merci de contacter l'administrateur."
|
188 |
|
189 |
-
#: lib/wfu_constants.php:
|
190 |
msgid ""
|
191 |
"Upload failed! A PHP extension stopped the file upload. PHP does not provide "
|
192 |
"a way to ascertain which extension caused the file upload to stop; examining "
|
@@ -196,21 +200,21 @@ msgstr ""
|
|
196 |
"pas fournir avec certitude quelle extension est en cause; examiner la liste "
|
197 |
"des extensions chargées avec phpinfo() peut être nécessaire."
|
198 |
|
199 |
-
#: lib/wfu_constants.php:
|
200 |
msgid "Upload failed! Error occured while attemting to upload the file."
|
201 |
msgstr ""
|
202 |
"Envoi impossible! Une erreur est survenue pendant la tentative d'envoi du "
|
203 |
"fichier."
|
204 |
|
205 |
-
#: lib/wfu_constants.php:
|
206 |
msgid "Upload failed!"
|
207 |
msgstr "Envoi impossible!"
|
208 |
|
209 |
-
#: lib/wfu_constants.php:
|
210 |
msgid "No file!"
|
211 |
msgstr "Pas de fichier!"
|
212 |
|
213 |
-
#: lib/wfu_constants.php:
|
214 |
msgid ""
|
215 |
"Upload failed! The upload has been canceled by the user or the browser "
|
216 |
"dropped the connection."
|
@@ -218,27 +222,27 @@ msgstr ""
|
|
218 |
"Envoi impossible! L'envoi a été annulé par l'utilisateur ou le navigateur à "
|
219 |
"cassé la connexion."
|
220 |
|
221 |
-
#: lib/wfu_constants.php:
|
222 |
msgid "Upload failed! Unknown error."
|
223 |
msgstr "Envoi impossible! Erreur inconnue."
|
224 |
|
225 |
-
#: lib/wfu_constants.php:
|
226 |
msgid "Please contact the administrator."
|
227 |
msgstr "Merci de contacter l'administrateur."
|
228 |
|
229 |
-
#: lib/wfu_constants.php:
|
230 |
msgid "No result from remote server!"
|
231 |
msgstr "Pas de résultat du serveur distant!"
|
232 |
|
233 |
-
#: lib/wfu_constants.php:
|
234 |
msgid " but with warnings"
|
235 |
msgstr "mais avec des avertissements"
|
236 |
|
237 |
-
#: lib/wfu_constants.php:
|
238 |
msgid "Warning: JSON parse error."
|
239 |
msgstr "Attention: Erreur d'analyse JSON"
|
240 |
|
241 |
-
#: lib/wfu_constants.php:
|
242 |
msgid ""
|
243 |
"Upload parameters of this file, passed as JSON string to the handler, could "
|
244 |
"not be parsed."
|
@@ -246,19 +250,19 @@ msgstr ""
|
|
246 |
"Les paramètres d'envoi de ce fichier, passés en tant que chaine JSON, ne "
|
247 |
"peuvent pas être analysés."
|
248 |
|
249 |
-
#: lib/wfu_constants.php:
|
250 |
msgid ""
|
251 |
"UploadStates, passed as JSON string to the handler, could not be parsed."
|
252 |
msgstr "UploadStates, passé en tant que chaine JSON, ne peut pas être analysé."
|
253 |
|
254 |
-
#: lib/wfu_constants.php:
|
255 |
msgid ""
|
256 |
"Redirection to classic form functionality occurred due to unknown error."
|
257 |
msgstr ""
|
258 |
"La redirection vers la fonctionalité classique des formulaire s'est produit "
|
259 |
"à cause d'une erreur inconue."
|
260 |
|
261 |
-
#: lib/wfu_constants.php:
|
262 |
msgid ""
|
263 |
"Redirection to classic form functionality occurred because AJAX is not "
|
264 |
"supported."
|
@@ -266,7 +270,7 @@ msgstr ""
|
|
266 |
"La redirection vers la fonctionalité classique des formulaire s'est produit "
|
267 |
"car AJAX n'est pas supporté."
|
268 |
|
269 |
-
#: lib/wfu_constants.php:
|
270 |
msgid ""
|
271 |
"Redirection to classic form functionality occurred because HTML5 is not "
|
272 |
"supported."
|
@@ -274,38 +278,50 @@ msgstr ""
|
|
274 |
"La redirection vers la fonctionalité classique des formulaire s'est produit "
|
275 |
"car HTML5 n'est pas supporté."
|
276 |
|
277 |
-
#: lib/wfu_constants.php:
|
278 |
msgid ""
|
279 |
"Redirection to classic form functionality occurred due to JSON parse error."
|
280 |
msgstr ""
|
281 |
"La redirection vers la fonctionalité classique des formulaire s'est produit "
|
282 |
"à cause d'une erreur d'analyse JSON."
|
283 |
|
284 |
-
#: lib/wfu_constants.php:
|
285 |
msgid "cannot be empty!"
|
286 |
msgstr "ne peut pas être vide!"
|
287 |
|
288 |
-
#: lib/wfu_constants.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
289 |
msgid "Upload skipped! File already exists."
|
290 |
msgstr "Envoi passé! Le fichier existe déjà."
|
291 |
|
292 |
-
#: lib/wfu_constants.php:
|
293 |
msgid "No files have been selected!"
|
294 |
msgstr "Aucun fichier n'a été envoyés!"
|
295 |
|
296 |
-
#: lib/wfu_constants.php:
|
297 |
msgid "WPFilebase Plugin not updated because there were no files uploaded."
|
298 |
msgstr ""
|
299 |
"WPFilebase Plugin n'a pas été mis à jour car il n'y a pas de fichiers à "
|
300 |
"envoyer."
|
301 |
|
302 |
-
#: lib/wfu_constants.php:
|
303 |
msgid "Notification email was not sent because there were no files uploaded."
|
304 |
msgstr ""
|
305 |
"Le mail de notification n'a pas été envoyé car il n'y a pas de fichiers à "
|
306 |
"envoyer."
|
307 |
|
308 |
-
#: lib/wfu_constants.php:
|
309 |
msgid ""
|
310 |
"Notification email was not sent because no recipients were defined. Please "
|
311 |
"check notifyrecipients attribute in the shortcode."
|
@@ -313,7 +329,7 @@ msgstr ""
|
|
313 |
"Le mail de notification n'a pas été envoyé car il n'y a pas de destinataire. "
|
314 |
"Merci de vérifier l'attribut notifyrecipients dans le shortcode."
|
315 |
|
316 |
-
#: lib/wfu_constants.php:
|
317 |
msgid ""
|
318 |
"Notification email was not sent due to an error. Please check "
|
319 |
"notifyrecipients, notifysubject and notifymessage attributes for errors."
|
@@ -321,7 +337,7 @@ msgstr ""
|
|
321 |
"Le mail de notification n'a pas été envoyé car il n'y a une erreur. Merci de "
|
322 |
"vérifier les attributs notifyrecipients, notifysubject et notifymessage."
|
323 |
|
324 |
-
#: lib/wfu_constants.php:
|
325 |
msgid ""
|
326 |
"Redirection not executed because redirection link is empty. Please check "
|
327 |
"redirectlink attribute."
|
@@ -329,57 +345,99 @@ msgstr ""
|
|
329 |
"La redirection n'a pas été effectuée car le lien de redirection est vide. "
|
330 |
"Merci de vérifier l'attribut redirectlink."
|
331 |
|
332 |
-
#: lib/wfu_constants.php:
|
333 |
msgid ""
|
334 |
"Redirection not executed because not all files were successfully uploaded."
|
335 |
msgstr ""
|
336 |
"La redirection n'est pas éxécuté car tous les fichiers n'ont pas été envoyés."
|
337 |
|
338 |
-
#: lib/wfu_constants.php:
|
339 |
msgid "Test Mode"
|
340 |
msgstr "Mode de test"
|
341 |
|
342 |
-
#: lib/wfu_constants.php:
|
|
|
|
|
|
|
|
|
343 |
msgid "Upload path: %filepath%"
|
344 |
msgstr "Chemin d'Upload : %filepath%"
|
345 |
|
346 |
-
#: lib/wfu_constants.php:
|
347 |
msgid "Failed upload path: %filepath%"
|
348 |
msgstr "Mauvais répertoir d'envoi: %filepath%"
|
349 |
|
350 |
-
#: lib/wfu_constants.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
351 |
msgid "This is a test message"
|
352 |
msgstr "Ceci est un message de test"
|
353 |
|
354 |
-
#: lib/wfu_constants.php:
|
355 |
msgid "This is a test administrator message"
|
356 |
msgstr "Ceci est un message administrateur de test"
|
357 |
|
358 |
-
#: lib/wfu_constants.php:
|
359 |
msgid "File testfile 1 under test"
|
360 |
msgstr "File testfile 1 under test"
|
361 |
|
362 |
-
#: lib/wfu_constants.php:
|
363 |
msgid "File testfile 1 message"
|
364 |
msgstr "File testfile 1 message"
|
365 |
|
366 |
-
#: lib/wfu_constants.php:
|
367 |
msgid "File testfile 1 administrator message"
|
368 |
msgstr "Message administrateur File testfile"
|
369 |
|
370 |
-
#: lib/wfu_constants.php:
|
371 |
msgid "File testfile 2 under test"
|
372 |
msgstr "En test File testfile"
|
373 |
|
374 |
-
#: lib/wfu_constants.php:
|
375 |
msgid "File testfile 2 message"
|
376 |
msgstr "Message File testfile 2"
|
377 |
|
378 |
-
#: lib/wfu_constants.php:
|
379 |
msgid "File testfile 2 administrator message"
|
380 |
msgstr "Message administrateur File testfile 2"
|
381 |
|
382 |
-
#: lib/wfu_constants.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
383 |
msgid ""
|
384 |
"Insert variable %username% inside text. It will be replaced by the username "
|
385 |
"of the current user."
|
@@ -387,7 +445,7 @@ msgstr ""
|
|
387 |
"Insérez la variable %username% dans le texte. Il sera remplacé par le "
|
388 |
"username de l'utilisateur courant."
|
389 |
|
390 |
-
#: lib/wfu_constants.php:
|
391 |
msgid ""
|
392 |
"Insert variable %useremail% inside text. It will be replaced by the email of "
|
393 |
"the current user."
|
@@ -395,7 +453,7 @@ msgstr ""
|
|
395 |
"Insérez la variable %useremail% dans le texte. Il sera remplacé par l'email "
|
396 |
"de l'utilisateur courant."
|
397 |
|
398 |
-
#: lib/wfu_constants.php:
|
399 |
msgid ""
|
400 |
"Insert variable %filename% inside text. It will be replaced by the filename "
|
401 |
"of the uploaded file."
|
@@ -403,7 +461,7 @@ msgstr ""
|
|
403 |
"Insérez la variable %filename% dans le texte. Il sera remplacé par le nom du "
|
404 |
"fichier à envoyer."
|
405 |
|
406 |
-
#: lib/wfu_constants.php:
|
407 |
msgid ""
|
408 |
"Insert variable %filepath% inside text. It will be replaced by the full "
|
409 |
"filepath of the uploaded file."
|
@@ -411,7 +469,7 @@ msgstr ""
|
|
411 |
"Insérez la variable %filepath% dans le texte. Il sera remplacé par le chemin "
|
412 |
"complet du fichier envoyé."
|
413 |
|
414 |
-
#: lib/wfu_constants.php:
|
415 |
msgid ""
|
416 |
"Insert variable %blogid% inside text. It will be replaced by the blog id of "
|
417 |
"the website."
|
@@ -419,7 +477,19 @@ msgstr ""
|
|
419 |
"Insérez la variable %blogid% dans le texte. Il sera remplacé par l'id du "
|
420 |
"blog du site web."
|
421 |
|
422 |
-
#: lib/wfu_constants.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
423 |
msgid ""
|
424 |
"Insert variable %userdataXXX% inside text. Select the user field from the "
|
425 |
"drop-down list. It will be replaced by the value that the user entered in "
|
@@ -429,69 +499,77 @@ msgstr ""
|
|
429 |
"l'utilisateur dans la liste déroulante. Il sera remplacé par la valeur que "
|
430 |
"l'utilisateur aura entré dans ce champs."
|
431 |
|
432 |
-
#: lib/wfu_constants.php:
|
433 |
msgid "Insert variable %n% inside text to denote a line change."
|
434 |
msgstr ""
|
435 |
"Insérez la variable %n% à l'intérieur du texte pour indiquer un changement "
|
436 |
"de ligne."
|
437 |
|
438 |
-
#: lib/wfu_constants.php:
|
439 |
msgid "Upload in progress"
|
440 |
msgstr "Envoi en cours"
|
441 |
|
442 |
-
#: lib/wfu_constants.php:
|
443 |
msgid "Upload in progress with warnings!"
|
444 |
msgstr "Envoi en cours mais avec des avertissements!"
|
445 |
|
446 |
-
#: lib/wfu_constants.php:
|
447 |
msgid "Upload in progress but some files already failed!"
|
448 |
msgstr "Envoi en cours mais certains fichiers ont échoués!"
|
449 |
|
450 |
-
#: lib/wfu_constants.php:
|
451 |
msgid "Upload in progress but no files uploaded so far!"
|
452 |
msgstr "Envoi en cours mais aucun fichiers n'a été envoyé pour le moment!"
|
453 |
|
454 |
-
#: lib/wfu_constants.php:
|
455 |
msgid "All files uploaded successfully"
|
456 |
msgstr "Tous les fichiers ont été envoyés avec succès"
|
457 |
|
458 |
-
#: lib/wfu_constants.php:
|
459 |
msgid "All files uploaded successfully but there are warnings!"
|
460 |
msgstr ""
|
461 |
"Tous les fichiers ont été envoyer avec succès mais avec des avertissements!"
|
462 |
|
463 |
-
#: lib/wfu_constants.php:
|
464 |
msgid "File uploaded successfully but there are warnings!"
|
465 |
msgstr "Fichiers envoyés avec succès mais certain avec un avertissement."
|
466 |
|
467 |
-
#: lib/wfu_constants.php:
|
468 |
msgid "Some files failed to upload!"
|
469 |
msgstr "Certains fichiers n'ont pas été envoyé"
|
470 |
|
471 |
-
#: lib/wfu_constants.php:
|
472 |
msgid "All files failed to upload"
|
473 |
msgstr "Impossible d'envoyer les fichiers"
|
474 |
|
475 |
-
#: lib/wfu_constants.php:
|
476 |
msgid "File failed to upload"
|
477 |
msgstr "Impossible d'envoyer le fichier"
|
478 |
|
479 |
-
#: lib/wfu_constants.php:
|
480 |
msgid "There are no files to upload!"
|
481 |
msgstr "Il n'y a pas de fichiers à envoyer"
|
482 |
|
483 |
-
#: lib/wfu_constants.php:
|
484 |
msgid "Test upload message"
|
485 |
msgstr "Message de test d'upload"
|
486 |
|
487 |
-
#: lib/wfu_constants.php:
|
488 |
msgid "JSON parse warning!"
|
489 |
msgstr "Avertisements d'analyse JSON."
|
490 |
|
491 |
-
#: lib/wfu_constants.php:
|
492 |
msgid "please wait while redirecting..."
|
493 |
msgstr "merci de patienter pendans la redirection..."
|
494 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
495 |
#~ msgid "Upload File/Upload Files"
|
496 |
#~ msgstr "Envoyer le fichier/Envoyer les fichiers"
|
497 |
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: Wordpress File Upload\n"
|
4 |
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: 2015-04-14 14:00+0200\n"
|
6 |
+
"PO-Revision-Date: 2015-04-14 14:00+0200\n"
|
7 |
"Last-Translator: nickboss <nickboss@iptanus.com>\n"
|
8 |
"Language-Team: \n"
|
9 |
"Language: fr_FR\n"
|
12 |
"Content-Transfer-Encoding: 8bit\n"
|
13 |
"X-Poedit-KeywordsList: __;gettext;gettext_noop\n"
|
14 |
"X-Poedit-Basepath: ../\n"
|
15 |
+
"X-Generator: Poedit 1.7.5\n"
|
16 |
"X-Poedit-SearchPath-0: .\n"
|
17 |
|
18 |
#: lib/wfu_constants.php:7
|
27 |
msgid "Upload File"
|
28 |
msgstr "Envoyer de fichier"
|
29 |
|
30 |
+
#: lib/wfu_constants.php:27
|
31 |
msgid "File Upload Notification"
|
32 |
msgstr "Notification d'envoi de fichier"
|
33 |
|
34 |
+
#: lib/wfu_constants.php:28
|
35 |
msgid ""
|
36 |
"Dear Recipient,%n%%n% This is an automatic delivery message to notify you "
|
37 |
"that a new file has been uploaded.%n%%n%Best Regards"
|
39 |
"Cher Destinataire,%n%%n% Ceci est un message envoyé automatiquement pour "
|
40 |
"vous prevenir qu'un nouveau fichier a été uploadé. %n%%n%Cordialement"
|
41 |
|
42 |
+
#: lib/wfu_constants.php:34
|
43 |
#, fuzzy, php-format
|
44 |
msgid "File %filename% uploaded successfully"
|
45 |
msgstr "Le fichier %filename% a été correctement envoyé"
|
46 |
|
47 |
+
#: lib/wfu_constants.php:35
|
48 |
#, fuzzy, php-format
|
49 |
msgid "File %filename% uploaded successfully but with warnings"
|
50 |
msgstr ""
|
51 |
"Le fichier %filename% a été envoyé avec succès mais avec des avertissements"
|
52 |
|
53 |
+
#: lib/wfu_constants.php:36
|
54 |
msgid "File %filename% not uploaded"
|
55 |
msgstr "Le fichier %filename% n'a pas été envoyé"
|
56 |
|
57 |
+
#: lib/wfu_constants.php:37
|
58 |
msgid "File %filename% is being uploaded"
|
59 |
msgstr "Le fichier %filename% est en cours d'envoi"
|
60 |
|
61 |
+
#: lib/wfu_constants.php:55
|
62 |
msgid "Your message"
|
63 |
msgstr "Votre message"
|
64 |
|
65 |
+
#: lib/wfu_constants.php:60
|
66 |
msgid ""
|
67 |
"Error. Could not resolve ftp target filedir. Check the domain in 'ftpinfo' "
|
68 |
"attribute."
|
70 |
"Erreur. Impossible d'atteindre le repertoire ftp de destination. Vérifier le "
|
71 |
"domaine dans l'attribut 'ftpinfo'."
|
72 |
|
73 |
+
#: lib/wfu_constants.php:61
|
74 |
msgid "Error. Invalid ftp information. Check 'ftpinfo' attribute."
|
75 |
msgstr ""
|
76 |
"Erreur. Les informations de ftp sont invalides. Vérifier le domaine dans "
|
77 |
"l'attribut 'ftpinfo'."
|
78 |
|
79 |
+
#: lib/wfu_constants.php:62
|
80 |
msgid ""
|
81 |
"Error. Could not extract ftp information from 'ftpinfo' attribute. Check its "
|
82 |
"syntax."
|
84 |
"Erreur. Impossible d'obtenir les informations dans l'attribut 'ftpinfo'. "
|
85 |
"Vérifez sa syntax."
|
86 |
|
87 |
+
#: lib/wfu_constants.php:63
|
88 |
msgid ""
|
89 |
"Error. Could not resolve ftp target filename. Check the domain in 'ftpinfo' "
|
90 |
"attribute."
|
92 |
"Erreur. Impossible de résoudre le nom de fichier de destination ftp. "
|
93 |
"Vérifiez le domaine dans l'attribut 'ftpinfo'."
|
94 |
|
95 |
+
#: lib/wfu_constants.php:64
|
96 |
msgid ""
|
97 |
"Error. The upload size limit of PHP directive upload_max_filesize is "
|
98 |
"preventing the upload of big files.\n"
|
102 |
"upload_max_filesize, empêche l'envoi de gros fichier.\n"
|
103 |
"La limite de la directive PHP upload_max_filesize est de :"
|
104 |
|
105 |
+
#: lib/wfu_constants.php:65
|
106 |
msgid ""
|
107 |
"The upload time limit of PHP directive max_input_time is preventing the "
|
108 |
"upload of big files.\n"
|
112 |
"l'envoi de gros fichier.\n"
|
113 |
"La limite de la directive PHP max_input_time est de :"
|
114 |
|
115 |
+
#: lib/wfu_constants.php:66
|
116 |
msgid ""
|
117 |
"Error. Permission denied to write to target folder.\n"
|
118 |
"Check and correct read/write permissions of target folder."
|
121 |
"Vérifiez et corrigez les permission en lecture/ecriture du repertoire de "
|
122 |
"destination."
|
123 |
|
124 |
+
#: lib/wfu_constants.php:67
|
125 |
msgid "Targer folder doesn't exist."
|
126 |
msgstr "Le répertoire de destination n'existe pas."
|
127 |
|
128 |
+
#: lib/wfu_constants.php:68
|
129 |
msgid "Upload failed! Missing a temporary folder."
|
130 |
msgstr "Envoi impossible! Il manque un répertoire temporaire."
|
131 |
|
132 |
+
#: lib/wfu_constants.php:69
|
133 |
msgid "Upload failed! Permission denied to write to target folder."
|
134 |
msgstr ""
|
135 |
"Envoi impossible! Permission refusée dans le répertoire de destination."
|
136 |
|
137 |
+
#: lib/wfu_constants.php:70
|
138 |
msgid "File not allowed."
|
139 |
msgstr "Type de fichier non autorisé."
|
140 |
|
141 |
+
#: lib/wfu_constants.php:71
|
142 |
msgid "The uploaded file exceeds the file size limit."
|
143 |
msgstr "La taille du fichier est supérieure à la taille limite."
|
144 |
|
145 |
+
#: lib/wfu_constants.php:72
|
146 |
+
msgid "The uploaded file exceeds 2GB and is not supported by this server."
|
147 |
+
msgstr ""
|
148 |
+
|
149 |
+
#: lib/wfu_constants.php:73
|
150 |
msgid ""
|
151 |
"Upload failed! The uploaded file exceeds the file size limit of the server. "
|
152 |
"Please contact the administrator."
|
154 |
"Envoi impossible! La taille du fichier excède la taille limite du serveur. "
|
155 |
"Merci de contacter l'administrateur."
|
156 |
|
157 |
+
#: lib/wfu_constants.php:74
|
158 |
msgid ""
|
159 |
"Upload failed! The duration of the upload exceeded the time limit of the "
|
160 |
"server. Please contact the administrator."
|
162 |
"Envoi impossible! La durée maximum d'envoi sur le serveur excède la durée "
|
163 |
"limite du serveur. Merci de contacter l'administrateur."
|
164 |
|
165 |
+
#: lib/wfu_constants.php:75
|
166 |
msgid ""
|
167 |
"Upload failed! The uploaded file exceeds the MAX_FILE_SIZE directive that "
|
168 |
"was specified in the HTML form."
|
170 |
"Envoi impossible! La taille du fichier excède la directive MAX_FILE_SIZE "
|
171 |
"spécifiée dans le formulaire HTML."
|
172 |
|
173 |
+
#: lib/wfu_constants.php:76
|
174 |
msgid "Upload failed! The uploaded file was only partially uploaded."
|
175 |
msgstr "Envoi impossible! Le fichier à été partiellement envoyé."
|
176 |
|
177 |
+
#: lib/wfu_constants.php:77
|
178 |
msgid "Upload failed! No file was uploaded."
|
179 |
msgstr "Envoi impossible! Le fichier n'a pas été envoyé."
|
180 |
|
181 |
+
#: lib/wfu_constants.php:78
|
182 |
msgid "Upload failed! Failed to write file to disk."
|
183 |
msgstr "Envoi impossible! Impossible d'écrire sur le fichier sur le disque."
|
184 |
|
185 |
+
#: lib/wfu_constants.php:79
|
186 |
msgid ""
|
187 |
"Upload failed! Error occured while moving temporary file. Please contact "
|
188 |
"administrator."
|
190 |
"Envoi impossible! Une erreur est survenue lors du déplacement du fichier "
|
191 |
"temporaire. merci de contacter l'administrateur."
|
192 |
|
193 |
+
#: lib/wfu_constants.php:80
|
194 |
msgid ""
|
195 |
"Upload failed! A PHP extension stopped the file upload. PHP does not provide "
|
196 |
"a way to ascertain which extension caused the file upload to stop; examining "
|
200 |
"pas fournir avec certitude quelle extension est en cause; examiner la liste "
|
201 |
"des extensions chargées avec phpinfo() peut être nécessaire."
|
202 |
|
203 |
+
#: lib/wfu_constants.php:81
|
204 |
msgid "Upload failed! Error occured while attemting to upload the file."
|
205 |
msgstr ""
|
206 |
"Envoi impossible! Une erreur est survenue pendant la tentative d'envoi du "
|
207 |
"fichier."
|
208 |
|
209 |
+
#: lib/wfu_constants.php:82
|
210 |
msgid "Upload failed!"
|
211 |
msgstr "Envoi impossible!"
|
212 |
|
213 |
+
#: lib/wfu_constants.php:83
|
214 |
msgid "No file!"
|
215 |
msgstr "Pas de fichier!"
|
216 |
|
217 |
+
#: lib/wfu_constants.php:84
|
218 |
msgid ""
|
219 |
"Upload failed! The upload has been canceled by the user or the browser "
|
220 |
"dropped the connection."
|
222 |
"Envoi impossible! L'envoi a été annulé par l'utilisateur ou le navigateur à "
|
223 |
"cassé la connexion."
|
224 |
|
225 |
+
#: lib/wfu_constants.php:85
|
226 |
msgid "Upload failed! Unknown error."
|
227 |
msgstr "Envoi impossible! Erreur inconnue."
|
228 |
|
229 |
+
#: lib/wfu_constants.php:86
|
230 |
msgid "Please contact the administrator."
|
231 |
msgstr "Merci de contacter l'administrateur."
|
232 |
|
233 |
+
#: lib/wfu_constants.php:87
|
234 |
msgid "No result from remote server!"
|
235 |
msgstr "Pas de résultat du serveur distant!"
|
236 |
|
237 |
+
#: lib/wfu_constants.php:88
|
238 |
msgid " but with warnings"
|
239 |
msgstr "mais avec des avertissements"
|
240 |
|
241 |
+
#: lib/wfu_constants.php:89 lib/wfu_constants.php:91
|
242 |
msgid "Warning: JSON parse error."
|
243 |
msgstr "Attention: Erreur d'analyse JSON"
|
244 |
|
245 |
+
#: lib/wfu_constants.php:90
|
246 |
msgid ""
|
247 |
"Upload parameters of this file, passed as JSON string to the handler, could "
|
248 |
"not be parsed."
|
250 |
"Les paramètres d'envoi de ce fichier, passés en tant que chaine JSON, ne "
|
251 |
"peuvent pas être analysés."
|
252 |
|
253 |
+
#: lib/wfu_constants.php:92
|
254 |
msgid ""
|
255 |
"UploadStates, passed as JSON string to the handler, could not be parsed."
|
256 |
msgstr "UploadStates, passé en tant que chaine JSON, ne peut pas être analysé."
|
257 |
|
258 |
+
#: lib/wfu_constants.php:93
|
259 |
msgid ""
|
260 |
"Redirection to classic form functionality occurred due to unknown error."
|
261 |
msgstr ""
|
262 |
"La redirection vers la fonctionalité classique des formulaire s'est produit "
|
263 |
"à cause d'une erreur inconue."
|
264 |
|
265 |
+
#: lib/wfu_constants.php:94
|
266 |
msgid ""
|
267 |
"Redirection to classic form functionality occurred because AJAX is not "
|
268 |
"supported."
|
270 |
"La redirection vers la fonctionalité classique des formulaire s'est produit "
|
271 |
"car AJAX n'est pas supporté."
|
272 |
|
273 |
+
#: lib/wfu_constants.php:95
|
274 |
msgid ""
|
275 |
"Redirection to classic form functionality occurred because HTML5 is not "
|
276 |
"supported."
|
278 |
"La redirection vers la fonctionalité classique des formulaire s'est produit "
|
279 |
"car HTML5 n'est pas supporté."
|
280 |
|
281 |
+
#: lib/wfu_constants.php:96
|
282 |
msgid ""
|
283 |
"Redirection to classic form functionality occurred due to JSON parse error."
|
284 |
msgstr ""
|
285 |
"La redirection vers la fonctionalité classique des formulaire s'est produit "
|
286 |
"à cause d'une erreur d'analyse JSON."
|
287 |
|
288 |
+
#: lib/wfu_constants.php:97
|
289 |
msgid "cannot be empty!"
|
290 |
msgstr "ne peut pas être vide!"
|
291 |
|
292 |
+
#: lib/wfu_constants.php:98
|
293 |
+
msgid ""
|
294 |
+
"There are more than one instances of the plugin in this page with the same "
|
295 |
+
"id. Please change it."
|
296 |
+
msgstr ""
|
297 |
+
|
298 |
+
#: lib/wfu_constants.php:99
|
299 |
+
msgid ""
|
300 |
+
"Cannot edit the shortcode because the page has been modified. Please reload "
|
301 |
+
"the page."
|
302 |
+
msgstr ""
|
303 |
+
|
304 |
+
#: lib/wfu_constants.php:102
|
305 |
msgid "Upload skipped! File already exists."
|
306 |
msgstr "Envoi passé! Le fichier existe déjà."
|
307 |
|
308 |
+
#: lib/wfu_constants.php:103
|
309 |
msgid "No files have been selected!"
|
310 |
msgstr "Aucun fichier n'a été envoyés!"
|
311 |
|
312 |
+
#: lib/wfu_constants.php:104
|
313 |
msgid "WPFilebase Plugin not updated because there were no files uploaded."
|
314 |
msgstr ""
|
315 |
"WPFilebase Plugin n'a pas été mis à jour car il n'y a pas de fichiers à "
|
316 |
"envoyer."
|
317 |
|
318 |
+
#: lib/wfu_constants.php:105
|
319 |
msgid "Notification email was not sent because there were no files uploaded."
|
320 |
msgstr ""
|
321 |
"Le mail de notification n'a pas été envoyé car il n'y a pas de fichiers à "
|
322 |
"envoyer."
|
323 |
|
324 |
+
#: lib/wfu_constants.php:106
|
325 |
msgid ""
|
326 |
"Notification email was not sent because no recipients were defined. Please "
|
327 |
"check notifyrecipients attribute in the shortcode."
|
329 |
"Le mail de notification n'a pas été envoyé car il n'y a pas de destinataire. "
|
330 |
"Merci de vérifier l'attribut notifyrecipients dans le shortcode."
|
331 |
|
332 |
+
#: lib/wfu_constants.php:107
|
333 |
msgid ""
|
334 |
"Notification email was not sent due to an error. Please check "
|
335 |
"notifyrecipients, notifysubject and notifymessage attributes for errors."
|
337 |
"Le mail de notification n'a pas été envoyé car il n'y a une erreur. Merci de "
|
338 |
"vérifier les attributs notifyrecipients, notifysubject et notifymessage."
|
339 |
|
340 |
+
#: lib/wfu_constants.php:108
|
341 |
msgid ""
|
342 |
"Redirection not executed because redirection link is empty. Please check "
|
343 |
"redirectlink attribute."
|
345 |
"La redirection n'a pas été effectuée car le lien de redirection est vide. "
|
346 |
"Merci de vérifier l'attribut redirectlink."
|
347 |
|
348 |
+
#: lib/wfu_constants.php:109
|
349 |
msgid ""
|
350 |
"Redirection not executed because not all files were successfully uploaded."
|
351 |
msgstr ""
|
352 |
"La redirection n'est pas éxécuté car tous les fichiers n'ont pas été envoyés."
|
353 |
|
354 |
+
#: lib/wfu_constants.php:112
|
355 |
msgid "Test Mode"
|
356 |
msgstr "Mode de test"
|
357 |
|
358 |
+
#: lib/wfu_constants.php:113
|
359 |
+
msgid "select dir..."
|
360 |
+
msgstr ""
|
361 |
+
|
362 |
+
#: lib/wfu_constants.php:114
|
363 |
msgid "Upload path: %filepath%"
|
364 |
msgstr "Chemin d'Upload : %filepath%"
|
365 |
|
366 |
+
#: lib/wfu_constants.php:115
|
367 |
msgid "Failed upload path: %filepath%"
|
368 |
msgstr "Mauvais répertoir d'envoi: %filepath%"
|
369 |
|
370 |
+
#: lib/wfu_constants.php:116
|
371 |
+
msgid " (required)"
|
372 |
+
msgstr ""
|
373 |
+
|
374 |
+
#: lib/wfu_constants.php:117
|
375 |
+
msgid "Files are being uploaded. Are you sure you want to exit the page?"
|
376 |
+
msgstr ""
|
377 |
+
|
378 |
+
#: lib/wfu_constants.php:120
|
379 |
msgid "This is a test message"
|
380 |
msgstr "Ceci est un message de test"
|
381 |
|
382 |
+
#: lib/wfu_constants.php:121
|
383 |
msgid "This is a test administrator message"
|
384 |
msgstr "Ceci est un message administrateur de test"
|
385 |
|
386 |
+
#: lib/wfu_constants.php:122
|
387 |
msgid "File testfile 1 under test"
|
388 |
msgstr "File testfile 1 under test"
|
389 |
|
390 |
+
#: lib/wfu_constants.php:123
|
391 |
msgid "File testfile 1 message"
|
392 |
msgstr "File testfile 1 message"
|
393 |
|
394 |
+
#: lib/wfu_constants.php:124
|
395 |
msgid "File testfile 1 administrator message"
|
396 |
msgstr "Message administrateur File testfile"
|
397 |
|
398 |
+
#: lib/wfu_constants.php:125
|
399 |
msgid "File testfile 2 under test"
|
400 |
msgstr "En test File testfile"
|
401 |
|
402 |
+
#: lib/wfu_constants.php:126
|
403 |
msgid "File testfile 2 message"
|
404 |
msgstr "Message File testfile 2"
|
405 |
|
406 |
+
#: lib/wfu_constants.php:127
|
407 |
msgid "File testfile 2 administrator message"
|
408 |
msgstr "Message administrateur File testfile 2"
|
409 |
|
410 |
+
#: lib/wfu_constants.php:130
|
411 |
+
msgid ""
|
412 |
+
"Failed to edit the shortcode because the contents of the page changed. Try "
|
413 |
+
"again to edit the shortcode."
|
414 |
+
msgstr ""
|
415 |
+
|
416 |
+
#: lib/wfu_constants.php:131
|
417 |
+
msgid ""
|
418 |
+
"The page containing the shortcode has been modified and it is no longer "
|
419 |
+
"valid. Please go back to reload the shortcode."
|
420 |
+
msgstr ""
|
421 |
+
|
422 |
+
#: lib/wfu_constants.php:132
|
423 |
+
msgid ""
|
424 |
+
"Failed to update the shortcode because the contents of the page changed. Go "
|
425 |
+
"back to reload the shortcode."
|
426 |
+
msgstr ""
|
427 |
+
|
428 |
+
#: lib/wfu_constants.php:133
|
429 |
+
msgid ""
|
430 |
+
"Failed to update the shortcode. Please try again. If the problem persists, "
|
431 |
+
"go back and reload the shortcode."
|
432 |
+
msgstr ""
|
433 |
+
|
434 |
+
#: lib/wfu_constants.php:136
|
435 |
+
msgid ""
|
436 |
+
"Insert variable %userid% inside text. It will be replaced by the id of the "
|
437 |
+
"current user."
|
438 |
+
msgstr ""
|
439 |
+
|
440 |
+
#: lib/wfu_constants.php:137
|
441 |
msgid ""
|
442 |
"Insert variable %username% inside text. It will be replaced by the username "
|
443 |
"of the current user."
|
445 |
"Insérez la variable %username% dans le texte. Il sera remplacé par le "
|
446 |
"username de l'utilisateur courant."
|
447 |
|
448 |
+
#: lib/wfu_constants.php:138
|
449 |
msgid ""
|
450 |
"Insert variable %useremail% inside text. It will be replaced by the email of "
|
451 |
"the current user."
|
453 |
"Insérez la variable %useremail% dans le texte. Il sera remplacé par l'email "
|
454 |
"de l'utilisateur courant."
|
455 |
|
456 |
+
#: lib/wfu_constants.php:139
|
457 |
msgid ""
|
458 |
"Insert variable %filename% inside text. It will be replaced by the filename "
|
459 |
"of the uploaded file."
|
461 |
"Insérez la variable %filename% dans le texte. Il sera remplacé par le nom du "
|
462 |
"fichier à envoyer."
|
463 |
|
464 |
+
#: lib/wfu_constants.php:140
|
465 |
msgid ""
|
466 |
"Insert variable %filepath% inside text. It will be replaced by the full "
|
467 |
"filepath of the uploaded file."
|
469 |
"Insérez la variable %filepath% dans le texte. Il sera remplacé par le chemin "
|
470 |
"complet du fichier envoyé."
|
471 |
|
472 |
+
#: lib/wfu_constants.php:141
|
473 |
msgid ""
|
474 |
"Insert variable %blogid% inside text. It will be replaced by the blog id of "
|
475 |
"the website."
|
477 |
"Insérez la variable %blogid% dans le texte. Il sera remplacé par l'id du "
|
478 |
"blog du site web."
|
479 |
|
480 |
+
#: lib/wfu_constants.php:142
|
481 |
+
msgid ""
|
482 |
+
"Insert variable %pageid% inside text. It will be replaced by the id of the "
|
483 |
+
"current page."
|
484 |
+
msgstr ""
|
485 |
+
|
486 |
+
#: lib/wfu_constants.php:143
|
487 |
+
msgid ""
|
488 |
+
"Insert variable %pagetitle% inside text. It will be replaced by the title of "
|
489 |
+
"the current page."
|
490 |
+
msgstr ""
|
491 |
+
|
492 |
+
#: lib/wfu_constants.php:144
|
493 |
msgid ""
|
494 |
"Insert variable %userdataXXX% inside text. Select the user field from the "
|
495 |
"drop-down list. It will be replaced by the value that the user entered in "
|
499 |
"l'utilisateur dans la liste déroulante. Il sera remplacé par la valeur que "
|
500 |
"l'utilisateur aura entré dans ce champs."
|
501 |
|
502 |
+
#: lib/wfu_constants.php:145
|
503 |
msgid "Insert variable %n% inside text to denote a line change."
|
504 |
msgstr ""
|
505 |
"Insérez la variable %n% à l'intérieur du texte pour indiquer un changement "
|
506 |
"de ligne."
|
507 |
|
508 |
+
#: lib/wfu_constants.php:148
|
509 |
msgid "Upload in progress"
|
510 |
msgstr "Envoi en cours"
|
511 |
|
512 |
+
#: lib/wfu_constants.php:149
|
513 |
msgid "Upload in progress with warnings!"
|
514 |
msgstr "Envoi en cours mais avec des avertissements!"
|
515 |
|
516 |
+
#: lib/wfu_constants.php:150
|
517 |
msgid "Upload in progress but some files already failed!"
|
518 |
msgstr "Envoi en cours mais certains fichiers ont échoués!"
|
519 |
|
520 |
+
#: lib/wfu_constants.php:151
|
521 |
msgid "Upload in progress but no files uploaded so far!"
|
522 |
msgstr "Envoi en cours mais aucun fichiers n'a été envoyé pour le moment!"
|
523 |
|
524 |
+
#: lib/wfu_constants.php:152
|
525 |
msgid "All files uploaded successfully"
|
526 |
msgstr "Tous les fichiers ont été envoyés avec succès"
|
527 |
|
528 |
+
#: lib/wfu_constants.php:153
|
529 |
msgid "All files uploaded successfully but there are warnings!"
|
530 |
msgstr ""
|
531 |
"Tous les fichiers ont été envoyer avec succès mais avec des avertissements!"
|
532 |
|
533 |
+
#: lib/wfu_constants.php:154
|
534 |
msgid "File uploaded successfully but there are warnings!"
|
535 |
msgstr "Fichiers envoyés avec succès mais certain avec un avertissement."
|
536 |
|
537 |
+
#: lib/wfu_constants.php:155
|
538 |
msgid "Some files failed to upload!"
|
539 |
msgstr "Certains fichiers n'ont pas été envoyé"
|
540 |
|
541 |
+
#: lib/wfu_constants.php:156
|
542 |
msgid "All files failed to upload"
|
543 |
msgstr "Impossible d'envoyer les fichiers"
|
544 |
|
545 |
+
#: lib/wfu_constants.php:157
|
546 |
msgid "File failed to upload"
|
547 |
msgstr "Impossible d'envoyer le fichier"
|
548 |
|
549 |
+
#: lib/wfu_constants.php:158
|
550 |
msgid "There are no files to upload!"
|
551 |
msgstr "Il n'y a pas de fichiers à envoyer"
|
552 |
|
553 |
+
#: lib/wfu_constants.php:159
|
554 |
msgid "Test upload message"
|
555 |
msgstr "Message de test d'upload"
|
556 |
|
557 |
+
#: lib/wfu_constants.php:160
|
558 |
msgid "JSON parse warning!"
|
559 |
msgstr "Avertisements d'analyse JSON."
|
560 |
|
561 |
+
#: lib/wfu_constants.php:161
|
562 |
msgid "please wait while redirecting..."
|
563 |
msgstr "merci de patienter pendans la redirection..."
|
564 |
|
565 |
+
#: lib/wfu_constants.php:162
|
566 |
+
msgid "Open visual shortcode editor in new window"
|
567 |
+
msgstr ""
|
568 |
+
|
569 |
+
#: lib/wfu_constants.php:163
|
570 |
+
msgid "loading visual editor"
|
571 |
+
msgstr ""
|
572 |
+
|
573 |
#~ msgid "Upload File/Upload Files"
|
574 |
#~ msgstr "Envoyer le fichier/Envoyer les fichiers"
|
575 |
|
languages/wordpress-file-upload.pot
CHANGED
@@ -2,8 +2,8 @@ msgid ""
|
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: Wordpress File Upload\n"
|
4 |
"Report-Msgid-Bugs-To: \n"
|
5 |
-
"POT-Creation-Date:
|
6 |
-
"PO-Revision-Date:
|
7 |
"Last-Translator: nickboss <info@iptanus.com>\n"
|
8 |
"Language-Team: Iptanus Team <info@iptanus.com>\n"
|
9 |
"Language: en\n"
|
@@ -13,7 +13,7 @@ msgstr ""
|
|
13 |
"X-Poedit-KeywordsList: __;gettext;gettext_noop\n"
|
14 |
"X-Poedit-Basepath: ../\n"
|
15 |
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
16 |
-
"X-Generator: Poedit 1.
|
17 |
"X-Poedit-SearchPath-0: .\n"
|
18 |
|
19 |
#: lib/wfu_constants.php:7
|
@@ -28,420 +28,472 @@ msgstr ""
|
|
28 |
msgid "Upload File"
|
29 |
msgstr ""
|
30 |
|
31 |
-
#: lib/wfu_constants.php:
|
32 |
msgid "File Upload Notification"
|
33 |
msgstr ""
|
34 |
|
35 |
-
#: lib/wfu_constants.php:
|
36 |
msgid ""
|
37 |
"Dear Recipient,%n%%n% This is an automatic delivery message to notify you "
|
38 |
"that a new file has been uploaded.%n%%n%Best Regards"
|
39 |
msgstr ""
|
40 |
|
41 |
-
#: lib/wfu_constants.php:
|
42 |
#, php-format
|
43 |
msgid "File %filename% uploaded successfully"
|
44 |
msgstr ""
|
45 |
|
46 |
-
#: lib/wfu_constants.php:
|
47 |
#, php-format
|
48 |
msgid "File %filename% uploaded successfully but with warnings"
|
49 |
msgstr ""
|
50 |
|
51 |
-
#: lib/wfu_constants.php:
|
52 |
msgid "File %filename% not uploaded"
|
53 |
msgstr ""
|
54 |
|
55 |
-
#: lib/wfu_constants.php:
|
56 |
msgid "File %filename% is being uploaded"
|
57 |
msgstr ""
|
58 |
|
59 |
-
#: lib/wfu_constants.php:
|
60 |
msgid "Your message"
|
61 |
msgstr ""
|
62 |
|
63 |
-
#: lib/wfu_constants.php:
|
64 |
msgid ""
|
65 |
"Error. Could not resolve ftp target filedir. Check the domain in 'ftpinfo' "
|
66 |
"attribute."
|
67 |
msgstr ""
|
68 |
|
69 |
-
#: lib/wfu_constants.php:
|
70 |
msgid "Error. Invalid ftp information. Check 'ftpinfo' attribute."
|
71 |
msgstr ""
|
72 |
|
73 |
-
#: lib/wfu_constants.php:
|
74 |
msgid ""
|
75 |
"Error. Could not extract ftp information from 'ftpinfo' attribute. Check its "
|
76 |
"syntax."
|
77 |
msgstr ""
|
78 |
|
79 |
-
#: lib/wfu_constants.php:
|
80 |
msgid ""
|
81 |
"Error. Could not resolve ftp target filename. Check the domain in 'ftpinfo' "
|
82 |
"attribute."
|
83 |
msgstr ""
|
84 |
|
85 |
-
#: lib/wfu_constants.php:
|
86 |
msgid ""
|
87 |
"Error. The upload size limit of PHP directive upload_max_filesize is "
|
88 |
"preventing the upload of big files.\n"
|
89 |
"PHP directive upload_max_filesize limit is: "
|
90 |
msgstr ""
|
91 |
|
92 |
-
#: lib/wfu_constants.php:
|
93 |
msgid ""
|
94 |
"The upload time limit of PHP directive max_input_time is preventing the "
|
95 |
"upload of big files.\n"
|
96 |
"PHP directive max_input_time limit is: "
|
97 |
msgstr ""
|
98 |
|
99 |
-
#: lib/wfu_constants.php:
|
100 |
msgid ""
|
101 |
"Error. Permission denied to write to target folder.\n"
|
102 |
"Check and correct read/write permissions of target folder."
|
103 |
msgstr ""
|
104 |
|
105 |
-
#: lib/wfu_constants.php:
|
106 |
msgid "Targer folder doesn't exist."
|
107 |
msgstr ""
|
108 |
|
109 |
-
#: lib/wfu_constants.php:
|
110 |
msgid "Upload failed! Missing a temporary folder."
|
111 |
msgstr ""
|
112 |
|
113 |
-
#: lib/wfu_constants.php:
|
114 |
msgid "Upload failed! Permission denied to write to target folder."
|
115 |
msgstr ""
|
116 |
|
117 |
-
#: lib/wfu_constants.php:
|
118 |
msgid "File not allowed."
|
119 |
msgstr ""
|
120 |
|
121 |
-
#: lib/wfu_constants.php:
|
122 |
msgid "The uploaded file exceeds the file size limit."
|
123 |
msgstr ""
|
124 |
|
125 |
-
#: lib/wfu_constants.php:
|
|
|
|
|
|
|
|
|
126 |
msgid ""
|
127 |
"Upload failed! The uploaded file exceeds the file size limit of the server. "
|
128 |
"Please contact the administrator."
|
129 |
msgstr ""
|
130 |
|
131 |
-
#: lib/wfu_constants.php:
|
132 |
msgid ""
|
133 |
"Upload failed! The duration of the upload exceeded the time limit of the "
|
134 |
"server. Please contact the administrator."
|
135 |
msgstr ""
|
136 |
|
137 |
-
#: lib/wfu_constants.php:
|
138 |
msgid ""
|
139 |
"Upload failed! The uploaded file exceeds the MAX_FILE_SIZE directive that "
|
140 |
"was specified in the HTML form."
|
141 |
msgstr ""
|
142 |
|
143 |
-
#: lib/wfu_constants.php:
|
144 |
msgid "Upload failed! The uploaded file was only partially uploaded."
|
145 |
msgstr ""
|
146 |
|
147 |
-
#: lib/wfu_constants.php:
|
148 |
msgid "Upload failed! No file was uploaded."
|
149 |
msgstr ""
|
150 |
|
151 |
-
#: lib/wfu_constants.php:
|
152 |
msgid "Upload failed! Failed to write file to disk."
|
153 |
msgstr ""
|
154 |
|
155 |
-
#: lib/wfu_constants.php:
|
156 |
msgid ""
|
157 |
"Upload failed! Error occured while moving temporary file. Please contact "
|
158 |
"administrator."
|
159 |
msgstr ""
|
160 |
|
161 |
-
#: lib/wfu_constants.php:
|
162 |
msgid ""
|
163 |
"Upload failed! A PHP extension stopped the file upload. PHP does not provide "
|
164 |
"a way to ascertain which extension caused the file upload to stop; examining "
|
165 |
"the list of loaded extensions with phpinfo() may help."
|
166 |
msgstr ""
|
167 |
|
168 |
-
#: lib/wfu_constants.php:
|
169 |
msgid "Upload failed! Error occured while attemting to upload the file."
|
170 |
msgstr ""
|
171 |
|
172 |
-
#: lib/wfu_constants.php:
|
173 |
msgid "Upload failed!"
|
174 |
msgstr ""
|
175 |
|
176 |
-
#: lib/wfu_constants.php:
|
177 |
msgid "No file!"
|
178 |
msgstr ""
|
179 |
|
180 |
-
#: lib/wfu_constants.php:
|
181 |
msgid ""
|
182 |
"Upload failed! The upload has been canceled by the user or the browser "
|
183 |
"dropped the connection."
|
184 |
msgstr ""
|
185 |
|
186 |
-
#: lib/wfu_constants.php:
|
187 |
msgid "Upload failed! Unknown error."
|
188 |
msgstr ""
|
189 |
|
190 |
-
#: lib/wfu_constants.php:
|
191 |
msgid "Please contact the administrator."
|
192 |
msgstr ""
|
193 |
|
194 |
-
#: lib/wfu_constants.php:
|
195 |
msgid "No result from remote server!"
|
196 |
msgstr ""
|
197 |
|
198 |
-
#: lib/wfu_constants.php:
|
199 |
msgid " but with warnings"
|
200 |
msgstr ""
|
201 |
|
202 |
-
#: lib/wfu_constants.php:
|
203 |
msgid "Warning: JSON parse error."
|
204 |
msgstr ""
|
205 |
|
206 |
-
#: lib/wfu_constants.php:
|
207 |
msgid ""
|
208 |
"Upload parameters of this file, passed as JSON string to the handler, could "
|
209 |
"not be parsed."
|
210 |
msgstr ""
|
211 |
|
212 |
-
#: lib/wfu_constants.php:
|
213 |
msgid ""
|
214 |
"UploadStates, passed as JSON string to the handler, could not be parsed."
|
215 |
msgstr ""
|
216 |
|
217 |
-
#: lib/wfu_constants.php:
|
218 |
msgid ""
|
219 |
"Redirection to classic form functionality occurred due to unknown error."
|
220 |
msgstr ""
|
221 |
|
222 |
-
#: lib/wfu_constants.php:
|
223 |
msgid ""
|
224 |
"Redirection to classic form functionality occurred because AJAX is not "
|
225 |
"supported."
|
226 |
msgstr ""
|
227 |
|
228 |
-
#: lib/wfu_constants.php:
|
229 |
msgid ""
|
230 |
"Redirection to classic form functionality occurred because HTML5 is not "
|
231 |
"supported."
|
232 |
msgstr ""
|
233 |
|
234 |
-
#: lib/wfu_constants.php:
|
235 |
msgid ""
|
236 |
"Redirection to classic form functionality occurred due to JSON parse error."
|
237 |
msgstr ""
|
238 |
|
239 |
-
#: lib/wfu_constants.php:
|
240 |
msgid "cannot be empty!"
|
241 |
msgstr ""
|
242 |
|
243 |
-
#: lib/wfu_constants.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
244 |
msgid "Upload skipped! File already exists."
|
245 |
msgstr ""
|
246 |
|
247 |
-
#: lib/wfu_constants.php:
|
248 |
msgid "No files have been selected!"
|
249 |
msgstr ""
|
250 |
|
251 |
-
#: lib/wfu_constants.php:
|
252 |
msgid "WPFilebase Plugin not updated because there were no files uploaded."
|
253 |
msgstr ""
|
254 |
|
255 |
-
#: lib/wfu_constants.php:
|
256 |
msgid "Notification email was not sent because there were no files uploaded."
|
257 |
msgstr ""
|
258 |
|
259 |
-
#: lib/wfu_constants.php:
|
260 |
msgid ""
|
261 |
"Notification email was not sent because no recipients were defined. Please "
|
262 |
"check notifyrecipients attribute in the shortcode."
|
263 |
msgstr ""
|
264 |
|
265 |
-
#: lib/wfu_constants.php:
|
266 |
msgid ""
|
267 |
"Notification email was not sent due to an error. Please check "
|
268 |
"notifyrecipients, notifysubject and notifymessage attributes for errors."
|
269 |
msgstr ""
|
270 |
|
271 |
-
#: lib/wfu_constants.php:
|
272 |
msgid ""
|
273 |
"Redirection not executed because redirection link is empty. Please check "
|
274 |
"redirectlink attribute."
|
275 |
msgstr ""
|
276 |
|
277 |
-
#: lib/wfu_constants.php:
|
278 |
msgid ""
|
279 |
"Redirection not executed because not all files were successfully uploaded."
|
280 |
msgstr ""
|
281 |
|
282 |
-
#: lib/wfu_constants.php:
|
283 |
msgid "Test Mode"
|
284 |
msgstr ""
|
285 |
|
286 |
-
#: lib/wfu_constants.php:
|
287 |
msgid "select dir..."
|
288 |
msgstr ""
|
289 |
|
290 |
-
#: lib/wfu_constants.php:
|
291 |
msgid "Upload path: %filepath%"
|
292 |
msgstr ""
|
293 |
|
294 |
-
#: lib/wfu_constants.php:
|
295 |
msgid "Failed upload path: %filepath%"
|
296 |
msgstr ""
|
297 |
|
298 |
-
#: lib/wfu_constants.php:
|
299 |
msgid " (required)"
|
300 |
msgstr ""
|
301 |
|
302 |
-
#: lib/wfu_constants.php:
|
|
|
|
|
|
|
|
|
303 |
msgid "This is a test message"
|
304 |
msgstr ""
|
305 |
|
306 |
-
#: lib/wfu_constants.php:
|
307 |
msgid "This is a test administrator message"
|
308 |
msgstr ""
|
309 |
|
310 |
-
#: lib/wfu_constants.php:
|
311 |
msgid "File testfile 1 under test"
|
312 |
msgstr ""
|
313 |
|
314 |
-
#: lib/wfu_constants.php:
|
315 |
msgid "File testfile 1 message"
|
316 |
msgstr ""
|
317 |
|
318 |
-
#: lib/wfu_constants.php:
|
319 |
msgid "File testfile 1 administrator message"
|
320 |
msgstr ""
|
321 |
|
322 |
-
#: lib/wfu_constants.php:
|
323 |
msgid "File testfile 2 under test"
|
324 |
msgstr ""
|
325 |
|
326 |
-
#: lib/wfu_constants.php:
|
327 |
msgid "File testfile 2 message"
|
328 |
msgstr ""
|
329 |
|
330 |
-
#: lib/wfu_constants.php:
|
331 |
msgid "File testfile 2 administrator message"
|
332 |
msgstr ""
|
333 |
|
334 |
-
#: lib/wfu_constants.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
335 |
msgid ""
|
336 |
"Insert variable %userid% inside text. It will be replaced by the id of the "
|
337 |
"current user."
|
338 |
msgstr ""
|
339 |
|
340 |
-
#: lib/wfu_constants.php:
|
341 |
msgid ""
|
342 |
"Insert variable %username% inside text. It will be replaced by the username "
|
343 |
"of the current user."
|
344 |
msgstr ""
|
345 |
|
346 |
-
#: lib/wfu_constants.php:
|
347 |
msgid ""
|
348 |
"Insert variable %useremail% inside text. It will be replaced by the email of "
|
349 |
"the current user."
|
350 |
msgstr ""
|
351 |
|
352 |
-
#: lib/wfu_constants.php:
|
353 |
msgid ""
|
354 |
"Insert variable %filename% inside text. It will be replaced by the filename "
|
355 |
"of the uploaded file."
|
356 |
msgstr ""
|
357 |
|
358 |
-
#: lib/wfu_constants.php:
|
359 |
msgid ""
|
360 |
"Insert variable %filepath% inside text. It will be replaced by the full "
|
361 |
"filepath of the uploaded file."
|
362 |
msgstr ""
|
363 |
|
364 |
-
#: lib/wfu_constants.php:
|
365 |
msgid ""
|
366 |
"Insert variable %blogid% inside text. It will be replaced by the blog id of "
|
367 |
"the website."
|
368 |
msgstr ""
|
369 |
|
370 |
-
#: lib/wfu_constants.php:
|
371 |
msgid ""
|
372 |
"Insert variable %pageid% inside text. It will be replaced by the id of the "
|
373 |
"current page."
|
374 |
msgstr ""
|
375 |
|
376 |
-
#: lib/wfu_constants.php:
|
377 |
msgid ""
|
378 |
"Insert variable %pagetitle% inside text. It will be replaced by the title of "
|
379 |
"the current page."
|
380 |
msgstr ""
|
381 |
|
382 |
-
#: lib/wfu_constants.php:
|
383 |
msgid ""
|
384 |
"Insert variable %userdataXXX% inside text. Select the user field from the "
|
385 |
"drop-down list. It will be replaced by the value that the user entered in "
|
386 |
"this field."
|
387 |
msgstr ""
|
388 |
|
389 |
-
#: lib/wfu_constants.php:
|
390 |
msgid "Insert variable %n% inside text to denote a line change."
|
391 |
msgstr ""
|
392 |
|
393 |
-
#: lib/wfu_constants.php:
|
394 |
msgid "Upload in progress"
|
395 |
msgstr ""
|
396 |
|
397 |
-
#: lib/wfu_constants.php:
|
398 |
msgid "Upload in progress with warnings!"
|
399 |
msgstr ""
|
400 |
|
401 |
-
#: lib/wfu_constants.php:
|
402 |
msgid "Upload in progress but some files already failed!"
|
403 |
msgstr ""
|
404 |
|
405 |
-
#: lib/wfu_constants.php:
|
406 |
msgid "Upload in progress but no files uploaded so far!"
|
407 |
msgstr ""
|
408 |
|
409 |
-
#: lib/wfu_constants.php:
|
410 |
msgid "All files uploaded successfully"
|
411 |
msgstr ""
|
412 |
|
413 |
-
#: lib/wfu_constants.php:
|
414 |
msgid "All files uploaded successfully but there are warnings!"
|
415 |
msgstr ""
|
416 |
|
417 |
-
#: lib/wfu_constants.php:
|
418 |
msgid "File uploaded successfully but there are warnings!"
|
419 |
msgstr ""
|
420 |
|
421 |
-
#: lib/wfu_constants.php:
|
422 |
msgid "Some files failed to upload!"
|
423 |
msgstr ""
|
424 |
|
425 |
-
#: lib/wfu_constants.php:
|
426 |
msgid "All files failed to upload"
|
427 |
msgstr ""
|
428 |
|
429 |
-
#: lib/wfu_constants.php:
|
430 |
msgid "File failed to upload"
|
431 |
msgstr ""
|
432 |
|
433 |
-
#: lib/wfu_constants.php:
|
434 |
msgid "There are no files to upload!"
|
435 |
msgstr ""
|
436 |
|
437 |
-
#: lib/wfu_constants.php:
|
438 |
msgid "Test upload message"
|
439 |
msgstr ""
|
440 |
|
441 |
-
#: lib/wfu_constants.php:
|
442 |
msgid "JSON parse warning!"
|
443 |
msgstr ""
|
444 |
|
445 |
-
#: lib/wfu_constants.php:
|
446 |
msgid "please wait while redirecting..."
|
447 |
msgstr ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: Wordpress File Upload\n"
|
4 |
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: 2015-04-14 14:00+0200\n"
|
6 |
+
"PO-Revision-Date: 2015-04-14 14:00+0200\n"
|
7 |
"Last-Translator: nickboss <info@iptanus.com>\n"
|
8 |
"Language-Team: Iptanus Team <info@iptanus.com>\n"
|
9 |
"Language: en\n"
|
13 |
"X-Poedit-KeywordsList: __;gettext;gettext_noop\n"
|
14 |
"X-Poedit-Basepath: ../\n"
|
15 |
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
16 |
+
"X-Generator: Poedit 1.7.5\n"
|
17 |
"X-Poedit-SearchPath-0: .\n"
|
18 |
|
19 |
#: lib/wfu_constants.php:7
|
28 |
msgid "Upload File"
|
29 |
msgstr ""
|
30 |
|
31 |
+
#: lib/wfu_constants.php:27
|
32 |
msgid "File Upload Notification"
|
33 |
msgstr ""
|
34 |
|
35 |
+
#: lib/wfu_constants.php:28
|
36 |
msgid ""
|
37 |
"Dear Recipient,%n%%n% This is an automatic delivery message to notify you "
|
38 |
"that a new file has been uploaded.%n%%n%Best Regards"
|
39 |
msgstr ""
|
40 |
|
41 |
+
#: lib/wfu_constants.php:34
|
42 |
#, php-format
|
43 |
msgid "File %filename% uploaded successfully"
|
44 |
msgstr ""
|
45 |
|
46 |
+
#: lib/wfu_constants.php:35
|
47 |
#, php-format
|
48 |
msgid "File %filename% uploaded successfully but with warnings"
|
49 |
msgstr ""
|
50 |
|
51 |
+
#: lib/wfu_constants.php:36
|
52 |
msgid "File %filename% not uploaded"
|
53 |
msgstr ""
|
54 |
|
55 |
+
#: lib/wfu_constants.php:37
|
56 |
msgid "File %filename% is being uploaded"
|
57 |
msgstr ""
|
58 |
|
59 |
+
#: lib/wfu_constants.php:55
|
60 |
msgid "Your message"
|
61 |
msgstr ""
|
62 |
|
63 |
+
#: lib/wfu_constants.php:60
|
64 |
msgid ""
|
65 |
"Error. Could not resolve ftp target filedir. Check the domain in 'ftpinfo' "
|
66 |
"attribute."
|
67 |
msgstr ""
|
68 |
|
69 |
+
#: lib/wfu_constants.php:61
|
70 |
msgid "Error. Invalid ftp information. Check 'ftpinfo' attribute."
|
71 |
msgstr ""
|
72 |
|
73 |
+
#: lib/wfu_constants.php:62
|
74 |
msgid ""
|
75 |
"Error. Could not extract ftp information from 'ftpinfo' attribute. Check its "
|
76 |
"syntax."
|
77 |
msgstr ""
|
78 |
|
79 |
+
#: lib/wfu_constants.php:63
|
80 |
msgid ""
|
81 |
"Error. Could not resolve ftp target filename. Check the domain in 'ftpinfo' "
|
82 |
"attribute."
|
83 |
msgstr ""
|
84 |
|
85 |
+
#: lib/wfu_constants.php:64
|
86 |
msgid ""
|
87 |
"Error. The upload size limit of PHP directive upload_max_filesize is "
|
88 |
"preventing the upload of big files.\n"
|
89 |
"PHP directive upload_max_filesize limit is: "
|
90 |
msgstr ""
|
91 |
|
92 |
+
#: lib/wfu_constants.php:65
|
93 |
msgid ""
|
94 |
"The upload time limit of PHP directive max_input_time is preventing the "
|
95 |
"upload of big files.\n"
|
96 |
"PHP directive max_input_time limit is: "
|
97 |
msgstr ""
|
98 |
|
99 |
+
#: lib/wfu_constants.php:66
|
100 |
msgid ""
|
101 |
"Error. Permission denied to write to target folder.\n"
|
102 |
"Check and correct read/write permissions of target folder."
|
103 |
msgstr ""
|
104 |
|
105 |
+
#: lib/wfu_constants.php:67
|
106 |
msgid "Targer folder doesn't exist."
|
107 |
msgstr ""
|
108 |
|
109 |
+
#: lib/wfu_constants.php:68
|
110 |
msgid "Upload failed! Missing a temporary folder."
|
111 |
msgstr ""
|
112 |
|
113 |
+
#: lib/wfu_constants.php:69
|
114 |
msgid "Upload failed! Permission denied to write to target folder."
|
115 |
msgstr ""
|
116 |
|
117 |
+
#: lib/wfu_constants.php:70
|
118 |
msgid "File not allowed."
|
119 |
msgstr ""
|
120 |
|
121 |
+
#: lib/wfu_constants.php:71
|
122 |
msgid "The uploaded file exceeds the file size limit."
|
123 |
msgstr ""
|
124 |
|
125 |
+
#: lib/wfu_constants.php:72
|
126 |
+
msgid "The uploaded file exceeds 2GB and is not supported by this server."
|
127 |
+
msgstr ""
|
128 |
+
|
129 |
+
#: lib/wfu_constants.php:73
|
130 |
msgid ""
|
131 |
"Upload failed! The uploaded file exceeds the file size limit of the server. "
|
132 |
"Please contact the administrator."
|
133 |
msgstr ""
|
134 |
|
135 |
+
#: lib/wfu_constants.php:74
|
136 |
msgid ""
|
137 |
"Upload failed! The duration of the upload exceeded the time limit of the "
|
138 |
"server. Please contact the administrator."
|
139 |
msgstr ""
|
140 |
|
141 |
+
#: lib/wfu_constants.php:75
|
142 |
msgid ""
|
143 |
"Upload failed! The uploaded file exceeds the MAX_FILE_SIZE directive that "
|
144 |
"was specified in the HTML form."
|
145 |
msgstr ""
|
146 |
|
147 |
+
#: lib/wfu_constants.php:76
|
148 |
msgid "Upload failed! The uploaded file was only partially uploaded."
|
149 |
msgstr ""
|
150 |
|
151 |
+
#: lib/wfu_constants.php:77
|
152 |
msgid "Upload failed! No file was uploaded."
|
153 |
msgstr ""
|
154 |
|
155 |
+
#: lib/wfu_constants.php:78
|
156 |
msgid "Upload failed! Failed to write file to disk."
|
157 |
msgstr ""
|
158 |
|
159 |
+
#: lib/wfu_constants.php:79
|
160 |
msgid ""
|
161 |
"Upload failed! Error occured while moving temporary file. Please contact "
|
162 |
"administrator."
|
163 |
msgstr ""
|
164 |
|
165 |
+
#: lib/wfu_constants.php:80
|
166 |
msgid ""
|
167 |
"Upload failed! A PHP extension stopped the file upload. PHP does not provide "
|
168 |
"a way to ascertain which extension caused the file upload to stop; examining "
|
169 |
"the list of loaded extensions with phpinfo() may help."
|
170 |
msgstr ""
|
171 |
|
172 |
+
#: lib/wfu_constants.php:81
|
173 |
msgid "Upload failed! Error occured while attemting to upload the file."
|
174 |
msgstr ""
|
175 |
|
176 |
+
#: lib/wfu_constants.php:82
|
177 |
msgid "Upload failed!"
|
178 |
msgstr ""
|
179 |
|
180 |
+
#: lib/wfu_constants.php:83
|
181 |
msgid "No file!"
|
182 |
msgstr ""
|
183 |
|
184 |
+
#: lib/wfu_constants.php:84
|
185 |
msgid ""
|
186 |
"Upload failed! The upload has been canceled by the user or the browser "
|
187 |
"dropped the connection."
|
188 |
msgstr ""
|
189 |
|
190 |
+
#: lib/wfu_constants.php:85
|
191 |
msgid "Upload failed! Unknown error."
|
192 |
msgstr ""
|
193 |
|
194 |
+
#: lib/wfu_constants.php:86
|
195 |
msgid "Please contact the administrator."
|
196 |
msgstr ""
|
197 |
|
198 |
+
#: lib/wfu_constants.php:87
|
199 |
msgid "No result from remote server!"
|
200 |
msgstr ""
|
201 |
|
202 |
+
#: lib/wfu_constants.php:88
|
203 |
msgid " but with warnings"
|
204 |
msgstr ""
|
205 |
|
206 |
+
#: lib/wfu_constants.php:89 lib/wfu_constants.php:91
|
207 |
msgid "Warning: JSON parse error."
|
208 |
msgstr ""
|
209 |
|
210 |
+
#: lib/wfu_constants.php:90
|
211 |
msgid ""
|
212 |
"Upload parameters of this file, passed as JSON string to the handler, could "
|
213 |
"not be parsed."
|
214 |
msgstr ""
|
215 |
|
216 |
+
#: lib/wfu_constants.php:92
|
217 |
msgid ""
|
218 |
"UploadStates, passed as JSON string to the handler, could not be parsed."
|
219 |
msgstr ""
|
220 |
|
221 |
+
#: lib/wfu_constants.php:93
|
222 |
msgid ""
|
223 |
"Redirection to classic form functionality occurred due to unknown error."
|
224 |
msgstr ""
|
225 |
|
226 |
+
#: lib/wfu_constants.php:94
|
227 |
msgid ""
|
228 |
"Redirection to classic form functionality occurred because AJAX is not "
|
229 |
"supported."
|
230 |
msgstr ""
|
231 |
|
232 |
+
#: lib/wfu_constants.php:95
|
233 |
msgid ""
|
234 |
"Redirection to classic form functionality occurred because HTML5 is not "
|
235 |
"supported."
|
236 |
msgstr ""
|
237 |
|
238 |
+
#: lib/wfu_constants.php:96
|
239 |
msgid ""
|
240 |
"Redirection to classic form functionality occurred due to JSON parse error."
|
241 |
msgstr ""
|
242 |
|
243 |
+
#: lib/wfu_constants.php:97
|
244 |
msgid "cannot be empty!"
|
245 |
msgstr ""
|
246 |
|
247 |
+
#: lib/wfu_constants.php:98
|
248 |
+
msgid ""
|
249 |
+
"There are more than one instances of the plugin in this page with the same "
|
250 |
+
"id. Please change it."
|
251 |
+
msgstr ""
|
252 |
+
|
253 |
+
#: lib/wfu_constants.php:99
|
254 |
+
msgid ""
|
255 |
+
"Cannot edit the shortcode because the page has been modified. Please reload "
|
256 |
+
"the page."
|
257 |
+
msgstr ""
|
258 |
+
|
259 |
+
#: lib/wfu_constants.php:102
|
260 |
msgid "Upload skipped! File already exists."
|
261 |
msgstr ""
|
262 |
|
263 |
+
#: lib/wfu_constants.php:103
|
264 |
msgid "No files have been selected!"
|
265 |
msgstr ""
|
266 |
|
267 |
+
#: lib/wfu_constants.php:104
|
268 |
msgid "WPFilebase Plugin not updated because there were no files uploaded."
|
269 |
msgstr ""
|
270 |
|
271 |
+
#: lib/wfu_constants.php:105
|
272 |
msgid "Notification email was not sent because there were no files uploaded."
|
273 |
msgstr ""
|
274 |
|
275 |
+
#: lib/wfu_constants.php:106
|
276 |
msgid ""
|
277 |
"Notification email was not sent because no recipients were defined. Please "
|
278 |
"check notifyrecipients attribute in the shortcode."
|
279 |
msgstr ""
|
280 |
|
281 |
+
#: lib/wfu_constants.php:107
|
282 |
msgid ""
|
283 |
"Notification email was not sent due to an error. Please check "
|
284 |
"notifyrecipients, notifysubject and notifymessage attributes for errors."
|
285 |
msgstr ""
|
286 |
|
287 |
+
#: lib/wfu_constants.php:108
|
288 |
msgid ""
|
289 |
"Redirection not executed because redirection link is empty. Please check "
|
290 |
"redirectlink attribute."
|
291 |
msgstr ""
|
292 |
|
293 |
+
#: lib/wfu_constants.php:109
|
294 |
msgid ""
|
295 |
"Redirection not executed because not all files were successfully uploaded."
|
296 |
msgstr ""
|
297 |
|
298 |
+
#: lib/wfu_constants.php:112
|
299 |
msgid "Test Mode"
|
300 |
msgstr ""
|
301 |
|
302 |
+
#: lib/wfu_constants.php:113
|
303 |
msgid "select dir..."
|
304 |
msgstr ""
|
305 |
|
306 |
+
#: lib/wfu_constants.php:114
|
307 |
msgid "Upload path: %filepath%"
|
308 |
msgstr ""
|
309 |
|
310 |
+
#: lib/wfu_constants.php:115
|
311 |
msgid "Failed upload path: %filepath%"
|
312 |
msgstr ""
|
313 |
|
314 |
+
#: lib/wfu_constants.php:116
|
315 |
msgid " (required)"
|
316 |
msgstr ""
|
317 |
|
318 |
+
#: lib/wfu_constants.php:117
|
319 |
+
msgid "Files are being uploaded. Are you sure you want to exit the page?"
|
320 |
+
msgstr ""
|
321 |
+
|
322 |
+
#: lib/wfu_constants.php:120
|
323 |
msgid "This is a test message"
|
324 |
msgstr ""
|
325 |
|
326 |
+
#: lib/wfu_constants.php:121
|
327 |
msgid "This is a test administrator message"
|
328 |
msgstr ""
|
329 |
|
330 |
+
#: lib/wfu_constants.php:122
|
331 |
msgid "File testfile 1 under test"
|
332 |
msgstr ""
|
333 |
|
334 |
+
#: lib/wfu_constants.php:123
|
335 |
msgid "File testfile 1 message"
|
336 |
msgstr ""
|
337 |
|
338 |
+
#: lib/wfu_constants.php:124
|
339 |
msgid "File testfile 1 administrator message"
|
340 |
msgstr ""
|
341 |
|
342 |
+
#: lib/wfu_constants.php:125
|
343 |
msgid "File testfile 2 under test"
|
344 |
msgstr ""
|
345 |
|
346 |
+
#: lib/wfu_constants.php:126
|
347 |
msgid "File testfile 2 message"
|
348 |
msgstr ""
|
349 |
|
350 |
+
#: lib/wfu_constants.php:127
|
351 |
msgid "File testfile 2 administrator message"
|
352 |
msgstr ""
|
353 |
|
354 |
+
#: lib/wfu_constants.php:130
|
355 |
+
msgid ""
|
356 |
+
"Failed to edit the shortcode because the contents of the page changed. Try "
|
357 |
+
"again to edit the shortcode."
|
358 |
+
msgstr ""
|
359 |
+
|
360 |
+
#: lib/wfu_constants.php:131
|
361 |
+
msgid ""
|
362 |
+
"The page containing the shortcode has been modified and it is no longer "
|
363 |
+
"valid. Please go back to reload the shortcode."
|
364 |
+
msgstr ""
|
365 |
+
|
366 |
+
#: lib/wfu_constants.php:132
|
367 |
+
msgid ""
|
368 |
+
"Failed to update the shortcode because the contents of the page changed. Go "
|
369 |
+
"back to reload the shortcode."
|
370 |
+
msgstr ""
|
371 |
+
|
372 |
+
#: lib/wfu_constants.php:133
|
373 |
+
msgid ""
|
374 |
+
"Failed to update the shortcode. Please try again. If the problem persists, "
|
375 |
+
"go back and reload the shortcode."
|
376 |
+
msgstr ""
|
377 |
+
|
378 |
+
#: lib/wfu_constants.php:136
|
379 |
msgid ""
|
380 |
"Insert variable %userid% inside text. It will be replaced by the id of the "
|
381 |
"current user."
|
382 |
msgstr ""
|
383 |
|
384 |
+
#: lib/wfu_constants.php:137
|
385 |
msgid ""
|
386 |
"Insert variable %username% inside text. It will be replaced by the username "
|
387 |
"of the current user."
|
388 |
msgstr ""
|
389 |
|
390 |
+
#: lib/wfu_constants.php:138
|
391 |
msgid ""
|
392 |
"Insert variable %useremail% inside text. It will be replaced by the email of "
|
393 |
"the current user."
|
394 |
msgstr ""
|
395 |
|
396 |
+
#: lib/wfu_constants.php:139
|
397 |
msgid ""
|
398 |
"Insert variable %filename% inside text. It will be replaced by the filename "
|
399 |
"of the uploaded file."
|
400 |
msgstr ""
|
401 |
|
402 |
+
#: lib/wfu_constants.php:140
|
403 |
msgid ""
|
404 |
"Insert variable %filepath% inside text. It will be replaced by the full "
|
405 |
"filepath of the uploaded file."
|
406 |
msgstr ""
|
407 |
|
408 |
+
#: lib/wfu_constants.php:141
|
409 |
msgid ""
|
410 |
"Insert variable %blogid% inside text. It will be replaced by the blog id of "
|
411 |
"the website."
|
412 |
msgstr ""
|
413 |
|
414 |
+
#: lib/wfu_constants.php:142
|
415 |
msgid ""
|
416 |
"Insert variable %pageid% inside text. It will be replaced by the id of the "
|
417 |
"current page."
|
418 |
msgstr ""
|
419 |
|
420 |
+
#: lib/wfu_constants.php:143
|
421 |
msgid ""
|
422 |
"Insert variable %pagetitle% inside text. It will be replaced by the title of "
|
423 |
"the current page."
|
424 |
msgstr ""
|
425 |
|
426 |
+
#: lib/wfu_constants.php:144
|
427 |
msgid ""
|
428 |
"Insert variable %userdataXXX% inside text. Select the user field from the "
|
429 |
"drop-down list. It will be replaced by the value that the user entered in "
|
430 |
"this field."
|
431 |
msgstr ""
|
432 |
|
433 |
+
#: lib/wfu_constants.php:145
|
434 |
msgid "Insert variable %n% inside text to denote a line change."
|
435 |
msgstr ""
|
436 |
|
437 |
+
#: lib/wfu_constants.php:148
|
438 |
msgid "Upload in progress"
|
439 |
msgstr ""
|
440 |
|
441 |
+
#: lib/wfu_constants.php:149
|
442 |
msgid "Upload in progress with warnings!"
|
443 |
msgstr ""
|
444 |
|
445 |
+
#: lib/wfu_constants.php:150
|
446 |
msgid "Upload in progress but some files already failed!"
|
447 |
msgstr ""
|
448 |
|
449 |
+
#: lib/wfu_constants.php:151
|
450 |
msgid "Upload in progress but no files uploaded so far!"
|
451 |
msgstr ""
|
452 |
|
453 |
+
#: lib/wfu_constants.php:152
|
454 |
msgid "All files uploaded successfully"
|
455 |
msgstr ""
|
456 |
|
457 |
+
#: lib/wfu_constants.php:153
|
458 |
msgid "All files uploaded successfully but there are warnings!"
|
459 |
msgstr ""
|
460 |
|
461 |
+
#: lib/wfu_constants.php:154
|
462 |
msgid "File uploaded successfully but there are warnings!"
|
463 |
msgstr ""
|
464 |
|
465 |
+
#: lib/wfu_constants.php:155
|
466 |
msgid "Some files failed to upload!"
|
467 |
msgstr ""
|
468 |
|
469 |
+
#: lib/wfu_constants.php:156
|
470 |
msgid "All files failed to upload"
|
471 |
msgstr ""
|
472 |
|
473 |
+
#: lib/wfu_constants.php:157
|
474 |
msgid "File failed to upload"
|
475 |
msgstr ""
|
476 |
|
477 |
+
#: lib/wfu_constants.php:158
|
478 |
msgid "There are no files to upload!"
|
479 |
msgstr ""
|
480 |
|
481 |
+
#: lib/wfu_constants.php:159
|
482 |
msgid "Test upload message"
|
483 |
msgstr ""
|
484 |
|
485 |
+
#: lib/wfu_constants.php:160
|
486 |
msgid "JSON parse warning!"
|
487 |
msgstr ""
|
488 |
|
489 |
+
#: lib/wfu_constants.php:161
|
490 |
msgid "please wait while redirecting..."
|
491 |
msgstr ""
|
492 |
+
|
493 |
+
#: lib/wfu_constants.php:162
|
494 |
+
msgid "Open visual shortcode editor in new window"
|
495 |
+
msgstr ""
|
496 |
+
|
497 |
+
#: lib/wfu_constants.php:163
|
498 |
+
msgid "loading visual editor"
|
499 |
+
msgstr ""
|
lib/wfu_admin.php
CHANGED
@@ -79,8 +79,8 @@ function wordpress_file_upload_install() {
|
|
79 |
function wordpress_file_upload_update_db_check() {
|
80 |
global $wfu_tb_log_version;
|
81 |
global $wfu_tb_userdata_version;
|
82 |
-
update_option("wordpress_file_upload_table_log_version", "0");
|
83 |
-
update_option("wordpress_file_upload_table_userdata_version", "0");
|
84 |
if ( get_option('wordpress_file_upload_table_log_version') != $wfu_tb_log_version || get_option('wordpress_file_upload_table_userdata_version') != $wfu_tb_userdata_version ) {
|
85 |
wordpress_file_upload_install();
|
86 |
}
|
@@ -93,6 +93,8 @@ function wordpress_file_upload_manage_dashboard() {
|
|
93 |
$action = (!empty($_POST['action']) ? $_POST['action'] : (!empty($_GET['action']) ? $_GET['action'] : ''));
|
94 |
$dir = (!empty($_POST['dir']) ? $_POST['dir'] : (!empty($_GET['dir']) ? $_GET['dir'] : ''));
|
95 |
$file = (!empty($_POST['file']) ? $_POST['file'] : (!empty($_GET['file']) ? $_GET['file'] : ''));
|
|
|
|
|
96 |
|
97 |
if ( $action == 'edit_settings' ) {
|
98 |
wfu_update_settings();
|
@@ -156,6 +158,11 @@ function wordpress_file_upload_manage_dashboard() {
|
|
156 |
elseif ( $action == 'plugin_settings' ) {
|
157 |
$echo_str = wfu_manage_settings();
|
158 |
}
|
|
|
|
|
|
|
|
|
|
|
159 |
else {
|
160 |
$echo_str = wfu_manage_mainmenu();
|
161 |
}
|
@@ -164,7 +171,10 @@ function wordpress_file_upload_manage_dashboard() {
|
|
164 |
}
|
165 |
|
166 |
function wfu_manage_mainmenu($message = '') {
|
167 |
-
if ( !current_user_can( 'manage_options' ) ) return
|
|
|
|
|
|
|
168 |
|
169 |
$siteurl = site_url();
|
170 |
$plugin_options = wfu_decode_plugin_options(get_option( "wordpress_file_upload_options" ));
|
@@ -179,12 +189,13 @@ function wfu_manage_mainmenu($message = '') {
|
|
179 |
$echo_str .= "\n\t".'<div style="margin-top:20px;">';
|
180 |
if ( current_user_can( 'manage_options' ) ) $echo_str .= "\n\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=plugin_settings" class="button" title="Settings">Settings</a>';
|
181 |
if ( current_user_can( 'manage_options' ) ) $echo_str .= "\n\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=file_browser" class="button" title="File browser">File Browser</a>';
|
182 |
-
$echo_str .= "\n\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=shortcode_composer" class="button" title="Shortcode composer">Shortcode Composer</a>';
|
183 |
if ( current_user_can( 'manage_options' ) ) $echo_str .= "\n\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=view_log" class="button" title="View log">View Log</a>';
|
184 |
if ( current_user_can( 'manage_options' ) ) $echo_str .= "\n\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=sync_db" class="button" title="Update database to reflect current status of files">Sync Database</a>';
|
185 |
$echo_str .= "\n\t\t".'<h3 style="margin-bottom: 10px; margin-top: 40px;">Status</h3>';
|
186 |
$echo_str .= "\n\t\t".'<table class="form-table">';
|
187 |
$echo_str .= "\n\t\t\t".'<tbody>';
|
|
|
188 |
$echo_str .= "\n\t\t\t\t".'<tr class="form-field">';
|
189 |
$echo_str .= "\n\t\t\t\t\t".'<th scope="row">';
|
190 |
$echo_str .= "\n\t\t\t\t\t\t".'<label style="cursor:default;">Edition</label>';
|
@@ -203,6 +214,7 @@ function wfu_manage_mainmenu($message = '') {
|
|
203 |
$echo_str .= "\n\t\t\t\t\t\t".'</div>';
|
204 |
$echo_str .= "\n\t\t\t\t\t".'</td>';
|
205 |
$echo_str .= "\n\t\t\t\t".'</tr>';
|
|
|
206 |
$echo_str .= "\n\t\t\t\t".'<tr class="form-field">';
|
207 |
$echo_str .= "\n\t\t\t\t\t".'<th scope="row">';
|
208 |
$echo_str .= "\n\t\t\t\t\t\t".'<label style="cursor:default;">Version</label>';
|
@@ -228,14 +240,140 @@ function wfu_manage_mainmenu($message = '') {
|
|
228 |
}
|
229 |
$echo_str .= "\n\t\t\t\t\t".'</td>';
|
230 |
$echo_str .= "\n\t\t\t\t".'</tr>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
231 |
$echo_str .= "\n\t\t\t".'</tbody>';
|
232 |
$echo_str .= "\n\t\t".'</table>';
|
|
|
|
|
|
|
233 |
$echo_str .= "\n\t".'</div>';
|
234 |
$echo_str .= "\n".'</div>';
|
235 |
|
236 |
echo $echo_str;
|
237 |
}
|
238 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
239 |
function wfu_manage_settings($message = '') {
|
240 |
if ( !current_user_can( 'manage_options' ) ) return wfu_shortcode_composer();
|
241 |
|
79 |
function wordpress_file_upload_update_db_check() {
|
80 |
global $wfu_tb_log_version;
|
81 |
global $wfu_tb_userdata_version;
|
82 |
+
// update_option("wordpress_file_upload_table_log_version", "0");
|
83 |
+
// update_option("wordpress_file_upload_table_userdata_version", "0");
|
84 |
if ( get_option('wordpress_file_upload_table_log_version') != $wfu_tb_log_version || get_option('wordpress_file_upload_table_userdata_version') != $wfu_tb_userdata_version ) {
|
85 |
wordpress_file_upload_install();
|
86 |
}
|
93 |
$action = (!empty($_POST['action']) ? $_POST['action'] : (!empty($_GET['action']) ? $_GET['action'] : ''));
|
94 |
$dir = (!empty($_POST['dir']) ? $_POST['dir'] : (!empty($_GET['dir']) ? $_GET['dir'] : ''));
|
95 |
$file = (!empty($_POST['file']) ? $_POST['file'] : (!empty($_GET['file']) ? $_GET['file'] : ''));
|
96 |
+
$data_enc = (!empty($_POST['data']) ? $_POST['data'] : (!empty($_GET['data']) ? $_GET['data'] : ''));
|
97 |
+
$echo_str = "";
|
98 |
|
99 |
if ( $action == 'edit_settings' ) {
|
100 |
wfu_update_settings();
|
158 |
elseif ( $action == 'plugin_settings' ) {
|
159 |
$echo_str = wfu_manage_settings();
|
160 |
}
|
161 |
+
elseif ( $action == 'edit_shortcode' && $data_enc != "" ) {
|
162 |
+
$data = wfu_decode_array_from_string($data_enc);
|
163 |
+
if ( wfu_check_edit_shortcode($data) ) wfu_shortcode_composer($data);
|
164 |
+
else $echo_str = wfu_manage_mainmenu(WFU_DASHBOARD_EDIT_SHORTCODE_REJECTED);
|
165 |
+
}
|
166 |
else {
|
167 |
$echo_str = wfu_manage_mainmenu();
|
168 |
}
|
171 |
}
|
172 |
|
173 |
function wfu_manage_mainmenu($message = '') {
|
174 |
+
if ( !current_user_can( 'manage_options' ) ) return;
|
175 |
+
|
176 |
+
// $str = str_replace(array("\r\n", "\r", "\n"), "<br/>", (print_r($alldata, true)));
|
177 |
+
// echo str_replace(array("\t", " "), " ", $str);
|
178 |
|
179 |
$siteurl = site_url();
|
180 |
$plugin_options = wfu_decode_plugin_options(get_option( "wordpress_file_upload_options" ));
|
189 |
$echo_str .= "\n\t".'<div style="margin-top:20px;">';
|
190 |
if ( current_user_can( 'manage_options' ) ) $echo_str .= "\n\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=plugin_settings" class="button" title="Settings">Settings</a>';
|
191 |
if ( current_user_can( 'manage_options' ) ) $echo_str .= "\n\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=file_browser" class="button" title="File browser">File Browser</a>';
|
192 |
+
if ( current_user_can( 'manage_options' ) ) $echo_str .= "\n\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=shortcode_composer" class="button" title="Shortcode composer">Shortcode Composer</a>';
|
193 |
if ( current_user_can( 'manage_options' ) ) $echo_str .= "\n\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=view_log" class="button" title="View log">View Log</a>';
|
194 |
if ( current_user_can( 'manage_options' ) ) $echo_str .= "\n\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=sync_db" class="button" title="Update database to reflect current status of files">Sync Database</a>';
|
195 |
$echo_str .= "\n\t\t".'<h3 style="margin-bottom: 10px; margin-top: 40px;">Status</h3>';
|
196 |
$echo_str .= "\n\t\t".'<table class="form-table">';
|
197 |
$echo_str .= "\n\t\t\t".'<tbody>';
|
198 |
+
//plugin edition
|
199 |
$echo_str .= "\n\t\t\t\t".'<tr class="form-field">';
|
200 |
$echo_str .= "\n\t\t\t\t\t".'<th scope="row">';
|
201 |
$echo_str .= "\n\t\t\t\t\t\t".'<label style="cursor:default;">Edition</label>';
|
214 |
$echo_str .= "\n\t\t\t\t\t\t".'</div>';
|
215 |
$echo_str .= "\n\t\t\t\t\t".'</td>';
|
216 |
$echo_str .= "\n\t\t\t\t".'</tr>';
|
217 |
+
//plugin version
|
218 |
$echo_str .= "\n\t\t\t\t".'<tr class="form-field">';
|
219 |
$echo_str .= "\n\t\t\t\t\t".'<th scope="row">';
|
220 |
$echo_str .= "\n\t\t\t\t\t\t".'<label style="cursor:default;">Version</label>';
|
240 |
}
|
241 |
$echo_str .= "\n\t\t\t\t\t".'</td>';
|
242 |
$echo_str .= "\n\t\t\t\t".'</tr>';
|
243 |
+
//server environment
|
244 |
+
$php_env = wfu_get_server_environment();
|
245 |
+
$echo_str .= "\n\t\t\t\t".'<tr class="form-field">';
|
246 |
+
$echo_str .= "\n\t\t\t\t\t".'<th scope="row">';
|
247 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<label style="cursor:default;">Server Environment</label>';
|
248 |
+
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
249 |
+
$echo_str .= "\n\t\t\t\t\t".'<td style="width:100px; vertical-align:top;">';
|
250 |
+
if ( $php_env == '64bit' ) $echo_str .= "\n\t\t\t\t\t\t".'<label style="font-weight:bold; cursor:default;">64bit</label></td><td style="vertical-align:top;"><label style="font-weight:normal; font-style:italic; cursor:default;">(Your server supports files up to 1 Exabyte, practically unlimited)</label>';
|
251 |
+
if ( $php_env == '32bit' ) $echo_str .= "\n\t\t\t\t\t\t".'<label style="font-weight:bold; cursor:default;">32bit</label></td><td style="vertical-align:top;"><label style="font-weight:normal; font-style:italic; cursor:default;">(Your server does not support files larger than 2GB)</label>';
|
252 |
+
if ( $php_env == '' ) $echo_str .= "\n\t\t\t\t\t\t".'<label style="font-weight:bold; cursor:default;">Unknown</label></td><td style="vertical-align:top;"><label style="font-weight:normal; font-style:italic; cursor:default;">(The maximum file size supported by the server cannot be determined)</label>';
|
253 |
+
$echo_str .= "\n\t\t\t\t\t".'</td>';
|
254 |
+
$echo_str .= "\n\t\t\t\t".'</tr>';
|
255 |
$echo_str .= "\n\t\t\t".'</tbody>';
|
256 |
$echo_str .= "\n\t\t".'</table>';
|
257 |
+
|
258 |
+
$echo_str .= wfu_manage_instances();
|
259 |
+
|
260 |
$echo_str .= "\n\t".'</div>';
|
261 |
$echo_str .= "\n".'</div>';
|
262 |
|
263 |
echo $echo_str;
|
264 |
}
|
265 |
|
266 |
+
function wfu_manage_instances() {
|
267 |
+
$siteurl = site_url();
|
268 |
+
$args = array( 'post_type' => array( "post", "page" ), 'post_status' => "publish,private,draft", 'posts_per_page' => -1 );
|
269 |
+
$posts = get_posts($args);
|
270 |
+
$wfu_shortcodes = array();
|
271 |
+
foreach ( $posts as $post ) {
|
272 |
+
$ret = wfu_get_content_shortcodes($post, 'wordpress_file_upload');
|
273 |
+
if ( $ret !== false ) $wfu_shortcodes = array_merge($wfu_shortcodes, $ret);
|
274 |
+
}
|
275 |
+
|
276 |
+
$echo_str = "\n\t\t".'<h3 style="margin-bottom: 10px; margin-top: 40px;">Plugin Instances</h3>';
|
277 |
+
$echo_str .= "\n\t\t".'<table class="widefat">';
|
278 |
+
$echo_str .= "\n\t\t\t".'<thead>';
|
279 |
+
$echo_str .= "\n\t\t\t\t".'<tr>';
|
280 |
+
$echo_str .= "\n\t\t\t\t\t".'<th scope="col" width="5%" style="text-align:center;">';
|
281 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<label>#</label>';
|
282 |
+
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
283 |
+
$echo_str .= "\n\t\t\t\t\t".'<th scope="col" width="10%" style="text-align:center;">';
|
284 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<label>ID</label>';
|
285 |
+
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
286 |
+
$echo_str .= "\n\t\t\t\t\t".'<th scope="col" width="10%" style="text-align:center;">';
|
287 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<label>Type</label>';
|
288 |
+
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
289 |
+
$echo_str .= "\n\t\t\t\t\t".'<th scope="col" width="30%" style="text-align:center;">';
|
290 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<label>Title</label>';
|
291 |
+
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
292 |
+
$echo_str .= "\n\t\t\t\t\t".'<th scope="col" width="45%" style="text-align:center;">';
|
293 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<label>Shortcode</label>';
|
294 |
+
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
295 |
+
$echo_str .= "\n\t\t\t\t".'</tr>';
|
296 |
+
$echo_str .= "\n\t\t\t".'</thead>';
|
297 |
+
$echo_str .= "\n\t\t\t".'<tbody>';
|
298 |
+
$i = 1;
|
299 |
+
foreach ( $wfu_shortcodes as $key => $data ) {
|
300 |
+
$id = $data['post_id'];
|
301 |
+
$data_enc = wfu_encode_array_to_string($data);
|
302 |
+
$echo_str .= "\n\t\t\t\t".'<tr onmouseover="for (i in document.getElementsByName(\'wfu_shortcode_actions\')){document.getElementsByName(\'wfu_shortcode_actions\').item(i).style.visibility=\'hidden\';} document.getElementById(\'wfu_shortcode_actions_'.$i.'\').style.visibility=\'visible\'" onmouseout="for (i in document.getElementsByName(\'wfu_shortcode_actions\')){document.getElementsByName(\'wfu_shortcode_actions\').item(i).style.visibility=\'hidden\';}">';
|
303 |
+
$echo_str .= "\n\t\t\t\t\t".'<td style="padding: 5px 5px 5px 10px; text-align:center;">';
|
304 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<a class="row-title" href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=edit_shortcode&data='.$data_enc.'" title="Plugin #'.$i.'">Plugin '.$i.'</a>';
|
305 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<div id="wfu_shortcode_actions_'.$i.'" name="wfu_shortcode_actions" style="visibility:hidden;">';
|
306 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<span>';
|
307 |
+
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=edit_shortcode&data='.$data_enc.'" title="Edit this shortcode">Edit</a>';
|
308 |
+
$echo_str .= "\n\t\t\t\t\t\t\t\t".' | ';
|
309 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'</span>';
|
310 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<span>';
|
311 |
+
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=delete_shortcode&data='.$data_enc.'" title="Delete this shortcode">Delete</a>';
|
312 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'</span>';
|
313 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</div>';
|
314 |
+
$echo_str .= "\n\t\t\t\t\t".'</td>';
|
315 |
+
$echo_str .= "\n\t\t\t\t\t".'<td style="padding: 5px 5px 5px 10px; text-align:center;">'.$id.'</td>';
|
316 |
+
$echo_str .= "\n\t\t\t\t\t".'<td style="padding: 5px 5px 5px 10px; text-align:center;">'.get_post_type($id).'</td>';
|
317 |
+
$echo_str .= "\n\t\t\t\t\t".'<td style="padding: 5px 5px 5px 10px; text-align:center;">'.get_the_title($id).'</td>';
|
318 |
+
$echo_str .= "\n\t\t\t\t\t".'<td style="padding: 5px 5px 5px 10px; text-align:left;">';
|
319 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<textarea rows="3" disabled="disabled" style="width:100%;">'.trim($data['shortcode']).'</textarea>';
|
320 |
+
$echo_str .= "\n\t\t\t\t\t".'</td>';
|
321 |
+
$echo_str .= "\n\t\t\t\t".'</tr>';
|
322 |
+
$i++;
|
323 |
+
}
|
324 |
+
$echo_str .= "\n\t\t\t".'</tbody>';
|
325 |
+
$echo_str .= "\n\t\t".'</table>';
|
326 |
+
|
327 |
+
return $echo_str;
|
328 |
+
}
|
329 |
+
|
330 |
+
function wfu_get_content_shortcodes($post, $tag) {
|
331 |
+
$ret = array();
|
332 |
+
$content = $post->post_content;
|
333 |
+
$hash = '';
|
334 |
+
if ( false === strpos( $content, '[' ) ) {
|
335 |
+
return false;
|
336 |
+
}
|
337 |
+
|
338 |
+
if ( shortcode_exists( $tag ) ) {
|
339 |
+
preg_match_all( '/' . get_shortcode_regex() . '/s', $content, $matches, PREG_SET_ORDER | PREG_OFFSET_CAPTURE );
|
340 |
+
if ( empty( $matches ) )
|
341 |
+
return false;
|
342 |
+
|
343 |
+
foreach ( $matches as $shortcode ) {
|
344 |
+
if ( $tag === $shortcode[2][0] ) {
|
345 |
+
$data['post_id'] = $post->ID;
|
346 |
+
if ( $hash == '' ) $hash = hash('md5', $content);
|
347 |
+
$data['post_hash'] = $hash;
|
348 |
+
$data['shortcode'] = $shortcode[0][0];
|
349 |
+
$data['position'] = $shortcode[0][1];
|
350 |
+
}
|
351 |
+
array_push($ret, $data);
|
352 |
+
}
|
353 |
+
return $ret;
|
354 |
+
}
|
355 |
+
}
|
356 |
+
|
357 |
+
function wfu_check_edit_shortcode($data) {
|
358 |
+
$post = get_post($data['post_id']);
|
359 |
+
$content = $post->post_content;
|
360 |
+
$hash = hash('md5', $content);
|
361 |
+
|
362 |
+
return ( $hash == $data['post_hash'] );
|
363 |
+
}
|
364 |
+
|
365 |
+
function wfu_replace_shortcode($data, $new_shortcode) {
|
366 |
+
$post = get_post($data['post_id']);
|
367 |
+
$new_content = substr($post->post_content, 0, $data['position']).$new_shortcode.substr($post->post_content, (int)$data['position'] + strlen($data['shortcode']));
|
368 |
+
$new_post = array( 'ID' => $data['post_id'], 'post_content' => $new_content );
|
369 |
+
return ( wp_update_post( $new_post ) === 0 ? false : true );
|
370 |
+
}
|
371 |
+
|
372 |
+
function wfu_edit_shortcode($data, $message = '') {
|
373 |
+
$echo_str = '';
|
374 |
+
return $echo_str;
|
375 |
+
}
|
376 |
+
|
377 |
function wfu_manage_settings($message = '') {
|
378 |
if ( !current_user_can( 'manage_options' ) ) return wfu_shortcode_composer();
|
379 |
|
lib/wfu_admin_browser.php
CHANGED
@@ -3,7 +3,9 @@
|
|
3 |
function wfu_browse_files($basedir) {
|
4 |
$siteurl = site_url();
|
5 |
$plugin_options = wfu_decode_plugin_options(get_option( "wordpress_file_upload_options" ));
|
6 |
-
|
|
|
|
|
7 |
if ( !current_user_can( 'manage_options' ) ) return;
|
8 |
//first decode basedir
|
9 |
$basedir = wfu_plugin_decode_string($basedir);
|
@@ -23,7 +25,7 @@ function wfu_browse_files($basedir) {
|
|
23 |
//set basedit to default value if empty
|
24 |
if ( $basedir == "" ) {
|
25 |
$plugin_options = wfu_decode_plugin_options(get_option( "wordpress_file_upload_options" ));
|
26 |
-
$basedir = $plugin_options['basedir'];
|
27 |
$temp_params = array( 'uploadpath' => $basedir, 'accessmethod' => 'normal', 'ftpinfo' => '', 'useftpdomain' => 'false' );
|
28 |
$basedir = wfu_upload_plugin_full_path($temp_params);
|
29 |
}
|
@@ -105,7 +107,7 @@ function wfu_browse_files($basedir) {
|
|
105 |
$filerec = wfu_get_file_rec($filepath, true);
|
106 |
//find user who uploaded the file
|
107 |
$username = '';
|
108 |
-
if ( $filerec != null ) $username = wfu_get_username_by_id($filerec->
|
109 |
array_push($filelist, array( 'name' => $file, 'fullpath' => $filepath, 'size' => $stat['size'], 'mdate' => $stat['mtime'], 'user' => $username, 'filedata' => $filerec ));
|
110 |
}
|
111 |
}
|
@@ -180,9 +182,10 @@ function wfu_browse_files($basedir) {
|
|
180 |
$echo_str .= "\n\t\t\t\t\t\t\t\t".' | ';
|
181 |
$echo_str .= "\n\t\t\t\t\t\t\t".'</span>';
|
182 |
$echo_str .= "\n\t\t\t\t\t\t\t".'<span>';
|
183 |
-
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<a href="javascript:wfu_download_file(\''.wfu_plugin_encode_string(
|
184 |
$echo_str .= "\n\t\t\t\t\t\t\t".'</span>';
|
185 |
$echo_str .= "\n\t\t\t\t\t\t".'</div>';
|
|
|
186 |
$echo_str .= "\n\t\t\t\t\t".'</td>';
|
187 |
$echo_str .= "\n\t\t\t\t\t".'<td width="10%" style="padding: 5px 5px 5px 10px; text-align:right;">'.$file['size'].'</td>';
|
188 |
$echo_str .= "\n\t\t\t\t\t".'<td width="20%" style="padding: 5px 5px 5px 10px; text-align:left;">'.date("d/m/Y H:i:s", $file['mdate']).'</td>';
|
@@ -222,6 +225,18 @@ function wfu_current_user_allowed_action($action, $filepath) {
|
|
222 |
return $user;
|
223 |
}
|
224 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
225 |
function wfu_rename_file_prompt($file, $type, $error) {
|
226 |
$siteurl = site_url();
|
227 |
|
3 |
function wfu_browse_files($basedir) {
|
4 |
$siteurl = site_url();
|
5 |
$plugin_options = wfu_decode_plugin_options(get_option( "wordpress_file_upload_options" ));
|
6 |
+
$user = wp_get_current_user();
|
7 |
+
//store session variables for use from the downloader
|
8 |
+
|
9 |
if ( !current_user_can( 'manage_options' ) ) return;
|
10 |
//first decode basedir
|
11 |
$basedir = wfu_plugin_decode_string($basedir);
|
25 |
//set basedit to default value if empty
|
26 |
if ( $basedir == "" ) {
|
27 |
$plugin_options = wfu_decode_plugin_options(get_option( "wordpress_file_upload_options" ));
|
28 |
+
$basedir = ( isset($plugin_options['basedir']) ? $plugin_options['basedir'] : "" );
|
29 |
$temp_params = array( 'uploadpath' => $basedir, 'accessmethod' => 'normal', 'ftpinfo' => '', 'useftpdomain' => 'false' );
|
30 |
$basedir = wfu_upload_plugin_full_path($temp_params);
|
31 |
}
|
107 |
$filerec = wfu_get_file_rec($filepath, true);
|
108 |
//find user who uploaded the file
|
109 |
$username = '';
|
110 |
+
if ( $filerec != null ) $username = wfu_get_username_by_id($filerec->uploaduserid);
|
111 |
array_push($filelist, array( 'name' => $file, 'fullpath' => $filepath, 'size' => $stat['size'], 'mdate' => $stat['mtime'], 'user' => $username, 'filedata' => $filerec ));
|
112 |
}
|
113 |
}
|
182 |
$echo_str .= "\n\t\t\t\t\t\t\t\t".' | ';
|
183 |
$echo_str .= "\n\t\t\t\t\t\t\t".'</span>';
|
184 |
$echo_str .= "\n\t\t\t\t\t\t\t".'<span>';
|
185 |
+
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<a href="javascript:wfu_download_file(\''.wfu_plugin_encode_string($file['fullpath']).'\', '.$ii.', \''.wp_create_nonce('wfu_download_file_invoker').'\');" title="Download this file">Download</a>';
|
186 |
$echo_str .= "\n\t\t\t\t\t\t\t".'</span>';
|
187 |
$echo_str .= "\n\t\t\t\t\t\t".'</div>';
|
188 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<div id="wfu_file_download_container_'.$ii.'" style="display: block;"></div>';
|
189 |
$echo_str .= "\n\t\t\t\t\t".'</td>';
|
190 |
$echo_str .= "\n\t\t\t\t\t".'<td width="10%" style="padding: 5px 5px 5px 10px; text-align:right;">'.$file['size'].'</td>';
|
191 |
$echo_str .= "\n\t\t\t\t\t".'<td width="20%" style="padding: 5px 5px 5px 10px; text-align:left;">'.date("d/m/Y H:i:s", $file['mdate']).'</td>';
|
225 |
return $user;
|
226 |
}
|
227 |
|
228 |
+
function wfu_current_user_allowed_action_remote($action, $filepath, $userid) {
|
229 |
+
//first get file data from database, if exist
|
230 |
+
$filerec = wfu_get_file_rec($filepath, false);
|
231 |
+
|
232 |
+
if ( 0 == $userid ) return null;
|
233 |
+
else $is_admin = user_can($userid, 'manage_options');
|
234 |
+
if ( !$is_admin ) {
|
235 |
+
return null;
|
236 |
+
}
|
237 |
+
return true;
|
238 |
+
}
|
239 |
+
|
240 |
function wfu_rename_file_prompt($file, $type, $error) {
|
241 |
$siteurl = site_url();
|
242 |
|
lib/wfu_admin_composer.php
CHANGED
@@ -1,17 +1,37 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
function wfu_shortcode_composer() {
|
4 |
global $wpdb;
|
5 |
global $wp_roles;
|
6 |
$siteurl = site_url();
|
7 |
|
8 |
$components = wfu_component_definitions();
|
9 |
-
|
10 |
$cats = wfu_category_definitions();
|
11 |
$defs = wfu_attribute_definitions();
|
12 |
-
|
13 |
$plugin_options = wfu_decode_plugin_options(get_option( "wordpress_file_upload_options" ));
|
14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
foreach ( $defs as $key => $def ) {
|
16 |
$defs[$key]['default'] = $def['value'];
|
17 |
if ( array_key_exists($def['attribute'], $shortcode_attrs) ) {
|
@@ -27,10 +47,26 @@ function wfu_shortcode_composer() {
|
|
27 |
|
28 |
$echo_str = '<div id="wfu_wrapper" class="wrap">';
|
29 |
$echo_str .= "\n\t".'<h2>Wordpress File Upload Control Panel</h2>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
$echo_str .= "\n\t".'<div style="margin-top:20px;">';
|
31 |
if ( current_user_can( 'manage_options' ) ) $echo_str .= "\n\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=manage_mainmenu" class="button" title="go back">Go to Main Menu</a>';
|
32 |
$echo_str .= "\n\t".'</div>';
|
33 |
-
$echo_str .= "\n\t".'<h2 style="margin-bottom: 10px; margin-top: 20px;">Shortcode Composer</h2>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
$echo_str .= "\n\t".'<div style="margin-top:20px;">';
|
35 |
$echo_str .= "\n\t\t".'<div class="wfu_shortcode_container">';
|
36 |
$echo_str .= "\n\t\t\t".'<span><strong>Generated Shortcode</strong></span>';
|
@@ -226,9 +262,8 @@ function wfu_shortcode_composer() {
|
|
226 |
}
|
227 |
elseif ( $def['type'] == "folderlist" ) {
|
228 |
$echo_str .= $dlp."\t\t".'<div id="wfu_subfolders_inner_shadow_'.$attr.'" class="wfu_subfolders_inner_shadow" style="display:none;"></div>';
|
229 |
-
$echo_str .= $dlp."\t\t".'<select id="wfu_attribute_'.$attr.'" class="wfu_select_folders" size="7" onchange="wfu_subfolders_changed(\''.$attr.'\');">';
|
230 |
-
// $def['value'] = 'admin,*&guests,*users,**user1/User1, **user2/User 2, ***user5, ***user6, *user3, **user4';
|
231 |
$subfolders = wfu_parse_folderlist($def['value']);
|
|
|
232 |
foreach ($subfolders['path'] as $ind => $subfolder) {
|
233 |
if ( substr($subfolder, -1) == '/' ) $subfolder = substr($subfolder, 0, -1);
|
234 |
$subfolder_raw = explode('/', $subfolder);
|
@@ -237,7 +272,7 @@ function wfu_shortcode_composer() {
|
|
237 |
$subvalue = str_repeat("*", intval($subfolders['level'][$ind])).( $subfolders['default'][$ind] ? '&' : '' ).( $subfolder == "" ? '{root}' : $subfolder ).'/'.$subfolders['label'][$ind];
|
238 |
$echo_str .= $dlp."\t\t\t".'<option class="'.( $subfolders['default'][$ind] ? 'wfu_select_folders_option_default' : '' ).'" value="'.wfu_plugin_encode_string($subvalue).'">'.$text.'</option>';
|
239 |
}
|
240 |
-
$echo_str .= $dlp."\t\t\t".'<option value=""
|
241 |
$echo_str .= $dlp."\t\t".'</select>';
|
242 |
$echo_str .= $dlp."\t\t".'<div id="wfu_subfolder_nav_'.$attr.'" class="wfu_subfolder_nav_container">';
|
243 |
$echo_str .= $dlp."\t\t\t".'<table class="wfu_subfolder_nav"><tbody>';
|
@@ -427,7 +462,7 @@ function wfu_shortcode_composer() {
|
|
427 |
$echo_str .= "\n\t".'</div>';
|
428 |
$echo_str .= "\n\t".'<div id="wfu_global_dialog_container" class="wfu_global_dialog_container">';
|
429 |
$echo_str .= "\n\t".'</div>';
|
430 |
-
$handler = 'function() { wfu_Attach_Admin_Events(); }';
|
431 |
$echo_str .= "\n\t".'<script type="text/javascript">if(window.addEventListener) { window.addEventListener("load", '.$handler.', false); } else if(window.attachEvent) { window.attachEvent("onload", '.$handler.'); } else { window["onload"] = '.$handler.'; }</script>';
|
432 |
$echo_str .= "\n".'</div>';
|
433 |
// $echo_str .= "\n\t".'<div style="margin-top:10px;">';
|
1 |
<?php
|
2 |
|
3 |
+
function wfu_shortcode_composer($data = '') {
|
4 |
global $wpdb;
|
5 |
global $wp_roles;
|
6 |
$siteurl = site_url();
|
7 |
|
8 |
$components = wfu_component_definitions();
|
|
|
9 |
$cats = wfu_category_definitions();
|
10 |
$defs = wfu_attribute_definitions();
|
|
|
11 |
$plugin_options = wfu_decode_plugin_options(get_option( "wordpress_file_upload_options" ));
|
12 |
+
|
13 |
+
if ( $data == "" ) {
|
14 |
+
$shortcode = $plugin_options['shortcode'];
|
15 |
+
$shortcode_full = '[wordpress_file_upload '.$shortcode.']';
|
16 |
+
$postid = "";
|
17 |
+
$postname = "";
|
18 |
+
$posttype = "";
|
19 |
+
$posthash = "";
|
20 |
+
$shortcode_position = -1;
|
21 |
+
$autosave = true;
|
22 |
+
}
|
23 |
+
else {
|
24 |
+
$shortcode = trim(substr($data['shortcode'], strlen('[wordpress_file_upload'), -1));
|
25 |
+
$shortcode_full = $data['shortcode'];
|
26 |
+
$postid = $data['post_id'];
|
27 |
+
$postname = get_the_title($postid);
|
28 |
+
$posttype = get_post_type($postid);
|
29 |
+
$posthash = $data['post_hash'];
|
30 |
+
$shortcode_position = $data['position'];
|
31 |
+
$autosave = false;
|
32 |
+
}
|
33 |
+
|
34 |
+
$shortcode_attrs = wfu_shortcode_string_to_array($shortcode);
|
35 |
foreach ( $defs as $key => $def ) {
|
36 |
$defs[$key]['default'] = $def['value'];
|
37 |
if ( array_key_exists($def['attribute'], $shortcode_attrs) ) {
|
47 |
|
48 |
$echo_str = '<div id="wfu_wrapper" class="wrap">';
|
49 |
$echo_str .= "\n\t".'<h2>Wordpress File Upload Control Panel</h2>';
|
50 |
+
$echo_str .= "\n\t".'<div id="wfu_page_obsolete_message" class="error" style="display:none;">';
|
51 |
+
$echo_str .= "\n\t\t".'<p>'.WFU_DASHBOARD_PAGE_OBSOLETE.'</p>';
|
52 |
+
$echo_str .= "\n\t".'</div>';
|
53 |
+
$echo_str .= "\n\t".'<div id="wfu_update_rejected_message" class="error" style="display:none;">';
|
54 |
+
$echo_str .= "\n\t\t".'<p>'.WFU_DASHBOARD_UPDATE_SHORTCODE_REJECTED.'</p>';
|
55 |
+
$echo_str .= "\n\t".'</div>';
|
56 |
+
$echo_str .= "\n\t".'<div id="wfu_update_failed_message" class="error" style="display:none;">';
|
57 |
+
$echo_str .= "\n\t\t".'<p>'.WFU_DASHBOARD_UPDATE_SHORTCODE_FAILED.'</p>';
|
58 |
+
$echo_str .= "\n\t".'</div>';
|
59 |
$echo_str .= "\n\t".'<div style="margin-top:20px;">';
|
60 |
if ( current_user_can( 'manage_options' ) ) $echo_str .= "\n\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=manage_mainmenu" class="button" title="go back">Go to Main Menu</a>';
|
61 |
$echo_str .= "\n\t".'</div>';
|
62 |
+
$echo_str .= "\n\t".'<h2 style="margin-bottom: 10px; margin-top: 20px;">Shortcode Composer for '.( $data == "" ? 'Test' : $posttype.' "'.$postname.'" ('.$postid.') Position '.$data['position'] ).'</h2>';
|
63 |
+
$echo_str .= "\n\t".'<div style="margin-top:10px; display:inline-block;">';
|
64 |
+
if ( $data != "") $echo_str .= "\n\t\t".'<input id="wfu_update_shortcode" type="button" value="Update" class="button-primary" disabled="disabled" onclick="wfu_save_shortcode()" /><span id="wfu_update_shortcode_wait" class="spinner" style="float:right; display:none;"></span>';
|
65 |
+
$echo_str .= "\n\t\t".'<input id="wfu_shortcode_original_enc" type="hidden" value="'.wfu_plugin_encode_string($shortcode_full).'" />';
|
66 |
+
$echo_str .= "\n\t\t".'<input id="wfu_shortcode_postid" type="hidden" value="'.$postid.'" />';
|
67 |
+
$echo_str .= "\n\t\t".'<input id="wfu_shortcode_posthash" type="hidden" value="'.$posthash.'" />';
|
68 |
+
$echo_str .= "\n\t\t".'<input id="wfu_shortcode_position" type="hidden" value="'.$shortcode_position.'" />';
|
69 |
+
$echo_str .= "\n\t".'</div>';
|
70 |
$echo_str .= "\n\t".'<div style="margin-top:20px;">';
|
71 |
$echo_str .= "\n\t\t".'<div class="wfu_shortcode_container">';
|
72 |
$echo_str .= "\n\t\t\t".'<span><strong>Generated Shortcode</strong></span>';
|
262 |
}
|
263 |
elseif ( $def['type'] == "folderlist" ) {
|
264 |
$echo_str .= $dlp."\t\t".'<div id="wfu_subfolders_inner_shadow_'.$attr.'" class="wfu_subfolders_inner_shadow" style="display:none;"></div>';
|
|
|
|
|
265 |
$subfolders = wfu_parse_folderlist($def['value']);
|
266 |
+
$echo_str .= $dlp."\t\t".'<select id="wfu_attribute_'.$attr.'" class="wfu_select_folders'.( count($subfolders['path']) == 0 ? ' wfu_select_folders_empty' : '' ).'" size="7" onchange="wfu_subfolders_changed(\''.$attr.'\');">';
|
267 |
foreach ($subfolders['path'] as $ind => $subfolder) {
|
268 |
if ( substr($subfolder, -1) == '/' ) $subfolder = substr($subfolder, 0, -1);
|
269 |
$subfolder_raw = explode('/', $subfolder);
|
272 |
$subvalue = str_repeat("*", intval($subfolders['level'][$ind])).( $subfolders['default'][$ind] ? '&' : '' ).( $subfolder == "" ? '{root}' : $subfolder ).'/'.$subfolders['label'][$ind];
|
273 |
$echo_str .= $dlp."\t\t\t".'<option class="'.( $subfolders['default'][$ind] ? 'wfu_select_folders_option_default' : '' ).'" value="'.wfu_plugin_encode_string($subvalue).'">'.$text.'</option>';
|
274 |
}
|
275 |
+
$echo_str .= $dlp."\t\t\t".'<option value="">'.( count($subfolders['path']) == 0 ? 'press here' : '' ).'</option>';
|
276 |
$echo_str .= $dlp."\t\t".'</select>';
|
277 |
$echo_str .= $dlp."\t\t".'<div id="wfu_subfolder_nav_'.$attr.'" class="wfu_subfolder_nav_container">';
|
278 |
$echo_str .= $dlp."\t\t\t".'<table class="wfu_subfolder_nav"><tbody>';
|
462 |
$echo_str .= "\n\t".'</div>';
|
463 |
$echo_str .= "\n\t".'<div id="wfu_global_dialog_container" class="wfu_global_dialog_container">';
|
464 |
$echo_str .= "\n\t".'</div>';
|
465 |
+
$handler = 'function() { wfu_Attach_Admin_Events('.( $data == "" ? 'true' : 'false' ).'); }';
|
466 |
$echo_str .= "\n\t".'<script type="text/javascript">if(window.addEventListener) { window.addEventListener("load", '.$handler.', false); } else if(window.attachEvent) { window.attachEvent("onload", '.$handler.'); } else { window["onload"] = '.$handler.'; }</script>';
|
467 |
$echo_str .= "\n".'</div>';
|
468 |
// $echo_str .= "\n\t".'<div style="margin-top:10px;">';
|
lib/wfu_ajaxactions.php
CHANGED
@@ -70,7 +70,7 @@ function wfu_ajax_action_callback() {
|
|
70 |
print_r(wfu_sanitize($_SESSION));
|
71 |
echo "<br/><br/>Post Data:<br/>";
|
72 |
print_r(wfu_sanitize($_POST));
|
73 |
-
die();
|
74 |
}
|
75 |
|
76 |
if ( $user->user_login != $arr['user_login'] ) {
|
@@ -80,15 +80,23 @@ function wfu_ajax_action_callback() {
|
|
80 |
print_r(wfu_sanitize($_POST));
|
81 |
echo "<br/><br/>Params Data:<br/>";
|
82 |
print_r(wfu_sanitize($arr));
|
83 |
-
die();
|
84 |
}
|
|
|
|
|
|
|
85 |
|
86 |
//the first pass to this callback script is for closing the previous connection_aborted
|
87 |
if ( isset($_POST["force_connection_close"]) && $_POST["force_connection_close"] === "1" ) {
|
88 |
header("Connection: Close");
|
89 |
die("success");
|
90 |
}
|
91 |
-
|
|
|
|
|
|
|
|
|
|
|
92 |
$params_str = get_option('wfu_params_'.$arr['unique_id']);
|
93 |
$params = wfu_decode_array_from_string($params_str);
|
94 |
|
@@ -103,16 +111,86 @@ function wfu_ajax_action_callback() {
|
|
103 |
}
|
104 |
|
105 |
function wfu_ajax_action_save_shortcode() {
|
106 |
-
if ( !
|
107 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
108 |
|
109 |
-
$
|
110 |
-
$
|
111 |
-
$
|
112 |
-
|
113 |
-
|
114 |
|
115 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
}
|
117 |
|
118 |
function wfu_ajax_action_read_subfolders() {
|
@@ -120,7 +198,7 @@ function wfu_ajax_action_read_subfolders() {
|
|
120 |
$temp_params = array( 'uploadpath' => wfu_plugin_decode_string($_POST['folder1']), 'accessmethod' => 'normal', 'ftpinfo' => '', 'useftpdomain' => 'false' );
|
121 |
$path = wfu_upload_plugin_full_path($temp_params);
|
122 |
|
123 |
-
if ( !is_dir($path) ) die("error:Parent folder is not valid! Cannot retrieve subfolder list.");
|
124 |
|
125 |
$path2 = wfu_plugin_decode_string($_POST['folder2']);
|
126 |
$dirlist = "";
|
@@ -154,59 +232,78 @@ function wfu_ajax_action_read_subfolders() {
|
|
154 |
$dirlist = str_replace('[['.$path2.']]', $dirlist2, $dirlist);
|
155 |
}
|
156 |
|
157 |
-
die("success:".wfu_plugin_encode_string($dirlist));
|
158 |
}
|
159 |
|
160 |
-
function
|
161 |
$file_enc = (isset($_POST['file']) ? $_POST['file'] : (isset($_GET['file']) ? $_GET['file'] : ''));
|
162 |
-
$
|
163 |
-
if ( $file_enc == '' || $
|
164 |
-
|
|
|
|
|
|
|
165 |
$filepath = wfu_plugin_decode_string($file_enc);
|
166 |
|
167 |
//check if user is allowed to perform this action
|
168 |
-
$
|
169 |
-
if ( $
|
170 |
-
|
171 |
-
//
|
172 |
-
|
173 |
-
|
174 |
-
$
|
175 |
-
|
176 |
-
|
177 |
-
$
|
178 |
-
//
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
$file = @fopen($filepath,"rb");
|
192 |
-
if ( $file ) {
|
193 |
-
while( !feof($file) ) {
|
194 |
-
print fread($file, 1024*8);
|
195 |
-
flush();
|
196 |
-
if ( connection_status() != 0 ) {
|
197 |
-
$failed = true;
|
198 |
-
break;
|
199 |
-
}
|
200 |
-
}
|
201 |
-
@fclose($file);
|
202 |
-
}
|
203 |
-
else $failed = true;
|
204 |
|
205 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
206 |
wfu_log_action('download', $filepath, $user->ID, '', 0, '', null);
|
207 |
-
die();
|
|
|
|
|
|
|
|
|
|
|
208 |
}
|
209 |
-
else die('<script language="javascript">alert("Error! Could not download file.");</script>');
|
210 |
}
|
211 |
|
212 |
function wfu_ajax_action_notify_wpfilebase() {
|
70 |
print_r(wfu_sanitize($_SESSION));
|
71 |
echo "<br/><br/>Post Data:<br/>";
|
72 |
print_r(wfu_sanitize($_POST));
|
73 |
+
die('force_errorabort_code');
|
74 |
}
|
75 |
|
76 |
if ( $user->user_login != $arr['user_login'] ) {
|
80 |
print_r(wfu_sanitize($_POST));
|
81 |
echo "<br/><br/>Params Data:<br/>";
|
82 |
print_r(wfu_sanitize($arr));
|
83 |
+
die('force_errorabort_code');
|
84 |
}
|
85 |
+
|
86 |
+
//get the unique id of the upload
|
87 |
+
$unique_id = ( isset($_POST['unique_id']) ? $_POST['unique_id'] : "" );
|
88 |
|
89 |
//the first pass to this callback script is for closing the previous connection_aborted
|
90 |
if ( isset($_POST["force_connection_close"]) && $_POST["force_connection_close"] === "1" ) {
|
91 |
header("Connection: Close");
|
92 |
die("success");
|
93 |
}
|
94 |
+
|
95 |
+
//if upload has finished then perform post upload actions
|
96 |
+
if ( isset($_POST["upload_finished"]) && $_POST["upload_finished"] === "1" ) {
|
97 |
+
die("success");
|
98 |
+
}
|
99 |
+
|
100 |
$params_str = get_option('wfu_params_'.$arr['unique_id']);
|
101 |
$params = wfu_decode_array_from_string($params_str);
|
102 |
|
111 |
}
|
112 |
|
113 |
function wfu_ajax_action_save_shortcode() {
|
114 |
+
if ( !current_user_can( 'manage_options' ) ) die();
|
115 |
+
if ( !isset($_POST['shortcode']) || !isset($_POST['shortcode_original']) || !isset($_POST['post_id']) || !isset($_POST['post_hash']) || !isset($_POST['shortcode_position']) ) die();
|
116 |
+
|
117 |
+
if ( $_POST['post_id'] == "" ) {
|
118 |
+
$plugin_options = wfu_decode_plugin_options(get_option( "wordpress_file_upload_options" ));
|
119 |
+
|
120 |
+
$new_plugin_options['version'] = '1.0';
|
121 |
+
$new_plugin_options['shortcode'] = wfu_plugin_decode_string($_POST['shortcode']);
|
122 |
+
$new_plugin_options['basedir'] = $plugin_options['basedir'];
|
123 |
+
$encoded_options = wfu_encode_plugin_options($new_plugin_options);
|
124 |
+
update_option( "wordpress_file_upload_options", $encoded_options );
|
125 |
+
|
126 |
+
die("wfu_save_shortcode:success:");
|
127 |
+
}
|
128 |
+
else {
|
129 |
+
$data['post_id'] = $_POST['post_id'];
|
130 |
+
$data['post_hash'] = $_POST['post_hash'];
|
131 |
+
$data['shortcode'] = wfu_plugin_decode_string($_POST['shortcode_original']);
|
132 |
+
$data['position'] = $_POST['shortcode_position'];
|
133 |
+
if ( !wfu_check_edit_shortcode($data) ) die("wfu_save_shortcode:fail:post_modified");
|
134 |
+
else {
|
135 |
+
$new_shortcode = "[wordpress_file_upload ".wfu_plugin_decode_string($_POST['shortcode'])."]";
|
136 |
+
if ( wfu_replace_shortcode($data, $new_shortcode) ) {
|
137 |
+
$post = get_post($_POST['post_id']);
|
138 |
+
$hash = hash('md5', $post->post_content);
|
139 |
+
die("wfu_save_shortcode:success:".$hash);
|
140 |
+
}
|
141 |
+
else die("wfu_save_shortcode:fail:post_update_failed");
|
142 |
+
}
|
143 |
+
}
|
144 |
+
}
|
145 |
+
|
146 |
+
function wfu_ajax_action_check_page_contents() {
|
147 |
+
if ( !current_user_can( 'manage_options' ) ) die();
|
148 |
+
if ( !isset($_POST['post_id']) || !isset($_POST['post_hash']) ) die();
|
149 |
+
if ( $_POST['post_id'] == "" ) die();
|
150 |
|
151 |
+
$data['post_id'] = $_POST['post_id'];
|
152 |
+
$data['post_hash'] = $_POST['post_hash'];
|
153 |
+
if ( wfu_check_edit_shortcode($data) ) die("wfu_check_page_contents:current:");
|
154 |
+
else die("wfu_check_page_contents:obsolete:");
|
155 |
+
}
|
156 |
|
157 |
+
function wfu_ajax_action_edit_shortcode() {
|
158 |
+
if ( !current_user_can( 'manage_options' ) ) die();
|
159 |
+
if ( !isset($_POST['upload_id']) || !isset($_POST['post_id']) || !isset($_POST['post_hash']) ) die();
|
160 |
+
|
161 |
+
$data['post_id'] = $_POST['post_id'];
|
162 |
+
$data['post_hash'] = $_POST['post_hash'];
|
163 |
+
if ( wfu_check_edit_shortcode($data) ) {
|
164 |
+
$post = get_post($data['post_id']);
|
165 |
+
//get default value for uploadid
|
166 |
+
$defs = wfu_attribute_definitions();
|
167 |
+
$default = "";
|
168 |
+
foreach ( $defs as $key => $def ) {
|
169 |
+
if ( $def['attribute'] == 'uploadid' ) {
|
170 |
+
$default = $def['value'];
|
171 |
+
break;
|
172 |
+
}
|
173 |
+
}
|
174 |
+
//get page shortcodes
|
175 |
+
$wfu_shortcodes = wfu_get_content_shortcodes($post, 'wordpress_file_upload');
|
176 |
+
//find the shortcodes' uploadid and the correct one
|
177 |
+
$validkey = -1;
|
178 |
+
foreach ( $wfu_shortcodes as $key => $data ) {
|
179 |
+
$shortcode = trim(substr($data['shortcode'], strlen('[wordpress_file_upload'), -1));
|
180 |
+
$shortcode_attrs = wfu_shortcode_string_to_array($shortcode);
|
181 |
+
if ( array_key_exists('uploadid', $shortcode_attrs) ) $uploadid = $shortcode_attrs['uploadid'];
|
182 |
+
else $uploadid = $default;
|
183 |
+
if ( $uploadid == $_POST['upload_id'] ) {
|
184 |
+
$validkey = $key;
|
185 |
+
break;
|
186 |
+
}
|
187 |
+
}
|
188 |
+
if ( $validkey == -1 ) die();
|
189 |
+
$data_enc = wfu_encode_array_to_string($wfu_shortcodes[$validkey]);
|
190 |
+
$url = site_url().'/wp-admin/options-general.php?page=wordpress_file_upload&action=edit_shortcode&data='.$data_enc;
|
191 |
+
die("wfu_edit_shortcode:success:".wfu_plugin_encode_string($url));
|
192 |
+
}
|
193 |
+
else die("wfu_edit_shortcode:check_page_obsolete:".WFU_ERROR_PAGE_OBSOLETE);
|
194 |
}
|
195 |
|
196 |
function wfu_ajax_action_read_subfolders() {
|
198 |
$temp_params = array( 'uploadpath' => wfu_plugin_decode_string($_POST['folder1']), 'accessmethod' => 'normal', 'ftpinfo' => '', 'useftpdomain' => 'false' );
|
199 |
$path = wfu_upload_plugin_full_path($temp_params);
|
200 |
|
201 |
+
if ( !is_dir($path) ) die("wfu_read_subfolders:error:Parent folder is not valid! Cannot retrieve subfolder list.");
|
202 |
|
203 |
$path2 = wfu_plugin_decode_string($_POST['folder2']);
|
204 |
$dirlist = "";
|
232 |
$dirlist = str_replace('[['.$path2.']]', $dirlist2, $dirlist);
|
233 |
}
|
234 |
|
235 |
+
die("wfu_read_subfolders:success:".wfu_plugin_encode_string($dirlist));
|
236 |
}
|
237 |
|
238 |
+
function wfu_ajax_action_download_file_invoker() {
|
239 |
$file_enc = (isset($_POST['file']) ? $_POST['file'] : (isset($_GET['file']) ? $_GET['file'] : ''));
|
240 |
+
$nonce = (isset($_POST['nonce']) ? $_POST['nonce'] : (isset($_GET['nonce']) ? $_GET['nonce'] : ''));
|
241 |
+
if ( $file_enc == '' || $nonce == '' ) die();
|
242 |
+
|
243 |
+
//security check to avoid CSRF attacks
|
244 |
+
if ( !wp_verify_nonce($nonce, 'wfu_download_file_invoker') ) die();
|
245 |
+
|
246 |
$filepath = wfu_plugin_decode_string($file_enc);
|
247 |
|
248 |
//check if user is allowed to perform this action
|
249 |
+
$user_allowed = wfu_current_user_allowed_action('download', $filepath);
|
250 |
+
if ( $user_allowed == null ) die();
|
251 |
+
|
252 |
+
//generate download unique id to monitor this download
|
253 |
+
$download_id = wfu_create_random_string(16);
|
254 |
+
//store download status of this download
|
255 |
+
$_SESSION['wfu_download_status_'.$download_id] = 'starting';
|
256 |
+
//generate download ticket which expires in 30sec and store it in session
|
257 |
+
//it will be used as security measure for the downloader script, which runs outside Wordpress environment
|
258 |
+
$_SESSION['wfu_download_ticket_'.$download_id] = time() + 30;
|
259 |
+
//generate download monitor ticket which expires in 30sec and store it in session
|
260 |
+
//it will be used as security measure for the monitor script that will check download status
|
261 |
+
$_SESSION['wfu_download_monitor_ticket_'.$download_id] = time() + 30;
|
262 |
+
|
263 |
+
//this routine returns a dynamically created iframe element, that will call the actual download script;
|
264 |
+
//the actual download script runs outside Wordpress environment in order to ensure that no php warnings
|
265 |
+
//or echo from other plugins is generated, that could scramble the downloaded file;
|
266 |
+
//a ticket, similar to nonces, is passed to the download script to check that it is not a CSRF attack; moreover,the ticket is destroyed
|
267 |
+
//by the time it is consumed by the download script, so it cannot be used again
|
268 |
+
$response = '<iframe src="'.WFU_DOWNLOADER_URL.'?file='.$file_enc.'&ticket='.$download_id.'" style="display: none;"></iframe>';
|
269 |
+
|
270 |
+
die('wfu_ajax_action_download_file_invoker:wfu_download_id;'.$download_id.':'.$response);
|
271 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
272 |
|
273 |
+
function wfu_ajax_action_download_file_monitor() {
|
274 |
+
$file_enc = (isset($_POST['file']) ? $_POST['file'] : (isset($_GET['file']) ? $_GET['file'] : ''));
|
275 |
+
$id = (isset($_POST['id']) ? $_POST['id'] : (isset($_GET['id']) ? $_GET['id'] : ''));
|
276 |
+
if ( $file_enc == '' || $id == '' ) die();
|
277 |
+
|
278 |
+
//ensure that this is not a CSRF attack by checking validity of a security ticket
|
279 |
+
if ( !isset($_SESSION['wfu_download_monitor_ticket_'.$id]) || time() > $_SESSION['wfu_download_monitor_ticket_'.$id] ) die('pass');
|
280 |
+
//destroy monitor ticket so it cannot be used again
|
281 |
+
unset($_SESSION['wfu_download_monitor_ticket_'.$id]);
|
282 |
+
|
283 |
+
//initiate loop of 30secs to check the download status of the file;
|
284 |
+
//the download status is controlled by the actual download script;
|
285 |
+
//if the file finishes within the 30secs of the loop, then this routine logs the action and notifies
|
286 |
+
//the client side about the download status of the file, otherwise an instruction
|
287 |
+
//to the client side to repeat this routine and wait for another 30secs is dispatched
|
288 |
+
$end_time = time() + 30;
|
289 |
+
$upload_ended = false;
|
290 |
+
while ( time() < $end_time ) {
|
291 |
+
$upload_ended = ( isset($_SESSION['wfu_download_status_'.$id]) ? ( $_SESSION['wfu_download_status_'.$id] == 'downloaded' || $_SESSION['wfu_download_status_'.$id] == 'failed' ? true : false ) : false );
|
292 |
+
if ( $upload_ended ) break;
|
293 |
+
usleep(100);
|
294 |
+
}
|
295 |
+
|
296 |
+
if ( $upload_ended ) {
|
297 |
+
$user = wp_get_current_user();
|
298 |
+
$filepath = wfu_plugin_decode_string($file_enc);
|
299 |
wfu_log_action('download', $filepath, $user->ID, '', 0, '', null);
|
300 |
+
die('wfu_ajax_action_download_file_monitor:'.$_SESSION['wfu_download_status_'.$id].':');
|
301 |
+
}
|
302 |
+
else {
|
303 |
+
//regenerate monitor ticket
|
304 |
+
$_SESSION['wfu_download_monitor_ticket_'.$id] = time() + 30;
|
305 |
+
die('wfu_ajax_action_download_file_monitor:repeat:'.$id);
|
306 |
}
|
|
|
307 |
}
|
308 |
|
309 |
function wfu_ajax_action_notify_wpfilebase() {
|
lib/wfu_attributes.php
CHANGED
@@ -182,6 +182,20 @@ function wfu_attribute_definitions() {
|
|
182 |
"variables" => null,
|
183 |
"help" => "If activated then the plugin will attempt to create the upload path, if it does not exist."
|
184 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
185 |
array(
|
186 |
"name" => "Folder Access Method",
|
187 |
"attribute" => "accessmethod",
|
@@ -224,6 +238,34 @@ function wfu_attribute_definitions() {
|
|
224 |
"variables" => null,
|
225 |
"help" => "If FTP access method is selected, then sometimes the FTP domain is different than the domain of your Wordpress installation. In this case, enable this attribute if upload of files is not successful."
|
226 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
227 |
array(
|
228 |
"name" => "Show Upload Folder Path",
|
229 |
"attribute" => "showtargetfolder",
|
182 |
"variables" => null,
|
183 |
"help" => "If activated then the plugin will attempt to create the upload path, if it does not exist."
|
184 |
),
|
185 |
+
array(
|
186 |
+
"name" => "Do Not Change Filename",
|
187 |
+
"attribute" => "forcefilename",
|
188 |
+
"type" => "onoff",
|
189 |
+
"listitems" => null,
|
190 |
+
"value" => WFU_FORCEFILENAME,
|
191 |
+
"mode" => "free",
|
192 |
+
"category" => "general",
|
193 |
+
"subcategory" => "Upload Path and Files",
|
194 |
+
"parent" => "",
|
195 |
+
"dependencies" => null,
|
196 |
+
"variables" => null,
|
197 |
+
"help" => "The plugin by default will modify the filename if it contains invalid or non-english characters. By enabling this attribute the plugin will not change the filename."
|
198 |
+
),
|
199 |
array(
|
200 |
"name" => "Folder Access Method",
|
201 |
"attribute" => "accessmethod",
|
238 |
"variables" => null,
|
239 |
"help" => "If FTP access method is selected, then sometimes the FTP domain is different than the domain of your Wordpress installation. In this case, enable this attribute if upload of files is not successful."
|
240 |
),
|
241 |
+
array(
|
242 |
+
"name" => "FTP Passive Mode",
|
243 |
+
"attribute" => "ftppassivemode",
|
244 |
+
"type" => "onoff",
|
245 |
+
"listitems" => null,
|
246 |
+
"value" => WFU_FTPPASSIVEMODE,
|
247 |
+
"mode" => "free",
|
248 |
+
"category" => "general",
|
249 |
+
"subcategory" => "Upload Path and Files",
|
250 |
+
"parent" => "accessmethod",
|
251 |
+
"dependencies" => null,
|
252 |
+
"variables" => null,
|
253 |
+
"help" => "If files fail to upload to the ftp domain then switching to passive FTP mode may solve the problem."
|
254 |
+
),
|
255 |
+
array(
|
256 |
+
"name" => "Permissions of Uploaded File",
|
257 |
+
"attribute" => "ftpfilepermissions",
|
258 |
+
"type" => "text",
|
259 |
+
"listitems" => null,
|
260 |
+
"value" => WFU_FTPFILEPERMISSIONS,
|
261 |
+
"mode" => "free",
|
262 |
+
"category" => "general",
|
263 |
+
"subcategory" => "Upload Path and Files",
|
264 |
+
"parent" => "accessmethod",
|
265 |
+
"dependencies" => null,
|
266 |
+
"variables" => null,
|
267 |
+
"help" => "Force the uploaded files to have specific permissions. This is a 4-digit octal number, e.g. 0777. If left empty, then the ftp server will define the permissions."
|
268 |
+
),
|
269 |
array(
|
270 |
"name" => "Show Upload Folder Path",
|
271 |
"attribute" => "showtargetfolder",
|
lib/wfu_constants.php
CHANGED
@@ -11,11 +11,14 @@ DEFINE("WFU_SINGLEBUTTON", "false");
|
|
11 |
DEFINE("WFU_UPLOADROLE", "all");
|
12 |
DEFINE("WFU_UPLOADPATH", 'uploads');
|
13 |
DEFINE("WFU_CREATEPATH", "false");
|
|
|
14 |
DEFINE("WFU_UPLOADPATTERNS", "*.*");
|
15 |
DEFINE("WFU_MAXSIZE", "50");
|
16 |
DEFINE("WFU_ACCESSMETHOD", "normal");
|
17 |
DEFINE("WFU_FTPINFO", "");
|
18 |
DEFINE("WFU_USEFTPDOMAIN", "false");
|
|
|
|
|
19 |
DEFINE("WFU_DUBLICATESPOLICY", "overwrite");
|
20 |
DEFINE("WFU_UNIQUEPATTERN", "index");
|
21 |
DEFINE("WFU_FILEBASELINK", "false");
|
@@ -66,6 +69,7 @@ DEFINE("WFU_ERROR_DIR_NOTEMP", __("Upload failed! Missing a temporary folder.",
|
|
66 |
DEFINE("WFU_ERROR_DIR_PERMISSION", __("Upload failed! Permission denied to write to target folder.", "wordpress-file-upload"));
|
67 |
DEFINE("WFU_ERROR_FILE_ALLOW", __("File not allowed.", "wordpress-file-upload"));
|
68 |
DEFINE("WFU_ERROR_FILE_PLUGIN_SIZE", __("The uploaded file exceeds the file size limit.", "wordpress-file-upload"));
|
|
|
69 |
DEFINE("WFU_ERROR_FILE_PHP_SIZE", __("Upload failed! The uploaded file exceeds the file size limit of the server. Please contact the administrator.", "wordpress-file-upload"));
|
70 |
DEFINE("WFU_ERROR_FILE_PHP_TIME", __("Upload failed! The duration of the upload exceeded the time limit of the server. Please contact the administrator.", "wordpress-file-upload"));
|
71 |
DEFINE("WFU_ERROR_FILE_HTML_SIZE", __("Upload failed! The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.", "wordpress-file-upload"));
|
@@ -91,6 +95,8 @@ DEFINE("WFU_ERROR_REDIRECTION_ERRORCODE1", __("Redirection to classic form funct
|
|
91 |
DEFINE("WFU_ERROR_REDIRECTION_ERRORCODE2", __("Redirection to classic form functionality occurred because HTML5 is not supported.", "wordpress-file-upload"));
|
92 |
DEFINE("WFU_ERROR_REDIRECTION_ERRORCODE3", __("Redirection to classic form functionality occurred due to JSON parse error.", "wordpress-file-upload"));
|
93 |
DEFINE("WFU_ERROR_USERDATA_EMPTY", __("cannot be empty!", "wordpress-file-upload"));
|
|
|
|
|
94 |
|
95 |
//define plugin warnings
|
96 |
DEFINE("WFU_WARNING_FILE_EXISTS", __("Upload skipped! File already exists.", "wordpress-file-upload"));
|
@@ -108,6 +114,7 @@ DEFINE("WFU_SUBDIR_SELECTDIR", __("select dir...", "wordpress-file-upload"));
|
|
108 |
DEFINE("WFU_SUCCESSMESSAGE_DETAILS", __('Upload path: %filepath%', 'wordpress-file-upload'));
|
109 |
DEFINE("WFU_FAILMESSAGE_DETAILS", __('Failed upload path: %filepath%', 'wordpress-file-upload'));
|
110 |
DEFINE("WFU_USERDATA_REQUIREDLABEL", __(' (required)', 'wordpress-file-upload'));
|
|
|
111 |
|
112 |
//define plugin test messages
|
113 |
DEFINE("WFU_TESTMESSAGE_MESSAGE", __('This is a test message', 'wordpress-file-upload'));
|
@@ -119,6 +126,12 @@ DEFINE("WFU_TESTMESSAGE_FILE2_HEADER", __('File testfile 2 under test', 'wordpre
|
|
119 |
DEFINE("WFU_TESTMESSAGE_FILE2_MESSAGE", __('File testfile 2 message', 'wordpress-file-upload'));
|
120 |
DEFINE("WFU_TESTMESSAGE_FILE2_ADMINMESSAGE", __('File testfile 2 administrator message', 'wordpress-file-upload'));
|
121 |
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
//define tool tip constants
|
123 |
DEFINE("WFU_VARIABLE_TITLE_USERID", __("Insert variable %userid% inside text. It will be replaced by the id of the current user.", "wordpress-file-upload"));
|
124 |
DEFINE("WFU_VARIABLE_TITLE_USERNAME", __("Insert variable %username% inside text. It will be replaced by the username of the current user.", "wordpress-file-upload"));
|
@@ -146,9 +159,12 @@ DEFINE("WFU_UPLOAD_STATE8", __("There are no files to upload!", "wordpress-file-
|
|
146 |
DEFINE("WFU_UPLOAD_STATE9", __("Test upload message", "wordpress-file-upload"));
|
147 |
DEFINE("WFU_UPLOAD_STATE10", __("JSON parse warning!", "wordpress-file-upload"));
|
148 |
DEFINE("WFU_UPLOAD_STATE11", __("please wait while redirecting...", "wordpress-file-upload"));
|
|
|
|
|
149 |
DEFINE("WFU_MAX_TIME_LIMIT", ini_get("max_input_time"));
|
150 |
DEFINE("WFU_RESPONSE_URL", $siteurl.WPFILEUPLOAD_DIR."wfu_response.php");
|
151 |
DEFINE("WFU_AJAX_URL", $siteurl."/wp-admin/admin-ajax.php");
|
|
|
152 |
DEFINE("WFU_PRO_VERSION_URL", 'http://www.iptanus.com/product/wordpress-file-upload-pro/');
|
153 |
|
154 |
//define colors
|
@@ -177,6 +193,8 @@ DEFINE("WFU_IMAGE_ADMIN_SUBFOLDER_OK", $siteurl.WPFILEUPLOAD_DIR.'images/ok_12.g
|
|
177 |
DEFINE("WFU_IMAGE_ADMIN_SUBFOLDER_CANCEL", $siteurl.WPFILEUPLOAD_DIR.'images/cancel_12.gif');
|
178 |
DEFINE("WFU_IMAGE_ADMIN_SUBFOLDER_LOADING", $siteurl.WPFILEUPLOAD_DIR.'images/refresh_16.gif');
|
179 |
DEFINE("WFU_IMAGE_SIMPLE_PROGBAR", $siteurl.WPFILEUPLOAD_DIR.'images/progbar.gif');
|
|
|
|
|
180 |
DEFINE("WFU_IMAGE_VERSION_COMPARISON", $siteurl.WPFILEUPLOAD_DIR.'images/Version Comparison.png');
|
181 |
|
182 |
function wfu_set_javascript_constants() {
|
@@ -196,11 +214,13 @@ function wfu_set_javascript_constants() {
|
|
196 |
"jsonparse_adminmessage" => WFU_ERROR_JSONPARSE_ADMINMESSAGE,
|
197 |
"jsonparse_headermessage" => WFU_ERROR_JSONPARSE_HEADERMESSAGE,
|
198 |
"jsonparse_headeradminmessage" => WFU_ERROR_JSONPARSE_HEADERADMINMESSAGE,
|
|
|
199 |
"default_colors" => WFU_DEFAULTMESSAGECOLORS,
|
200 |
"fail_colors" => WFU_FAILMESSAGECOLORS,
|
201 |
"max_time_limit" => WFU_MAX_TIME_LIMIT,
|
202 |
"response_url" => WFU_RESPONSE_URL,
|
203 |
-
"ajax_url" => WFU_AJAX_URL
|
|
|
204 |
);
|
205 |
$consts_txt = "";
|
206 |
foreach ( $consts as $key => $val )
|
11 |
DEFINE("WFU_UPLOADROLE", "all");
|
12 |
DEFINE("WFU_UPLOADPATH", 'uploads');
|
13 |
DEFINE("WFU_CREATEPATH", "false");
|
14 |
+
DEFINE("WFU_FORCEFILENAME", "false");
|
15 |
DEFINE("WFU_UPLOADPATTERNS", "*.*");
|
16 |
DEFINE("WFU_MAXSIZE", "50");
|
17 |
DEFINE("WFU_ACCESSMETHOD", "normal");
|
18 |
DEFINE("WFU_FTPINFO", "");
|
19 |
DEFINE("WFU_USEFTPDOMAIN", "false");
|
20 |
+
DEFINE("WFU_FTPPASSIVEMODE", "false");
|
21 |
+
DEFINE("WFU_FTPFILEPERMISSIONS", "");
|
22 |
DEFINE("WFU_DUBLICATESPOLICY", "overwrite");
|
23 |
DEFINE("WFU_UNIQUEPATTERN", "index");
|
24 |
DEFINE("WFU_FILEBASELINK", "false");
|
69 |
DEFINE("WFU_ERROR_DIR_PERMISSION", __("Upload failed! Permission denied to write to target folder.", "wordpress-file-upload"));
|
70 |
DEFINE("WFU_ERROR_FILE_ALLOW", __("File not allowed.", "wordpress-file-upload"));
|
71 |
DEFINE("WFU_ERROR_FILE_PLUGIN_SIZE", __("The uploaded file exceeds the file size limit.", "wordpress-file-upload"));
|
72 |
+
DEFINE("WFU_ERROR_FILE_PLUGIN_2GBSIZE", __("The uploaded file exceeds 2GB and is not supported by this server.", "wordpress-file-upload"));
|
73 |
DEFINE("WFU_ERROR_FILE_PHP_SIZE", __("Upload failed! The uploaded file exceeds the file size limit of the server. Please contact the administrator.", "wordpress-file-upload"));
|
74 |
DEFINE("WFU_ERROR_FILE_PHP_TIME", __("Upload failed! The duration of the upload exceeded the time limit of the server. Please contact the administrator.", "wordpress-file-upload"));
|
75 |
DEFINE("WFU_ERROR_FILE_HTML_SIZE", __("Upload failed! The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.", "wordpress-file-upload"));
|
95 |
DEFINE("WFU_ERROR_REDIRECTION_ERRORCODE2", __("Redirection to classic form functionality occurred because HTML5 is not supported.", "wordpress-file-upload"));
|
96 |
DEFINE("WFU_ERROR_REDIRECTION_ERRORCODE3", __("Redirection to classic form functionality occurred due to JSON parse error.", "wordpress-file-upload"));
|
97 |
DEFINE("WFU_ERROR_USERDATA_EMPTY", __("cannot be empty!", "wordpress-file-upload"));
|
98 |
+
DEFINE("WFU_ERROR_SAME_PLUGINID", __("There are more than one instances of the plugin in this page with the same id. Please change it.", "wordpress-file-upload"));
|
99 |
+
DEFINE("WFU_ERROR_PAGE_OBSOLETE", __("Cannot edit the shortcode because the page has been modified. Please reload the page.", "wordpress-file-upload"));
|
100 |
|
101 |
//define plugin warnings
|
102 |
DEFINE("WFU_WARNING_FILE_EXISTS", __("Upload skipped! File already exists.", "wordpress-file-upload"));
|
114 |
DEFINE("WFU_SUCCESSMESSAGE_DETAILS", __('Upload path: %filepath%', 'wordpress-file-upload'));
|
115 |
DEFINE("WFU_FAILMESSAGE_DETAILS", __('Failed upload path: %filepath%', 'wordpress-file-upload'));
|
116 |
DEFINE("WFU_USERDATA_REQUIREDLABEL", __(' (required)', 'wordpress-file-upload'));
|
117 |
+
DEFINE("WFU_PAGEEXIT_PROMPT", __('Files are being uploaded. Are you sure you want to exit the page?', 'wordpress-file-upload'));
|
118 |
|
119 |
//define plugin test messages
|
120 |
DEFINE("WFU_TESTMESSAGE_MESSAGE", __('This is a test message', 'wordpress-file-upload'));
|
126 |
DEFINE("WFU_TESTMESSAGE_FILE2_MESSAGE", __('File testfile 2 message', 'wordpress-file-upload'));
|
127 |
DEFINE("WFU_TESTMESSAGE_FILE2_ADMINMESSAGE", __('File testfile 2 administrator message', 'wordpress-file-upload'));
|
128 |
|
129 |
+
//define admin area messages
|
130 |
+
DEFINE("WFU_DASHBOARD_EDIT_SHORTCODE_REJECTED", __("Failed to edit the shortcode because the contents of the page changed. Try again to edit the shortcode.", "wordpress-file-upload"));
|
131 |
+
DEFINE("WFU_DASHBOARD_PAGE_OBSOLETE", __("The page containing the shortcode has been modified and it is no longer valid. Please go back to reload the shortcode.", "wordpress-file-upload"));
|
132 |
+
DEFINE("WFU_DASHBOARD_UPDATE_SHORTCODE_REJECTED", __("Failed to update the shortcode because the contents of the page changed. Go back to reload the shortcode.", "wordpress-file-upload"));
|
133 |
+
DEFINE("WFU_DASHBOARD_UPDATE_SHORTCODE_FAILED", __("Failed to update the shortcode. Please try again. If the problem persists, go back and reload the shortcode.", "wordpress-file-upload"));
|
134 |
+
|
135 |
//define tool tip constants
|
136 |
DEFINE("WFU_VARIABLE_TITLE_USERID", __("Insert variable %userid% inside text. It will be replaced by the id of the current user.", "wordpress-file-upload"));
|
137 |
DEFINE("WFU_VARIABLE_TITLE_USERNAME", __("Insert variable %username% inside text. It will be replaced by the username of the current user.", "wordpress-file-upload"));
|
159 |
DEFINE("WFU_UPLOAD_STATE9", __("Test upload message", "wordpress-file-upload"));
|
160 |
DEFINE("WFU_UPLOAD_STATE10", __("JSON parse warning!", "wordpress-file-upload"));
|
161 |
DEFINE("WFU_UPLOAD_STATE11", __("please wait while redirecting...", "wordpress-file-upload"));
|
162 |
+
DEFINE("WFU_PAGE_PLUGINEDITOR_BUTTONTITLE", __("Open visual shortcode editor in new window", "wordpress-file-upload"));
|
163 |
+
DEFINE("WFU_PAGE_PLUGINEDITOR_LOADING", __("loading visual editor", "wordpress-file-upload"));
|
164 |
DEFINE("WFU_MAX_TIME_LIMIT", ini_get("max_input_time"));
|
165 |
DEFINE("WFU_RESPONSE_URL", $siteurl.WPFILEUPLOAD_DIR."wfu_response.php");
|
166 |
DEFINE("WFU_AJAX_URL", $siteurl."/wp-admin/admin-ajax.php");
|
167 |
+
DEFINE("WFU_DOWNLOADER_URL", $siteurl.WPFILEUPLOAD_DIR."wfu_file_downloader.php");
|
168 |
DEFINE("WFU_PRO_VERSION_URL", 'http://www.iptanus.com/product/wordpress-file-upload-pro/');
|
169 |
|
170 |
//define colors
|
193 |
DEFINE("WFU_IMAGE_ADMIN_SUBFOLDER_CANCEL", $siteurl.WPFILEUPLOAD_DIR.'images/cancel_12.gif');
|
194 |
DEFINE("WFU_IMAGE_ADMIN_SUBFOLDER_LOADING", $siteurl.WPFILEUPLOAD_DIR.'images/refresh_16.gif');
|
195 |
DEFINE("WFU_IMAGE_SIMPLE_PROGBAR", $siteurl.WPFILEUPLOAD_DIR.'images/progbar.gif');
|
196 |
+
DEFINE("WFU_IMAGE_OVERLAY_EDITOR", $siteurl.WPFILEUPLOAD_DIR.'images/pencil.svg');
|
197 |
+
DEFINE("WFU_IMAGE_OVERLAY_LOADING", $siteurl.WPFILEUPLOAD_DIR.'images/loading_icon.gif');
|
198 |
DEFINE("WFU_IMAGE_VERSION_COMPARISON", $siteurl.WPFILEUPLOAD_DIR.'images/Version Comparison.png');
|
199 |
|
200 |
function wfu_set_javascript_constants() {
|
214 |
"jsonparse_adminmessage" => WFU_ERROR_JSONPARSE_ADMINMESSAGE,
|
215 |
"jsonparse_headermessage" => WFU_ERROR_JSONPARSE_HEADERMESSAGE,
|
216 |
"jsonparse_headeradminmessage" => WFU_ERROR_JSONPARSE_HEADERADMINMESSAGE,
|
217 |
+
"same_pluginid" => WFU_ERROR_SAME_PLUGINID,
|
218 |
"default_colors" => WFU_DEFAULTMESSAGECOLORS,
|
219 |
"fail_colors" => WFU_FAILMESSAGECOLORS,
|
220 |
"max_time_limit" => WFU_MAX_TIME_LIMIT,
|
221 |
"response_url" => WFU_RESPONSE_URL,
|
222 |
+
"ajax_url" => WFU_AJAX_URL,
|
223 |
+
"wfu_pageexit_prompt" => WFU_PAGEEXIT_PROMPT
|
224 |
);
|
225 |
$consts_txt = "";
|
226 |
foreach ( $consts as $key => $val )
|
lib/wfu_functions.php
CHANGED
@@ -10,10 +10,11 @@ function wfu_upload_plugin_clean($label) {
|
|
10 |
$search = array ('@[eeeeEE]@i','@[aaaAA]@i','@[iiII]@i','@[uuuUU]@i','@[ooOO]@i',
|
11 |
'@[c]@i','@[^a-zA-Z0-9._]@');
|
12 |
$replace = array ('e','a','i','u','o','c','-');
|
13 |
-
$
|
14 |
-
$
|
15 |
// $label = preg_replace('/[\\/\?%\*:\|\"<>]/', '-', $label);
|
16 |
-
|
|
|
17 |
}
|
18 |
|
19 |
function wfu_upload_plugin_wildcard_to_preg($pattern) {
|
@@ -215,6 +216,20 @@ function wfu_array_sort($array, $on, $order=SORT_ASC) {
|
|
215 |
|
216 |
//********************* Plugin Options Functions *******************************************************************************************
|
217 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
218 |
function wfu_encode_plugin_options($plugin_options) {
|
219 |
$encoded_options = 'version='.$plugin_options['version'].';';
|
220 |
$encoded_options .= 'shortcode='.wfu_plugin_encode_string($plugin_options['shortcode']).';';
|
@@ -227,12 +242,13 @@ function wfu_decode_plugin_options($encoded_options) {
|
|
227 |
$decoded_array = explode(';', $encoded_options);
|
228 |
$plugin_options = array();
|
229 |
foreach ($decoded_array as $decoded_item) {
|
230 |
-
|
231 |
-
|
232 |
-
$
|
233 |
-
|
234 |
-
|
235 |
-
|
|
|
236 |
}
|
237 |
return $plugin_options;
|
238 |
}
|
@@ -295,12 +311,12 @@ function wfu_compare_versions($current, $latest) {
|
|
295 |
return array( 'status' => true, 'custom' => $custom, 'result' => 'equal' );
|
296 |
}
|
297 |
|
298 |
-
|
299 |
-
$logpath = WP_CONTENT_DIR.'/debug_log.txt';
|
300 |
-
file_put_contents($logpath, $message, FILE_APPEND);
|
301 |
-
}
|
302 |
|
303 |
-
|
|
|
|
|
|
|
304 |
|
305 |
function wfu_upload_plugin_full_path( $params ) {
|
306 |
$path = $params["uploadpath"];
|
@@ -435,6 +451,106 @@ function wfu_parse_folderlist($subfoldertree) {
|
|
435 |
return $ret;
|
436 |
}
|
437 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
438 |
//********************* User Functions *****************************************************************************************************
|
439 |
|
440 |
function wfu_get_user_role($user, $param_roles) {
|
@@ -754,7 +870,7 @@ function wfu_get_file_rec($filepath, $include_userdata) {
|
|
754 |
$relativepath = str_replace(ABSPATH, '', $filepath);
|
755 |
if ( substr($relativepath, 0, 1) != '/' ) $relativepath = '/'.$relativepath;
|
756 |
//if file hash is enabled, then search file based on its path and hash, otherwise find file based on its path and size
|
757 |
-
if ( $plugin_options['hashfiles'] == '1' ) {
|
758 |
$filehash = md5_file($filepath);
|
759 |
$filerec = $wpdb->get_row('SELECT * FROM '.$table_name1.' WHERE filepath = \''.$relativepath.'\' AND filehash = \''.$filehash.'\' AND date_to = 0 ORDER BY date_from DESC');
|
760 |
}
|
@@ -936,7 +1052,7 @@ function wfu_add_div() {
|
|
936 |
for ( $k = 1; $k <= $item_lines_count; $k++ ) {
|
937 |
if ( $items[$i]["line".$k] != "" ) $div .= "\n\t\t\t\t\t\t\t".$items[$i]["line".$k];
|
938 |
}
|
939 |
-
$div .= "\n\t\t\t\t\t\t\t".'<div class="file_space_clean"
|
940 |
$div .= "\n\t\t\t\t\t\t".'</div>';
|
941 |
$div .= "\n\t\t\t\t\t".'</td>';
|
942 |
}
|
@@ -993,11 +1109,11 @@ function wfu_send_notification_email($user, $only_filename_list, $target_path_li
|
|
993 |
|
994 |
// function wfu_process_media_insert contribution from Aaron Olin
|
995 |
function wfu_process_media_insert($file_path, $page_id){
|
996 |
-
$filetype = wp_check_filetype(
|
997 |
|
998 |
$attachment = array(
|
999 |
'post_mime_type' => $filetype['type'],
|
1000 |
-
'post_title' => preg_replace( '/\.[^.]+$/', '',
|
1001 |
'post_content' => '',
|
1002 |
'post_status' => 'inherit'
|
1003 |
);
|
@@ -1012,4 +1128,18 @@ function wfu_process_media_insert($file_path, $page_id){
|
|
1012 |
return $attach_id;
|
1013 |
}
|
1014 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1015 |
?>
|
10 |
$search = array ('@[eeeeEE]@i','@[aaaAA]@i','@[iiII]@i','@[uuuUU]@i','@[ooOO]@i',
|
11 |
'@[c]@i','@[^a-zA-Z0-9._]@');
|
12 |
$replace = array ('e','a','i','u','o','c','-');
|
13 |
+
$clean = preg_replace($search, $replace, $label);
|
14 |
+
$clean = strtolower($clean); // Convert in lower case
|
15 |
// $label = preg_replace('/[\\/\?%\*:\|\"<>]/', '-', $label);
|
16 |
+
|
17 |
+
return $clean;
|
18 |
}
|
19 |
|
20 |
function wfu_upload_plugin_wildcard_to_preg($pattern) {
|
216 |
|
217 |
//********************* Plugin Options Functions *******************************************************************************************
|
218 |
|
219 |
+
function wfu_get_server_environment() {
|
220 |
+
$php_env = '';
|
221 |
+
if ( PHP_INT_SIZE == 4 ) $php_env = '32bit';
|
222 |
+
elseif ( PHP_INT_SIZE == 8 ) $php_env = '64bit';
|
223 |
+
else {
|
224 |
+
$int = "9223372036854775807";
|
225 |
+
$int = intval($int);
|
226 |
+
if ($int == 9223372036854775807) $php_env = '64bit';
|
227 |
+
elseif ($int == 2147483647) $php_env = '32bit';
|
228 |
+
}
|
229 |
+
|
230 |
+
return $php_env;
|
231 |
+
}
|
232 |
+
|
233 |
function wfu_encode_plugin_options($plugin_options) {
|
234 |
$encoded_options = 'version='.$plugin_options['version'].';';
|
235 |
$encoded_options .= 'shortcode='.wfu_plugin_encode_string($plugin_options['shortcode']).';';
|
242 |
$decoded_array = explode(';', $encoded_options);
|
243 |
$plugin_options = array();
|
244 |
foreach ($decoded_array as $decoded_item) {
|
245 |
+
if ( trim($decoded_item) != "" ) {
|
246 |
+
list($item_key, $item_value) = explode("=", $decoded_item, 2);
|
247 |
+
if ( $item_key == 'shortcode' || $item_key == 'basedir' )
|
248 |
+
$plugin_options[$item_key] = wfu_plugin_decode_string($item_value);
|
249 |
+
else
|
250 |
+
$plugin_options[$item_key] = $item_value;
|
251 |
+
}
|
252 |
}
|
253 |
return $plugin_options;
|
254 |
}
|
311 |
return array( 'status' => true, 'custom' => $custom, 'result' => 'equal' );
|
312 |
}
|
313 |
|
314 |
+
//********************* File / Directory Functions ************************************************************************************************
|
|
|
|
|
|
|
315 |
|
316 |
+
function wfu_basename($path) {
|
317 |
+
if ( !$path || $path == "" ) return "";
|
318 |
+
return preg_replace('/.*(\\\\|\\/)/', '', $path);
|
319 |
+
}
|
320 |
|
321 |
function wfu_upload_plugin_full_path( $params ) {
|
322 |
$path = $params["uploadpath"];
|
451 |
return $ret;
|
452 |
}
|
453 |
|
454 |
+
function wfu_filesize($filepath) {
|
455 |
+
$fp = fopen($filepath, 'r');
|
456 |
+
$pos = 0;
|
457 |
+
if ($fp) {
|
458 |
+
$size = 1073741824;
|
459 |
+
fseek($fp, 0, SEEK_SET);
|
460 |
+
while ($size > 1) {
|
461 |
+
fseek($fp, $size, SEEK_CUR);
|
462 |
+
if (fgetc($fp) === false) {
|
463 |
+
fseek($fp, -$size, SEEK_CUR);
|
464 |
+
$size = (int)($size / 2);
|
465 |
+
}
|
466 |
+
else {
|
467 |
+
fseek($fp, -1, SEEK_CUR);
|
468 |
+
$pos += $size;
|
469 |
+
}
|
470 |
+
}
|
471 |
+
while (fgetc($fp) !== false) $pos++;
|
472 |
+
fclose($fp);
|
473 |
+
}
|
474 |
+
|
475 |
+
return $pos;
|
476 |
+
}
|
477 |
+
|
478 |
+
function wfu_filesize2($filepath) {
|
479 |
+
$fp = fopen($filepath, 'r');
|
480 |
+
$return = false;
|
481 |
+
if (is_resource($fp)) {
|
482 |
+
if (PHP_INT_SIZE < 8) {
|
483 |
+
// 32bit
|
484 |
+
if (0 === fseek($fp, 0, SEEK_END)) {
|
485 |
+
$return = 0.0;
|
486 |
+
$step = 0x7FFFFFFF;
|
487 |
+
while ($step > 0) {
|
488 |
+
if (0 === fseek($fp, - $step, SEEK_CUR)) {
|
489 |
+
$return += floatval($step);
|
490 |
+
} else {
|
491 |
+
$step >>= 1;
|
492 |
+
}
|
493 |
+
}
|
494 |
+
}
|
495 |
+
} elseif (0 === fseek($fp, 0, SEEK_END)) {
|
496 |
+
// 64bit
|
497 |
+
$return = ftell($fp);
|
498 |
+
}
|
499 |
+
fclose($fp);
|
500 |
+
}
|
501 |
+
return $return;
|
502 |
+
}
|
503 |
+
|
504 |
+
function wfu_fseek($fp, $pos, $first = 1) {
|
505 |
+
// set to 0 pos initially, one-time
|
506 |
+
if ( $first ) fseek($fp, 0, SEEK_SET);
|
507 |
+
|
508 |
+
// get pos float value
|
509 |
+
$pos = floatval($pos);
|
510 |
+
|
511 |
+
// within limits, use normal fseek
|
512 |
+
if ( $pos <= PHP_INT_MAX )
|
513 |
+
fseek($fp, $pos, SEEK_CUR);
|
514 |
+
// out of limits, use recursive fseek
|
515 |
+
else {
|
516 |
+
fseek($fp, PHP_INT_MAX, SEEK_CUR);
|
517 |
+
$pos -= PHP_INT_MAX;
|
518 |
+
wfu_fseek($fp, $pos, 0);
|
519 |
+
}
|
520 |
+
}
|
521 |
+
|
522 |
+
function wfu_fseek2($fp, $pos) {
|
523 |
+
$pos = floatval($pos);
|
524 |
+
if ( $pos <= PHP_INT_MAX ) {
|
525 |
+
return fseek($fp, $pos, SEEK_SET);
|
526 |
+
}
|
527 |
+
else {
|
528 |
+
$fsize = wfu_filesize2($filepath);
|
529 |
+
$opp = $fsize - $pos;
|
530 |
+
if ( 0 === ($ans = fseek($fp, 0, SEEK_END)) ) {
|
531 |
+
$maxstep = 0x7FFFFFFF;
|
532 |
+
$step = $opp;
|
533 |
+
if ( $step > $maxstep ) $step = $maxstep;
|
534 |
+
while ($step > 0) {
|
535 |
+
if ( 0 === ($ans = fseek($fp, - $step, SEEK_CUR)) ) {
|
536 |
+
$opp -= floatval($step);
|
537 |
+
}
|
538 |
+
else {
|
539 |
+
$maxstep >>= 1;
|
540 |
+
}
|
541 |
+
$step = $opp;
|
542 |
+
if ( $step > $maxstep ) $step = $maxstep;
|
543 |
+
}
|
544 |
+
}
|
545 |
+
}
|
546 |
+
return $ans;
|
547 |
+
}
|
548 |
+
|
549 |
+
function wfu_debug_log($message) {
|
550 |
+
$logpath = WP_CONTENT_DIR.'/debug_log.txt';
|
551 |
+
file_put_contents($logpath, $message, FILE_APPEND);
|
552 |
+
}
|
553 |
+
|
554 |
//********************* User Functions *****************************************************************************************************
|
555 |
|
556 |
function wfu_get_user_role($user, $param_roles) {
|
870 |
$relativepath = str_replace(ABSPATH, '', $filepath);
|
871 |
if ( substr($relativepath, 0, 1) != '/' ) $relativepath = '/'.$relativepath;
|
872 |
//if file hash is enabled, then search file based on its path and hash, otherwise find file based on its path and size
|
873 |
+
if ( isset($plugin_options['hashfiles']) && $plugin_options['hashfiles'] == '1' ) {
|
874 |
$filehash = md5_file($filepath);
|
875 |
$filerec = $wpdb->get_row('SELECT * FROM '.$table_name1.' WHERE filepath = \''.$relativepath.'\' AND filehash = \''.$filehash.'\' AND date_to = 0 ORDER BY date_from DESC');
|
876 |
}
|
1052 |
for ( $k = 1; $k <= $item_lines_count; $k++ ) {
|
1053 |
if ( $items[$i]["line".$k] != "" ) $div .= "\n\t\t\t\t\t\t\t".$items[$i]["line".$k];
|
1054 |
}
|
1055 |
+
$div .= "\n\t\t\t\t\t\t\t".'<div class="file_space_clean"></div>';
|
1056 |
$div .= "\n\t\t\t\t\t\t".'</div>';
|
1057 |
$div .= "\n\t\t\t\t\t".'</td>';
|
1058 |
}
|
1109 |
|
1110 |
// function wfu_process_media_insert contribution from Aaron Olin
|
1111 |
function wfu_process_media_insert($file_path, $page_id){
|
1112 |
+
$filetype = wp_check_filetype( wfu_basename( $file_path ), null );
|
1113 |
|
1114 |
$attachment = array(
|
1115 |
'post_mime_type' => $filetype['type'],
|
1116 |
+
'post_title' => preg_replace( '/\.[^.]+$/', '', wfu_basename( $file_path ) ),
|
1117 |
'post_content' => '',
|
1118 |
'post_status' => 'inherit'
|
1119 |
);
|
1128 |
return $attach_id;
|
1129 |
}
|
1130 |
|
1131 |
+
//********************* POST/GET Requests Functions ****************************************************************************************************
|
1132 |
+
|
1133 |
+
function wfu_post_request($url, $params) {
|
1134 |
+
$context_params = array(
|
1135 |
+
'http' => array(
|
1136 |
+
'method' => 'POST',
|
1137 |
+
'header' => 'Content-type: application/x-www-form-urlencoded',
|
1138 |
+
'content' => http_build_query($params)
|
1139 |
+
)
|
1140 |
+
);
|
1141 |
+
$context = stream_context_create($context_params);
|
1142 |
+
return file_get_contents($url, false, $context);
|
1143 |
+
}
|
1144 |
+
|
1145 |
?>
|
lib/wfu_io.php
CHANGED
@@ -21,7 +21,7 @@ function wfu_create_directory($path, $method, $ftpdata) {
|
|
21 |
if ( $pos1 ) {
|
22 |
$path = substr($path, $pos1 + strlen($flat_host));
|
23 |
ftp_mkdir($conn_id, $path);
|
24 |
-
ftp_chmod($conn_id,
|
25 |
}
|
26 |
else {
|
27 |
$ret_message = WFU_ERROR_ADMIN_FTPDIR_RESOLVE;
|
@@ -43,12 +43,14 @@ function wfu_create_directory($path, $method, $ftpdata) {
|
|
43 |
}
|
44 |
|
45 |
|
46 |
-
function wfu_upload_file($source, $target, $method, $ftpdata) {
|
47 |
$ret_array = "";
|
48 |
$ret_array["uploaded"] = false;
|
49 |
$ret_array["admin_message"] = "";
|
50 |
$ret_message = "";
|
51 |
$target_perms = substr(sprintf('%o', fileperms(dirname($target))), -4);
|
|
|
|
|
52 |
if ( $method == "" || $method == "normal" ) {
|
53 |
$ret_array["uploaded"] = move_uploaded_file($source, $target);
|
54 |
if ( !$ret_array["uploaded"] && !is_writable(dirname($target)) ) {
|
@@ -70,13 +72,21 @@ function wfu_upload_file($source, $target, $method, $ftpdata) {
|
|
70 |
$flat_host = preg_replace("/^(.*\.)?([^.]*\..*)$/", "$2", $ftp_host);
|
71 |
$pos1 = strpos($target, $flat_host);
|
72 |
if ( $pos1 ) {
|
|
|
73 |
// $temp_fname = tempnam(dirname($target), "tmp");
|
74 |
// move_uploaded_file($source, $temp_fname);
|
75 |
$target = substr($target, $pos1 + strlen($flat_host));
|
76 |
-
ftp_chmod($conn_id, 0755, dirname($target));
|
77 |
$ret_array["uploaded"] = ftp_put($conn_id, $target, $source, FTP_BINARY);
|
78 |
-
|
79 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
unlink($source);
|
81 |
if ( !$ret_array["uploaded"] ) {
|
82 |
$ret_message = WFU_ERROR_ADMIN_DIR_PERMISSION;
|
21 |
if ( $pos1 ) {
|
22 |
$path = substr($path, $pos1 + strlen($flat_host));
|
23 |
ftp_mkdir($conn_id, $path);
|
24 |
+
ftp_chmod($conn_id, 493, $path);
|
25 |
}
|
26 |
else {
|
27 |
$ret_message = WFU_ERROR_ADMIN_FTPDIR_RESOLVE;
|
43 |
}
|
44 |
|
45 |
|
46 |
+
function wfu_upload_file($source, $target, $method, $ftpdata, $passive, $fileperms) {
|
47 |
$ret_array = "";
|
48 |
$ret_array["uploaded"] = false;
|
49 |
$ret_array["admin_message"] = "";
|
50 |
$ret_message = "";
|
51 |
$target_perms = substr(sprintf('%o', fileperms(dirname($target))), -4);
|
52 |
+
$target_perms = octdec($target_perms);
|
53 |
+
$target_perms = (int)$target_perms;
|
54 |
if ( $method == "" || $method == "normal" ) {
|
55 |
$ret_array["uploaded"] = move_uploaded_file($source, $target);
|
56 |
if ( !$ret_array["uploaded"] && !is_writable(dirname($target)) ) {
|
72 |
$flat_host = preg_replace("/^(.*\.)?([^.]*\..*)$/", "$2", $ftp_host);
|
73 |
$pos1 = strpos($target, $flat_host);
|
74 |
if ( $pos1 ) {
|
75 |
+
if ( $passive == "true" ) ftp_pasv($conn_id, true);
|
76 |
// $temp_fname = tempnam(dirname($target), "tmp");
|
77 |
// move_uploaded_file($source, $temp_fname);
|
78 |
$target = substr($target, $pos1 + strlen($flat_host));
|
79 |
+
// ftp_chmod($conn_id, 0755, dirname($target));
|
80 |
$ret_array["uploaded"] = ftp_put($conn_id, $target, $source, FTP_BINARY);
|
81 |
+
//apply user-defined permissions to file
|
82 |
+
$fileperms = trim($fileperms);
|
83 |
+
if ( strlen($fileperms) == 4 && sprintf("%04o", octdec($fileperms)) == $fileperms ) {
|
84 |
+
$fileperms = octdec($fileperms);
|
85 |
+
$fileperms = (int)$fileperms;
|
86 |
+
ftp_chmod($conn_id, $fileperms, $target);
|
87 |
+
}
|
88 |
+
// ftp_chmod($conn_id, 0755, $target);
|
89 |
+
// ftp_chmod($conn_id, $target_perms, dirname($target));
|
90 |
unlink($source);
|
91 |
if ( !$ret_array["uploaded"] ) {
|
92 |
$ret_message = WFU_ERROR_ADMIN_DIR_PERMISSION;
|
lib/wfu_message.php
CHANGED
@@ -122,7 +122,7 @@ function wfu_prepare_message_block_skeleton($sid, $styles, $test) {
|
|
122 |
/* Construct the header block HTML text */
|
123 |
$i = 1;
|
124 |
$messageblock["msgblock"]["line".$i++] = '<table id="'.$messageblock_main.'" class="file_messageblock_table"'.$styles.'><tbody>';
|
125 |
-
$messageblock["msgblock"]["line".$i++] = "\t".'<tr id="'.$messageblock_header.'" class="file_messageblock_header_tr"'.( $test ? '' : 'style="display:none;"' ).'>';
|
126 |
$messageblock["msgblock"]["line".$i++] = "\t\t".'<td colspan="2" id="'.$messageblock_header.'_container" class="file_messageblock_header_td">';
|
127 |
/* Inside this td element the appropriate upload state HTML block is going to be inserted using Javascript
|
128 |
If the plugin is in test mode, then State9 HTML block is inserted now */
|
@@ -138,7 +138,7 @@ function wfu_prepare_message_block_skeleton($sid, $styles, $test) {
|
|
138 |
}
|
139 |
$messageblock["msgblock"]["line".$i++] = "\t\t".'</td>';
|
140 |
/* Add a drop down arrow to the header */
|
141 |
-
$messageblock["msgblock"]["line".$i++] = "\t\t".'<td id="'.$messageblock_arrow.'" class="file_messageblock_arrow_td"'.( $test ? '' : 'style="display:none;"' ).' onclick="wfu_headerdetails_toggle('.$sid.');">';
|
142 |
$messageblock["msgblock"]["line".$i++] = "\t\t\t".'<input id="'.$messageblock_header.'_state" type="hidden" value="none" />';
|
143 |
$messageblock["msgblock"]["line".$i++] = "\t\t\t".'<div id="'.$messageblock_arrow.'_up" class="file_messageblock_header_arrow_up" style="display:none;"></div>';
|
144 |
$messageblock["msgblock"]["line".$i++] = "\t\t\t".'<div id="'.$messageblock_arrow.'_down" class="file_messageblock_header_arrow_down"></div>';
|
@@ -147,10 +147,10 @@ function wfu_prepare_message_block_skeleton($sid, $styles, $test) {
|
|
147 |
/* Construct the subheader block HTML text if exists */
|
148 |
$messageblock["msgblock"]["line".$i++] = "\t".'<tr id="'.$messageblock_subheader.'" class="file_messageblock_subheader_tr" style="display:none;">';
|
149 |
$messageblock["msgblock"]["line".$i++] = "\t\t".'<td colspan="3" id="'.$messageblock_subheader.'_td" class="file_messageblock_subheader_td">';
|
150 |
-
$messageblock["msgblock"]["line".$i++] = "\t\t\t".'<div id="'.$messageblock_subheader.'_message" class="file_messageblock_subheader_message"'.( $test ? '' : 'style="display:none;"' ).'>';
|
151 |
$messageblock["msgblock"]["line".$i++] = "\t\t\t\t".'<label id="'.$messageblock_subheader.'_messagelabel" class="file_messageblock_subheader_messagelabel">'.( $test ? WFU_TESTMESSAGE_MESSAGE : '' ).'</label>';
|
152 |
$messageblock["msgblock"]["line".$i++] = "\t\t\t".'</div>';
|
153 |
-
$messageblock["msgblock"]["line".$i++] = "\t\t\t".'<div id="'.$messageblock_subheader.'_adminmessage" class="file_messageblock_subheader_adminmessage"'.( $test ? '' : 'style="display:none;"' ).'>';
|
154 |
$messageblock["msgblock"]["line".$i++] = "\t\t\t\t".'<label id="'.$messageblock_subheader.'_adminmessagelabel" class="file_messageblock_subheader_adminmessagelabel">'.( $test ? WFU_TESTMESSAGE_ADMINMESSAGE : '' ).'</label>';
|
155 |
$messageblock["msgblock"]["line".$i++] = "\t\t\t".'</div>';
|
156 |
$messageblock["msgblock"]["line".$i++] = "\t\t".'</td>';
|
122 |
/* Construct the header block HTML text */
|
123 |
$i = 1;
|
124 |
$messageblock["msgblock"]["line".$i++] = '<table id="'.$messageblock_main.'" class="file_messageblock_table"'.$styles.'><tbody>';
|
125 |
+
$messageblock["msgblock"]["line".$i++] = "\t".'<tr id="'.$messageblock_header.'" class="file_messageblock_header_tr"'.( $test ? '' : ' style="display:none;"' ).'>';
|
126 |
$messageblock["msgblock"]["line".$i++] = "\t\t".'<td colspan="2" id="'.$messageblock_header.'_container" class="file_messageblock_header_td">';
|
127 |
/* Inside this td element the appropriate upload state HTML block is going to be inserted using Javascript
|
128 |
If the plugin is in test mode, then State9 HTML block is inserted now */
|
138 |
}
|
139 |
$messageblock["msgblock"]["line".$i++] = "\t\t".'</td>';
|
140 |
/* Add a drop down arrow to the header */
|
141 |
+
$messageblock["msgblock"]["line".$i++] = "\t\t".'<td id="'.$messageblock_arrow.'" class="file_messageblock_arrow_td"'.( $test ? '' : ' style="display:none;"' ).' onclick="wfu_headerdetails_toggle('.$sid.');">';
|
142 |
$messageblock["msgblock"]["line".$i++] = "\t\t\t".'<input id="'.$messageblock_header.'_state" type="hidden" value="none" />';
|
143 |
$messageblock["msgblock"]["line".$i++] = "\t\t\t".'<div id="'.$messageblock_arrow.'_up" class="file_messageblock_header_arrow_up" style="display:none;"></div>';
|
144 |
$messageblock["msgblock"]["line".$i++] = "\t\t\t".'<div id="'.$messageblock_arrow.'_down" class="file_messageblock_header_arrow_down"></div>';
|
147 |
/* Construct the subheader block HTML text if exists */
|
148 |
$messageblock["msgblock"]["line".$i++] = "\t".'<tr id="'.$messageblock_subheader.'" class="file_messageblock_subheader_tr" style="display:none;">';
|
149 |
$messageblock["msgblock"]["line".$i++] = "\t\t".'<td colspan="3" id="'.$messageblock_subheader.'_td" class="file_messageblock_subheader_td">';
|
150 |
+
$messageblock["msgblock"]["line".$i++] = "\t\t\t".'<div id="'.$messageblock_subheader.'_message" class="file_messageblock_subheader_message"'.( $test ? '' : ' style="display:none;"' ).'>';
|
151 |
$messageblock["msgblock"]["line".$i++] = "\t\t\t\t".'<label id="'.$messageblock_subheader.'_messagelabel" class="file_messageblock_subheader_messagelabel">'.( $test ? WFU_TESTMESSAGE_MESSAGE : '' ).'</label>';
|
152 |
$messageblock["msgblock"]["line".$i++] = "\t\t\t".'</div>';
|
153 |
+
$messageblock["msgblock"]["line".$i++] = "\t\t\t".'<div id="'.$messageblock_subheader.'_adminmessage" class="file_messageblock_subheader_adminmessage"'.( $test ? '' : ' style="display:none;"' ).'>';
|
154 |
$messageblock["msgblock"]["line".$i++] = "\t\t\t\t".'<label id="'.$messageblock_subheader.'_adminmessagelabel" class="file_messageblock_subheader_adminmessagelabel">'.( $test ? WFU_TESTMESSAGE_ADMINMESSAGE : '' ).'</label>';
|
155 |
$messageblock["msgblock"]["line".$i++] = "\t\t\t".'</div>';
|
156 |
$messageblock["msgblock"]["line".$i++] = "\t\t".'</td>';
|
lib/wfu_processfiles.php
CHANGED
@@ -2,13 +2,16 @@
|
|
2 |
|
3 |
function wfu_process_files($params, $method) {
|
4 |
$sid = $params["uploadid"];
|
|
|
5 |
$user = wp_get_current_user();
|
6 |
if ( 0 == $user->ID ) {
|
|
|
7 |
$user_login = "guest";
|
8 |
$user_email = "";
|
9 |
$is_admin = false;
|
10 |
}
|
11 |
else {
|
|
|
12 |
$user_login = $user->user_login;
|
13 |
$user_email = $user->user_email;
|
14 |
$is_admin = current_user_can('manage_options');
|
@@ -116,6 +119,8 @@ function wfu_process_files($params, $method) {
|
|
116 |
$upload_path_ok = false;
|
117 |
$allowed_file_ok = false;
|
118 |
$size_file_ok = false;
|
|
|
|
|
119 |
$file_output['color'] = $default_colors['color'];
|
120 |
$file_output['bgcolor'] = $default_colors['bgcolor'];
|
121 |
$file_output['borcolor'] = $default_colors['borcolor'];
|
@@ -134,9 +139,10 @@ function wfu_process_files($params, $method) {
|
|
134 |
$file_unique_id = wfu_create_random_string(20);
|
135 |
|
136 |
/* Get uploaded file size in Mbytes */
|
137 |
-
$upload_file_size = filesize($fileprops['tmp_name']) / 1024 / 1024;
|
138 |
// correct file size in case of checking of file otherwise $upload_file_size will be zero and the routine will fail
|
139 |
-
if ( $only_check ) $upload_file_size = $fileprops['size']
|
|
|
|
|
140 |
|
141 |
if ( $upload_file_size > 0 ) {
|
142 |
|
@@ -150,9 +156,9 @@ function wfu_process_files($params, $method) {
|
|
150 |
$changable_data['user_data'] = $userdata_fields;
|
151 |
$changable_data['error_message'] = $filter_error_message;
|
152 |
$additional_data['file_unique_id'] = $file_unique_id;
|
153 |
-
$additional_data['file_size'] = filesize($fileprops['tmp_name']);
|
154 |
// correct file size in case of checking of file
|
155 |
if ( $only_check ) $additional_data['file_size'] = $fileprops['size'];
|
|
|
156 |
$additional_data['user_id'] = $user->ID;
|
157 |
$additional_data['page_id'] = $params["pageid"];
|
158 |
$ret_data = apply_filters('wfu_before_file_check', $changable_data, $additional_data);
|
@@ -174,7 +180,8 @@ function wfu_process_files($params, $method) {
|
|
174 |
$userdata_fields = $_SESSION[$file_map]['userdata'];
|
175 |
}
|
176 |
if ( $filter_error_message != '' ) {
|
177 |
-
|
|
|
178 |
$file_output['message'] = wfu_join_strings("<br />", $file_output['message'], $filter_error_message);
|
179 |
}
|
180 |
else {
|
@@ -204,17 +211,22 @@ function wfu_process_files($params, $method) {
|
|
204 |
}
|
205 |
|
206 |
/* File size control */
|
207 |
-
if ( $
|
208 |
-
$
|
|
|
209 |
}
|
210 |
|
211 |
if ( !$upload_path_ok or !$allowed_file_ok or !$size_file_ok ) {
|
212 |
-
|
|
|
213 |
$file_output['message'] = wfu_join_strings("<br />", $file_output['message'], WFU_ERROR_UPLOAD_FAILED);
|
214 |
|
215 |
if ( !$upload_path_ok ) $file_output['message'] = wfu_join_strings("<br />", $file_output['message'], WFU_ERROR_DIR_EXIST);
|
216 |
if ( !$allowed_file_ok ) $file_output['message'] = wfu_join_strings("<br />", $file_output['message'], WFU_ERROR_FILE_ALLOW);
|
217 |
-
if ( !$size_file_ok )
|
|
|
|
|
|
|
218 |
}
|
219 |
}
|
220 |
}
|
@@ -237,21 +249,25 @@ function wfu_process_files($params, $method) {
|
|
237 |
$message_text = WFU_ERROR_FILE_PHP_TIME;
|
238 |
$file_output['admin_messages'] = wfu_join_strings("<br />", $file_output['admin_messages'], WFU_ERROR_ADMIN_FILE_PHP_TIME);
|
239 |
}
|
|
|
240 |
$file_output['message_type'] = "error";
|
241 |
$file_output['message'] = wfu_join_strings("<br />", $file_output['message'], $message_text);
|
242 |
}
|
243 |
-
|
|
|
|
|
|
|
|
|
244 |
// if ( $upload_path_ok and $allowed_file_ok and $size_file_ok ) {
|
245 |
-
if ( $file_output['message_type'] != "error" ) {
|
246 |
|
247 |
if ( is_uploaded_file($fileprops['tmp_name']) || $only_check ) {
|
248 |
-
|
|
|
|
|
|
|
249 |
else {
|
250 |
$file_copied = false;
|
251 |
-
$message_processed = false;
|
252 |
-
$source_path = $fileprops['tmp_name'];
|
253 |
-
$only_filename = wfu_upload_plugin_clean( $fileprops['name'] );
|
254 |
-
$target_path = wfu_upload_plugin_full_path($params).$only_filename;
|
255 |
|
256 |
$search = array ('/%filename%/', '/%filepath%/');
|
257 |
$replace = array ($only_filename, $target_path);
|
@@ -268,15 +284,16 @@ function wfu_process_files($params, $method) {
|
|
268 |
previous filter wfu_before_file_check, corresponding them to the unique file id */
|
269 |
if ( $file_unique_id != '' ) $target_path = apply_filters('wfu_before_file_upload', $target_path, $file_unique_id);
|
270 |
//recalculate $only_filename in case it changed with wfu_before_file_upload filter
|
271 |
-
$only_filename =
|
272 |
//move the uploaded file to its final destination
|
273 |
-
$wfu_upload_file_ret = wfu_upload_file($source_path, $target_path, $params["accessmethod"], $params["ftpinfo"]);
|
274 |
$file_copied = $wfu_upload_file_ret["uploaded"];
|
275 |
//process warning messages from wfu_upload_file
|
276 |
$echo_message = ob_get_contents();
|
277 |
//finish redirecting of echo to internal buffer
|
278 |
ob_end_clean();
|
279 |
if ( $echo_message != "" && !$file_copied ) {
|
|
|
280 |
$file_output['message_type'] = "error";
|
281 |
if ( stristr($echo_message, "warning") && stristr($echo_message, "permission denied") && stristr($echo_message, "unable to move") ) {
|
282 |
$file_output['message'] = wfu_join_strings("<br />", $file_output['message'], WFU_ERROR_DIR_PERMISSION);
|
@@ -327,15 +344,16 @@ function wfu_process_files($params, $method) {
|
|
327 |
previous filter wfu_before_file_check, corresponding them to the unique file id */
|
328 |
if ( $file_unique_id != '' ) $target_path = apply_filters('wfu_before_file_upload', $target_path, $file_unique_id);
|
329 |
//recalculate $only_filename in case it changed with wfu_before_file_upload filter
|
330 |
-
$only_filename =
|
331 |
//move the uploaded file to its final destination
|
332 |
-
$wfu_upload_file_ret = wfu_upload_file($source_path, $target_path, $params["accessmethod"], $params["ftpinfo"]);
|
333 |
$file_copied = $wfu_upload_file_ret["uploaded"];
|
334 |
//process warning messages from move_uploaded_file
|
335 |
$echo_message = ob_get_contents();
|
336 |
//finish redirecting of echo to internal buffer
|
337 |
ob_end_clean();
|
338 |
if ( $echo_message != "" && !$file_copied ) {
|
|
|
339 |
$file_output['message_type'] = "error";
|
340 |
if ( stristr($echo_message, "warning") && stristr($echo_message, "permission denied") && stristr($echo_message, "unable to move") ) {
|
341 |
$file_output['message'] = wfu_join_strings("<br />", $file_output['message'], WFU_ERROR_DIR_PERMISSION);
|
@@ -352,7 +370,8 @@ function wfu_process_files($params, $method) {
|
|
352 |
}
|
353 |
}
|
354 |
else {
|
355 |
-
|
|
|
356 |
$file_output['message'] = wfu_join_strings("<br />", $file_output['message'], WFU_WARNING_FILE_EXISTS);
|
357 |
$message_processed = true;
|
358 |
$file_copied = false;
|
@@ -382,7 +401,8 @@ function wfu_process_files($params, $method) {
|
|
382 |
}
|
383 |
}
|
384 |
else if ( !$message_processed ) {
|
385 |
-
|
|
|
386 |
$file_output['message'] = wfu_join_strings("<br />", $file_output['message'], WFU_ERROR_UNKNOWN);
|
387 |
}
|
388 |
|
@@ -390,7 +410,8 @@ function wfu_process_files($params, $method) {
|
|
390 |
// unlink($source_path);
|
391 |
}
|
392 |
else {
|
393 |
-
|
|
|
394 |
$file_output['message'] = wfu_join_strings("<br />", $file_output['message'], WFU_ERROR_UNKNOWN);
|
395 |
}
|
396 |
}
|
@@ -399,7 +420,8 @@ function wfu_process_files($params, $method) {
|
|
399 |
if ( $file_output['message_type'] == "" ) {
|
400 |
if ( $file_copied ) $file_output['message_type'] = "success";
|
401 |
else {
|
402 |
-
|
|
|
403 |
$file_output['message'] = wfu_join_strings("<br />", $file_output['message'], WFU_ERROR_UNKNOWN);
|
404 |
}
|
405 |
}
|
@@ -413,6 +435,12 @@ function wfu_process_files($params, $method) {
|
|
413 |
$file_output['message_type'] = "warning";
|
414 |
}
|
415 |
|
|
|
|
|
|
|
|
|
|
|
|
|
416 |
/* adjust message details and colors according to file result */
|
417 |
/* FileResult: A */
|
418 |
$search = array ('/%username%/', '/%useremail%/', '/%filename%/', '/%filepath%/');
|
@@ -439,14 +467,15 @@ function wfu_process_files($params, $method) {
|
|
439 |
$file_output['admin_messages'] = wfu_join_strings("<br />", preg_replace($search, $replace, WFU_SUCCESSMESSAGE_DETAILS), $file_output['admin_messages']);
|
440 |
}
|
441 |
/* FileResult: C */
|
442 |
-
elseif ( $file_output['message_type'] == "error" ) {
|
443 |
$error_count ++;
|
444 |
$color_array = explode(",", $params['failmessagecolors']);
|
445 |
$file_output['color'] = $color_array[0];
|
446 |
$file_output['bgcolor'] = $color_array[1];
|
447 |
$file_output['borcolor'] = $color_array[2];
|
448 |
/* define variables that were not defined before due to error */
|
449 |
-
$only_filename = wfu_upload_plugin_clean( $fileprops['name'] );
|
|
|
450 |
$target_path = wfu_upload_plugin_full_path($params).$only_filename;
|
451 |
$replace = array ($user_login, ( $user_email == "" ? "no email" : $user_email ), $only_filename, $target_path);
|
452 |
$file_output['header'] = preg_replace($search, $replace, $params['errormessage']);
|
@@ -457,29 +486,26 @@ function wfu_process_files($params, $method) {
|
|
457 |
/* suppress again any admin messages if user is not administrator or adminmessages is not activated */
|
458 |
if ( $suppress_admin_messages ) $file_output['admin_messages'] = "";
|
459 |
|
460 |
-
/* set success status of the file, to be used for medialink and post actions */
|
461 |
-
$file_finished_successfully = ( !$only_check && ( $file_output['message_type'] == "success" || $file_output['message_type'] == "warning" ) );
|
462 |
-
|
463 |
$params_output_array[0] = $file_output;
|
464 |
|
465 |
/* Apply wfu_after_file_upload action after failed upload, in order to allow the user to perform any post-upload actions.
|
466 |
If additional data are required, such as user_id or userdata values or filepath, they can be retrieved by implementing
|
467 |
the previous filters wfu_before_file_check and wfu_before_file_upload, corresponding them to the unique file id */
|
468 |
-
if ( $file_unique_id != '' && $
|
469 |
do_action('wfu_after_file_upload', $file_unique_id, $file_output['message_type'], $file_output['message'], $file_output['admin_messages']);
|
470 |
}
|
471 |
|
472 |
/* log file upload action if file has finished uploading successfully */
|
473 |
-
if ( $file_finished_successfully ) {
|
474 |
wfu_log_action('upload', $target_path, $user->ID, $uniqueuploadid, $params['pageid'], $sid, $userdata_fields);
|
475 |
-
/* Apply wfu_after_file_upload action after
|
476 |
If additional data are required, such as user_id or userdata values or filepath, they can be retrieved by implementing
|
477 |
the previous filters wfu_before_file_check and wfu_before_file_upload, corresponding them to the unique file id */
|
478 |
do_action('wfu_after_file_upload', $file_unique_id, $file_output['message_type'], $file_output['message'], $file_output['admin_messages']);
|
479 |
}
|
480 |
|
481 |
/* add file to Media or attach file to current post if any of these options is activated and the file has finished uploading successfully */
|
482 |
-
if ( ( $params["medialink"] == "true" || $params["postlink"] == "true" ) && $file_finished_successfully ) {
|
483 |
$pageid = ( $params["postlink"] == "true" ? $params['pageid'] : 0 );
|
484 |
wfu_process_media_insert($target_path, $pageid);
|
485 |
}
|
@@ -516,7 +542,7 @@ function wfu_process_files($params, $method) {
|
|
516 |
$notifyrecipients = trim(preg_replace('/%useremail%/', $user_email, $params["notifyrecipients"]));
|
517 |
if ( $notifyrecipients != "" ) {
|
518 |
if ( $somefiles_Ok ) {
|
519 |
-
if ( $method == 'no_ajax' ) {
|
520 |
$send_error = wfu_send_notification_email($user, $notify_only_filename_list, $notify_target_path_list, $notify_attachment_list, $userdata_fields, $params);
|
521 |
if ( $send_error != "" ) {
|
522 |
$params_output_array["general"]['admin_messages']['notify'] = $send_error;
|
2 |
|
3 |
function wfu_process_files($params, $method) {
|
4 |
$sid = $params["uploadid"];
|
5 |
+
$sesid = session_id();
|
6 |
$user = wp_get_current_user();
|
7 |
if ( 0 == $user->ID ) {
|
8 |
+
$user_id = 0;
|
9 |
$user_login = "guest";
|
10 |
$user_email = "";
|
11 |
$is_admin = false;
|
12 |
}
|
13 |
else {
|
14 |
+
$user_id = $user->ID;
|
15 |
$user_login = $user->user_login;
|
16 |
$user_email = $user->user_email;
|
17 |
$is_admin = current_user_can('manage_options');
|
119 |
$upload_path_ok = false;
|
120 |
$allowed_file_ok = false;
|
121 |
$size_file_ok = false;
|
122 |
+
$size_file_phpenv_ok = true;
|
123 |
+
$ignore_server_actions = false;
|
124 |
$file_output['color'] = $default_colors['color'];
|
125 |
$file_output['bgcolor'] = $default_colors['bgcolor'];
|
126 |
$file_output['borcolor'] = $default_colors['borcolor'];
|
139 |
$file_unique_id = wfu_create_random_string(20);
|
140 |
|
141 |
/* Get uploaded file size in Mbytes */
|
|
|
142 |
// correct file size in case of checking of file otherwise $upload_file_size will be zero and the routine will fail
|
143 |
+
if ( $only_check ) $upload_file_size = $fileprops['size'];
|
144 |
+
else $upload_file_size = filesize($fileprops['tmp_name']);
|
145 |
+
$upload_file_size_MB = $upload_file_size / 1024 / 1024;
|
146 |
|
147 |
if ( $upload_file_size > 0 ) {
|
148 |
|
156 |
$changable_data['user_data'] = $userdata_fields;
|
157 |
$changable_data['error_message'] = $filter_error_message;
|
158 |
$additional_data['file_unique_id'] = $file_unique_id;
|
|
|
159 |
// correct file size in case of checking of file
|
160 |
if ( $only_check ) $additional_data['file_size'] = $fileprops['size'];
|
161 |
+
else $additional_data['file_size'] = filesize($fileprops['tmp_name']);
|
162 |
$additional_data['user_id'] = $user->ID;
|
163 |
$additional_data['page_id'] = $params["pageid"];
|
164 |
$ret_data = apply_filters('wfu_before_file_check', $changable_data, $additional_data);
|
180 |
$userdata_fields = $_SESSION[$file_map]['userdata'];
|
181 |
}
|
182 |
if ( $filter_error_message != '' ) {
|
183 |
+
//errorabort flag designates that file will be aborted and no resuming will be attempted
|
184 |
+
$file_output['message_type'] = "errorabort";
|
185 |
$file_output['message'] = wfu_join_strings("<br />", $file_output['message'], $filter_error_message);
|
186 |
}
|
187 |
else {
|
211 |
}
|
212 |
|
213 |
/* File size control */
|
214 |
+
if ( $upload_file_size_MB <= $params["maxsize"] ) {
|
215 |
+
if ( $params['php_env'] == '32bit' && $upload_file_size > 2147483647 ) $size_file_phpenv_ok = false;
|
216 |
+
else $size_file_ok = true;
|
217 |
}
|
218 |
|
219 |
if ( !$upload_path_ok or !$allowed_file_ok or !$size_file_ok ) {
|
220 |
+
//abort the file, no resuming will be attempted
|
221 |
+
$file_output['message_type'] = "errorabort";
|
222 |
$file_output['message'] = wfu_join_strings("<br />", $file_output['message'], WFU_ERROR_UPLOAD_FAILED);
|
223 |
|
224 |
if ( !$upload_path_ok ) $file_output['message'] = wfu_join_strings("<br />", $file_output['message'], WFU_ERROR_DIR_EXIST);
|
225 |
if ( !$allowed_file_ok ) $file_output['message'] = wfu_join_strings("<br />", $file_output['message'], WFU_ERROR_FILE_ALLOW);
|
226 |
+
if ( !$size_file_ok ) {
|
227 |
+
if ( $size_file_phpenv_ok ) $file_output['message'] = wfu_join_strings("<br />", $file_output['message'], WFU_ERROR_FILE_PLUGIN_SIZE);
|
228 |
+
else $file_output['message'] = wfu_join_strings("<br />", $file_output['message'], WFU_ERROR_FILE_PLUGIN_2GBSIZE);
|
229 |
+
}
|
230 |
}
|
231 |
}
|
232 |
}
|
249 |
$message_text = WFU_ERROR_FILE_PHP_TIME;
|
250 |
$file_output['admin_messages'] = wfu_join_strings("<br />", $file_output['admin_messages'], WFU_ERROR_ADMIN_FILE_PHP_TIME);
|
251 |
}
|
252 |
+
//error (and not errorabort) flag designates that a resuming of the file may be attempted
|
253 |
$file_output['message_type'] = "error";
|
254 |
$file_output['message'] = wfu_join_strings("<br />", $file_output['message'], $message_text);
|
255 |
}
|
256 |
+
//generate safe filename by removing invalid characters if forcefilename is deactivated
|
257 |
+
if ( $params['forcefilename'] != "true" ) $only_filename = wfu_upload_plugin_clean( $fileprops['name'] );
|
258 |
+
else $only_filename = $fileprops['name'];
|
259 |
+
|
260 |
+
$message_processed = false;
|
261 |
// if ( $upload_path_ok and $allowed_file_ok and $size_file_ok ) {
|
262 |
+
if ( substr($file_output['message_type'], 0, 5) != "error" ) {
|
263 |
|
264 |
if ( is_uploaded_file($fileprops['tmp_name']) || $only_check ) {
|
265 |
+
$source_path = $fileprops['tmp_name'];
|
266 |
+
$target_path = wfu_upload_plugin_full_path($params).$only_filename;
|
267 |
+
|
268 |
+
if ( $only_check || $ignore_server_actions ) $file_copied = true;
|
269 |
else {
|
270 |
$file_copied = false;
|
|
|
|
|
|
|
|
|
271 |
|
272 |
$search = array ('/%filename%/', '/%filepath%/');
|
273 |
$replace = array ($only_filename, $target_path);
|
284 |
previous filter wfu_before_file_check, corresponding them to the unique file id */
|
285 |
if ( $file_unique_id != '' ) $target_path = apply_filters('wfu_before_file_upload', $target_path, $file_unique_id);
|
286 |
//recalculate $only_filename in case it changed with wfu_before_file_upload filter
|
287 |
+
$only_filename = wfu_basename($target_path);
|
288 |
//move the uploaded file to its final destination
|
289 |
+
$wfu_upload_file_ret = wfu_upload_file($source_path, $target_path, $params["accessmethod"], $params["ftpinfo"], $params["ftppassivemode"], $params["ftpfilepermissions"]);
|
290 |
$file_copied = $wfu_upload_file_ret["uploaded"];
|
291 |
//process warning messages from wfu_upload_file
|
292 |
$echo_message = ob_get_contents();
|
293 |
//finish redirecting of echo to internal buffer
|
294 |
ob_end_clean();
|
295 |
if ( $echo_message != "" && !$file_copied ) {
|
296 |
+
//error (and not errorabort) flag designates that file may be resumed
|
297 |
$file_output['message_type'] = "error";
|
298 |
if ( stristr($echo_message, "warning") && stristr($echo_message, "permission denied") && stristr($echo_message, "unable to move") ) {
|
299 |
$file_output['message'] = wfu_join_strings("<br />", $file_output['message'], WFU_ERROR_DIR_PERMISSION);
|
344 |
previous filter wfu_before_file_check, corresponding them to the unique file id */
|
345 |
if ( $file_unique_id != '' ) $target_path = apply_filters('wfu_before_file_upload', $target_path, $file_unique_id);
|
346 |
//recalculate $only_filename in case it changed with wfu_before_file_upload filter
|
347 |
+
$only_filename = wfu_basename($target_path);
|
348 |
//move the uploaded file to its final destination
|
349 |
+
$wfu_upload_file_ret = wfu_upload_file($source_path, $target_path, $params["accessmethod"], $params["ftpinfo"], $params["ftppassivemode"], $params["ftpfilepermissions"]);
|
350 |
$file_copied = $wfu_upload_file_ret["uploaded"];
|
351 |
//process warning messages from move_uploaded_file
|
352 |
$echo_message = ob_get_contents();
|
353 |
//finish redirecting of echo to internal buffer
|
354 |
ob_end_clean();
|
355 |
if ( $echo_message != "" && !$file_copied ) {
|
356 |
+
//error (and not errorabort) flag designates that file may be resumed
|
357 |
$file_output['message_type'] = "error";
|
358 |
if ( stristr($echo_message, "warning") && stristr($echo_message, "permission denied") && stristr($echo_message, "unable to move") ) {
|
359 |
$file_output['message'] = wfu_join_strings("<br />", $file_output['message'], WFU_ERROR_DIR_PERMISSION);
|
370 |
}
|
371 |
}
|
372 |
else {
|
373 |
+
//abort the file and do not allow resuming
|
374 |
+
$file_output['message_type'] = "errorabort";
|
375 |
$file_output['message'] = wfu_join_strings("<br />", $file_output['message'], WFU_WARNING_FILE_EXISTS);
|
376 |
$message_processed = true;
|
377 |
$file_copied = false;
|
401 |
}
|
402 |
}
|
403 |
else if ( !$message_processed ) {
|
404 |
+
//abort the file and do not allow resuming
|
405 |
+
$file_output['message_type'] = "errorabort";
|
406 |
$file_output['message'] = wfu_join_strings("<br />", $file_output['message'], WFU_ERROR_UNKNOWN);
|
407 |
}
|
408 |
|
410 |
// unlink($source_path);
|
411 |
}
|
412 |
else {
|
413 |
+
//abort the file and do not allow resuming
|
414 |
+
$file_output['message_type'] = "errorabort";
|
415 |
$file_output['message'] = wfu_join_strings("<br />", $file_output['message'], WFU_ERROR_UNKNOWN);
|
416 |
}
|
417 |
}
|
420 |
if ( $file_output['message_type'] == "" ) {
|
421 |
if ( $file_copied ) $file_output['message_type'] = "success";
|
422 |
else {
|
423 |
+
//abort the file and do not allow resuming
|
424 |
+
$file_output['message_type'] = "errorabort";
|
425 |
$file_output['message'] = wfu_join_strings("<br />", $file_output['message'], WFU_ERROR_UNKNOWN);
|
426 |
}
|
427 |
}
|
435 |
$file_output['message_type'] = "warning";
|
436 |
}
|
437 |
|
438 |
+
/* set success status of the file, to be used for medialink and post actions */
|
439 |
+
$file_finished_successfully = ( !$only_check && ( $file_output['message_type'] == "success" || $file_output['message_type'] == "warning" ) );
|
440 |
+
/* set non-success status of the file, to be used for medialink and post actions */
|
441 |
+
$file_finished_unsuccessfully = ( substr($file_output['message_type'], 0, 5) == "error" );
|
442 |
+
|
443 |
+
|
444 |
/* adjust message details and colors according to file result */
|
445 |
/* FileResult: A */
|
446 |
$search = array ('/%username%/', '/%useremail%/', '/%filename%/', '/%filepath%/');
|
467 |
$file_output['admin_messages'] = wfu_join_strings("<br />", preg_replace($search, $replace, WFU_SUCCESSMESSAGE_DETAILS), $file_output['admin_messages']);
|
468 |
}
|
469 |
/* FileResult: C */
|
470 |
+
elseif ( substr($file_output['message_type'], 0, 5) == "error" ) {
|
471 |
$error_count ++;
|
472 |
$color_array = explode(",", $params['failmessagecolors']);
|
473 |
$file_output['color'] = $color_array[0];
|
474 |
$file_output['bgcolor'] = $color_array[1];
|
475 |
$file_output['borcolor'] = $color_array[2];
|
476 |
/* define variables that were not defined before due to error */
|
477 |
+
if ( $params['forcefilename'] != "true" ) $only_filename = wfu_upload_plugin_clean( $fileprops['name'] );
|
478 |
+
else $only_filename = $fileprops['name'];
|
479 |
$target_path = wfu_upload_plugin_full_path($params).$only_filename;
|
480 |
$replace = array ($user_login, ( $user_email == "" ? "no email" : $user_email ), $only_filename, $target_path);
|
481 |
$file_output['header'] = preg_replace($search, $replace, $params['errormessage']);
|
486 |
/* suppress again any admin messages if user is not administrator or adminmessages is not activated */
|
487 |
if ( $suppress_admin_messages ) $file_output['admin_messages'] = "";
|
488 |
|
|
|
|
|
|
|
489 |
$params_output_array[0] = $file_output;
|
490 |
|
491 |
/* Apply wfu_after_file_upload action after failed upload, in order to allow the user to perform any post-upload actions.
|
492 |
If additional data are required, such as user_id or userdata values or filepath, they can be retrieved by implementing
|
493 |
the previous filters wfu_before_file_check and wfu_before_file_upload, corresponding them to the unique file id */
|
494 |
+
if ( $file_unique_id != '' && $file_finished_unsuccessfully && !$ignore_server_actions ) {
|
495 |
do_action('wfu_after_file_upload', $file_unique_id, $file_output['message_type'], $file_output['message'], $file_output['admin_messages']);
|
496 |
}
|
497 |
|
498 |
/* log file upload action if file has finished uploading successfully */
|
499 |
+
if ( $file_finished_successfully && !$ignore_server_actions ) {
|
500 |
wfu_log_action('upload', $target_path, $user->ID, $uniqueuploadid, $params['pageid'], $sid, $userdata_fields);
|
501 |
+
/* Apply wfu_after_file_upload action after successful upload, in order to allow the user to perform any post-upload actions.
|
502 |
If additional data are required, such as user_id or userdata values or filepath, they can be retrieved by implementing
|
503 |
the previous filters wfu_before_file_check and wfu_before_file_upload, corresponding them to the unique file id */
|
504 |
do_action('wfu_after_file_upload', $file_unique_id, $file_output['message_type'], $file_output['message'], $file_output['admin_messages']);
|
505 |
}
|
506 |
|
507 |
/* add file to Media or attach file to current post if any of these options is activated and the file has finished uploading successfully */
|
508 |
+
if ( ( $params["medialink"] == "true" || $params["postlink"] == "true" ) && $file_finished_successfully && !$ignore_server_actions ) {
|
509 |
$pageid = ( $params["postlink"] == "true" ? $params['pageid'] : 0 );
|
510 |
wfu_process_media_insert($target_path, $pageid);
|
511 |
}
|
542 |
$notifyrecipients = trim(preg_replace('/%useremail%/', $user_email, $params["notifyrecipients"]));
|
543 |
if ( $notifyrecipients != "" ) {
|
544 |
if ( $somefiles_Ok ) {
|
545 |
+
if ( $method == 'no_ajax' && !$ignore_server_actions ) {
|
546 |
$send_error = wfu_send_notification_email($user, $notify_only_filename_list, $notify_target_path_list, $notify_attachment_list, $userdata_fields, $params);
|
547 |
if ( $send_error != "" ) {
|
548 |
$params_output_array["general"]['admin_messages']['notify'] = $send_error;
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: nickboss
|
|
3 |
Donate link: http://www.iptanus.com/support/wordpress-file-upload
|
4 |
Tags: upload, upload file, upload files, multiple, multiple upload, multiple uploads, captcha, progress bar, form, ajax, directory, HTML5, filelist, gallery, image gallery, browser, file browser, gallery, image gallery, shortcode, logging, file logging
|
5 |
Requires at least: 2.9.2
|
6 |
-
Tested up to: 4.1.
|
7 |
Stable tag: "trunk"
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
@@ -35,8 +35,8 @@ The characteristics of the plugin are:
|
|
35 |
* You can create additional fields that the user must fill in along with the uploaded file.
|
36 |
* It supports redirection to another url after successful upload.
|
37 |
* It supports filters and actions before and after file upload, so that programmers can extend the plugin and make it cooperate with other plugins.
|
|
|
38 |
* It supports logging of upload events or management of files, which can be viewed by admins through the Dashboard.
|
39 |
-
* You can create you shortcode very easily by using the included Shortcode Composer in the plugin's settings inside Dashboard.
|
40 |
* It includes a file browser in the Dashboard, from where admins can view the uploaded file and manage them.
|
41 |
|
42 |
Please note that old desktop browsers or mobile browsers may not support all of the above functionalities. In order to get full functionality use the latest versions browsers, supporting HTML5, AJAX and CSS3.
|
@@ -47,10 +47,12 @@ Please visit the **Other Notes** section for customization options of this plugi
|
|
47 |
|
48 |
== Installation ==
|
49 |
|
50 |
-
1. First copy wordpress_file_upload directory inside wp-contents/plugins directory of your wordpress site.
|
51 |
-
1. Activate the plugin from Plugins
|
52 |
1. In order to use the plugin simply put the shortcode [wordpress_file_upload] in the contents of any page.
|
53 |
-
1.
|
|
|
|
|
54 |
|
55 |
== Frequently Asked Questions ==
|
56 |
|
@@ -98,6 +100,10 @@ The plugin is designed not to expose website information by using sessions. Para
|
|
98 |
|
99 |
Administrators can view and manage the uploaded files from the File Browser that exists inside the plugin's Settings inside Dashboard, or use an FTP client. Other users can view their uploaded files by combining this plugin with WP-Filebase plugin. If you want to show the uploaded files as an image gallery please consider the [Professional](http://www.iptanus.com/support/wordpress-file-upload/ "Wordpress File Upload support page") version of the plugin.
|
100 |
|
|
|
|
|
|
|
|
|
101 |
== Screenshots ==
|
102 |
|
103 |
1. A screenshot of the plugin in its most simple form.
|
@@ -110,6 +116,27 @@ Administrators can view and manage the uploaded files from the File Browser that
|
|
110 |
|
111 |
== Changelog ==
|
112 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
= 2.5.5 =
|
114 |
* fixed serious bug not uploading files when captcha is enabled
|
115 |
* fixed bug not redirecting files when email notification is enabled
|
@@ -355,6 +382,9 @@ Initial version.
|
|
355 |
|
356 |
== Upgrade Notice ==
|
357 |
|
|
|
|
|
|
|
358 |
= 2.5.5 =
|
359 |
Important upgrade to address some bugs.
|
360 |
|
@@ -521,9 +551,12 @@ A detailed list of attributes, together with instructions is shown below:
|
|
521 |
*Upload Path and Files*
|
522 |
|
523 |
* **createpath:** If this attribute is set to "true", the upload directory, defined by uploadpath, will be created in case it does not exist. Default value is "false".
|
|
|
524 |
* **accessmethod:** This attributes defines the method to create directories and upload files. Default value is "normal". If it is set to "ftp", then the plugin will attempt to create directories and upload files using ftp access. In order to do this, the attribute *ftpinfo* must also be filled with valid ftp access information. Use this attribute when you cannot upload files, access uploaded files or cannot copy or delete uploaded files because of SAFE MODE restrictions, or because the owner of the file is the domain administrator.
|
525 |
* **ftpinfo:** This attribute defines the ftp access information. It has the syntax *username:password@domain*. If username, password or domain contains the characters (:) or (@), then replace them with (\\:) and (\\@) in order to avoid misreading of the attribute.
|
526 |
* **useftpdomain:** This attribute is used when the ftp domain used to upload files is in different domain than Wordpress installation. If it is set to "true" (and also uploadmethod is "ftp"), then the domain that will be used to upload files will be the one defined in ftpinfo attribute. Default value is "false".
|
|
|
|
|
527 |
* **showtargetfolder:** This attribute defines if a message with the upload directory will be shown. Default value is "false".
|
528 |
* **askforsubfolders:** This attribute defines if the user can select a subfolder to upload the file. Default value is "false". If set to "true", then the user is able to select a subfolder of the path, defined by the attribute *uploadpath*, to upload a file through a drop down list. This attributed is used together with attribute *subfoldertree*, which defines the subfolders.
|
529 |
* **subfoldertree:** This attribute defines the structure of the subfolders that the user can select to upload a file. Default value is "". The format of this attribute is as follows: the subfolders are separated by commas (,), e.g. "subfolder1, subfolder2". It is possible to use nested subfolders (a folder inside another folder). To do this place stars (*) before the name of the subfolder. The number of stars determines nesting level, e.g. "subfolder1, *nested1, *nested2, **nested3". Please note that the first subfolder must be the name of the folder defined by attribute *uploadpath* (only the last part) without any stars, while all the next subfolders must have at least one star. The user has also the capability to use a different name (from the actual subfolder name) to be shown in the drop down list for every subfolder, by separating the actual and shown name using the slash (/) symbol, e.g. "subfolder1, *subfolder2/shownname2, *subfolder3/shownname3".
|
3 |
Donate link: http://www.iptanus.com/support/wordpress-file-upload
|
4 |
Tags: upload, upload file, upload files, multiple, multiple upload, multiple uploads, captcha, progress bar, form, ajax, directory, HTML5, filelist, gallery, image gallery, browser, file browser, gallery, image gallery, shortcode, logging, file logging
|
5 |
Requires at least: 2.9.2
|
6 |
+
Tested up to: 4.1.1
|
7 |
Stable tag: "trunk"
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
35 |
* You can create additional fields that the user must fill in along with the uploaded file.
|
36 |
* It supports redirection to another url after successful upload.
|
37 |
* It supports filters and actions before and after file upload, so that programmers can extend the plugin and make it cooperate with other plugins.
|
38 |
+
* It contains a visual editor for customizing the plugin easily and without any knowledge of shortcodes or programming
|
39 |
* It supports logging of upload events or management of files, which can be viewed by admins through the Dashboard.
|
|
|
40 |
* It includes a file browser in the Dashboard, from where admins can view the uploaded file and manage them.
|
41 |
|
42 |
Please note that old desktop browsers or mobile browsers may not support all of the above functionalities. In order to get full functionality use the latest versions browsers, supporting HTML5, AJAX and CSS3.
|
47 |
|
48 |
== Installation ==
|
49 |
|
50 |
+
1. First install the plugin using Wordpress auto-installer or download the .zip file from wordpress.org and install it from the Plugins section of your Dashboard or copy wordpress_file_upload directory inside wp-contents/plugins directory of your wordpress site.
|
51 |
+
1. Activate the plugin from Plugins section of your Dashboard.
|
52 |
1. In order to use the plugin simply put the shortcode [wordpress_file_upload] in the contents of any page.
|
53 |
+
1. Open the page on your browser and you will see the upload form.
|
54 |
+
1. You can change the upload directory or any other settings easily by pressing the small edit button found at the left-top corner of the upload form. A new window (or tab) with pop up with plugin options. If you do not see the new window, adjust your browser settings to allow pop-up windows.
|
55 |
+
1. Full documentation about the plugin options can be found at https://wordpress.org/plugins/wp-file-upload/other_notes/ or at http://www.iptanus.com/wordpress-plugins/wordpress-file-upload/ (including the Pro version)
|
56 |
|
57 |
== Frequently Asked Questions ==
|
58 |
|
100 |
|
101 |
Administrators can view and manage the uploaded files from the File Browser that exists inside the plugin's Settings inside Dashboard, or use an FTP client. Other users can view their uploaded files by combining this plugin with WP-Filebase plugin. If you want to show the uploaded files as an image gallery please consider the [Professional](http://www.iptanus.com/support/wordpress-file-upload/ "Wordpress File Upload support page") version of the plugin.
|
102 |
|
103 |
+
= What happens if connection is lost during a file upload? =
|
104 |
+
|
105 |
+
In the free version the upload will fail. However in the Pro version the upload will resume and will continue until the file is fully uploaded. This is especially useful when uploading very large files.
|
106 |
+
|
107 |
== Screenshots ==
|
108 |
|
109 |
1. A screenshot of the plugin in its most simple form.
|
116 |
|
117 |
== Changelog ==
|
118 |
|
119 |
+
= 2.6.0 =
|
120 |
+
* full redesign of the upload algorithm to become more robust
|
121 |
+
* added improved server-side handling of large files
|
122 |
+
* plugin shortcodes can be edited using the Shortcode Composer
|
123 |
+
* added visual editor button on the plugin to enable administrators to change the plugin settings easily
|
124 |
+
* corrected bug causing sometimes database overloads
|
125 |
+
* slight improvements of subfolder option
|
126 |
+
* improvements to avoid code breaking in ajax calls when there are php warnings or echo from Wordpress environment or other plugins
|
127 |
+
* improvements and bug fixes in uploader when classic (no AJAX) upload is selected
|
128 |
+
* eliminated php warnings in shortcode composer
|
129 |
+
* corrected bug that was not correctly downloading files from the plugin's File Browser
|
130 |
+
* added better security when downloading files from the plugin's File Browser
|
131 |
+
* fixed bug not correctly showing the user that uploaded a file in the plugin's File Browser
|
132 |
+
* use of curl to perform server http requests was replaced by native php because some web servers do not have CURL installed
|
133 |
+
* corrected bug in shortcode composer where userdata fields were not shown in variables drop down
|
134 |
+
* added feature that prevents page closing if an upload is on progress
|
135 |
+
* added forcefilename attribute to avoid filename sanitization
|
136 |
+
* added ftppassivemode attribute for enabling FTP passive mode when FTP method is used for uploading
|
137 |
+
* added ftpfilepermissions attribute for defining the permissions of the uploaded file, when using FTP method
|
138 |
+
* javascript and css files are minified for faster loading
|
139 |
+
|
140 |
= 2.5.5 =
|
141 |
* fixed serious bug not uploading files when captcha is enabled
|
142 |
* fixed bug not redirecting files when email notification is enabled
|
382 |
|
383 |
== Upgrade Notice ==
|
384 |
|
385 |
+
= 2.6.0 =
|
386 |
+
Important upgrade to add new features and address some bugs.
|
387 |
+
|
388 |
= 2.5.5 =
|
389 |
Important upgrade to address some bugs.
|
390 |
|
551 |
*Upload Path and Files*
|
552 |
|
553 |
* **createpath:** If this attribute is set to "true", the upload directory, defined by uploadpath, will be created in case it does not exist. Default value is "false".
|
554 |
+
* **forcefilename:** The plugin by default will modify the filename if it contains invalid or non-english characters. By setting this attribute to "true" the plugin will not change the filename. Default value is "false".
|
555 |
* **accessmethod:** This attributes defines the method to create directories and upload files. Default value is "normal". If it is set to "ftp", then the plugin will attempt to create directories and upload files using ftp access. In order to do this, the attribute *ftpinfo* must also be filled with valid ftp access information. Use this attribute when you cannot upload files, access uploaded files or cannot copy or delete uploaded files because of SAFE MODE restrictions, or because the owner of the file is the domain administrator.
|
556 |
* **ftpinfo:** This attribute defines the ftp access information. It has the syntax *username:password@domain*. If username, password or domain contains the characters (:) or (@), then replace them with (\\:) and (\\@) in order to avoid misreading of the attribute.
|
557 |
* **useftpdomain:** This attribute is used when the ftp domain used to upload files is in different domain than Wordpress installation. If it is set to "true" (and also uploadmethod is "ftp"), then the domain that will be used to upload files will be the one defined in ftpinfo attribute. Default value is "false".
|
558 |
+
* **ftppassivemode:** If this attribute is set to "true", FTP passive mode will be used instead of active mode. It is used if files fail to upload when using FTP method. Default value is "false".
|
559 |
+
* **ftpfilepermissions:** Force the uploaded files to have specific permissions. This is a 4-digit octal number, e.g. 0777. If left empty, then the ftp server will define the permissions.. Default value is "".
|
560 |
* **showtargetfolder:** This attribute defines if a message with the upload directory will be shown. Default value is "false".
|
561 |
* **askforsubfolders:** This attribute defines if the user can select a subfolder to upload the file. Default value is "false". If set to "true", then the user is able to select a subfolder of the path, defined by the attribute *uploadpath*, to upload a file through a drop down list. This attributed is used together with attribute *subfoldertree*, which defines the subfolders.
|
562 |
* **subfoldertree:** This attribute defines the structure of the subfolders that the user can select to upload a file. Default value is "". The format of this attribute is as follows: the subfolders are separated by commas (,), e.g. "subfolder1, subfolder2". It is possible to use nested subfolders (a folder inside another folder). To do this place stars (*) before the name of the subfolder. The number of stars determines nesting level, e.g. "subfolder1, *nested1, *nested2, **nested3". Please note that the first subfolder must be the name of the folder defined by attribute *uploadpath* (only the last part) without any stars, while all the next subfolders must have at least one star. The user has also the capability to use a different name (from the actual subfolder name) to be shown in the drop down list for every subfolder, by separating the actual and shown name using the slash (/) symbol, e.g. "subfolder1, *subfolder2/shownname2, *subfolder3/shownname3".
|
wfu_file_downloader.php
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
session_start();
|
3 |
+
include_once( dirname(__FILE__).'/lib/wfu_functions.php' );
|
4 |
+
wfu_download_file();
|
5 |
+
|
6 |
+
function wfu_download_file() {
|
7 |
+
$file_enc = (isset($_POST['file']) ? $_POST['file'] : (isset($_GET['file']) ? $_GET['file'] : ''));
|
8 |
+
$ticket = (isset($_POST['ticket']) ? $_POST['ticket'] : (isset($_GET['ticket']) ? $_GET['ticket'] : ''));
|
9 |
+
if ( $file_enc == '' || $ticket == '' ) die();
|
10 |
+
//if download ticket does not exist or is expired die
|
11 |
+
if ( !isset($_SESSION['wfu_download_ticket_'.$ticket]) || time() > $_SESSION['wfu_download_ticket_'.$ticket] ) die();
|
12 |
+
//destroy ticket so it cannot be used again
|
13 |
+
unset($_SESSION['wfu_download_ticket_'.$ticket]);
|
14 |
+
|
15 |
+
$filepath = wfu_plugin_decode_string($file_enc);
|
16 |
+
//check that file exists
|
17 |
+
if ( !file_exists($filepath) ) {
|
18 |
+
$_SESSION['wfu_download_status_'.$ticket] = 'failed';
|
19 |
+
die('<script language="javascript">alert("Error! File does not exist.");</script>');
|
20 |
+
}
|
21 |
+
|
22 |
+
set_time_limit(0); // disable the time limit for this script
|
23 |
+
if ( $fd = fopen ($filepath, "r") ) {
|
24 |
+
$fsize = filesize($filepath);
|
25 |
+
$path_parts = pathinfo($filepath);
|
26 |
+
$ext = strtolower($path_parts["extension"]);
|
27 |
+
switch ($ext) {
|
28 |
+
case "pdf":
|
29 |
+
header("Content-type: application/pdf");
|
30 |
+
header("Content-Disposition: attachment; filename=\"".$path_parts["basename"]."\""); // use 'attachment' to force a file download
|
31 |
+
break;
|
32 |
+
// add more headers for other content types here
|
33 |
+
default;
|
34 |
+
header("Content-type: application/octet-stream");
|
35 |
+
header("Content-Disposition: filename=\"".$path_parts["basename"]."\"");
|
36 |
+
break;
|
37 |
+
}
|
38 |
+
header("Content-length: $fsize");
|
39 |
+
header("Cache-control: private"); //use this to open files directly
|
40 |
+
$failed = false;
|
41 |
+
while( !feof($fd) ) {
|
42 |
+
$buffer = fread($fd, 2048);
|
43 |
+
echo $buffer;
|
44 |
+
if ( connection_status() != 0 ) {
|
45 |
+
$failed = true;
|
46 |
+
break;
|
47 |
+
}
|
48 |
+
}
|
49 |
+
fclose ($fd);
|
50 |
+
}
|
51 |
+
else $failed = true;
|
52 |
+
|
53 |
+
if ( !$failed ) {
|
54 |
+
$_SESSION['wfu_download_status_'.$ticket] = 'downloaded';
|
55 |
+
die();
|
56 |
+
}
|
57 |
+
else {
|
58 |
+
$_SESSION['wfu_download_status_'.$ticket] = 'failed';
|
59 |
+
die('<script language="javascript">alert("Error! Could not download file.");</script>');
|
60 |
+
}
|
61 |
+
}
|
62 |
+
|
63 |
+
?>
|
wfu_response.php
CHANGED
@@ -8,7 +8,6 @@ session_start();
|
|
8 |
if ( isset($_GET['shortcode_id']) && isset($_GET['session_token']) ) {
|
9 |
//check referer using server sessions to avoid CSRF attacks
|
10 |
if ( $_SESSION["wfu_token_".$_GET['shortcode_id']] != $_GET['session_token'] ) die();
|
11 |
-
|
12 |
if ( isset($_GET['start_time']) ) {
|
13 |
$_SESSION['wfu_check_refresh_'.$_GET['shortcode_id']] = 'form button pressed';
|
14 |
$_SESSION['wfu_start_time_'.$_GET['shortcode_id']] = $_GET['start_time'];
|
8 |
if ( isset($_GET['shortcode_id']) && isset($_GET['session_token']) ) {
|
9 |
//check referer using server sessions to avoid CSRF attacks
|
10 |
if ( $_SESSION["wfu_token_".$_GET['shortcode_id']] != $_GET['session_token'] ) die();
|
|
|
11 |
if ( isset($_GET['start_time']) ) {
|
12 |
$_SESSION['wfu_check_refresh_'.$_GET['shortcode_id']] = 'form button pressed';
|
13 |
$_SESSION['wfu_start_time_'.$_GET['shortcode_id']] = $_GET['start_time'];
|
wordpress_file_upload.php
CHANGED
@@ -4,7 +4,7 @@ session_start();
|
|
4 |
/*
|
5 |
Plugin URI: http://www.iptanus.com/support/wordpress-file-upload
|
6 |
Description: Simple interface to upload files from a page.
|
7 |
-
Version: 2.
|
8 |
Author: Nickolas Bossinas
|
9 |
Author URI: http://www.iptanus.com
|
10 |
*/
|
@@ -56,8 +56,13 @@ add_action('wp_ajax_nopriv_wfu_ajax_action_send_email_notification', 'wfu_ajax_a
|
|
56 |
add_action('wp_ajax_wfu_ajax_action_notify_wpfilebase', 'wfu_ajax_action_notify_wpfilebase');
|
57 |
add_action('wp_ajax_nopriv_wfu_ajax_action_notify_wpfilebase', 'wfu_ajax_action_notify_wpfilebase');
|
58 |
add_action('wp_ajax_wfu_ajax_action_save_shortcode', 'wfu_ajax_action_save_shortcode');
|
|
|
59 |
add_action('wp_ajax_wfu_ajax_action_read_subfolders', 'wfu_ajax_action_read_subfolders');
|
60 |
-
add_action('
|
|
|
|
|
|
|
|
|
61 |
wfu_include_lib();
|
62 |
|
63 |
function wfu_enqueue_frontpage_scripts() {
|
@@ -106,6 +111,8 @@ function wordpress_file_upload_function($incomingfromhandler) {
|
|
106 |
|
107 |
if ( !isset($_SESSION['wfu_token_'.$sid]) || $_SESSION['wfu_token_'.$sid] == "" )
|
108 |
$_SESSION['wfu_token_'.$sid] = uniqid(mt_rand(), TRUE);
|
|
|
|
|
109 |
|
110 |
$user = wp_get_current_user();
|
111 |
$widths = wfu_decode_dimensions($params["widths"]);
|
@@ -216,7 +223,17 @@ function wordpress_file_upload_function($incomingfromhandler) {
|
|
216 |
|
217 |
/* Compose the html code for the plugin */
|
218 |
$wordpress_file_upload_output = "";
|
219 |
-
$wordpress_file_upload_output .= '<div id="wordpress_file_upload_block_'.$sid.'" class="file_div_clean">';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
220 |
$itemplaces = explode("/", $params["placements"]);
|
221 |
foreach ( $itemplaces as $section ) {
|
222 |
$items_in_section = explode("+", trim($section));
|
@@ -247,9 +264,9 @@ function wordpress_file_upload_function($incomingfromhandler) {
|
|
247 |
$wordpress_file_upload_output .= call_user_func_array("wfu_add_div", $section_array);
|
248 |
}
|
249 |
|
250 |
-
/* Pass constants to javascript */
|
251 |
$consts = wfu_set_javascript_constants();
|
252 |
-
$handler = 'function() { wfu_Initialize_Consts("'.$consts.'") }';
|
253 |
$wordpress_file_upload_output .= "\n\t".'<script type="text/javascript">if(window.addEventListener) { window.addEventListener("load", '.$handler.', false); } else if(window.attachEvent) { window.attachEvent("onload", '.$handler.'); } else { window["onload"] = '.$handler.'; }</script>';
|
254 |
$wordpress_file_upload_output .= '</div>';
|
255 |
// $wordpress_file_upload_output .= '<div>';
|
@@ -259,7 +276,7 @@ function wordpress_file_upload_function($incomingfromhandler) {
|
|
259 |
// The plugin uses sessions in order to detect if the page was loaded due to file upload or
|
260 |
// because the user pressed the Refresh button (or F5) of the page.
|
261 |
// In the second case we do not want to perform any file upload, so we abort the rest of the script.
|
262 |
-
if ( $_SESSION['wfu_check_refresh_'.$sid] != "form button pressed" ) {
|
263 |
$_SESSION['wfu_check_refresh_'.$sid] = 'do not process';
|
264 |
$wordpress_file_upload_output .= wfu_post_plugin_actions($params);
|
265 |
return $wordpress_file_upload_output."\n";
|
4 |
/*
|
5 |
Plugin URI: http://www.iptanus.com/support/wordpress-file-upload
|
6 |
Description: Simple interface to upload files from a page.
|
7 |
+
Version: 2.6.0
|
8 |
Author: Nickolas Bossinas
|
9 |
Author URI: http://www.iptanus.com
|
10 |
*/
|
56 |
add_action('wp_ajax_wfu_ajax_action_notify_wpfilebase', 'wfu_ajax_action_notify_wpfilebase');
|
57 |
add_action('wp_ajax_nopriv_wfu_ajax_action_notify_wpfilebase', 'wfu_ajax_action_notify_wpfilebase');
|
58 |
add_action('wp_ajax_wfu_ajax_action_save_shortcode', 'wfu_ajax_action_save_shortcode');
|
59 |
+
add_action('wp_ajax_wfu_ajax_action_check_page_contents', 'wfu_ajax_action_check_page_contents');
|
60 |
add_action('wp_ajax_wfu_ajax_action_read_subfolders', 'wfu_ajax_action_read_subfolders');
|
61 |
+
add_action('wp_ajax_wfu_ajax_action_download_file_invoker', 'wfu_ajax_action_download_file_invoker');
|
62 |
+
add_action('wp_ajax_nopriv_wfu_ajax_action_download_file_invoker', 'wfu_ajax_action_download_file_invoker');
|
63 |
+
add_action('wp_ajax_wfu_ajax_action_download_file_monitor', 'wfu_ajax_action_download_file_monitor');
|
64 |
+
add_action('wp_ajax_nopriv_wfu_ajax_action_download_file_monitor', 'wfu_ajax_action_download_file_monitor');
|
65 |
+
add_action('wp_ajax_wfu_ajax_action_edit_shortcode', 'wfu_ajax_action_edit_shortcode');
|
66 |
wfu_include_lib();
|
67 |
|
68 |
function wfu_enqueue_frontpage_scripts() {
|
111 |
|
112 |
if ( !isset($_SESSION['wfu_token_'.$sid]) || $_SESSION['wfu_token_'.$sid] == "" )
|
113 |
$_SESSION['wfu_token_'.$sid] = uniqid(mt_rand(), TRUE);
|
114 |
+
//store the server environment (32 or 64bit) for use when checking file size limits
|
115 |
+
$params["php_env"] = wfu_get_server_environment();
|
116 |
|
117 |
$user = wp_get_current_user();
|
118 |
$widths = wfu_decode_dimensions($params["widths"]);
|
223 |
|
224 |
/* Compose the html code for the plugin */
|
225 |
$wordpress_file_upload_output = "";
|
226 |
+
$wordpress_file_upload_output .= '<div id="wordpress_file_upload_block_'.$sid.'" class="file_div_clean wfu_container">';
|
227 |
+
//add visual editor overlay if the current user is administrator
|
228 |
+
if ( current_user_can( 'manage_options' ) ) {
|
229 |
+
$wordpress_file_upload_output .= "\n\t".'<div id="wordpress_file_upload_editor_'.$sid.'" class="wfu_overlay_editor">';
|
230 |
+
$wordpress_file_upload_output .= "\n\t\t".'<button class="wfu_overlay_editor_button" title="'.WFU_PAGE_PLUGINEDITOR_BUTTONTITLE.'" onclick="wfu_invoke_shortcode_editor('.$sid.', '.$post->ID.', \''.hash('md5', $post->post_content).'\');"><img src="'.WFU_IMAGE_OVERLAY_EDITOR.'" width="20px" height="20px" /></button>';
|
231 |
+
$wordpress_file_upload_output .= "\n\t".'</div>';
|
232 |
+
$wordpress_file_upload_output .= "\n\t".'<div id="wordpress_file_upload_overlay_'.$sid.'" class="wfu_overlay_container">';
|
233 |
+
$wordpress_file_upload_output .= "\n\t\t".'<table class="wfu_overlay_table"><tbody><tr><td><img src="'.WFU_IMAGE_OVERLAY_LOADING.'" /><label>'.WFU_PAGE_PLUGINEDITOR_LOADING.'</label></td></tr></tbody></table>';
|
234 |
+
$wordpress_file_upload_output .= "\n\t\t".'<div class="wfu_overlay_container_inner"></div>';
|
235 |
+
$wordpress_file_upload_output .= "\n\t".'</div>';
|
236 |
+
}
|
237 |
$itemplaces = explode("/", $params["placements"]);
|
238 |
foreach ( $itemplaces as $section ) {
|
239 |
$items_in_section = explode("+", trim($section));
|
264 |
$wordpress_file_upload_output .= call_user_func_array("wfu_add_div", $section_array);
|
265 |
}
|
266 |
|
267 |
+
/* Pass constants to javascript and set page unload hook */
|
268 |
$consts = wfu_set_javascript_constants();
|
269 |
+
$handler = 'function() { wfu_Initialize_Consts("'.$consts.'"); wfu_install_unload_hook(); }';
|
270 |
$wordpress_file_upload_output .= "\n\t".'<script type="text/javascript">if(window.addEventListener) { window.addEventListener("load", '.$handler.', false); } else if(window.attachEvent) { window.attachEvent("onload", '.$handler.'); } else { window["onload"] = '.$handler.'; }</script>';
|
271 |
$wordpress_file_upload_output .= '</div>';
|
272 |
// $wordpress_file_upload_output .= '<div>';
|
276 |
// The plugin uses sessions in order to detect if the page was loaded due to file upload or
|
277 |
// because the user pressed the Refresh button (or F5) of the page.
|
278 |
// In the second case we do not want to perform any file upload, so we abort the rest of the script.
|
279 |
+
if ( !isset($_SESSION['wfu_check_refresh_'.$sid]) || $_SESSION['wfu_check_refresh_'.$sid] != "form button pressed" ) {
|
280 |
$_SESSION['wfu_check_refresh_'.$sid] = 'do not process';
|
281 |
$wordpress_file_upload_output .= wfu_post_plugin_actions($params);
|
282 |
return $wordpress_file_upload_output."\n";
|