Version Description
- code improved so that shortcode composer can be used by all users who can edit pages (and not only the admins)
- added environment variable 'Show Shortcode Composer to Non-Admins' to control whether non-admin users can edit the shortcodes
- added filtering of get_users() function in order to handle websites with many users more efficiently
- added notification in shortcode composer if user leaves page without saving
- corrected bug where restricted frontend loading of the plugin was not working for websites installed in localhost due to wrong calculation of request uri
Download this release
Release Info
Developer | nickboss |
Plugin | WordPress File Upload |
Version | 4.11.0 |
Comparing to | |
See all releases |
Code changes from version 4.10.3 to 4.11.0
- images/fonts/wfu-icons.svg +11 -11
- images/open-iconic.svg +451 -451
- images/pencil.svg +6 -6
- images/wfu-media-external.svg +3 -3
- js/wordpress_file_upload_adminfunctions.js +11 -9
- lib/wfu_admin.php +958 -896
- lib/wfu_admin_browser.php +1394 -1392
- lib/wfu_admin_composer.php +901 -899
- lib/wfu_admin_log.php +176 -176
- lib/wfu_admin_maintenance.php +408 -408
- lib/wfu_admin_settings.php +241 -241
- lib/wfu_admin_uploadedfiles.php +503 -503
- lib/wfu_ajaxactions.php +803 -763
- lib/wfu_attributes.php +1803 -1803
- lib/wfu_blocks.php +627 -627
- lib/wfu_constants.php +348 -466
images/fonts/wfu-icons.svg
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
-
<?xml version="1.0" standalone="no"?>
|
2 |
-
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
3 |
-
<svg xmlns="http://www.w3.org/2000/svg">
|
4 |
-
<metadata>Generated by IcoMoon</metadata>
|
5 |
-
<defs>
|
6 |
-
<font id="wfu-icons" horiz-adv-x="1024">
|
7 |
-
<font-face units-per-em="1024" ascent="960" descent="-64" />
|
8 |
-
<missing-glyph horiz-adv-x="1024" />
|
9 |
-
<glyph unicode=" " horiz-adv-x="512" d="" />
|
10 |
-
<glyph unicode="" glyph-name="media-external" d="M221.9 755.2l-56.8-85.3h-71.2c-23.467 0-42.7-19.233-42.7-42.7v-298.7c0-23.467 19.233-42.6 42.7-42.6h426.6c23.467 0 42.7 19.133 42.7 42.6v9.2l-150.3 151.4c-5.162-54.079-50.276-96.6-105.7-96.6-58.88 0-106.7 47.82-106.7 106.7s47.82 106.7 106.7 106.7c57.989 0 104.984-46.45 106.4-104.1l144.4 144.6c-7.108 13.74-21.039 23.5-37.5 23.5h-71.2l-56.8 85.3h-170.6zM811.3 541.9l-127.8-128h50.4v-215.5c-6.827 1.28-14.147 2.1-21.4 2.1-58.88 0-106.6-47.72-106.6-106.6s47.72-106.7 106.6-106.7c58.88 0 106.7 47.82 106.7 106.7v448h-7.9zM435.2 243.2v-44.8c-6.827 1.28-14.047 2.1-21.3 2.1-58.88 0-106.7-47.72-106.7-106.6s47.82-106.7 106.7-106.7c58.88 0 106.6 47.82 106.6 106.7v149.3h-85.3zM563.221 908.88h409.6v-409.6l-102.4 51.2v157.696l-286.72-286.208-72.192 72.192 311.808 312.32h-208.896z" />
|
11 |
-
<glyph unicode="" glyph-name="ftp" d="M593.3 806.4c-86.739 0-157.152-53.747-195.1-131.4-10.842 5.973-32.536 11.9-48.8 11.9-75.896 0-135.6-65.673-135.6-149.3 0-11.947 0.079-23.927 5.5-29.9-97.581-17.92-168.1-101.48-168.1-209 0-113.493 86.698-209.1 189.7-209.1h542.2c103.002 0 189.7 95.607 189.7 209.1 0 107.52-70.519 197.053-168.1 209 0 17.92 5.5 35.907 5.5 59.8 0 131.413-97.634 238.9-216.9 238.9zM452.5 671h109.8v-73.2h73.3l-128.2-146.5-128.2 146.5h73.3v73.2zM219.9 404.9h166.7v-45h-107v-43.3h99.2v-45h-99.2v-99.4h-59.7v232.7zM404.8 404.9h205.3v-45h-72.7v-187.7h-60v187.7h-72.6v45zM646.2 404.9h98.7c14.792 0 27.296-1.296 37.4-3.9 10.208-2.5 19.188-6.296 27-11.4 9.375-6.146 16.504-14.017 21.4-23.6 5-9.583 7.5-21.063 7.5-34.5 0-10.417-1.854-20.7-5.5-30.7-3.646-9.896-8.829-18.229-15.6-25-9.271-9.167-19.642-16.012-31.1-20.7-11.354-4.688-25.521-7.1-42.5-7.1h-37.3v-75.8h-60v232.7zM706.2 361.5v-69.7h17.1c10.208 0 18.638 0.65 25.2 1.9 6.667 1.25 12.221 3.75 16.7 7.5 3.854 3.333 6.633 7.217 8.3 11.8 1.771 4.688 2.7 10.433 2.7 17.1 0 6.563-1.858 12.112-5.4 16.8-3.542 4.792-7.613 8.125-12.3 10-6.25 2.5-12.362 3.891-18.3 4.1-5.937 0.314-13.804 0.5-23.7 0.5h-10.3z" />
|
12 |
</font></defs></svg>
|
1 |
+
<?xml version="1.0" standalone="no"?>
|
2 |
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
3 |
+
<svg xmlns="http://www.w3.org/2000/svg">
|
4 |
+
<metadata>Generated by IcoMoon</metadata>
|
5 |
+
<defs>
|
6 |
+
<font id="wfu-icons" horiz-adv-x="1024">
|
7 |
+
<font-face units-per-em="1024" ascent="960" descent="-64" />
|
8 |
+
<missing-glyph horiz-adv-x="1024" />
|
9 |
+
<glyph unicode=" " horiz-adv-x="512" d="" />
|
10 |
+
<glyph unicode="" glyph-name="media-external" d="M221.9 755.2l-56.8-85.3h-71.2c-23.467 0-42.7-19.233-42.7-42.7v-298.7c0-23.467 19.233-42.6 42.7-42.6h426.6c23.467 0 42.7 19.133 42.7 42.6v9.2l-150.3 151.4c-5.162-54.079-50.276-96.6-105.7-96.6-58.88 0-106.7 47.82-106.7 106.7s47.82 106.7 106.7 106.7c57.989 0 104.984-46.45 106.4-104.1l144.4 144.6c-7.108 13.74-21.039 23.5-37.5 23.5h-71.2l-56.8 85.3h-170.6zM811.3 541.9l-127.8-128h50.4v-215.5c-6.827 1.28-14.147 2.1-21.4 2.1-58.88 0-106.6-47.72-106.6-106.6s47.72-106.7 106.6-106.7c58.88 0 106.7 47.82 106.7 106.7v448h-7.9zM435.2 243.2v-44.8c-6.827 1.28-14.047 2.1-21.3 2.1-58.88 0-106.7-47.72-106.7-106.6s47.82-106.7 106.7-106.7c58.88 0 106.6 47.82 106.6 106.7v149.3h-85.3zM563.221 908.88h409.6v-409.6l-102.4 51.2v157.696l-286.72-286.208-72.192 72.192 311.808 312.32h-208.896z" />
|
11 |
+
<glyph unicode="" glyph-name="ftp" d="M593.3 806.4c-86.739 0-157.152-53.747-195.1-131.4-10.842 5.973-32.536 11.9-48.8 11.9-75.896 0-135.6-65.673-135.6-149.3 0-11.947 0.079-23.927 5.5-29.9-97.581-17.92-168.1-101.48-168.1-209 0-113.493 86.698-209.1 189.7-209.1h542.2c103.002 0 189.7 95.607 189.7 209.1 0 107.52-70.519 197.053-168.1 209 0 17.92 5.5 35.907 5.5 59.8 0 131.413-97.634 238.9-216.9 238.9zM452.5 671h109.8v-73.2h73.3l-128.2-146.5-128.2 146.5h73.3v73.2zM219.9 404.9h166.7v-45h-107v-43.3h99.2v-45h-99.2v-99.4h-59.7v232.7zM404.8 404.9h205.3v-45h-72.7v-187.7h-60v187.7h-72.6v45zM646.2 404.9h98.7c14.792 0 27.296-1.296 37.4-3.9 10.208-2.5 19.188-6.296 27-11.4 9.375-6.146 16.504-14.017 21.4-23.6 5-9.583 7.5-21.063 7.5-34.5 0-10.417-1.854-20.7-5.5-30.7-3.646-9.896-8.829-18.229-15.6-25-9.271-9.167-19.642-16.012-31.1-20.7-11.354-4.688-25.521-7.1-42.5-7.1h-37.3v-75.8h-60v232.7zM706.2 361.5v-69.7h17.1c10.208 0 18.638 0.65 25.2 1.9 6.667 1.25 12.221 3.75 16.7 7.5 3.854 3.333 6.633 7.217 8.3 11.8 1.771 4.688 2.7 10.433 2.7 17.1 0 6.563-1.858 12.112-5.4 16.8-3.542 4.792-7.613 8.125-12.3 10-6.25 2.5-12.362 3.891-18.3 4.1-5.937 0.314-13.804 0.5-23.7 0.5h-10.3z" />
|
12 |
</font></defs></svg>
|
images/open-iconic.svg
CHANGED
@@ -1,452 +1,452 @@
|
|
1 |
-
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 8 8" style="display:none;">
|
2 |
-
<symbol viewBox="0 0 8 8" id="account-login">
|
3 |
-
<path d="M3 0v1h4v5h-4v1h5v-7h-5zm1 2v1h-4v1h4v1l2-1.5-2-1.5z" id="account-login"></path>
|
4 |
-
</symbol>
|
5 |
-
<defs>
|
6 |
-
|
7 |
-
|
8 |
-
<path d="M3 0v1h4v5h-4v1h5v-7h-5zm-1 2l-2 1.5 2 1.5v-1h4v-1h-4v-1z" id="account-logout"></path>
|
9 |
-
|
10 |
-
<path d="M3.5 1c-1.93 0-3.5 1.57-3.5 3.5 0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5v.5h-1l2 2 2-2h-1v-.5c0-1.93-1.57-3.5-3.5-3.5z" id="action-redo"></path>
|
11 |
-
|
12 |
-
<path d="M4.5 1c-1.93 0-3.5 1.57-3.5 3.5v.5h-1l2 2 2-2h-1v-.5c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5c0-1.93-1.57-3.5-3.5-3.5z" id="action-undo"></path>
|
13 |
-
|
14 |
-
<path d="M0 0v1h8v-1h-8zm1 2v1h6v-1h-6zm-1 2v1h8v-1h-8zm1 2v1h6v-1h-6z" id="align-center"></path>
|
15 |
-
|
16 |
-
<path d="M0 0v1h8v-1h-8zm0 2v1h6v-1h-6zm0 2v1h8v-1h-8zm0 2v1h6v-1h-6z" id="align-left"></path>
|
17 |
-
|
18 |
-
<path d="M0 0v1h8v-1h-8zm2 2v1h6v-1h-6zm-2 2v1h8v-1h-8zm2 2v1h6v-1h-6z" id="align-right"></path>
|
19 |
-
|
20 |
-
<path d="M4 0c-.69 0-1.336.19-1.906.5l3.219 2.344.719-2.25c-.59-.36-1.281-.594-2.031-.594zm-2.75 1.125c-.76.73-1.25 1.735-1.25 2.875 0 .25.022.489.063.719l3.094-2.219-1.906-1.375zm5.625.125l-1.219 3.75h2.219c.08-.32.125-.65.125-1 0-1.07-.435-2.03-1.125-2.75zm-4.719 3.188l-1.75 1.281c.55 1.13 1.595 1.989 2.875 2.219l-1.125-3.5zm1.563 1.563l.625 1.969c1.33-.11 2.454-.879 3.094-1.969h-3.719z" id="aperture"></path>
|
21 |
-
|
22 |
-
<path d="M3 0v5h-2l2.531 3 2.469-3h-2v-5h-1z" id="arrow-bottom"></path>
|
23 |
-
|
24 |
-
<path d="M4 0c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm-1 1h2v3h2l-3 3-3-3h2v-3z" id="arrow-circle-bottom"></path>
|
25 |
-
|
26 |
-
<path d="M4 0c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 1v2h3v2h-3v2l-3-3 3-3z" id="arrow-circle-left"></path>
|
27 |
-
|
28 |
-
<path d="M4 0c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 1l3 3-3 3v-2h-3v-2h3v-2z" id="arrow-circle-right"></path>
|
29 |
-
|
30 |
-
<path d="M4 0c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 1l3 3h-2v3h-2v-3h-2l3-3z" id="arrow-circle-top"></path>
|
31 |
-
|
32 |
-
<path d="M3 1l-3 2.531 3 2.469v-2h5v-1h-5v-2z" id="arrow-left"></path>
|
33 |
-
|
34 |
-
<path d="M5 1v2h-5v1h5v2l3-2.531-3-2.469z" id="arrow-right"></path>
|
35 |
-
|
36 |
-
<path d="M3 0v5h-2l3.031 3 2.969-3h-2v-5h-2z" id="arrow-thick-bottom"></path>
|
37 |
-
|
38 |
-
<path d="M3 1l-3 3.031 3 2.969v-2h5v-2h-5v-2z" id="arrow-thick-left"></path>
|
39 |
-
|
40 |
-
<path d="M5 1v2h-5v2h5v2l3-3.031-3-2.969z" id="arrow-thick-right"></path>
|
41 |
-
|
42 |
-
<path d="M3.969 0l-2.969 3h2v5h2v-5h2l-3.031-3z" id="arrow-thick-top"></path>
|
43 |
-
|
44 |
-
<path d="M3.469 0l-2.469 3h2v5h1v-5h2l-2.531-3z" id="arrow-top"></path>
|
45 |
-
|
46 |
-
<path d="M4 0v8h1v-8h-1zm-2 1v6h1v-6h-1zm4 1v4h1v-4h-1zm-6 1v2h1v-2h-1z" id="audio-spectrum"></path>
|
47 |
-
|
48 |
-
<path d="M1.188 1c-.734.722-1.188 1.748-1.188 2.844 0 1.095.454 2.09 1.188 2.813l.688-.719c-.546-.538-.875-1.269-.875-2.094s.329-1.587.875-2.125l-.688-.719zm5.625 0l-.688.719c.552.552.875 1.289.875 2.125 0 .836-.327 1.554-.875 2.094l.688.719c.732-.72 1.188-1.708 1.188-2.813 0-1.104-.459-2.115-1.188-2.844zm-4.219 1.406c-.362.362-.594.889-.594 1.438 0 .548.232 1.045.594 1.406l.688-.719c-.178-.178-.281-.416-.281-.688 0-.272.103-.54.281-.719l-.688-.719zm2.813 0l-.688.719c.183.183.281.434.281.719s-.099.505-.281.688l.688.719c.357-.357.594-.851.594-1.406 0-.555-.236-1.08-.594-1.438z" id="audio"></path>
|
49 |
-
|
50 |
-
<path d="M4 0c-1.105 0-2 .895-2 2s.895 2 2 2 2-.895 2-2-.895-2-2-2zm-1 4.813v3.188l1-1 1 1v-3.188c-.31.11-.65.188-1 .188s-.69-.077-1-.188z" id="badge"></path>
|
51 |
-
|
52 |
-
<path d="M4 0c-2.203 0-4 1.797-4 4 0 2.203 1.797 4 4 4 2.203 0 4-1.797 4-4 0-2.203-1.797-4-4-4zm0 1c.655 0 1.258.209 1.75.563l-4.188 4.188c-.353-.492-.563-1.095-.563-1.75 0-1.663 1.337-3 3-3zm2.438 1.25c.353.492.563 1.095.563 1.75 0 1.663-1.337 3-3 3-.655 0-1.258-.209-1.75-.563l4.188-4.188z" id="ban"></path>
|
53 |
-
|
54 |
-
<path d="M0 0v7h8v-1h-7v-6h-1zm5 0v5h2v-5h-2zm-3 2v3h2v-3h-2z" id="bar-chart"></path>
|
55 |
-
|
56 |
-
<path d="M3.969 0c-.127.011-.259.083-.344.188l-2.344 2.813h-1.281v1h1v3.656c0 .18.164.344.344.344h5.313c.18 0 .344-.164.344-.344v-3.656h1v-1h-1.281c-.274-.329-2.387-2.866-2.406-2.875-.105-.09-.216-.136-.344-.125zm.031 1.281l1.438 1.719h-2.875l1.438-1.719zm-1.5 3.719c.28 0 .5.22.5.5v1c0 .28-.22.5-.5.5s-.5-.22-.5-.5v-1c0-.28.22-.5.5-.5zm3 0c.28 0 .5.22.5.5v1c0 .28-.22.5-.5.5s-.5-.22-.5-.5v-1c0-.28.22-.5.5-.5z" id="basket"></path>
|
57 |
-
|
58 |
-
<path d="M.094 1c-.06 0-.094.034-.094.094v5.813c0 .06.034.094.094.094h6.813c.06 0 .094-.034.094-.094v-1.906h1v-2h-1v-1.906c0-.06-.034-.094-.094-.094h-6.813zm.906 1h5v4h-5v-4z" id="battery-empty"></path>
|
59 |
-
|
60 |
-
<path d="M.094 1c-.06 0-.094.034-.094.094v5.813c0 .06.034.094.094.094h6.813c.06 0 .094-.034.094-.094v-1.906h1v-2h-1v-1.906c0-.06-.034-.094-.094-.094h-6.813z" id="battery-full"></path>
|
61 |
-
|
62 |
-
<path d="M1.344 0a.502.502 0 0 0 .156 1h.5v1.406c-.088.172-1.194 2.313-1.656 3.094-.153.268-.344.612-.344 1.063 0 .383.139.764.406 1.031.26.26.643.406 1.031.406h5.125c.383 0 .764-.139 1.031-.406.26-.26.406-.643.406-1.031 0-.452-.194-.801-.344-1.063-.463-.78-1.568-2.922-1.656-3.094v-1.406h.5a.5.5 0 1 0 0-1h-5a.5.5 0 0 0-.094 0 .502.502 0 0 0-.063 0zm1.656 1h2v1.625l.063.094s.652 1.233 1.219 2.281h-4.563c.567-1.049 1.219-2.281 1.219-2.281l.063-.094v-1.625z" id="beaker"></path>
|
63 |
-
|
64 |
-
<path d="M4 0c-1.1 0-2 .9-2 2 0 1.04-.524 1.976-1.344 2.656-.42.34-.656.824-.656 1.344h8c0-.52-.236-1.004-.656-1.344-.82-.68-1.344-1.616-1.344-2.656 0-1.1-.9-2-2-2zm-1 7c0 .55.45 1 1 1s1-.45 1-1h-2z" id="bell"></path>
|
65 |
-
|
66 |
-
<path d="M2.5 0v2.5l-.75-.75-.75.75 1.5 1.5-1.5 1.5.75.75.75-.75v2.5h.5l3.5-2.5-2.25-1.531 2.25-1.469-3.5-2.5h-.5zm1 1.5l1.5 1-1.5 1v-2zm0 3l1.5 1-1.5 1v-2z" id="bluetooth"></path>
|
67 |
-
|
68 |
-
<path d="M0 0v1c.55 0 1 .45 1 1v4c0 .55-.45 1-1 1v1h5.5c1.38 0 2.5-1.12 2.5-2.5 0-1-.588-1.85-1.438-2.25.27-.34.438-.78.438-1.25 0-1.1-.9-2-2-2h-5zm3 1h1c.55 0 1 .45 1 1s-.45 1-1 1h-1v-2zm0 3h1.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-1.5v-3z" id="bold"></path>
|
69 |
-
|
70 |
-
<path d="M4 0l-3 5h2v3l3-5h-2v-3z" id="bolt"></path>
|
71 |
-
|
72 |
-
<path d="M1 0l-.188.031c-.39.08-.701.391-.781.781l-.031.188v5.5c0 .83.67 1.5 1.5 1.5h5.5v-1h-5.5c-.28 0-.5-.22-.5-.5s.22-.5.5-.5h5.5v-5.5c0-.28-.22-.5-.5-.5h-.5v3l-1-1-1 1v-3h-3z" id="book"></path>
|
73 |
-
|
74 |
-
<path d="M2 0v8l2-2 2 2v-8h-4z" id="bookmark"></path>
|
75 |
-
|
76 |
-
<path d="M0 0v1h8v-1h-8zm0 2v5.906c0 .06.034.094.094.094h7.813c.06 0 .094-.034.094-.094v-5.906h-2.969v1.031h-2.031v-1.031h-3z" id="box"></path>
|
77 |
-
|
78 |
-
<path d="M3 0c-.554 0-1 .458-1 1v1h-1.906c-.06 0-.094.034-.094.094v2.406c0 .28.22.5.5.5h7c.28 0 .5-.22.5-.5v-2.406c0-.06-.034-.094-.094-.094h-1.906v-1c0-.542-.446-1-1-1h-2zm0 1h2v1h-2v-1zm-3 4.906v2c0 .06.034.094.094.094h7.813c.06 0 .094-.034.094-.094v-2c-.16.05-.32.094-.5.094h-7c-.18 0-.34-.044-.5-.094z" id="briefcase"></path>
|
79 |
-
|
80 |
-
<path d="M4 0c-.619 0-1.159.262-1.5.688-.341.426-.5.986-.5 1.563 0 .692.165 1.245.25 1.75h-1.25v1h1.219c-.112.448-.37.964-1.063 1.656l-.156.125v1.219h6v-1h-4.906c.641-.729.982-1.397 1.125-2h1.781v-1h-1.719c-.078-.683-.281-1.242-.281-1.75 0-.394.115-.731.281-.938.166-.207.368-.313.719-.313.394 0 .609.109.75.25.141.141.25.356.25.75h1c0-.576-.165-1.102-.531-1.469-.366-.366-.893-.531-1.469-.531z" id="british-pound"></path>
|
81 |
-
|
82 |
-
<path d="M.344 0a.5.5 0 0 0-.344.5v7a.5.5 0 0 0 .5.5h7a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.5-.5h-7a.5.5 0 0 0-.094 0 .5.5 0 0 0-.063 0zm1.156 1c.28 0 .5.22.5.5s-.22.5-.5.5-.5-.22-.5-.5.22-.5.5-.5zm2 0h3c.28 0 .5.22.5.5s-.22.5-.5.5h-3c-.28 0-.5-.22-.5-.5s.22-.5.5-.5zm-2.5 2h6v4h-6v-4z" id="browser"></path>
|
83 |
-
|
84 |
-
<path d="M7.438.031l-.063.031-3.75 2.656-.125.156-.125.25c.719.229 1.271.781 1.5 1.5l.25-.125c.05-.02.126-.075.156-.125l2.656-3.75c.03-.04.04-.116 0-.156l-.406-.406-.094-.031zm-4.781 3.969c-.73 0-1.313.614-1.313 1.344 0 .99-.544 1.821-1.344 2.281.4.23.864.375 1.344.375 1.48 0 2.656-1.176 2.656-2.656 0-.73-.604-1.344-1.344-1.344z" id="brush"></path>
|
85 |
-
|
86 |
-
<path d="M3.5 0c-1.19 0-1.978 1.69-1.188 2.5l-.281.219-1.313-.656a.5.5 0 0 0-.344-.063.5.5 0 0 0-.094.938l1.156.563c-.09.156-.186.328-.25.5h-.688a.5.5 0 0 0-.094 0 .502.502 0 1 0 .094 1h.5c0 .227.023.445.063.656l-.781.406a.5.5 0 1 0 .438.875l.656-.344c.245.46.59.844 1 1.094.35-.19.625-.439.625-.719v-1.438a.5.5 0 0 0 0-.094v-.813a.5.5 0 0 0 0-.219c.045-.231.254-.406.5-.406.28 0 .5.22.5.5v.875a.5.5 0 0 0 0 .094v.063a.5.5 0 0 0 0 .094v1.344c0 .27.275.497.625.688.41-.245.755-.604 1-1.063l.656.344a.5.5 0 1 0 .438-.875l-.781-.406c.04-.211.063-.429.063-.656h.5a.5.5 0 1 0 0-1h-.688c-.064-.172-.16-.344-.25-.5l1.156-.563a.5.5 0 0 0-.313-.938.5.5 0 0 0-.125.063l-1.313.656-.281-.219c.78-.83.003-2.5-1.188-2.5z" id="bug"></path>
|
87 |
-
|
88 |
-
<path d="M6.094 0l-.094.031v5.969h.907c.06 0 .094-.034.094-.094v-5.813c0-.06-.034-.094-.094-.094h-.813zm-1.094.5l-2.906 1.469-.188.031h-1.813c-.06 0-.094.034-.094.094v1.813c0 .06.034.094.094.094h.906l1.031 2.719c.11.25.406.36.656.25.25-.11.36-.406.25-.656l-.719-1.781c.033-.136.136-.25.281-.25v-.031l2.5 1.25v-5z" id="bullhorn"></path>
|
89 |
-
|
90 |
-
<path d="M.094 0c-.06 0-.094.034-.094.094v7.813c0 .06.034.094.094.094h6.813c.06 0 .094-.034.094-.094v-7.813c0-.06-.034-.094-.094-.094h-6.813zm.906 1h5v2h-5v-2zm0 3h1v1h-1v-1zm2 0h1v1h-1v-1zm2 0h1v3h-1v-3zm-4 2h1v1h-1v-1zm2 0h1v1h-1v-1z" id="calculator"></path>
|
91 |
-
|
92 |
-
<path d="M0 0v2h7v-2h-7zm0 3v4.906c0 .06.034.094.094.094h6.813c.06 0 .094-.034.094-.094v-4.906h-7zm1 1h1v1h-1v-1zm2 0h1v1h-1v-1zm2 0h1v1h-1v-1zm-4 2h1v1h-1v-1zm2 0h1v1h-1v-1z" id="calendar"></path>
|
93 |
-
|
94 |
-
<path d="M4.094 0c-.06 0-.105.044-.125.094l-.938 1.813c-.02.05-.065.094-.125.094h-1.406c-.83 0-1.5.67-1.5 1.5v4.406c0 .06.034.094.094.094h7.813c.06 0 .094-.034.094-.094v-5.813c0-.06-.034-.094-.094-.094h-.813c-.06 0-.105-.044-.125-.094l-.938-1.813c-.02-.05-.065-.094-.125-.094h-1.813zm-2.594 3c.28 0 .5.22.5.5s-.22.5-.5.5-.5-.22-.5-.5.22-.5.5-.5zm3.5 0c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm0 1c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1z" id="camera-slr"></path>
|
95 |
-
|
96 |
-
<path d="M0 2l4 4 4-4h-8z" id="caret-bottom"></path>
|
97 |
-
|
98 |
-
<path d="M6 0l-4 4 4 4v-8z" id="caret-left"></path>
|
99 |
-
|
100 |
-
<path d="M2 0v8l4-4-4-4z" id="caret-right"></path>
|
101 |
-
|
102 |
-
<path d="M4 2l-4 4h8l-4-4z" id="caret-top"></path>
|
103 |
-
|
104 |
-
<path d="M.344 0a.502.502 0 0 0 .156 1h1.5l.094.25.406 1.25.406 1.25c.04.13.204.25.344.25h3.5c.14 0 .304-.12.344-.25l.813-2.531c.04-.12-.016-.219-.156-.219h-4.438l-.375-.719a.5.5 0 0 0-.438-.281h-2a.5.5 0 0 0-.094 0 .502.502 0 0 0-.063 0zm3.156 5c-.276 0-.5.224-.5.5s.224.5.5.5.5-.224.5-.5-.224-.5-.5-.5zm3 0c-.276 0-.5.224-.5.5s.224.5.5.5.5-.224.5-.5-.224-.5-.5-.5z" transform="translate(0 1)" id="cart"></path>
|
105 |
-
|
106 |
-
<path d="M0 0v5l1-1h1v-3h3v-1h-5zm3 2v4h4l1 1v-5h-5z" id="chat"></path>
|
107 |
-
|
108 |
-
<path d="M6.406 1l-.719.688-2.781 2.781-.781-.781-.719-.688-1.406 1.406.688.719 1.5 1.5.719.688.719-.688 3.5-3.5.688-.719-1.406-1.406z" id="check"></path>
|
109 |
-
|
110 |
-
<path d="M1.5 1l-1.5 1.5 4 4 4-4-1.5-1.5-2.5 2.5-2.5-2.5z" id="chevron-bottom"></path>
|
111 |
-
|
112 |
-
<path d="M5 0l-4 4 4 4 1.5-1.5-2.5-2.5 2.5-2.5-1.5-1.5z" id="chevron-left"></path>
|
113 |
-
|
114 |
-
<path d="M2.5 0l-1.5 1.5 2.5 2.5-2.5 2.5 1.5 1.5 4-4-4-4z" id="chevron-right"></path>
|
115 |
-
|
116 |
-
<path d="M4 1l-4 4 1.5 1.5 2.5-2.5 2.5 2.5 1.5-1.5-4-4z" id="chevron-top"></path>
|
117 |
-
|
118 |
-
<path d="M4 0c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm2 1.781l.719.719-3.219 3.219-1.719-1.719.719-.719 1 1 2.5-2.5z" id="circle-check"></path>
|
119 |
-
|
120 |
-
<path d="M4 0c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm-1.5 1.781l1.5 1.5 1.5-1.5.719.719-1.5 1.5 1.5 1.5-.719.719-1.5-1.5-1.5 1.5-.719-.719 1.5-1.5-1.5-1.5.719-.719z" id="circle-x"></path>
|
121 |
-
|
122 |
-
<path d="M3.5 0c-.28 0-.5.22-.5.5v.5h-.75c-.14 0-.25.11-.25.25v.75h3v-.75c0-.14-.11-.25-.25-.25h-.75v-.5c0-.28-.22-.5-.5-.5zm-3.25 1c-.14 0-.25.11-.25.25v6.5c0 .14.11.25.25.25h6.5c.14 0 .25-.11.25-.25v-6.5c0-.14-.11-.25-.25-.25h-.75v2h-5v-2h-.75z" id="clipboard"></path>
|
123 |
-
|
124 |
-
<path d="M4 0c-2.203 0-4 1.797-4 4 0 2.203 1.797 4 4 4 2.203 0 4-1.797 4-4 0-2.203-1.797-4-4-4zm0 1c1.663 0 3 1.337 3 3s-1.337 3-3 3-3-1.337-3-3 1.337-3 3-3zm-.5 1v2.219l.156.125.5.5.344.375.719-.719-.375-.344-.344-.344v-1.813h-1z" id="clock"></path>
|
125 |
-
|
126 |
-
<path d="M4.5 0c-1.21 0-2.27.86-2.5 2-1.1 0-2 .9-2 2 0 .37.111.7.281 1h2.719v-.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5v.5h1.906c.05-.16.094-.32.094-.5 0-.65-.42-1.29-1-1.5v-.5c0-1.38-1.12-2.5-2.5-2.5zm-.156 4a.5.5 0 0 0-.344.5v1.5h-1.5l2 2 2-2h-1.5v-1.5a.5.5 0 0 0-.594-.5.5.5 0 0 0-.063 0z" id="cloud-download"></path>
|
127 |
-
|
128 |
-
<path d="M4.5 0c-1.21 0-2.27.86-2.5 2-1.1 0-2 .9-2 2 0 .37.111.7.281 1h2.219l2-2 2 2h1.406c.05-.16.094-.32.094-.5 0-.65-.42-1.29-1-1.5v-.5c0-1.38-1.12-2.5-2.5-2.5zm0 4.5l-2.5 2.5h2v.5a.5.5 0 1 0 1 0v-.5h2l-2.5-2.5z" id="cloud-upload"></path>
|
129 |
-
|
130 |
-
<path d="M4.5 1c-1.21 0-2.27.86-2.5 2-1.1 0-2 .9-2 2s.9 2 2 2h4.5c.83 0 1.5-.67 1.5-1.5 0-.65-.42-1.29-1-1.5v-.5c0-1.38-1.12-2.5-2.5-2.5z" id="cloud"></path>
|
131 |
-
|
132 |
-
<path d="M2.5 0c-1.38 0-2.5 1.12-2.5 2.5 0 .39.09.743.25 1.063.3-.21.63-.379 1-.469.55-1.25 1.82-2.084 3.25-2.094-.46-.6-1.18-1-2-1zm2 2c-1.21 0-2.27.86-2.5 2-1.1 0-2 .9-2 2s.9 2 2 2h4.5c.83 0 1.5-.67 1.5-1.5 0-.65-.42-1.29-1-1.5v-.5c0-1.38-1.12-2.5-2.5-2.5z" id="cloudy"></path>
|
133 |
-
|
134 |
-
<path d="M5 1l-3 6h1l3-6h-1zm-4 1l-1 2 1 2h1l-1-2 1-2h-1zm5 0l1 2-1 2h1l1-2-1-2h-1z" id="code"></path>
|
135 |
-
|
136 |
-
<path d="M3.5 0l-.5 1.188-.281.125-1.188-.5-.719.719.5 1.188-.125.281-1.188.5v1l1.188.5.125.313-.5 1.156.719.719 1.188-.5.281.125.5 1.188h1l.5-1.188.281-.125 1.188.5.719-.719-.5-1.188.125-.281 1.188-.5v-1l-1.188-.5-.125-.281.469-1.188-.688-.719-1.188.5-.281-.125-.5-1.188h-1zm.5 2.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5-1.5-.67-1.5-1.5.67-1.5 1.5-1.5z" id="cog"></path>
|
137 |
-
|
138 |
-
<path d="M0 0v2h8v-2h-8zm2 3l2 2 2-2h-4zm-2 4v1h8v-1h-8z" id="collapse-down"></path>
|
139 |
-
|
140 |
-
<path d="M0 0v8h1v-8h-1zm6 0v8h2v-8h-2zm-1 2l-2 2 2 2v-4z" id="collapse-left"></path>
|
141 |
-
|
142 |
-
<path d="M0 0v8h2v-8h-2zm7 0v8h1v-8h-1zm-4 2v4l2-2-2-2z" id="collapse-right"></path>
|
143 |
-
|
144 |
-
<path d="M0 0v1h8v-1h-8zm4 3l-2 2h4l-2-2zm-4 3v2h8v-2h-8z" id="collapse-up"></path>
|
145 |
-
|
146 |
-
<path d="M1.5 0c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5h.5v1h-.5c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5v-.5h1v.5c0 .83.67 1.5 1.5 1.5s1.5-.67 1.5-1.5-.67-1.5-1.5-1.5h-.5v-1h.5c.83 0 1.5-.67 1.5-1.5s-.67-1.5-1.5-1.5-1.5.67-1.5 1.5v.5h-1v-.5c0-.83-.67-1.5-1.5-1.5zm0 1c.28 0 .5.22.5.5v.5h-.5c-.28 0-.5-.22-.5-.5s.22-.5.5-.5zm4 0c.28 0 .5.22.5.5s-.22.5-.5.5h-.5v-.5c0-.28.22-.5.5-.5zm-2.5 2h1v1h-1v-1zm-1.5 2h.5v.5c0 .28-.22.5-.5.5s-.5-.22-.5-.5.22-.5.5-.5zm3.5 0h.5c.28 0 .5.22.5.5s-.22.5-.5.5-.5-.22-.5-.5v-.5z" id="command"></path>
|
147 |
-
|
148 |
-
<path d="M.094 0c-.06 0-.094.034-.094.094v5.813c0 .06.034.094.094.094h5.906l2 2v-7.906c0-.06-.034-.094-.094-.094h-7.813z" id="comment-square"></path>
|
149 |
-
|
150 |
-
<path d="M4 0c-2.203 0-4 1.797-4 4 0 2.203 1.797 4 4 4 2.203 0 4-1.797 4-4 0-2.203-1.797-4-4-4zm0 1c1.663 0 3 1.337 3 3s-1.337 3-3 3-3-1.337-3-3 1.337-3 3-3zm2 1l-3 1-1 3 3-1 1-3zm-2 1.5c.28 0 .5.22.5.5s-.22.5-.5.5-.5-.22-.5-.5.22-.5.5-.5z" id="compass"></path>
|
151 |
-
|
152 |
-
<path d="M4 0c-2.203 0-4 1.797-4 4 0 2.203 1.797 4 4 4 2.203 0 4-1.797 4-4 0-2.203-1.797-4-4-4zm0 1c1.663 0 3 1.337 3 3s-1.337 3-3 3v-6z" id="contrast"></path>
|
153 |
-
|
154 |
-
<path d="M0 0v1h8v-1h-8zm0 2v1h5v-1h-5zm0 3v1h8v-1h-8zm0 2v1h6v-1h-6zm7.5 0c-.276 0-.5.224-.5.5s.224.5.5.5.5-.224.5-.5-.224-.5-.5-.5z" id="copywriting"></path>
|
155 |
-
|
156 |
-
<path d="M.25 1c-.14 0-.25.11-.25.25v.75h8v-.75c0-.14-.11-.25-.25-.25h-7.5zm-.25 2v3.75c0 .14.11.25.25.25h7.5c.14 0 .25-.11.25-.25v-3.75h-8zm1 2h1v1h-1v-1zm2 0h1v1h-1v-1z" id="credit-card"></path>
|
157 |
-
|
158 |
-
<path d="M1 0v1h-1v1h1v5h5v1h1v-1h1v-1h-1v-4.5l1-1-.5-.5-1 1h-4.5v-1h-1zm1 2h3.5l-3.5 3.5v-3.5zm4 .5v3.5h-3.5l3.5-3.5z" id="crop"></path>
|
159 |
-
|
160 |
-
<path d="M4 0c-2.203 0-4 1.797-4 4 0 2.203 1.797 4 4 4 2.203 0 4-1.797 4-4 0-2.203-1.797-4-4-4zm0 1c1.663 0 3 1.337 3 3s-1.337 3-3 3-3-1.337-3-3 1.337-3 3-3zm0 1c-.276 0-.5.224-.5.5s.224.5.5.5.5-.224.5-.5-.224-.5-.5-.5zm-1.656 1a.5.5 0 0 0-.188.844l.906.906-.063.25c0 .552.448 1 1 1s1-.448 1-1-.448-1-1-1l-.25.063-.906-.906a.5.5 0 0 0-.438-.156.5.5 0 0 0-.063 0zm3.156 0c-.276 0-.5.224-.5.5s.224.5.5.5.5-.224.5-.5-.224-.5-.5-.5z" id="dashboard"></path>
|
161 |
-
|
162 |
-
<path d="M3 0v3h-2l3 3 3-3h-2v-3h-2zm-3 7v1h8v-1h-8z" id="data-transfer-download"></path>
|
163 |
-
|
164 |
-
<path d="M0 0v1h8v-1h-8zm4 2l-3 3h2v3h2v-3h2l-3-3z" id="data-transfer-upload"></path>
|
165 |
-
|
166 |
-
<path d="M2 1l-2 3 2 3h6v-6h-6zm1.5.781l1.5 1.5 1.5-1.5.719.719-1.5 1.5 1.5 1.5-.719.719-1.5-1.5-1.5 1.5-.719-.719 1.5-1.5-1.5-1.5.719-.719z" id="delete"></path>
|
167 |
-
|
168 |
-
<path d="M4 1c-2.201 0-4 1.799-4 4h1c0-1.659 1.341-3 3-3s3 1.341 3 3h1c0-2.201-1.799-4-4-4zm-.594 2.094c-.82.25-1.406 1.006-1.406 1.906 0 1.1.9 2 2 2s2-.9 2-2c0-.9-.586-1.656-1.406-1.906l-.594.875-.594-.875z" id="dial"></path>
|
169 |
-
|
170 |
-
<path d="M0 0v8h7v-4h-4v-4h-3zm4 0v3h3l-3-3zm-3 2h1v1h-1v-1zm0 2h1v1h-1v-1zm0 2h4v1h-4v-1z" id="document"></path>
|
171 |
-
|
172 |
-
<path d="M3 0v1h-.75c-.686 0-1.25.564-1.25 1.25v.5c0 .678.437 1.242 1.094 1.406l2.563.656c.143.036.344.296.344.438v.5c0 .134-.116.25-.25.25h-2.5c-.116 0-.212-.037-.25-.063v-.938h-1v1c0 .342.203.627.438.781.234.155.518.219.813.219h.75v1h1v-1h.75c.686 0 1.25-.564 1.25-1.25v-.5c0-.678-.437-1.242-1.094-1.406l-2.563-.656c-.143-.036-.344-.296-.344-.438v-.5c0-.134.116-.25.25-.25h2.5c.116 0 .212.037.25.063v.938h1v-1c0-.342-.203-.627-.438-.781-.234-.155-.518-.219-.813-.219h-.75v-1h-1z" id="dollar"></path>
|
173 |
-
|
174 |
-
<path d="M0 1v6l3-3v-3h-3zm5 0v6l3-3v-3h-3z" id="double-quote-sans-left"></path>
|
175 |
-
|
176 |
-
<path d="M3 1l-3 3v3h3v-6zm5 0l-3 3v3h3v-6z" id="double-quote-sans-right"></path>
|
177 |
-
|
178 |
-
<path d="M3 1c-1.651 0-3 1.349-3 3v3h3v-3h-2c0-1.109.891-2 2-2v-1zm5 0c-1.651 0-3 1.349-3 3v3h3v-3h-2c0-1.109.891-2 2-2v-1z" id="double-quote-serif-left"></path>
|
179 |
-
|
180 |
-
<path d="M0 1v3h2c0 1.109-.891 2-2 2v1c1.651 0 3-1.349 3-3v-3h-3zm5 0v3h2c0 1.109-.891 2-2 2v1c1.651 0 3-1.349 3-3v-3h-3z" id="double-quote-serif-right"></path>
|
181 |
-
|
182 |
-
<path d="M4 0l-.344.344c-.11.11-2.656 2.685-2.656 4.875 0 1.65 1.35 3 3 3s3-1.35 3-3c0-2.19-2.546-4.765-2.656-4.875l-.344-.344zm-1.5 4.719c.28 0 .5.22.5.5 0 .55.45 1 1 1 .28 0 .5.22.5.5s-.22.5-.5.5c-1.1 0-2-.9-2-2 0-.28.22-.5.5-.5z" id="droplet"></path>
|
183 |
-
|
184 |
-
<path d="M4 0l-4 5h8l-4-5zm-4 6v2h8v-2h-8z" id="eject"></path>
|
185 |
-
|
186 |
-
<path d="M4 0l-3 3h6l-3-3zm-3 5l3 3 3-3h-6z" id="elevator"></path>
|
187 |
-
|
188 |
-
<path d="M0 3v2h2v-2h-2zm3 0v2h2v-2h-2zm3 0v2h2v-2h-2z" id="ellipses"></path>
|
189 |
-
|
190 |
-
<path d="M0 1v1l4 2 4-2v-1h-8zm0 2v4h8v-4l-4 2-4-2z" id="envelope-closed"></path>
|
191 |
-
|
192 |
-
<path d="M4 0l-4 2v6h8v-6l-4-2zm0 1.125l3 1.5v1.875l-3 1.5-3-1.5v-1.875l3-1.5zm-2 1.875v1l2 1 2-1v-1h-4z" id="envelope-open"></path>
|
193 |
-
|
194 |
-
<path d="M5 0c-1.858 0-3.398 1.278-3.844 3h-1.906l-.25 1h2c0 .345.073.68.156 1h-1.969l-.188 1h2.563c.696 1.185 1.969 2 3.438 2 .734 0 1.407-.215 2-.563v-1.219c-.531.479-1.225.781-2 .781-.888 0-1.671-.392-2.219-1h2.219l.156-1h-2.969c-.113-.317-.188-.643-.188-1h3.344l.156-1h-3.313c.414-1.16 1.507-2 2.813-2 .655 0 1.258.209 1.75.563l.156-1.063c-.57-.313-1.213-.5-1.906-.5z" id="euro"></path>
|
195 |
-
|
196 |
-
<path d="M0 0v1h7v-1h-7zm0 2v1h5v-1h-5zm0 2v1h8v-1h-8zm0 2v1h1v-1h-1zm2 0v1h1v-1h-1zm2 0v1h1v-1h-1z" id="excerpt"></path>
|
197 |
-
|
198 |
-
<path d="M0 0v1h8v-1h-8zm2 2l2 2 2-2h-4zm-2 4v2h8v-2h-8z" id="expand-down"></path>
|
199 |
-
|
200 |
-
<path d="M0 0v8h1v-8h-1zm6 0v8h2v-8h-2zm-4 2v4l2-2-2-2z" id="expand-left"></path>
|
201 |
-
|
202 |
-
<path d="M0 0v8h2v-8h-2zm7 0v8h1v-8h-1zm-1 2l-2 2 2 2v-4z" id="expand-right"></path>
|
203 |
-
|
204 |
-
<path d="M0 0v2h8v-2h-8zm4 4l-2 2h4l-2-2zm-4 3v1h8v-1h-8z" id="expand-up"></path>
|
205 |
-
|
206 |
-
<path d="M0 0v8h8v-2h-1v1h-6v-6h1v-1h-2zm4 0l1.5 1.5-2.5 2.5 1 1 2.5-2.5 1.5 1.5v-4h-4z" id="external-link"></path>
|
207 |
-
|
208 |
-
<path d="M4.031 1c-2.53 0-4.031 3-4.031 3s1.501 3 4.031 3c2.47 0 3.969-3 3.969-3s-1.499-3-3.969-3zm-.031 1c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm0 1c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1c0-.1-.032-.191-.063-.281-.08.16-.237.281-.438.281-.28 0-.5-.22-.5-.5 0-.2.121-.357.281-.438-.09-.03-.181-.063-.281-.063z" id="eye"></path>
|
209 |
-
|
210 |
-
<path d="M3.313 0a.5.5 0 0 0-.188.844l.625.625-3.594 3.656-.156.156v2.719h2.719l.125-.156 3.656-3.656.625.656a.5.5 0 1 0 .719-.688l-.938-.938.656-.656c.59-.58.59-1.545 0-2.125-.56-.57-1.555-.57-2.125 0l-.656.656-.938-.938a.5.5 0 0 0-.469-.156.5.5 0 0 0-.063 0zm1.156 2.188l1.313 1.313-3.156 3.156-1.281-1.313 3.125-3.156z" id="eyedropper"></path>
|
211 |
-
|
212 |
-
<path d="M0 0v8h7v-4h-4v-4h-3zm4 0v3h3l-3-3z" id="file"></path>
|
213 |
-
|
214 |
-
<path d="M2 0c1 2-2 3-2 5l2 3c-.98-1.98 2-3 2-5l-2-3zm3 3c1 2-2 3-2 5h3c.4 0 1-.5 1-2 0-2-2-3-2-3z" id="fire"></path>
|
215 |
-
|
216 |
-
<path d="M0 0v8h1v-8h-1zm2 0v4h2v1h4l-2-1.969 2-2.031h-3v-1h-3z" id="flag"></path>
|
217 |
-
|
218 |
-
<path d="M3.5 0l-1.5 3h2l-.656 2h-1.344l1 3 3-3h-1.5l1.5-3h-2l1-2h-1.5z" id="flash"></path>
|
219 |
-
|
220 |
-
<path d="M0 0v2h8v-1h-5v-1h-3zm0 3v4.5c0 .28.22.5.5.5h7c.28 0 .5-.22.5-.5v-4.5h-8z" id="folder"></path>
|
221 |
-
|
222 |
-
<path d="M1.5 0c-.828 0-1.5.672-1.5 1.5 0 .656.414 1.202 1 1.406v2.188c-.586.204-1 .75-1 1.406 0 .828.672 1.5 1.5 1.5s1.5-.672 1.5-1.5c0-.595-.341-1.101-.844-1.344.09-.09.205-.156.344-.156h2c.823 0 1.5-.677 1.5-1.5v-.594c.586-.204 1-.75 1-1.406 0-.828-.672-1.5-1.5-1.5s-1.5.672-1.5 1.5c0 .656.414 1.202 1 1.406v.594c0 .277-.223.5-.5.5h-2c-.171 0-.346.04-.5.094v-1.188c.586-.204 1-.75 1-1.406 0-.828-.672-1.5-1.5-1.5z" id="fork"></path>
|
223 |
-
|
224 |
-
<path d="M0 0v4l1.5-1.5 1.5 1.5 1-1-1.5-1.5 1.5-1.5h-4zm5 4l-1 1 1.5 1.5-1.5 1.5h4v-4l-1.5 1.5-1.5-1.5z" id="fullscreen-enter"></path>
|
225 |
-
|
226 |
-
<path d="M1 0l-1 1 1.5 1.5-1.5 1.5h4v-4l-1.5 1.5-1.5-1.5zm3 4v4l1.5-1.5 1.5 1.5 1-1-1.5-1.5 1.5-1.5h-4z" id="fullscreen-exit"></path>
|
227 |
-
|
228 |
-
<path d="M4 0c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 1c.333 0 .637.086.938.188-.214.197-.45.383-.406.563.04.18.688.13.688.5 0 .27-.425.346-.125.656.35.35-.636.978-.656 1.438-.03.83.841.969 1.531.969.424 0 .503.195.469.438-.546.758-1.438 1.25-2.438 1.25-.378 0-.729-.09-1.063-.219.224-.442-.313-1.344-.781-1.625-.226-.226-.689-.114-.969-.219-.092-.271-.178-.545-.188-.844.031-.05.081-.094.156-.094.19 0 .454.374.594.344.18-.04-.742-1.313-.313-1.563.2-.12.609.394.469-.156-.12-.51.366-.276.656-.406.26-.11.455-.414.125-.594l-.219-.188c.45-.27.972-.438 1.531-.438zm2.313 1.094c.184.222.323.481.438.75l-.188.219c-.29.27-.327-.212-.438-.313-.13-.11-.638.025-.688-.125-.077-.181.499-.418.875-.531z" id="globe"></path>
|
229 |
-
|
230 |
-
<path d="M7.031 0l-3.031 3-1-1-3 3.031 1 1 2-2.031 1 1 4-4-.969-1zm-7.031 7v1h8v-1h-8z" id="graph"></path>
|
231 |
-
|
232 |
-
<path d="M0 0v1h1v-1h-1zm2 0v1h1v-1h-1zm2 0v1h1v-1h-1zm2 0v1h1v-1h-1zm-6 2v1h1v-1h-1zm2 0v1h1v-1h-1zm2 0v1h1v-1h-1zm2 0v1h1v-1h-1zm-6 2v1h1v-1h-1zm2 0v1h1v-1h-1zm2 0v1h1v-1h-1zm2 0v1h1v-1h-1zm-6 2v1h1v-1h-1zm2 0v1h1v-1h-1zm2 0v1h1v-1h-1zm2 0v1h1v-1h-1z" id="grid-four-up"></path>
|
233 |
-
|
234 |
-
<path d="M0 0v2h2v-2h-2zm3 0v2h2v-2h-2zm3 0v2h2v-2h-2zm-6 3v2h2v-2h-2zm3 0v2h2v-2h-2zm3 0v2h2v-2h-2zm-6 3v2h2v-2h-2zm3 0v2h2v-2h-2zm3 0v2h2v-2h-2z" id="grid-three-up"></path>
|
235 |
-
|
236 |
-
<path d="M0 0v3h3v-3h-3zm5 0v3h3v-3h-3zm-5 5v3h3v-3h-3zm5 0v3h3v-3h-3z" id="grid-two-up"></path>
|
237 |
-
|
238 |
-
<path d="M.188 0c-.11 0-.188.077-.188.188v3.313c0 .28.22.5.5.5h6c.28 0 .5-.22.5-.5v-3.313c0-.11-.077-.188-.188-.188h-6.625zm-.188 4.906v2.906c0 .11.077.188.188.188h6.625c.11 0 .188-.077.188-.188v-2.906c-.16.05-.32.094-.5.094h-6c-.18 0-.34-.044-.5-.094zm5.5 1.094c.28 0 .5.22.5.5s-.22.5-.5.5-.5-.22-.5-.5.22-.5.5-.5z" id="hard-drive"></path>
|
239 |
-
|
240 |
-
<path d="M0 0v1h.5c.28 0 .5.22.5.5v4c0 .28-.22.5-.5.5h-.5v1h3v-1h-.5c-.28 0-.5-.22-.5-.5v-1.5h3v1.5c0 .28-.22.5-.5.5h-.5v1h3v-1h-.5c-.28 0-.5-.22-.5-.5v-4c0-.28.22-.5.5-.5h.5v-1h-3v1h.5c.28 0 .5.22.5.5v1.5h-3v-1.5c0-.28.22-.5.5-.5h.5v-1h-3z" id="header"></path>
|
241 |
-
|
242 |
-
<path d="M4 0c-1.651 0-3 1.349-3 3v1h-.5a.5.5 0 0 0-.5.5v2a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-3.5c0-1.109.891-2 2-2s2 .891 2 2v3.5a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-2a.5.5 0 0 0-.5-.5h-.5v-1c0-1.651-1.349-3-3-3z" id="headphones"></path>
|
243 |
-
|
244 |
-
<path d="M2 1c-.55 0-1.046.224-1.406.594-.37.36-.594.856-.594 1.406 0 .55.224 1.046.594 1.406l3.406 3.438 3.406-3.438c.37-.37.594-.856.594-1.406 0-.55-.224-1.046-.594-1.406-.36-.37-.856-.594-1.406-.594-.55 0-1.046.224-1.406.594-.37.36-.594.856-.594 1.406 0-.55-.224-1.046-.594-1.406-.36-.37-.856-.594-1.406-.594z" id="heart"></path>
|
245 |
-
|
246 |
-
<path d="M4 0l-4 3h1v4h2v-2h2v2h2v-4.031l1 .031-4-3z" id="home"></path>
|
247 |
-
|
248 |
-
<path d="M0 0v8h8v-8h-8zm1 1h6v3l-1-1-1 1 2 2v1h-1l-4-4-1 1v-3z" id="image"></path>
|
249 |
-
|
250 |
-
<path d="M.188 0c-.11 0-.188.077-.188.188v7.625c0 .11.077.188.188.188h7.625c.11 0 .188-.077.188-.188v-7.625c0-.11-.077-.188-.188-.188h-7.625zm.813 2h6v3h-1l-1 1h-2l-1-1h-1v-3z" id="inbox"></path>
|
251 |
-
|
252 |
-
<path d="M2 2c-1.31 0-2 1.01-2 2s.69 2 2 2c.79 0 1.42-.559 2-1.219.58.66 1.19 1.219 2 1.219 1.31 0 2-1.01 2-2s-.69-2-2-2c-.81 0-1.42.559-2 1.219-.57-.66-1.21-1.219-2-1.219zm0 1c.42 0 .884.47 1.344 1-.46.53-.924 1-1.344 1-.74 0-1-.54-1-1 0-.46.26-1 1-1zm4 0c.74 0 1 .54 1 1 0 .46-.26 1-1 1-.43 0-.894-.47-1.344-1 .45-.53.914-1 1.344-1z" id="infinity"></path>
|
253 |
-
|
254 |
-
<path d="M5 0c-.552 0-1 .448-1 1s.448 1 1 1 1-.448 1-1-.448-1-1-1zm-1.5 2.5c-.83 0-1.5.67-1.5 1.5h1c0-.28.22-.5.5-.5s.5.22.5.5-1 1.64-1 2.5c0 .86.67 1.5 1.5 1.5s1.5-.67 1.5-1.5h-1c0 .28-.22.5-.5.5s-.5-.22-.5-.5c0-.36 1-1.84 1-2.5 0-.81-.67-1.5-1.5-1.5z" id="info"></path>
|
255 |
-
|
256 |
-
<path d="M2 0v1h1.625l-.063.125-2 5-.344.875h-1.219v1h5v-1h-1.625l.063-.125 2-5 .344-.875h1.219v-1h-5z" id="italic"></path>
|
257 |
-
|
258 |
-
<path d="M0 0v1h8v-1h-8zm0 2v1h8v-1h-8zm0 2v1h8v-1h-8zm1 2v1h6v-1h-6z" id="justify-center"></path>
|
259 |
-
|
260 |
-
<path d="M0 0v1h8v-1h-8zm0 2v1h8v-1h-8zm0 2v1h8v-1h-8zm0 2v1h6v-1h-6z" id="justify-left"></path>
|
261 |
-
|
262 |
-
<path d="M0 0v1h8v-1h-8zm0 2v1h8v-1h-8zm0 2v1h8v-1h-8zm2 2v1h6v-1h-6z" id="justify-right"></path>
|
263 |
-
|
264 |
-
<path d="M5.5 0c-1.38 0-2.5 1.12-2.5 2.5 0 .16.033.297.063.438l-3.063 3.063v2h3v-2h2v-1l.063-.063c.14.03.277.063.438.063 1.38 0 2.5-1.12 2.5-2.5s-1.12-2.5-2.5-2.5zm.5 1c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1z" id="key"></path>
|
265 |
-
|
266 |
-
<path d="M1.344 0a.5.5 0 0 0-.344.5v3.5h-1v1.5c0 .28.22.5.5.5h7c.28 0 .5-.22.5-.5v-1.5h-1v-3.5a.5.5 0 0 0-.5-.5h-5a.5.5 0 0 0-.094 0 .5.5 0 0 0-.063 0zm.656 1h4v3h-1v1h-2v-1h-1v-3z" transform="translate(0 1)" id="laptop"></path>
|
267 |
-
|
268 |
-
<path d="M0 0v4h4v-4h-4zm5 2v3h-3v1h4v-4h-1zm2 2v3h-3v1h4v-4h-1z" id="layers"></path>
|
269 |
-
|
270 |
-
<path d="M3.406 0a.5.5 0 0 0-.125.063l-3 1.5a.5.5 0 1 0 .438.875l3-1.5a.5.5 0 0 0-.313-.938zm1 1.5a.5.5 0 0 0-.125.063l-4 2a.5.5 0 1 0 .438.875l4-2a.5.5 0 0 0-.313-.938zm0 2a.5.5 0 0 0-.125.063l-3 1.5a.5.5 0 0 0 .219.938h2a.502.502 0 0 0 .156-1l1.063-.563a.5.5 0 0 0-.313-.938zm-2.563 3.5a.502.502 0 0 0 .156 1h1a.5.5 0 1 0 0-1h-1a.5.5 0 0 0-.094 0 .502.502 0 0 0-.063 0z" transform="translate(1)" id="lightbulb"></path>
|
271 |
-
|
272 |
-
<path d="M2 0v1h-1v1h2v-2h-1zm3.875.031c-.184.01-.354.03-.531.094-.27.095-.531.25-.75.469l-.438.438a.5.5 0 1 0 .688.688l.438-.438c.101-.101.245-.173.375-.219.352-.126.78-.064 1.063.219.395.389.4 1.037 0 1.438l-1.5 1.5a.5.5 0 1 0 .688.688l1.5-1.5c.78-.78.785-2.041 0-2.813-.279-.279-.606-.452-.969-.531-.181-.039-.379-.041-.563-.031zm-3.594 2.906a.5.5 0 0 0-.188.156l-1.5 1.5c-.78.78-.785 2.041 0 2.813.557.557 1.355.722 2.063.469.27-.095.531-.25.75-.469l.438-.438a.5.5 0 1 0-.688-.688l-.438.438c-.101.101-.245.173-.375.219-.352.126-.78.064-1.063-.219-.395-.389-.4-1.037 0-1.438l1.5-1.5a.5.5 0 0 0-.438-.844.5.5 0 0 0-.063 0zm2.719 3.063v2h1v-1h1v-1h-2z" id="link-broken"></path>
|
273 |
-
|
274 |
-
<path d="M5.875.031c-.184.01-.354.03-.531.094-.27.095-.531.25-.75.469a.5.5 0 1 0 .688.688c.101-.101.245-.173.375-.219.352-.126.78-.064 1.063.219.395.389.4 1.037 0 1.438l-1.5 1.5c-.434.434-.799.483-1.063.469-.264-.015-.406-.125-.406-.125a.504.504 0 1 0-.5.875s.34.222.844.25c.504.028 1.197-.165 1.813-.781l1.5-1.5c.78-.78.785-2.041 0-2.813-.279-.279-.606-.452-.969-.531-.181-.039-.379-.041-.563-.031zm-2 2.313c-.501-.019-1.186.155-1.781.75l-1.5 1.5c-.78.78-.785 2.041 0 2.813.557.557 1.355.722 2.063.469.27-.095.531-.25.75-.469a.5.5 0 1 0-.688-.688c-.101.101-.245.173-.375.219-.352.126-.78.064-1.063-.219-.395-.389-.4-1.037 0-1.438l1.5-1.5c.405-.405.752-.448 1.031-.438.279.011.469.094.469.094a.5.5 0 1 0 .438-.875s-.343-.199-.844-.219z" id="link-intact"></path>
|
275 |
-
|
276 |
-
<path d="M0 0v3h3v-3h-3zm4 0v1h4v-1h-4zm0 2v1h3v-1h-3zm-4 2v3h3v-3h-3zm4 0v1h4v-1h-4zm0 2v1h3v-1h-3z" id="list-rich"></path>
|
277 |
-
|
278 |
-
<path d="M.5 0c-.276 0-.5.224-.5.5s.224.5.5.5.5-.224.5-.5-.224-.5-.5-.5zm1.5 0v1h6v-1h-6zm-1.5 2c-.276 0-.5.224-.5.5s.224.5.5.5.5-.224.5-.5-.224-.5-.5-.5zm1.5 0v1h6v-1h-6zm-1.5 2c-.276 0-.5.224-.5.5s.224.5.5.5.5-.224.5-.5-.224-.5-.5-.5zm1.5 0v1h6v-1h-6zm-1.5 2c-.276 0-.5.224-.5.5s.224.5.5.5.5-.224.5-.5-.224-.5-.5-.5zm1.5 0v1h6v-1h-6z" id="list"></path>
|
279 |
-
|
280 |
-
<path d="M8 0l-8 4 3 1 1 3 4-8z" id="location"></path>
|
281 |
-
|
282 |
-
<path d="M4 0c-1.099 0-2 .901-2 2v1h-1v4h6v-4h-1v-1c0-1.099-.901-2-2-2zm0 1c.561 0 1 .439 1 1v1h-2v-1c0-.561.439-1 1-1z" id="lock-locked"></path>
|
283 |
-
|
284 |
-
<path d="M4 0c-1.099 0-2 .901-2 2h1c0-.561.439-1 1-1 .561 0 1 .439 1 1v2h-4v4h6v-4h-1v-2c0-1.099-.901-2-2-2z" id="lock-unlocked"></path>
|
285 |
-
|
286 |
-
<path d="M4 1c-1.651 0-3 1.349-3 3h-1l1.5 2 1.5-2h-1c0-1.109.891-2 2-2v-1zm2.5 1l-1.5 2h1c0 1.109-.891 2-2 2v1c1.651 0 3-1.349 3-3h1l-1.5-2z" id="loop-circular"></path>
|
287 |
-
|
288 |
-
<path d="M1 0v2h1v-1h4v2h-1l1.5 2.5 1.5-2.5h-1v-3h-6zm.5 2.5l-1.5 2.5h1v3h6v-2h-1v1h-4v-2h1l-1.5-2.5z" id="loop-square"></path>
|
289 |
-
|
290 |
-
<path d="M6 0v1h-5c-.554 0-1 .446-1 1v1h1v-1h5v1l2-1.5-2-1.5zm-4 4l-2 1.5 2 1.5v-1h5c.542 0 1-.458 1-1v-1h-1v1h-5v-1z" id="loop"></path>
|
291 |
-
|
292 |
-
<path d="M3.5 0c-1.927 0-3.5 1.573-3.5 3.5s1.573 3.5 3.5 3.5c.592 0 1.166-.145 1.656-.406a1 1 0 0 0 .125.125l1 1a1.016 1.016 0 1 0 1.438-1.438l-1-1a1 1 0 0 0-.156-.125c.266-.493.438-1.059.438-1.656 0-1.927-1.573-3.5-3.5-3.5zm0 1c1.387 0 2.5 1.113 2.5 2.5 0 .661-.241 1.273-.656 1.719l-.031.031a1 1 0 0 0-.125.125c-.442.397-1.043.625-1.688.625-1.387 0-2.5-1.113-2.5-2.5s1.113-2.5 2.5-2.5z" id="magnifying-glass"></path>
|
293 |
-
|
294 |
-
<path d="M4 0c-1.66 0-3 1.34-3 3 0 2 3 5 3 5s3-3 3-5c0-1.66-1.34-3-3-3zm0 1c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2z" id="map-marker"></path>
|
295 |
-
|
296 |
-
<path d="M0 0v8h8v-2.375a.5.5 0 0 0 0-.219v-5.406h-8zm1 1h6v4h-1.5a.5.5 0 0 0-.094 0 .502.502 0 1 0 .094 1h1.5v1h-6v-6zm2.5 1c-.83 0-1.5.67-1.5 1.5 0 1 1.5 2.5 1.5 2.5s1.5-1.5 1.5-2.5c0-.83-.67-1.5-1.5-1.5zm0 1c.28 0 .5.22.5.5s-.22.5-.5.5-.5-.22-.5-.5.22-.5.5-.5z" id="map"></path>
|
297 |
-
|
298 |
-
<path d="M1 1v6h2v-6h-2zm4 0v6h2v-6h-2z" id="media-pause"></path>
|
299 |
-
|
300 |
-
<path d="M1 1v6l6-3-6-3z" id="media-play"></path>
|
301 |
-
|
302 |
-
<path d="M4 1c-1.657 0-3 1.343-3 3s1.343 3 3 3 3-1.343 3-3-1.343-3-3-3z" id="media-record"></path>
|
303 |
-
|
304 |
-
<path d="M4 1l-4 3 4 3v-6zm0 3l4 3v-6l-4 3z" id="media-skip-backward"></path>
|
305 |
-
|
306 |
-
<path d="M0 1v6l4-3-4-3zm4 3v3l4-3-4-3v3z" id="media-skip-forward"></path>
|
307 |
-
|
308 |
-
<path d="M0 1v6h2v-6h-2zm2 3l5 3v-6l-5 3z" id="media-step-backward"></path>
|
309 |
-
|
310 |
-
<path d="M0 1v6l5-3-5-3zm5 3v3h2v-6h-2v3z" id="media-step-forward"></path>
|
311 |
-
|
312 |
-
<path d="M1 1v6h6v-6h-6z" id="media-stop"></path>
|
313 |
-
|
314 |
-
<path d="M2 0v2h-2v4h2v2h4v-2h2v-4h-2v-2h-4z" id="medical-cross"></path>
|
315 |
-
|
316 |
-
<path d="M0 1v1h8v-1h-8zm0 2.969v1h8v-1h-8zm0 3v1h8v-1h-8z" id="menu"></path>
|
317 |
-
|
318 |
-
<path d="M2.906-.031a1 1 0 0 0-.125.031 1 1 0 0 0-.781 1v2a1 1 0 1 0 2 0v-2a1 1 0 0 0-1.094-1.031zm-2.563 2.031a.5.5 0 0 0-.344.5v.5c0 1.476 1.091 2.693 2.5 2.938v1.063h-.5c-.55 0-1 .45-1 1h4c0-.55-.45-1-1-1h-.5v-1.063c1.409-.244 2.5-1.461 2.5-2.938v-.5a.5.5 0 1 0-1 0v.5c0 1.109-.891 2-2 2s-2-.891-2-2v-.5a.5.5 0 0 0-.594-.5.5.5 0 0 0-.063 0z" transform="translate(1)" id="microphone"></path>
|
319 |
-
|
320 |
-
<path d="M0 3v2h8v-2h-8z" id="minus"></path>
|
321 |
-
|
322 |
-
<path d="M.344 0a.5.5 0 0 0-.344.5v5a.5.5 0 0 0 .5.5h2.5v1h-1c-.55 0-1 .45-1 1h6c0-.55-.45-1-1-1h-1v-1h2.5a.5.5 0 0 0 .5-.5v-5a.5.5 0 0 0-.5-.5h-7a.5.5 0 0 0-.094 0 .5.5 0 0 0-.063 0zm.656 1h6v4h-6v-4z" id="monitor"></path>
|
323 |
-
|
324 |
-
<path d="M2.719 0c-1.58.53-2.719 2.021-2.719 3.781 0 2.21 1.79 4 4 4 1.76 0 3.251-1.17 3.781-2.75-.4.14-.831.25-1.281.25-2.21 0-4-1.79-4-4 0-.44.079-.881.219-1.281z" id="moon"></path>
|
325 |
-
|
326 |
-
<path d="M3.5 0l-1.5 1.5h1v1.5h-1.5v-1l-1.5 1.5 1.5 1.5v-1h1.5v1.5h-1l1.5 1.5 1.5-1.5h-1v-1.5h1.5v1l1.5-1.5-1.5-1.5v1h-1.5v-1.5h1l-1.5-1.5z" id="move"></path>
|
327 |
-
|
328 |
-
<path d="M8 0c-5 0-6 1-6 1v4.094c-.154-.054-.327-.094-.5-.094-.828 0-1.5.672-1.5 1.5s.672 1.5 1.5 1.5 1.5-.672 1.5-1.5v-3.969c.732-.226 1.99-.438 4-.5v2.063c-.154-.054-.327-.094-.5-.094-.828 0-1.5.672-1.5 1.5s.672 1.5 1.5 1.5 1.5-.672 1.5-1.5v-5.5z" id="musical-note"></path>
|
329 |
-
|
330 |
-
<path d="M5 0c-.514 0-1.021.201-1.406.594l-2.781 2.719c-1.07 1.07-1.07 2.805 0 3.875 1.07 1.07 2.805 1.07 3.875 0l1.25-1.25-.688-.688-.906.875-.344.375c-.69.69-1.81.69-2.5 0-.682-.682-.668-1.778 0-2.469l2.781-2.719v-.031c.389-.395 1.037-.4 1.438 0 .388.381.378 1.006 0 1.406l-2.5 2.469c-.095.095-.28.095-.375 0-.095-.095-.095-.28 0-.375l.375-.344.594-.625-.688-.688-.875.875-.094.094c-.485.485-.485 1.265 0 1.75.485.485 1.265.485 1.75 0l2.5-2.438c.78-.78.785-2.041 0-2.813-.39-.39-.893-.594-1.406-.594z" id="paperclip"></path>
|
331 |
-
|
332 |
-
<path d="M6 0l-1 1 2 2 1-1-2-2zm-2 2l-4 4v2h2l4-4-2-2z" id="pencil"></path>
|
333 |
-
|
334 |
-
<path d="M5.5 0c-.51 0-.949.355-1.219.875.45.54.719 1.275.719 2.125 0 .29-.034.574-.094.844.18.11.374.156.594.156.83 0 1.5-.9 1.5-2s-.67-2-1.5-2zm-3 1c-.828 0-1.5.895-1.5 2s.672 2 1.5 2 1.5-.895 1.5-2-.672-2-1.5-2zm4.75 3.156c-.43.51-1.018.824-1.688.844.27.38.438.844.438 1.344v.656h2v-1.656c0-.52-.31-.968-.75-1.188zm-6.5 1c-.44.22-.75.668-.75 1.188v1.656h5v-1.656c0-.52-.31-.968-.75-1.188-.44.53-1.06.844-1.75.844s-1.31-.314-1.75-.844z" id="people"></path>
|
335 |
-
|
336 |
-
<path d="M4 0c-1.105 0-2 1.119-2 2.5s.895 2.5 2 2.5 2-1.119 2-2.5-.895-2.5-2-2.5zm-2.094 5c-1.07.04-1.906.92-1.906 2v1h8v-1c0-1.08-.836-1.96-1.906-2-.54.61-1.284 1-2.094 1-.81 0-1.554-.39-2.094-1z" id="person"></path>
|
337 |
-
|
338 |
-
<path d="M1.188 0c-.11 0-.188.077-.188.188v7.625c0 .11.077.188.188.188h4.625c.11 0 .188-.077.188-.188v-7.625c0-.11-.077-.188-.188-.188h-4.625zm.813 1h3v5h-3v-5zm1.5 5.5c.28 0 .5.22.5.5s-.22.5-.5.5-.5-.22-.5-.5.22-.5.5-.5z" id="phone"></path>
|
339 |
-
|
340 |
-
<path d="M3.5 0c-.97 0-1.839.391-2.469 1.031l2.969 2.969v-3.969c-.16-.03-.33-.031-.5-.031zm1.5 1.063v3.406l-2.719 2.719c.6.5 1.369.813 2.219.813 1.93 0 3.5-1.57 3.5-3.5 0-1.76-1.31-3.197-3-3.438zm-4.094 1.313c-.55.54-.906 1.285-.906 2.125 0 .95.435 1.804 1.125 2.344l2.156-2.125-2.375-2.344z" id="pie-chart"></path>
|
341 |
-
|
342 |
-
<path d="M1.344 0a.502.502 0 0 0 .156 1h.5v2h-1c-.55 0-1 .45-1 1h3v3l.438 1 .563-1v-3h3c0-.55-.45-1-1-1h-1v-2h.5a.5.5 0 1 0 0-1h-4a.5.5 0 0 0-.094 0 .502.502 0 0 0-.063 0z" id="pin"></path>
|
343 |
-
|
344 |
-
<path d="M4 0c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm-1 2l3 2-3 2v-4z" id="play-circle"></path>
|
345 |
-
|
346 |
-
<path d="M3 0v3h-3v2h3v3h2v-3h3v-2h-3v-3h-2z" id="plus"></path>
|
347 |
-
|
348 |
-
<path d="M3 0v4h1v-4h-1zm-1.281 1.438l-.375.313c-.803.64-1.344 1.634-1.344 2.75 0 1.929 1.571 3.5 3.5 3.5s3.5-1.571 3.5-3.5c0-1.116-.529-2.11-1.344-2.75l-.375-.313-.625.781.375.313c.585.46.969 1.165.969 1.969 0 1.391-1.109 2.5-2.5 2.5s-2.5-1.109-2.5-2.5c0-.804.361-1.509.938-1.969l.406-.313-.625-.781z" id="power-standby"></path>
|
349 |
-
|
350 |
-
<path d="M2 0v2h4v-2h-4zm-1.906 3c-.06 0-.094.034-.094.094v2.813c0 .06.034.094.094.094h.906v-2h6v2h.906c.06 0 .094-.034.094-.094v-2.813c0-.06-.034-.094-.094-.094h-7.813zm1.906 2v3h4v-3h-4z" id="print"></path>
|
351 |
-
|
352 |
-
<path d="M0 0v7h1v-7h-1zm7 0v7h1v-7h-1zm-5 1v1h2v-1h-2zm1 2v1h2v-1h-2zm1 2v1h2v-1h-2z" id="project"></path>
|
353 |
-
|
354 |
-
<path d="M3.25 0l-.469 1.531-.781 2.563-.031-.063-.094-.344h-1.875v1h1.156l.375 1.156.469 1.469.469-1.469.781-2.5.781 2.5.406 1.313.531-1.281.594-1.469.125.281h2.313v-1h-1.688l-.375-.719-.5-1-.406 1.031-.469 1.188-.844-2.656-.469-1.531z" id="pulse"></path>
|
355 |
-
|
356 |
-
<path d="M3 0c-.28 0-.539.101-.719.281-.18.18-.281.439-.281.719 0 .28.181.479.281.719.03.06.063.161.063.281h-2.344v6h2.344c0-.12-.011-.221-.031-.281-.11-.24-.313-.439-.313-.719 0-.28.101-.539.281-.719.18-.18.439-.281.719-.281.28 0 .539.101.719.281.18.18.281.439.281.719 0 .28-.181.479-.281.719-.03.06-.063.161-.063.281h2.344v-2.344c.12 0 .221.011.281.031.24.11.439.313.719.313.28 0 .539-.101.719-.281.18-.18.281-.439.281-.719 0-.28-.101-.539-.281-.719-.18-.18-.439-.281-.719-.281-.28 0-.479.181-.719.281-.06.03-.161.063-.281.063v-2.344h-2.344c0-.12.011-.221.031-.281.11-.24.313-.439.313-.719 0-.28-.101-.539-.281-.719-.18-.18-.439-.281-.719-.281z" id="puzzle-piece"></path>
|
357 |
-
|
358 |
-
<path d="M4.469 0c-.854 0-1.48.256-1.875.656s-.54.901-.594 1.281l1 .125c.036-.26.125-.497.313-.688.188-.19.491-.375 1.156-.375.664 0 1.019.163 1.219.344.199.181.281.405.281.656 0 .833-.313 1.063-.813 1.5-.5.438-1.188 1.083-1.188 2.25v.25h1v-.25c0-.833.344-1.063.844-1.5.5-.438 1.156-1.083 1.156-2.25 0-.479-.168-1.02-.594-1.406-.426-.387-1.071-.594-1.906-.594zm-.5 7v1h1v-1h-1z" id="question-mark"></path>
|
359 |
-
|
360 |
-
<path d="M4.5 0c-1.21 0-2.27.86-2.5 2-1.1 0-2 .9-2 2 0 .52.201 1.015.531 1.375.26-.22.599-.375.969-.375.2 0 .393.055.563.125.17-.64.748-1.125 1.438-1.125s1.268.485 1.438 1.125c.17-.07.362-.125.563-.125.63 0 1.155.388 1.375.938.64-.17 1.125-.747 1.125-1.438 0-.65-.42-1.29-1-1.5v-.5c0-1.38-1.12-2.5-2.5-2.5zm-1.156 5a.5.5 0 0 0-.344.5v2a.5.5 0 1 0 1 0v-2a.5.5 0 0 0-.594-.5.5.5 0 0 0-.063 0zm-2 1a.5.5 0 0 0-.344.5v1a.5.5 0 1 0 1 0v-1a.5.5 0 0 0-.594-.5.5.5 0 0 0-.063 0zm4 0a.5.5 0 0 0-.344.5v1a.5.5 0 1 0 1 0v-1a.5.5 0 0 0-.594-.5.5.5 0 0 0-.063 0z" id="rain"></path>
|
361 |
-
|
362 |
-
<path d="M6 0v1h-.5c-.354 0-.6.116-.813.375l-1.406 1.75-1.5-1.75v-.031c-.212-.236-.427-.344-.781-.344h-1v1h1.031v.031l1.625 1.906-1.625 2.031v.031h-1.031v1h1c.354 0 .6-.116.813-.375l1.531-1.906 1.625 1.906v.031c.212.236.427.344.781.344h.25v1l2-1.5-2-1.5v1h-.281v-.031l-1.75-2.063 1.5-1.875v-.031h.531v1l2-1.5-2-1.5z" id="random"></path>
|
363 |
-
|
364 |
-
<path d="M4 0c-2.201 0-4 1.799-4 4s1.799 4 4 4c1.104 0 2.092-.456 2.813-1.188l-.688-.688c-.54.548-1.289.875-2.125.875-1.659 0-3-1.341-3-3s1.341-3 3-3c.834 0 1.545.354 2.094.906l-1.094 1.094h3v-3l-1.188 1.188c-.731-.72-1.719-1.188-2.813-1.188z" id="reload"></path>
|
365 |
-
|
366 |
-
<path d="M4 0l1.656 1.656-4 4-1.656-1.656v4h4l-1.656-1.656 4-4 1.656 1.656v-4h-4z" id="resize-both"></path>
|
367 |
-
|
368 |
-
<path d="M3.5 0l-2.5 3h2v2h-2l2.5 3 2.5-3h-2v-2h2l-2.5-3z" id="resize-height"></path>
|
369 |
-
|
370 |
-
<path d="M3 1l-3 2.5 3 2.5v-2h2v2l3-2.5-3-2.5v2h-2v-2z" id="resize-width"></path>
|
371 |
-
|
372 |
-
<path d="M0 0v2c3.331 0 6 2.669 6 6h2c0-4.409-3.591-8-8-8zm0 3v2c1.67 0 3 1.33 3 3h2c0-2.75-2.25-5-5-5zm0 3v2h2c0-1.11-.89-2-2-2z" id="rss-alt"></path>
|
373 |
-
|
374 |
-
<path d="M1 0v1c3.32 0 6 2.68 6 6h1c0-3.86-3.14-7-7-7zm0 2v1c2.221 0 4 1.779 4 4h1c0-2.759-2.241-5-5-5zm0 2v1c1.109 0 2 .891 2 2h1c0-1.651-1.349-3-3-3zm0 2c-.552 0-1 .448-1 1s.448 1 1 1 1-.448 1-1-.448-1-1-1z" id="rss"></path>
|
375 |
-
|
376 |
-
<path d="M3 0c-.55 0-1 .45-1 1v5.5c0 .28-.22.5-.5.5s-.5-.22-.5-.5v-1.5h-1v2c0 .55.45 1 1 1h5c.55 0 1-.45 1-1v-3h-4v-2.5c0-.28.22-.5.5-.5s.5.22.5.5v1.5h4v-2c0-.55-.45-1-1-1h-4z" id="script"></path>
|
377 |
-
|
378 |
-
<path d="M.75 0c-.402 0-.75.348-.75.75v5.5c0 .402.348.75.75.75h4.5c.402 0 .75-.348.75-.75v-1.25h-1v1h-4v-5h2v-1h-2.25zm5.25 0v1c-2.05 0-3.704 1.544-3.938 3.531.213-.875.999-1.531 1.938-1.531h2v1l2-2-2-2z" id="share-boxed"></path>
|
379 |
-
|
380 |
-
<path d="M5 0v2c-4 0-5 2.05-5 5 .52-1.98 2-3 4-3h1v2l3-3.156-3-2.844z" id="share"></path>
|
381 |
-
|
382 |
-
<path d="M4 0l-.188.094-3.5 1.469-.313.125v.313c0 1.657.666 3.122 1.469 4.188.401.533.828.969 1.25 1.281.422.313.826.531 1.281.531.455 0 .86-.219 1.281-.531.422-.313.849-.749 1.25-1.281.803-1.065 1.469-2.53 1.469-4.188v-.313l-.313-.125-3.5-1.469-.188-.094zm0 1.094v5.906c-.045 0-.328-.069-.656-.313s-.714-.631-1.063-1.094c-.642-.851-1.137-2.025-1.219-3.281l2.938-1.219z" id="shield"></path>
|
383 |
-
|
384 |
-
<path d="M6 0v8h1v-8h-1zm-2 1v7h1v-7h-1zm-2 2v5h1v-5h-1zm-2 2v3h1v-3h-1z" id="signal"></path>
|
385 |
-
|
386 |
-
<path d="M3 0v1h-2l-1 1 1 1h2v5h1v-4h2l1-1-1-1h-2v-2h-1z" id="signpost"></path>
|
387 |
-
|
388 |
-
<path d="M2 0v6h-2l2.5 2 2.5-2h-2v-6h-1zm2 0v1h2v-1h-2zm0 2v1h3v-1h-3zm0 2v1h4v-1h-4z" id="sort-ascending"></path>
|
389 |
-
|
390 |
-
<path d="M2 0v6h-2l2.5 2 2.5-2h-2v-6h-1zm2 0v1h4v-1h-4zm0 2v1h3v-1h-3zm0 2v1h2v-1h-2z" id="sort-descending"></path>
|
391 |
-
|
392 |
-
<path d="M.75 0c-.402 0-.75.348-.75.75v5.5c0 .402.348.75.75.75h6.5c.402 0 .75-.348.75-.75v-5.5c0-.402-.348-.75-.75-.75h-6.5zm.25 1h1v1h-1v-1zm2 0h4v1h-4v-1zm-2 2h1v1h-1v-1zm2 0h4v1h-4v-1zm-2 2h1v1h-1v-1zm2 0h4v1h-4v-1z" id="spreadsheet"></path>
|
393 |
-
|
394 |
-
<path d="M4 0l-1 3h-3l2.5 2-1 3 2.5-2 2.5 2-1-3 2.5-2h-3l-1-3z" id="star"></path>
|
395 |
-
|
396 |
-
<path d="M4 0c-.276 0-.5.224-.5.5s.224.5.5.5.5-.224.5-.5-.224-.5-.5-.5zm-2.5 1c-.276 0-.5.224-.5.5s.224.5.5.5.5-.224.5-.5-.224-.5-.5-.5zm5 0c-.276 0-.5.224-.5.5s.224.5.5.5.5-.224.5-.5-.224-.5-.5-.5zm-2.5 1c-1.105 0-2 .895-2 2s.895 2 2 2 2-.895 2-2-.895-2-2-2zm-3.5 1.5c-.276 0-.5.224-.5.5s.224.5.5.5.5-.224.5-.5-.224-.5-.5-.5zm7 0c-.276 0-.5.224-.5.5s.224.5.5.5.5-.224.5-.5-.224-.5-.5-.5zm-6 2.5c-.276 0-.5.224-.5.5s.224.5.5.5.5-.224.5-.5-.224-.5-.5-.5zm5 0c-.276 0-.5.224-.5.5s.224.5.5.5.5-.224.5-.5-.224-.5-.5-.5zm-2.5 1c-.276 0-.5.224-.5.5s.224.5.5.5.5-.224.5-.5-.224-.5-.5-.5z" id="sun"></path>
|
397 |
-
|
398 |
-
<path d="M.344 0c-.18 0-.344.164-.344.344v7.313c0 .18.164.344.344.344h6.313c.18 0 .344-.164.344-.344v-7.313c0-.18-.164-.344-.344-.344h-6.313zm.656 1h5v5h-5v-5zm2.5 5.5c.28 0 .5.22.5.5s-.22.5-.5.5-.5-.22-.5-.5.22-.5.5-.5z" id="tablet"></path>
|
399 |
-
|
400 |
-
<path d="M0 0v3l5 5 3-3-5-5h-3zm2 1c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1z" id="tag"></path>
|
401 |
-
|
402 |
-
<path d="M0 1v2l3 3 1.5-1.5.5-.5-2-2-1-1h-2zm3.406 0l3 3-1.188 1.219.781.781 2-2-3-3h-1.594zm-1.906 1c.28 0 .5.22.5.5s-.22.5-.5.5-.5-.22-.5-.5.22-.5.5-.5z" id="tags"></path>
|
403 |
-
|
404 |
-
<path d="M4 0c-2.203 0-4 1.797-4 4 0 2.203 1.797 4 4 4 2.203 0 4-1.797 4-4 0-2.203-1.797-4-4-4zm0 1c1.663 0 3 1.337 3 3s-1.337 3-3 3-3-1.337-3-3 1.337-3 3-3zm0 1c-1.099 0-2 .901-2 2s.901 2 2 2 2-.901 2-2-.901-2-2-2zm0 1c.558 0 1 .442 1 1s-.442 1-1 1-1-.442-1-1 .442-1 1-1z" id="target"></path>
|
405 |
-
|
406 |
-
<path d="M0 0v7h7v-3.594l-1 1v1.594h-5v-5h3.594l1-1h-5.594zm7 0l-3 3-1-1-1 1 2 2 4-4-1-1z" id="task"></path>
|
407 |
-
|
408 |
-
<path d="M.094 0c-.06 0-.094.034-.094.094v7.813c0 .06.034.094.094.094h7.813c.06 0 .094-.034.094-.094v-7.813c0-.06-.034-.094-.094-.094h-7.813zm1.406.781l1.719 1.719-1.719 1.719-.719-.719 1-1-1-1 .719-.719zm2.5 2.219h3v1h-3v-1z" id="terminal"></path>
|
409 |
-
|
410 |
-
<path d="M0 0v2h.5c0-.55.45-1 1-1h1.5v5.5c0 .28-.22.5-.5.5h-.5v1h4v-1h-.5c-.28 0-.5-.22-.5-.5v-5.5h1.5c.55 0 1 .45 1 1h.5v-2h-8z" id="text"></path>
|
411 |
-
|
412 |
-
<path d="M0 0v4h1v-4h-1zm2 0v4.001c.28 0 .529.101.719.281.18.19 1.151 2.115 1.281 2.375.13.26.386.393.656.313.26-.08.393-.355.313-.625-.08-.26-.469-1.594-.469-1.844s.22-.5.5-.5h1.5c.28 0 .5-.22.5-.5l-1.031-3.188c-.08-.18-.259-.313-.469-.313h-3.5z" id="thumb-down"></path>
|
413 |
-
|
414 |
-
<path d="M4.438 0c-.19.021-.34.149-.438.344-.13.26-1.101 2.185-1.281 2.375-.19.18-.439.281-.719.281v4.001h3.5c.21 0 .389-.133.469-.313 0 0 1.031-2.908 1.031-3.188 0-.28-.22-.5-.5-.5h-1.5c-.28 0-.5-.25-.5-.5s.389-1.574.469-1.844c.08-.27-.053-.545-.313-.625l-.219-.031zm-4.438 3v4h1v-4h-1z" id="thumb-up"></path>
|
415 |
-
|
416 |
-
<path d="M2 0v1h1v.031c-1.697.241-3 1.707-3 3.469 0 1.929 1.571 3.5 3.5 3.5s3.5-1.571 3.5-3.5c0-.45-.086-.874-.219-1.25l-.938.344c.107.304.156.596.156.906 0 1.391-1.109 2.5-2.5 2.5s-2.5-1.109-2.5-2.5 1.109-2.5 2.5-2.5c.298 0 .585.051.875.156l.344-.938c-.221-.081-.471-.119-.719-.156v-.063h1v-1h-3zm5 1.125s-3.675 2.8-3.875 3c-.2.2-.2.519 0 .719.2.2.519.2.719 0 .2-.19 3.156-3.719 3.156-3.719z" id="timer"></path>
|
417 |
-
|
418 |
-
<path d="M6 0v1h-6v1h6v1l2-1.5-2-1.5zm-4 4l-2 1.5 2 1.5v-1h6v-1h-6v-1z" id="transfer"></path>
|
419 |
-
|
420 |
-
<path d="M3 0c-.55 0-1 .45-1 1h-1c-.55 0-1 .45-1 1h7c0-.55-.45-1-1-1h-1c0-.55-.45-1-1-1h-1zm-2 3v4.813c0 .11.077.188.188.188h4.625c.11 0 .188-.077.188-.188v-4.813h-1v3.5c0 .28-.22.5-.5.5s-.5-.22-.5-.5v-3.5h-1v3.5c0 .28-.22.5-.5.5s-.5-.22-.5-.5v-3.5h-1z" id="trash"></path>
|
421 |
-
|
422 |
-
<path d="M1 0v4c0 1.1 1.12 2 2.5 2h.5c1.1 0 2-.9 2-2v-4h-1v4c0 .55-.45 1-1 1s-1-.45-1-1v-4h-2zm-1 7v1h7v-1h-7z" id="underline"></path>
|
423 |
-
|
424 |
-
<path d="M.094 0c-.06 0-.094.034-.094.094v4.813c0 .06.034.094.094.094h1.813c.06 0 .094-.034.094-.094v-4.813c0-.06-.034-.094-.094-.094h-1.813zm6 0c-.06 0-.094.034-.094.094v4.813c0 .06.034.094.094.094h1.813c.06 0 .094-.034.094-.094v-4.813c0-.06-.034-.094-.094-.094h-1.813zm-3 2c-.06 0-.094.034-.094.094v2.813c0 .06.034.094.094.094h1.813c.06 0 .094-.034.094-.094v-2.813c0-.06-.034-.094-.094-.094h-1.813zm-3.094 4v1h8v-1h-8z" id="vertical-align-bottom"></path>
|
425 |
-
|
426 |
-
<path d="M.094 0c-.06 0-.094.034-.094.094v1.906h2v-1.906c0-.06-.034-.094-.094-.094h-1.813zm6 0c-.06 0-.094.034-.094.094v1.906h2v-1.906c0-.06-.034-.094-.094-.094h-1.813zm-3 1c-.06 0-.094.034-.094.094v.906h2v-.906c0-.06-.034-.094-.094-.094h-1.813zm-3.094 2v1h8v-1h-8zm0 2v1.906c0 .06.034.094.094.094h1.813c.06 0 .094-.034.094-.094v-1.906h-2zm3 0v.906c0 .06.034.094.094.094h1.813c.06 0 .094-.034.094-.094v-.906h-2zm3 0v1.906c0 .06.034.094.094.094h1.813c.06 0 .094-.034.094-.094v-1.906h-2z" id="vertical-align-center"></path>
|
427 |
-
|
428 |
-
<path d="M0 0v1h8v-1h-8zm.094 2c-.06 0-.094.034-.094.094v4.813c0 .06.034.094.094.094h1.813c.06 0 .094-.034.094-.094v-4.813c0-.06-.034-.094-.094-.094h-1.813zm3 0c-.06 0-.094.034-.094.094v2.813c0 .06.034.094.094.094h1.813c.06 0 .094-.034.094-.094v-2.813c0-.06-.034-.094-.094-.094h-1.813zm3 0c-.06 0-.094.034-.094.094v4.813c0 .06.034.094.094.094h1.813c.06 0 .094-.034.094-.094v-4.813c0-.06-.034-.094-.094-.094h-1.813z" id="vertical-align-top"></path>
|
429 |
-
|
430 |
-
<path d="M.5 1c-.28 0-.5.22-.5.5v4c0 .28.22.5.5.5h5c.28 0 .5-.22.5-.5v-1.5l1 1h1v-3h-1l-1 1v-1.5c0-.28-.22-.5-.5-.5h-5z" id="video"></path>
|
431 |
-
|
432 |
-
<path d="M3.344 0l-1.344 2h-2v4h2l1.344 2h.656v-8h-.656zm1.656 1v1c.152 0 .313.026.469.063h.031c.86.215 1.5.995 1.5 1.938 0 .942-.64 1.722-1.5 1.938-.166.041-.338.063-.5.063v1c.258 0 .516-.035.75-.094 1.3-.325 2.25-1.508 2.25-2.906 0-1.398-.95-2.581-2.25-2.906-.234-.059-.492-.094-.75-.094zm0 2v2l.25-.031c.433-.118.75-.507.75-.969 0-.446-.325-.819-.75-.938v-.031h-.031l-.219-.031z" id="volume-high"></path>
|
433 |
-
|
434 |
-
<path d="M4.344 0l-1.344 2h-2v4h2l1.344 2h.656v-8h-.656zm1.656 3v2l.25-.031c.433-.118.75-.507.75-.969 0-.446-.325-.819-.75-.938v-.031h-.031l-.219-.031z" id="volume-low"></path>
|
435 |
-
|
436 |
-
<path d="M5.344 0l-1.344 2h-2v4h2l1.344 2h.656v-8h-.656z" id="volume-off"></path>
|
437 |
-
|
438 |
-
<path d="M3.094 0c-.06 0-.105.044-.125.094l-2.938 6.813-.031.188v.813c0 .06.034.094.094.094h6.813c.06 0 .094-.034.094-.094v-.813l-.031-.188-2.938-6.813c-.02-.05-.065-.094-.125-.094h-.813zm-.094 3h1v2h-1v-2zm0 3h1v1h-1v-1z" id="warning"></path>
|
439 |
-
|
440 |
-
<path d="M3.75 0c-1.374 0-2.66.372-3.75 1.063l.531.875c.93-.59 2.033-.938 3.219-.938 1.2 0 2.323.31 3.25.906l.531-.813c-1.093-.703-2.401-1.094-3.781-1.094zm.031 3c-.795 0-1.531.227-2.156.625l.531.844c.475-.302 1.02-.469 1.625-.469.593 0 1.13.177 1.594.469l.531-.844c-.616-.388-1.338-.625-2.125-.625zm-.031 3c-.552 0-1 .448-1 1s.448 1 1 1 1-.448 1-1-.448-1-1-1z" id="wifi"></path>
|
441 |
-
|
442 |
-
<path d="M5.5 0c-1.38 0-2.5 1.12-2.5 2.5 0 .32.078.626.188.906l-2.906 2.875c-.39.39-.39 1.016 0 1.406.2.2.459.313.719.313.26 0 .519-.091.719-.281l2.875-2.875c.28.1.586.156.906.156 1.38 0 2.5-1.12 2.5-2.5 0-.16-.032-.297-.063-.438l-.938.938h-2v-2l.938-.938c-.14-.03-.277-.062-.438-.063zm-4.5 6.5c.28 0 .5.22.5.5s-.22.5-.5.5-.5-.22-.5-.5.22-.5.5-.5z" id="wrench"></path>
|
443 |
-
|
444 |
-
<path d="M1.406 0l-1.406 1.406.688.719 1.781 1.781-1.781 1.781-.688.719 1.406 1.406.719-.688 1.781-1.781 1.781 1.781.719.688 1.406-1.406-.688-.719-1.781-1.781 1.781-1.781.688-.719-1.406-1.406-.719.688-1.781 1.781-1.781-1.781-.719-.688z" id="x"></path>
|
445 |
-
|
446 |
-
<path d="M0 0l2.25 3h-2.25v1h3v1h-3v1h3v2h1v-2h3v-1h-3v-1h3v-1h-2.25l2.25-3h-1l-2.313 3h-.375l-2.313-3h-1z" id="yen"></path>
|
447 |
-
|
448 |
-
<path d="M3.5 0c-1.927 0-3.5 1.573-3.5 3.5s1.573 3.5 3.5 3.5c.592 0 1.166-.145 1.656-.406a1 1 0 0 0 .094.094l1.031 1.031a1.016 1.016 0 1 0 1.438-1.438l-1.031-1.031a1 1 0 0 0-.125-.094c.266-.493.438-1.059.438-1.656 0-1.927-1.573-3.5-3.5-3.5zm0 1c1.387 0 2.5 1.113 2.5 2.5 0 .587-.196 1.137-.531 1.563l-.031.031a1 1 0 0 0-.063.031 1 1 0 0 0-.281.281 1 1 0 0 0-.063.063c-.422.326-.953.531-1.531.531-1.387 0-2.5-1.113-2.5-2.5s1.113-2.5 2.5-2.5zm-.5 1v1h-1v1h1v1h1v-1h1v-1h-1v-1h-1z" id="zoom-in"></path>
|
449 |
-
|
450 |
-
<path d="M3.5 0c-1.927 0-3.5 1.573-3.5 3.5s1.573 3.5 3.5 3.5c.592 0 1.166-.145 1.656-.406a1 1 0 0 0 .094.094l1.031 1.031a1.016 1.016 0 1 0 1.438-1.438l-1.031-1.031a1 1 0 0 0-.125-.094c.266-.493.438-1.059.438-1.656 0-1.927-1.573-3.5-3.5-3.5zm0 1c1.387 0 2.5 1.113 2.5 2.5 0 .587-.196 1.137-.531 1.563l-.031.031a1 1 0 0 0-.063.031 1 1 0 0 0-.281.281 1 1 0 0 0-.063.063c-.422.326-.953.531-1.531.531-1.387 0-2.5-1.113-2.5-2.5s1.113-2.5 2.5-2.5zm-1.5 2v1h3v-1h-3z" id="zoom-out"></path>
|
451 |
-
</defs>
|
452 |
</svg>
|
1 |
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 8 8" style="display:none;">
|
2 |
+
<symbol viewBox="0 0 8 8" id="account-login">
|
3 |
+
<path d="M3 0v1h4v5h-4v1h5v-7h-5zm1 2v1h-4v1h4v1l2-1.5-2-1.5z" id="account-login"></path>
|
4 |
+
</symbol>
|
5 |
+
<defs>
|
6 |
+
|
7 |
+
|
8 |
+
<path d="M3 0v1h4v5h-4v1h5v-7h-5zm-1 2l-2 1.5 2 1.5v-1h4v-1h-4v-1z" id="account-logout"></path>
|
9 |
+
|
10 |
+
<path d="M3.5 1c-1.93 0-3.5 1.57-3.5 3.5 0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5v.5h-1l2 2 2-2h-1v-.5c0-1.93-1.57-3.5-3.5-3.5z" id="action-redo"></path>
|
11 |
+
|
12 |
+
<path d="M4.5 1c-1.93 0-3.5 1.57-3.5 3.5v.5h-1l2 2 2-2h-1v-.5c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5c0-1.93-1.57-3.5-3.5-3.5z" id="action-undo"></path>
|
13 |
+
|
14 |
+
<path d="M0 0v1h8v-1h-8zm1 2v1h6v-1h-6zm-1 2v1h8v-1h-8zm1 2v1h6v-1h-6z" id="align-center"></path>
|
15 |
+
|
16 |
+
<path d="M0 0v1h8v-1h-8zm0 2v1h6v-1h-6zm0 2v1h8v-1h-8zm0 2v1h6v-1h-6z" id="align-left"></path>
|
17 |
+
|
18 |
+
<path d="M0 0v1h8v-1h-8zm2 2v1h6v-1h-6zm-2 2v1h8v-1h-8zm2 2v1h6v-1h-6z" id="align-right"></path>
|
19 |
+
|
20 |
+
<path d="M4 0c-.69 0-1.336.19-1.906.5l3.219 2.344.719-2.25c-.59-.36-1.281-.594-2.031-.594zm-2.75 1.125c-.76.73-1.25 1.735-1.25 2.875 0 .25.022.489.063.719l3.094-2.219-1.906-1.375zm5.625.125l-1.219 3.75h2.219c.08-.32.125-.65.125-1 0-1.07-.435-2.03-1.125-2.75zm-4.719 3.188l-1.75 1.281c.55 1.13 1.595 1.989 2.875 2.219l-1.125-3.5zm1.563 1.563l.625 1.969c1.33-.11 2.454-.879 3.094-1.969h-3.719z" id="aperture"></path>
|
21 |
+
|
22 |
+
<path d="M3 0v5h-2l2.531 3 2.469-3h-2v-5h-1z" id="arrow-bottom"></path>
|
23 |
+
|
24 |
+
<path d="M4 0c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm-1 1h2v3h2l-3 3-3-3h2v-3z" id="arrow-circle-bottom"></path>
|
25 |
+
|
26 |
+
<path d="M4 0c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 1v2h3v2h-3v2l-3-3 3-3z" id="arrow-circle-left"></path>
|
27 |
+
|
28 |
+
<path d="M4 0c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 1l3 3-3 3v-2h-3v-2h3v-2z" id="arrow-circle-right"></path>
|
29 |
+
|
30 |
+
<path d="M4 0c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 1l3 3h-2v3h-2v-3h-2l3-3z" id="arrow-circle-top"></path>
|
31 |
+
|
32 |
+
<path d="M3 1l-3 2.531 3 2.469v-2h5v-1h-5v-2z" id="arrow-left"></path>
|
33 |
+
|
34 |
+
<path d="M5 1v2h-5v1h5v2l3-2.531-3-2.469z" id="arrow-right"></path>
|
35 |
+
|
36 |
+
<path d="M3 0v5h-2l3.031 3 2.969-3h-2v-5h-2z" id="arrow-thick-bottom"></path>
|
37 |
+
|
38 |
+
<path d="M3 1l-3 3.031 3 2.969v-2h5v-2h-5v-2z" id="arrow-thick-left"></path>
|
39 |
+
|
40 |
+
<path d="M5 1v2h-5v2h5v2l3-3.031-3-2.969z" id="arrow-thick-right"></path>
|
41 |
+
|
42 |
+
<path d="M3.969 0l-2.969 3h2v5h2v-5h2l-3.031-3z" id="arrow-thick-top"></path>
|
43 |
+
|
44 |
+
<path d="M3.469 0l-2.469 3h2v5h1v-5h2l-2.531-3z" id="arrow-top"></path>
|
45 |
+
|
46 |
+
<path d="M4 0v8h1v-8h-1zm-2 1v6h1v-6h-1zm4 1v4h1v-4h-1zm-6 1v2h1v-2h-1z" id="audio-spectrum"></path>
|
47 |
+
|
48 |
+
<path d="M1.188 1c-.734.722-1.188 1.748-1.188 2.844 0 1.095.454 2.09 1.188 2.813l.688-.719c-.546-.538-.875-1.269-.875-2.094s.329-1.587.875-2.125l-.688-.719zm5.625 0l-.688.719c.552.552.875 1.289.875 2.125 0 .836-.327 1.554-.875 2.094l.688.719c.732-.72 1.188-1.708 1.188-2.813 0-1.104-.459-2.115-1.188-2.844zm-4.219 1.406c-.362.362-.594.889-.594 1.438 0 .548.232 1.045.594 1.406l.688-.719c-.178-.178-.281-.416-.281-.688 0-.272.103-.54.281-.719l-.688-.719zm2.813 0l-.688.719c.183.183.281.434.281.719s-.099.505-.281.688l.688.719c.357-.357.594-.851.594-1.406 0-.555-.236-1.08-.594-1.438z" id="audio"></path>
|
49 |
+
|
50 |
+
<path d="M4 0c-1.105 0-2 .895-2 2s.895 2 2 2 2-.895 2-2-.895-2-2-2zm-1 4.813v3.188l1-1 1 1v-3.188c-.31.11-.65.188-1 .188s-.69-.077-1-.188z" id="badge"></path>
|
51 |
+
|
52 |
+
<path d="M4 0c-2.203 0-4 1.797-4 4 0 2.203 1.797 4 4 4 2.203 0 4-1.797 4-4 0-2.203-1.797-4-4-4zm0 1c.655 0 1.258.209 1.75.563l-4.188 4.188c-.353-.492-.563-1.095-.563-1.75 0-1.663 1.337-3 3-3zm2.438 1.25c.353.492.563 1.095.563 1.75 0 1.663-1.337 3-3 3-.655 0-1.258-.209-1.75-.563l4.188-4.188z" id="ban"></path>
|
53 |
+
|
54 |
+
<path d="M0 0v7h8v-1h-7v-6h-1zm5 0v5h2v-5h-2zm-3 2v3h2v-3h-2z" id="bar-chart"></path>
|
55 |
+
|
56 |
+
<path d="M3.969 0c-.127.011-.259.083-.344.188l-2.344 2.813h-1.281v1h1v3.656c0 .18.164.344.344.344h5.313c.18 0 .344-.164.344-.344v-3.656h1v-1h-1.281c-.274-.329-2.387-2.866-2.406-2.875-.105-.09-.216-.136-.344-.125zm.031 1.281l1.438 1.719h-2.875l1.438-1.719zm-1.5 3.719c.28 0 .5.22.5.5v1c0 .28-.22.5-.5.5s-.5-.22-.5-.5v-1c0-.28.22-.5.5-.5zm3 0c.28 0 .5.22.5.5v1c0 .28-.22.5-.5.5s-.5-.22-.5-.5v-1c0-.28.22-.5.5-.5z" id="basket"></path>
|
57 |
+
|
58 |
+
<path d="M.094 1c-.06 0-.094.034-.094.094v5.813c0 .06.034.094.094.094h6.813c.06 0 .094-.034.094-.094v-1.906h1v-2h-1v-1.906c0-.06-.034-.094-.094-.094h-6.813zm.906 1h5v4h-5v-4z" id="battery-empty"></path>
|
59 |
+
|
60 |
+
<path d="M.094 1c-.06 0-.094.034-.094.094v5.813c0 .06.034.094.094.094h6.813c.06 0 .094-.034.094-.094v-1.906h1v-2h-1v-1.906c0-.06-.034-.094-.094-.094h-6.813z" id="battery-full"></path>
|
61 |
+
|
62 |
+
<path d="M1.344 0a.502.502 0 0 0 .156 1h.5v1.406c-.088.172-1.194 2.313-1.656 3.094-.153.268-.344.612-.344 1.063 0 .383.139.764.406 1.031.26.26.643.406 1.031.406h5.125c.383 0 .764-.139 1.031-.406.26-.26.406-.643.406-1.031 0-.452-.194-.801-.344-1.063-.463-.78-1.568-2.922-1.656-3.094v-1.406h.5a.5.5 0 1 0 0-1h-5a.5.5 0 0 0-.094 0 .502.502 0 0 0-.063 0zm1.656 1h2v1.625l.063.094s.652 1.233 1.219 2.281h-4.563c.567-1.049 1.219-2.281 1.219-2.281l.063-.094v-1.625z" id="beaker"></path>
|
63 |
+
|
64 |
+
<path d="M4 0c-1.1 0-2 .9-2 2 0 1.04-.524 1.976-1.344 2.656-.42.34-.656.824-.656 1.344h8c0-.52-.236-1.004-.656-1.344-.82-.68-1.344-1.616-1.344-2.656 0-1.1-.9-2-2-2zm-1 7c0 .55.45 1 1 1s1-.45 1-1h-2z" id="bell"></path>
|
65 |
+
|
66 |
+
<path d="M2.5 0v2.5l-.75-.75-.75.75 1.5 1.5-1.5 1.5.75.75.75-.75v2.5h.5l3.5-2.5-2.25-1.531 2.25-1.469-3.5-2.5h-.5zm1 1.5l1.5 1-1.5 1v-2zm0 3l1.5 1-1.5 1v-2z" id="bluetooth"></path>
|
67 |
+
|
68 |
+
<path d="M0 0v1c.55 0 1 .45 1 1v4c0 .55-.45 1-1 1v1h5.5c1.38 0 2.5-1.12 2.5-2.5 0-1-.588-1.85-1.438-2.25.27-.34.438-.78.438-1.25 0-1.1-.9-2-2-2h-5zm3 1h1c.55 0 1 .45 1 1s-.45 1-1 1h-1v-2zm0 3h1.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-1.5v-3z" id="bold"></path>
|
69 |
+
|
70 |
+
<path d="M4 0l-3 5h2v3l3-5h-2v-3z" id="bolt"></path>
|
71 |
+
|
72 |
+
<path d="M1 0l-.188.031c-.39.08-.701.391-.781.781l-.031.188v5.5c0 .83.67 1.5 1.5 1.5h5.5v-1h-5.5c-.28 0-.5-.22-.5-.5s.22-.5.5-.5h5.5v-5.5c0-.28-.22-.5-.5-.5h-.5v3l-1-1-1 1v-3h-3z" id="book"></path>
|
73 |
+
|
74 |
+
<path d="M2 0v8l2-2 2 2v-8h-4z" id="bookmark"></path>
|
75 |
+
|
76 |
+
<path d="M0 0v1h8v-1h-8zm0 2v5.906c0 .06.034.094.094.094h7.813c.06 0 .094-.034.094-.094v-5.906h-2.969v1.031h-2.031v-1.031h-3z" id="box"></path>
|
77 |
+
|
78 |
+
<path d="M3 0c-.554 0-1 .458-1 1v1h-1.906c-.06 0-.094.034-.094.094v2.406c0 .28.22.5.5.5h7c.28 0 .5-.22.5-.5v-2.406c0-.06-.034-.094-.094-.094h-1.906v-1c0-.542-.446-1-1-1h-2zm0 1h2v1h-2v-1zm-3 4.906v2c0 .06.034.094.094.094h7.813c.06 0 .094-.034.094-.094v-2c-.16.05-.32.094-.5.094h-7c-.18 0-.34-.044-.5-.094z" id="briefcase"></path>
|
79 |
+
|
80 |
+
<path d="M4 0c-.619 0-1.159.262-1.5.688-.341.426-.5.986-.5 1.563 0 .692.165 1.245.25 1.75h-1.25v1h1.219c-.112.448-.37.964-1.063 1.656l-.156.125v1.219h6v-1h-4.906c.641-.729.982-1.397 1.125-2h1.781v-1h-1.719c-.078-.683-.281-1.242-.281-1.75 0-.394.115-.731.281-.938.166-.207.368-.313.719-.313.394 0 .609.109.75.25.141.141.25.356.25.75h1c0-.576-.165-1.102-.531-1.469-.366-.366-.893-.531-1.469-.531z" id="british-pound"></path>
|
81 |
+
|
82 |
+
<path d="M.344 0a.5.5 0 0 0-.344.5v7a.5.5 0 0 0 .5.5h7a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.5-.5h-7a.5.5 0 0 0-.094 0 .5.5 0 0 0-.063 0zm1.156 1c.28 0 .5.22.5.5s-.22.5-.5.5-.5-.22-.5-.5.22-.5.5-.5zm2 0h3c.28 0 .5.22.5.5s-.22.5-.5.5h-3c-.28 0-.5-.22-.5-.5s.22-.5.5-.5zm-2.5 2h6v4h-6v-4z" id="browser"></path>
|
83 |
+
|
84 |
+
<path d="M7.438.031l-.063.031-3.75 2.656-.125.156-.125.25c.719.229 1.271.781 1.5 1.5l.25-.125c.05-.02.126-.075.156-.125l2.656-3.75c.03-.04.04-.116 0-.156l-.406-.406-.094-.031zm-4.781 3.969c-.73 0-1.313.614-1.313 1.344 0 .99-.544 1.821-1.344 2.281.4.23.864.375 1.344.375 1.48 0 2.656-1.176 2.656-2.656 0-.73-.604-1.344-1.344-1.344z" id="brush"></path>
|
85 |
+
|
86 |
+
<path d="M3.5 0c-1.19 0-1.978 1.69-1.188 2.5l-.281.219-1.313-.656a.5.5 0 0 0-.344-.063.5.5 0 0 0-.094.938l1.156.563c-.09.156-.186.328-.25.5h-.688a.5.5 0 0 0-.094 0 .502.502 0 1 0 .094 1h.5c0 .227.023.445.063.656l-.781.406a.5.5 0 1 0 .438.875l.656-.344c.245.46.59.844 1 1.094.35-.19.625-.439.625-.719v-1.438a.5.5 0 0 0 0-.094v-.813a.5.5 0 0 0 0-.219c.045-.231.254-.406.5-.406.28 0 .5.22.5.5v.875a.5.5 0 0 0 0 .094v.063a.5.5 0 0 0 0 .094v1.344c0 .27.275.497.625.688.41-.245.755-.604 1-1.063l.656.344a.5.5 0 1 0 .438-.875l-.781-.406c.04-.211.063-.429.063-.656h.5a.5.5 0 1 0 0-1h-.688c-.064-.172-.16-.344-.25-.5l1.156-.563a.5.5 0 0 0-.313-.938.5.5 0 0 0-.125.063l-1.313.656-.281-.219c.78-.83.003-2.5-1.188-2.5z" id="bug"></path>
|
87 |
+
|
88 |
+
<path d="M6.094 0l-.094.031v5.969h.907c.06 0 .094-.034.094-.094v-5.813c0-.06-.034-.094-.094-.094h-.813zm-1.094.5l-2.906 1.469-.188.031h-1.813c-.06 0-.094.034-.094.094v1.813c0 .06.034.094.094.094h.906l1.031 2.719c.11.25.406.36.656.25.25-.11.36-.406.25-.656l-.719-1.781c.033-.136.136-.25.281-.25v-.031l2.5 1.25v-5z" id="bullhorn"></path>
|
89 |
+
|
90 |
+
<path d="M.094 0c-.06 0-.094.034-.094.094v7.813c0 .06.034.094.094.094h6.813c.06 0 .094-.034.094-.094v-7.813c0-.06-.034-.094-.094-.094h-6.813zm.906 1h5v2h-5v-2zm0 3h1v1h-1v-1zm2 0h1v1h-1v-1zm2 0h1v3h-1v-3zm-4 2h1v1h-1v-1zm2 0h1v1h-1v-1z" id="calculator"></path>
|
91 |
+
|
92 |
+
<path d="M0 0v2h7v-2h-7zm0 3v4.906c0 .06.034.094.094.094h6.813c.06 0 .094-.034.094-.094v-4.906h-7zm1 1h1v1h-1v-1zm2 0h1v1h-1v-1zm2 0h1v1h-1v-1zm-4 2h1v1h-1v-1zm2 0h1v1h-1v-1z" id="calendar"></path>
|
93 |
+
|
94 |
+
<path d="M4.094 0c-.06 0-.105.044-.125.094l-.938 1.813c-.02.05-.065.094-.125.094h-1.406c-.83 0-1.5.67-1.5 1.5v4.406c0 .06.034.094.094.094h7.813c.06 0 .094-.034.094-.094v-5.813c0-.06-.034-.094-.094-.094h-.813c-.06 0-.105-.044-.125-.094l-.938-1.813c-.02-.05-.065-.094-.125-.094h-1.813zm-2.594 3c.28 0 .5.22.5.5s-.22.5-.5.5-.5-.22-.5-.5.22-.5.5-.5zm3.5 0c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm0 1c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1z" id="camera-slr"></path>
|
95 |
+
|
96 |
+
<path d="M0 2l4 4 4-4h-8z" id="caret-bottom"></path>
|
97 |
+
|
98 |
+
<path d="M6 0l-4 4 4 4v-8z" id="caret-left"></path>
|
99 |
+
|
100 |
+
<path d="M2 0v8l4-4-4-4z" id="caret-right"></path>
|
101 |
+
|
102 |
+
<path d="M4 2l-4 4h8l-4-4z" id="caret-top"></path>
|
103 |
+
|
104 |
+
<path d="M.344 0a.502.502 0 0 0 .156 1h1.5l.094.25.406 1.25.406 1.25c.04.13.204.25.344.25h3.5c.14 0 .304-.12.344-.25l.813-2.531c.04-.12-.016-.219-.156-.219h-4.438l-.375-.719a.5.5 0 0 0-.438-.281h-2a.5.5 0 0 0-.094 0 .502.502 0 0 0-.063 0zm3.156 5c-.276 0-.5.224-.5.5s.224.5.5.5.5-.224.5-.5-.224-.5-.5-.5zm3 0c-.276 0-.5.224-.5.5s.224.5.5.5.5-.224.5-.5-.224-.5-.5-.5z" transform="translate(0 1)" id="cart"></path>
|
105 |
+
|
106 |
+
<path d="M0 0v5l1-1h1v-3h3v-1h-5zm3 2v4h4l1 1v-5h-5z" id="chat"></path>
|
107 |
+
|
108 |
+
<path d="M6.406 1l-.719.688-2.781 2.781-.781-.781-.719-.688-1.406 1.406.688.719 1.5 1.5.719.688.719-.688 3.5-3.5.688-.719-1.406-1.406z" id="check"></path>
|
109 |
+
|
110 |
+
<path d="M1.5 1l-1.5 1.5 4 4 4-4-1.5-1.5-2.5 2.5-2.5-2.5z" id="chevron-bottom"></path>
|
111 |
+
|
112 |
+
<path d="M5 0l-4 4 4 4 1.5-1.5-2.5-2.5 2.5-2.5-1.5-1.5z" id="chevron-left"></path>
|
113 |
+
|
114 |
+
<path d="M2.5 0l-1.5 1.5 2.5 2.5-2.5 2.5 1.5 1.5 4-4-4-4z" id="chevron-right"></path>
|
115 |
+
|
116 |
+
<path d="M4 1l-4 4 1.5 1.5 2.5-2.5 2.5 2.5 1.5-1.5-4-4z" id="chevron-top"></path>
|
117 |
+
|
118 |
+
<path d="M4 0c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm2 1.781l.719.719-3.219 3.219-1.719-1.719.719-.719 1 1 2.5-2.5z" id="circle-check"></path>
|
119 |
+
|
120 |
+
<path d="M4 0c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm-1.5 1.781l1.5 1.5 1.5-1.5.719.719-1.5 1.5 1.5 1.5-.719.719-1.5-1.5-1.5 1.5-.719-.719 1.5-1.5-1.5-1.5.719-.719z" id="circle-x"></path>
|
121 |
+
|
122 |
+
<path d="M3.5 0c-.28 0-.5.22-.5.5v.5h-.75c-.14 0-.25.11-.25.25v.75h3v-.75c0-.14-.11-.25-.25-.25h-.75v-.5c0-.28-.22-.5-.5-.5zm-3.25 1c-.14 0-.25.11-.25.25v6.5c0 .14.11.25.25.25h6.5c.14 0 .25-.11.25-.25v-6.5c0-.14-.11-.25-.25-.25h-.75v2h-5v-2h-.75z" id="clipboard"></path>
|
123 |
+
|
124 |
+
<path d="M4 0c-2.203 0-4 1.797-4 4 0 2.203 1.797 4 4 4 2.203 0 4-1.797 4-4 0-2.203-1.797-4-4-4zm0 1c1.663 0 3 1.337 3 3s-1.337 3-3 3-3-1.337-3-3 1.337-3 3-3zm-.5 1v2.219l.156.125.5.5.344.375.719-.719-.375-.344-.344-.344v-1.813h-1z" id="clock"></path>
|
125 |
+
|
126 |
+
<path d="M4.5 0c-1.21 0-2.27.86-2.5 2-1.1 0-2 .9-2 2 0 .37.111.7.281 1h2.719v-.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5v.5h1.906c.05-.16.094-.32.094-.5 0-.65-.42-1.29-1-1.5v-.5c0-1.38-1.12-2.5-2.5-2.5zm-.156 4a.5.5 0 0 0-.344.5v1.5h-1.5l2 2 2-2h-1.5v-1.5a.5.5 0 0 0-.594-.5.5.5 0 0 0-.063 0z" id="cloud-download"></path>
|
127 |
+
|
128 |
+
<path d="M4.5 0c-1.21 0-2.27.86-2.5 2-1.1 0-2 .9-2 2 0 .37.111.7.281 1h2.219l2-2 2 2h1.406c.05-.16.094-.32.094-.5 0-.65-.42-1.29-1-1.5v-.5c0-1.38-1.12-2.5-2.5-2.5zm0 4.5l-2.5 2.5h2v.5a.5.5 0 1 0 1 0v-.5h2l-2.5-2.5z" id="cloud-upload"></path>
|
129 |
+
|
130 |
+
<path d="M4.5 1c-1.21 0-2.27.86-2.5 2-1.1 0-2 .9-2 2s.9 2 2 2h4.5c.83 0 1.5-.67 1.5-1.5 0-.65-.42-1.29-1-1.5v-.5c0-1.38-1.12-2.5-2.5-2.5z" id="cloud"></path>
|
131 |
+
|
132 |
+
<path d="M2.5 0c-1.38 0-2.5 1.12-2.5 2.5 0 .39.09.743.25 1.063.3-.21.63-.379 1-.469.55-1.25 1.82-2.084 3.25-2.094-.46-.6-1.18-1-2-1zm2 2c-1.21 0-2.27.86-2.5 2-1.1 0-2 .9-2 2s.9 2 2 2h4.5c.83 0 1.5-.67 1.5-1.5 0-.65-.42-1.29-1-1.5v-.5c0-1.38-1.12-2.5-2.5-2.5z" id="cloudy"></path>
|
133 |
+
|
134 |
+
<path d="M5 1l-3 6h1l3-6h-1zm-4 1l-1 2 1 2h1l-1-2 1-2h-1zm5 0l1 2-1 2h1l1-2-1-2h-1z" id="code"></path>
|
135 |
+
|
136 |
+
<path d="M3.5 0l-.5 1.188-.281.125-1.188-.5-.719.719.5 1.188-.125.281-1.188.5v1l1.188.5.125.313-.5 1.156.719.719 1.188-.5.281.125.5 1.188h1l.5-1.188.281-.125 1.188.5.719-.719-.5-1.188.125-.281 1.188-.5v-1l-1.188-.5-.125-.281.469-1.188-.688-.719-1.188.5-.281-.125-.5-1.188h-1zm.5 2.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5-1.5-.67-1.5-1.5.67-1.5 1.5-1.5z" id="cog"></path>
|
137 |
+
|
138 |
+
<path d="M0 0v2h8v-2h-8zm2 3l2 2 2-2h-4zm-2 4v1h8v-1h-8z" id="collapse-down"></path>
|
139 |
+
|
140 |
+
<path d="M0 0v8h1v-8h-1zm6 0v8h2v-8h-2zm-1 2l-2 2 2 2v-4z" id="collapse-left"></path>
|
141 |
+
|
142 |
+
<path d="M0 0v8h2v-8h-2zm7 0v8h1v-8h-1zm-4 2v4l2-2-2-2z" id="collapse-right"></path>
|
143 |
+
|
144 |
+
<path d="M0 0v1h8v-1h-8zm4 3l-2 2h4l-2-2zm-4 3v2h8v-2h-8z" id="collapse-up"></path>
|
145 |
+
|
146 |
+
<path d="M1.5 0c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5h.5v1h-.5c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5v-.5h1v.5c0 .83.67 1.5 1.5 1.5s1.5-.67 1.5-1.5-.67-1.5-1.5-1.5h-.5v-1h.5c.83 0 1.5-.67 1.5-1.5s-.67-1.5-1.5-1.5-1.5.67-1.5 1.5v.5h-1v-.5c0-.83-.67-1.5-1.5-1.5zm0 1c.28 0 .5.22.5.5v.5h-.5c-.28 0-.5-.22-.5-.5s.22-.5.5-.5zm4 0c.28 0 .5.22.5.5s-.22.5-.5.5h-.5v-.5c0-.28.22-.5.5-.5zm-2.5 2h1v1h-1v-1zm-1.5 2h.5v.5c0 .28-.22.5-.5.5s-.5-.22-.5-.5.22-.5.5-.5zm3.5 0h.5c.28 0 .5.22.5.5s-.22.5-.5.5-.5-.22-.5-.5v-.5z" id="command"></path>
|
147 |
+
|
148 |
+
<path d="M.094 0c-.06 0-.094.034-.094.094v5.813c0 .06.034.094.094.094h5.906l2 2v-7.906c0-.06-.034-.094-.094-.094h-7.813z" id="comment-square"></path>
|
149 |
+
|
150 |
+
<path d="M4 0c-2.203 0-4 1.797-4 4 0 2.203 1.797 4 4 4 2.203 0 4-1.797 4-4 0-2.203-1.797-4-4-4zm0 1c1.663 0 3 1.337 3 3s-1.337 3-3 3-3-1.337-3-3 1.337-3 3-3zm2 1l-3 1-1 3 3-1 1-3zm-2 1.5c.28 0 .5.22.5.5s-.22.5-.5.5-.5-.22-.5-.5.22-.5.5-.5z" id="compass"></path>
|
151 |
+
|
152 |
+
<path d="M4 0c-2.203 0-4 1.797-4 4 0 2.203 1.797 4 4 4 2.203 0 4-1.797 4-4 0-2.203-1.797-4-4-4zm0 1c1.663 0 3 1.337 3 3s-1.337 3-3 3v-6z" id="contrast"></path>
|
153 |
+
|
154 |
+
<path d="M0 0v1h8v-1h-8zm0 2v1h5v-1h-5zm0 3v1h8v-1h-8zm0 2v1h6v-1h-6zm7.5 0c-.276 0-.5.224-.5.5s.224.5.5.5.5-.224.5-.5-.224-.5-.5-.5z" id="copywriting"></path>
|
155 |
+
|
156 |
+
<path d="M.25 1c-.14 0-.25.11-.25.25v.75h8v-.75c0-.14-.11-.25-.25-.25h-7.5zm-.25 2v3.75c0 .14.11.25.25.25h7.5c.14 0 .25-.11.25-.25v-3.75h-8zm1 2h1v1h-1v-1zm2 0h1v1h-1v-1z" id="credit-card"></path>
|
157 |
+
|
158 |
+
<path d="M1 0v1h-1v1h1v5h5v1h1v-1h1v-1h-1v-4.5l1-1-.5-.5-1 1h-4.5v-1h-1zm1 2h3.5l-3.5 3.5v-3.5zm4 .5v3.5h-3.5l3.5-3.5z" id="crop"></path>
|
159 |
+
|
160 |
+
<path d="M4 0c-2.203 0-4 1.797-4 4 0 2.203 1.797 4 4 4 2.203 0 4-1.797 4-4 0-2.203-1.797-4-4-4zm0 1c1.663 0 3 1.337 3 3s-1.337 3-3 3-3-1.337-3-3 1.337-3 3-3zm0 1c-.276 0-.5.224-.5.5s.224.5.5.5.5-.224.5-.5-.224-.5-.5-.5zm-1.656 1a.5.5 0 0 0-.188.844l.906.906-.063.25c0 .552.448 1 1 1s1-.448 1-1-.448-1-1-1l-.25.063-.906-.906a.5.5 0 0 0-.438-.156.5.5 0 0 0-.063 0zm3.156 0c-.276 0-.5.224-.5.5s.224.5.5.5.5-.224.5-.5-.224-.5-.5-.5z" id="dashboard"></path>
|
161 |
+
|
162 |
+
<path d="M3 0v3h-2l3 3 3-3h-2v-3h-2zm-3 7v1h8v-1h-8z" id="data-transfer-download"></path>
|
163 |
+
|
164 |
+
<path d="M0 0v1h8v-1h-8zm4 2l-3 3h2v3h2v-3h2l-3-3z" id="data-transfer-upload"></path>
|
165 |
+
|
166 |
+
<path d="M2 1l-2 3 2 3h6v-6h-6zm1.5.781l1.5 1.5 1.5-1.5.719.719-1.5 1.5 1.5 1.5-.719.719-1.5-1.5-1.5 1.5-.719-.719 1.5-1.5-1.5-1.5.719-.719z" id="delete"></path>
|
167 |
+
|
168 |
+
<path d="M4 1c-2.201 0-4 1.799-4 4h1c0-1.659 1.341-3 3-3s3 1.341 3 3h1c0-2.201-1.799-4-4-4zm-.594 2.094c-.82.25-1.406 1.006-1.406 1.906 0 1.1.9 2 2 2s2-.9 2-2c0-.9-.586-1.656-1.406-1.906l-.594.875-.594-.875z" id="dial"></path>
|
169 |
+
|
170 |
+
<path d="M0 0v8h7v-4h-4v-4h-3zm4 0v3h3l-3-3zm-3 2h1v1h-1v-1zm0 2h1v1h-1v-1zm0 2h4v1h-4v-1z" id="document"></path>
|
171 |
+
|
172 |
+
<path d="M3 0v1h-.75c-.686 0-1.25.564-1.25 1.25v.5c0 .678.437 1.242 1.094 1.406l2.563.656c.143.036.344.296.344.438v.5c0 .134-.116.25-.25.25h-2.5c-.116 0-.212-.037-.25-.063v-.938h-1v1c0 .342.203.627.438.781.234.155.518.219.813.219h.75v1h1v-1h.75c.686 0 1.25-.564 1.25-1.25v-.5c0-.678-.437-1.242-1.094-1.406l-2.563-.656c-.143-.036-.344-.296-.344-.438v-.5c0-.134.116-.25.25-.25h2.5c.116 0 .212.037.25.063v.938h1v-1c0-.342-.203-.627-.438-.781-.234-.155-.518-.219-.813-.219h-.75v-1h-1z" id="dollar"></path>
|
173 |
+
|
174 |
+
<path d="M0 1v6l3-3v-3h-3zm5 0v6l3-3v-3h-3z" id="double-quote-sans-left"></path>
|
175 |
+
|
176 |
+
<path d="M3 1l-3 3v3h3v-6zm5 0l-3 3v3h3v-6z" id="double-quote-sans-right"></path>
|
177 |
+
|
178 |
+
<path d="M3 1c-1.651 0-3 1.349-3 3v3h3v-3h-2c0-1.109.891-2 2-2v-1zm5 0c-1.651 0-3 1.349-3 3v3h3v-3h-2c0-1.109.891-2 2-2v-1z" id="double-quote-serif-left"></path>
|
179 |
+
|
180 |
+
<path d="M0 1v3h2c0 1.109-.891 2-2 2v1c1.651 0 3-1.349 3-3v-3h-3zm5 0v3h2c0 1.109-.891 2-2 2v1c1.651 0 3-1.349 3-3v-3h-3z" id="double-quote-serif-right"></path>
|
181 |
+
|
182 |
+
<path d="M4 0l-.344.344c-.11.11-2.656 2.685-2.656 4.875 0 1.65 1.35 3 3 3s3-1.35 3-3c0-2.19-2.546-4.765-2.656-4.875l-.344-.344zm-1.5 4.719c.28 0 .5.22.5.5 0 .55.45 1 1 1 .28 0 .5.22.5.5s-.22.5-.5.5c-1.1 0-2-.9-2-2 0-.28.22-.5.5-.5z" id="droplet"></path>
|
183 |
+
|
184 |
+
<path d="M4 0l-4 5h8l-4-5zm-4 6v2h8v-2h-8z" id="eject"></path>
|
185 |
+
|
186 |
+
<path d="M4 0l-3 3h6l-3-3zm-3 5l3 3 3-3h-6z" id="elevator"></path>
|
187 |
+
|
188 |
+
<path d="M0 3v2h2v-2h-2zm3 0v2h2v-2h-2zm3 0v2h2v-2h-2z" id="ellipses"></path>
|
189 |
+
|
190 |
+
<path d="M0 1v1l4 2 4-2v-1h-8zm0 2v4h8v-4l-4 2-4-2z" id="envelope-closed"></path>
|
191 |
+
|
192 |
+
<path d="M4 0l-4 2v6h8v-6l-4-2zm0 1.125l3 1.5v1.875l-3 1.5-3-1.5v-1.875l3-1.5zm-2 1.875v1l2 1 2-1v-1h-4z" id="envelope-open"></path>
|
193 |
+
|
194 |
+
<path d="M5 0c-1.858 0-3.398 1.278-3.844 3h-1.906l-.25 1h2c0 .345.073.68.156 1h-1.969l-.188 1h2.563c.696 1.185 1.969 2 3.438 2 .734 0 1.407-.215 2-.563v-1.219c-.531.479-1.225.781-2 .781-.888 0-1.671-.392-2.219-1h2.219l.156-1h-2.969c-.113-.317-.188-.643-.188-1h3.344l.156-1h-3.313c.414-1.16 1.507-2 2.813-2 .655 0 1.258.209 1.75.563l.156-1.063c-.57-.313-1.213-.5-1.906-.5z" id="euro"></path>
|
195 |
+
|
196 |
+
<path d="M0 0v1h7v-1h-7zm0 2v1h5v-1h-5zm0 2v1h8v-1h-8zm0 2v1h1v-1h-1zm2 0v1h1v-1h-1zm2 0v1h1v-1h-1z" id="excerpt"></path>
|
197 |
+
|
198 |
+
<path d="M0 0v1h8v-1h-8zm2 2l2 2 2-2h-4zm-2 4v2h8v-2h-8z" id="expand-down"></path>
|
199 |
+
|
200 |
+
<path d="M0 0v8h1v-8h-1zm6 0v8h2v-8h-2zm-4 2v4l2-2-2-2z" id="expand-left"></path>
|
201 |
+
|
202 |
+
<path d="M0 0v8h2v-8h-2zm7 0v8h1v-8h-1zm-1 2l-2 2 2 2v-4z" id="expand-right"></path>
|
203 |
+
|
204 |
+
<path d="M0 0v2h8v-2h-8zm4 4l-2 2h4l-2-2zm-4 3v1h8v-1h-8z" id="expand-up"></path>
|
205 |
+
|
206 |
+
<path d="M0 0v8h8v-2h-1v1h-6v-6h1v-1h-2zm4 0l1.5 1.5-2.5 2.5 1 1 2.5-2.5 1.5 1.5v-4h-4z" id="external-link"></path>
|
207 |
+
|
208 |
+
<path d="M4.031 1c-2.53 0-4.031 3-4.031 3s1.501 3 4.031 3c2.47 0 3.969-3 3.969-3s-1.499-3-3.969-3zm-.031 1c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm0 1c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1c0-.1-.032-.191-.063-.281-.08.16-.237.281-.438.281-.28 0-.5-.22-.5-.5 0-.2.121-.357.281-.438-.09-.03-.181-.063-.281-.063z" id="eye"></path>
|
209 |
+
|
210 |
+
<path d="M3.313 0a.5.5 0 0 0-.188.844l.625.625-3.594 3.656-.156.156v2.719h2.719l.125-.156 3.656-3.656.625.656a.5.5 0 1 0 .719-.688l-.938-.938.656-.656c.59-.58.59-1.545 0-2.125-.56-.57-1.555-.57-2.125 0l-.656.656-.938-.938a.5.5 0 0 0-.469-.156.5.5 0 0 0-.063 0zm1.156 2.188l1.313 1.313-3.156 3.156-1.281-1.313 3.125-3.156z" id="eyedropper"></path>
|
211 |
+
|
212 |
+
<path d="M0 0v8h7v-4h-4v-4h-3zm4 0v3h3l-3-3z" id="file"></path>
|
213 |
+
|
214 |
+
<path d="M2 0c1 2-2 3-2 5l2 3c-.98-1.98 2-3 2-5l-2-3zm3 3c1 2-2 3-2 5h3c.4 0 1-.5 1-2 0-2-2-3-2-3z" id="fire"></path>
|
215 |
+
|
216 |
+
<path d="M0 0v8h1v-8h-1zm2 0v4h2v1h4l-2-1.969 2-2.031h-3v-1h-3z" id="flag"></path>
|
217 |
+
|
218 |
+
<path d="M3.5 0l-1.5 3h2l-.656 2h-1.344l1 3 3-3h-1.5l1.5-3h-2l1-2h-1.5z" id="flash"></path>
|
219 |
+
|
220 |
+
<path d="M0 0v2h8v-1h-5v-1h-3zm0 3v4.5c0 .28.22.5.5.5h7c.28 0 .5-.22.5-.5v-4.5h-8z" id="folder"></path>
|
221 |
+
|
222 |
+
<path d="M1.5 0c-.828 0-1.5.672-1.5 1.5 0 .656.414 1.202 1 1.406v2.188c-.586.204-1 .75-1 1.406 0 .828.672 1.5 1.5 1.5s1.5-.672 1.5-1.5c0-.595-.341-1.101-.844-1.344.09-.09.205-.156.344-.156h2c.823 0 1.5-.677 1.5-1.5v-.594c.586-.204 1-.75 1-1.406 0-.828-.672-1.5-1.5-1.5s-1.5.672-1.5 1.5c0 .656.414 1.202 1 1.406v.594c0 .277-.223.5-.5.5h-2c-.171 0-.346.04-.5.094v-1.188c.586-.204 1-.75 1-1.406 0-.828-.672-1.5-1.5-1.5z" id="fork"></path>
|
223 |
+
|
224 |
+
<path d="M0 0v4l1.5-1.5 1.5 1.5 1-1-1.5-1.5 1.5-1.5h-4zm5 4l-1 1 1.5 1.5-1.5 1.5h4v-4l-1.5 1.5-1.5-1.5z" id="fullscreen-enter"></path>
|
225 |
+
|
226 |
+
<path d="M1 0l-1 1 1.5 1.5-1.5 1.5h4v-4l-1.5 1.5-1.5-1.5zm3 4v4l1.5-1.5 1.5 1.5 1-1-1.5-1.5 1.5-1.5h-4z" id="fullscreen-exit"></path>
|
227 |
+
|
228 |
+
<path d="M4 0c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 1c.333 0 .637.086.938.188-.214.197-.45.383-.406.563.04.18.688.13.688.5 0 .27-.425.346-.125.656.35.35-.636.978-.656 1.438-.03.83.841.969 1.531.969.424 0 .503.195.469.438-.546.758-1.438 1.25-2.438 1.25-.378 0-.729-.09-1.063-.219.224-.442-.313-1.344-.781-1.625-.226-.226-.689-.114-.969-.219-.092-.271-.178-.545-.188-.844.031-.05.081-.094.156-.094.19 0 .454.374.594.344.18-.04-.742-1.313-.313-1.563.2-.12.609.394.469-.156-.12-.51.366-.276.656-.406.26-.11.455-.414.125-.594l-.219-.188c.45-.27.972-.438 1.531-.438zm2.313 1.094c.184.222.323.481.438.75l-.188.219c-.29.27-.327-.212-.438-.313-.13-.11-.638.025-.688-.125-.077-.181.499-.418.875-.531z" id="globe"></path>
|
229 |
+
|
230 |
+
<path d="M7.031 0l-3.031 3-1-1-3 3.031 1 1 2-2.031 1 1 4-4-.969-1zm-7.031 7v1h8v-1h-8z" id="graph"></path>
|
231 |
+
|
232 |
+
<path d="M0 0v1h1v-1h-1zm2 0v1h1v-1h-1zm2 0v1h1v-1h-1zm2 0v1h1v-1h-1zm-6 2v1h1v-1h-1zm2 0v1h1v-1h-1zm2 0v1h1v-1h-1zm2 0v1h1v-1h-1zm-6 2v1h1v-1h-1zm2 0v1h1v-1h-1zm2 0v1h1v-1h-1zm2 0v1h1v-1h-1zm-6 2v1h1v-1h-1zm2 0v1h1v-1h-1zm2 0v1h1v-1h-1zm2 0v1h1v-1h-1z" id="grid-four-up"></path>
|
233 |
+
|
234 |
+
<path d="M0 0v2h2v-2h-2zm3 0v2h2v-2h-2zm3 0v2h2v-2h-2zm-6 3v2h2v-2h-2zm3 0v2h2v-2h-2zm3 0v2h2v-2h-2zm-6 3v2h2v-2h-2zm3 0v2h2v-2h-2zm3 0v2h2v-2h-2z" id="grid-three-up"></path>
|
235 |
+
|
236 |
+
<path d="M0 0v3h3v-3h-3zm5 0v3h3v-3h-3zm-5 5v3h3v-3h-3zm5 0v3h3v-3h-3z" id="grid-two-up"></path>
|
237 |
+
|
238 |
+
<path d="M.188 0c-.11 0-.188.077-.188.188v3.313c0 .28.22.5.5.5h6c.28 0 .5-.22.5-.5v-3.313c0-.11-.077-.188-.188-.188h-6.625zm-.188 4.906v2.906c0 .11.077.188.188.188h6.625c.11 0 .188-.077.188-.188v-2.906c-.16.05-.32.094-.5.094h-6c-.18 0-.34-.044-.5-.094zm5.5 1.094c.28 0 .5.22.5.5s-.22.5-.5.5-.5-.22-.5-.5.22-.5.5-.5z" id="hard-drive"></path>
|
239 |
+
|
240 |
+
<path d="M0 0v1h.5c.28 0 .5.22.5.5v4c0 .28-.22.5-.5.5h-.5v1h3v-1h-.5c-.28 0-.5-.22-.5-.5v-1.5h3v1.5c0 .28-.22.5-.5.5h-.5v1h3v-1h-.5c-.28 0-.5-.22-.5-.5v-4c0-.28.22-.5.5-.5h.5v-1h-3v1h.5c.28 0 .5.22.5.5v1.5h-3v-1.5c0-.28.22-.5.5-.5h.5v-1h-3z" id="header"></path>
|
241 |
+
|
242 |
+
<path d="M4 0c-1.651 0-3 1.349-3 3v1h-.5a.5.5 0 0 0-.5.5v2a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-3.5c0-1.109.891-2 2-2s2 .891 2 2v3.5a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-2a.5.5 0 0 0-.5-.5h-.5v-1c0-1.651-1.349-3-3-3z" id="headphones"></path>
|
243 |
+
|
244 |
+
<path d="M2 1c-.55 0-1.046.224-1.406.594-.37.36-.594.856-.594 1.406 0 .55.224 1.046.594 1.406l3.406 3.438 3.406-3.438c.37-.37.594-.856.594-1.406 0-.55-.224-1.046-.594-1.406-.36-.37-.856-.594-1.406-.594-.55 0-1.046.224-1.406.594-.37.36-.594.856-.594 1.406 0-.55-.224-1.046-.594-1.406-.36-.37-.856-.594-1.406-.594z" id="heart"></path>
|
245 |
+
|
246 |
+
<path d="M4 0l-4 3h1v4h2v-2h2v2h2v-4.031l1 .031-4-3z" id="home"></path>
|
247 |
+
|
248 |
+
<path d="M0 0v8h8v-8h-8zm1 1h6v3l-1-1-1 1 2 2v1h-1l-4-4-1 1v-3z" id="image"></path>
|
249 |
+
|
250 |
+
<path d="M.188 0c-.11 0-.188.077-.188.188v7.625c0 .11.077.188.188.188h7.625c.11 0 .188-.077.188-.188v-7.625c0-.11-.077-.188-.188-.188h-7.625zm.813 2h6v3h-1l-1 1h-2l-1-1h-1v-3z" id="inbox"></path>
|
251 |
+
|
252 |
+
<path d="M2 2c-1.31 0-2 1.01-2 2s.69 2 2 2c.79 0 1.42-.559 2-1.219.58.66 1.19 1.219 2 1.219 1.31 0 2-1.01 2-2s-.69-2-2-2c-.81 0-1.42.559-2 1.219-.57-.66-1.21-1.219-2-1.219zm0 1c.42 0 .884.47 1.344 1-.46.53-.924 1-1.344 1-.74 0-1-.54-1-1 0-.46.26-1 1-1zm4 0c.74 0 1 .54 1 1 0 .46-.26 1-1 1-.43 0-.894-.47-1.344-1 .45-.53.914-1 1.344-1z" id="infinity"></path>
|
253 |
+
|
254 |
+
<path d="M5 0c-.552 0-1 .448-1 1s.448 1 1 1 1-.448 1-1-.448-1-1-1zm-1.5 2.5c-.83 0-1.5.67-1.5 1.5h1c0-.28.22-.5.5-.5s.5.22.5.5-1 1.64-1 2.5c0 .86.67 1.5 1.5 1.5s1.5-.67 1.5-1.5h-1c0 .28-.22.5-.5.5s-.5-.22-.5-.5c0-.36 1-1.84 1-2.5 0-.81-.67-1.5-1.5-1.5z" id="info"></path>
|
255 |
+
|
256 |
+
<path d="M2 0v1h1.625l-.063.125-2 5-.344.875h-1.219v1h5v-1h-1.625l.063-.125 2-5 .344-.875h1.219v-1h-5z" id="italic"></path>
|
257 |
+
|
258 |
+
<path d="M0 0v1h8v-1h-8zm0 2v1h8v-1h-8zm0 2v1h8v-1h-8zm1 2v1h6v-1h-6z" id="justify-center"></path>
|
259 |
+
|
260 |
+
<path d="M0 0v1h8v-1h-8zm0 2v1h8v-1h-8zm0 2v1h8v-1h-8zm0 2v1h6v-1h-6z" id="justify-left"></path>
|
261 |
+
|
262 |
+
<path d="M0 0v1h8v-1h-8zm0 2v1h8v-1h-8zm0 2v1h8v-1h-8zm2 2v1h6v-1h-6z" id="justify-right"></path>
|
263 |
+
|
264 |
+
<path d="M5.5 0c-1.38 0-2.5 1.12-2.5 2.5 0 .16.033.297.063.438l-3.063 3.063v2h3v-2h2v-1l.063-.063c.14.03.277.063.438.063 1.38 0 2.5-1.12 2.5-2.5s-1.12-2.5-2.5-2.5zm.5 1c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1z" id="key"></path>
|
265 |
+
|
266 |
+
<path d="M1.344 0a.5.5 0 0 0-.344.5v3.5h-1v1.5c0 .28.22.5.5.5h7c.28 0 .5-.22.5-.5v-1.5h-1v-3.5a.5.5 0 0 0-.5-.5h-5a.5.5 0 0 0-.094 0 .5.5 0 0 0-.063 0zm.656 1h4v3h-1v1h-2v-1h-1v-3z" transform="translate(0 1)" id="laptop"></path>
|
267 |
+
|
268 |
+
<path d="M0 0v4h4v-4h-4zm5 2v3h-3v1h4v-4h-1zm2 2v3h-3v1h4v-4h-1z" id="layers"></path>
|
269 |
+
|
270 |
+
<path d="M3.406 0a.5.5 0 0 0-.125.063l-3 1.5a.5.5 0 1 0 .438.875l3-1.5a.5.5 0 0 0-.313-.938zm1 1.5a.5.5 0 0 0-.125.063l-4 2a.5.5 0 1 0 .438.875l4-2a.5.5 0 0 0-.313-.938zm0 2a.5.5 0 0 0-.125.063l-3 1.5a.5.5 0 0 0 .219.938h2a.502.502 0 0 0 .156-1l1.063-.563a.5.5 0 0 0-.313-.938zm-2.563 3.5a.502.502 0 0 0 .156 1h1a.5.5 0 1 0 0-1h-1a.5.5 0 0 0-.094 0 .502.502 0 0 0-.063 0z" transform="translate(1)" id="lightbulb"></path>
|
271 |
+
|
272 |
+
<path d="M2 0v1h-1v1h2v-2h-1zm3.875.031c-.184.01-.354.03-.531.094-.27.095-.531.25-.75.469l-.438.438a.5.5 0 1 0 .688.688l.438-.438c.101-.101.245-.173.375-.219.352-.126.78-.064 1.063.219.395.389.4 1.037 0 1.438l-1.5 1.5a.5.5 0 1 0 .688.688l1.5-1.5c.78-.78.785-2.041 0-2.813-.279-.279-.606-.452-.969-.531-.181-.039-.379-.041-.563-.031zm-3.594 2.906a.5.5 0 0 0-.188.156l-1.5 1.5c-.78.78-.785 2.041 0 2.813.557.557 1.355.722 2.063.469.27-.095.531-.25.75-.469l.438-.438a.5.5 0 1 0-.688-.688l-.438.438c-.101.101-.245.173-.375.219-.352.126-.78.064-1.063-.219-.395-.389-.4-1.037 0-1.438l1.5-1.5a.5.5 0 0 0-.438-.844.5.5 0 0 0-.063 0zm2.719 3.063v2h1v-1h1v-1h-2z" id="link-broken"></path>
|
273 |
+
|
274 |
+
<path d="M5.875.031c-.184.01-.354.03-.531.094-.27.095-.531.25-.75.469a.5.5 0 1 0 .688.688c.101-.101.245-.173.375-.219.352-.126.78-.064 1.063.219.395.389.4 1.037 0 1.438l-1.5 1.5c-.434.434-.799.483-1.063.469-.264-.015-.406-.125-.406-.125a.504.504 0 1 0-.5.875s.34.222.844.25c.504.028 1.197-.165 1.813-.781l1.5-1.5c.78-.78.785-2.041 0-2.813-.279-.279-.606-.452-.969-.531-.181-.039-.379-.041-.563-.031zm-2 2.313c-.501-.019-1.186.155-1.781.75l-1.5 1.5c-.78.78-.785 2.041 0 2.813.557.557 1.355.722 2.063.469.27-.095.531-.25.75-.469a.5.5 0 1 0-.688-.688c-.101.101-.245.173-.375.219-.352.126-.78.064-1.063-.219-.395-.389-.4-1.037 0-1.438l1.5-1.5c.405-.405.752-.448 1.031-.438.279.011.469.094.469.094a.5.5 0 1 0 .438-.875s-.343-.199-.844-.219z" id="link-intact"></path>
|
275 |
+
|
276 |
+
<path d="M0 0v3h3v-3h-3zm4 0v1h4v-1h-4zm0 2v1h3v-1h-3zm-4 2v3h3v-3h-3zm4 0v1h4v-1h-4zm0 2v1h3v-1h-3z" id="list-rich"></path>
|
277 |
+
|
278 |
+
<path d="M.5 0c-.276 0-.5.224-.5.5s.224.5.5.5.5-.224.5-.5-.224-.5-.5-.5zm1.5 0v1h6v-1h-6zm-1.5 2c-.276 0-.5.224-.5.5s.224.5.5.5.5-.224.5-.5-.224-.5-.5-.5zm1.5 0v1h6v-1h-6zm-1.5 2c-.276 0-.5.224-.5.5s.224.5.5.5.5-.224.5-.5-.224-.5-.5-.5zm1.5 0v1h6v-1h-6zm-1.5 2c-.276 0-.5.224-.5.5s.224.5.5.5.5-.224.5-.5-.224-.5-.5-.5zm1.5 0v1h6v-1h-6z" id="list"></path>
|
279 |
+
|
280 |
+
<path d="M8 0l-8 4 3 1 1 3 4-8z" id="location"></path>
|
281 |
+
|
282 |
+
<path d="M4 0c-1.099 0-2 .901-2 2v1h-1v4h6v-4h-1v-1c0-1.099-.901-2-2-2zm0 1c.561 0 1 .439 1 1v1h-2v-1c0-.561.439-1 1-1z" id="lock-locked"></path>
|
283 |
+
|
284 |
+
<path d="M4 0c-1.099 0-2 .901-2 2h1c0-.561.439-1 1-1 .561 0 1 .439 1 1v2h-4v4h6v-4h-1v-2c0-1.099-.901-2-2-2z" id="lock-unlocked"></path>
|
285 |
+
|
286 |
+
<path d="M4 1c-1.651 0-3 1.349-3 3h-1l1.5 2 1.5-2h-1c0-1.109.891-2 2-2v-1zm2.5 1l-1.5 2h1c0 1.109-.891 2-2 2v1c1.651 0 3-1.349 3-3h1l-1.5-2z" id="loop-circular"></path>
|
287 |
+
|
288 |
+
<path d="M1 0v2h1v-1h4v2h-1l1.5 2.5 1.5-2.5h-1v-3h-6zm.5 2.5l-1.5 2.5h1v3h6v-2h-1v1h-4v-2h1l-1.5-2.5z" id="loop-square"></path>
|
289 |
+
|
290 |
+
<path d="M6 0v1h-5c-.554 0-1 .446-1 1v1h1v-1h5v1l2-1.5-2-1.5zm-4 4l-2 1.5 2 1.5v-1h5c.542 0 1-.458 1-1v-1h-1v1h-5v-1z" id="loop"></path>
|
291 |
+
|
292 |
+
<path d="M3.5 0c-1.927 0-3.5 1.573-3.5 3.5s1.573 3.5 3.5 3.5c.592 0 1.166-.145 1.656-.406a1 1 0 0 0 .125.125l1 1a1.016 1.016 0 1 0 1.438-1.438l-1-1a1 1 0 0 0-.156-.125c.266-.493.438-1.059.438-1.656 0-1.927-1.573-3.5-3.5-3.5zm0 1c1.387 0 2.5 1.113 2.5 2.5 0 .661-.241 1.273-.656 1.719l-.031.031a1 1 0 0 0-.125.125c-.442.397-1.043.625-1.688.625-1.387 0-2.5-1.113-2.5-2.5s1.113-2.5 2.5-2.5z" id="magnifying-glass"></path>
|
293 |
+
|
294 |
+
<path d="M4 0c-1.66 0-3 1.34-3 3 0 2 3 5 3 5s3-3 3-5c0-1.66-1.34-3-3-3zm0 1c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2z" id="map-marker"></path>
|
295 |
+
|
296 |
+
<path d="M0 0v8h8v-2.375a.5.5 0 0 0 0-.219v-5.406h-8zm1 1h6v4h-1.5a.5.5 0 0 0-.094 0 .502.502 0 1 0 .094 1h1.5v1h-6v-6zm2.5 1c-.83 0-1.5.67-1.5 1.5 0 1 1.5 2.5 1.5 2.5s1.5-1.5 1.5-2.5c0-.83-.67-1.5-1.5-1.5zm0 1c.28 0 .5.22.5.5s-.22.5-.5.5-.5-.22-.5-.5.22-.5.5-.5z" id="map"></path>
|
297 |
+
|
298 |
+
<path d="M1 1v6h2v-6h-2zm4 0v6h2v-6h-2z" id="media-pause"></path>
|
299 |
+
|
300 |
+
<path d="M1 1v6l6-3-6-3z" id="media-play"></path>
|
301 |
+
|
302 |
+
<path d="M4 1c-1.657 0-3 1.343-3 3s1.343 3 3 3 3-1.343 3-3-1.343-3-3-3z" id="media-record"></path>
|
303 |
+
|
304 |
+
<path d="M4 1l-4 3 4 3v-6zm0 3l4 3v-6l-4 3z" id="media-skip-backward"></path>
|
305 |
+
|
306 |
+
<path d="M0 1v6l4-3-4-3zm4 3v3l4-3-4-3v3z" id="media-skip-forward"></path>
|
307 |
+
|
308 |
+
<path d="M0 1v6h2v-6h-2zm2 3l5 3v-6l-5 3z" id="media-step-backward"></path>
|
309 |
+
|
310 |
+
<path d="M0 1v6l5-3-5-3zm5 3v3h2v-6h-2v3z" id="media-step-forward"></path>
|
311 |
+
|
312 |
+
<path d="M1 1v6h6v-6h-6z" id="media-stop"></path>
|
313 |
+
|
314 |
+
<path d="M2 0v2h-2v4h2v2h4v-2h2v-4h-2v-2h-4z" id="medical-cross"></path>
|
315 |
+
|
316 |
+
<path d="M0 1v1h8v-1h-8zm0 2.969v1h8v-1h-8zm0 3v1h8v-1h-8z" id="menu"></path>
|
317 |
+
|
318 |
+
<path d="M2.906-.031a1 1 0 0 0-.125.031 1 1 0 0 0-.781 1v2a1 1 0 1 0 2 0v-2a1 1 0 0 0-1.094-1.031zm-2.563 2.031a.5.5 0 0 0-.344.5v.5c0 1.476 1.091 2.693 2.5 2.938v1.063h-.5c-.55 0-1 .45-1 1h4c0-.55-.45-1-1-1h-.5v-1.063c1.409-.244 2.5-1.461 2.5-2.938v-.5a.5.5 0 1 0-1 0v.5c0 1.109-.891 2-2 2s-2-.891-2-2v-.5a.5.5 0 0 0-.594-.5.5.5 0 0 0-.063 0z" transform="translate(1)" id="microphone"></path>
|
319 |
+
|
320 |
+
<path d="M0 3v2h8v-2h-8z" id="minus"></path>
|
321 |
+
|
322 |
+
<path d="M.344 0a.5.5 0 0 0-.344.5v5a.5.5 0 0 0 .5.5h2.5v1h-1c-.55 0-1 .45-1 1h6c0-.55-.45-1-1-1h-1v-1h2.5a.5.5 0 0 0 .5-.5v-5a.5.5 0 0 0-.5-.5h-7a.5.5 0 0 0-.094 0 .5.5 0 0 0-.063 0zm.656 1h6v4h-6v-4z" id="monitor"></path>
|
323 |
+
|
324 |
+
<path d="M2.719 0c-1.58.53-2.719 2.021-2.719 3.781 0 2.21 1.79 4 4 4 1.76 0 3.251-1.17 3.781-2.75-.4.14-.831.25-1.281.25-2.21 0-4-1.79-4-4 0-.44.079-.881.219-1.281z" id="moon"></path>
|
325 |
+
|
326 |
+
<path d="M3.5 0l-1.5 1.5h1v1.5h-1.5v-1l-1.5 1.5 1.5 1.5v-1h1.5v1.5h-1l1.5 1.5 1.5-1.5h-1v-1.5h1.5v1l1.5-1.5-1.5-1.5v1h-1.5v-1.5h1l-1.5-1.5z" id="move"></path>
|
327 |
+
|
328 |
+
<path d="M8 0c-5 0-6 1-6 1v4.094c-.154-.054-.327-.094-.5-.094-.828 0-1.5.672-1.5 1.5s.672 1.5 1.5 1.5 1.5-.672 1.5-1.5v-3.969c.732-.226 1.99-.438 4-.5v2.063c-.154-.054-.327-.094-.5-.094-.828 0-1.5.672-1.5 1.5s.672 1.5 1.5 1.5 1.5-.672 1.5-1.5v-5.5z" id="musical-note"></path>
|
329 |
+
|
330 |
+
<path d="M5 0c-.514 0-1.021.201-1.406.594l-2.781 2.719c-1.07 1.07-1.07 2.805 0 3.875 1.07 1.07 2.805 1.07 3.875 0l1.25-1.25-.688-.688-.906.875-.344.375c-.69.69-1.81.69-2.5 0-.682-.682-.668-1.778 0-2.469l2.781-2.719v-.031c.389-.395 1.037-.4 1.438 0 .388.381.378 1.006 0 1.406l-2.5 2.469c-.095.095-.28.095-.375 0-.095-.095-.095-.28 0-.375l.375-.344.594-.625-.688-.688-.875.875-.094.094c-.485.485-.485 1.265 0 1.75.485.485 1.265.485 1.75 0l2.5-2.438c.78-.78.785-2.041 0-2.813-.39-.39-.893-.594-1.406-.594z" id="paperclip"></path>
|
331 |
+
|
332 |
+
<path d="M6 0l-1 1 2 2 1-1-2-2zm-2 2l-4 4v2h2l4-4-2-2z" id="pencil"></path>
|
333 |
+
|
334 |
+
<path d="M5.5 0c-.51 0-.949.355-1.219.875.45.54.719 1.275.719 2.125 0 .29-.034.574-.094.844.18.11.374.156.594.156.83 0 1.5-.9 1.5-2s-.67-2-1.5-2zm-3 1c-.828 0-1.5.895-1.5 2s.672 2 1.5 2 1.5-.895 1.5-2-.672-2-1.5-2zm4.75 3.156c-.43.51-1.018.824-1.688.844.27.38.438.844.438 1.344v.656h2v-1.656c0-.52-.31-.968-.75-1.188zm-6.5 1c-.44.22-.75.668-.75 1.188v1.656h5v-1.656c0-.52-.31-.968-.75-1.188-.44.53-1.06.844-1.75.844s-1.31-.314-1.75-.844z" id="people"></path>
|
335 |
+
|
336 |
+
<path d="M4 0c-1.105 0-2 1.119-2 2.5s.895 2.5 2 2.5 2-1.119 2-2.5-.895-2.5-2-2.5zm-2.094 5c-1.07.04-1.906.92-1.906 2v1h8v-1c0-1.08-.836-1.96-1.906-2-.54.61-1.284 1-2.094 1-.81 0-1.554-.39-2.094-1z" id="person"></path>
|
337 |
+
|
338 |
+
<path d="M1.188 0c-.11 0-.188.077-.188.188v7.625c0 .11.077.188.188.188h4.625c.11 0 .188-.077.188-.188v-7.625c0-.11-.077-.188-.188-.188h-4.625zm.813 1h3v5h-3v-5zm1.5 5.5c.28 0 .5.22.5.5s-.22.5-.5.5-.5-.22-.5-.5.22-.5.5-.5z" id="phone"></path>
|
339 |
+
|
340 |
+
<path d="M3.5 0c-.97 0-1.839.391-2.469 1.031l2.969 2.969v-3.969c-.16-.03-.33-.031-.5-.031zm1.5 1.063v3.406l-2.719 2.719c.6.5 1.369.813 2.219.813 1.93 0 3.5-1.57 3.5-3.5 0-1.76-1.31-3.197-3-3.438zm-4.094 1.313c-.55.54-.906 1.285-.906 2.125 0 .95.435 1.804 1.125 2.344l2.156-2.125-2.375-2.344z" id="pie-chart"></path>
|
341 |
+
|
342 |
+
<path d="M1.344 0a.502.502 0 0 0 .156 1h.5v2h-1c-.55 0-1 .45-1 1h3v3l.438 1 .563-1v-3h3c0-.55-.45-1-1-1h-1v-2h.5a.5.5 0 1 0 0-1h-4a.5.5 0 0 0-.094 0 .502.502 0 0 0-.063 0z" id="pin"></path>
|
343 |
+
|
344 |
+
<path d="M4 0c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm-1 2l3 2-3 2v-4z" id="play-circle"></path>
|
345 |
+
|
346 |
+
<path d="M3 0v3h-3v2h3v3h2v-3h3v-2h-3v-3h-2z" id="plus"></path>
|
347 |
+
|
348 |
+
<path d="M3 0v4h1v-4h-1zm-1.281 1.438l-.375.313c-.803.64-1.344 1.634-1.344 2.75 0 1.929 1.571 3.5 3.5 3.5s3.5-1.571 3.5-3.5c0-1.116-.529-2.11-1.344-2.75l-.375-.313-.625.781.375.313c.585.46.969 1.165.969 1.969 0 1.391-1.109 2.5-2.5 2.5s-2.5-1.109-2.5-2.5c0-.804.361-1.509.938-1.969l.406-.313-.625-.781z" id="power-standby"></path>
|
349 |
+
|
350 |
+
<path d="M2 0v2h4v-2h-4zm-1.906 3c-.06 0-.094.034-.094.094v2.813c0 .06.034.094.094.094h.906v-2h6v2h.906c.06 0 .094-.034.094-.094v-2.813c0-.06-.034-.094-.094-.094h-7.813zm1.906 2v3h4v-3h-4z" id="print"></path>
|
351 |
+
|
352 |
+
<path d="M0 0v7h1v-7h-1zm7 0v7h1v-7h-1zm-5 1v1h2v-1h-2zm1 2v1h2v-1h-2zm1 2v1h2v-1h-2z" id="project"></path>
|
353 |
+
|
354 |
+
<path d="M3.25 0l-.469 1.531-.781 2.563-.031-.063-.094-.344h-1.875v1h1.156l.375 1.156.469 1.469.469-1.469.781-2.5.781 2.5.406 1.313.531-1.281.594-1.469.125.281h2.313v-1h-1.688l-.375-.719-.5-1-.406 1.031-.469 1.188-.844-2.656-.469-1.531z" id="pulse"></path>
|
355 |
+
|
356 |
+
<path d="M3 0c-.28 0-.539.101-.719.281-.18.18-.281.439-.281.719 0 .28.181.479.281.719.03.06.063.161.063.281h-2.344v6h2.344c0-.12-.011-.221-.031-.281-.11-.24-.313-.439-.313-.719 0-.28.101-.539.281-.719.18-.18.439-.281.719-.281.28 0 .539.101.719.281.18.18.281.439.281.719 0 .28-.181.479-.281.719-.03.06-.063.161-.063.281h2.344v-2.344c.12 0 .221.011.281.031.24.11.439.313.719.313.28 0 .539-.101.719-.281.18-.18.281-.439.281-.719 0-.28-.101-.539-.281-.719-.18-.18-.439-.281-.719-.281-.28 0-.479.181-.719.281-.06.03-.161.063-.281.063v-2.344h-2.344c0-.12.011-.221.031-.281.11-.24.313-.439.313-.719 0-.28-.101-.539-.281-.719-.18-.18-.439-.281-.719-.281z" id="puzzle-piece"></path>
|
357 |
+
|
358 |
+
<path d="M4.469 0c-.854 0-1.48.256-1.875.656s-.54.901-.594 1.281l1 .125c.036-.26.125-.497.313-.688.188-.19.491-.375 1.156-.375.664 0 1.019.163 1.219.344.199.181.281.405.281.656 0 .833-.313 1.063-.813 1.5-.5.438-1.188 1.083-1.188 2.25v.25h1v-.25c0-.833.344-1.063.844-1.5.5-.438 1.156-1.083 1.156-2.25 0-.479-.168-1.02-.594-1.406-.426-.387-1.071-.594-1.906-.594zm-.5 7v1h1v-1h-1z" id="question-mark"></path>
|
359 |
+
|
360 |
+
<path d="M4.5 0c-1.21 0-2.27.86-2.5 2-1.1 0-2 .9-2 2 0 .52.201 1.015.531 1.375.26-.22.599-.375.969-.375.2 0 .393.055.563.125.17-.64.748-1.125 1.438-1.125s1.268.485 1.438 1.125c.17-.07.362-.125.563-.125.63 0 1.155.388 1.375.938.64-.17 1.125-.747 1.125-1.438 0-.65-.42-1.29-1-1.5v-.5c0-1.38-1.12-2.5-2.5-2.5zm-1.156 5a.5.5 0 0 0-.344.5v2a.5.5 0 1 0 1 0v-2a.5.5 0 0 0-.594-.5.5.5 0 0 0-.063 0zm-2 1a.5.5 0 0 0-.344.5v1a.5.5 0 1 0 1 0v-1a.5.5 0 0 0-.594-.5.5.5 0 0 0-.063 0zm4 0a.5.5 0 0 0-.344.5v1a.5.5 0 1 0 1 0v-1a.5.5 0 0 0-.594-.5.5.5 0 0 0-.063 0z" id="rain"></path>
|
361 |
+
|
362 |
+
<path d="M6 0v1h-.5c-.354 0-.6.116-.813.375l-1.406 1.75-1.5-1.75v-.031c-.212-.236-.427-.344-.781-.344h-1v1h1.031v.031l1.625 1.906-1.625 2.031v.031h-1.031v1h1c.354 0 .6-.116.813-.375l1.531-1.906 1.625 1.906v.031c.212.236.427.344.781.344h.25v1l2-1.5-2-1.5v1h-.281v-.031l-1.75-2.063 1.5-1.875v-.031h.531v1l2-1.5-2-1.5z" id="random"></path>
|
363 |
+
|
364 |
+
<path d="M4 0c-2.201 0-4 1.799-4 4s1.799 4 4 4c1.104 0 2.092-.456 2.813-1.188l-.688-.688c-.54.548-1.289.875-2.125.875-1.659 0-3-1.341-3-3s1.341-3 3-3c.834 0 1.545.354 2.094.906l-1.094 1.094h3v-3l-1.188 1.188c-.731-.72-1.719-1.188-2.813-1.188z" id="reload"></path>
|
365 |
+
|
366 |
+
<path d="M4 0l1.656 1.656-4 4-1.656-1.656v4h4l-1.656-1.656 4-4 1.656 1.656v-4h-4z" id="resize-both"></path>
|
367 |
+
|
368 |
+
<path d="M3.5 0l-2.5 3h2v2h-2l2.5 3 2.5-3h-2v-2h2l-2.5-3z" id="resize-height"></path>
|
369 |
+
|
370 |
+
<path d="M3 1l-3 2.5 3 2.5v-2h2v2l3-2.5-3-2.5v2h-2v-2z" id="resize-width"></path>
|
371 |
+
|
372 |
+
<path d="M0 0v2c3.331 0 6 2.669 6 6h2c0-4.409-3.591-8-8-8zm0 3v2c1.67 0 3 1.33 3 3h2c0-2.75-2.25-5-5-5zm0 3v2h2c0-1.11-.89-2-2-2z" id="rss-alt"></path>
|
373 |
+
|
374 |
+
<path d="M1 0v1c3.32 0 6 2.68 6 6h1c0-3.86-3.14-7-7-7zm0 2v1c2.221 0 4 1.779 4 4h1c0-2.759-2.241-5-5-5zm0 2v1c1.109 0 2 .891 2 2h1c0-1.651-1.349-3-3-3zm0 2c-.552 0-1 .448-1 1s.448 1 1 1 1-.448 1-1-.448-1-1-1z" id="rss"></path>
|
375 |
+
|
376 |
+
<path d="M3 0c-.55 0-1 .45-1 1v5.5c0 .28-.22.5-.5.5s-.5-.22-.5-.5v-1.5h-1v2c0 .55.45 1 1 1h5c.55 0 1-.45 1-1v-3h-4v-2.5c0-.28.22-.5.5-.5s.5.22.5.5v1.5h4v-2c0-.55-.45-1-1-1h-4z" id="script"></path>
|
377 |
+
|
378 |
+
<path d="M.75 0c-.402 0-.75.348-.75.75v5.5c0 .402.348.75.75.75h4.5c.402 0 .75-.348.75-.75v-1.25h-1v1h-4v-5h2v-1h-2.25zm5.25 0v1c-2.05 0-3.704 1.544-3.938 3.531.213-.875.999-1.531 1.938-1.531h2v1l2-2-2-2z" id="share-boxed"></path>
|
379 |
+
|
380 |
+
<path d="M5 0v2c-4 0-5 2.05-5 5 .52-1.98 2-3 4-3h1v2l3-3.156-3-2.844z" id="share"></path>
|
381 |
+
|
382 |
+
<path d="M4 0l-.188.094-3.5 1.469-.313.125v.313c0 1.657.666 3.122 1.469 4.188.401.533.828.969 1.25 1.281.422.313.826.531 1.281.531.455 0 .86-.219 1.281-.531.422-.313.849-.749 1.25-1.281.803-1.065 1.469-2.53 1.469-4.188v-.313l-.313-.125-3.5-1.469-.188-.094zm0 1.094v5.906c-.045 0-.328-.069-.656-.313s-.714-.631-1.063-1.094c-.642-.851-1.137-2.025-1.219-3.281l2.938-1.219z" id="shield"></path>
|
383 |
+
|
384 |
+
<path d="M6 0v8h1v-8h-1zm-2 1v7h1v-7h-1zm-2 2v5h1v-5h-1zm-2 2v3h1v-3h-1z" id="signal"></path>
|
385 |
+
|
386 |
+
<path d="M3 0v1h-2l-1 1 1 1h2v5h1v-4h2l1-1-1-1h-2v-2h-1z" id="signpost"></path>
|
387 |
+
|
388 |
+
<path d="M2 0v6h-2l2.5 2 2.5-2h-2v-6h-1zm2 0v1h2v-1h-2zm0 2v1h3v-1h-3zm0 2v1h4v-1h-4z" id="sort-ascending"></path>
|
389 |
+
|
390 |
+
<path d="M2 0v6h-2l2.5 2 2.5-2h-2v-6h-1zm2 0v1h4v-1h-4zm0 2v1h3v-1h-3zm0 2v1h2v-1h-2z" id="sort-descending"></path>
|
391 |
+
|
392 |
+
<path d="M.75 0c-.402 0-.75.348-.75.75v5.5c0 .402.348.75.75.75h6.5c.402 0 .75-.348.75-.75v-5.5c0-.402-.348-.75-.75-.75h-6.5zm.25 1h1v1h-1v-1zm2 0h4v1h-4v-1zm-2 2h1v1h-1v-1zm2 0h4v1h-4v-1zm-2 2h1v1h-1v-1zm2 0h4v1h-4v-1z" id="spreadsheet"></path>
|
393 |
+
|
394 |
+
<path d="M4 0l-1 3h-3l2.5 2-1 3 2.5-2 2.5 2-1-3 2.5-2h-3l-1-3z" id="star"></path>
|
395 |
+
|
396 |
+
<path d="M4 0c-.276 0-.5.224-.5.5s.224.5.5.5.5-.224.5-.5-.224-.5-.5-.5zm-2.5 1c-.276 0-.5.224-.5.5s.224.5.5.5.5-.224.5-.5-.224-.5-.5-.5zm5 0c-.276 0-.5.224-.5.5s.224.5.5.5.5-.224.5-.5-.224-.5-.5-.5zm-2.5 1c-1.105 0-2 .895-2 2s.895 2 2 2 2-.895 2-2-.895-2-2-2zm-3.5 1.5c-.276 0-.5.224-.5.5s.224.5.5.5.5-.224.5-.5-.224-.5-.5-.5zm7 0c-.276 0-.5.224-.5.5s.224.5.5.5.5-.224.5-.5-.224-.5-.5-.5zm-6 2.5c-.276 0-.5.224-.5.5s.224.5.5.5.5-.224.5-.5-.224-.5-.5-.5zm5 0c-.276 0-.5.224-.5.5s.224.5.5.5.5-.224.5-.5-.224-.5-.5-.5zm-2.5 1c-.276 0-.5.224-.5.5s.224.5.5.5.5-.224.5-.5-.224-.5-.5-.5z" id="sun"></path>
|
397 |
+
|
398 |
+
<path d="M.344 0c-.18 0-.344.164-.344.344v7.313c0 .18.164.344.344.344h6.313c.18 0 .344-.164.344-.344v-7.313c0-.18-.164-.344-.344-.344h-6.313zm.656 1h5v5h-5v-5zm2.5 5.5c.28 0 .5.22.5.5s-.22.5-.5.5-.5-.22-.5-.5.22-.5.5-.5z" id="tablet"></path>
|
399 |
+
|
400 |
+
<path d="M0 0v3l5 5 3-3-5-5h-3zm2 1c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1z" id="tag"></path>
|
401 |
+
|
402 |
+
<path d="M0 1v2l3 3 1.5-1.5.5-.5-2-2-1-1h-2zm3.406 0l3 3-1.188 1.219.781.781 2-2-3-3h-1.594zm-1.906 1c.28 0 .5.22.5.5s-.22.5-.5.5-.5-.22-.5-.5.22-.5.5-.5z" id="tags"></path>
|
403 |
+
|
404 |
+
<path d="M4 0c-2.203 0-4 1.797-4 4 0 2.203 1.797 4 4 4 2.203 0 4-1.797 4-4 0-2.203-1.797-4-4-4zm0 1c1.663 0 3 1.337 3 3s-1.337 3-3 3-3-1.337-3-3 1.337-3 3-3zm0 1c-1.099 0-2 .901-2 2s.901 2 2 2 2-.901 2-2-.901-2-2-2zm0 1c.558 0 1 .442 1 1s-.442 1-1 1-1-.442-1-1 .442-1 1-1z" id="target"></path>
|
405 |
+
|
406 |
+
<path d="M0 0v7h7v-3.594l-1 1v1.594h-5v-5h3.594l1-1h-5.594zm7 0l-3 3-1-1-1 1 2 2 4-4-1-1z" id="task"></path>
|
407 |
+
|
408 |
+
<path d="M.094 0c-.06 0-.094.034-.094.094v7.813c0 .06.034.094.094.094h7.813c.06 0 .094-.034.094-.094v-7.813c0-.06-.034-.094-.094-.094h-7.813zm1.406.781l1.719 1.719-1.719 1.719-.719-.719 1-1-1-1 .719-.719zm2.5 2.219h3v1h-3v-1z" id="terminal"></path>
|
409 |
+
|
410 |
+
<path d="M0 0v2h.5c0-.55.45-1 1-1h1.5v5.5c0 .28-.22.5-.5.5h-.5v1h4v-1h-.5c-.28 0-.5-.22-.5-.5v-5.5h1.5c.55 0 1 .45 1 1h.5v-2h-8z" id="text"></path>
|
411 |
+
|
412 |
+
<path d="M0 0v4h1v-4h-1zm2 0v4.001c.28 0 .529.101.719.281.18.19 1.151 2.115 1.281 2.375.13.26.386.393.656.313.26-.08.393-.355.313-.625-.08-.26-.469-1.594-.469-1.844s.22-.5.5-.5h1.5c.28 0 .5-.22.5-.5l-1.031-3.188c-.08-.18-.259-.313-.469-.313h-3.5z" id="thumb-down"></path>
|
413 |
+
|
414 |
+
<path d="M4.438 0c-.19.021-.34.149-.438.344-.13.26-1.101 2.185-1.281 2.375-.19.18-.439.281-.719.281v4.001h3.5c.21 0 .389-.133.469-.313 0 0 1.031-2.908 1.031-3.188 0-.28-.22-.5-.5-.5h-1.5c-.28 0-.5-.25-.5-.5s.389-1.574.469-1.844c.08-.27-.053-.545-.313-.625l-.219-.031zm-4.438 3v4h1v-4h-1z" id="thumb-up"></path>
|
415 |
+
|
416 |
+
<path d="M2 0v1h1v.031c-1.697.241-3 1.707-3 3.469 0 1.929 1.571 3.5 3.5 3.5s3.5-1.571 3.5-3.5c0-.45-.086-.874-.219-1.25l-.938.344c.107.304.156.596.156.906 0 1.391-1.109 2.5-2.5 2.5s-2.5-1.109-2.5-2.5 1.109-2.5 2.5-2.5c.298 0 .585.051.875.156l.344-.938c-.221-.081-.471-.119-.719-.156v-.063h1v-1h-3zm5 1.125s-3.675 2.8-3.875 3c-.2.2-.2.519 0 .719.2.2.519.2.719 0 .2-.19 3.156-3.719 3.156-3.719z" id="timer"></path>
|
417 |
+
|
418 |
+
<path d="M6 0v1h-6v1h6v1l2-1.5-2-1.5zm-4 4l-2 1.5 2 1.5v-1h6v-1h-6v-1z" id="transfer"></path>
|
419 |
+
|
420 |
+
<path d="M3 0c-.55 0-1 .45-1 1h-1c-.55 0-1 .45-1 1h7c0-.55-.45-1-1-1h-1c0-.55-.45-1-1-1h-1zm-2 3v4.813c0 .11.077.188.188.188h4.625c.11 0 .188-.077.188-.188v-4.813h-1v3.5c0 .28-.22.5-.5.5s-.5-.22-.5-.5v-3.5h-1v3.5c0 .28-.22.5-.5.5s-.5-.22-.5-.5v-3.5h-1z" id="trash"></path>
|
421 |
+
|
422 |
+
<path d="M1 0v4c0 1.1 1.12 2 2.5 2h.5c1.1 0 2-.9 2-2v-4h-1v4c0 .55-.45 1-1 1s-1-.45-1-1v-4h-2zm-1 7v1h7v-1h-7z" id="underline"></path>
|
423 |
+
|
424 |
+
<path d="M.094 0c-.06 0-.094.034-.094.094v4.813c0 .06.034.094.094.094h1.813c.06 0 .094-.034.094-.094v-4.813c0-.06-.034-.094-.094-.094h-1.813zm6 0c-.06 0-.094.034-.094.094v4.813c0 .06.034.094.094.094h1.813c.06 0 .094-.034.094-.094v-4.813c0-.06-.034-.094-.094-.094h-1.813zm-3 2c-.06 0-.094.034-.094.094v2.813c0 .06.034.094.094.094h1.813c.06 0 .094-.034.094-.094v-2.813c0-.06-.034-.094-.094-.094h-1.813zm-3.094 4v1h8v-1h-8z" id="vertical-align-bottom"></path>
|
425 |
+
|
426 |
+
<path d="M.094 0c-.06 0-.094.034-.094.094v1.906h2v-1.906c0-.06-.034-.094-.094-.094h-1.813zm6 0c-.06 0-.094.034-.094.094v1.906h2v-1.906c0-.06-.034-.094-.094-.094h-1.813zm-3 1c-.06 0-.094.034-.094.094v.906h2v-.906c0-.06-.034-.094-.094-.094h-1.813zm-3.094 2v1h8v-1h-8zm0 2v1.906c0 .06.034.094.094.094h1.813c.06 0 .094-.034.094-.094v-1.906h-2zm3 0v.906c0 .06.034.094.094.094h1.813c.06 0 .094-.034.094-.094v-.906h-2zm3 0v1.906c0 .06.034.094.094.094h1.813c.06 0 .094-.034.094-.094v-1.906h-2z" id="vertical-align-center"></path>
|
427 |
+
|
428 |
+
<path d="M0 0v1h8v-1h-8zm.094 2c-.06 0-.094.034-.094.094v4.813c0 .06.034.094.094.094h1.813c.06 0 .094-.034.094-.094v-4.813c0-.06-.034-.094-.094-.094h-1.813zm3 0c-.06 0-.094.034-.094.094v2.813c0 .06.034.094.094.094h1.813c.06 0 .094-.034.094-.094v-2.813c0-.06-.034-.094-.094-.094h-1.813zm3 0c-.06 0-.094.034-.094.094v4.813c0 .06.034.094.094.094h1.813c.06 0 .094-.034.094-.094v-4.813c0-.06-.034-.094-.094-.094h-1.813z" id="vertical-align-top"></path>
|
429 |
+
|
430 |
+
<path d="M.5 1c-.28 0-.5.22-.5.5v4c0 .28.22.5.5.5h5c.28 0 .5-.22.5-.5v-1.5l1 1h1v-3h-1l-1 1v-1.5c0-.28-.22-.5-.5-.5h-5z" id="video"></path>
|
431 |
+
|
432 |
+
<path d="M3.344 0l-1.344 2h-2v4h2l1.344 2h.656v-8h-.656zm1.656 1v1c.152 0 .313.026.469.063h.031c.86.215 1.5.995 1.5 1.938 0 .942-.64 1.722-1.5 1.938-.166.041-.338.063-.5.063v1c.258 0 .516-.035.75-.094 1.3-.325 2.25-1.508 2.25-2.906 0-1.398-.95-2.581-2.25-2.906-.234-.059-.492-.094-.75-.094zm0 2v2l.25-.031c.433-.118.75-.507.75-.969 0-.446-.325-.819-.75-.938v-.031h-.031l-.219-.031z" id="volume-high"></path>
|
433 |
+
|
434 |
+
<path d="M4.344 0l-1.344 2h-2v4h2l1.344 2h.656v-8h-.656zm1.656 3v2l.25-.031c.433-.118.75-.507.75-.969 0-.446-.325-.819-.75-.938v-.031h-.031l-.219-.031z" id="volume-low"></path>
|
435 |
+
|
436 |
+
<path d="M5.344 0l-1.344 2h-2v4h2l1.344 2h.656v-8h-.656z" id="volume-off"></path>
|
437 |
+
|
438 |
+
<path d="M3.094 0c-.06 0-.105.044-.125.094l-2.938 6.813-.031.188v.813c0 .06.034.094.094.094h6.813c.06 0 .094-.034.094-.094v-.813l-.031-.188-2.938-6.813c-.02-.05-.065-.094-.125-.094h-.813zm-.094 3h1v2h-1v-2zm0 3h1v1h-1v-1z" id="warning"></path>
|
439 |
+
|
440 |
+
<path d="M3.75 0c-1.374 0-2.66.372-3.75 1.063l.531.875c.93-.59 2.033-.938 3.219-.938 1.2 0 2.323.31 3.25.906l.531-.813c-1.093-.703-2.401-1.094-3.781-1.094zm.031 3c-.795 0-1.531.227-2.156.625l.531.844c.475-.302 1.02-.469 1.625-.469.593 0 1.13.177 1.594.469l.531-.844c-.616-.388-1.338-.625-2.125-.625zm-.031 3c-.552 0-1 .448-1 1s.448 1 1 1 1-.448 1-1-.448-1-1-1z" id="wifi"></path>
|
441 |
+
|
442 |
+
<path d="M5.5 0c-1.38 0-2.5 1.12-2.5 2.5 0 .32.078.626.188.906l-2.906 2.875c-.39.39-.39 1.016 0 1.406.2.2.459.313.719.313.26 0 .519-.091.719-.281l2.875-2.875c.28.1.586.156.906.156 1.38 0 2.5-1.12 2.5-2.5 0-.16-.032-.297-.063-.438l-.938.938h-2v-2l.938-.938c-.14-.03-.277-.062-.438-.063zm-4.5 6.5c.28 0 .5.22.5.5s-.22.5-.5.5-.5-.22-.5-.5.22-.5.5-.5z" id="wrench"></path>
|
443 |
+
|
444 |
+
<path d="M1.406 0l-1.406 1.406.688.719 1.781 1.781-1.781 1.781-.688.719 1.406 1.406.719-.688 1.781-1.781 1.781 1.781.719.688 1.406-1.406-.688-.719-1.781-1.781 1.781-1.781.688-.719-1.406-1.406-.719.688-1.781 1.781-1.781-1.781-.719-.688z" id="x"></path>
|
445 |
+
|
446 |
+
<path d="M0 0l2.25 3h-2.25v1h3v1h-3v1h3v2h1v-2h3v-1h-3v-1h3v-1h-2.25l2.25-3h-1l-2.313 3h-.375l-2.313-3h-1z" id="yen"></path>
|
447 |
+
|
448 |
+
<path d="M3.5 0c-1.927 0-3.5 1.573-3.5 3.5s1.573 3.5 3.5 3.5c.592 0 1.166-.145 1.656-.406a1 1 0 0 0 .094.094l1.031 1.031a1.016 1.016 0 1 0 1.438-1.438l-1.031-1.031a1 1 0 0 0-.125-.094c.266-.493.438-1.059.438-1.656 0-1.927-1.573-3.5-3.5-3.5zm0 1c1.387 0 2.5 1.113 2.5 2.5 0 .587-.196 1.137-.531 1.563l-.031.031a1 1 0 0 0-.063.031 1 1 0 0 0-.281.281 1 1 0 0 0-.063.063c-.422.326-.953.531-1.531.531-1.387 0-2.5-1.113-2.5-2.5s1.113-2.5 2.5-2.5zm-.5 1v1h-1v1h1v1h1v-1h1v-1h-1v-1h-1z" id="zoom-in"></path>
|
449 |
+
|
450 |
+
<path d="M3.5 0c-1.927 0-3.5 1.573-3.5 3.5s1.573 3.5 3.5 3.5c.592 0 1.166-.145 1.656-.406a1 1 0 0 0 .094.094l1.031 1.031a1.016 1.016 0 1 0 1.438-1.438l-1.031-1.031a1 1 0 0 0-.125-.094c.266-.493.438-1.059.438-1.656 0-1.927-1.573-3.5-3.5-3.5zm0 1c1.387 0 2.5 1.113 2.5 2.5 0 .587-.196 1.137-.531 1.563l-.031.031a1 1 0 0 0-.063.031 1 1 0 0 0-.281.281 1 1 0 0 0-.063.063c-.422.326-.953.531-1.531.531-1.387 0-2.5-1.113-2.5-2.5s1.113-2.5 2.5-2.5zm-1.5 2v1h3v-1h-3z" id="zoom-out"></path>
|
451 |
+
</defs>
|
452 |
</svg>
|
images/pencil.svg
CHANGED
@@ -1,6 +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>
|
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>
|
images/wfu-media-external.svg
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
|
2 |
-
<path d="M 4.3339844 4 L 3.2246094 5.6660156 L 1.8339844 5.6660156 C 1.3756511 5.6660156 1 6.0416666 1 6.5 L 1 12.333984 C 1 12.792318 1.3756511 13.166016 1.8339844 13.166016 L 10.166016 13.166016 C 10.62435 13.166016 11 12.792318 11 12.333984 L 11 12.154297 L 8.0644531 9.1972656 C 7.9636343 10.253489 7.0824936 11.083984 6 11.083984 C 4.8500001 11.083984 3.9160156 10.149999 3.9160156 9 C 3.9160156 7.8499995 4.8500001 6.9160156 6 6.9160156 C 7.1325933 6.9160156 8.05046 7.8232465 8.078125 8.9492188 L 10.898438 6.125 C 10.759609 5.8566437 10.487512 5.6660156 10.166016 5.6660156 L 8.7753906 5.6660156 L 7.6660156 4 L 4.3339844 4 z M 15.845703 8.1660156 L 13.349609 10.666016 L 14.333984 10.666016 L 14.333984 14.875 C 14.200651 14.85 14.057682 14.833984 13.916016 14.833984 C 12.766017 14.833984 11.833984 15.766016 11.833984 16.916016 C 11.833984 18.066016 12.766017 19 13.916016 19 C 15.066016 19 16 18.066016 16 16.916016 L 16 8.1660156 L 15.845703 8.1660156 z M 8.5 14 L 8.5 14.875 C 8.3666668 14.85 8.2256512 14.833984 8.0839844 14.833984 C 6.9339844 14.833984 6 15.766016 6 16.916016 C 6 18.066016 6.9339844 19 8.0839844 19 C 9.2339842 19 10.166016 18.066016 10.166016 16.916016 L 10.166016 14 L 8.5 14 z " />
|
3 |
-
<path d="m 11.000408,0.99844212 8.000001,0 0,8.00000038 -2,-1 0,-3.0800003 -5.600001,5.5899988 -1.4099996,-1.4099985 6.0900006,-6.1000003 -4.080001,0 z" />
|
4 |
</svg>
|
1 |
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
|
2 |
+
<path d="M 4.3339844 4 L 3.2246094 5.6660156 L 1.8339844 5.6660156 C 1.3756511 5.6660156 1 6.0416666 1 6.5 L 1 12.333984 C 1 12.792318 1.3756511 13.166016 1.8339844 13.166016 L 10.166016 13.166016 C 10.62435 13.166016 11 12.792318 11 12.333984 L 11 12.154297 L 8.0644531 9.1972656 C 7.9636343 10.253489 7.0824936 11.083984 6 11.083984 C 4.8500001 11.083984 3.9160156 10.149999 3.9160156 9 C 3.9160156 7.8499995 4.8500001 6.9160156 6 6.9160156 C 7.1325933 6.9160156 8.05046 7.8232465 8.078125 8.9492188 L 10.898438 6.125 C 10.759609 5.8566437 10.487512 5.6660156 10.166016 5.6660156 L 8.7753906 5.6660156 L 7.6660156 4 L 4.3339844 4 z M 15.845703 8.1660156 L 13.349609 10.666016 L 14.333984 10.666016 L 14.333984 14.875 C 14.200651 14.85 14.057682 14.833984 13.916016 14.833984 C 12.766017 14.833984 11.833984 15.766016 11.833984 16.916016 C 11.833984 18.066016 12.766017 19 13.916016 19 C 15.066016 19 16 18.066016 16 16.916016 L 16 8.1660156 L 15.845703 8.1660156 z M 8.5 14 L 8.5 14.875 C 8.3666668 14.85 8.2256512 14.833984 8.0839844 14.833984 C 6.9339844 14.833984 6 15.766016 6 16.916016 C 6 18.066016 6.9339844 19 8.0839844 19 C 9.2339842 19 10.166016 18.066016 10.166016 16.916016 L 10.166016 14 L 8.5 14 z " />
|
3 |
+
<path d="m 11.000408,0.99844212 8.000001,0 0,8.00000038 -2,-1 0,-3.0800003 -5.600001,5.5899988 -1.4099996,-1.4099985 6.0900006,-6.1000003 -4.080001,0 z" />
|
4 |
</svg>
|
js/wordpress_file_upload_adminfunctions.js
CHANGED
@@ -160,7 +160,8 @@ function wfu_Attach_Admin_Events(autosave_shortcode){Autosave=autosave_shortcode
|
|
160 |
wfu_update_ptext_value);var stringmatch_elements=document.getElementsByName("wfu_stringmatch_elements");for(var i=0;i<stringmatch_elements.length;i++)wfu_attach_element_handlers(stringmatch_elements[i],wfu_update_stringmatch_textvalue);var triplecolor_elements=document.getElementsByName("wfu_triplecolor_elements");for(var i=0;i<triplecolor_elements.length;i++)wfu_attach_element_handlers(triplecolor_elements[i],wfu_update_triplecolor_value);var dimension_elements=document.getElementsByName("wfu_dimension_elements_widths");
|
161 |
for(var i=0;i<dimension_elements.length;i++)wfu_attach_element_handlers(dimension_elements[i],wfu_update_dimension_value);dimension_elements=document.getElementsByName("wfu_dimension_elements_heights");for(var i=0;i<dimension_elements.length;i++)wfu_attach_element_handlers(dimension_elements[i],wfu_update_dimension_value);var userfield_elements=document.getElementsByName("wfu_userfield_elements");for(var i=0;i<userfield_elements.length;i++)wfu_attach_element_handlers(userfield_elements[i],wfu_update_userfield_value);
|
162 |
var formfield_elements=document.getElementsByName("wfu_formfield_elements");for(var i=0;i<formfield_elements.length;i++)wfu_attach_element_handlers(formfield_elements[i],wfu_update_formfield_value);var subfolder_input_elements=document.getElementsByName("wfu_subfolder_tools_input");for(var i=0;i<subfolder_input_elements.length;i++)wfu_attach_element_handlers(subfolder_input_elements[i],wfu_subfolders_input_changed);var wfu_columnprops_elements=document.getElementsByName("wfu_columnprops_elements");
|
163 |
-
for(var i=0;i<wfu_columnprops_elements.length;i++)wfu_attach_element_handlers(wfu_columnprops_elements[i],wfu_columnprops_element_changed);if(document.getElementById("wfu_shortcode_postid").value!="")setTimeout(function(){wfu_check_page_obsolescence()},CheckObsolescenceTimeOut)}
|
|
|
164 |
function wfu_insert_variable(obj){var attr=obj.className.replace("wfu_variable wfu_variable_","");var inp=document.getElementById("wfu_attribute_"+attr);var pos=inp.selectionStart;var prevval=inp.value;inp.value=prevval.substr(0,pos)+obj.innerHTML+prevval.substr(pos);wfu_update_text_value({target:inp})}
|
165 |
function wfu_insert_userfield_variable(obj){var attr=obj.className.replace("wfu_variable wfu_variable_","");var inp=document.getElementById("wfu_attribute_"+attr);var pos=inp.selectionStart;var prevval=inp.value;inp.value=prevval.substr(0,pos)+obj.value+prevval.substr(pos);obj.value="%userdataXXX%";wfu_update_text_value({target:inp})}
|
166 |
function wfu_columns_itemclicked(obj,attribute){var select=obj.parentNode;if(select.tagName!="SELECT")return;for(var i=0;i<select.options.length;i++)select.options[i].selected=select.options[i]==obj;wfu_update_column_props(attribute)}
|
@@ -182,14 +183,15 @@ function wfu_plugin_encode_string(str){var i=0;var newstr="";var num;var hex="";
|
|
182 |
function wfu_plugin_decode_string(str){var i=0;var newstr="";var num,val;while(i<str.length){num=parseInt(str.substr(i,2),16);if(num<128)val=num;else if(num<224)val=((num&31)<<6)+(parseInt(str.substr(i+=2,2),16)&63);else val=((num&15)<<12)+((parseInt(str.substr(i+=2,2),16)&63)<<6)+(parseInt(str.substr(i+=2,2),16)&63);newstr+=String.fromCharCode(val);i+=2}return newstr}
|
183 |
function wfu_randomString(len){var chars="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";var string_length=len;var randomstring="";for(var i=0;i<string_length;i++){var rnum=Math.floor(Math.random()*chars.length);randomstring+=chars.substring(rnum,rnum+1)}return randomstring}
|
184 |
function wfu_schedule_save_shortcode(){var d=new Date;var dt=ShortcodeNextSave-d.getTime();if(ShortcodeTimeOut!=null){clearTimeout(ShortcodeTimeOut);ShortcodeTimeOut=null}if(dt<=0)wfu_save_shortcode();else ShortcodeTimeOut=setTimeout(function(){wfu_save_shortcode()},dt)}function wfu_check_page_obsolescence(){if(PageObsolete||PageUpdating||document.getElementById("wfu_shortcode_postid").value=="")return}
|
185 |
-
function wfu_save_shortcode(){if(PageObsolete)return;var xhr=wfu_GetHttpRequestObject();if(xhr==null)return;PageUpdating=true;document.getElementById("wfu_update_failed_message").style.display="none";var url=AdminParams.wfu_ajax_url;params=new Array(8);params[0]=
|
186 |
-
params[
|
187 |
-
params[7]=new Array(2);params[7][0]="widget_id";params[7][1]=document.getElementById("wfu_shortcode_widgetid").value;var parameters="";for(var i=0;i<params.length;i++)parameters+=(i>0?"&":"")+params[i][0]+"="+encodeURI(params[i][1]);var d=new Date;if(Autosave)ShortcodeNextSave=
|
188 |
-
xhr.onreadystatechange=function(){if(xhr.readyState==4)if(xhr.status==200){PageUpdating=false;var start_text="wfu_save_shortcode:";var pos=xhr.responseText.indexOf(start_text);if(pos==-1)pos=xhr.responseText.length;var messages=xhr.responseText.substr(0,
|
189 |
-
|
190 |
-
|
191 |
-
document.getElementById("
|
192 |
-
|
|
|
193 |
function wfu_apply_value(attribute,type,value){if(type=="onoff"){document.getElementById("wfu_attribute_"+attribute).className="wfu_onoff_container_"+(value!="true"?"on":"off");wfu_admin_onoff_clicked(attribute)}else if(type=="text"||type=="ltext"||type=="integer"||type=="float"||type=="mtext"||type=="color"){var item=document.getElementById("wfu_attribute_"+attribute);value=value.replace(/%n%/gm,"\n");value=value.replace(/%dq%/gm,'"');value=value.replace(/%brl%/gm,"[");value=value.replace(/%brr%/gm,
|
194 |
"]");if(type=="color"){var rgb=colourNameToHex(value);if(!rgb)rgb=value;jQuery("#wfu_attribute_"+attribute).wpColorPicker("color",rgb)}item.value=value;wfu_update_text_value({target:item})}else if(type=="date"){var item=document.getElementById("wfu_attribute_"+attribute);item.value=value;wfu_update_date_value({target:item})}else if(type=="placements"){wfu_admin_recreate_placements_panel(value);document.getElementById("wfu_attribute_value_placements").value=value;wfu_generate_shortcode()}else if(type==
|
195 |
"radio"){var radios=document.getElementsByName("wfu_radioattribute_"+attribute);for(var i=0;i<radios.length;i++)radios[i].checked=radios[i].value==value||"*"+radios[i].value==value;wfu_admin_radio_clicked(attribute)}else if(type=="ptext"){value=value.replace(/%n%/gm,"\n");value=value.replace(/%dq%/gm,'"');value=value.replace(/%brl%/gm,"[");value=value.replace(/%brr%/gm,"]");var parts=value.split("/");var singular=parts.length<1?"":parts[0];var plural=parts.length<2?singular:parts[1];var item1=document.getElementById("wfu_attribute_s_"+
|
160 |
wfu_update_ptext_value);var stringmatch_elements=document.getElementsByName("wfu_stringmatch_elements");for(var i=0;i<stringmatch_elements.length;i++)wfu_attach_element_handlers(stringmatch_elements[i],wfu_update_stringmatch_textvalue);var triplecolor_elements=document.getElementsByName("wfu_triplecolor_elements");for(var i=0;i<triplecolor_elements.length;i++)wfu_attach_element_handlers(triplecolor_elements[i],wfu_update_triplecolor_value);var dimension_elements=document.getElementsByName("wfu_dimension_elements_widths");
|
161 |
for(var i=0;i<dimension_elements.length;i++)wfu_attach_element_handlers(dimension_elements[i],wfu_update_dimension_value);dimension_elements=document.getElementsByName("wfu_dimension_elements_heights");for(var i=0;i<dimension_elements.length;i++)wfu_attach_element_handlers(dimension_elements[i],wfu_update_dimension_value);var userfield_elements=document.getElementsByName("wfu_userfield_elements");for(var i=0;i<userfield_elements.length;i++)wfu_attach_element_handlers(userfield_elements[i],wfu_update_userfield_value);
|
162 |
var formfield_elements=document.getElementsByName("wfu_formfield_elements");for(var i=0;i<formfield_elements.length;i++)wfu_attach_element_handlers(formfield_elements[i],wfu_update_formfield_value);var subfolder_input_elements=document.getElementsByName("wfu_subfolder_tools_input");for(var i=0;i<subfolder_input_elements.length;i++)wfu_attach_element_handlers(subfolder_input_elements[i],wfu_subfolders_input_changed);var wfu_columnprops_elements=document.getElementsByName("wfu_columnprops_elements");
|
163 |
+
for(var i=0;i<wfu_columnprops_elements.length;i++)wfu_attach_element_handlers(wfu_columnprops_elements[i],wfu_columnprops_element_changed);if(document.getElementById("wfu_shortcode_postid").value!="")setTimeout(function(){wfu_check_page_obsolescence()},CheckObsolescenceTimeOut);wfu_install_unload_hook()}function wfu_install_unload_hook(){window.onbeforeunload=wfu_unload_hook}function wfu_unload_hook(){if(!wfu_changes_saved())return 1}
|
164 |
+
function wfu_changes_saved(){return wfu_plugin_encode_string(document.getElementById("wfu_shortcode").value)==document.getElementById("wfu_shortcode_original_enc").value}function wfu_force_save_changes(){document.getElementById("wfu_shortcode").value=wfu_plugin_decode_string(document.getElementById("wfu_shortcode_original_enc").value)}
|
165 |
function wfu_insert_variable(obj){var attr=obj.className.replace("wfu_variable wfu_variable_","");var inp=document.getElementById("wfu_attribute_"+attr);var pos=inp.selectionStart;var prevval=inp.value;inp.value=prevval.substr(0,pos)+obj.innerHTML+prevval.substr(pos);wfu_update_text_value({target:inp})}
|
166 |
function wfu_insert_userfield_variable(obj){var attr=obj.className.replace("wfu_variable wfu_variable_","");var inp=document.getElementById("wfu_attribute_"+attr);var pos=inp.selectionStart;var prevval=inp.value;inp.value=prevval.substr(0,pos)+obj.value+prevval.substr(pos);obj.value="%userdataXXX%";wfu_update_text_value({target:inp})}
|
167 |
function wfu_columns_itemclicked(obj,attribute){var select=obj.parentNode;if(select.tagName!="SELECT")return;for(var i=0;i<select.options.length;i++)select.options[i].selected=select.options[i]==obj;wfu_update_column_props(attribute)}
|
183 |
function wfu_plugin_decode_string(str){var i=0;var newstr="";var num,val;while(i<str.length){num=parseInt(str.substr(i,2),16);if(num<128)val=num;else if(num<224)val=((num&31)<<6)+(parseInt(str.substr(i+=2,2),16)&63);else val=((num&15)<<12)+((parseInt(str.substr(i+=2,2),16)&63)<<6)+(parseInt(str.substr(i+=2,2),16)&63);newstr+=String.fromCharCode(val);i+=2}return newstr}
|
184 |
function wfu_randomString(len){var chars="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";var string_length=len;var randomstring="";for(var i=0;i<string_length;i++){var rnum=Math.floor(Math.random()*chars.length);randomstring+=chars.substring(rnum,rnum+1)}return randomstring}
|
185 |
function wfu_schedule_save_shortcode(){var d=new Date;var dt=ShortcodeNextSave-d.getTime();if(ShortcodeTimeOut!=null){clearTimeout(ShortcodeTimeOut);ShortcodeTimeOut=null}if(dt<=0)wfu_save_shortcode();else ShortcodeTimeOut=setTimeout(function(){wfu_save_shortcode()},dt)}function wfu_check_page_obsolescence(){if(PageObsolete||PageUpdating||document.getElementById("wfu_shortcode_postid").value=="")return}
|
186 |
+
function wfu_save_shortcode(){if(typeof window.fromGutenberg!="undefined"){document.getElementById("wfu_shortcode").value=wfu_plugin_decode_string(document.getElementById("wfu_shortcode_original_enc").value);window.plugin_window.wfu_save_from_editor(window.blockId);return}if(PageObsolete)return;var xhr=wfu_GetHttpRequestObject();if(xhr==null)return;PageUpdating=true;document.getElementById("wfu_update_failed_message").style.display="none";var url=AdminParams.wfu_ajax_url;params=new Array(8);params[0]=
|
187 |
+
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;
|
188 |
+
params[5]=new Array(2);params[5][0]="shortcode_position";params[5][1]=document.getElementById("wfu_shortcode_position").value;params[6]=new Array(2);params[6][0]="shortcode_tag";params[6][1]=document.getElementById("wfu_shortcode_tag").value;params[7]=new Array(2);params[7][0]="widget_id";params[7][1]=document.getElementById("wfu_shortcode_widgetid").value;var parameters="";for(var i=0;i<params.length;i++)parameters+=(i>0?"&":"")+params[i][0]+"="+encodeURI(params[i][1]);var d=new Date;if(Autosave)ShortcodeNextSave=
|
189 |
+
d.getTime()+5E3;else if(document.getElementById("wfu_update_shortcode"))document.getElementById("wfu_update_shortcode_wait").style.display="inline";xhr.open("POST",url,true);xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded");xhr.onreadystatechange=function(){if(xhr.readyState==4)if(xhr.status==200){PageUpdating=false;var start_text="wfu_save_shortcode:";var pos=xhr.responseText.indexOf(start_text);if(pos==-1)pos=xhr.responseText.length;var messages=xhr.responseText.substr(0,
|
190 |
+
pos);var response=xhr.responseText.substr(pos+start_text.length,xhr.responseText.length-pos-start_text.length);pos=response.indexOf(":");var txt_header=response.substr(0,pos);txt_value=response.substr(pos+1,response.length-pos-1);if(txt_header=="success"){if(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=d.getTime()+
|
191 |
+
1E3;if(ShortcodeTimeOut!=null)wfu_schedule_save_shortcode()}else if(document.getElementById("wfu_update_shortcode")){document.getElementById("wfu_update_shortcode_wait").style.display="none";document.getElementById("wfu_update_shortcode").disabled=true;if(window.plugin_window)window.plugin_window.location.reload(true)}if(document.getElementById("wfu_shortcode_postid").value!=""){var shortcode_tag=document.getElementById("wfu_shortcode_tag").value;document.getElementById("wfu_shortcode_original_enc").value=
|
192 |
+
wfu_plugin_encode_string("["+shortcode_tag+" "+ShortcodeString+"]");document.getElementById("wfu_shortcode_posthash").value=txt_value;setTimeout(function(){wfu_check_page_obsolescence()},CheckObsolescenceTimeOut)}}else{if(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)}if(txt_header=="fail")if(txt_value=="post_modified"){PageObsolete=
|
193 |
+
true;if(document.getElementById("wfu_update_shortcode"))document.getElementById("wfu_update_shortcode").disabled=true;document.getElementById("wfu_update_rejected_message").style.display="block"}else document.getElementById("wfu_update_failed_message").style.display="block"}}};xhr.send(parameters)}function wfu_adjust_opacity(opacity){document.getElementById("wfu_save_label").style.opacity=opacity}
|
194 |
+
function wfu_fadeout_element(interval){var reps=20;var op=0;for(var i=0;i<reps;i++){op=1-i/reps;setTimeout('wfu_adjust_opacity("'+op.toString()+'")',i*interval/reps)}setTimeout('wfu_adjust_opacity("0.0")',i*interval/reps)}
|
195 |
function wfu_apply_value(attribute,type,value){if(type=="onoff"){document.getElementById("wfu_attribute_"+attribute).className="wfu_onoff_container_"+(value!="true"?"on":"off");wfu_admin_onoff_clicked(attribute)}else if(type=="text"||type=="ltext"||type=="integer"||type=="float"||type=="mtext"||type=="color"){var item=document.getElementById("wfu_attribute_"+attribute);value=value.replace(/%n%/gm,"\n");value=value.replace(/%dq%/gm,'"');value=value.replace(/%brl%/gm,"[");value=value.replace(/%brr%/gm,
|
196 |
"]");if(type=="color"){var rgb=colourNameToHex(value);if(!rgb)rgb=value;jQuery("#wfu_attribute_"+attribute).wpColorPicker("color",rgb)}item.value=value;wfu_update_text_value({target:item})}else if(type=="date"){var item=document.getElementById("wfu_attribute_"+attribute);item.value=value;wfu_update_date_value({target:item})}else if(type=="placements"){wfu_admin_recreate_placements_panel(value);document.getElementById("wfu_attribute_value_placements").value=value;wfu_generate_shortcode()}else if(type==
|
197 |
"radio"){var radios=document.getElementsByName("wfu_radioattribute_"+attribute);for(var i=0;i<radios.length;i++)radios[i].checked=radios[i].value==value||"*"+radios[i].value==value;wfu_admin_radio_clicked(attribute)}else if(type=="ptext"){value=value.replace(/%n%/gm,"\n");value=value.replace(/%dq%/gm,'"');value=value.replace(/%brl%/gm,"[");value=value.replace(/%brr%/gm,"]");var parts=value.split("/");var singular=parts.length<1?"":parts[0];var plural=parts.length<2?singular:parts[1];var item1=document.getElementById("wfu_attribute_s_"+
|
lib/wfu_admin.php
CHANGED
@@ -1,896 +1,958 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
function wordpress_file_upload_admin_init() {
|
4 |
-
$uri = $_SERVER['REQUEST_URI'];
|
5 |
-
$is_admin = current_user_can( 'manage_options' );
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
//
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
//
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
//
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
//
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
//
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
$
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
$
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
//
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
uploadid VARCHAR(20) NOT NULL,
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
date_from DATETIME,
|
192 |
-
date_to DATETIME,
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
}
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
$echo_str =
|
274 |
-
}
|
275 |
-
elseif ( $action == '
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
$echo_str =
|
295 |
-
}
|
296 |
-
elseif ( $action == '
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
$
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
$
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
$
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
$
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
$
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
$referer_url = wfu_flatten_path(wfu_get_filepath_from_safe(wfu_sanitize_code($referer)));
|
333 |
-
if ( $referer_url === false ) $referer_url = "";
|
334 |
-
$match = array();
|
335 |
-
preg_match("/\&dir=(.*)/", $referer_url, $match);
|
336 |
-
$dir = ( isset($match[1]) ? $match[1] : "" );
|
337 |
-
$echo_str = wfu_browse_files($dir);
|
338 |
-
}
|
339 |
-
elseif ( $action == '
|
340 |
-
$echo_str =
|
341 |
-
}
|
342 |
-
elseif ( $action == '
|
343 |
-
|
344 |
-
$echo_str =
|
345 |
-
}
|
346 |
-
elseif ( $action == '
|
347 |
-
$
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
$
|
354 |
-
if ( $
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
$echo_str =
|
359 |
-
}
|
360 |
-
elseif ( $action == '
|
361 |
-
$
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
}
|
373 |
-
elseif ( $action == '
|
374 |
-
$
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
}
|
381 |
-
elseif ( $action == '
|
382 |
-
|
383 |
-
|
384 |
-
else $echo_str = wfu_maintenance_actions();
|
385 |
-
}
|
386 |
-
elseif ( $action == '
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
$echo_str =
|
393 |
-
}
|
394 |
-
elseif ( $action == '
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
}
|
421 |
-
|
422 |
-
$
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
$echo_str
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
$
|
454 |
-
$
|
455 |
-
$
|
456 |
-
$
|
457 |
-
$
|
458 |
-
$echo_str
|
459 |
-
|
460 |
-
$
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
$echo_str
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
$
|
477 |
-
|
478 |
-
$
|
479 |
-
|
480 |
-
$echo_str
|
481 |
-
$
|
482 |
-
|
483 |
-
|
484 |
-
$echo_str .= "\n\t\t
|
485 |
-
$echo_str .= "\n\t
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
$echo_str .=
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
$echo_str .= "\n\t\t\t\t\t".'</
|
503 |
-
$echo_str .= "\n\t\t\t\t".'</
|
504 |
-
|
505 |
-
$
|
506 |
-
$echo_str .= "\n\t\t\t\t".'<
|
507 |
-
$echo_str .= "\n\t\t\t\t\t".'<
|
508 |
-
$echo_str .= "\n\t\t\t\t\t\t".'
|
509 |
-
$echo_str .= "\n\t\t\t\t\t".'
|
510 |
-
$echo_str .= "\n\t\t\t\t\t".'<
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
$echo_str .= "\n\t\t\t\t
|
515 |
-
|
516 |
-
$echo_str .= "\n\t\t\t\t".'<tr>';
|
517 |
-
$echo_str .= "\n\t\t\t\t\t".'<th scope="row">';
|
518 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<label style="cursor:default;">
|
519 |
-
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
520 |
-
$echo_str .= "\n\t\t\t\t\t".'<td style="width:100px;">';
|
521 |
-
$cur_version = wfu_get_plugin_version();
|
522 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<label style="font-weight:bold; cursor:default;">'.$
|
523 |
-
$echo_str .= "\n\t\t\t\t\t".'</td>';
|
524 |
-
$echo_str .= "\n\t\t\t\t\t".'<td>';
|
525 |
-
$
|
526 |
-
$
|
527 |
-
$
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
$
|
551 |
-
$
|
552 |
-
$
|
553 |
-
|
554 |
-
$echo_str
|
555 |
-
$echo_str .=
|
556 |
-
$echo_str .=
|
557 |
-
$echo_str .=
|
558 |
-
$echo_str .=
|
559 |
-
|
560 |
-
|
561 |
-
$echo_str .=
|
562 |
-
$echo_str .=
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
$
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
$
|
575 |
-
$
|
576 |
-
$
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
$
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
$
|
601 |
-
$
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
if ( $
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
$
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
$
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
$
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
$echo_str
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
$
|
726 |
-
$
|
727 |
-
$
|
728 |
-
$
|
729 |
-
$
|
730 |
-
|
731 |
-
$
|
732 |
-
|
733 |
-
|
734 |
-
|
735 |
-
//
|
736 |
-
$
|
737 |
-
$
|
738 |
-
$
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
-
|
760 |
-
|
761 |
-
|
762 |
-
|
763 |
-
|
764 |
-
|
765 |
-
|
766 |
-
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
|
777 |
-
|
778 |
-
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
$echo_str .= "\n\t\t\t\t
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
$echo_str .= "\n\t\t
|
787 |
-
$echo_str .= "\n\t\t".'</
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
$
|
795 |
-
$
|
796 |
-
|
797 |
-
$
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
-
|
812 |
-
|
813 |
-
|
814 |
-
$
|
815 |
-
|
816 |
-
|
817 |
-
|
818 |
-
|
819 |
-
|
820 |
-
|
821 |
-
|
822 |
-
|
823 |
-
|
824 |
-
|
825 |
-
|
826 |
-
|
827 |
-
|
828 |
-
|
829 |
-
|
830 |
-
|
831 |
-
|
832 |
-
|
833 |
-
|
834 |
-
|
835 |
-
|
836 |
-
|
837 |
-
|
838 |
-
|
839 |
-
|
840 |
-
|
841 |
-
|
842 |
-
|
843 |
-
|
844 |
-
|
845 |
-
|
846 |
-
|
847 |
-
|
848 |
-
$echo_str
|
849 |
-
$echo_str .= "\n\t".'
|
850 |
-
|
851 |
-
$echo_str
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
-
$
|
856 |
-
$
|
857 |
-
$
|
858 |
-
$
|
859 |
-
$
|
860 |
-
|
861 |
-
$
|
862 |
-
|
863 |
-
$
|
864 |
-
return $
|
865 |
-
}
|
866 |
-
|
867 |
-
function
|
868 |
-
|
869 |
-
|
870 |
-
|
871 |
-
$
|
872 |
-
|
873 |
-
|
874 |
-
$
|
875 |
-
|
876 |
-
|
877 |
-
|
878 |
-
}
|
879 |
-
|
880 |
-
|
881 |
-
|
882 |
-
|
883 |
-
|
884 |
-
|
885 |
-
$post = get_post();
|
886 |
-
$
|
887 |
-
|
888 |
-
|
889 |
-
|
890 |
-
|
891 |
-
|
892 |
-
|
893 |
-
|
894 |
-
|
895 |
-
|
896 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
function wordpress_file_upload_admin_init() {
|
4 |
+
$uri = $_SERVER['REQUEST_URI'];
|
5 |
+
$is_admin = current_user_can( 'manage_options' );
|
6 |
+
$can_edit_posts = ( current_user_can( 'edit_pages' ) || current_user_can( 'edit_posts' ) );
|
7 |
+
$can_open_composer = ( WFU_VAR("WFU_SHORTCODECOMPOSER_NOADMIN") == "true" && $can_edit_posts );
|
8 |
+
if ( is_admin() && ( ( $is_admin && strpos($uri, "options-general.php") !== false ) ) ||
|
9 |
+
//conditional that will register scripts for non-admin users who can
|
10 |
+
//edit posts or pages so that they can open the shortcode composer
|
11 |
+
( is_admin() && $can_open_composer && strpos($uri, "admin.php") !== false ) ) {
|
12 |
+
//apply wfu_before_admin_scripts to get additional settings
|
13 |
+
$changable_data = array();
|
14 |
+
$ret_data = apply_filters('wfu_before_admin_scripts', $changable_data);
|
15 |
+
//if $ret_data contains 'return_value' key then no scripts will be
|
16 |
+
//registered
|
17 |
+
if ( isset($ret_data['return_value']) ) return $ret_data['return_value'];
|
18 |
+
//continue with script and style registering
|
19 |
+
wp_register_style('wordpress-file-upload-admin-style', WPFILEUPLOAD_DIR.'css/wordpress_file_upload_adminstyle.css',false,'1.0','all');
|
20 |
+
wp_register_style('wordpress-file-upload-adminbar-style', WPFILEUPLOAD_DIR.'css/wordpress_file_upload_adminbarstyle.css',false,'1.0','all');
|
21 |
+
//do not register JQuery UI css if $ret_data denotes incompatibility
|
22 |
+
//issues
|
23 |
+
if ( ( !isset($ret_data["correct_NextGenGallery_incompatibility"]) || $ret_data["correct_NextGenGallery_incompatibility"] != "true" ) &&
|
24 |
+
( !isset($ret_data["correct_JQueryUI_incompatibility"]) || $ret_data["correct_JQueryUI_incompatibility"] != "true" ) )
|
25 |
+
wp_register_style('jquery-ui-css', WPFILEUPLOAD_DIR.'vendor/jquery/jquery-ui.min.css');
|
26 |
+
//don't load datepicker js if $ret_data exclude_datepicker flag is true
|
27 |
+
if ( !isset($ret_data["exclude_datepicker"]) || $ret_data["exclude_datepicker"] != "true" )
|
28 |
+
wp_register_script('jquery-ui-datepicker', false, array('jquery'));
|
29 |
+
wp_register_script('wordpress_file_upload_admin_script', WPFILEUPLOAD_DIR.'js/wordpress_file_upload_adminfunctions.js', array( 'wp-color-picker' ), false, true);
|
30 |
+
if ( !$is_admin ) {
|
31 |
+
add_action('admin_post_edit_shortcode', 'wordpress_file_upload_manage_dashboard');
|
32 |
+
add_action('admin_print_scripts', 'wfu_enqueue_admin_scripts');
|
33 |
+
}
|
34 |
+
}
|
35 |
+
//register scripts for Uploaded Files
|
36 |
+
elseif ( is_admin() && $is_admin && strpos($uri, "admin.php") !== false ) {
|
37 |
+
//apply wfu_before_admin_scripts to get additional settings
|
38 |
+
$changable_data = array();
|
39 |
+
$ret_data = apply_filters('wfu_before_uploadedfiles_admin_scripts', $changable_data);
|
40 |
+
//if $ret_data contains 'return_value' key then no scripts will be
|
41 |
+
//registered
|
42 |
+
if ( isset($ret_data['return_value']) ) return $ret_data['return_value'];
|
43 |
+
//continue with script and style registering
|
44 |
+
wp_register_style('wordpress-file-upload-admin-style', WPFILEUPLOAD_DIR.'css/wordpress_file_upload_adminstyle.css',false,'1.0','all');
|
45 |
+
wp_register_style('wordpress-file-upload-adminbar-style', WPFILEUPLOAD_DIR.'css/wordpress_file_upload_adminbarstyle.css',false,'1.0','all');
|
46 |
+
//do not register JQuery UI css if $ret_data denotes incompatibility
|
47 |
+
//issues
|
48 |
+
if ( ( !isset($ret_data["correct_NextGenGallery_incompatibility"]) || $ret_data["correct_NextGenGallery_incompatibility"] != "true" ) &&
|
49 |
+
( !isset($ret_data["correct_JQueryUI_incompatibility"]) || $ret_data["correct_JQueryUI_incompatibility"] != "true" ) )
|
50 |
+
wp_register_style('jquery-ui-css', WPFILEUPLOAD_DIR.'vendor/jquery/jquery-ui.min.css');
|
51 |
+
wp_register_script('wordpress_file_upload_admin_script', WPFILEUPLOAD_DIR.'js/wordpress_file_upload_adminfunctions.js', array( 'wp-color-picker' ), false, true);
|
52 |
+
}
|
53 |
+
//register scripts for admin bar menu item
|
54 |
+
elseif ( is_admin() && $is_admin ) {
|
55 |
+
//script and style registering
|
56 |
+
wp_register_style('wordpress-file-upload-adminbar-style', WPFILEUPLOAD_DIR.'css/wordpress_file_upload_adminbarstyle.css',false,'1.0','all');
|
57 |
+
}
|
58 |
+
}
|
59 |
+
|
60 |
+
function wordpress_file_upload_add_admin_pages() {
|
61 |
+
global $wpdb;
|
62 |
+
global $wfu_uploadedfiles_hook_suffix;
|
63 |
+
$table_name1 = $wpdb->prefix . "wfu_log";
|
64 |
+
|
65 |
+
$page_hook_suffix = false;
|
66 |
+
if ( current_user_can( 'manage_options' ) ) $page_hook_suffix = add_options_page('Wordpress File Upload', 'Wordpress File Upload', 'manage_options', 'wordpress_file_upload', 'wordpress_file_upload_manage_dashboard');
|
67 |
+
if ( $page_hook_suffix !== false ) add_action('admin_print_scripts-'.$page_hook_suffix, 'wfu_enqueue_admin_scripts');
|
68 |
+
//conditional that will create Wordpress File Upload Dashboard menu, if it
|
69 |
+
//has not already been created, for non-admin users who can edit posts or
|
70 |
+
//pages, so that their requests for opening the shortcode composer can be
|
71 |
+
//handled
|
72 |
+
elseif ( WFU_VAR("WFU_SHORTCODECOMPOSER_NOADMIN") == "true" && ( current_user_can( 'edit_pages' ) || current_user_can( 'edit_posts' ) ) ) {
|
73 |
+
$page_hook_suffix = add_menu_page('Wordpress File Upload', 'Wordpress File Upload', 'read', 'wordpress_file_upload', 'wordpress_file_upload_manage_dashboard_editor');
|
74 |
+
if ( $page_hook_suffix !== false ) add_action('admin_print_scripts-'.$page_hook_suffix, 'wfu_enqueue_admin_scripts');
|
75 |
+
}
|
76 |
+
//add Uploaded Files menu if it is allowed
|
77 |
+
$wfu_uploadedfiles_hook_suffix = false;
|
78 |
+
if ( current_user_can( 'manage_options' ) && WFU_VAR("WFU_UPLOADEDFILES_MENU") == "true" ) {
|
79 |
+
//get the number of new (unread) uploaded files
|
80 |
+
$unread_files_count = wfu_get_unread_files_count();
|
81 |
+
$text = $unread_files_count;
|
82 |
+
if ( $unread_files_count > 99 ) $text = "99+";
|
83 |
+
$title = 'Uploaded Files <span class="update-plugins count-'.$unread_files_count.'"><span class="plugin-count">'.$text.'</span></span>';
|
84 |
+
$wfu_uploadedfiles_hook_suffix = add_menu_page(
|
85 |
+
'Uploaded Files',
|
86 |
+
$title,
|
87 |
+
'manage_options',
|
88 |
+
'wfu_uploaded_files',
|
89 |
+
'wfu_uploadedfiles_menu',
|
90 |
+
'dashicons-upload',
|
91 |
+
6
|
92 |
+
);
|
93 |
+
}
|
94 |
+
if ( $wfu_uploadedfiles_hook_suffix !== false ) {
|
95 |
+
add_action('admin_print_scripts-'.$wfu_uploadedfiles_hook_suffix, 'wfu_enqueue_uploadedfiles_admin_scripts');
|
96 |
+
}
|
97 |
+
//enqueue scripts for admin bar menu item
|
98 |
+
if ( current_user_can( 'manage_options' ) )
|
99 |
+
add_action('admin_print_scripts', 'wfu_enqueue_uploadedfiles_adminbar_scripts');
|
100 |
+
}
|
101 |
+
|
102 |
+
function wfu_enqueue_admin_scripts() {
|
103 |
+
$uri = $_SERVER['REQUEST_URI'];
|
104 |
+
$is_admin = current_user_can( 'manage_options' );
|
105 |
+
$can_open_composer = ( WFU_VAR("WFU_SHORTCODECOMPOSER_NOADMIN") == "true" && ( current_user_can( 'edit_pages' ) || current_user_can( 'edit_posts' ) ) );
|
106 |
+
if ( is_admin() && ( ( $is_admin && strpos($uri, "options-general.php") !== false ) ) ||
|
107 |
+
//conditional that will enqueue scripts for non-admin users who can
|
108 |
+
//edit posts or pages so that they can open the shortcode composer
|
109 |
+
( is_admin() && $can_open_composer && strpos($uri, "admin.php") !== false ) ) {
|
110 |
+
//apply wfu_before_admin_scripts to get additional settings
|
111 |
+
$changable_data = array();
|
112 |
+
$ret_data = apply_filters('wfu_before_admin_scripts', $changable_data);
|
113 |
+
//if $ret_data contains 'return_value' key then no scripts will be
|
114 |
+
//enqueued
|
115 |
+
if ( isset($ret_data['return_value']) ) return $ret_data['return_value'];
|
116 |
+
//continue with script and style enqueuing
|
117 |
+
wp_enqueue_style('wordpress-file-upload-admin-style');
|
118 |
+
wp_enqueue_style('wordpress-file-upload-adminbar-style');
|
119 |
+
//do not enqueue JQuery UI css if $ret_data denotes incompatibility
|
120 |
+
//issues
|
121 |
+
if ( ( !isset($ret_data["correct_NextGenGallery_incompatibility"]) || $ret_data["correct_NextGenGallery_incompatibility"] != "true" ) &&
|
122 |
+
( !isset($ret_data["correct_JQueryUI_incompatibility"]) || $ret_data["correct_JQueryUI_incompatibility"] != "true" ) )
|
123 |
+
wp_enqueue_style('jquery-ui-css');
|
124 |
+
wp_enqueue_style( 'wp-color-picker' );
|
125 |
+
//don't load datepicker js if $ret_data exclude_datepicker flag is true
|
126 |
+
if ( !isset($ret_data["exclude_datepicker"]) || $ret_data["exclude_datepicker"] != "true" )
|
127 |
+
wp_enqueue_script('jquery-ui-datepicker');
|
128 |
+
wp_enqueue_script('wordpress_file_upload_admin_script');
|
129 |
+
$AdminParams = array("wfu_ajax_url" => site_url()."/wp-admin/admin-ajax.php");
|
130 |
+
wp_localize_script( 'wordpress_file_upload_admin_script', 'AdminParams', $AdminParams );
|
131 |
+
}
|
132 |
+
}
|
133 |
+
|
134 |
+
function wfu_enqueue_uploadedfiles_admin_scripts() {
|
135 |
+
$uri = $_SERVER['REQUEST_URI'];
|
136 |
+
$is_admin = current_user_can( 'manage_options' );
|
137 |
+
if ( is_admin() && $is_admin && strpos($uri, "admin.php") !== false ) {
|
138 |
+
//apply wfu_before_admin_scripts to get additional settings
|
139 |
+
$changable_data = array();
|
140 |
+
$ret_data = apply_filters('wfu_before_uploadedfiles_admin_scripts', $changable_data);
|
141 |
+
//if $ret_data contains 'return_value' key then no scripts will be
|
142 |
+
//enqueued
|
143 |
+
if ( isset($ret_data['return_value']) ) return $ret_data['return_value'];
|
144 |
+
//continue with script and style enqueuing
|
145 |
+
wp_enqueue_style('wordpress-file-upload-admin-style');
|
146 |
+
wp_enqueue_style('wordpress-file-upload-adminbar-style');
|
147 |
+
//do not enqueue JQuery UI css if $ret_data denotes incompatibility
|
148 |
+
//issues
|
149 |
+
if ( ( !isset($ret_data["correct_NextGenGallery_incompatibility"]) || $ret_data["correct_NextGenGallery_incompatibility"] != "true" ) &&
|
150 |
+
( !isset($ret_data["correct_JQueryUI_incompatibility"]) || $ret_data["correct_JQueryUI_incompatibility"] != "true" ) )
|
151 |
+
wp_enqueue_style('jquery-ui-css');
|
152 |
+
wp_enqueue_script('wordpress_file_upload_admin_script');
|
153 |
+
$AdminParams = array("wfu_ajax_url" => site_url()."/wp-admin/admin-ajax.php");
|
154 |
+
wp_localize_script( 'wordpress_file_upload_admin_script', 'AdminParams', $AdminParams );
|
155 |
+
}
|
156 |
+
}
|
157 |
+
|
158 |
+
function wfu_enqueue_uploadedfiles_adminbar_scripts() {
|
159 |
+
$is_admin = current_user_can( 'manage_options' );
|
160 |
+
if ( is_admin() && $is_admin ) {
|
161 |
+
//script and style enqueuing
|
162 |
+
wp_enqueue_style('wordpress-file-upload-adminbar-style');
|
163 |
+
}
|
164 |
+
}
|
165 |
+
|
166 |
+
|
167 |
+
function wordpress_file_upload_install() {
|
168 |
+
global $wpdb;
|
169 |
+
global $wfu_tb_log_version;
|
170 |
+
global $wfu_tb_userdata_version;
|
171 |
+
global $wfu_tb_dbxqueue_version;
|
172 |
+
require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
|
173 |
+
|
174 |
+
//define database tables
|
175 |
+
$table_name1 = $wpdb->prefix . "wfu_log";
|
176 |
+
$installed_ver = get_option( "wordpress_file_upload_table_log_version" );
|
177 |
+
if( $installed_ver != $wfu_tb_log_version ) {
|
178 |
+
$sql = "CREATE TABLE " . $table_name1 . " (
|
179 |
+
idlog mediumint(9) NOT NULL AUTO_INCREMENT,
|
180 |
+
userid int NOT NULL,
|
181 |
+
uploaduserid int NOT NULL,
|
182 |
+
uploadtime bigint,
|
183 |
+
sessionid VARCHAR(40),
|
184 |
+
filepath TEXT NOT NULL,
|
185 |
+
filehash VARCHAR(100) NOT NULL,
|
186 |
+
filesize bigint NOT NULL,
|
187 |
+
uploadid VARCHAR(20) NOT NULL,
|
188 |
+
pageid mediumint(9),
|
189 |
+
blogid mediumint(9),
|
190 |
+
sid VARCHAR(10),
|
191 |
+
date_from DATETIME,
|
192 |
+
date_to DATETIME,
|
193 |
+
action VARCHAR(20) NOT NULL,
|
194 |
+
linkedto mediumint(9),
|
195 |
+
filedata TEXT,
|
196 |
+
PRIMARY KEY (idlog))
|
197 |
+
DEFAULT CHARACTER SET = utf8
|
198 |
+
DEFAULT COLLATE = utf8_general_ci;";
|
199 |
+
dbDelta($sql);
|
200 |
+
update_option("wordpress_file_upload_table_log_version", $wfu_tb_log_version);
|
201 |
+
}
|
202 |
+
|
203 |
+
$table_name2 = $wpdb->prefix . "wfu_userdata";
|
204 |
+
$installed_ver = get_option( "wordpress_file_upload_table_userdata_version" );
|
205 |
+
if( $installed_ver != $wfu_tb_userdata_version ) {
|
206 |
+
$sql = "CREATE TABLE " . $table_name2 . " (
|
207 |
+
iduserdata mediumint(9) NOT NULL AUTO_INCREMENT,
|
208 |
+
uploadid VARCHAR(20) NOT NULL,
|
209 |
+
property VARCHAR(100) NOT NULL,
|
210 |
+
propkey mediumint(9) NOT NULL,
|
211 |
+
propvalue TEXT,
|
212 |
+
date_from DATETIME,
|
213 |
+
date_to DATETIME,
|
214 |
+
PRIMARY KEY (iduserdata))
|
215 |
+
DEFAULT CHARACTER SET = utf8
|
216 |
+
DEFAULT COLLATE = utf8_general_ci;";
|
217 |
+
dbDelta($sql);
|
218 |
+
update_option("wordpress_file_upload_table_userdata_version", $wfu_tb_userdata_version);
|
219 |
+
}
|
220 |
+
|
221 |
+
$table_name3 = $wpdb->prefix . "wfu_dbxqueue";
|
222 |
+
$installed_ver = get_option( "wordpress_file_upload_table_dbxqueue_version" );
|
223 |
+
if( $installed_ver != $wfu_tb_dbxqueue_version ) {
|
224 |
+
$sql = "CREATE TABLE " . $table_name3 . " (
|
225 |
+
iddbxqueue mediumint(9) NOT NULL AUTO_INCREMENT,
|
226 |
+
fileid mediumint(9) NOT NULL,
|
227 |
+
priority mediumint(9) NOT NULL,
|
228 |
+
status mediumint(9) NOT NULL,
|
229 |
+
jobid VARCHAR(10) NOT NULL,
|
230 |
+
start_time bigint,
|
231 |
+
PRIMARY KEY (iddbxqueue))
|
232 |
+
DEFAULT CHARACTER SET = utf8
|
233 |
+
DEFAULT COLLATE = utf8_general_ci;";
|
234 |
+
dbDelta($sql);
|
235 |
+
update_option("wordpress_file_upload_table_dbxqueue_version", $wfu_tb_dbxqueue_version);
|
236 |
+
}
|
237 |
+
}
|
238 |
+
|
239 |
+
function wordpress_file_upload_uninstall() {
|
240 |
+
}
|
241 |
+
|
242 |
+
function wordpress_file_upload_update_db_check() {
|
243 |
+
global $wfu_tb_log_version;
|
244 |
+
global $wfu_tb_userdata_version;
|
245 |
+
global $wfu_tb_dbxqueue_version;
|
246 |
+
// update_option("wordpress_file_upload_table_log_version", "0");
|
247 |
+
// update_option("wordpress_file_upload_table_userdata_version", "0");
|
248 |
+
// update_option("wordpress_file_upload_table_dbxqueue_version", "0");
|
249 |
+
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 || get_option('wordpress_file_upload_table_dbxqueue_version') != $wfu_tb_dbxqueue_version ) {
|
250 |
+
wordpress_file_upload_install();
|
251 |
+
}
|
252 |
+
}
|
253 |
+
|
254 |
+
// This is the callback function that generates dashboard page content
|
255 |
+
function wordpress_file_upload_manage_dashboard() {
|
256 |
+
$plugin_options = wfu_decode_plugin_options(get_option( "wordpress_file_upload_options" ));
|
257 |
+
$_POST = stripslashes_deep($_POST);
|
258 |
+
$_GET = stripslashes_deep($_GET);
|
259 |
+
$action = (!empty($_POST['action']) ? $_POST['action'] : (!empty($_GET['action']) ? $_GET['action'] : ''));
|
260 |
+
$dir = (!empty($_POST['dir']) ? $_POST['dir'] : (!empty($_GET['dir']) ? $_GET['dir'] : ''));
|
261 |
+
$file = (!empty($_POST['file']) ? $_POST['file'] : (!empty($_GET['file']) ? $_GET['file'] : ''));
|
262 |
+
$referer = (!empty($_POST['referer']) ? $_POST['referer'] : (!empty($_GET['referer']) ? $_GET['referer'] : ''));
|
263 |
+
$data_enc = (!empty($_POST['data']) ? $_POST['data'] : (!empty($_GET['data']) ? $_GET['data'] : ''));
|
264 |
+
$postid = (!empty($_POST['postid']) ? $_POST['postid'] : (!empty($_GET['postid']) ? $_GET['postid'] : ''));
|
265 |
+
$nonce = (!empty($_POST['nonce']) ? $_POST['nonce'] : (!empty($_GET['nonce']) ? $_GET['nonce'] : ''));
|
266 |
+
$tag = (!empty($_POST['tag']) ? $_POST['tag'] : (!empty($_GET['tag']) ? $_GET['tag'] : ''));
|
267 |
+
$username = (!empty($_POST['username']) ? $_POST['username'] : (!empty($_GET['username']) ? $_GET['username'] : ''));
|
268 |
+
$invoker = (!empty($_POST['invoker']) ? $_POST['invoker'] : (!empty($_GET['invoker']) ? $_GET['invoker'] : ''));
|
269 |
+
$echo_str = "";
|
270 |
+
|
271 |
+
if ( $action == 'edit_settings' ) {
|
272 |
+
wfu_update_settings();
|
273 |
+
$echo_str = wfu_manage_settings();
|
274 |
+
}
|
275 |
+
elseif ( $action == 'shortcode_composer' ) {
|
276 |
+
$echo_str = wfu_shortcode_composer();
|
277 |
+
}
|
278 |
+
elseif ( $action == 'file_browser' ) {
|
279 |
+
$echo_str = wfu_browse_files($dir);
|
280 |
+
}
|
281 |
+
elseif ( $action == 'view_log' ) {
|
282 |
+
$page = $tag;
|
283 |
+
if ( $page == '' ) $page = 1;
|
284 |
+
$page = (int)wfu_sanitize_int($page);
|
285 |
+
$located_rec = $invoker;
|
286 |
+
if ( $located_rec == '' ) $located_rec = -1;
|
287 |
+
$located_rec = (int)wfu_sanitize_int($located_rec);
|
288 |
+
$echo_str = wfu_view_log($page, false, $located_rec);
|
289 |
+
}
|
290 |
+
elseif ( $action == 'rename_file' && $file != "" ) {
|
291 |
+
$echo_str = wfu_rename_file_prompt($file, 'file', false);
|
292 |
+
}
|
293 |
+
elseif ( $action == 'rename_dir' && $file != "" ) {
|
294 |
+
$echo_str = wfu_rename_file_prompt($file, 'dir', false);
|
295 |
+
}
|
296 |
+
elseif ( $action == 'move_file' && $file != "" ) {
|
297 |
+
if ( substr($file, 0, 5) == "list:" ) $file = explode(",", substr($file, 5));
|
298 |
+
$echo_str = wfu_move_file_prompt($file, false);
|
299 |
+
}
|
300 |
+
elseif ( $action == 'renamefile' && $file != "" ) {
|
301 |
+
if ( wfu_rename_file($file, 'file') ) $echo_str = wfu_browse_files($dir);
|
302 |
+
else $echo_str = wfu_rename_file_prompt($file, 'file', true);
|
303 |
+
}
|
304 |
+
elseif ( $action == 'renamedir' && $file != "" ) {
|
305 |
+
if ( wfu_rename_file($file, 'dir') ) $echo_str = wfu_browse_files($dir);
|
306 |
+
else $echo_str = wfu_rename_file_prompt($file, 'dir', true);
|
307 |
+
}
|
308 |
+
elseif ( $action == 'movefile' && $file != "" ) {
|
309 |
+
if ( substr($file, 0, 5) == "list:" ) $file = explode(",", substr($file, 5));
|
310 |
+
if ( wfu_move_file($file) ) $echo_str = wfu_browse_files($dir);
|
311 |
+
else $echo_str = wfu_move_file_prompt($file, true);
|
312 |
+
}
|
313 |
+
elseif ( $action == 'delete_file' && $file != "" && $referer != "" ) {
|
314 |
+
if ( substr($file, 0, 5) == "list:" ) $file = explode(",", substr($file, 5));
|
315 |
+
$echo_str = wfu_delete_file_prompt($file, 'file', $referer);
|
316 |
+
}
|
317 |
+
elseif ( $action == 'delete_dir' && $file != "" && $referer != "" ) {
|
318 |
+
$echo_str = wfu_delete_file_prompt($file, 'dir', $referer);
|
319 |
+
}
|
320 |
+
elseif ( $action == 'deletefile' && $file != "" ) {
|
321 |
+
if ( substr($file, 0, 5) == "list:" ) $file = explode(",", substr($file, 5));
|
322 |
+
wfu_delete_file($file, 'file');
|
323 |
+
$referer_url = wfu_flatten_path(wfu_get_filepath_from_safe(wfu_sanitize_code($referer)));
|
324 |
+
if ( $referer_url === false ) $referer_url = "";
|
325 |
+
$match = array();
|
326 |
+
preg_match("/\&dir=(.*)/", $referer_url, $match);
|
327 |
+
$dir = ( isset($match[1]) ? $match[1] : "" );
|
328 |
+
$echo_str = wfu_browse_files($dir);
|
329 |
+
}
|
330 |
+
elseif ( $action == 'deletedir' && $file != "" ) {
|
331 |
+
wfu_delete_file($file, 'dir');
|
332 |
+
$referer_url = wfu_flatten_path(wfu_get_filepath_from_safe(wfu_sanitize_code($referer)));
|
333 |
+
if ( $referer_url === false ) $referer_url = "";
|
334 |
+
$match = array();
|
335 |
+
preg_match("/\&dir=(.*)/", $referer_url, $match);
|
336 |
+
$dir = ( isset($match[1]) ? $match[1] : "" );
|
337 |
+
$echo_str = wfu_browse_files($dir);
|
338 |
+
}
|
339 |
+
elseif ( $action == 'create_dir' ) {
|
340 |
+
$echo_str = wfu_create_dir_prompt($dir, false);
|
341 |
+
}
|
342 |
+
elseif ( $action == 'createdir' ) {
|
343 |
+
if ( wfu_create_dir($dir) ) $echo_str = wfu_browse_files($dir);
|
344 |
+
else $echo_str = wfu_create_dir_prompt($dir, true);
|
345 |
+
}
|
346 |
+
elseif ( $action == 'include_file' && $file != "" && $referer != "" ) {
|
347 |
+
if ( substr($file, 0, 5) == "list:" ) $file = explode(",", substr($file, 5));
|
348 |
+
$echo_str = wfu_include_file_prompt($file, $referer);
|
349 |
+
}
|
350 |
+
elseif ( $action == 'includefile' && $file != "" ) {
|
351 |
+
if ( substr($file, 0, 5) == "list:" ) $file = explode(",", substr($file, 5));
|
352 |
+
wfu_include_file($file);
|
353 |
+
$referer_url = wfu_flatten_path(wfu_get_filepath_from_safe(wfu_sanitize_code($referer)));
|
354 |
+
if ( $referer_url === false ) $referer_url = "";
|
355 |
+
$match = array();
|
356 |
+
preg_match("/\&dir=(.*)/", $referer_url, $match);
|
357 |
+
$dir = ( isset($match[1]) ? $match[1] : "" );
|
358 |
+
$echo_str = wfu_browse_files($dir);
|
359 |
+
}
|
360 |
+
elseif ( $action == 'file_details' && $file != "" ) {
|
361 |
+
$echo_str = wfu_file_details($file, false, $invoker);
|
362 |
+
}
|
363 |
+
elseif ( $action == 'edit_filedetails' && $file != "" ) {
|
364 |
+
wfu_edit_filedetails($file);
|
365 |
+
$echo_str = wfu_file_details($file, false, $invoker);
|
366 |
+
}
|
367 |
+
elseif ( $action == 'personal_data' && $plugin_options["personaldata"] == "1" ) {
|
368 |
+
$echo_str = wfu_manage_personaldata_policies();
|
369 |
+
}
|
370 |
+
elseif ( $action == 'erase_userdata_ask' && $plugin_options["personaldata"] == "1" && $username != "" ) {
|
371 |
+
$echo_str = wfu_erase_userdata_ask_prompt($username);
|
372 |
+
}
|
373 |
+
elseif ( $action == 'erase_userdata' && $plugin_options["personaldata"] == "1" && $username != "" ) {
|
374 |
+
$ret = wfu_erase_userdata($username);
|
375 |
+
if ( $ret <= -1 ) $echo_str = wfu_manage_personaldata_policies();
|
376 |
+
else $echo_str = wfu_manage_personaldata_policies('Database cleaned. '.$ret.' items where affected.');
|
377 |
+
}
|
378 |
+
elseif ( $action == 'maintenance_actions' ) {
|
379 |
+
$echo_str = wfu_maintenance_actions();
|
380 |
+
}
|
381 |
+
elseif ( $action == 'sync_db' && $nonce != "" ) {
|
382 |
+
$affected_items = wfu_sync_database_controller($nonce);
|
383 |
+
if ( $affected_items > -1 ) $echo_str = wfu_maintenance_actions('Database updated. '.$affected_items.' items where affected.');
|
384 |
+
else $echo_str = wfu_maintenance_actions();
|
385 |
+
}
|
386 |
+
elseif ( $action == 'clean_log_ask' && $nonce != "" && $data_enc != "" ) {
|
387 |
+
$echo_str = wfu_clean_log_prompt($nonce, $data_enc);
|
388 |
+
}
|
389 |
+
elseif ( $action == 'clean_log' ) {
|
390 |
+
$ret = wfu_clean_log();
|
391 |
+
if ( $ret["recs_count"] <= -1 && $ret["files_count"] ) $echo_str = wfu_maintenance_actions();
|
392 |
+
else $echo_str = wfu_maintenance_actions('Database cleaned. '.$ret["recs_count"].' records and '.$ret["files_count"].' files where deleted.');
|
393 |
+
}
|
394 |
+
elseif ( $action == 'purge_data_ask' && $nonce != "" ) {
|
395 |
+
$echo_str = wfu_purge_data_prompt($nonce);
|
396 |
+
}
|
397 |
+
elseif ( $action == 'purge_data' ) {
|
398 |
+
$ret = wfu_purge_data();
|
399 |
+
if ( !$ret ) $echo_str = wfu_maintenance_actions();
|
400 |
+
else $echo_str = '<script type="text/javascript">window.location.replace("'.admin_url('plugins.php').'");</script>';
|
401 |
+
}
|
402 |
+
elseif ( $action == 'reset_all_transfers' && $nonce != "" ) {
|
403 |
+
if ( wfu_reset_all_transfers_controller($nonce) === true )
|
404 |
+
$echo_str = wfu_maintenance_actions('All file transfers were successfully reset.');
|
405 |
+
else $echo_str = wfu_maintenance_actions();
|
406 |
+
}
|
407 |
+
elseif ( $action == 'clear_all_transfers' && $nonce != "" ) {
|
408 |
+
if ( wfu_clear_all_transfers_controller($nonce) === true )
|
409 |
+
$echo_str = wfu_maintenance_actions('All file transfers were successfully cleared.');
|
410 |
+
else $echo_str = wfu_maintenance_actions();
|
411 |
+
}
|
412 |
+
elseif ( $action == 'plugin_settings' ) {
|
413 |
+
$echo_str = wfu_manage_settings();
|
414 |
+
}
|
415 |
+
elseif ( $action == 'add_shortcode' && $postid != "" && $nonce != "" && $tag != "" ) {
|
416 |
+
if ( WFU_USVAR('wfu_add_shortcode_ticket_for_'.$tag) != $nonce ) $echo_str = wfu_manage_mainmenu();
|
417 |
+
elseif ( wfu_add_shortcode($postid, $tag) ) $echo_str = wfu_manage_mainmenu();
|
418 |
+
else $echo_str = wfu_manage_mainmenu(WFU_DASHBOARD_ADD_SHORTCODE_REJECTED);
|
419 |
+
WFU_USVAR_store('wfu_add_shortcode_ticket', 'noticket');
|
420 |
+
}
|
421 |
+
elseif ( $action == 'edit_shortcode' && $data_enc != "" && $tag != "" ) {
|
422 |
+
$data = wfu_decode_array_from_string(wfu_get_shortcode_data_from_safe($data_enc));
|
423 |
+
if ( $data['post_id'] == "" || $referer == 'guteditor' || wfu_check_edit_shortcode($data) ) wfu_shortcode_composer($data, $tag, $referer);
|
424 |
+
else $echo_str = wfu_manage_mainmenu(WFU_DASHBOARD_EDIT_SHORTCODE_REJECTED);
|
425 |
+
}
|
426 |
+
elseif ( $action == 'delete_shortcode' && $data_enc != "" ) {
|
427 |
+
$data = wfu_decode_array_from_string(wfu_get_shortcode_data_from_safe($data_enc));
|
428 |
+
if ( wfu_check_edit_shortcode($data) ) $echo_str = wfu_delete_shortcode_prompt($data_enc);
|
429 |
+
else $echo_str = wfu_manage_mainmenu(WFU_DASHBOARD_DELETE_SHORTCODE_REJECTED);
|
430 |
+
}
|
431 |
+
elseif ( $action == 'deleteshortcode' && $data_enc != "" ) {
|
432 |
+
$data = wfu_decode_array_from_string(wfu_get_shortcode_data_from_safe($data_enc));
|
433 |
+
if ( wfu_check_edit_shortcode($data) ) {
|
434 |
+
if ( wfu_delete_shortcode($data) ) wfu_clear_shortcode_data_from_safe($data_enc);
|
435 |
+
$echo_str = wfu_manage_mainmenu();
|
436 |
+
}
|
437 |
+
else $echo_str = wfu_manage_mainmenu(WFU_DASHBOARD_DELETE_SHORTCODE_REJECTED);
|
438 |
+
}
|
439 |
+
elseif ( $action == 'add_policy' ) {
|
440 |
+
$echo_str = wfu_edit_pd_policy();
|
441 |
+
}
|
442 |
+
else {
|
443 |
+
$echo_str = wfu_manage_mainmenu();
|
444 |
+
}
|
445 |
+
|
446 |
+
echo $echo_str;
|
447 |
+
}
|
448 |
+
|
449 |
+
// This is the callback function that generates dashboard page content when
|
450 |
+
// loaded by a non-admin user who is able to edit posts or pages
|
451 |
+
function wordpress_file_upload_manage_dashboard_editor() {
|
452 |
+
$_POST = stripslashes_deep($_POST);
|
453 |
+
$_GET = stripslashes_deep($_GET);
|
454 |
+
$action = (!empty($_POST['action']) ? $_POST['action'] : (!empty($_GET['action']) ? $_GET['action'] : ''));
|
455 |
+
$referer = (!empty($_POST['referer']) ? $_POST['referer'] : (!empty($_GET['referer']) ? $_GET['referer'] : ''));
|
456 |
+
$data_enc = (!empty($_POST['data']) ? $_POST['data'] : (!empty($_GET['data']) ? $_GET['data'] : ''));
|
457 |
+
$tag = (!empty($_POST['tag']) ? $_POST['tag'] : (!empty($_GET['tag']) ? $_GET['tag'] : ''));
|
458 |
+
$echo_str = "";
|
459 |
+
|
460 |
+
if ( $action == 'edit_shortcode' && $data_enc != "" && $tag != "" ) {
|
461 |
+
$data = wfu_decode_array_from_string(wfu_get_shortcode_data_from_safe($data_enc));
|
462 |
+
if ( $data['post_id'] == "" || $referer == 'guteditor' || wfu_check_edit_shortcode($data) ) wfu_shortcode_composer($data, $tag, $referer);
|
463 |
+
else $echo_str = wfu_manage_mainmenu(WFU_DASHBOARD_EDIT_SHORTCODE_REJECTED);
|
464 |
+
}
|
465 |
+
else {
|
466 |
+
$echo_str = wfu_manage_mainmenu_editor();
|
467 |
+
}
|
468 |
+
|
469 |
+
echo $echo_str;
|
470 |
+
}
|
471 |
+
|
472 |
+
function wfu_manage_mainmenu($message = '') {
|
473 |
+
if ( !current_user_can( 'manage_options' ) ) return;
|
474 |
+
|
475 |
+
//get php version
|
476 |
+
$php_version = preg_replace("/-.*/", "", phpversion());
|
477 |
+
|
478 |
+
$plugin_options = wfu_decode_plugin_options(get_option( "wordpress_file_upload_options" ));
|
479 |
+
|
480 |
+
$echo_str = '<div class="wrap wfumain">';
|
481 |
+
$echo_str .= "\n\t".'<h2>Wordpress File Upload Control Panel</h2>';
|
482 |
+
if ( $message != '' ) {
|
483 |
+
$echo_str .= "\n\t".'<div class="updated">';
|
484 |
+
$echo_str .= "\n\t\t".'<p>'.$message.'</p>';
|
485 |
+
$echo_str .= "\n\t".'</div>';
|
486 |
+
}
|
487 |
+
$echo_str .= "\n\t".'<div style="margin-top:20px;">';
|
488 |
+
$echo_str .= wfu_generate_dashboard_menu("\n\t\t", "Main");
|
489 |
+
$echo_str .= "\n\t\t".'<h3 style="margin-bottom: 10px;">Status';
|
490 |
+
if ( $plugin_options["altserver"] == "1" && substr(trim(WFU_VAR("WFU_ALT_IPTANUS_SERVER")), 0, 5) == "http:" ) {
|
491 |
+
$echo_str .= '<div style="display: inline-block; margin-left:20px;" title="'.WFU_WARNING_ALT_IPTANUS_SERVER_ACTIVATED.'"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 200 800" version="1.1" style="background:darkorange; border-radius:13px; padding:2px; vertical-align:middle; border: 1px solid silver;"><path d="M 110,567 L 90,567 L 42,132 C 40,114 40,100 40,90 C 40,70 45,49 56,35 C 70,22 83,15 100,15 C 117,15 130,22 144,35 C 155,49 160,70 160,90 C 160,100 160,114 158,132 z M 100,640 A 60,60 0 1,1 100,760 A 60,60 0 1,1 100,640 z"/></svg></div>';
|
492 |
+
}
|
493 |
+
$echo_str .= '</h3>';
|
494 |
+
$echo_str .= "\n\t\t".'<table class="form-table">';
|
495 |
+
$echo_str .= "\n\t\t\t".'<tbody>';
|
496 |
+
//plugin edition
|
497 |
+
$echo_str .= "\n\t\t\t\t".'<tr>';
|
498 |
+
$echo_str .= "\n\t\t\t\t\t".'<th scope="row">';
|
499 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<label style="cursor:default;">Edition</label>';
|
500 |
+
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
501 |
+
$echo_str .= "\n\t\t\t\t\t".'<td style="width:100px; vertical-align:top;">';
|
502 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<label style="font-weight:bold; cursor:default;">Free</label>';
|
503 |
+
$echo_str .= "\n\t\t\t\t\t".'</td>';
|
504 |
+
$echo_str .= "\n\t\t\t\t\t".'<td>';
|
505 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<div style="display:inline-block; background-color:bisque; padding:0 0 0 4px; border-left:3px solid lightcoral;">';
|
506 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<label style="cursor:default;">Consider </label><a href="'.WFU_PRO_VERSION_URL.'">Upgrading</a><label style="cursor:default;"> to the Professional Version. </label>';
|
507 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<button onclick="if (this.innerText == \'See why >>\') {this.innerText = \'<< Close\'; document.getElementById(\'wfu_version_comparison\').style.display = \'inline-block\';} else {this.innerText = \'See why >>\'; document.getElementById(\'wfu_version_comparison\').style.display = \'none\';}">See why >></button>';
|
508 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</div>';
|
509 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<br /><div id="wfu_version_comparison" style="display:none; background-color:lightyellow; border:1px solid yellow; margin:10px 0; padding:10px;">';
|
510 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<img src="'.WFU_IMAGE_VERSION_COMPARISON.'" style="display:block; margin-bottom:6px;" />';
|
511 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<a class="button-primary" href="'.WFU_PRO_VERSION_URL.'">Go for the PRO version</a>';
|
512 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</div>';
|
513 |
+
$echo_str .= "\n\t\t\t\t\t".'</td>';
|
514 |
+
$echo_str .= "\n\t\t\t\t".'</tr>';
|
515 |
+
//plugin version
|
516 |
+
$echo_str .= "\n\t\t\t\t".'<tr>';
|
517 |
+
$echo_str .= "\n\t\t\t\t\t".'<th scope="row">';
|
518 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<label style="cursor:default;">Version</label>';
|
519 |
+
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
520 |
+
$echo_str .= "\n\t\t\t\t\t".'<td style="width:100px;">';
|
521 |
+
$cur_version = wfu_get_plugin_version();
|
522 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<label style="font-weight:bold; cursor:default;">'.$cur_version.'</label>';
|
523 |
+
$echo_str .= "\n\t\t\t\t\t".'</td>';
|
524 |
+
$echo_str .= "\n\t\t\t\t\t".'<td>';
|
525 |
+
$lat_version = wfu_get_latest_version();
|
526 |
+
$ret = wfu_compare_versions($cur_version, $lat_version);
|
527 |
+
if ( $lat_version == "" && WFU_VAR("WFU_DISABLE_VERSION_CHECK") != "true" ) {
|
528 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<div style="display:inline-block; background-color:transparent; padding:0 0 0 4px; color:red;">';
|
529 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 200 800" version="1.1" style="background:transparent; border-radius:13px; padding:2px; vertical-align:middle; border: 2px solid red; fill:red;"><path d="M 110,567 L 90,567 L 42,132 C 40,114 40,100 40,90 C 40,70 45,49 56,35 C 70,22 83,15 100,15 C 117,15 130,22 144,35 C 155,49 160,70 160,90 C 160,100 160,114 158,132 z M 100,640 A 60,60 0 1,1 100,760 A 60,60 0 1,1 100,640 z"/></svg>';
|
530 |
+
$warning_text = preg_replace("/:(\w+):/", '<a target="_blank" href="'.WFU_IPTANUS_SERVER_UNREACHABLE_ARTICLE.'" title="Iptanus Services Server Unreachable Error of WFU Plugin">$1</a>', WFU_WARNING_IPTANUS_SERVER_UNREACHABLE);
|
531 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<label style="cursor:default;">'.$warning_text.'</label>';
|
532 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</div>';
|
533 |
+
}
|
534 |
+
elseif ( $ret['status'] && $ret['result'] == 'lower' ) {
|
535 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<div style="display:inline-block; background-color:bisque; padding:0 0 0 4px; border-left:3px solid lightcoral;">';
|
536 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<label style="cursor:default;">Version <strong>'.$lat_version.'</strong> of the plugin is available. Go to Plugins page of your Dashboard to update to the latest version.</label>';
|
537 |
+
if ( $ret['custom'] ) $echo_str .= '<label style="cursor:default; color: purple;"> <em>Please note that you are using a custom version of the plugin. If you upgrade to the newest version, custom changes will be lost.</em></label>';
|
538 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</div>';
|
539 |
+
}
|
540 |
+
elseif ( $ret['status'] && $ret['result'] == 'equal' ) {
|
541 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<div style="display:inline-block; background-color:rgb(220,255,220); padding:0 0 0 4px; border-left:3px solid limegreen;">';
|
542 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<label style="cursor:default;">You have the latest version.</label>';
|
543 |
+
if ( $ret['custom'] ) $echo_str .= '<label style="cursor:default; color: purple;"> <em>(Please note that your version is custom)</em></label>';
|
544 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</div>';
|
545 |
+
}
|
546 |
+
$echo_str .= "\n\t\t\t\t\t".'</td>';
|
547 |
+
$echo_str .= "\n\t\t\t\t".'</tr>';
|
548 |
+
//server environment
|
549 |
+
$php_env = wfu_get_server_environment();
|
550 |
+
$echo_str .= "\n\t\t\t\t".'<tr>';
|
551 |
+
$echo_str .= "\n\t\t\t\t\t".'<th scope="row">';
|
552 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<label style="cursor:default;">Server Environment</label>';
|
553 |
+
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
554 |
+
$echo_str .= "\n\t\t\t\t\t".'<td style="width:100px;">';
|
555 |
+
if ( $php_env == '64bit' ) $echo_str .= "\n\t\t\t\t\t\t".'<label style="font-weight:bold; cursor:default;">64bit</label></td><td><label style="font-weight:normal; font-style:italic; cursor:default;">(Your server supports files up to 1 Exabyte, practically unlimited)</label>';
|
556 |
+
if ( $php_env == '32bit' ) $echo_str .= "\n\t\t\t\t\t\t".'<label style="font-weight:bold; cursor:default;">32bit</label></td><td><label style="font-weight:normal; font-style:italic; cursor:default;">(Your server does not support files larger than 2GB)</label>';
|
557 |
+
if ( $php_env == '' ) $echo_str .= "\n\t\t\t\t\t\t".'<label style="font-weight:bold; cursor:default;">Unknown</label></td><td><label style="font-weight:normal; font-style:italic; cursor:default;">(The maximum file size supported by the server cannot be determined)</label>';
|
558 |
+
$echo_str .= "\n\t\t\t\t\t".'</td>';
|
559 |
+
$echo_str .= "\n\t\t\t\t".'</tr>';
|
560 |
+
$echo_str .= "\n\t\t\t\t".'<tr>';
|
561 |
+
$echo_str .= "\n\t\t\t\t\t".'<th scope="row">';
|
562 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<label style="cursor:default;">PHP Version</label>';
|
563 |
+
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
564 |
+
$echo_str .= "\n\t\t\t\t\t".'<td style="width:100px;">';
|
565 |
+
$cur_version = wfu_get_plugin_version();
|
566 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<label style="font-weight:bold; cursor:default;">'.$php_version.'</label>';
|
567 |
+
$echo_str .= "\n\t\t\t\t\t".'</td>';
|
568 |
+
$echo_str .= "\n\t\t\t\t\t".'<td>';
|
569 |
+
$echo_str .= "\n\t\t\t\t\t".'</td>';
|
570 |
+
$echo_str .= "\n\t\t\t\t".'</tr>';
|
571 |
+
$echo_str .= "\n\t\t\t\t".'<tr>';
|
572 |
+
$echo_str .= "\n\t\t\t\t\t".'<th scope="row">';
|
573 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<label style="cursor:default;">Release Notes</label>';
|
574 |
+
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
575 |
+
$echo_str .= "\n\t\t\t\t\t".'<td colspan="2" style="width:100px;">';
|
576 |
+
$rel_path = ABSWPFILEUPLOAD_DIR.'release_notes.txt';
|
577 |
+
$rel_notes = '';
|
578 |
+
if ( file_exists($rel_path) ) $rel_notes = file_get_contents($rel_path);
|
579 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<div style="text-align:justify;">'.$rel_notes.'</div>';
|
580 |
+
$echo_str .= "\n\t\t\t\t\t".'</td>';
|
581 |
+
$echo_str .= "\n\t\t\t\t".'</tr>';
|
582 |
+
$echo_str .= "\n\t\t\t".'</tbody>';
|
583 |
+
$echo_str .= "\n\t\t".'</table>';
|
584 |
+
|
585 |
+
$echo_str .= wfu_manage_instances();
|
586 |
+
|
587 |
+
$echo_str .= "\n\t".'</div>';
|
588 |
+
$echo_str .= "\n".'</div>';
|
589 |
+
|
590 |
+
echo $echo_str;
|
591 |
+
}
|
592 |
+
|
593 |
+
function wfu_manage_mainmenu_editor($message = '') {
|
594 |
+
if ( !current_user_can( 'edit_pages' ) && !current_user_can( 'edit_posts' ) ) return;
|
595 |
+
|
596 |
+
$echo_str = '<div class="wrap wfumain">';
|
597 |
+
$echo_str .= "\n\t".'<h2>Wordpress File Upload Control Panel</h2>';
|
598 |
+
if ( $message != '' ) {
|
599 |
+
$echo_str .= "\n\t".'<div class="updated">';
|
600 |
+
$echo_str .= "\n\t\t".'<p>'.$message.'</p>';
|
601 |
+
$echo_str .= "\n\t".'</div>';
|
602 |
+
}
|
603 |
+
$echo_str .= "\n\t".'<div style="margin-top:20px;">';
|
604 |
+
$echo_str .= "\n\t\t".'<h3 style="margin-bottom: 10px;">This menu item exists to show the plugin\'s shortcode composer when editing pages or posts.</h3>';
|
605 |
+
$echo_str .= "\n\t".'</div>';
|
606 |
+
$echo_str .= "\n".'</div>';
|
607 |
+
|
608 |
+
echo $echo_str;
|
609 |
+
}
|
610 |
+
|
611 |
+
function wfu_generate_dashboard_menu($dlp, $active) {
|
612 |
+
$a = func_get_args(); $a = WFU_FUNCTION_HOOK(__FUNCTION__, $a, $out); if (isset($out['vars'])) foreach($out['vars'] as $p => $v) $$p = $v; switch($a) { case 'R': return $out['output']; break; case 'D': die($out['output']); }
|
613 |
+
$siteurl = site_url();
|
614 |
+
$plugin_options = wfu_decode_plugin_options(get_option( "wordpress_file_upload_options" ));
|
615 |
+
|
616 |
+
$echo_str = $dlp.'<h2 class="nav-tab-wrapper" style="margin-bottom:40px;">';
|
617 |
+
$echo_str .= $dlp."\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload" class="nav-tab'.( $active == "Main" ? ' nav-tab-active' : '' ).'" title="Main">Main</a>';
|
618 |
+
$echo_str .= $dlp."\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=plugin_settings" class="nav-tab'.( $active == "Settings" ? ' nav-tab-active' : '' ).'" title="Settings">Settings</a>';
|
619 |
+
$echo_str .= $dlp."\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=file_browser" class="nav-tab'.( $active == "File Browser" ? ' nav-tab-active' : '' ).'" title="File browser">File Browser</a>';
|
620 |
+
$echo_str .= $dlp."\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=view_log" class="nav-tab'.( $active == "View Log" ? ' nav-tab-active' : '' ).'" title="View log">View Log</a>';
|
621 |
+
if ( $plugin_options["personaldata"] == "1" )
|
622 |
+
$echo_str .= $dlp."\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=personal_data" class="nav-tab'.( $active == "Personal Data" ? ' nav-tab-active' : '' ).'" title="Personal Data">Personal Data</a>';
|
623 |
+
$echo_str .= $dlp."\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=maintenance_actions" class="nav-tab'.( $active == "Maintenance Actions" ? ' nav-tab-active' : '' ).'" title="Maintenance Actions">Maintenance Actions</a>';
|
624 |
+
$echo_str .= $dlp.'</h2>';
|
625 |
+
|
626 |
+
return $echo_str;
|
627 |
+
}
|
628 |
+
|
629 |
+
function wfu_test_function() {
|
630 |
+
$str = 'hello τεστ A piñata Ёнвидюнт';
|
631 |
+
|
632 |
+
echo "pass: ".$str;
|
633 |
+
}
|
634 |
+
|
635 |
+
function wfu_construct_post_list($posts) {
|
636 |
+
$ids = array();
|
637 |
+
$list = array();
|
638 |
+
$id_keys = array();
|
639 |
+
//construct item indices
|
640 |
+
foreach ( $posts as $key => $post ) {
|
641 |
+
if ( !array_key_exists($post->post_type, $ids) ) {
|
642 |
+
$ids[$post->post_type] = array();
|
643 |
+
$list[$post->post_type] = array();
|
644 |
+
}
|
645 |
+
array_push($ids[$post->post_type], $post->ID);
|
646 |
+
$id_keys[$post->ID] = $key;
|
647 |
+
}
|
648 |
+
//create post list in tree order; items are sorted by post status (publish, private, draft) and then by title
|
649 |
+
$i = 0;
|
650 |
+
while ( $i < count($posts) ) {
|
651 |
+
$post = $posts[$i];
|
652 |
+
//find topmost element in family tree
|
653 |
+
$tree = array( $post->ID );
|
654 |
+
$topmost = $post;
|
655 |
+
$par_id = $topmost->post_parent;
|
656 |
+
while ( in_array($par_id, $ids[$post->post_type]) ) {
|
657 |
+
$topmost = $posts[$id_keys[$par_id]];
|
658 |
+
array_splice($tree, 0, 0, $par_id);
|
659 |
+
$par_id = $topmost->post_parent;
|
660 |
+
}
|
661 |
+
//find which needs to be processed
|
662 |
+
$level = 0;
|
663 |
+
$host = &$list[$post->post_type];
|
664 |
+
foreach ( $tree as $process_id ) {
|
665 |
+
$found_key = -1;
|
666 |
+
foreach ( $host as $key => $item )
|
667 |
+
if ( $item['id'] == $process_id ) {
|
668 |
+
$found_key = $key;
|
669 |
+
break;
|
670 |
+
}
|
671 |
+
if ( $found_key == -1 ) break;
|
672 |
+
$level++;
|
673 |
+
$host = &$host[$found_key]['children'];
|
674 |
+
}
|
675 |
+
if ( $found_key == -1 ) {
|
676 |
+
$processed = $posts[$id_keys[$process_id]];
|
677 |
+
//add the processed item in the right position in children's list
|
678 |
+
$pos = 0;
|
679 |
+
$status = ( $processed->post_status == 'publish' ? 0 : ( $processed->post_status == 'private' ? 1 : 2 ) );
|
680 |
+
foreach ($host as $item) {
|
681 |
+
if ( $status < $item['status'] ) break;
|
682 |
+
if ( $status == $item['status'] && strcmp($processed->post_title, $item['title']) < 0 ) break;
|
683 |
+
$pos++;
|
684 |
+
}
|
685 |
+
$new_item = array(
|
686 |
+
'id' => $process_id,
|
687 |
+
'title' => $processed->post_title,
|
688 |
+
'status' => $status,
|
689 |
+
'level' => $level,
|
690 |
+
'children' => array()
|
691 |
+
);
|
692 |
+
array_splice($host, $pos, 0, array($new_item));
|
693 |
+
}
|
694 |
+
//advance index if we have finished processing all the tree
|
695 |
+
if ( $process_id == $post->ID ) $i++;
|
696 |
+
}
|
697 |
+
return $list;
|
698 |
+
}
|
699 |
+
|
700 |
+
function wfu_flatten_post_list($list) {
|
701 |
+
$flat = array();
|
702 |
+
if ( !is_array($list) ) return $flat;
|
703 |
+
foreach( $list as $item ) {
|
704 |
+
$flat_item = array(
|
705 |
+
'id' => $item['id'],
|
706 |
+
'title' => $item['title'],
|
707 |
+
'status' => $item['status'],
|
708 |
+
'level' => $item['level']
|
709 |
+
);
|
710 |
+
array_push($flat, $flat_item);
|
711 |
+
$flat = array_merge($flat, wfu_flatten_post_list($item['children']));
|
712 |
+
}
|
713 |
+
return $flat;
|
714 |
+
}
|
715 |
+
|
716 |
+
function wfu_manage_instances() {
|
717 |
+
$echo_str = wfu_manage_instances_of_shortcode('wordpress_file_upload', 'Uploader Instances', 'uploader', 1);
|
718 |
+
|
719 |
+
return $echo_str;
|
720 |
+
}
|
721 |
+
|
722 |
+
function wfu_manage_instances_of_shortcode($tag, $title, $slug, $inc) {
|
723 |
+
global $wp_registered_widgets, $wp_registered_sidebars;
|
724 |
+
|
725 |
+
$siteurl = site_url();
|
726 |
+
$args = array( 'post_type' => array( "post", "page" ), 'post_status' => "publish,private,draft", 'posts_per_page' => -1 );
|
727 |
+
$args = apply_filters("_wfu_get_posts", $args, "manage_instances");
|
728 |
+
$posts = get_posts($args);
|
729 |
+
$wfu_shortcodes = array();
|
730 |
+
//get shortcode instances from page/posts
|
731 |
+
foreach ( $posts as $post ) {
|
732 |
+
$ret = wfu_get_content_shortcodes($post, $tag);
|
733 |
+
if ( $ret !== false ) $wfu_shortcodes = array_merge($wfu_shortcodes, $ret);
|
734 |
+
}
|
735 |
+
//get shortcode instances from sidebars
|
736 |
+
$data = array();
|
737 |
+
$widget_base = $tag.'_widget';
|
738 |
+
if ( is_array($wp_registered_widgets) ) {
|
739 |
+
foreach ( $wp_registered_widgets as $id => $widget ) {
|
740 |
+
if ( substr($id, 0, strlen($widget_base)) == $widget_base ) {
|
741 |
+
$widget_obj = ( isset($widget['callback']) ? ( isset($widget['callback'][0]) ? ( $widget['callback'][0] instanceof WP_Widget ? $widget['callback'][0] : false ) : false ) : false );
|
742 |
+
$widget_sidebar = is_active_widget(false, $id, $widget_base);
|
743 |
+
if ( $widget_obj !== false && $widget_sidebar !== false ) {
|
744 |
+
if ( isset($wp_registered_sidebars[$widget_sidebar]) && isset($wp_registered_sidebars[$widget_sidebar]['name']) ) $widget_sidebar = $wp_registered_sidebars[$widget_sidebar]['name'];
|
745 |
+
$data['post_id'] = "";
|
746 |
+
$data['post_hash'] = "";
|
747 |
+
$data['shortcode'] = $widget_obj->shortcode();
|
748 |
+
$data['position'] = 0;
|
749 |
+
$data['widgetid'] = $id;
|
750 |
+
$data['sidebar'] = $widget_sidebar;
|
751 |
+
array_push($wfu_shortcodes, $data);
|
752 |
+
}
|
753 |
+
}
|
754 |
+
}
|
755 |
+
}
|
756 |
+
|
757 |
+
$list = wfu_construct_post_list($posts);
|
758 |
+
$pagelist = wfu_flatten_post_list($list["page"]);
|
759 |
+
$postlist = wfu_flatten_post_list($list["post"]);
|
760 |
+
|
761 |
+
$echo_str = "\n\t\t".'<h3 style="margin-bottom: 10px; margin-top: 40px;">'.$title.'</h3>';
|
762 |
+
$onchange_js = 'document.getElementById(\'wfu_add_plugin_ok_'.$inc.'\').disabled = !((document.getElementById(\'wfu_page_type_'.$inc.'\').value == \'page\' && document.getElementById(\'wfu_page_list_'.$inc.'\').value != \'\') || (document.getElementById(\'wfu_page_type_'.$inc.'\').value == \'post\' && document.getElementById(\'wfu_post_list_'.$inc.'\').value != \'\'));';
|
763 |
+
$no_shortcodes = ( count($wfu_shortcodes) == 0 );
|
764 |
+
$echo_str .= "\n\t\t".'<div id="wfu_add_plugin_button_'.$inc.'" style="'. ( !$no_shortcodes ? '' : 'color:blue; font-weight:bold; font-size:larger;' ).'margin-bottom: 20px; margin-top: 10px;">';
|
765 |
+
$addbutton_pre = ( !$no_shortcodes ? '' : '<label>Press </label>');
|
766 |
+
$addbutton_post = ( !$no_shortcodes ? '' : '<label> to get started and add the '.$slug.' in a page</label>');
|
767 |
+
$echo_str .= "\n\t\t\t".$addbutton_pre.'<button onclick="document.getElementById(\'wfu_add_plugin_button_'.$inc.'\').style.display = \'none\'; document.getElementById(\'wfu_add_plugin_'.$inc.'\').style.display = \'inline-block\'; '.$onchange_js.'">'.( !$no_shortcodes ? 'Add Plugin Instance' : 'here' ).'</button>'.$addbutton_post;
|
768 |
+
$echo_str .= "\n\t\t".'</div>';
|
769 |
+
$echo_str .= "\n\t\t".'<div id="wfu_add_plugin_'.$inc.'" style="margin-bottom: 20px; margin-top: 10px; position:relative; display:none;">';
|
770 |
+
$echo_str .= "\n\t\t\t".'<div id="wfu_add_plugin_'.$inc.'_overlay" style="position:absolute; top:0; left:0; width:100%; height:100%; background-color:rgba(255,255,255,0.8); border:none; display:none;">';
|
771 |
+
$echo_str .= "\n\t\t\t\t".'<table style="background:none; border:none; margin:0; padding:0; line-height:1; border-spacing:0; width:100%; height:100%; table-layout:fixed;"><tbody><tr><td style="text-align:center; vertical-align:middle;"><div style="display:inline-block;"><span class="spinner" style="opacity:1; float:left; margin:0; display:inline;"></span><label style="margin-left:4px;">please wait...</label></div></td></tr></tbody></table>';
|
772 |
+
$echo_str .= "\n\t\t\t".'</div>';
|
773 |
+
$echo_str .= "\n\t\t\t".'<label>Add '.$slug.' to </label><select id="wfu_page_type_'.$inc.'" onchange="document.getElementById(\'wfu_page_list_'.$inc.'\').style.display = (this.value == \'page\' ? \'inline-block\' : \'none\'); document.getElementById(\'wfu_post_list_'.$inc.'\').style.display = (this.value == \'post\' ? \'inline-block\' : \'none\'); '.$onchange_js.'"><option value="page" selected="selected">Page</option><option value="post">Post</option></select>';
|
774 |
+
$echo_str .= "\n\t\t\t".'<select id="wfu_page_list_'.$inc.'" style="margin-bottom:6px;" onchange="'.$onchange_js.'">';
|
775 |
+
$echo_str .= "\n\t\t\t\t".'<option value=""></option>';
|
776 |
+
foreach ( $pagelist as $item )
|
777 |
+
$echo_str .= "\n\t\t\t\t".'<option value="'.$item['id'].'">'.str_repeat(' ', 4 * $item['level']).( $item['status'] == 1 ? '[Private]' : ( $item['status'] == 2 ? '[Draft]' : '' ) ).$item['title'].'</option>';
|
778 |
+
$echo_str .= "\n\t\t\t".'</select>';
|
779 |
+
$echo_str .= "\n\t\t\t".'<select id="wfu_post_list_'.$inc.'" style="display:none; margin-bottom:6px;" onchange="'.$onchange_js.'">';
|
780 |
+
$echo_str .= "\n\t\t\t\t".'<option value=""></option>';
|
781 |
+
foreach ( $postlist as $item )
|
782 |
+
$echo_str .= "\n\t\t\t\t".'<option value="'.$item['id'].'">'.str_repeat(' ', 4 * $item['level']).( $item['status'] == 1 ? '[Private]' : ( $item['status'] == 2 ? '[Draft]' : '' ) ).$item['title'].'</option>';
|
783 |
+
$echo_str .= "\n\t\t\t".'</select><br />';
|
784 |
+
$add_shortcode_ticket = wfu_create_random_string(16);
|
785 |
+
WFU_USVAR_store('wfu_add_shortcode_ticket_for_'.$tag, $add_shortcode_ticket);
|
786 |
+
$echo_str .= "\n\t\t".'<button id="wfu_add_plugin_ok_'.$inc.'" style="float:right; margin: 0 2px 0 4px;" disabled="disabled" onclick="document.getElementById(\'wfu_add_plugin_'.$inc.'_overlay\').style.display = \'block\'; window.location = \''.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=add_shortcode&tag='.$tag.'&postid=\' + (document.getElementById(\'wfu_page_type_'.$inc.'\').value == \'page\' ? document.getElementById(\'wfu_page_list_'.$inc.'\').value : document.getElementById(\'wfu_post_list_'.$inc.'\').value) + \'&nonce='.$add_shortcode_ticket.'\';">Ok</button>';
|
787 |
+
$echo_str .= "\n\t\t".'<button style="float:right;" onclick="document.getElementById(\'wfu_page_type_'.$inc.'\').value = \'page\'; document.getElementById(\'wfu_page_list_'.$inc.'\').value = \'\'; document.getElementById(\'wfu_post_list_'.$inc.'\').value = \'\'; document.getElementById(\'wfu_add_plugin_'.$inc.'\').style.display = \'none\'; document.getElementById(\'wfu_add_plugin_button_'.$inc.'\').style.display = \'inline-block\';">Cancel</button>';
|
788 |
+
$echo_str .= "\n\t\t".'</div>';
|
789 |
+
$echo_str .= "\n\t\t".'<table class="wp-list-table widefat fixed striped">';
|
790 |
+
$echo_str .= "\n\t\t\t".'<thead>';
|
791 |
+
$echo_str .= "\n\t\t\t\t".'<tr>';
|
792 |
+
$echo_str .= "\n\t\t\t\t\t".'<th scope="col" width="5%" class="manage-column column-primary">';
|
793 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<label>ID</label>';
|
794 |
+
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
795 |
+
// $echo_str .= "\n\t\t\t\t\t".'<th scope="col" width="10%" style="text-align:center;">';
|
796 |
+
// $echo_str .= "\n\t\t\t\t\t\t".'<label>ID</label>';
|
797 |
+
// $echo_str .= "\n\t\t\t\t\t".'</th>';
|
798 |
+
$echo_str .= "\n\t\t\t\t\t".'<th scope="col" width="10%" class="manage-column">';
|
799 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<label>Contained In</label>';
|
800 |
+
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
801 |
+
$echo_str .= "\n\t\t\t\t\t".'<th scope="col" width="30%" class="manage-column">';
|
802 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<label>Page/Post Title</label>';
|
803 |
+
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
804 |
+
$echo_str .= "\n\t\t\t\t\t".'<th scope="col" width="45%" class="manage-column">';
|
805 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<label>Shortcode</label>';
|
806 |
+
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
807 |
+
$echo_str .= "\n\t\t\t\t".'</tr>';
|
808 |
+
$echo_str .= "\n\t\t\t".'</thead>';
|
809 |
+
$echo_str .= "\n\t\t\t".'<tbody>';
|
810 |
+
$i = 1;
|
811 |
+
foreach ( $wfu_shortcodes as $key => $data ) {
|
812 |
+
$widget_id = ( isset($data['widgetid']) ? $data['widgetid'] : '' );
|
813 |
+
if ( $widget_id == "" ) {
|
814 |
+
$id = $data['post_id'];
|
815 |
+
$posttype_obj = get_post_type_object(get_post_type($id));
|
816 |
+
$type = ( $posttype_obj ? $posttype_obj->labels->singular_name : "" );
|
817 |
+
$title = get_the_title($id);
|
818 |
+
if ( trim($title) == "" ) $title = 'ID: '.$id;
|
819 |
+
}
|
820 |
+
else {
|
821 |
+
$type = 'Sidebar';
|
822 |
+
$title = $data['sidebar'];
|
823 |
+
}
|
824 |
+
$data_enc = wfu_safe_store_shortcode_data(wfu_encode_array_to_string($data));
|
825 |
+
$echo_str .= "\n\t\t\t\t".'<tr onmouseover="var actions=document.getElementsByName(\'wfu_shortcode_actions_'.$inc.'\'); for (var i=0; i<actions.length; i++) {actions[i].style.visibility=\'hidden\';} document.getElementById(\'wfu_shortcode_actions_'.$inc.'_'.$i.'\').style.visibility=\'visible\'" onmouseout="var actions=document.getElementsByName(\'wfu_shortcode_actions_'.$inc.'\'); for (var i=0; i<actions.length; i++) {actions[i].style.visibility=\'hidden\';}">';
|
826 |
+
$echo_str .= "\n\t\t\t\t\t".'<td class="column-primary" data-colname="ID">';
|
827 |
+
$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&tag='.$tag.'&data='.$data_enc.'&referer=dashboard" title="Instance #'.$i.'">Instance '.$i.'</a>';
|
828 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<div id="wfu_shortcode_actions_'.$inc.'_'.$i.'" name="wfu_shortcode_actions_'.$inc.'" style="visibility:hidden;">';
|
829 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<span>';
|
830 |
+
$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&tag='.$tag.'&data='.$data_enc.'&referer=dashboard" title="Edit this shortcode">Edit</a>';
|
831 |
+
$echo_str .= "\n\t\t\t\t\t\t\t\t".' | ';
|
832 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'</span>';
|
833 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<span>';
|
834 |
+
$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>';
|
835 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'</span>';
|
836 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</div>';
|
837 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<button type="button" class="toggle-row"><span class="screen-reader-text">Show more details</span></button>';
|
838 |
+
$echo_str .= "\n\t\t\t\t\t".'</td>';
|
839 |
+
// $echo_str .= "\n\t\t\t\t\t".'<td style="padding: 5px 5px 5px 10px; text-align:center;">'.$id.'</td>';
|
840 |
+
$echo_str .= "\n\t\t\t\t\t".'<td data-colname="Contained In">'.$type.'</td>';
|
841 |
+
$echo_str .= "\n\t\t\t\t\t".'<td data-colname="Page/Post Title">'.$title.'</td>';
|
842 |
+
$echo_str .= "\n\t\t\t\t\t".'<td data-colname="Shortcode">';
|
843 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<textarea rows="3" disabled="disabled" style="width:100%;">'.trim($data['shortcode']).'</textarea>';
|
844 |
+
$echo_str .= "\n\t\t\t\t\t".'</td>';
|
845 |
+
$echo_str .= "\n\t\t\t\t".'</tr>';
|
846 |
+
$i++;
|
847 |
+
}
|
848 |
+
$echo_str .= "\n\t\t\t".'</tbody>';
|
849 |
+
$echo_str .= "\n\t\t".'</table>';
|
850 |
+
|
851 |
+
return $echo_str;
|
852 |
+
}
|
853 |
+
|
854 |
+
function wfu_get_content_shortcodes($post, $tag) {
|
855 |
+
global $shortcode_tags;
|
856 |
+
$found_shortcodes = array();
|
857 |
+
$content = $post->post_content;
|
858 |
+
if ( false === strpos( $content, '[' ) ) return false;
|
859 |
+
$hash = hash('md5', $content);
|
860 |
+
|
861 |
+
if ( array_key_exists( $tag, $shortcode_tags ) ) wfu_match_shortcode_nested($tag, $post, $hash, $content, 0, $found_shortcodes);
|
862 |
+
|
863 |
+
if ( count($found_shortcodes) == 0 ) return false;
|
864 |
+
return $found_shortcodes;
|
865 |
+
}
|
866 |
+
|
867 |
+
function wfu_match_shortcode_nested($tag, $post, $hash, $content, $position, &$found_shortcodes) {
|
868 |
+
if ( false === strpos( $content, '[' ) ) return false;
|
869 |
+
preg_match_all( '/' . get_shortcode_regex() . '/s', $content, $matches, PREG_SET_ORDER | PREG_OFFSET_CAPTURE );
|
870 |
+
if ( empty( $matches ) ) return false;
|
871 |
+
foreach ( $matches as $shortcode ) {
|
872 |
+
if ( $tag === $shortcode[2][0] ) {
|
873 |
+
$data['post_id'] = $post->ID;
|
874 |
+
$data['post_hash'] = $hash;
|
875 |
+
$data['shortcode'] = $shortcode[0][0];
|
876 |
+
$data['position'] = (int)$shortcode[0][1] + (int)$position;
|
877 |
+
array_push($found_shortcodes, $data);
|
878 |
+
}
|
879 |
+
wfu_match_shortcode_nested($tag, $post, $hash, $shortcode[5][0], $shortcode[5][1] + (int)$position, $found_shortcodes);
|
880 |
+
}
|
881 |
+
return false;
|
882 |
+
}
|
883 |
+
|
884 |
+
function wfu_check_edit_shortcode($data) {
|
885 |
+
$post = get_post($data['post_id']);
|
886 |
+
$content = $post->post_content;
|
887 |
+
$hash = hash('md5', $content);
|
888 |
+
|
889 |
+
return ( $hash == $data['post_hash'] );
|
890 |
+
}
|
891 |
+
|
892 |
+
function wfu_add_shortcode($postid, $tag) {
|
893 |
+
$post = get_post($postid);
|
894 |
+
$new_content = '['.$tag.']'.$post->post_content;
|
895 |
+
$new_post = array( 'ID' => $postid, 'post_content' => $new_content );
|
896 |
+
return ( wp_update_post( wfu_slash($new_post) ) === 0 ? false : true );
|
897 |
+
}
|
898 |
+
|
899 |
+
function wfu_replace_shortcode($data, $new_shortcode) {
|
900 |
+
$post = get_post($data['post_id']);
|
901 |
+
$new_content = substr($post->post_content, 0, $data['position']).$new_shortcode.substr($post->post_content, (int)$data['position'] + strlen($data['shortcode']));
|
902 |
+
$new_post = array( 'ID' => $data['post_id'], 'post_content' => $new_content );
|
903 |
+
return ( wp_update_post( wfu_slash($new_post) ) === 0 ? false : true );
|
904 |
+
}
|
905 |
+
|
906 |
+
function wfu_delete_shortcode_prompt($data_enc) {
|
907 |
+
$siteurl = site_url();
|
908 |
+
$data = wfu_decode_array_from_string(wfu_get_shortcode_data_from_safe($data_enc));
|
909 |
+
$postid = $data['post_id'];
|
910 |
+
$echo_str = "\n".'<div class="wrap">';
|
911 |
+
$echo_str .= "\n\t".'<h2>Wordpress File Upload Control Panel</h2>';
|
912 |
+
$echo_str .= "\n\t".'<div style="margin-top:20px;">';
|
913 |
+
$echo_str .= "\n\t\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>';
|
914 |
+
$echo_str .= "\n\t".'</div>';
|
915 |
+
$echo_str .= "\n\t".'<h2 style="margin-bottom: 10px; margin-top: 20px;">Delete Shortcode</h2>';
|
916 |
+
$echo_str .= "\n\t".'<form enctype="multipart/form-data" name="deletefile" id="deleteshortcode" method="post" action="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload" class="validate">';
|
917 |
+
$echo_str .= "\n\t\t".'<input type="hidden" name="action" value="deleteshortcode">';
|
918 |
+
$echo_str .= "\n\t\t".'<input type="hidden" name="data" value="'.$data_enc.'">';
|
919 |
+
$echo_str .= "\n\t\t".'<label>Are you sure that you want to delete shortcode for <strong>'.get_post_type($postid).' "'.get_the_title($postid).'" ('.$postid.') Position '.$data['position'].'</strong> ?</label><br/>';
|
920 |
+
$echo_str .= "\n\t\t".'<p class="submit">';
|
921 |
+
$echo_str .= "\n\t\t\t".'<input type="submit" class="button-primary" name="submit" value="Delete">';
|
922 |
+
$echo_str .= "\n\t\t\t".'<input type="submit" class="button-primary" name="submit" value="Cancel">';
|
923 |
+
$echo_str .= "\n\t\t".'</p>';
|
924 |
+
$echo_str .= "\n\t".'</form>';
|
925 |
+
$echo_str .= "\n".'</div>';
|
926 |
+
return $echo_str;
|
927 |
+
}
|
928 |
+
|
929 |
+
function wfu_delete_shortcode($data) {
|
930 |
+
//check if user is allowed to perform this action
|
931 |
+
if ( !current_user_can( 'manage_options' ) ) return false;
|
932 |
+
|
933 |
+
$res = true;
|
934 |
+
if ( isset($_POST['submit']) ) {
|
935 |
+
if ( $_POST['submit'] == "Delete" ) {
|
936 |
+
$res = wfu_replace_shortcode($data, '');
|
937 |
+
}
|
938 |
+
}
|
939 |
+
return $res;
|
940 |
+
}
|
941 |
+
|
942 |
+
function wfu_media_editor_properties() {
|
943 |
+
$a = func_get_args(); $a = WFU_FUNCTION_HOOK(__FUNCTION__, $a, $out); if (isset($out['vars'])) foreach($out['vars'] as $p => $v) $$p = $v; switch($a) { case 'R': return $out['output']; break; case 'D': die($out['output']); }
|
944 |
+
$plugin_options = wfu_decode_plugin_options(get_option( "wordpress_file_upload_options" ));
|
945 |
+
if ( $plugin_options["mediacustom"] != "1" ) return;
|
946 |
+
|
947 |
+
$post = get_post();
|
948 |
+
$meta = wp_get_attachment_metadata( $post->ID );
|
949 |
+
|
950 |
+
$echo_str = "";
|
951 |
+
if ( isset($meta["WFU User Data"]) && is_array($meta["WFU User Data"]) ) {
|
952 |
+
foreach ( $meta["WFU User Data"] as $label => $value )
|
953 |
+
$echo_str .= '<div class="misc-pub-section misc-pub-userdata">'.$label.': <strong>'.$value.'</strong></div>';
|
954 |
+
}
|
955 |
+
echo $echo_str;
|
956 |
+
}
|
957 |
+
|
958 |
+
?>
|
lib/wfu_admin_browser.php
CHANGED
@@ -1,1392 +1,1394 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
function wfu_browse_files($basedir_code, $page = -1, $only_table_rows = false) {
|
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 |
-
|
11 |
-
//first decode basedir_code
|
12 |
-
$basedir = wfu_get_filepath_from_safe($basedir_code);
|
13 |
-
//clean session array holding dir and file paths if it is too big
|
14 |
-
if ( WFU_USVAR_exists('wfu_filepath_safe_storage') && count(WFU_USVAR('wfu_filepath_safe_storage')) > WFU_VAR("WFU_PHP_ARRAY_MAXLEN") ) WFU_USVAR_store('wfu_filepath_safe_storage', array());
|
15 |
-
|
16 |
-
//basedir may also contain information about the sorting of the displayed
|
17 |
-
//elements, as well as a filename that needs to be located and get focus on
|
18 |
-
//the browser;
|
19 |
-
//sorting information is enclosed in double brackets: [[sort_info]]
|
20 |
-
//filename information is enclosed in double braces: {{filename}}
|
21 |
-
$sort = "";
|
22 |
-
$located_file = "";
|
23 |
-
$located_file_found = false;
|
24 |
-
$filter = "";
|
25 |
-
if ( $basedir !== false ) {
|
26 |
-
$ret = wfu_extract_sortdata_from_path($basedir);
|
27 |
-
$basedir = $ret['path'];
|
28 |
-
$sort = $ret['sort'];
|
29 |
-
$located_file = $ret['file'];
|
30 |
-
$filter = $ret['filter'];
|
31 |
-
}
|
32 |
-
if ( $sort == "" ) $sort = 'name';
|
33 |
-
if ( substr($sort, 0, 1) == '-' ) $order = SORT_DESC;
|
34 |
-
else $order = SORT_ASC;
|
35 |
-
//if page is not -1, then do not locate a file
|
36 |
-
if ( $located_file != "" && $page > -1 ) $located_file = "";
|
37 |
-
//adjust page to be larger than zero
|
38 |
-
if ( $page < 1 ) $page = 1;
|
39 |
-
|
40 |
-
//adjust basedir to have a standard format
|
41 |
-
if ( $basedir !== false ) {
|
42 |
-
if ( substr($basedir, -1) != '/' ) $basedir .= '/';
|
43 |
-
if ( substr($basedir, 0, 1) == '/' ) $basedir = substr($basedir, 1);
|
44 |
-
//calculate the absolute path of basedir knowing that basedir is relative to website root
|
45 |
-
$basedir = wfu_path_rel2abs($basedir);
|
46 |
-
if ( !file_exists($basedir) ) $basedir = false;
|
47 |
-
}
|
48 |
-
//set basedit to default value if empty
|
49 |
-
if ( $basedir === false ) {
|
50 |
-
$plugin_options = wfu_decode_plugin_options(get_option( "wordpress_file_upload_options" ));
|
51 |
-
$basedir = ( isset($plugin_options['basedir']) ? $plugin_options['basedir'] : "" );
|
52 |
-
$temp_params = array( 'uploadpath' => $basedir, 'accessmethod' => 'normal', 'ftpinfo' => '', 'useftpdomain' => 'false' );
|
53 |
-
$basedir = wfu_upload_plugin_full_path($temp_params);
|
54 |
-
}
|
55 |
-
//find relative dir
|
56 |
-
$reldir = str_replace(wfu_abspath(), "root/", $basedir);
|
57 |
-
//save dir route to an array
|
58 |
-
$parts = explode('/', $reldir);
|
59 |
-
$route = array();
|
60 |
-
$prev = "";
|
61 |
-
foreach ( $parts as $part ) {
|
62 |
-
$part = trim($part);
|
63 |
-
if ( $part != "" ) {
|
64 |
-
// if ( $part == 'root' && $prev == "" ) $prev = wfu_abspath();
|
65 |
-
if ( $part == 'root' && $prev == "" ) $prev = "";
|
66 |
-
else $prev .= $part.'/';
|
67 |
-
array_push($route, array( 'item' => $part, 'path' => $prev ));
|
68 |
-
}
|
69 |
-
}
|
70 |
-
//calculate upper directory
|
71 |
-
$updir = substr($basedir, 0, -1);
|
72 |
-
$delim_pos = strrpos($updir, '/');
|
73 |
-
if ( $delim_pos !== false ) $updir = substr($updir, 0, $delim_pos + 1);
|
74 |
-
|
75 |
-
//define referer (with sort data) to point to this url for use by the elements
|
76 |
-
$referer = $siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=file_browser&dir='.$basedir_code;
|
77 |
-
$referer_code = wfu_safe_store_filepath($referer.'[['.$sort.']]');
|
78 |
-
//define header parameters that can be later used when defining file actions
|
79 |
-
$header_params = array();
|
80 |
-
|
81 |
-
//find contents of current folder taking into account pagination, if it is
|
82 |
-
//activated; contents are found following an optimized procedure as follows:
|
83 |
-
// 1. all dirs and files are found and stored in separate arrays
|
84 |
-
// 2. if pagination is activated then it is checked if there are any dirs
|
85 |
-
// in the current page
|
86 |
-
// 3. if dir sorting is name then dirs are sorted
|
87 |
-
// 4. if dir sorting is date then stat is called for all dirs and then they
|
88 |
-
// are sorted
|
89 |
-
// 5. if pagination is activated then dirs array is sliced to keep only the
|
90 |
-
// ones belonging to the current page and then stat is called if it has
|
91 |
-
// not already been called
|
92 |
-
// 6. if there is room in the page for showing files, then files are also
|
93 |
-
// processed
|
94 |
-
// 7. if file sorting is name then files are sorted
|
95 |
-
// 8. if file sorting is date or size then stat is called for all files and
|
96 |
-
// then they are sorted
|
97 |
-
// 9. if file sorting is user then db record is retrieved for all files and
|
98 |
-
// then they are sorted
|
99 |
-
// 10. if pagination is activated then files array is sliced to keep only
|
100 |
-
// the ones fitting in the page; then stat is called and/or db record is
|
101 |
-
// retrieved
|
102 |
-
//first calculate dirs and files arrays
|
103 |
-
$dirlist = array();
|
104 |
-
$dirlist_include = true;
|
105 |
-
$dirlist_perpage = array();
|
106 |
-
$dirstat_ok = false;
|
107 |
-
$filelist = array();
|
108 |
-
$filestat_ok = false;
|
109 |
-
$filerec_ok = false;
|
110 |
-
if ( $handle = opendir($basedir) ) {
|
111 |
-
$blacklist = array('.', '..');
|
112 |
-
while ( false !== ($file = readdir($handle)) )
|
113 |
-
if ( !in_array($file, $blacklist) ) {
|
114 |
-
$filepath = $basedir.$file;
|
115 |
-
if ( is_dir($filepath) ) array_push($dirlist, array( 'name' => $file, 'fullpath' => $filepath ));
|
116 |
-
else array_push($filelist, array( 'name' => $file, 'fullpath' => $filepath ));
|
117 |
-
}
|
118 |
-
closedir($handle);
|
119 |
-
}
|
120 |
-
$dirlist_count = count($dirlist);
|
121 |
-
$filelist_count = count($filelist);
|
122 |
-
//get pagination details and determine if any dirs will be shown
|
123 |
-
$maxrows = (int)WFU_VAR("WFU_ADMINBROWSER_TABLE_MAXROWS");
|
124 |
-
$files_total = $dirlist_count + $filelist_count;
|
125 |
-
if ( $maxrows > 0 ) {
|
126 |
-
$pages = max(ceil($files_total / $maxrows), 1);
|
127 |
-
if ( $page > $pages ) $page = $pages;
|
128 |
-
//if first item index passes number of dirs then do not include dirs
|
129 |
-
if ( ($page - 1) * $maxrows >= $dirlist_count ) $dirlist_include = false;
|
130 |
-
//if a filename has been defined to get focus, then $dirlist_include
|
131 |
-
//needs to be true in order to calculate the dirs of every page
|
132 |
-
if ( $located_file != "" ) $dirlist_include = true;
|
133 |
-
}
|
134 |
-
//process dirs if they are included in page
|
135 |
-
if ( $dirlist_include ) {
|
136 |
-
//adjust sort details
|
137 |
-
$dirsort = ( substr($sort, -4) == 'date' ? 'mdate' : substr($sort, -4) );
|
138 |
-
$dirorder = $order;
|
139 |
-
if ( $dirsort == 'size' ) { $dirsort = 'name'; $dirorder = SORT_ASC; }
|
140 |
-
if ( $dirsort == 'user' ) { $dirsort = 'name'; $dirorder = SORT_ASC; }
|
141 |
-
switch ( $dirsort ) {
|
142 |
-
case "name": $dirsort .= ":s"; break;
|
143 |
-
case "mdate": $dirsort .= ":n"; break;
|
144 |
-
}
|
145 |
-
//if dir sort is mdate or if a file needs to be located then first
|
146 |
-
//calculate stat
|
147 |
-
if ( substr($dirsort, 0, 5) == 'mdate' || $located_file != "" ) {
|
148 |
-
foreach ( $dirlist as &$dir ) {
|
149 |
-
$stat = stat($dir['fullpath']);
|
150 |
-
$dir['mdate'] = $stat['mtime'];
|
151 |
-
}
|
152 |
-
unset($dir);
|
153 |
-
$dirstat_ok = true;
|
154 |
-
}
|
155 |
-
//sort dirs
|
156 |
-
$dirlist = wfu_array_sort($dirlist, $dirsort, $dirorder);
|
157 |
-
//if pagination is activated then slice dirs array to keep only the
|
158 |
-
//items belonging in the current page
|
159 |
-
if ( $maxrows > 0 ) {
|
160 |
-
//before slicing we store the items in $dirlist_perpage array
|
161 |
-
$i = $maxrows;
|
162 |
-
$ipage = 0;
|
163 |
-
foreach ( $dirlist as $dir ) {
|
164 |
-
if ( $i >= $maxrows ) {
|
165 |
-
$i = 0;
|
166 |
-
$ipage ++;
|
167 |
-
$dirlist_perpage[$ipage] = array();
|
168 |
-
}
|
169 |
-
array_push($dirlist_perpage[$ipage], $dir);
|
170 |
-
$i ++;
|
171 |
-
}
|
172 |
-
//now we slice $dirlist
|
173 |
-
$dirlist = array_slice($dirlist, ($page - 1) * $maxrows, $maxrows);
|
174 |
-
}
|
175 |
-
//calculate stat for the remaining dirs array, if it has not already
|
176 |
-
//been done
|
177 |
-
if ( !$dirstat_ok ) {
|
178 |
-
foreach ( $dirlist as &$dir ) {
|
179 |
-
$stat = stat($dir['fullpath']);
|
180 |
-
$dir['mdate'] = $stat['mtime'];
|
181 |
-
}
|
182 |
-
unset($dir);
|
183 |
-
}
|
184 |
-
}
|
185 |
-
else $dirlist = array();
|
186 |
-
//determine if any files will be included in page; in case pagination is
|
187 |
-
//activated then the remaining places need to be more than zero
|
188 |
-
$files_included = ( $maxrows > 0 ? ( $maxrows - count($dirlist) > 0 ) : true );
|
189 |
-
//if a filename has been defined to get focus, then $files_included
|
190 |
-
//needs to be true in order to re-calculate the page
|
191 |
-
if ( $located_file != "" ) $files_included = true;
|
192 |
-
if ( $files_included ) {
|
193 |
-
//adjust sort details
|
194 |
-
$filesort = ( substr($sort, -4) == 'date' ? 'mdate' : substr($sort, -4) );
|
195 |
-
switch ( $filesort ) {
|
196 |
-
case "name": $filesort .= ":s"; break;
|
197 |
-
case "size": $filesort .= ":n"; break;
|
198 |
-
case "mdate": $filesort .= ":n"; break;
|
199 |
-
case "user": $filesort .= ":s"; break;
|
200 |
-
}
|
201 |
-
//if file sort is size or mdate then first calculate stat
|
202 |
-
if ( substr($filesort, 0, 4) == 'size' || substr($filesort, 0, 5) == 'mdate' ) {
|
203 |
-
foreach ( $filelist as &$file ) {
|
204 |
-
$stat = stat($file['fullpath']);
|
205 |
-
$file['size'] = $stat['size'];
|
206 |
-
$file['mdate'] = $stat['mtime'];
|
207 |
-
}
|
208 |
-
unset($file);
|
209 |
-
$filestat_ok = true;
|
210 |
-
}
|
211 |
-
//if file sort is user then first calculate db records
|
212 |
-
elseif ( substr($filesort, 0, 4) == 'user' ) {
|
213 |
-
foreach ( $filelist as &$file ) {
|
214 |
-
//find relative file record in database together with user data;
|
215 |
-
//if the file is php, then file record is null meaning that the file
|
216 |
-
//can only be viewed; if file record is not found then the file can
|
217 |
-
//again only be viewed
|
218 |
-
if ( preg_match("/\.php$/", $file['fullpath']) ) $filerec = null;
|
219 |
-
else $filerec = wfu_get_file_rec($file['fullpath'], true);
|
220 |
-
//find user who uploaded the file
|
221 |
-
$username = ( $filerec != null ? wfu_get_username_by_id($filerec->uploaduserid) : '' );
|
222 |
-
$file['user'] = $username;
|
223 |
-
$file['filedata'] = $filerec;
|
224 |
-
}
|
225 |
-
unset($file);
|
226 |
-
$filerec_ok = true;
|
227 |
-
}
|
228 |
-
//sort files
|
229 |
-
$filelist = wfu_array_sort($filelist, $filesort, $order);
|
230 |
-
//if pagination is activated and a file needs to receive focus, then we
|
231 |
-
//need to calculate the page where the file is shown
|
232 |
-
if ( $maxrows > 0 && $located_file != "" ) {
|
233 |
-
$i = $dirlist_count;
|
234 |
-
foreach ( $filelist as $key => $file ) {
|
235 |
-
if ( $file['name'] == $located_file ) {
|
236 |
-
$located_file_found = true;
|
237 |
-
$filelist[$key]['highlighted'] = 1;
|
238 |
-
break;
|
239 |
-
}
|
240 |
-
$i ++;
|
241 |
-
}
|
242 |
-
if ( $located_file_found ) {
|
243 |
-
$page = floor( $i / $maxrows ) + 1;
|
244 |
-
if ( isset($dirlist_perpage[$page]) ) $dirlist = $dirlist_perpage[$page];
|
245 |
-
else $dirlist = array();
|
246 |
-
}
|
247 |
-
}
|
248 |
-
//if pagination is activated then slice files array to keep only the items
|
249 |
-
//belonging in the current page
|
250 |
-
if ( $maxrows > 0 )
|
251 |
-
$filelist = array_slice($filelist, max(($page - 1) * $maxrows - $dirlist_count, 0), $maxrows - count($dirlist));
|
252 |
-
if ( !$filestat_ok || !$filerec_ok ) {
|
253 |
-
foreach ( $filelist as &$file ) {
|
254 |
-
if ( !$filestat_ok ) {
|
255 |
-
$stat = stat($file['fullpath']);
|
256 |
-
$file['size'] = $stat['size'];
|
257 |
-
$file['mdate'] = $stat['mtime'];
|
258 |
-
}
|
259 |
-
if ( !$filerec_ok ) {
|
260 |
-
if ( preg_match("/\.php$/", $file['fullpath']) ) $filerec = null;
|
261 |
-
else $filerec = wfu_get_file_rec($file['fullpath'], true);
|
262 |
-
$username = ( $filerec != null ? wfu_get_username_by_id($filerec->uploaduserid) : '' );
|
263 |
-
$file['user'] = $username;
|
264 |
-
$file['filedata'] = $filerec;
|
265 |
-
}
|
266 |
-
}
|
267 |
-
unset($file);
|
268 |
-
}
|
269 |
-
}
|
270 |
-
else $filelist = array();
|
271 |
-
|
272 |
-
//start html output
|
273 |
-
$echo_str = "";
|
274 |
-
if ( !$only_table_rows ) {
|
275 |
-
$echo_str .= "\n".'<div class="wrap">';
|
276 |
-
$echo_str .= "\n\t".'<h2>Wordpress File Upload Control Panel</h2>';
|
277 |
-
$echo_str .= "\n\t".'<div style="margin-top:20px;">';
|
278 |
-
$echo_str .= wfu_generate_dashboard_menu("\n\t\t", "File Browser");
|
279 |
-
$echo_str .= "\n\t".'<div>';
|
280 |
-
$echo_str .= "\n\t\t".'<span><strong>Location:</strong> </span>';
|
281 |
-
foreach ( $route as $item ) {
|
282 |
-
// store dir path that we need to pass to other functions in session, instead of exposing it in the url
|
283 |
-
$dir_code = wfu_safe_store_filepath($item['path']);
|
284 |
-
$echo_str .= '<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=file_browser&dir='.$dir_code.'">'.$item['item'].'</a>';
|
285 |
-
$echo_str .= '<span>/</span>';
|
286 |
-
}
|
287 |
-
//file browser header
|
288 |
-
$echo_str .= "\n\t".'</div>';
|
289 |
-
// $dir_code = wfu_safe_store_filepath(wfu_path_abs2rel($basedir).'[['.$sort.']]');
|
290 |
-
// $echo_str .= "\n\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=create_dir&dir='.$dir_code.'" class="button" title="create folder" style="margin-top:6px">Create folder</a>';
|
291 |
-
$echo_str .= "\n\t".'<div style="margin-top:10px; position:relative;">';
|
292 |
-
$echo_str .= wfu_add_loading_overlay("\n\t\t", "adminbrowser");
|
293 |
-
$adminbrowser_nonce = wp_create_nonce( 'wfu-adminbrowser-page' );
|
294 |
-
$echo_str .= "\n\t\t".'<div class="wfu_adminbrowser_header" style="width: 100%;">';
|
295 |
-
$bulkactions = array(
|
296 |
-
array( "name" => "move", "title" => "Move" ),
|
297 |
-
array( "name" => "delete", "title" => "Delete" ),
|
298 |
-
array( "name" => "include", "title" => "Include" )
|
299 |
-
);
|
300 |
-
$echo_str .= wfu_add_bulkactions_header("\n\t\t\t", "adminbrowser", $bulkactions);
|
301 |
-
if ( $maxrows > 0 ) {
|
302 |
-
$echo_str .= wfu_add_pagination_header("\n\t\t\t", "adminbrowser", $page, $pages, $adminbrowser_nonce);
|
303 |
-
}
|
304 |
-
$echo_str .= "\n\t\t\t".'<input id="wfu_adminbrowser_action_url" type="hidden" value="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload" />';
|
305 |
-
$echo_str .= "\n\t\t\t".'<input id="wfu_adminbrowser_code" type="hidden" value="'.$basedir_code.'" />';
|
306 |
-
$echo_str .= "\n\t\t\t".'<input id="wfu_adminbrowser_referer" type="hidden" value="'.$referer_code.'" />';
|
307 |
-
$echo_str .= "\n\t\t\t".'<input id="wfu_download_file_nonce" type="hidden" value="'.wp_create_nonce('wfu_download_file_invoker').'" />';
|
308 |
-
$echo_str .= "\n\t\t\t".'<input id="wfu_include_file_nonce" type="hidden" value="'.wp_create_nonce('wfu_include_file').'" />';
|
309 |
-
$echo_str .= "\n\t\t".'</div>';
|
310 |
-
$echo_str .= "\n\t\t".'<table id="wfu_adminbrowser_table" class="wfu-adminbrowser wp-list-table widefat fixed striped">';
|
311 |
-
$echo_str .= "\n\t\t\t".'<thead>';
|
312 |
-
$echo_str .= "\n\t\t\t\t".'<tr>';
|
313 |
-
$echo_str .= "\n\t\t\t\t\t".'<td scope="col" width="5%" class="manage-column check-column">';
|
314 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<input id="wfu_select_all_visible" type="checkbox" onchange="wfu_adminbrowser_select_all_visible_changed();" style="-webkit-appearance:checkbox;" />';
|
315 |
-
$echo_str .= "\n\t\t\t\t\t".'</td>';
|
316 |
-
$echo_str .= "\n\t\t\t\t\t".'<th scope="col" width="25%" class="manage-column column-primary">';
|
317 |
-
$dir_code = wfu_safe_store_filepath(wfu_path_abs2rel($basedir).'[['.( substr($sort, -4) == 'name' ? ( $order == SORT_ASC ? '-name' : 'name' ) : 'name' ).']]');
|
318 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=file_browser&dir='.$dir_code.'">Name'.( substr($sort, -4) == 'name' ? ( $order == SORT_ASC ? ' ↑' : ' ↓' ) : '' ).'</a>';
|
319 |
-
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
320 |
-
$echo_str .= "\n\t\t\t\t\t".'<th scope="col" width="10%" class="manage-column">';
|
321 |
-
$dir_code = wfu_safe_store_filepath(wfu_path_abs2rel($basedir).'[['.( substr($sort, -4) == 'size' ? ( $order == SORT_ASC ? '-size' : 'size' ) : 'size' ).']]');
|
322 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=file_browser&dir='.$dir_code.'">Size'.( substr($sort, -4) == 'size' ? ( $order == SORT_ASC ? ' ↑' : ' ↓' ) : '' ).'</a>';
|
323 |
-
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
324 |
-
$echo_str .= "\n\t\t\t\t\t".'<th scope="col" width="20%" class="manage-column">';
|
325 |
-
$dir_code = wfu_safe_store_filepath(wfu_path_abs2rel($basedir).'[['.( substr($sort, -4) == 'date' ? ( $order == SORT_ASC ? '-date' : 'date' ) : 'date' ).']]');
|
326 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=file_browser&dir='.$dir_code.'">Date'.( substr($sort, -4) == 'date' ? ( $order == SORT_ASC ? ' ↑' : ' ↓' ) : '' ).'</a>';
|
327 |
-
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
328 |
-
$echo_str .= "\n\t\t\t\t\t".'<th scope="col" width="10%" class="manage-column">';
|
329 |
-
$dir_code = wfu_safe_store_filepath(wfu_path_abs2rel($basedir).'[['.( substr($sort, -4) == 'user' ? ( $order == SORT_ASC ? '-user' : 'user' ) : 'user' ).']]');
|
330 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=file_browser&dir='.$dir_code.'">Uploaded By'.( substr($sort, -4) == 'user' ? ( $order == SORT_ASC ? ' ↑' : ' ↓' ) : '' ).'</a>';
|
331 |
-
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
332 |
-
$echo_str .= "\n\t\t\t\t\t".'<th scope="col" width="30%" class="manage-column">';
|
333 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<label>User Data</label>';
|
334 |
-
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
335 |
-
$echo_str .= "\n\t\t\t\t".'</tr>';
|
336 |
-
$echo_str .= "\n\t\t\t".'</thead>';
|
337 |
-
$echo_str .= "\n\t\t\t".'<tbody>';
|
338 |
-
}
|
339 |
-
|
340 |
-
//show subfolders first
|
341 |
-
if ( $reldir != "root/" ) {
|
342 |
-
$dir_code = wfu_safe_store_filepath(wfu_path_abs2rel($updir));
|
343 |
-
$echo_str .= "\n\t\t\t\t".'<tr>';
|
344 |
-
$echo_str .= "\n\t\t\t\t\t".'<th class="check-column"><input type="checkbox" disabled="disabled" /></th>';
|
345 |
-
$echo_str .= "\n\t\t\t\t\t".'<td class="column-primary" data-colname="Name">';
|
346 |
-
$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=file_browser&dir='.$dir_code.'" title="go up">..</a>';
|
347 |
-
$echo_str .= "\n\t\t\t\t\t".'</td>';
|
348 |
-
$echo_str .= "\n\t\t\t\t\t".'<td data-colname="Size"> </td>';
|
349 |
-
$echo_str .= "\n\t\t\t\t\t".'<td data-colname="Date"> </td>';
|
350 |
-
$echo_str .= "\n\t\t\t\t\t".'<td data-colname="Uploaded By"> </td>';
|
351 |
-
$echo_str .= "\n\t\t\t\t\t".'<td data-colname="User Data"> </td>';
|
352 |
-
$echo_str .= "\n\t\t\t\t".'</tr>';
|
353 |
-
}
|
354 |
-
$ii = 1;
|
355 |
-
foreach ( $dirlist as $dir ) {
|
356 |
-
$dir_code = wfu_safe_store_filepath(wfu_path_abs2rel($dir['fullpath']).'[['.$sort.']]');
|
357 |
-
$echo_str .= "\n\t\t\t\t".'<tr onmouseover="var actions=document.getElementsByName(\'wfu_dir_actions\'); for (var i=0; i<actions.length; i++) {actions[i].style.visibility=\'hidden\';} document.getElementById(\'wfu_dir_actions_'.$ii.'\').style.visibility=\'visible\'" onmouseout="var actions=document.getElementsByName(\'wfu_dir_actions\'); for (var i=0; i<actions.length; i++) {actions[i].style.visibility=\'hidden\';}">';
|
358 |
-
$echo_str .= "\n\t\t\t\t\t".'<th class="check-column"><input type="checkbox" disabled="disabled" /></th>';
|
359 |
-
$echo_str .= "\n\t\t\t\t\t".'<td class="column-primary" data-colname="Name">';
|
360 |
-
$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=file_browser&dir='.$dir_code.'" title="'.$dir['name'].'">'.$dir['name'].'</a>';
|
361 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<div id="wfu_dir_actions_'.$ii.'" name="wfu_dir_actions" style="visibility:hidden;">';
|
362 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<span style="visibility:hidden;">';
|
363 |
-
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=file_browser&dir=">Noaction</a>';
|
364 |
-
$echo_str .= "\n\t\t\t\t\t\t\t\t".' | ';
|
365 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'</span>';
|
366 |
-
// $echo_str .= "\n\t\t\t\t\t\t\t".'<span>';
|
367 |
-
// $echo_str .= "\n\t\t\t\t\t\t\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=rename_dir&file='.$dir_code.'" title="Rename this folder">Rename</a>';
|
368 |
-
// $echo_str .= "\n\t\t\t\t\t\t\t\t".' | ';
|
369 |
-
// $echo_str .= "\n\t\t\t\t\t\t\t".'</span>';
|
370 |
-
// $echo_str .= "\n\t\t\t\t\t\t\t".'<span>';
|
371 |
-
// $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_dir&file='.$dir_code.'" title="Delete this folder">Delete</a>';
|
372 |
-
// $echo_str .= "\n\t\t\t\t\t\t\t".'</span>';
|
373 |
-
$echo_str .= "\n\t\t\t\t\t\t".'</div>';
|
374 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<button type="button" class="toggle-row"><span class="screen-reader-text">Show more details</span></button>';
|
375 |
-
$echo_str .= "\n\t\t\t\t\t".'</td>';
|
376 |
-
$echo_str .= "\n\t\t\t\t\t".'<td data-colname="Size"> </td>';
|
377 |
-
$echo_str .= "\n\t\t\t\t\t".'<td data-colname="Date">'.get_date_from_gmt(date("Y-m-d H:i:s", $dir['mdate']), "d/m/Y H:i:s").'</td>';
|
378 |
-
$echo_str .= "\n\t\t\t\t\t".'<td data-colname="Uploaded By"> </td>';
|
379 |
-
$echo_str .= "\n\t\t\t\t\t".'<td data-colname="User Data"> </td>';
|
380 |
-
$echo_str .= "\n\t\t\t\t".'</tr>';
|
381 |
-
$ii ++;
|
382 |
-
}
|
383 |
-
//show contained files
|
384 |
-
foreach ( $filelist as $file ) {
|
385 |
-
$is_included = ( $file['filedata'] != null );
|
386 |
-
$can_be_included = ( $plugin_options['includeotherfiles'] == "1" ) && !wfu_file_extension_blacklisted($file['name']);
|
387 |
-
$highlighted = ( isset($file['highlighted']) && $file['highlighted'] == 1 );
|
388 |
-
$file_code = '';
|
389 |
-
if ( $is_included || $can_be_included ) $file_code = wfu_safe_store_filepath(wfu_path_abs2rel($file['fullpath']).'[['.$sort.']]');
|
390 |
-
$echo_str .= "\n\t\t\t\t".'<tr '.( $highlighted ? 'class="wfu-highlighted" ' : '' ).'onmouseover="var actions=document.getElementsByName(\'wfu_file_actions\'); for (var i=0; i<actions.length; i++) {actions[i].style.visibility=\'hidden\';} document.getElementById(\'wfu_file_actions_'.$ii.'\').style.visibility=\'visible\'" onmouseout="var actions=document.getElementsByName(\'wfu_file_actions\'); for (var i=0; i<actions.length; i++) {actions[i].style.visibility=\'hidden\';}">';
|
391 |
-
$echo_str .= "\n\t\t\t\t\t".'<th class="check-column">';
|
392 |
-
if ( $is_included || $can_be_included ) $echo_str .= "\n\t\t\t\t\t\t".'<input class="wfu_selectors'.( $is_included ? ' wfu_included' : '' ).' wfu_selcode_'.$file_code.'" type="checkbox" onchange="wfu_adminbrowser_selector_changed(this);" />';
|
393 |
-
else $echo_str .= "\n\t\t\t\t\t\t".'<input type="checkbox" disabled="disabled" />';
|
394 |
-
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
395 |
-
$echo_str .= "\n\t\t\t\t\t".'<td class="column-primary" data-colname="Name">';
|
396 |
-
if ( $is_included || $can_be_included )
|
397 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<a id="wfu_file_link_'.$ii.'" class="row-title" href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=file_details&file='.$file_code.'" title="View and edit file details" style="font-weight:normal;'.( $is_included ? '' : ' display:none;' ).'">'.$file['name'].'</a>';
|
398 |
-
if ( !$is_included )
|
399 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<span id="wfu_file_flat_'.$ii.'">'.$file['name'].'</span>';
|
400 |
-
//set additional $file properties for generating file actions
|
401 |
-
$file["index"] = $ii;
|
402 |
-
$file["code"] = $file_code;
|
403 |
-
$file["referer_code"] = $referer_code;
|
404 |
-
$file_actions = wfu_adminbrowser_file_actions($file, $header_params);
|
405 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<div id="wfu_file_actions_'.$ii.'" name="wfu_file_actions" style="visibility:hidden;">';
|
406 |
-
if ( $is_included || $can_be_included ) {
|
407 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<div id="wfu_file_is_included_actions_'.$ii.'" style="display:'.( $is_included ? 'block' : 'none' ).';">';
|
408 |
-
//add file actions for files already included
|
409 |
-
$array_keys = array_keys($file_actions["is_included"]);
|
410 |
-
$lastkey = array_pop($array_keys);
|
411 |
-
foreach ( $file_actions["is_included"] as $key => $action ) {
|
412 |
-
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<span>';
|
413 |
-
foreach ( $action as $line )
|
414 |
-
$echo_str .= "\n\t\t\t\t\t\t\t\t\t".$line;
|
415 |
-
if ( $key != $lastkey ) $echo_str .= "\n\t\t\t\t\t\t\t\t\t".' | ';
|
416 |
-
$echo_str .= "\n\t\t\t\t\t\t\t\t".'</span>';
|
417 |
-
}
|
418 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'</div>';
|
419 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<div id="wfu_file_can_be_included_actions_'.$ii.'" style="display:'.( $is_included ? 'none' : 'block' ).';">';
|
420 |
-
//add file actions for files that can be included
|
421 |
-
$array_keys = array_keys($file_actions["can_be_included"]);
|
422 |
-
$lastkey = array_pop($array_keys);
|
423 |
-
foreach ( $file_actions["can_be_included"] as $key => $action ) {
|
424 |
-
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<span>';
|
425 |
-
foreach ( $action as $line )
|
426 |
-
$echo_str .= "\n\t\t\t\t\t\t\t\t\t".$line;
|
427 |
-
if ( $key != $lastkey ) $echo_str .= "\n\t\t\t\t\t\t\t\t\t".' | ';
|
428 |
-
$echo_str .= "\n\t\t\t\t\t\t\t\t".'</span>';
|
429 |
-
}
|
430 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'</div>';
|
431 |
-
}
|
432 |
-
else {
|
433 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<span style="visibility:hidden;">';
|
434 |
-
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=file_browser&dir=">Noaction</a>';
|
435 |
-
$echo_str .= "\n\t\t\t\t\t\t\t\t".' | ';
|
436 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'</span>';
|
437 |
-
}
|
438 |
-
$echo_str .= "\n\t\t\t\t\t\t".'</div>';
|
439 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<div id="wfu_file_download_container_'.$ii.'" style="display: none;"></div>';
|
440 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<button type="button" class="toggle-row"><span class="screen-reader-text">Show more details</span></button>';
|
441 |
-
$echo_str .= "\n\t\t\t\t\t".'</td>';
|
442 |
-
$echo_str .= "\n\t\t\t\t\t".'<td data-colname="Size">'.$file['size'].'</td>';
|
443 |
-
$echo_str .= "\n\t\t\t\t\t".'<td data-colname="Date">'.get_date_from_gmt(date("Y-m-d H:i:s", $file['mdate']), "d/m/Y H:i:s").'</td>';
|
444 |
-
$echo_str .= "\n\t\t\t\t\t".'<td data-colname="Uploaded By">'.$file['user'].'</td>';
|
445 |
-
$echo_str .= "\n\t\t\t\t\t".'<td data-colname="User Data">';
|
446 |
-
if ( $is_included ) {
|
447 |
-
if ( count($file['filedata']->userdata) > 0 ) {
|
448 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<select multiple="multiple" style="width:100%; height:40px; background:none; font-size:small;">';
|
449 |
-
foreach ( $file['filedata']->userdata as $userdata )
|
450 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<option>'.$userdata->property.': '.$userdata->propvalue.'</option>';
|
451 |
-
$echo_str .= "\n\t\t\t\t\t\t".'</select>';
|
452 |
-
}
|
453 |
-
}
|
454 |
-
$echo_str .= "\n\t\t\t\t\t".'</td>';
|
455 |
-
$echo_str .= "\n\t\t\t\t".'</tr>';
|
456 |
-
$ii ++;
|
457 |
-
}
|
458 |
-
|
459 |
-
if ( !$only_table_rows ) {
|
460 |
-
$echo_str .= "\n\t\t\t".'</tbody>';
|
461 |
-
$echo_str .= "\n\t\t".'</table>';
|
462 |
-
$echo_str .= "\n\t\t".'<iframe id="wfu_download_frame" style="display: none;"></iframe>';
|
463 |
-
$echo_str .= "\n\t".'</div>';
|
464 |
-
$echo_str .= "\n\t".'</div>';
|
465 |
-
$echo_str .= "\n".'</div>';
|
466 |
-
}
|
467 |
-
if ( $located_file_found ) {
|
468 |
-
$handler = 'function() { wfu_focus_table_on_highlighted_file("wfu_adminbrowser_table"); }';
|
469 |
-
$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>';
|
470 |
-
}
|
471 |
-
|
472 |
-
return $echo_str;
|
473 |
-
}
|
474 |
-
|
475 |
-
function wfu_adminbrowser_file_actions($file, $params) {
|
476 |
-
$siteurl = site_url();
|
477 |
-
$actions = array(
|
478 |
-
"is_included" => array(),
|
479 |
-
"can_be_included" => array()
|
480 |
-
);
|
481 |
-
//add file actions if file is already included
|
482 |
-
$actions["is_included"] += array(
|
483 |
-
array( '<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=file_details&file='.$file["code"].'" title="View and edit file details">Details</a>' ),
|
484 |
-
array( '<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=rename_file&file='.$file["code"].'" title="Rename this file">Rename</a>' ),
|
485 |
-
array( '<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=move_file&file='.$file["code"].'" title="Move this file">Move</a>' ),
|
486 |
-
array( '<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=delete_file&file='.$file["code"].'&referer='.$file["referer_code"].'" title="Delete this file">Delete</a>' ),
|
487 |
-
array( '<a href="javascript:wfu_download_file(\''.$file["code"].'\', '.$file["index"].');" title="Download this file">Download</a>' )
|
488 |
-
);
|
489 |
-
//add file actions if file is already included
|
490 |
-
$actions["can_be_included"] += array(
|
491 |
-
array(
|
492 |
-
'<a id="wfu_include_file_'.$file["index"].'_a" href="javascript:wfu_include_file(\''.$file["code"].'\', '.$file["index"].');" title="Include file in plugin\'s database">Include File</a>',
|
493 |
-
'<img id="wfu_include_file_'.$file["index"].'_img" src="'.WFU_IMAGE_ADMIN_SUBFOLDER_LOADING.'" style="width:12px; display:none;" />',
|
494 |
-
'<input id="wfu_include_file_'.$file["index"].'_inpfail" type="hidden" value="File could not be included!" />'
|
495 |
-
)
|
496 |
-
);
|
497 |
-
|
498 |
-
return $actions;
|
499 |
-
}
|
500 |
-
|
501 |
-
function wfu_user_owns_file($userid, $filerec) {
|
502 |
-
if ( 0 == $userid )
|
503 |
-
return false;
|
504 |
-
if ( current_user_can('manage_options') ) return true;
|
505 |
-
return false;
|
506 |
-
}
|
507 |
-
|
508 |
-
function wfu_current_user_owes_file($filepath) {
|
509 |
-
//first check if file has a restricted extension; for security reasons some file extensions cannot be owned
|
510 |
-
if ( wfu_file_extension_blacklisted($filepath) ) return false;
|
511 |
-
//then get file data from database, if exist
|
512 |
-
$filerec = wfu_get_file_rec($filepath, false);
|
513 |
-
if ( $filerec == null ) return false;
|
514 |
-
|
515 |
-
$user = wp_get_current_user();
|
516 |
-
return wfu_user_owns_file($user->ID, $filerec);
|
517 |
-
}
|
518 |
-
|
519 |
-
function wfu_current_user_allowed_action($action, $filepath) {
|
520 |
-
//first get file data from database, if exist
|
521 |
-
$filerec = wfu_get_file_rec($filepath, false);
|
522 |
-
|
523 |
-
$user = wp_get_current_user();
|
524 |
-
if ( 0 == $user->ID ) return null;
|
525 |
-
else $is_admin = current_user_can('manage_options');
|
526 |
-
if ( !$is_admin ) {
|
527 |
-
return null;
|
528 |
-
}
|
529 |
-
return $user;
|
530 |
-
}
|
531 |
-
|
532 |
-
function wfu_current_user_allowed_action_remote($action, $filepath, $userid) {
|
533 |
-
//first get file data from database, if exist
|
534 |
-
$filerec = wfu_get_file_rec($filepath, false);
|
535 |
-
|
536 |
-
if ( 0 == $userid ) return null;
|
537 |
-
else $is_admin = user_can($userid, 'manage_options');
|
538 |
-
if ( !$is_admin ) {
|
539 |
-
return null;
|
540 |
-
}
|
541 |
-
return true;
|
542 |
-
}
|
543 |
-
|
544 |
-
function wfu_rename_file_prompt($file_code, $type, $error) {
|
545 |
-
if ( $type == 'dir' ) return;
|
546 |
-
|
547 |
-
$siteurl = site_url();
|
548 |
-
|
549 |
-
$is_admin = current_user_can( 'manage_options' );
|
550 |
-
//check if user is allowed to view file details
|
551 |
-
if ( !$is_admin ) {
|
552 |
-
return;
|
553 |
-
}
|
554 |
-
$file_code = wfu_sanitize_code($file_code);
|
555 |
-
$dec_file = wfu_get_filepath_from_safe($file_code);
|
556 |
-
if ( $dec_file === false ) return;
|
557 |
-
|
558 |
-
//first extract sort info from dec_file
|
559 |
-
$ret = wfu_extract_sortdata_from_path($dec_file);
|
560 |
-
$dec_file = wfu_path_rel2abs($ret['path']);
|
561 |
-
if ( $type == 'dir' && substr($dec_file, -1) == '/' ) $dec_file = substr($dec_file, 0, -1);
|
562 |
-
|
563 |
-
//check if user is allowed to perform this action
|
564 |
-
if ( !wfu_current_user_owes_file($dec_file) ) return;
|
565 |
-
|
566 |
-
$parts = pathinfo($dec_file);
|
567 |
-
$newname = $parts['basename'];
|
568 |
-
$dir_code = wfu_safe_store_filepath(wfu_path_abs2rel($parts['dirname']).'[['.$ret['sort'].']]');
|
569 |
-
|
570 |
-
$echo_str = "\n".'<div class="wrap">';
|
571 |
-
if ( $error ) {
|
572 |
-
$rename_file = WFU_USVAR('wfu_rename_file');
|
573 |
-
$newname = $rename_file['newname'];
|
574 |
-
$echo_str .= "\n\t".'<div class="error">';
|
575 |
-
$echo_str .= "\n\t\t".'<p>'.WFU_USVAR('wfu_rename_file_error').'</p>';
|
576 |
-
$echo_str .= "\n\t".'</div>';
|
577 |
-
}
|
578 |
-
$echo_str .= "\n\t".'<div style="margin-top:20px;">';
|
579 |
-
if ( $is_admin ) $echo_str .= "\n\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=file_browser&dir='.$dir_code.'" class="button" title="go back">Go back</a>';
|
580 |
-
$echo_str .= "\n\t".'</div>';
|
581 |
-
$echo_str .= "\n\t".'<h2 style="margin-bottom: 10px;">Rename '.( $type == 'dir' ? 'Folder' : 'File' ).'</h2>';
|
582 |
-
if ( $is_admin ) $echo_str .= "\n\t".'<form enctype="multipart/form-data" name="renamefile" id="renamefile" method="post" action="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload" class="validate">';
|
583 |
-
$echo_str .= "\n\t\t".'<input type="hidden" name="action" value="rename'.( $type == 'dir' ? 'dir' : 'file' ).'">';
|
584 |
-
$echo_str .= "\n\t\t".'<input type="hidden" name="dir" value="'.$dir_code.'">';
|
585 |
-
$echo_str .= "\n\t\t".'<input type="hidden" name="file" value="'.$file_code.'">';
|
586 |
-
if ( $type == 'dir' ) $echo_str .= "\n\t\t".'<label>Enter new name for folder <strong>'.$dec_file.'</strong></label><br/>';
|
587 |
-
elseif ( $is_admin ) $echo_str .= "\n\t\t".'<label>Enter new filename for file <strong>'.$dec_file.'</strong></label><br/>';
|
588 |
-
$echo_str .= "\n\t\t".'<input name="wfu_newname" id="wfu_newname" type="text" value="'.$newname.'" style="width:50%;" />';
|
589 |
-
$echo_str .= "\n\t\t".'<p class="submit">';
|
590 |
-
$echo_str .= "\n\t\t\t".'<input type="submit" class="button-primary" name="submit" value="Rename">';
|
591 |
-
$echo_str .= "\n\t\t\t".'<input type="submit" class="button-primary" name="submit" value="Cancel">';
|
592 |
-
$echo_str .= "\n\t\t".'</p>';
|
593 |
-
$echo_str .= "\n\t".'</form>';
|
594 |
-
$echo_str .= "\n".'</div>';
|
595 |
-
return $echo_str;
|
596 |
-
}
|
597 |
-
|
598 |
-
function wfu_move_file_prompt($file_code, $error) {
|
599 |
-
$siteurl = site_url();
|
600 |
-
|
601 |
-
$is_admin = current_user_can( 'manage_options' );
|
602 |
-
//check if user is allowed to view file details
|
603 |
-
if ( !$is_admin ) return;
|
604 |
-
|
605 |
-
if ( !is_array($file_code) ) $file_code = array( $file_code );
|
606 |
-
$names = array();
|
607 |
-
foreach ( $file_code as $index => $code ) {
|
608 |
-
$file_code[$index] = wfu_sanitize_code($code);
|
609 |
-
$dec_file = wfu_get_filepath_from_safe($file_code[$index]);
|
610 |
-
if ( $dec_file === false ) unset($file_code[$index]);
|
611 |
-
else {
|
612 |
-
//first extract sort info from dec_file
|
613 |
-
$ret = wfu_extract_sortdata_from_path($dec_file);
|
614 |
-
$dec_file = $ret['path'];
|
615 |
-
$parts = pathinfo($dec_file);
|
616 |
-
array_push($names, $parts['basename']);
|
617 |
-
}
|
618 |
-
}
|
619 |
-
if ( count($file_code) == 0 ) return;
|
620 |
-
$file_code_list = "list:".implode(",", $file_code);
|
621 |
-
|
622 |
-
$newpath = $parts['dirname'];
|
623 |
-
$replacefiles = "";
|
624 |
-
$dir_code = wfu_safe_store_filepath($parts['dirname'].'[['.$ret['sort'].']]');
|
625 |
-
|
626 |
-
$echo_str = "\n".'<div class="wrap">';
|
627 |
-
if ( $error ) {
|
628 |
-
$move_file = WFU_USVAR('wfu_move_file');
|
629 |
-
$newpath = $move_file['newpath'];
|
630 |
-
$replacefiles = $move_file['replacefiles'];
|
631 |
-
$echo_str .= "\n\t".'<div class="error">';
|
632 |
-
$echo_str .= "\n\t\t".'<p>'.WFU_USVAR('wfu_move_file_error').'</p>';
|
633 |
-
$echo_str .= "\n\t".'</div>';
|
634 |
-
}
|
635 |
-
$echo_str .= "\n\t".'<div style="margin-top:20px;">';
|
636 |
-
$echo_str .= "\n\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=file_browser&dir='.$dir_code.'" class="button" title="go back">Go back</a>';
|
637 |
-
$echo_str .= "\n\t".'</div>';
|
638 |
-
$echo_str .= "\n\t".'<h2 style="margin-bottom: 10px;">Move File</h2>';
|
639 |
-
$echo_str .= "\n\t".'<form enctype="multipart/form-data" name="movefile" id="movefile" method="post" action="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload" class="validate">';
|
640 |
-
$echo_str .= "\n\t\t".'<input type="hidden" name="action" value="movefile">';
|
641 |
-
$echo_str .= "\n\t\t".'<input type="hidden" name="dir" value="'.$dir_code.'">';
|
642 |
-
$echo_str .= "\n\t\t".'<input type="hidden" name="file" value="'.$file_code_list.'">';
|
643 |
-
if ( count($names) == 1 )
|
644 |
-
$echo_str .= "\n\t\t".'<label style="display:inline-block; margin-bottom:1em;">Enter destination folder for file <strong>'.$dec_file.'</strong></label><br/>';
|
645 |
-
else {
|
646 |
-
$echo_str .= "\n\t\t".'<label>Enter destination folder for files:</label><br/>';
|
647 |
-
$echo_str .= "\n\t\t".'<ul style="padding-left: 20px; list-style: initial;">';
|
648 |
-
foreach ( $names as $name )
|
649 |
-
$echo_str .= "\n\t\t\t".'<li><strong>'.$name.'</strong></li>';
|
650 |
-
$echo_str .= "\n\t\t".'</ul>';
|
651 |
-
}
|
652 |
-
$echo_str .= "\n\t\t".'<input name="wfu_newpath" id="wfu_newpath" type="text" value="'.$newpath.'" style="width:50%;" />';
|
653 |
-
$echo_str .= "\n\t\t".'<p>';
|
654 |
-
$echo_str .= "\n\t\t\t".'<label>Replace files with the same filename at destination:</label><br />';
|
655 |
-
$echo_str .= "\n\t\t\t".'<input name="wfu_replace" id="wfu_replace_yes" type="radio" value="yes"'.( $replacefiles == "yes" ? ' checked="checked"' : '' ).' /><label for="wfu_replace_yes">Yes</label>';
|
656 |
-
$echo_str .= "\n\t\t\t".'<input name="wfu_replace" id="wfu_replace_no" type="radio" value="no"'.( $replacefiles == "no" ? ' checked="checked"' : '' ).' style="margin-left:1em;" /><label for="wfu_replace_no">No</label>';
|
657 |
-
$echo_str .= "\n\t\t".'</p>';
|
658 |
-
$echo_str .= "\n\t\t".'<p class="submit">';
|
659 |
-
$echo_str .= "\n\t\t\t".'<input type="button" class="button-primary" name="submitBtn" value="Move" onclick="if (!document.getElementById(\'wfu_replace_yes\').checked && !document.getElementById(\'wfu_replace_no\').checked) alert(\'Please select if files in destination with the same filename will be replaced or not!\'); else this.form.submit();" />';
|
660 |
-
$echo_str .= "\n\t\t\t".'<input type="submit" class="button-primary" name="submitBtn" value="Cancel" />';
|
661 |
-
$echo_str .= "\n\t\t".'</p>';
|
662 |
-
$echo_str .= "\n\t".'</form>';
|
663 |
-
$echo_str .= "\n".'</div>';
|
664 |
-
return $echo_str;
|
665 |
-
}
|
666 |
-
|
667 |
-
function wfu_rename_file($file_code, $type) {
|
668 |
-
if ( $type == 'dir' ) return;
|
669 |
-
|
670 |
-
$user = wp_get_current_user();
|
671 |
-
$is_admin = current_user_can( 'manage_options' );
|
672 |
-
//check if user is allowed to view file details
|
673 |
-
if ( !$is_admin ) {
|
674 |
-
return;
|
675 |
-
}
|
676 |
-
$file_code = wfu_sanitize_code($file_code);
|
677 |
-
$dec_file = wfu_get_filepath_from_safe($file_code);
|
678 |
-
if ( $dec_file === false ) return;
|
679 |
-
|
680 |
-
$dec_file = wfu_path_rel2abs(wfu_flatten_path($dec_file));
|
681 |
-
if ( $type == 'dir' && substr($dec_file, -1) == '/' ) $dec_file = substr($dec_file, 0, -1);
|
682 |
-
if ( !file_exists($dec_file) ) return;
|
683 |
-
|
684 |
-
//check if user is allowed to perform this action
|
685 |
-
if ( !wfu_current_user_owes_file($dec_file) ) return;
|
686 |
-
|
687 |
-
$parts = pathinfo($dec_file);
|
688 |
-
$error = "";
|
689 |
-
if ( isset($_POST['wfu_newname']) && isset($_POST['submit']) ) {
|
690 |
-
if ( $_POST['submit'] == "Rename" && $_POST['wfu_newname'] != $parts['basename'] ) {
|
691 |
-
$new_file = $parts['dirname'].'/'.$_POST['wfu_newname'];
|
692 |
-
if ( $_POST['wfu_newname'] == "" ) $error = 'Error: New '.( $type == 'dir' ? 'folder ' : 'file' ).'name cannot be empty!';
|
693 |
-
elseif ( preg_match("/[^A-Za-z0-9_.#\-$]/", $_POST['wfu_newname']) ) $error = 'Error: name contained invalid characters that were stripped off! Please try again.';
|
694 |
-
elseif ( substr($_POST['wfu_newname'], -1 - strlen($parts['extension'])) != '.'.$parts['extension'] ) $error = 'Error: new and old file name extensions must be identical! Please correct.';
|
695 |
-
elseif ( wfu_file_extension_blacklisted($_POST['wfu_newname']) ) $error = 'Error: the new file name has an extension that is forbidden for security reasons. Please correct.';
|
696 |
-
elseif ( file_exists($new_file) ) $error = 'Error: The '.( $type == 'dir' ? 'folder' : 'file' ).' <strong>'.$_POST['wfu_newname'].'</strong> already exists! Please choose another one.';
|
697 |
-
else {
|
698 |
-
//pre-log rename action
|
699 |
-
if ( $type == 'file' ) $retid = wfu_log_action('rename:'.$new_file, $dec_file, $user->ID, '', 0, 0, '', null);
|
700 |
-
//perform rename action
|
701 |
-
if ( rename($dec_file, $new_file) == false ) $error = 'Error: Rename of '.( $type == 'dir' ? 'folder' : 'file' ).' <strong>'.$parts['basename'].'</strong> failed!';
|
702 |
-
//revert log action if file was not renamed
|
703 |
-
if ( $type == 'file' && !file_exists($new_file) ) wfu_revert_log_action($retid);
|
704 |
-
}
|
705 |
-
}
|
706 |
-
}
|
707 |
-
if ( $error != "" ) {
|
708 |
-
WFU_USVAR_store('wfu_rename_file_error', $error);
|
709 |
-
$rename_file = WFU_USVAR('wfu_rename_file');
|
710 |
-
$rename_file['newname'] = preg_replace("/[^A-Za-z0-9_.#\-$]/", "", $_POST['wfu_newname']);
|
711 |
-
WFU_USVAR_store('wfu_rename_file', $rename_file);
|
712 |
-
}
|
713 |
-
return ( $error == "" );
|
714 |
-
}
|
715 |
-
|
716 |
-
function wfu_move_file($file_code) {
|
717 |
-
$user = wp_get_current_user();
|
718 |
-
$is_admin = current_user_can( 'manage_options' );
|
719 |
-
//check if user is allowed to view file details
|
720 |
-
if ( !$is_admin ) return;
|
721 |
-
|
722 |
-
if ( !is_array($file_code) ) $file_code = array( $file_code );
|
723 |
-
$dec_files = array();
|
724 |
-
foreach ( $file_code as $index => $code ) {
|
725 |
-
$file_code[$index] = wfu_sanitize_code($code);
|
726 |
-
$dec_file = wfu_get_filepath_from_safe($file_code[$index]);
|
727 |
-
if ( $dec_file !== false ) {
|
728 |
-
$dec_file = wfu_path_rel2abs(wfu_flatten_path($dec_file));
|
729 |
-
array_push($dec_files, $dec_file);
|
730 |
-
}
|
731 |
-
}
|
732 |
-
if ( count($dec_files) == 0 ) return;
|
733 |
-
|
734 |
-
$parts = pathinfo($dec_files[0]);
|
735 |
-
$error = "";
|
736 |
-
$regex = "/([^A-Za-z0-9\-._~!$&'()*+,;=:@#\/\\\\%]|%[^A-Fa-f0-9][^A-Fa-f0-9]|%[A-Fa-f0-9][^A-Fa-f0-9]|%[^A-Fa-f0-9][A-Fa-f0-9]|%.?$)/";
|
737 |
-
if ( isset($_POST['wfu_newpath']) && isset($_POST['wfu_replace']) ) {
|
738 |
-
$oldpath = $parts['dirname'];
|
739 |
-
if ( substr($oldpath, -1) != '/' ) $oldpath = $oldpath.'/';
|
740 |
-
$newpath = preg_replace($regex, "", $_POST['wfu_newpath']);
|
741 |
-
if ( substr($newpath, 0, 1) != '/' ) $newpath = '/'.$newpath;
|
742 |
-
$newpath = realpath(wfu_path_rel2abs($newpath));
|
743 |
-
if ( substr($newpath, -1) != '/' ) $newpath = $newpath.'/';
|
744 |
-
$replacefiles = ( $_POST['wfu_replace'] == 'yes' ? 'yes' : ( $_POST['wfu_replace'] == 'no' ? 'no' : '' ) );
|
745 |
-
if ( trim($_POST['wfu_newpath']) == "" ) $error = 'Error: Destination path cannot be empty!';
|
746 |
-
elseif ( $newpath == $oldpath ) $error = 'Error: Destination path is the same as source path!';
|
747 |
-
elseif ( preg_match($regex, $_POST['wfu_newpath']) ) $error = 'Error: path contained invalid characters that were stripped off! Please try again.';
|
748 |
-
elseif ( !file_exists($newpath) ) $error = 'Error: Destination folder <strong>'.$_POST['wfu_newpath'].'</strong> does not exist!';
|
749 |
-
elseif ( $replacefiles == "" ) $error = 'Error: Invalid selection about replacing files with same filename at destination!';
|
750 |
-
else {
|
751 |
-
foreach ( $dec_files as $dec_file ) {
|
752 |
-
if ( file_exists($dec_file) ) {
|
753 |
-
$new_file = $newpath.wfu_basename($dec_file);
|
754 |
-
if ( !file_exists($new_file) || $replacefiles == "yes" ) {
|
755 |
-
//pre-log move action
|
756 |
-
$retid = wfu_log_action('move:'.$new_file, $dec_file, $user->ID, '', 0, 0, '', null);
|
757 |
-
//perform move action
|
758 |
-
if ( @rename($dec_file, $new_file) === false || !file_exists($new_file) ) {
|
759 |
-
wfu_revert_log_action($retid);
|
760 |
-
}
|
761 |
-
}
|
762 |
-
}
|
763 |
-
}
|
764 |
-
}
|
765 |
-
}
|
766 |
-
if ( $error != "" ) {
|
767 |
-
WFU_USVAR_store('wfu_move_file_error', $error);
|
768 |
-
$move_file = WFU_USVAR('wfu_move_file');
|
769 |
-
$move_file['newpath'] = preg_replace($regex, "", $_POST['wfu_newpath']);
|
770 |
-
$move_file['replacefiles'] = $replacefiles;
|
771 |
-
WFU_USVAR_store('wfu_move_file', $move_file);
|
772 |
-
}
|
773 |
-
return ( $error == "" );
|
774 |
-
}
|
775 |
-
|
776 |
-
function wfu_delete_file_prompt($file_code, $type, $referer) {
|
777 |
-
if ( $type == 'dir' ) return;
|
778 |
-
|
779 |
-
$siteurl = site_url();
|
780 |
-
|
781 |
-
$is_admin = current_user_can( 'manage_options' );
|
782 |
-
//check if user is allowed to view file details
|
783 |
-
if ( !$is_admin ) {
|
784 |
-
return;
|
785 |
-
}
|
786 |
-
if ( !is_array($file_code) ) $file_code = array( $file_code );
|
787 |
-
$names = array();
|
788 |
-
foreach ( $file_code as $index => $code ) {
|
789 |
-
$file_code[$index] = wfu_sanitize_code($code);
|
790 |
-
$dec_file = wfu_get_filepath_from_safe($file_code[$index]);
|
791 |
-
if ( $dec_file === false ) unset($file_code[$index]);
|
792 |
-
else {
|
793 |
-
//first extract sort info from dec_file
|
794 |
-
$ret = wfu_extract_sortdata_from_path($dec_file);
|
795 |
-
$dec_file = wfu_path_rel2abs($ret['path']);
|
796 |
-
if ( $type == 'dir' && substr($dec_file, -1) == '/' ) $dec_file = substr($dec_file, 0, -1);
|
797 |
-
//check if user is allowed to perform this action
|
798 |
-
if ( !wfu_current_user_owes_file($dec_file) ) unset($file_code[$index]);
|
799 |
-
else {
|
800 |
-
$parts = pathinfo($dec_file);
|
801 |
-
array_push($names, $parts['basename']);
|
802 |
-
}
|
803 |
-
}
|
804 |
-
}
|
805 |
-
if ( count($file_code) == 0 ) return;
|
806 |
-
$file_code_list = "list:".implode(",", $file_code);
|
807 |
-
|
808 |
-
$referer_url = wfu_get_filepath_from_safe(wfu_sanitize_code($referer));
|
809 |
-
$ret = wfu_extract_sortdata_from_path($referer_url);
|
810 |
-
$referer_url = $ret['path'];
|
811 |
-
|
812 |
-
$echo_str = "\n".'<div class="wrap">';
|
813 |
-
$echo_str .= "\n\t".'<div style="margin-top:20px;">';
|
814 |
-
if ( $is_admin ) $echo_str .= "\n\t\t".'<a href="'.$referer_url.'" class="button" title="go back">Go back</a>';
|
815 |
-
$echo_str .= "\n\t".'</div>';
|
816 |
-
$echo_str .= "\n\t".'<h2 style="margin-bottom: 10px;">Delete '.( $type == 'dir' ? 'Folder' : 'File'.( count($names) == 1 ? '' : 's' ) ).'</h2>';
|
817 |
-
if ( $is_admin ) $echo_str .= "\n\t".'<form enctype="multipart/form-data" name="deletefile" id="deletefile" method="post" action="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload" class="validate">';
|
818 |
-
$echo_str .= "\n\t\t".'<input type="hidden" name="action" value="delete'.( $type == 'dir' ? 'dir' : 'file' ).'">';
|
819 |
-
$echo_str .= "\n\t\t".'<input type="hidden" name="referer" value="'.$referer.'">';
|
820 |
-
$echo_str .= "\n\t\t".'<input type="hidden" name="file" value="'.$file_code_list.'">';
|
821 |
-
if ( count($names) == 1 )
|
822 |
-
$echo_str .= "\n\t\t".'<label>Are you sure that you want to delete '.( $type == 'dir' ? 'folder' : 'file' ).' <strong>'.$names[0].'</strong>?</label><br/>';
|
823 |
-
else {
|
824 |
-
$echo_str .= "\n\t\t".'<label>Are you sure that you want to delete '.( $type == 'dir' ? 'folder' : 'files' ).':';
|
825 |
-
$echo_str .= "\n\t\t".'<ul style="padding-left: 20px; list-style: initial;">';
|
826 |
-
foreach ( $names as $name )
|
827 |
-
$echo_str .= "\n\t\t\t".'<li><strong>'.$name.'</strong></li>';
|
828 |
-
$echo_str .= "\n\t\t".'</ul>';
|
829 |
-
}
|
830 |
-
$echo_str .= "\n\t\t".'<p class="submit">';
|
831 |
-
$echo_str .= "\n\t\t\t".'<input type="submit" class="button-primary" name="submit" value="Delete">';
|
832 |
-
$echo_str .= "\n\t\t\t".'<input type="submit" class="button-primary" name="submit" value="Cancel">';
|
833 |
-
$echo_str .= "\n\t\t".'</p>';
|
834 |
-
$echo_str .= "\n\t".'</form>';
|
835 |
-
$echo_str .= "\n".'</div>';
|
836 |
-
return $echo_str;
|
837 |
-
}
|
838 |
-
|
839 |
-
function wfu_delete_file($file_code, $type) {
|
840 |
-
if ( $type == 'dir' ) return;
|
841 |
-
|
842 |
-
$user = wp_get_current_user();
|
843 |
-
$is_admin = current_user_can( 'manage_options' );
|
844 |
-
//check if user is allowed to view file details
|
845 |
-
if ( !$is_admin ) {
|
846 |
-
return;
|
847 |
-
}
|
848 |
-
if ( !is_array($file_code) ) $file_code = array( $file_code );
|
849 |
-
$dec_files = array();
|
850 |
-
foreach ( $file_code as $index => $code ) {
|
851 |
-
$file_code[$index] = wfu_sanitize_code($code);
|
852 |
-
$dec_file = wfu_get_filepath_from_safe($file_code[$index]);
|
853 |
-
if ( $dec_file !== false ) {
|
854 |
-
$dec_file = wfu_path_rel2abs(wfu_flatten_path($dec_file));
|
855 |
-
if ( $type == 'dir' && substr($dec_file, -1) == '/' ) $dec_file = substr($dec_file, 0, -1);
|
856 |
-
//check if user is allowed to perform this action
|
857 |
-
if ( wfu_current_user_owes_file($dec_file) ) array_push($dec_files, $dec_file);
|
858 |
-
}
|
859 |
-
}
|
860 |
-
if ( count($dec_files) == 0 ) return;
|
861 |
-
|
862 |
-
if ( isset($_POST['submit']) ) {
|
863 |
-
if ( $_POST['submit'] == "Delete" ) {
|
864 |
-
foreach ( $dec_files as $dec_file ) {
|
865 |
-
//pre-log delete action
|
866 |
-
if ( $type == 'file' ) wfu_delete_file_execute($dec_file, $user->ID);
|
867 |
-
elseif ( $type == 'dir' && $dec_file != "" ) wfu_delTree($dec_file);
|
868 |
-
}
|
869 |
-
}
|
870 |
-
}
|
871 |
-
return true;
|
872 |
-
}
|
873 |
-
|
874 |
-
function wfu_create_dir_prompt($dir_code, $error) {
|
875 |
-
return;
|
876 |
-
|
877 |
-
$siteurl = site_url();
|
878 |
-
|
879 |
-
if ( !current_user_can( 'manage_options' ) ) return;
|
880 |
-
|
881 |
-
$dir_code = wfu_sanitize_code($dir_code);
|
882 |
-
$dec_dir = wfu_get_filepath_from_safe($dir_code);
|
883 |
-
if ( $dec_dir === false ) return;
|
884 |
-
|
885 |
-
//first extract sort info from dec_dir
|
886 |
-
$ret = wfu_extract_sortdata_from_path($dec_dir);
|
887 |
-
$dec_dir = wfu_path_rel2abs($ret['path']);
|
888 |
-
if ( substr($dec_dir, -1) != '/' ) $dec_dir .= '/';
|
889 |
-
$newname = '';
|
890 |
-
|
891 |
-
$echo_str = "\n".'<div class="wrap">';
|
892 |
-
if ( $error ) {
|
893 |
-
$create_dir = WFU_USVAR('wfu_create_dir');
|
894 |
-
$newname = $create_dir['newname'];
|
895 |
-
$echo_str .= "\n\t".'<div class="error">';
|
896 |
-
$echo_str .= "\n\t\t".'<p>'.WFU_USVAR('wfu_create_dir_error').'</p>';
|
897 |
-
$echo_str .= "\n\t".'</div>';
|
898 |
-
}
|
899 |
-
$echo_str .= "\n\t".'<div style="margin-top:20px;">';
|
900 |
-
$echo_str .= "\n\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=file_browser&dir='.$dir_code.'" class="button" title="go back">Go back</a>';
|
901 |
-
$echo_str .= "\n\t".'</div>';
|
902 |
-
$echo_str .= "\n\t".'<h2 style="margin-bottom: 10px;">Create Folder</h2>';
|
903 |
-
$echo_str .= "\n\t".'<form enctype="multipart/form-data" name="createdir" id="createdir" method="post" action="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload" class="validate">';
|
904 |
-
$echo_str .= "\n\t\t".'<input type="hidden" name="action" value="createdir">';
|
905 |
-
$echo_str .= "\n\t\t".'<input type="hidden" name="dir" value="'.$dir_code.'">';
|
906 |
-
$echo_str .= "\n\t\t".'<label>Enter the name of the new folder inside <strong>'.$dec_dir.'</strong></label><br/>';
|
907 |
-
$echo_str .= "\n\t\t".'<input name="wfu_newname" id="wfu_newname" type="text" value="'.$newname.'" style="width:50%;" />';
|
908 |
-
$echo_str .= "\n\t\t".'<p class="submit">';
|
909 |
-
$echo_str .= "\n\t\t\t".'<input type="submit" class="button-primary" name="submit" value="Create">';
|
910 |
-
$echo_str .= "\n\t\t\t".'<input type="submit" class="button-primary" name="submit" value="Cancel">';
|
911 |
-
$echo_str .= "\n\t\t".'</p>';
|
912 |
-
$echo_str .= "\n\t".'</form>';
|
913 |
-
$echo_str .= "\n".'</div>';
|
914 |
-
return $echo_str;
|
915 |
-
}
|
916 |
-
|
917 |
-
function wfu_create_dir($dir_code) {
|
918 |
-
return;
|
919 |
-
|
920 |
-
if ( !current_user_can( 'manage_options' ) ) return;
|
921 |
-
|
922 |
-
$dir_code = wfu_sanitize_code($dir_code);
|
923 |
-
$dec_dir = wfu_get_filepath_from_safe($dir_code);
|
924 |
-
if ( $dec_dir === false ) return;
|
925 |
-
|
926 |
-
$dec_dir = wfu_path_rel2abs(wfu_flatten_path($dec_dir));
|
927 |
-
if ( substr($dec_dir, -1) != '/' ) $dec_dir .= '/';
|
928 |
-
if ( !file_exists($dec_dir) ) return;
|
929 |
-
$error = "";
|
930 |
-
if ( isset($_POST['wfu_newname']) && isset($_POST['submit']) ) {
|
931 |
-
if ( $_POST['submit'] == "Create" ) {
|
932 |
-
$new_dir = $dec_dir.$_POST['wfu_newname'];
|
933 |
-
if ( $_POST['wfu_newname'] == "" ) $error = 'Error: New folder name cannot be empty!';
|
934 |
-
elseif ( preg_match("/[^A-Za-z0-9_.#\-$]/", $_POST['wfu_newname']) ) $error = 'Error: name contained invalid characters that were stripped off! Please try again.';
|
935 |
-
elseif ( file_exists($new_dir) ) $error = 'Error: The folder <strong>'.$_POST['wfu_newname'].'</strong> already exists! Please choose another one.';
|
936 |
-
elseif ( mkdir($new_dir) == false ) $error = 'Error: Creation of folder <strong>'.$_POST['wfu_newname'].'</strong> failed!';
|
937 |
-
}
|
938 |
-
}
|
939 |
-
if ( $error != "" ) {
|
940 |
-
WFU_USVAR_store('wfu_create_dir_error', $error);
|
941 |
-
$create_dir = WFU_USVAR('wfu_create_dir');
|
942 |
-
$create_dir['newname'] = preg_replace("/[^A-Za-z0-9_.#\-$]/", "", $_POST['wfu_newname']);
|
943 |
-
WFU_USVAR_store('wfu_create_dir', $create_dir);
|
944 |
-
}
|
945 |
-
return ( $error == "" );
|
946 |
-
}
|
947 |
-
|
948 |
-
function wfu_include_file_prompt($file_code, $referer) {
|
949 |
-
if ( !current_user_can( 'manage_options' ) ) return;
|
950 |
-
$plugin_options = wfu_decode_plugin_options(get_option( "wordpress_file_upload_options" ));
|
951 |
-
if ( $plugin_options['includeotherfiles'] != "1" ) return;
|
952 |
-
|
953 |
-
$siteurl = site_url();
|
954 |
-
if ( !is_array($file_code) ) $file_code = array( $file_code );
|
955 |
-
$names = array();
|
956 |
-
foreach ( $file_code as $index => $code ) {
|
957 |
-
$file_code[$index] = wfu_sanitize_code($code);
|
958 |
-
$dec_file = wfu_get_filepath_from_safe($file_code[$index]);
|
959 |
-
if ( $dec_file === false ) unset($file_code[$index]);
|
960 |
-
else {
|
961 |
-
$dec_file = wfu_path_rel2abs(wfu_flatten_path($dec_file));
|
962 |
-
//do not include file if it has a forbidden extention or it is already included
|
963 |
-
if ( wfu_file_extension_blacklisted(wfu_basename($dec_file)) || wfu_get_file_rec($dec_file, false) != null )
|
964 |
-
unset($file_code[$index]);
|
965 |
-
else array_push($names, wfu_basename($dec_file));
|
966 |
-
}
|
967 |
-
}
|
968 |
-
if ( count($file_code) == 0 ) return;
|
969 |
-
$file_code_list = "list:".implode(",", $file_code);
|
970 |
-
|
971 |
-
$referer_url = wfu_get_filepath_from_safe(wfu_sanitize_code($referer));
|
972 |
-
$ret = wfu_extract_sortdata_from_path($referer_url);
|
973 |
-
$referer_url = $ret['path'];
|
974 |
-
|
975 |
-
$echo_str = "\n".'<div class="wrap">';
|
976 |
-
$echo_str .= "\n\t".'<div style="margin-top:20px;">';
|
977 |
-
$echo_str .= "\n\t\t".'<a href="'.$referer_url.'" class="button" title="go back">Go back</a>';
|
978 |
-
$echo_str .= "\n\t".'</div>';
|
979 |
-
$echo_str .= "\n\t".'<h2 style="margin-bottom: 10px;">Include File'.( count($names) == 1 ? '' : 's' ).'</h2>';
|
980 |
-
$echo_str .= "\n\t".'<form enctype="multipart/form-data" name="includefile" id="includefile" method="post" action="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload" class="validate">';
|
981 |
-
$echo_str .= "\n\t\t".'<input type="hidden" name="action" value="includefile">';
|
982 |
-
$echo_str .= "\n\t\t".'<input type="hidden" name="referer" value="'.$referer.'">';
|
983 |
-
$echo_str .= "\n\t\t".'<input type="hidden" name="file" value="'.$file_code_list.'">';
|
984 |
-
if ( count($names) == 1 )
|
985 |
-
$echo_str .= "\n\t\t".'<label>Are you sure that you want to include file <strong>'.$names[0].'</strong>?</label><br/>';
|
986 |
-
else {
|
987 |
-
$echo_str .= "\n\t\t".'<label>Are you sure that you want to include files:';
|
988 |
-
$echo_str .= "\n\t\t".'<ul style="padding-left: 20px; list-style: initial;">';
|
989 |
-
foreach ( $names as $name )
|
990 |
-
$echo_str .= "\n\t\t\t".'<li><strong>'.$name.'</strong></li>';
|
991 |
-
$echo_str .= "\n\t\t".'</ul>';
|
992 |
-
}
|
993 |
-
$echo_str .= "\n\t\t".'<p class="submit">';
|
994 |
-
$echo_str .= "\n\t\t\t".'<input type="submit" class="button-primary" name="submit" value="Include">';
|
995 |
-
$echo_str .= "\n\t\t\t".'<input type="submit" class="button-primary" name="submit" value="Cancel">';
|
996 |
-
$echo_str .= "\n\t\t".'</p>';
|
997 |
-
$echo_str .= "\n\t".'</form>';
|
998 |
-
$echo_str .= "\n".'</div>';
|
999 |
-
return $echo_str;
|
1000 |
-
}
|
1001 |
-
|
1002 |
-
function wfu_include_file($file_code) {
|
1003 |
-
if ( !current_user_can( 'manage_options' ) ) return;
|
1004 |
-
$plugin_options = wfu_decode_plugin_options(get_option( "wordpress_file_upload_options" ));
|
1005 |
-
if ( $plugin_options['includeotherfiles'] != "1" ) return;
|
1006 |
-
|
1007 |
-
if ( !is_array($file_code) ) $file_code = array( $file_code );
|
1008 |
-
$dec_files = array();
|
1009 |
-
foreach ( $file_code as $index => $code ) {
|
1010 |
-
$file_code[$index] = wfu_sanitize_code($code);
|
1011 |
-
$dec_file = wfu_get_filepath_from_safe($file_code[$index]);
|
1012 |
-
if ( $dec_file !== false ) {
|
1013 |
-
$dec_file = wfu_path_rel2abs(wfu_flatten_path($dec_file));
|
1014 |
-
//include file if it does not have a forbidden extention and it not already included
|
1015 |
-
if ( !wfu_file_extension_blacklisted(wfu_basename($dec_file)) && wfu_get_file_rec($dec_file, false) == null )
|
1016 |
-
array_push($dec_files, $dec_file);
|
1017 |
-
}
|
1018 |
-
}
|
1019 |
-
if ( count($dec_files) == 0 ) return;
|
1020 |
-
|
1021 |
-
$user = wp_get_current_user();
|
1022 |
-
if ( isset($_POST['submit']) ) {
|
1023 |
-
if ( $_POST['submit'] == "Include" ) {
|
1024 |
-
foreach ( $dec_files as $dec_file )
|
1025 |
-
$fileid = wfu_log_action('include', $dec_file, $user->ID, '', '', get_current_blog_id(), '', null);
|
1026 |
-
}
|
1027 |
-
}
|
1028 |
-
return true;
|
1029 |
-
}
|
1030 |
-
|
1031 |
-
function wfu_file_details($file_code, $errorstatus, $invoker = '') {
|
1032 |
-
$siteurl = site_url();
|
1033 |
-
$allow_obsolete = false;
|
1034 |
-
$file_exists = true;
|
1035 |
-
$file_belongs = true;
|
1036 |
-
$admin_can_edit = true;
|
1037 |
-
|
1038 |
-
//if $file_code starts with 'byID:', then it contains a db record ID and not
|
1039 |
-
//a file path; in this case we show the properties of the specific record
|
1040 |
-
//and all linked ones, even if it is obsolete; this is only allowed for
|
1041 |
-
//admins
|
1042 |
-
if ( substr($file_code, 0, 5) == "byID:" ) {
|
1043 |
-
$allow_obsolete = true;
|
1044 |
-
$file_code = substr($file_code, 5);
|
1045 |
-
}
|
1046 |
-
|
1047 |
-
$user = wp_get_current_user();
|
1048 |
-
$is_admin = current_user_can( 'manage_options' );
|
1049 |
-
//check if user is allowed to view file details
|
1050 |
-
if ( !$is_admin ) {
|
1051 |
-
if ( $allow_obsolete ) return;
|
1052 |
-
return;
|
1053 |
-
}
|
1054 |
-
if ( $allow_obsolete ) {
|
1055 |
-
$file_code = wfu_sanitize_int($file_code);
|
1056 |
-
$initialrec = wfu_get_file_rec_from_id($file_code, true);
|
1057 |
-
if ( $initialrec == null ) return;
|
1058 |
-
|
1059 |
-
//get all associated file records
|
1060 |
-
$filerecs = wfu_get_rec_new_history($initialrec->idlog);
|
1061 |
-
//get the latest record of this upload
|
1062 |
-
$filerec = $filerecs[count($filerecs) - 1];
|
1063 |
-
$filerec->userdata = $initialrec->userdata;
|
1064 |
-
|
1065 |
-
$filepath = wfu_path_rel2abs($filerec->filepath);
|
1066 |
-
//in the case of $allow_obsolete we need to check if the file exists and
|
1067 |
-
//if it belongs to the current record
|
1068 |
-
$latestrec = wfu_get_file_rec($filepath, true);
|
1069 |
-
$file_exists = ( $latestrec != null );
|
1070 |
-
$file_belongs = ( $file_exists && $latestrec->idlog == $filerec->idlog );
|
1071 |
-
$admin_can_edit = $file_exists;
|
1072 |
-
|
1073 |
-
//extract file parts and file properties
|
1074 |
-
$parts = pathinfo($filepath);
|
1075 |
-
if ( $file_exists ) $stat = stat($filepath);
|
1076 |
-
else $stat['mtime'] = '';
|
1077 |
-
}
|
1078 |
-
else {
|
1079 |
-
$file_code = wfu_sanitize_code($file_code);
|
1080 |
-
$dec_file = wfu_get_filepath_from_safe($file_code);
|
1081 |
-
if ( $dec_file === false ) return;
|
1082 |
-
|
1083 |
-
//extract file browser data from $file variable
|
1084 |
-
$ret = wfu_extract_sortdata_from_path($dec_file);
|
1085 |
-
$filepath = wfu_path_rel2abs($ret['path']);
|
1086 |
-
|
1087 |
-
//check if user is allowed to perform this action
|
1088 |
-
if ( !wfu_current_user_owes_file($filepath) ) return;
|
1089 |
-
|
1090 |
-
//get file data from database with user data
|
1091 |
-
$filerec = wfu_get_file_rec($filepath, true);
|
1092 |
-
if ( $filerec == null ) return;
|
1093 |
-
|
1094 |
-
//extract sort info and construct contained dir
|
1095 |
-
$parts = pathinfo($filepath);
|
1096 |
-
$dir_code = wfu_safe_store_filepath(wfu_path_abs2rel($parts['dirname']).'[['.$ret['sort'].']]');
|
1097 |
-
|
1098 |
-
$stat = stat($filepath);
|
1099 |
-
}
|
1100 |
-
|
1101 |
-
$echo_str = '<div class="regev_wrap">';
|
1102 |
-
if ( $errorstatus == 'error' ) {
|
1103 |
-
$echo_str .= "\n\t".'<div class="error">';
|
1104 |
-
$echo_str .= "\n\t\t".'<p>'.WFU_USVAR('wfu_filedetails_error').'</p>';
|
1105 |
-
$echo_str .= "\n\t".'</div>';
|
1106 |
-
}
|
1107 |
-
//show file detais
|
1108 |
-
$echo_str .= "\n\t".'<h2>Detais of File: '.$parts['basename'].'</h2>';
|
1109 |
-
if ( !$file_exists ) {
|
1110 |
-
$echo_str .= "\n\t\t".'<div class="notice notice-warning">';
|
1111 |
-
$echo_str .= "\n\t\t\t".'<p>File does not exist on the server anymore!</p>';
|
1112 |
-
$echo_str .= "\n\t\t".'</div>';
|
1113 |
-
}
|
1114 |
-
elseif ( !$file_belongs ) {
|
1115 |
-
$echo_str .= "\n\t\t".'<div class="notice notice-warning">';
|
1116 |
-
$echo_str .= "\n\t\t\t".'<p>This record is old. The file is associated with another record.</p>';
|
1117 |
-
$echo_str .= "\n\t\t".'</div>';
|
1118 |
-
}
|
1119 |
-
$echo_str .= "\n\t".'<div style="margin-top:10px;">';
|
1120 |
-
if ( $is_admin ) {
|
1121 |
-
$invoker_action = ( $invoker == '' ? false : wfu_get_browser_params_from_safe($invoker) );
|
1122 |
-
$goback_action = ( $invoker_action === false ? 'file_browser&dir='.$dir_code : $invoker_action );
|
1123 |
-
if ( substr($goback_action, 0, 18) == "wfu_uploaded_files" )
|
1124 |
-
$echo_str .= "\n\t\t".'<a href="'.$siteurl.'/wp-admin/admin.php?page='.$goback_action.'" class="button" title="go back">Go back</a>';
|
1125 |
-
elseif ( $goback_action != "no_referer" )
|
1126 |
-
$echo_str .= "\n\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action='.$goback_action.'" class="button" title="go back">Go back</a>';
|
1127 |
-
$echo_str .= "\n\t\t".'<form enctype="multipart/form-data" name="editfiledetails" id="editfiledetails" method="post" action="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=edit_filedetails" class="validate">';
|
1128 |
-
}
|
1129 |
-
$echo_str .= "\n\t\t\t".'<h3 style="margin-bottom: 10px; margin-top: 40px;">Upload Details</h3>';
|
1130 |
-
$echo_str .= "\n\t\t\t".'<input type="hidden" name="action" value="edit_filedetails" />';
|
1131 |
-
//$echo_str .= "\n\t\t\t".'<input type="hidden" name="dir" value="'.$dir_code.'">';
|
1132 |
-
$echo_str .= "\n\t\t\t".'<input type="hidden" name="invoker" value="'.$invoker.'">';
|
1133 |
-
$echo_str .= "\n\t\t\t".'<input type="hidden" name="file" value="'.( $allow_obsolete ? 'byID:'.$file_code : $file_code ).'">';
|
1134 |
-
$echo_str .= "\n\t\t\t".'<table class="form-table">';
|
1135 |
-
$echo_str .= "\n\t\t\t\t".'<tbody>';
|
1136 |
-
if ( $is_admin ) {
|
1137 |
-
$echo_str .= "\n\t\t\t\t\t".'<tr>';
|
1138 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<th scope="row">';
|
1139 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<label>Full Path</label>';
|
1140 |
-
$echo_str .= "\n\t\t\t\t\t\t".'</th>';
|
1141 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<td>';
|
1142 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<input type="text" value="'.$filepath.'" readonly="readonly" style="width:50%;" />';
|
1143 |
-
$echo_str .= "\n\t\t\t\t\t\t".'</td>';
|
1144 |
-
$echo_str .= "\n\t\t\t\t\t".'</tr>';
|
1145 |
-
$echo_str .= "\n\t\t\t\t\t".'<tr>';
|
1146 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<th scope="row">';
|
1147 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<label>Uploaded By User</label>';
|
1148 |
-
$echo_str .= "\n\t\t\t\t\t\t".'</th>';
|
1149 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<td>';
|
1150 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<select id="wfu_filedetails_users" disabled="disabled">';
|
1151 |
-
//get all users
|
1152 |
-
$
|
1153 |
-
|
1154 |
-
|
1155 |
-
$
|
1156 |
-
|
1157 |
-
|
1158 |
-
|
1159 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<a class="button" id="
|
1160 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<
|
1161 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<
|
1162 |
-
|
1163 |
-
|
1164 |
-
|
1165 |
-
|
1166 |
-
|
1167 |
-
|
1168 |
-
$echo_str .= "\n\t\t\t\t\t
|
1169 |
-
$echo_str .= "\n\t\t\t\t\t\t".'
|
1170 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<
|
1171 |
-
$echo_str .= "\n\t\t\t\t\t\t
|
1172 |
-
$echo_str .= "\n\t\t\t\t\t\t".'
|
1173 |
-
$echo_str .= "\n\t\t\t\t\t".'
|
1174 |
-
$echo_str .= "\n\t\t\t\t\t".'
|
1175 |
-
$echo_str .= "\n\t\t\t\t\t
|
1176 |
-
$echo_str .= "\n\t\t\t\t\t
|
1177 |
-
$echo_str .= "\n\t\t\t\t\t\t".'
|
1178 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<
|
1179 |
-
$echo_str .= "\n\t\t\t\t\t\t
|
1180 |
-
$echo_str .= "\n\t\t\t\t\t\t".'
|
1181 |
-
$echo_str .= "\n\t\t\t\t\t".'
|
1182 |
-
$echo_str .= "\n\t\t\t\t\t".'
|
1183 |
-
$echo_str .= "\n\t\t\t\t\t
|
1184 |
-
$echo_str .= "\n\t\t\t\t\t
|
1185 |
-
$echo_str .= "\n\t\t\t\t\t\t".'
|
1186 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<
|
1187 |
-
$echo_str .= "\n\t\t\t\t\t\t
|
1188 |
-
$echo_str .= "\n\t\t\t\t\t\t".'
|
1189 |
-
$echo_str .= "\n\t\t\t\t\t".'
|
1190 |
-
|
1191 |
-
|
1192 |
-
|
1193 |
-
$echo_str .= "\n\t\t\t\t\t
|
1194 |
-
$echo_str .= "\n\t\t\t\t\t\t".'
|
1195 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<
|
1196 |
-
$echo_str .= "\n\t\t\t\t\t\t
|
1197 |
-
$echo_str .= "\n\t\t\t\t\t\t".'
|
1198 |
-
$echo_str .= "\n\t\t\t\t\t".'
|
1199 |
-
|
1200 |
-
|
1201 |
-
|
1202 |
-
|
1203 |
-
|
1204 |
-
|
1205 |
-
|
1206 |
-
$echo_str .= "\n\t\t\t
|
1207 |
-
$echo_str .= "\n\t\t\t
|
1208 |
-
$echo_str .= "\n\t\t\t\t
|
1209 |
-
$echo_str .= "\n\t\t\t\t\t
|
1210 |
-
$echo_str .= "\n\t\t\t\t\t\t".'
|
1211 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<
|
1212 |
-
|
1213 |
-
$
|
1214 |
-
//
|
1215 |
-
$
|
1216 |
-
|
1217 |
-
|
1218 |
-
|
1219 |
-
|
1220 |
-
$
|
1221 |
-
if ( $
|
1222 |
-
|
1223 |
-
|
1224 |
-
$rep .= 'File
|
1225 |
-
elseif ( $rec->action == '
|
1226 |
-
$rep .= 'File
|
1227 |
-
elseif ( $rec->action == '
|
1228 |
-
$rep .= 'File
|
1229 |
-
elseif ( $rec->action == '
|
1230 |
-
$rep .= 'File
|
1231 |
-
elseif ( $rec->action == '
|
1232 |
-
$rep .= 'File
|
1233 |
-
elseif ( $rec->action == '
|
1234 |
-
$rep .= 'File
|
1235 |
-
elseif ( $rec->action == '
|
1236 |
-
$rep .= 'File
|
1237 |
-
|
1238 |
-
|
1239 |
-
|
1240 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'
|
1241 |
-
$echo_str .= "\n\t\t\t\t\t\t".'</
|
1242 |
-
$echo_str .= "\n\t\t\t\t\t".'</
|
1243 |
-
$echo_str .= "\n\t\t\t\t".'</
|
1244 |
-
$echo_str .= "\n\t\t\t".'</
|
1245 |
-
|
1246 |
-
|
1247 |
-
|
1248 |
-
|
1249 |
-
$echo_str .= "\n\t\t\t
|
1250 |
-
|
1251 |
-
|
1252 |
-
|
1253 |
-
|
1254 |
-
$echo_str .= "\n\t\t\t\t\t
|
1255 |
-
$echo_str .= "\n\t\t\t\t\t\t".'
|
1256 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<
|
1257 |
-
|
1258 |
-
$echo_str .= "\n\t\t\t\t\t\t
|
1259 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<input id="
|
1260 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<
|
1261 |
-
$echo_str .= "\n\t\t\t\t\t\t".'
|
1262 |
-
$echo_str .= "\n\t\t\t\t\t".'
|
1263 |
-
|
1264 |
-
|
1265 |
-
|
1266 |
-
|
1267 |
-
|
1268 |
-
$echo_str .= "\n\t\t\t\t\t
|
1269 |
-
$echo_str .= "\n\t\t\t\t\t\t".'
|
1270 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<
|
1271 |
-
$echo_str .= "\n\t\t\t\t\t".'</
|
1272 |
-
|
1273 |
-
|
1274 |
-
|
1275 |
-
|
1276 |
-
|
1277 |
-
|
1278 |
-
$echo_str .= "\n\t\t\t".'
|
1279 |
-
|
1280 |
-
|
1281 |
-
|
1282 |
-
$
|
1283 |
-
$echo_str .= "\n\t".'
|
1284 |
-
$
|
1285 |
-
|
1286 |
-
|
1287 |
-
|
1288 |
-
|
1289 |
-
|
1290 |
-
|
1291 |
-
|
1292 |
-
$
|
1293 |
-
|
1294 |
-
|
1295 |
-
|
1296 |
-
|
1297 |
-
|
1298 |
-
|
1299 |
-
|
1300 |
-
|
1301 |
-
|
1302 |
-
|
1303 |
-
|
1304 |
-
|
1305 |
-
|
1306 |
-
|
1307 |
-
|
1308 |
-
|
1309 |
-
|
1310 |
-
|
1311 |
-
|
1312 |
-
|
1313 |
-
//get
|
1314 |
-
$
|
1315 |
-
|
1316 |
-
|
1317 |
-
$
|
1318 |
-
|
1319 |
-
|
1320 |
-
|
1321 |
-
//if
|
1322 |
-
if ( $latestrec
|
1323 |
-
|
1324 |
-
|
1325 |
-
|
1326 |
-
|
1327 |
-
|
1328 |
-
|
1329 |
-
|
1330 |
-
|
1331 |
-
|
1332 |
-
|
1333 |
-
|
1334 |
-
|
1335 |
-
|
1336 |
-
|
1337 |
-
|
1338 |
-
|
1339 |
-
|
1340 |
-
|
1341 |
-
|
1342 |
-
|
1343 |
-
$
|
1344 |
-
|
1345 |
-
|
1346 |
-
|
1347 |
-
|
1348 |
-
|
1349 |
-
|
1350 |
-
|
1351 |
-
|
1352 |
-
|
1353 |
-
|
1354 |
-
|
1355 |
-
|
1356 |
-
$
|
1357 |
-
|
1358 |
-
|
1359 |
-
array( '
|
1360 |
-
array( '
|
1361 |
-
|
1362 |
-
|
1363 |
-
|
1364 |
-
|
1365 |
-
|
1366 |
-
|
1367 |
-
'
|
1368 |
-
'
|
1369 |
-
'
|
1370 |
-
'
|
1371 |
-
|
1372 |
-
|
1373 |
-
|
1374 |
-
|
1375 |
-
'%
|
1376 |
-
'%s',
|
1377 |
-
'%
|
1378 |
-
'%s'
|
1379 |
-
|
1380 |
-
|
1381 |
-
|
1382 |
-
|
1383 |
-
|
1384 |
-
|
1385 |
-
|
1386 |
-
|
1387 |
-
|
1388 |
-
|
1389 |
-
|
1390 |
-
}
|
1391 |
-
|
1392 |
-
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
function wfu_browse_files($basedir_code, $page = -1, $only_table_rows = false) {
|
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 |
+
|
11 |
+
//first decode basedir_code
|
12 |
+
$basedir = wfu_get_filepath_from_safe($basedir_code);
|
13 |
+
//clean session array holding dir and file paths if it is too big
|
14 |
+
if ( WFU_USVAR_exists('wfu_filepath_safe_storage') && count(WFU_USVAR('wfu_filepath_safe_storage')) > WFU_VAR("WFU_PHP_ARRAY_MAXLEN") ) WFU_USVAR_store('wfu_filepath_safe_storage', array());
|
15 |
+
|
16 |
+
//basedir may also contain information about the sorting of the displayed
|
17 |
+
//elements, as well as a filename that needs to be located and get focus on
|
18 |
+
//the browser;
|
19 |
+
//sorting information is enclosed in double brackets: [[sort_info]]
|
20 |
+
//filename information is enclosed in double braces: {{filename}}
|
21 |
+
$sort = "";
|
22 |
+
$located_file = "";
|
23 |
+
$located_file_found = false;
|
24 |
+
$filter = "";
|
25 |
+
if ( $basedir !== false ) {
|
26 |
+
$ret = wfu_extract_sortdata_from_path($basedir);
|
27 |
+
$basedir = $ret['path'];
|
28 |
+
$sort = $ret['sort'];
|
29 |
+
$located_file = $ret['file'];
|
30 |
+
$filter = $ret['filter'];
|
31 |
+
}
|
32 |
+
if ( $sort == "" ) $sort = 'name';
|
33 |
+
if ( substr($sort, 0, 1) == '-' ) $order = SORT_DESC;
|
34 |
+
else $order = SORT_ASC;
|
35 |
+
//if page is not -1, then do not locate a file
|
36 |
+
if ( $located_file != "" && $page > -1 ) $located_file = "";
|
37 |
+
//adjust page to be larger than zero
|
38 |
+
if ( $page < 1 ) $page = 1;
|
39 |
+
|
40 |
+
//adjust basedir to have a standard format
|
41 |
+
if ( $basedir !== false ) {
|
42 |
+
if ( substr($basedir, -1) != '/' ) $basedir .= '/';
|
43 |
+
if ( substr($basedir, 0, 1) == '/' ) $basedir = substr($basedir, 1);
|
44 |
+
//calculate the absolute path of basedir knowing that basedir is relative to website root
|
45 |
+
$basedir = wfu_path_rel2abs($basedir);
|
46 |
+
if ( !file_exists($basedir) ) $basedir = false;
|
47 |
+
}
|
48 |
+
//set basedit to default value if empty
|
49 |
+
if ( $basedir === false ) {
|
50 |
+
$plugin_options = wfu_decode_plugin_options(get_option( "wordpress_file_upload_options" ));
|
51 |
+
$basedir = ( isset($plugin_options['basedir']) ? $plugin_options['basedir'] : "" );
|
52 |
+
$temp_params = array( 'uploadpath' => $basedir, 'accessmethod' => 'normal', 'ftpinfo' => '', 'useftpdomain' => 'false' );
|
53 |
+
$basedir = wfu_upload_plugin_full_path($temp_params);
|
54 |
+
}
|
55 |
+
//find relative dir
|
56 |
+
$reldir = str_replace(wfu_abspath(), "root/", $basedir);
|
57 |
+
//save dir route to an array
|
58 |
+
$parts = explode('/', $reldir);
|
59 |
+
$route = array();
|
60 |
+
$prev = "";
|
61 |
+
foreach ( $parts as $part ) {
|
62 |
+
$part = trim($part);
|
63 |
+
if ( $part != "" ) {
|
64 |
+
// if ( $part == 'root' && $prev == "" ) $prev = wfu_abspath();
|
65 |
+
if ( $part == 'root' && $prev == "" ) $prev = "";
|
66 |
+
else $prev .= $part.'/';
|
67 |
+
array_push($route, array( 'item' => $part, 'path' => $prev ));
|
68 |
+
}
|
69 |
+
}
|
70 |
+
//calculate upper directory
|
71 |
+
$updir = substr($basedir, 0, -1);
|
72 |
+
$delim_pos = strrpos($updir, '/');
|
73 |
+
if ( $delim_pos !== false ) $updir = substr($updir, 0, $delim_pos + 1);
|
74 |
+
|
75 |
+
//define referer (with sort data) to point to this url for use by the elements
|
76 |
+
$referer = $siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=file_browser&dir='.$basedir_code;
|
77 |
+
$referer_code = wfu_safe_store_filepath($referer.'[['.$sort.']]');
|
78 |
+
//define header parameters that can be later used when defining file actions
|
79 |
+
$header_params = array();
|
80 |
+
|
81 |
+
//find contents of current folder taking into account pagination, if it is
|
82 |
+
//activated; contents are found following an optimized procedure as follows:
|
83 |
+
// 1. all dirs and files are found and stored in separate arrays
|
84 |
+
// 2. if pagination is activated then it is checked if there are any dirs
|
85 |
+
// in the current page
|
86 |
+
// 3. if dir sorting is name then dirs are sorted
|
87 |
+
// 4. if dir sorting is date then stat is called for all dirs and then they
|
88 |
+
// are sorted
|
89 |
+
// 5. if pagination is activated then dirs array is sliced to keep only the
|
90 |
+
// ones belonging to the current page and then stat is called if it has
|
91 |
+
// not already been called
|
92 |
+
// 6. if there is room in the page for showing files, then files are also
|
93 |
+
// processed
|
94 |
+
// 7. if file sorting is name then files are sorted
|
95 |
+
// 8. if file sorting is date or size then stat is called for all files and
|
96 |
+
// then they are sorted
|
97 |
+
// 9. if file sorting is user then db record is retrieved for all files and
|
98 |
+
// then they are sorted
|
99 |
+
// 10. if pagination is activated then files array is sliced to keep only
|
100 |
+
// the ones fitting in the page; then stat is called and/or db record is
|
101 |
+
// retrieved
|
102 |
+
//first calculate dirs and files arrays
|
103 |
+
$dirlist = array();
|
104 |
+
$dirlist_include = true;
|
105 |
+
$dirlist_perpage = array();
|
106 |
+
$dirstat_ok = false;
|
107 |
+
$filelist = array();
|
108 |
+
$filestat_ok = false;
|
109 |
+
$filerec_ok = false;
|
110 |
+
if ( $handle = opendir($basedir) ) {
|
111 |
+
$blacklist = array('.', '..');
|
112 |
+
while ( false !== ($file = readdir($handle)) )
|
113 |
+
if ( !in_array($file, $blacklist) ) {
|
114 |
+
$filepath = $basedir.$file;
|
115 |
+
if ( is_dir($filepath) ) array_push($dirlist, array( 'name' => $file, 'fullpath' => $filepath ));
|
116 |
+
else array_push($filelist, array( 'name' => $file, 'fullpath' => $filepath ));
|
117 |
+
}
|
118 |
+
closedir($handle);
|
119 |
+
}
|
120 |
+
$dirlist_count = count($dirlist);
|
121 |
+
$filelist_count = count($filelist);
|
122 |
+
//get pagination details and determine if any dirs will be shown
|
123 |
+
$maxrows = (int)WFU_VAR("WFU_ADMINBROWSER_TABLE_MAXROWS");
|
124 |
+
$files_total = $dirlist_count + $filelist_count;
|
125 |
+
if ( $maxrows > 0 ) {
|
126 |
+
$pages = max(ceil($files_total / $maxrows), 1);
|
127 |
+
if ( $page > $pages ) $page = $pages;
|
128 |
+
//if first item index passes number of dirs then do not include dirs
|
129 |
+
if ( ($page - 1) * $maxrows >= $dirlist_count ) $dirlist_include = false;
|
130 |
+
//if a filename has been defined to get focus, then $dirlist_include
|
131 |
+
//needs to be true in order to calculate the dirs of every page
|
132 |
+
if ( $located_file != "" ) $dirlist_include = true;
|
133 |
+
}
|
134 |
+
//process dirs if they are included in page
|
135 |
+
if ( $dirlist_include ) {
|
136 |
+
//adjust sort details
|
137 |
+
$dirsort = ( substr($sort, -4) == 'date' ? 'mdate' : substr($sort, -4) );
|
138 |
+
$dirorder = $order;
|
139 |
+
if ( $dirsort == 'size' ) { $dirsort = 'name'; $dirorder = SORT_ASC; }
|
140 |
+
if ( $dirsort == 'user' ) { $dirsort = 'name'; $dirorder = SORT_ASC; }
|
141 |
+
switch ( $dirsort ) {
|
142 |
+
case "name": $dirsort .= ":s"; break;
|
143 |
+
case "mdate": $dirsort .= ":n"; break;
|
144 |
+
}
|
145 |
+
//if dir sort is mdate or if a file needs to be located then first
|
146 |
+
//calculate stat
|
147 |
+
if ( substr($dirsort, 0, 5) == 'mdate' || $located_file != "" ) {
|
148 |
+
foreach ( $dirlist as &$dir ) {
|
149 |
+
$stat = stat($dir['fullpath']);
|
150 |
+
$dir['mdate'] = $stat['mtime'];
|
151 |
+
}
|
152 |
+
unset($dir);
|
153 |
+
$dirstat_ok = true;
|
154 |
+
}
|
155 |
+
//sort dirs
|
156 |
+
$dirlist = wfu_array_sort($dirlist, $dirsort, $dirorder);
|
157 |
+
//if pagination is activated then slice dirs array to keep only the
|
158 |
+
//items belonging in the current page
|
159 |
+
if ( $maxrows > 0 ) {
|
160 |
+
//before slicing we store the items in $dirlist_perpage array
|
161 |
+
$i = $maxrows;
|
162 |
+
$ipage = 0;
|
163 |
+
foreach ( $dirlist as $dir ) {
|
164 |
+
if ( $i >= $maxrows ) {
|
165 |
+
$i = 0;
|
166 |
+
$ipage ++;
|
167 |
+
$dirlist_perpage[$ipage] = array();
|
168 |
+
}
|
169 |
+
array_push($dirlist_perpage[$ipage], $dir);
|
170 |
+
$i ++;
|
171 |
+
}
|
172 |
+
//now we slice $dirlist
|
173 |
+
$dirlist = array_slice($dirlist, ($page - 1) * $maxrows, $maxrows);
|
174 |
+
}
|
175 |
+
//calculate stat for the remaining dirs array, if it has not already
|
176 |
+
//been done
|
177 |
+
if ( !$dirstat_ok ) {
|
178 |
+
foreach ( $dirlist as &$dir ) {
|
179 |
+
$stat = stat($dir['fullpath']);
|
180 |
+
$dir['mdate'] = $stat['mtime'];
|
181 |
+
}
|
182 |
+
unset($dir);
|
183 |
+
}
|
184 |
+
}
|
185 |
+
else $dirlist = array();
|
186 |
+
//determine if any files will be included in page; in case pagination is
|
187 |
+
//activated then the remaining places need to be more than zero
|
188 |
+
$files_included = ( $maxrows > 0 ? ( $maxrows - count($dirlist) > 0 ) : true );
|
189 |
+
//if a filename has been defined to get focus, then $files_included
|
190 |
+
//needs to be true in order to re-calculate the page
|
191 |
+
if ( $located_file != "" ) $files_included = true;
|
192 |
+
if ( $files_included ) {
|
193 |
+
//adjust sort details
|
194 |
+
$filesort = ( substr($sort, -4) == 'date' ? 'mdate' : substr($sort, -4) );
|
195 |
+
switch ( $filesort ) {
|
196 |
+
case "name": $filesort .= ":s"; break;
|
197 |
+
case "size": $filesort .= ":n"; break;
|
198 |
+
case "mdate": $filesort .= ":n"; break;
|
199 |
+
case "user": $filesort .= ":s"; break;
|
200 |
+
}
|
201 |
+
//if file sort is size or mdate then first calculate stat
|
202 |
+
if ( substr($filesort, 0, 4) == 'size' || substr($filesort, 0, 5) == 'mdate' ) {
|
203 |
+
foreach ( $filelist as &$file ) {
|
204 |
+
$stat = stat($file['fullpath']);
|
205 |
+
$file['size'] = $stat['size'];
|
206 |
+
$file['mdate'] = $stat['mtime'];
|
207 |
+
}
|
208 |
+
unset($file);
|
209 |
+
$filestat_ok = true;
|
210 |
+
}
|
211 |
+
//if file sort is user then first calculate db records
|
212 |
+
elseif ( substr($filesort, 0, 4) == 'user' ) {
|
213 |
+
foreach ( $filelist as &$file ) {
|
214 |
+
//find relative file record in database together with user data;
|
215 |
+
//if the file is php, then file record is null meaning that the file
|
216 |
+
//can only be viewed; if file record is not found then the file can
|
217 |
+
//again only be viewed
|
218 |
+
if ( preg_match("/\.php$/", $file['fullpath']) ) $filerec = null;
|
219 |
+
else $filerec = wfu_get_file_rec($file['fullpath'], true);
|
220 |
+
//find user who uploaded the file
|
221 |
+
$username = ( $filerec != null ? wfu_get_username_by_id($filerec->uploaduserid) : '' );
|
222 |
+
$file['user'] = $username;
|
223 |
+
$file['filedata'] = $filerec;
|
224 |
+
}
|
225 |
+
unset($file);
|
226 |
+
$filerec_ok = true;
|
227 |
+
}
|
228 |
+
//sort files
|
229 |
+
$filelist = wfu_array_sort($filelist, $filesort, $order);
|
230 |
+
//if pagination is activated and a file needs to receive focus, then we
|
231 |
+
//need to calculate the page where the file is shown
|
232 |
+
if ( $maxrows > 0 && $located_file != "" ) {
|
233 |
+
$i = $dirlist_count;
|
234 |
+
foreach ( $filelist as $key => $file ) {
|
235 |
+
if ( $file['name'] == $located_file ) {
|
236 |
+
$located_file_found = true;
|
237 |
+
$filelist[$key]['highlighted'] = 1;
|
238 |
+
break;
|
239 |
+
}
|
240 |
+
$i ++;
|
241 |
+
}
|
242 |
+
if ( $located_file_found ) {
|
243 |
+
$page = floor( $i / $maxrows ) + 1;
|
244 |
+
if ( isset($dirlist_perpage[$page]) ) $dirlist = $dirlist_perpage[$page];
|
245 |
+
else $dirlist = array();
|
246 |
+
}
|
247 |
+
}
|
248 |
+
//if pagination is activated then slice files array to keep only the items
|
249 |
+
//belonging in the current page
|
250 |
+
if ( $maxrows > 0 )
|
251 |
+
$filelist = array_slice($filelist, max(($page - 1) * $maxrows - $dirlist_count, 0), $maxrows - count($dirlist));
|
252 |
+
if ( !$filestat_ok || !$filerec_ok ) {
|
253 |
+
foreach ( $filelist as &$file ) {
|
254 |
+
if ( !$filestat_ok ) {
|
255 |
+
$stat = stat($file['fullpath']);
|
256 |
+
$file['size'] = $stat['size'];
|
257 |
+
$file['mdate'] = $stat['mtime'];
|
258 |
+
}
|
259 |
+
if ( !$filerec_ok ) {
|
260 |
+
if ( preg_match("/\.php$/", $file['fullpath']) ) $filerec = null;
|
261 |
+
else $filerec = wfu_get_file_rec($file['fullpath'], true);
|
262 |
+
$username = ( $filerec != null ? wfu_get_username_by_id($filerec->uploaduserid) : '' );
|
263 |
+
$file['user'] = $username;
|
264 |
+
$file['filedata'] = $filerec;
|
265 |
+
}
|
266 |
+
}
|
267 |
+
unset($file);
|
268 |
+
}
|
269 |
+
}
|
270 |
+
else $filelist = array();
|
271 |
+
|
272 |
+
//start html output
|
273 |
+
$echo_str = "";
|
274 |
+
if ( !$only_table_rows ) {
|
275 |
+
$echo_str .= "\n".'<div class="wrap">';
|
276 |
+
$echo_str .= "\n\t".'<h2>Wordpress File Upload Control Panel</h2>';
|
277 |
+
$echo_str .= "\n\t".'<div style="margin-top:20px;">';
|
278 |
+
$echo_str .= wfu_generate_dashboard_menu("\n\t\t", "File Browser");
|
279 |
+
$echo_str .= "\n\t".'<div>';
|
280 |
+
$echo_str .= "\n\t\t".'<span><strong>Location:</strong> </span>';
|
281 |
+
foreach ( $route as $item ) {
|
282 |
+
// store dir path that we need to pass to other functions in session, instead of exposing it in the url
|
283 |
+
$dir_code = wfu_safe_store_filepath($item['path']);
|
284 |
+
$echo_str .= '<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=file_browser&dir='.$dir_code.'">'.$item['item'].'</a>';
|
285 |
+
$echo_str .= '<span>/</span>';
|
286 |
+
}
|
287 |
+
//file browser header
|
288 |
+
$echo_str .= "\n\t".'</div>';
|
289 |
+
// $dir_code = wfu_safe_store_filepath(wfu_path_abs2rel($basedir).'[['.$sort.']]');
|
290 |
+
// $echo_str .= "\n\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=create_dir&dir='.$dir_code.'" class="button" title="create folder" style="margin-top:6px">Create folder</a>';
|
291 |
+
$echo_str .= "\n\t".'<div style="margin-top:10px; position:relative;">';
|
292 |
+
$echo_str .= wfu_add_loading_overlay("\n\t\t", "adminbrowser");
|
293 |
+
$adminbrowser_nonce = wp_create_nonce( 'wfu-adminbrowser-page' );
|
294 |
+
$echo_str .= "\n\t\t".'<div class="wfu_adminbrowser_header" style="width: 100%;">';
|
295 |
+
$bulkactions = array(
|
296 |
+
array( "name" => "move", "title" => "Move" ),
|
297 |
+
array( "name" => "delete", "title" => "Delete" ),
|
298 |
+
array( "name" => "include", "title" => "Include" )
|
299 |
+
);
|
300 |
+
$echo_str .= wfu_add_bulkactions_header("\n\t\t\t", "adminbrowser", $bulkactions);
|
301 |
+
if ( $maxrows > 0 ) {
|
302 |
+
$echo_str .= wfu_add_pagination_header("\n\t\t\t", "adminbrowser", $page, $pages, $adminbrowser_nonce);
|
303 |
+
}
|
304 |
+
$echo_str .= "\n\t\t\t".'<input id="wfu_adminbrowser_action_url" type="hidden" value="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload" />';
|
305 |
+
$echo_str .= "\n\t\t\t".'<input id="wfu_adminbrowser_code" type="hidden" value="'.$basedir_code.'" />';
|
306 |
+
$echo_str .= "\n\t\t\t".'<input id="wfu_adminbrowser_referer" type="hidden" value="'.$referer_code.'" />';
|
307 |
+
$echo_str .= "\n\t\t\t".'<input id="wfu_download_file_nonce" type="hidden" value="'.wp_create_nonce('wfu_download_file_invoker').'" />';
|
308 |
+
$echo_str .= "\n\t\t\t".'<input id="wfu_include_file_nonce" type="hidden" value="'.wp_create_nonce('wfu_include_file').'" />';
|
309 |
+
$echo_str .= "\n\t\t".'</div>';
|
310 |
+
$echo_str .= "\n\t\t".'<table id="wfu_adminbrowser_table" class="wfu-adminbrowser wp-list-table widefat fixed striped">';
|
311 |
+
$echo_str .= "\n\t\t\t".'<thead>';
|
312 |
+
$echo_str .= "\n\t\t\t\t".'<tr>';
|
313 |
+
$echo_str .= "\n\t\t\t\t\t".'<td scope="col" width="5%" class="manage-column check-column">';
|
314 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<input id="wfu_select_all_visible" type="checkbox" onchange="wfu_adminbrowser_select_all_visible_changed();" style="-webkit-appearance:checkbox;" />';
|
315 |
+
$echo_str .= "\n\t\t\t\t\t".'</td>';
|
316 |
+
$echo_str .= "\n\t\t\t\t\t".'<th scope="col" width="25%" class="manage-column column-primary">';
|
317 |
+
$dir_code = wfu_safe_store_filepath(wfu_path_abs2rel($basedir).'[['.( substr($sort, -4) == 'name' ? ( $order == SORT_ASC ? '-name' : 'name' ) : 'name' ).']]');
|
318 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=file_browser&dir='.$dir_code.'">Name'.( substr($sort, -4) == 'name' ? ( $order == SORT_ASC ? ' ↑' : ' ↓' ) : '' ).'</a>';
|
319 |
+
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
320 |
+
$echo_str .= "\n\t\t\t\t\t".'<th scope="col" width="10%" class="manage-column">';
|
321 |
+
$dir_code = wfu_safe_store_filepath(wfu_path_abs2rel($basedir).'[['.( substr($sort, -4) == 'size' ? ( $order == SORT_ASC ? '-size' : 'size' ) : 'size' ).']]');
|
322 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=file_browser&dir='.$dir_code.'">Size'.( substr($sort, -4) == 'size' ? ( $order == SORT_ASC ? ' ↑' : ' ↓' ) : '' ).'</a>';
|
323 |
+
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
324 |
+
$echo_str .= "\n\t\t\t\t\t".'<th scope="col" width="20%" class="manage-column">';
|
325 |
+
$dir_code = wfu_safe_store_filepath(wfu_path_abs2rel($basedir).'[['.( substr($sort, -4) == 'date' ? ( $order == SORT_ASC ? '-date' : 'date' ) : 'date' ).']]');
|
326 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=file_browser&dir='.$dir_code.'">Date'.( substr($sort, -4) == 'date' ? ( $order == SORT_ASC ? ' ↑' : ' ↓' ) : '' ).'</a>';
|
327 |
+
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
328 |
+
$echo_str .= "\n\t\t\t\t\t".'<th scope="col" width="10%" class="manage-column">';
|
329 |
+
$dir_code = wfu_safe_store_filepath(wfu_path_abs2rel($basedir).'[['.( substr($sort, -4) == 'user' ? ( $order == SORT_ASC ? '-user' : 'user' ) : 'user' ).']]');
|
330 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=file_browser&dir='.$dir_code.'">Uploaded By'.( substr($sort, -4) == 'user' ? ( $order == SORT_ASC ? ' ↑' : ' ↓' ) : '' ).'</a>';
|
331 |
+
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
332 |
+
$echo_str .= "\n\t\t\t\t\t".'<th scope="col" width="30%" class="manage-column">';
|
333 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<label>User Data</label>';
|
334 |
+
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
335 |
+
$echo_str .= "\n\t\t\t\t".'</tr>';
|
336 |
+
$echo_str .= "\n\t\t\t".'</thead>';
|
337 |
+
$echo_str .= "\n\t\t\t".'<tbody>';
|
338 |
+
}
|
339 |
+
|
340 |
+
//show subfolders first
|
341 |
+
if ( $reldir != "root/" ) {
|
342 |
+
$dir_code = wfu_safe_store_filepath(wfu_path_abs2rel($updir));
|
343 |
+
$echo_str .= "\n\t\t\t\t".'<tr>';
|
344 |
+
$echo_str .= "\n\t\t\t\t\t".'<th class="check-column"><input type="checkbox" disabled="disabled" /></th>';
|
345 |
+
$echo_str .= "\n\t\t\t\t\t".'<td class="column-primary" data-colname="Name">';
|
346 |
+
$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=file_browser&dir='.$dir_code.'" title="go up">..</a>';
|
347 |
+
$echo_str .= "\n\t\t\t\t\t".'</td>';
|
348 |
+
$echo_str .= "\n\t\t\t\t\t".'<td data-colname="Size"> </td>';
|
349 |
+
$echo_str .= "\n\t\t\t\t\t".'<td data-colname="Date"> </td>';
|
350 |
+
$echo_str .= "\n\t\t\t\t\t".'<td data-colname="Uploaded By"> </td>';
|
351 |
+
$echo_str .= "\n\t\t\t\t\t".'<td data-colname="User Data"> </td>';
|
352 |
+
$echo_str .= "\n\t\t\t\t".'</tr>';
|
353 |
+
}
|
354 |
+
$ii = 1;
|
355 |
+
foreach ( $dirlist as $dir ) {
|
356 |
+
$dir_code = wfu_safe_store_filepath(wfu_path_abs2rel($dir['fullpath']).'[['.$sort.']]');
|
357 |
+
$echo_str .= "\n\t\t\t\t".'<tr onmouseover="var actions=document.getElementsByName(\'wfu_dir_actions\'); for (var i=0; i<actions.length; i++) {actions[i].style.visibility=\'hidden\';} document.getElementById(\'wfu_dir_actions_'.$ii.'\').style.visibility=\'visible\'" onmouseout="var actions=document.getElementsByName(\'wfu_dir_actions\'); for (var i=0; i<actions.length; i++) {actions[i].style.visibility=\'hidden\';}">';
|
358 |
+
$echo_str .= "\n\t\t\t\t\t".'<th class="check-column"><input type="checkbox" disabled="disabled" /></th>';
|
359 |
+
$echo_str .= "\n\t\t\t\t\t".'<td class="column-primary" data-colname="Name">';
|
360 |
+
$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=file_browser&dir='.$dir_code.'" title="'.$dir['name'].'">'.$dir['name'].'</a>';
|
361 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<div id="wfu_dir_actions_'.$ii.'" name="wfu_dir_actions" style="visibility:hidden;">';
|
362 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<span style="visibility:hidden;">';
|
363 |
+
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=file_browser&dir=">Noaction</a>';
|
364 |
+
$echo_str .= "\n\t\t\t\t\t\t\t\t".' | ';
|
365 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'</span>';
|
366 |
+
// $echo_str .= "\n\t\t\t\t\t\t\t".'<span>';
|
367 |
+
// $echo_str .= "\n\t\t\t\t\t\t\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=rename_dir&file='.$dir_code.'" title="Rename this folder">Rename</a>';
|
368 |
+
// $echo_str .= "\n\t\t\t\t\t\t\t\t".' | ';
|
369 |
+
// $echo_str .= "\n\t\t\t\t\t\t\t".'</span>';
|
370 |
+
// $echo_str .= "\n\t\t\t\t\t\t\t".'<span>';
|
371 |
+
// $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_dir&file='.$dir_code.'" title="Delete this folder">Delete</a>';
|
372 |
+
// $echo_str .= "\n\t\t\t\t\t\t\t".'</span>';
|
373 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</div>';
|
374 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<button type="button" class="toggle-row"><span class="screen-reader-text">Show more details</span></button>';
|
375 |
+
$echo_str .= "\n\t\t\t\t\t".'</td>';
|
376 |
+
$echo_str .= "\n\t\t\t\t\t".'<td data-colname="Size"> </td>';
|
377 |
+
$echo_str .= "\n\t\t\t\t\t".'<td data-colname="Date">'.get_date_from_gmt(date("Y-m-d H:i:s", $dir['mdate']), "d/m/Y H:i:s").'</td>';
|
378 |
+
$echo_str .= "\n\t\t\t\t\t".'<td data-colname="Uploaded By"> </td>';
|
379 |
+
$echo_str .= "\n\t\t\t\t\t".'<td data-colname="User Data"> </td>';
|
380 |
+
$echo_str .= "\n\t\t\t\t".'</tr>';
|
381 |
+
$ii ++;
|
382 |
+
}
|
383 |
+
//show contained files
|
384 |
+
foreach ( $filelist as $file ) {
|
385 |
+
$is_included = ( $file['filedata'] != null );
|
386 |
+
$can_be_included = ( $plugin_options['includeotherfiles'] == "1" ) && !wfu_file_extension_blacklisted($file['name']);
|
387 |
+
$highlighted = ( isset($file['highlighted']) && $file['highlighted'] == 1 );
|
388 |
+
$file_code = '';
|
389 |
+
if ( $is_included || $can_be_included ) $file_code = wfu_safe_store_filepath(wfu_path_abs2rel($file['fullpath']).'[['.$sort.']]');
|
390 |
+
$echo_str .= "\n\t\t\t\t".'<tr '.( $highlighted ? 'class="wfu-highlighted" ' : '' ).'onmouseover="var actions=document.getElementsByName(\'wfu_file_actions\'); for (var i=0; i<actions.length; i++) {actions[i].style.visibility=\'hidden\';} document.getElementById(\'wfu_file_actions_'.$ii.'\').style.visibility=\'visible\'" onmouseout="var actions=document.getElementsByName(\'wfu_file_actions\'); for (var i=0; i<actions.length; i++) {actions[i].style.visibility=\'hidden\';}">';
|
391 |
+
$echo_str .= "\n\t\t\t\t\t".'<th class="check-column">';
|
392 |
+
if ( $is_included || $can_be_included ) $echo_str .= "\n\t\t\t\t\t\t".'<input class="wfu_selectors'.( $is_included ? ' wfu_included' : '' ).' wfu_selcode_'.$file_code.'" type="checkbox" onchange="wfu_adminbrowser_selector_changed(this);" />';
|
393 |
+
else $echo_str .= "\n\t\t\t\t\t\t".'<input type="checkbox" disabled="disabled" />';
|
394 |
+
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
395 |
+
$echo_str .= "\n\t\t\t\t\t".'<td class="column-primary" data-colname="Name">';
|
396 |
+
if ( $is_included || $can_be_included )
|
397 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<a id="wfu_file_link_'.$ii.'" class="row-title" href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=file_details&file='.$file_code.'" title="View and edit file details" style="font-weight:normal;'.( $is_included ? '' : ' display:none;' ).'">'.$file['name'].'</a>';
|
398 |
+
if ( !$is_included )
|
399 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<span id="wfu_file_flat_'.$ii.'">'.$file['name'].'</span>';
|
400 |
+
//set additional $file properties for generating file actions
|
401 |
+
$file["index"] = $ii;
|
402 |
+
$file["code"] = $file_code;
|
403 |
+
$file["referer_code"] = $referer_code;
|
404 |
+
$file_actions = wfu_adminbrowser_file_actions($file, $header_params);
|
405 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<div id="wfu_file_actions_'.$ii.'" name="wfu_file_actions" style="visibility:hidden;">';
|
406 |
+
if ( $is_included || $can_be_included ) {
|
407 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<div id="wfu_file_is_included_actions_'.$ii.'" style="display:'.( $is_included ? 'block' : 'none' ).';">';
|
408 |
+
//add file actions for files already included
|
409 |
+
$array_keys = array_keys($file_actions["is_included"]);
|
410 |
+
$lastkey = array_pop($array_keys);
|
411 |
+
foreach ( $file_actions["is_included"] as $key => $action ) {
|
412 |
+
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<span>';
|
413 |
+
foreach ( $action as $line )
|
414 |
+
$echo_str .= "\n\t\t\t\t\t\t\t\t\t".$line;
|
415 |
+
if ( $key != $lastkey ) $echo_str .= "\n\t\t\t\t\t\t\t\t\t".' | ';
|
416 |
+
$echo_str .= "\n\t\t\t\t\t\t\t\t".'</span>';
|
417 |
+
}
|
418 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'</div>';
|
419 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<div id="wfu_file_can_be_included_actions_'.$ii.'" style="display:'.( $is_included ? 'none' : 'block' ).';">';
|
420 |
+
//add file actions for files that can be included
|
421 |
+
$array_keys = array_keys($file_actions["can_be_included"]);
|
422 |
+
$lastkey = array_pop($array_keys);
|
423 |
+
foreach ( $file_actions["can_be_included"] as $key => $action ) {
|
424 |
+
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<span>';
|
425 |
+
foreach ( $action as $line )
|
426 |
+
$echo_str .= "\n\t\t\t\t\t\t\t\t\t".$line;
|
427 |
+
if ( $key != $lastkey ) $echo_str .= "\n\t\t\t\t\t\t\t\t\t".' | ';
|
428 |
+
$echo_str .= "\n\t\t\t\t\t\t\t\t".'</span>';
|
429 |
+
}
|
430 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'</div>';
|
431 |
+
}
|
432 |
+
else {
|
433 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<span style="visibility:hidden;">';
|
434 |
+
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=file_browser&dir=">Noaction</a>';
|
435 |
+
$echo_str .= "\n\t\t\t\t\t\t\t\t".' | ';
|
436 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'</span>';
|
437 |
+
}
|
438 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</div>';
|
439 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<div id="wfu_file_download_container_'.$ii.'" style="display: none;"></div>';
|
440 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<button type="button" class="toggle-row"><span class="screen-reader-text">Show more details</span></button>';
|
441 |
+
$echo_str .= "\n\t\t\t\t\t".'</td>';
|
442 |
+
$echo_str .= "\n\t\t\t\t\t".'<td data-colname="Size">'.$file['size'].'</td>';
|
443 |
+
$echo_str .= "\n\t\t\t\t\t".'<td data-colname="Date">'.get_date_from_gmt(date("Y-m-d H:i:s", $file['mdate']), "d/m/Y H:i:s").'</td>';
|
444 |
+
$echo_str .= "\n\t\t\t\t\t".'<td data-colname="Uploaded By">'.$file['user'].'</td>';
|
445 |
+
$echo_str .= "\n\t\t\t\t\t".'<td data-colname="User Data">';
|
446 |
+
if ( $is_included ) {
|
447 |
+
if ( count($file['filedata']->userdata) > 0 ) {
|
448 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<select multiple="multiple" style="width:100%; height:40px; background:none; font-size:small;">';
|
449 |
+
foreach ( $file['filedata']->userdata as $userdata )
|
450 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<option>'.$userdata->property.': '.$userdata->propvalue.'</option>';
|
451 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</select>';
|
452 |
+
}
|
453 |
+
}
|
454 |
+
$echo_str .= "\n\t\t\t\t\t".'</td>';
|
455 |
+
$echo_str .= "\n\t\t\t\t".'</tr>';
|
456 |
+
$ii ++;
|
457 |
+
}
|
458 |
+
|
459 |
+
if ( !$only_table_rows ) {
|
460 |
+
$echo_str .= "\n\t\t\t".'</tbody>';
|
461 |
+
$echo_str .= "\n\t\t".'</table>';
|
462 |
+
$echo_str .= "\n\t\t".'<iframe id="wfu_download_frame" style="display: none;"></iframe>';
|
463 |
+
$echo_str .= "\n\t".'</div>';
|
464 |
+
$echo_str .= "\n\t".'</div>';
|
465 |
+
$echo_str .= "\n".'</div>';
|
466 |
+
}
|
467 |
+
if ( $located_file_found ) {
|
468 |
+
$handler = 'function() { wfu_focus_table_on_highlighted_file("wfu_adminbrowser_table"); }';
|
469 |
+
$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>';
|
470 |
+
}
|
471 |
+
|
472 |
+
return $echo_str;
|
473 |
+
}
|
474 |
+
|
475 |
+
function wfu_adminbrowser_file_actions($file, $params) {
|
476 |
+
$siteurl = site_url();
|
477 |
+
$actions = array(
|
478 |
+
"is_included" => array(),
|
479 |
+
"can_be_included" => array()
|
480 |
+
);
|
481 |
+
//add file actions if file is already included
|
482 |
+
$actions["is_included"] += array(
|
483 |
+
array( '<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=file_details&file='.$file["code"].'" title="View and edit file details">Details</a>' ),
|
484 |
+
array( '<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=rename_file&file='.$file["code"].'" title="Rename this file">Rename</a>' ),
|
485 |
+
array( '<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=move_file&file='.$file["code"].'" title="Move this file">Move</a>' ),
|
486 |
+
array( '<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=delete_file&file='.$file["code"].'&referer='.$file["referer_code"].'" title="Delete this file">Delete</a>' ),
|
487 |
+
array( '<a href="javascript:wfu_download_file(\''.$file["code"].'\', '.$file["index"].');" title="Download this file">Download</a>' )
|
488 |
+
);
|
489 |
+
//add file actions if file is already included
|
490 |
+
$actions["can_be_included"] += array(
|
491 |
+
array(
|
492 |
+
'<a id="wfu_include_file_'.$file["index"].'_a" href="javascript:wfu_include_file(\''.$file["code"].'\', '.$file["index"].');" title="Include file in plugin\'s database">Include File</a>',
|
493 |
+
'<img id="wfu_include_file_'.$file["index"].'_img" src="'.WFU_IMAGE_ADMIN_SUBFOLDER_LOADING.'" style="width:12px; display:none;" />',
|
494 |
+
'<input id="wfu_include_file_'.$file["index"].'_inpfail" type="hidden" value="File could not be included!" />'
|
495 |
+
)
|
496 |
+
);
|
497 |
+
|
498 |
+
return $actions;
|
499 |
+
}
|
500 |
+
|
501 |
+
function wfu_user_owns_file($userid, $filerec) {
|
502 |
+
if ( 0 == $userid )
|
503 |
+
return false;
|
504 |
+
if ( current_user_can('manage_options') ) return true;
|
505 |
+
return false;
|
506 |
+
}
|
507 |
+
|
508 |
+
function wfu_current_user_owes_file($filepath) {
|
509 |
+
//first check if file has a restricted extension; for security reasons some file extensions cannot be owned
|
510 |
+
if ( wfu_file_extension_blacklisted($filepath) ) return false;
|
511 |
+
//then get file data from database, if exist
|
512 |
+
$filerec = wfu_get_file_rec($filepath, false);
|
513 |
+
if ( $filerec == null ) return false;
|
514 |
+
|
515 |
+
$user = wp_get_current_user();
|
516 |
+
return wfu_user_owns_file($user->ID, $filerec);
|
517 |
+
}
|
518 |
+
|
519 |
+
function wfu_current_user_allowed_action($action, $filepath) {
|
520 |
+
//first get file data from database, if exist
|
521 |
+
$filerec = wfu_get_file_rec($filepath, false);
|
522 |
+
|
523 |
+
$user = wp_get_current_user();
|
524 |
+
if ( 0 == $user->ID ) return null;
|
525 |
+
else $is_admin = current_user_can('manage_options');
|
526 |
+
if ( !$is_admin ) {
|
527 |
+
return null;
|
528 |
+
}
|
529 |
+
return $user;
|
530 |
+
}
|
531 |
+
|
532 |
+
function wfu_current_user_allowed_action_remote($action, $filepath, $userid) {
|
533 |
+
//first get file data from database, if exist
|
534 |
+
$filerec = wfu_get_file_rec($filepath, false);
|
535 |
+
|
536 |
+
if ( 0 == $userid ) return null;
|
537 |
+
else $is_admin = user_can($userid, 'manage_options');
|
538 |
+
if ( !$is_admin ) {
|
539 |
+
return null;
|
540 |
+
}
|
541 |
+
return true;
|
542 |
+
}
|
543 |
+
|
544 |
+
function wfu_rename_file_prompt($file_code, $type, $error) {
|
545 |
+
if ( $type == 'dir' ) return;
|
546 |
+
|
547 |
+
$siteurl = site_url();
|
548 |
+
|
549 |
+
$is_admin = current_user_can( 'manage_options' );
|
550 |
+
//check if user is allowed to view file details
|
551 |
+
if ( !$is_admin ) {
|
552 |
+
return;
|
553 |
+
}
|
554 |
+
$file_code = wfu_sanitize_code($file_code);
|
555 |
+
$dec_file = wfu_get_filepath_from_safe($file_code);
|
556 |
+
if ( $dec_file === false ) return;
|
557 |
+
|
558 |
+
//first extract sort info from dec_file
|
559 |
+
$ret = wfu_extract_sortdata_from_path($dec_file);
|
560 |
+
$dec_file = wfu_path_rel2abs($ret['path']);
|
561 |
+
if ( $type == 'dir' && substr($dec_file, -1) == '/' ) $dec_file = substr($dec_file, 0, -1);
|
562 |
+
|
563 |
+
//check if user is allowed to perform this action
|
564 |
+
if ( !wfu_current_user_owes_file($dec_file) ) return;
|
565 |
+
|
566 |
+
$parts = pathinfo($dec_file);
|
567 |
+
$newname = $parts['basename'];
|
568 |
+
$dir_code = wfu_safe_store_filepath(wfu_path_abs2rel($parts['dirname']).'[['.$ret['sort'].']]');
|
569 |
+
|
570 |
+
$echo_str = "\n".'<div class="wrap">';
|
571 |
+
if ( $error ) {
|
572 |
+
$rename_file = WFU_USVAR('wfu_rename_file');
|
573 |
+
$newname = $rename_file['newname'];
|
574 |
+
$echo_str .= "\n\t".'<div class="error">';
|
575 |
+
$echo_str .= "\n\t\t".'<p>'.WFU_USVAR('wfu_rename_file_error').'</p>';
|
576 |
+
$echo_str .= "\n\t".'</div>';
|
577 |
+
}
|
578 |
+
$echo_str .= "\n\t".'<div style="margin-top:20px;">';
|
579 |
+
if ( $is_admin ) $echo_str .= "\n\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=file_browser&dir='.$dir_code.'" class="button" title="go back">Go back</a>';
|
580 |
+
$echo_str .= "\n\t".'</div>';
|
581 |
+
$echo_str .= "\n\t".'<h2 style="margin-bottom: 10px;">Rename '.( $type == 'dir' ? 'Folder' : 'File' ).'</h2>';
|
582 |
+
if ( $is_admin ) $echo_str .= "\n\t".'<form enctype="multipart/form-data" name="renamefile" id="renamefile" method="post" action="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload" class="validate">';
|
583 |
+
$echo_str .= "\n\t\t".'<input type="hidden" name="action" value="rename'.( $type == 'dir' ? 'dir' : 'file' ).'">';
|
584 |
+
$echo_str .= "\n\t\t".'<input type="hidden" name="dir" value="'.$dir_code.'">';
|
585 |
+
$echo_str .= "\n\t\t".'<input type="hidden" name="file" value="'.$file_code.'">';
|
586 |
+
if ( $type == 'dir' ) $echo_str .= "\n\t\t".'<label>Enter new name for folder <strong>'.$dec_file.'</strong></label><br/>';
|
587 |
+
elseif ( $is_admin ) $echo_str .= "\n\t\t".'<label>Enter new filename for file <strong>'.$dec_file.'</strong></label><br/>';
|
588 |
+
$echo_str .= "\n\t\t".'<input name="wfu_newname" id="wfu_newname" type="text" value="'.$newname.'" style="width:50%;" />';
|
589 |
+
$echo_str .= "\n\t\t".'<p class="submit">';
|
590 |
+
$echo_str .= "\n\t\t\t".'<input type="submit" class="button-primary" name="submit" value="Rename">';
|
591 |
+
$echo_str .= "\n\t\t\t".'<input type="submit" class="button-primary" name="submit" value="Cancel">';
|
592 |
+
$echo_str .= "\n\t\t".'</p>';
|
593 |
+
$echo_str .= "\n\t".'</form>';
|
594 |
+
$echo_str .= "\n".'</div>';
|
595 |
+
return $echo_str;
|
596 |
+
}
|
597 |
+
|
598 |
+
function wfu_move_file_prompt($file_code, $error) {
|
599 |
+
$siteurl = site_url();
|
600 |
+
|
601 |
+
$is_admin = current_user_can( 'manage_options' );
|
602 |
+
//check if user is allowed to view file details
|
603 |
+
if ( !$is_admin ) return;
|
604 |
+
|
605 |
+
if ( !is_array($file_code) ) $file_code = array( $file_code );
|
606 |
+
$names = array();
|
607 |
+
foreach ( $file_code as $index => $code ) {
|
608 |
+
$file_code[$index] = wfu_sanitize_code($code);
|
609 |
+
$dec_file = wfu_get_filepath_from_safe($file_code[$index]);
|
610 |
+
if ( $dec_file === false ) unset($file_code[$index]);
|
611 |
+
else {
|
612 |
+
//first extract sort info from dec_file
|
613 |
+
$ret = wfu_extract_sortdata_from_path($dec_file);
|
614 |
+
$dec_file = $ret['path'];
|
615 |
+
$parts = pathinfo($dec_file);
|
616 |
+
array_push($names, $parts['basename']);
|
617 |
+
}
|
618 |
+
}
|
619 |
+
if ( count($file_code) == 0 ) return;
|
620 |
+
$file_code_list = "list:".implode(",", $file_code);
|
621 |
+
|
622 |
+
$newpath = $parts['dirname'];
|
623 |
+
$replacefiles = "";
|
624 |
+
$dir_code = wfu_safe_store_filepath($parts['dirname'].'[['.$ret['sort'].']]');
|
625 |
+
|
626 |
+
$echo_str = "\n".'<div class="wrap">';
|
627 |
+
if ( $error ) {
|
628 |
+
$move_file = WFU_USVAR('wfu_move_file');
|
629 |
+
$newpath = $move_file['newpath'];
|
630 |
+
$replacefiles = $move_file['replacefiles'];
|
631 |
+
$echo_str .= "\n\t".'<div class="error">';
|
632 |
+
$echo_str .= "\n\t\t".'<p>'.WFU_USVAR('wfu_move_file_error').'</p>';
|
633 |
+
$echo_str .= "\n\t".'</div>';
|
634 |
+
}
|
635 |
+
$echo_str .= "\n\t".'<div style="margin-top:20px;">';
|
636 |
+
$echo_str .= "\n\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=file_browser&dir='.$dir_code.'" class="button" title="go back">Go back</a>';
|
637 |
+
$echo_str .= "\n\t".'</div>';
|
638 |
+
$echo_str .= "\n\t".'<h2 style="margin-bottom: 10px;">Move File</h2>';
|
639 |
+
$echo_str .= "\n\t".'<form enctype="multipart/form-data" name="movefile" id="movefile" method="post" action="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload" class="validate">';
|
640 |
+
$echo_str .= "\n\t\t".'<input type="hidden" name="action" value="movefile">';
|
641 |
+
$echo_str .= "\n\t\t".'<input type="hidden" name="dir" value="'.$dir_code.'">';
|
642 |
+
$echo_str .= "\n\t\t".'<input type="hidden" name="file" value="'.$file_code_list.'">';
|
643 |
+
if ( count($names) == 1 )
|
644 |
+
$echo_str .= "\n\t\t".'<label style="display:inline-block; margin-bottom:1em;">Enter destination folder for file <strong>'.$dec_file.'</strong></label><br/>';
|
645 |
+
else {
|
646 |
+
$echo_str .= "\n\t\t".'<label>Enter destination folder for files:</label><br/>';
|
647 |
+
$echo_str .= "\n\t\t".'<ul style="padding-left: 20px; list-style: initial;">';
|
648 |
+
foreach ( $names as $name )
|
649 |
+
$echo_str .= "\n\t\t\t".'<li><strong>'.$name.'</strong></li>';
|
650 |
+
$echo_str .= "\n\t\t".'</ul>';
|
651 |
+
}
|
652 |
+
$echo_str .= "\n\t\t".'<input name="wfu_newpath" id="wfu_newpath" type="text" value="'.$newpath.'" style="width:50%;" />';
|
653 |
+
$echo_str .= "\n\t\t".'<p>';
|
654 |
+
$echo_str .= "\n\t\t\t".'<label>Replace files with the same filename at destination:</label><br />';
|
655 |
+
$echo_str .= "\n\t\t\t".'<input name="wfu_replace" id="wfu_replace_yes" type="radio" value="yes"'.( $replacefiles == "yes" ? ' checked="checked"' : '' ).' /><label for="wfu_replace_yes">Yes</label>';
|
656 |
+
$echo_str .= "\n\t\t\t".'<input name="wfu_replace" id="wfu_replace_no" type="radio" value="no"'.( $replacefiles == "no" ? ' checked="checked"' : '' ).' style="margin-left:1em;" /><label for="wfu_replace_no">No</label>';
|
657 |
+
$echo_str .= "\n\t\t".'</p>';
|
658 |
+
$echo_str .= "\n\t\t".'<p class="submit">';
|
659 |
+
$echo_str .= "\n\t\t\t".'<input type="button" class="button-primary" name="submitBtn" value="Move" onclick="if (!document.getElementById(\'wfu_replace_yes\').checked && !document.getElementById(\'wfu_replace_no\').checked) alert(\'Please select if files in destination with the same filename will be replaced or not!\'); else this.form.submit();" />';
|
660 |
+
$echo_str .= "\n\t\t\t".'<input type="submit" class="button-primary" name="submitBtn" value="Cancel" />';
|
661 |
+
$echo_str .= "\n\t\t".'</p>';
|
662 |
+
$echo_str .= "\n\t".'</form>';
|
663 |
+
$echo_str .= "\n".'</div>';
|
664 |
+
return $echo_str;
|
665 |
+
}
|
666 |
+
|
667 |
+
function wfu_rename_file($file_code, $type) {
|
668 |
+
if ( $type == 'dir' ) return;
|
669 |
+
|
670 |
+
$user = wp_get_current_user();
|
671 |
+
$is_admin = current_user_can( 'manage_options' );
|
672 |
+
//check if user is allowed to view file details
|
673 |
+
if ( !$is_admin ) {
|
674 |
+
return;
|
675 |
+
}
|
676 |
+
$file_code = wfu_sanitize_code($file_code);
|
677 |
+
$dec_file = wfu_get_filepath_from_safe($file_code);
|
678 |
+
if ( $dec_file === false ) return;
|
679 |
+
|
680 |
+
$dec_file = wfu_path_rel2abs(wfu_flatten_path($dec_file));
|
681 |
+
if ( $type == 'dir' && substr($dec_file, -1) == '/' ) $dec_file = substr($dec_file, 0, -1);
|
682 |
+
if ( !file_exists($dec_file) ) return;
|
683 |
+
|
684 |
+
//check if user is allowed to perform this action
|
685 |
+
if ( !wfu_current_user_owes_file($dec_file) ) return;
|
686 |
+
|
687 |
+
$parts = pathinfo($dec_file);
|
688 |
+
$error = "";
|
689 |
+
if ( isset($_POST['wfu_newname']) && isset($_POST['submit']) ) {
|
690 |
+
if ( $_POST['submit'] == "Rename" && $_POST['wfu_newname'] != $parts['basename'] ) {
|
691 |
+
$new_file = $parts['dirname'].'/'.$_POST['wfu_newname'];
|
692 |
+
if ( $_POST['wfu_newname'] == "" ) $error = 'Error: New '.( $type == 'dir' ? 'folder ' : 'file' ).'name cannot be empty!';
|
693 |
+
elseif ( preg_match("/[^A-Za-z0-9_.#\-$]/", $_POST['wfu_newname']) ) $error = 'Error: name contained invalid characters that were stripped off! Please try again.';
|
694 |
+
elseif ( substr($_POST['wfu_newname'], -1 - strlen($parts['extension'])) != '.'.$parts['extension'] ) $error = 'Error: new and old file name extensions must be identical! Please correct.';
|
695 |
+
elseif ( wfu_file_extension_blacklisted($_POST['wfu_newname']) ) $error = 'Error: the new file name has an extension that is forbidden for security reasons. Please correct.';
|
696 |
+
elseif ( file_exists($new_file) ) $error = 'Error: The '.( $type == 'dir' ? 'folder' : 'file' ).' <strong>'.$_POST['wfu_newname'].'</strong> already exists! Please choose another one.';
|
697 |
+
else {
|
698 |
+
//pre-log rename action
|
699 |
+
if ( $type == 'file' ) $retid = wfu_log_action('rename:'.$new_file, $dec_file, $user->ID, '', 0, 0, '', null);
|
700 |
+
//perform rename action
|
701 |
+
if ( rename($dec_file, $new_file) == false ) $error = 'Error: Rename of '.( $type == 'dir' ? 'folder' : 'file' ).' <strong>'.$parts['basename'].'</strong> failed!';
|
702 |
+
//revert log action if file was not renamed
|
703 |
+
if ( $type == 'file' && !file_exists($new_file) ) wfu_revert_log_action($retid);
|
704 |
+
}
|
705 |
+
}
|
706 |
+
}
|
707 |
+
if ( $error != "" ) {
|
708 |
+
WFU_USVAR_store('wfu_rename_file_error', $error);
|
709 |
+
$rename_file = WFU_USVAR('wfu_rename_file');
|
710 |
+
$rename_file['newname'] = preg_replace("/[^A-Za-z0-9_.#\-$]/", "", $_POST['wfu_newname']);
|
711 |
+
WFU_USVAR_store('wfu_rename_file', $rename_file);
|
712 |
+
}
|
713 |
+
return ( $error == "" );
|
714 |
+
}
|
715 |
+
|
716 |
+
function wfu_move_file($file_code) {
|
717 |
+
$user = wp_get_current_user();
|
718 |
+
$is_admin = current_user_can( 'manage_options' );
|
719 |
+
//check if user is allowed to view file details
|
720 |
+
if ( !$is_admin ) return;
|
721 |
+
|
722 |
+
if ( !is_array($file_code) ) $file_code = array( $file_code );
|
723 |
+
$dec_files = array();
|
724 |
+
foreach ( $file_code as $index => $code ) {
|
725 |
+
$file_code[$index] = wfu_sanitize_code($code);
|
726 |
+
$dec_file = wfu_get_filepath_from_safe($file_code[$index]);
|
727 |
+
if ( $dec_file !== false ) {
|
728 |
+
$dec_file = wfu_path_rel2abs(wfu_flatten_path($dec_file));
|
729 |
+
array_push($dec_files, $dec_file);
|
730 |
+
}
|
731 |
+
}
|
732 |
+
if ( count($dec_files) == 0 ) return;
|
733 |
+
|
734 |
+
$parts = pathinfo($dec_files[0]);
|
735 |
+
$error = "";
|
736 |
+
$regex = "/([^A-Za-z0-9\-._~!$&'()*+,;=:@#\/\\\\%]|%[^A-Fa-f0-9][^A-Fa-f0-9]|%[A-Fa-f0-9][^A-Fa-f0-9]|%[^A-Fa-f0-9][A-Fa-f0-9]|%.?$)/";
|
737 |
+
if ( isset($_POST['wfu_newpath']) && isset($_POST['wfu_replace']) ) {
|
738 |
+
$oldpath = $parts['dirname'];
|
739 |
+
if ( substr($oldpath, -1) != '/' ) $oldpath = $oldpath.'/';
|
740 |
+
$newpath = preg_replace($regex, "", $_POST['wfu_newpath']);
|
741 |
+
if ( substr($newpath, 0, 1) != '/' ) $newpath = '/'.$newpath;
|
742 |
+
$newpath = realpath(wfu_path_rel2abs($newpath));
|
743 |
+
if ( substr($newpath, -1) != '/' ) $newpath = $newpath.'/';
|
744 |
+
$replacefiles = ( $_POST['wfu_replace'] == 'yes' ? 'yes' : ( $_POST['wfu_replace'] == 'no' ? 'no' : '' ) );
|
745 |
+
if ( trim($_POST['wfu_newpath']) == "" ) $error = 'Error: Destination path cannot be empty!';
|
746 |
+
elseif ( $newpath == $oldpath ) $error = 'Error: Destination path is the same as source path!';
|
747 |
+
elseif ( preg_match($regex, $_POST['wfu_newpath']) ) $error = 'Error: path contained invalid characters that were stripped off! Please try again.';
|
748 |
+
elseif ( !file_exists($newpath) ) $error = 'Error: Destination folder <strong>'.$_POST['wfu_newpath'].'</strong> does not exist!';
|
749 |
+
elseif ( $replacefiles == "" ) $error = 'Error: Invalid selection about replacing files with same filename at destination!';
|
750 |
+
else {
|
751 |
+
foreach ( $dec_files as $dec_file ) {
|
752 |
+
if ( file_exists($dec_file) ) {
|
753 |
+
$new_file = $newpath.wfu_basename($dec_file);
|
754 |
+
if ( !file_exists($new_file) || $replacefiles == "yes" ) {
|
755 |
+
//pre-log move action
|
756 |
+
$retid = wfu_log_action('move:'.$new_file, $dec_file, $user->ID, '', 0, 0, '', null);
|
757 |
+
//perform move action
|
758 |
+
if ( @rename($dec_file, $new_file) === false || !file_exists($new_file) ) {
|
759 |
+
wfu_revert_log_action($retid);
|
760 |
+
}
|
761 |
+
}
|
762 |
+
}
|
763 |
+
}
|
764 |
+
}
|
765 |
+
}
|
766 |
+
if ( $error != "" ) {
|
767 |
+
WFU_USVAR_store('wfu_move_file_error', $error);
|
768 |
+
$move_file = WFU_USVAR('wfu_move_file');
|
769 |
+
$move_file['newpath'] = preg_replace($regex, "", $_POST['wfu_newpath']);
|
770 |
+
$move_file['replacefiles'] = $replacefiles;
|
771 |
+
WFU_USVAR_store('wfu_move_file', $move_file);
|
772 |
+
}
|
773 |
+
return ( $error == "" );
|
774 |
+
}
|
775 |
+
|
776 |
+
function wfu_delete_file_prompt($file_code, $type, $referer) {
|
777 |
+
if ( $type == 'dir' ) return;
|
778 |
+
|
779 |
+
$siteurl = site_url();
|
780 |
+
|
781 |
+
$is_admin = current_user_can( 'manage_options' );
|
782 |
+
//check if user is allowed to view file details
|
783 |
+
if ( !$is_admin ) {
|
784 |
+
return;
|
785 |
+
}
|
786 |
+
if ( !is_array($file_code) ) $file_code = array( $file_code );
|
787 |
+
$names = array();
|
788 |
+
foreach ( $file_code as $index => $code ) {
|
789 |
+
$file_code[$index] = wfu_sanitize_code($code);
|
790 |
+
$dec_file = wfu_get_filepath_from_safe($file_code[$index]);
|
791 |
+
if ( $dec_file === false ) unset($file_code[$index]);
|
792 |
+
else {
|
793 |
+
//first extract sort info from dec_file
|
794 |
+
$ret = wfu_extract_sortdata_from_path($dec_file);
|
795 |
+
$dec_file = wfu_path_rel2abs($ret['path']);
|
796 |
+
if ( $type == 'dir' && substr($dec_file, -1) == '/' ) $dec_file = substr($dec_file, 0, -1);
|
797 |
+
//check if user is allowed to perform this action
|
798 |
+
if ( !wfu_current_user_owes_file($dec_file) ) unset($file_code[$index]);
|
799 |
+
else {
|
800 |
+
$parts = pathinfo($dec_file);
|
801 |
+
array_push($names, $parts['basename']);
|
802 |
+
}
|
803 |
+
}
|
804 |
+
}
|
805 |
+
if ( count($file_code) == 0 ) return;
|
806 |
+
$file_code_list = "list:".implode(",", $file_code);
|
807 |
+
|
808 |
+
$referer_url = wfu_get_filepath_from_safe(wfu_sanitize_code($referer));
|
809 |
+
$ret = wfu_extract_sortdata_from_path($referer_url);
|
810 |
+
$referer_url = $ret['path'];
|
811 |
+
|
812 |
+
$echo_str = "\n".'<div class="wrap">';
|
813 |
+
$echo_str .= "\n\t".'<div style="margin-top:20px;">';
|
814 |
+
if ( $is_admin ) $echo_str .= "\n\t\t".'<a href="'.$referer_url.'" class="button" title="go back">Go back</a>';
|
815 |
+
$echo_str .= "\n\t".'</div>';
|
816 |
+
$echo_str .= "\n\t".'<h2 style="margin-bottom: 10px;">Delete '.( $type == 'dir' ? 'Folder' : 'File'.( count($names) == 1 ? '' : 's' ) ).'</h2>';
|
817 |
+
if ( $is_admin ) $echo_str .= "\n\t".'<form enctype="multipart/form-data" name="deletefile" id="deletefile" method="post" action="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload" class="validate">';
|
818 |
+
$echo_str .= "\n\t\t".'<input type="hidden" name="action" value="delete'.( $type == 'dir' ? 'dir' : 'file' ).'">';
|
819 |
+
$echo_str .= "\n\t\t".'<input type="hidden" name="referer" value="'.$referer.'">';
|
820 |
+
$echo_str .= "\n\t\t".'<input type="hidden" name="file" value="'.$file_code_list.'">';
|
821 |
+
if ( count($names) == 1 )
|
822 |
+
$echo_str .= "\n\t\t".'<label>Are you sure that you want to delete '.( $type == 'dir' ? 'folder' : 'file' ).' <strong>'.$names[0].'</strong>?</label><br/>';
|
823 |
+
else {
|
824 |
+
$echo_str .= "\n\t\t".'<label>Are you sure that you want to delete '.( $type == 'dir' ? 'folder' : 'files' ).':';
|
825 |
+
$echo_str .= "\n\t\t".'<ul style="padding-left: 20px; list-style: initial;">';
|
826 |
+
foreach ( $names as $name )
|
827 |
+
$echo_str .= "\n\t\t\t".'<li><strong>'.$name.'</strong></li>';
|
828 |
+
$echo_str .= "\n\t\t".'</ul>';
|
829 |
+
}
|
830 |
+
$echo_str .= "\n\t\t".'<p class="submit">';
|
831 |
+
$echo_str .= "\n\t\t\t".'<input type="submit" class="button-primary" name="submit" value="Delete">';
|
832 |
+
$echo_str .= "\n\t\t\t".'<input type="submit" class="button-primary" name="submit" value="Cancel">';
|
833 |
+
$echo_str .= "\n\t\t".'</p>';
|
834 |
+
$echo_str .= "\n\t".'</form>';
|
835 |
+
$echo_str .= "\n".'</div>';
|
836 |
+
return $echo_str;
|
837 |
+
}
|
838 |
+
|
839 |
+
function wfu_delete_file($file_code, $type) {
|
840 |
+
if ( $type == 'dir' ) return;
|
841 |
+
|
842 |
+
$user = wp_get_current_user();
|
843 |
+
$is_admin = current_user_can( 'manage_options' );
|
844 |
+
//check if user is allowed to view file details
|
845 |
+
if ( !$is_admin ) {
|
846 |
+
return;
|
847 |
+
}
|
848 |
+
if ( !is_array($file_code) ) $file_code = array( $file_code );
|
849 |
+
$dec_files = array();
|
850 |
+
foreach ( $file_code as $index => $code ) {
|
851 |
+
$file_code[$index] = wfu_sanitize_code($code);
|
852 |
+
$dec_file = wfu_get_filepath_from_safe($file_code[$index]);
|
853 |
+
if ( $dec_file !== false ) {
|
854 |
+
$dec_file = wfu_path_rel2abs(wfu_flatten_path($dec_file));
|
855 |
+
if ( $type == 'dir' && substr($dec_file, -1) == '/' ) $dec_file = substr($dec_file, 0, -1);
|
856 |
+
//check if user is allowed to perform this action
|
857 |
+
if ( wfu_current_user_owes_file($dec_file) ) array_push($dec_files, $dec_file);
|
858 |
+
}
|
859 |
+
}
|
860 |
+
if ( count($dec_files) == 0 ) return;
|
861 |
+
|
862 |
+
if ( isset($_POST['submit']) ) {
|
863 |
+
if ( $_POST['submit'] == "Delete" ) {
|
864 |
+
foreach ( $dec_files as $dec_file ) {
|
865 |
+
//pre-log delete action
|
866 |
+
if ( $type == 'file' ) wfu_delete_file_execute($dec_file, $user->ID);
|
867 |
+
elseif ( $type == 'dir' && $dec_file != "" ) wfu_delTree($dec_file);
|
868 |
+
}
|
869 |
+
}
|
870 |
+
}
|
871 |
+
return true;
|
872 |
+
}
|
873 |
+
|
874 |
+
function wfu_create_dir_prompt($dir_code, $error) {
|
875 |
+
return;
|
876 |
+
|
877 |
+
$siteurl = site_url();
|
878 |
+
|
879 |
+
if ( !current_user_can( 'manage_options' ) ) return;
|
880 |
+
|
881 |
+
$dir_code = wfu_sanitize_code($dir_code);
|
882 |
+
$dec_dir = wfu_get_filepath_from_safe($dir_code);
|
883 |
+
if ( $dec_dir === false ) return;
|
884 |
+
|
885 |
+
//first extract sort info from dec_dir
|
886 |
+
$ret = wfu_extract_sortdata_from_path($dec_dir);
|
887 |
+
$dec_dir = wfu_path_rel2abs($ret['path']);
|
888 |
+
if ( substr($dec_dir, -1) != '/' ) $dec_dir .= '/';
|
889 |
+
$newname = '';
|
890 |
+
|
891 |
+
$echo_str = "\n".'<div class="wrap">';
|
892 |
+
if ( $error ) {
|
893 |
+
$create_dir = WFU_USVAR('wfu_create_dir');
|
894 |
+
$newname = $create_dir['newname'];
|
895 |
+
$echo_str .= "\n\t".'<div class="error">';
|
896 |
+
$echo_str .= "\n\t\t".'<p>'.WFU_USVAR('wfu_create_dir_error').'</p>';
|
897 |
+
$echo_str .= "\n\t".'</div>';
|
898 |
+
}
|
899 |
+
$echo_str .= "\n\t".'<div style="margin-top:20px;">';
|
900 |
+
$echo_str .= "\n\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=file_browser&dir='.$dir_code.'" class="button" title="go back">Go back</a>';
|
901 |
+
$echo_str .= "\n\t".'</div>';
|
902 |
+
$echo_str .= "\n\t".'<h2 style="margin-bottom: 10px;">Create Folder</h2>';
|
903 |
+
$echo_str .= "\n\t".'<form enctype="multipart/form-data" name="createdir" id="createdir" method="post" action="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload" class="validate">';
|
904 |
+
$echo_str .= "\n\t\t".'<input type="hidden" name="action" value="createdir">';
|
905 |
+
$echo_str .= "\n\t\t".'<input type="hidden" name="dir" value="'.$dir_code.'">';
|
906 |
+
$echo_str .= "\n\t\t".'<label>Enter the name of the new folder inside <strong>'.$dec_dir.'</strong></label><br/>';
|
907 |
+
$echo_str .= "\n\t\t".'<input name="wfu_newname" id="wfu_newname" type="text" value="'.$newname.'" style="width:50%;" />';
|
908 |
+
$echo_str .= "\n\t\t".'<p class="submit">';
|
909 |
+
$echo_str .= "\n\t\t\t".'<input type="submit" class="button-primary" name="submit" value="Create">';
|
910 |
+
$echo_str .= "\n\t\t\t".'<input type="submit" class="button-primary" name="submit" value="Cancel">';
|
911 |
+
$echo_str .= "\n\t\t".'</p>';
|
912 |
+
$echo_str .= "\n\t".'</form>';
|
913 |
+
$echo_str .= "\n".'</div>';
|
914 |
+
return $echo_str;
|
915 |
+
}
|
916 |
+
|
917 |
+
function wfu_create_dir($dir_code) {
|
918 |
+
return;
|
919 |
+
|
920 |
+
if ( !current_user_can( 'manage_options' ) ) return;
|
921 |
+
|
922 |
+
$dir_code = wfu_sanitize_code($dir_code);
|
923 |
+
$dec_dir = wfu_get_filepath_from_safe($dir_code);
|
924 |
+
if ( $dec_dir === false ) return;
|
925 |
+
|
926 |
+
$dec_dir = wfu_path_rel2abs(wfu_flatten_path($dec_dir));
|
927 |
+
if ( substr($dec_dir, -1) != '/' ) $dec_dir .= '/';
|
928 |
+
if ( !file_exists($dec_dir) ) return;
|
929 |
+
$error = "";
|
930 |
+
if ( isset($_POST['wfu_newname']) && isset($_POST['submit']) ) {
|
931 |
+
if ( $_POST['submit'] == "Create" ) {
|
932 |
+
$new_dir = $dec_dir.$_POST['wfu_newname'];
|
933 |
+
if ( $_POST['wfu_newname'] == "" ) $error = 'Error: New folder name cannot be empty!';
|
934 |
+
elseif ( preg_match("/[^A-Za-z0-9_.#\-$]/", $_POST['wfu_newname']) ) $error = 'Error: name contained invalid characters that were stripped off! Please try again.';
|
935 |
+
elseif ( file_exists($new_dir) ) $error = 'Error: The folder <strong>'.$_POST['wfu_newname'].'</strong> already exists! Please choose another one.';
|
936 |
+
elseif ( mkdir($new_dir) == false ) $error = 'Error: Creation of folder <strong>'.$_POST['wfu_newname'].'</strong> failed!';
|
937 |
+
}
|
938 |
+
}
|
939 |
+
if ( $error != "" ) {
|
940 |
+
WFU_USVAR_store('wfu_create_dir_error', $error);
|
941 |
+
$create_dir = WFU_USVAR('wfu_create_dir');
|
942 |
+
$create_dir['newname'] = preg_replace("/[^A-Za-z0-9_.#\-$]/", "", $_POST['wfu_newname']);
|
943 |
+
WFU_USVAR_store('wfu_create_dir', $create_dir);
|
944 |
+
}
|
945 |
+
return ( $error == "" );
|
946 |
+
}
|
947 |
+
|
948 |
+
function wfu_include_file_prompt($file_code, $referer) {
|
949 |
+
if ( !current_user_can( 'manage_options' ) ) return;
|
950 |
+
$plugin_options = wfu_decode_plugin_options(get_option( "wordpress_file_upload_options" ));
|
951 |
+
if ( $plugin_options['includeotherfiles'] != "1" ) return;
|
952 |
+
|
953 |
+
$siteurl = site_url();
|
954 |
+
if ( !is_array($file_code) ) $file_code = array( $file_code );
|
955 |
+
$names = array();
|
956 |
+
foreach ( $file_code as $index => $code ) {
|
957 |
+
$file_code[$index] = wfu_sanitize_code($code);
|
958 |
+
$dec_file = wfu_get_filepath_from_safe($file_code[$index]);
|
959 |
+
if ( $dec_file === false ) unset($file_code[$index]);
|
960 |
+
else {
|
961 |
+
$dec_file = wfu_path_rel2abs(wfu_flatten_path($dec_file));
|
962 |
+
//do not include file if it has a forbidden extention or it is already included
|
963 |
+
if ( wfu_file_extension_blacklisted(wfu_basename($dec_file)) || wfu_get_file_rec($dec_file, false) != null )
|
964 |
+
unset($file_code[$index]);
|
965 |
+
else array_push($names, wfu_basename($dec_file));
|
966 |
+
}
|
967 |
+
}
|
968 |
+
if ( count($file_code) == 0 ) return;
|
969 |
+
$file_code_list = "list:".implode(",", $file_code);
|
970 |
+
|
971 |
+
$referer_url = wfu_get_filepath_from_safe(wfu_sanitize_code($referer));
|
972 |
+
$ret = wfu_extract_sortdata_from_path($referer_url);
|
973 |
+
$referer_url = $ret['path'];
|
974 |
+
|
975 |
+
$echo_str = "\n".'<div class="wrap">';
|
976 |
+
$echo_str .= "\n\t".'<div style="margin-top:20px;">';
|
977 |
+
$echo_str .= "\n\t\t".'<a href="'.$referer_url.'" class="button" title="go back">Go back</a>';
|
978 |
+
$echo_str .= "\n\t".'</div>';
|
979 |
+
$echo_str .= "\n\t".'<h2 style="margin-bottom: 10px;">Include File'.( count($names) == 1 ? '' : 's' ).'</h2>';
|
980 |
+
$echo_str .= "\n\t".'<form enctype="multipart/form-data" name="includefile" id="includefile" method="post" action="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload" class="validate">';
|
981 |
+
$echo_str .= "\n\t\t".'<input type="hidden" name="action" value="includefile">';
|
982 |
+
$echo_str .= "\n\t\t".'<input type="hidden" name="referer" value="'.$referer.'">';
|
983 |
+
$echo_str .= "\n\t\t".'<input type="hidden" name="file" value="'.$file_code_list.'">';
|
984 |
+
if ( count($names) == 1 )
|
985 |
+
$echo_str .= "\n\t\t".'<label>Are you sure that you want to include file <strong>'.$names[0].'</strong>?</label><br/>';
|
986 |
+
else {
|
987 |
+
$echo_str .= "\n\t\t".'<label>Are you sure that you want to include files:';
|
988 |
+
$echo_str .= "\n\t\t".'<ul style="padding-left: 20px; list-style: initial;">';
|
989 |
+
foreach ( $names as $name )
|
990 |
+
$echo_str .= "\n\t\t\t".'<li><strong>'.$name.'</strong></li>';
|
991 |
+
$echo_str .= "\n\t\t".'</ul>';
|
992 |
+
}
|
993 |
+
$echo_str .= "\n\t\t".'<p class="submit">';
|
994 |
+
$echo_str .= "\n\t\t\t".'<input type="submit" class="button-primary" name="submit" value="Include">';
|
995 |
+
$echo_str .= "\n\t\t\t".'<input type="submit" class="button-primary" name="submit" value="Cancel">';
|
996 |
+
$echo_str .= "\n\t\t".'</p>';
|
997 |
+
$echo_str .= "\n\t".'</form>';
|
998 |
+
$echo_str .= "\n".'</div>';
|
999 |
+
return $echo_str;
|
1000 |
+
}
|
1001 |
+
|
1002 |
+
function wfu_include_file($file_code) {
|
1003 |
+
if ( !current_user_can( 'manage_options' ) ) return;
|
1004 |
+
$plugin_options = wfu_decode_plugin_options(get_option( "wordpress_file_upload_options" ));
|
1005 |
+
if ( $plugin_options['includeotherfiles'] != "1" ) return;
|
1006 |
+
|
1007 |
+
if ( !is_array($file_code) ) $file_code = array( $file_code );
|
1008 |
+
$dec_files = array();
|
1009 |
+
foreach ( $file_code as $index => $code ) {
|
1010 |
+
$file_code[$index] = wfu_sanitize_code($code);
|
1011 |
+
$dec_file = wfu_get_filepath_from_safe($file_code[$index]);
|
1012 |
+
if ( $dec_file !== false ) {
|
1013 |
+
$dec_file = wfu_path_rel2abs(wfu_flatten_path($dec_file));
|
1014 |
+
//include file if it does not have a forbidden extention and it not already included
|
1015 |
+
if ( !wfu_file_extension_blacklisted(wfu_basename($dec_file)) && wfu_get_file_rec($dec_file, false) == null )
|
1016 |
+
array_push($dec_files, $dec_file);
|
1017 |
+
}
|
1018 |
+
}
|
1019 |
+
if ( count($dec_files) == 0 ) return;
|
1020 |
+
|
1021 |
+
$user = wp_get_current_user();
|
1022 |
+
if ( isset($_POST['submit']) ) {
|
1023 |
+
if ( $_POST['submit'] == "Include" ) {
|
1024 |
+
foreach ( $dec_files as $dec_file )
|
1025 |
+
$fileid = wfu_log_action('include', $dec_file, $user->ID, '', '', get_current_blog_id(), '', null);
|
1026 |
+
}
|
1027 |
+
}
|
1028 |
+
return true;
|
1029 |
+
}
|
1030 |
+
|
1031 |
+
function wfu_file_details($file_code, $errorstatus, $invoker = '') {
|
1032 |
+
$siteurl = site_url();
|
1033 |
+
$allow_obsolete = false;
|
1034 |
+
$file_exists = true;
|
1035 |
+
$file_belongs = true;
|
1036 |
+
$admin_can_edit = true;
|
1037 |
+
|
1038 |
+
//if $file_code starts with 'byID:', then it contains a db record ID and not
|
1039 |
+
//a file path; in this case we show the properties of the specific record
|
1040 |
+
//and all linked ones, even if it is obsolete; this is only allowed for
|
1041 |
+
//admins
|
1042 |
+
if ( substr($file_code, 0, 5) == "byID:" ) {
|
1043 |
+
$allow_obsolete = true;
|
1044 |
+
$file_code = substr($file_code, 5);
|
1045 |
+
}
|
1046 |
+
|
1047 |
+
$user = wp_get_current_user();
|
1048 |
+
$is_admin = current_user_can( 'manage_options' );
|
1049 |
+
//check if user is allowed to view file details
|
1050 |
+
if ( !$is_admin ) {
|
1051 |
+
if ( $allow_obsolete ) return;
|
1052 |
+
return;
|
1053 |
+
}
|
1054 |
+
if ( $allow_obsolete ) {
|
1055 |
+
$file_code = wfu_sanitize_int($file_code);
|
1056 |
+
$initialrec = wfu_get_file_rec_from_id($file_code, true);
|
1057 |
+
if ( $initialrec == null ) return;
|
1058 |
+
|
1059 |
+
//get all associated file records
|
1060 |
+
$filerecs = wfu_get_rec_new_history($initialrec->idlog);
|
1061 |
+
//get the latest record of this upload
|
1062 |
+
$filerec = $filerecs[count($filerecs) - 1];
|
1063 |
+
$filerec->userdata = $initialrec->userdata;
|
1064 |
+
|
1065 |
+
$filepath = wfu_path_rel2abs($filerec->filepath);
|
1066 |
+
//in the case of $allow_obsolete we need to check if the file exists and
|
1067 |
+
//if it belongs to the current record
|
1068 |
+
$latestrec = wfu_get_file_rec($filepath, true);
|
1069 |
+
$file_exists = ( $latestrec != null );
|
1070 |
+
$file_belongs = ( $file_exists && $latestrec->idlog == $filerec->idlog );
|
1071 |
+
$admin_can_edit = $file_exists;
|
1072 |
+
|
1073 |
+
//extract file parts and file properties
|
1074 |
+
$parts = pathinfo($filepath);
|
1075 |
+
if ( $file_exists ) $stat = stat($filepath);
|
1076 |
+
else $stat['mtime'] = '';
|
1077 |
+
}
|
1078 |
+
else {
|
1079 |
+
$file_code = wfu_sanitize_code($file_code);
|
1080 |
+
$dec_file = wfu_get_filepath_from_safe($file_code);
|
1081 |
+
if ( $dec_file === false ) return;
|
1082 |
+
|
1083 |
+
//extract file browser data from $file variable
|
1084 |
+
$ret = wfu_extract_sortdata_from_path($dec_file);
|
1085 |
+
$filepath = wfu_path_rel2abs($ret['path']);
|
1086 |
+
|
1087 |
+
//check if user is allowed to perform this action
|
1088 |
+
if ( !wfu_current_user_owes_file($filepath) ) return;
|
1089 |
+
|
1090 |
+
//get file data from database with user data
|
1091 |
+
$filerec = wfu_get_file_rec($filepath, true);
|
1092 |
+
if ( $filerec == null ) return;
|
1093 |
+
|
1094 |
+
//extract sort info and construct contained dir
|
1095 |
+
$parts = pathinfo($filepath);
|
1096 |
+
$dir_code = wfu_safe_store_filepath(wfu_path_abs2rel($parts['dirname']).'[['.$ret['sort'].']]');
|
1097 |
+
|
1098 |
+
$stat = stat($filepath);
|
1099 |
+
}
|
1100 |
+
|
1101 |
+
$echo_str = '<div class="regev_wrap">';
|
1102 |
+
if ( $errorstatus == 'error' ) {
|
1103 |
+
$echo_str .= "\n\t".'<div class="error">';
|
1104 |
+
$echo_str .= "\n\t\t".'<p>'.WFU_USVAR('wfu_filedetails_error').'</p>';
|
1105 |
+
$echo_str .= "\n\t".'</div>';
|
1106 |
+
}
|
1107 |
+
//show file detais
|
1108 |
+
$echo_str .= "\n\t".'<h2>Detais of File: '.$parts['basename'].'</h2>';
|
1109 |
+
if ( !$file_exists ) {
|
1110 |
+
$echo_str .= "\n\t\t".'<div class="notice notice-warning">';
|
1111 |
+
$echo_str .= "\n\t\t\t".'<p>File does not exist on the server anymore!</p>';
|
1112 |
+
$echo_str .= "\n\t\t".'</div>';
|
1113 |
+
}
|
1114 |
+
elseif ( !$file_belongs ) {
|
1115 |
+
$echo_str .= "\n\t\t".'<div class="notice notice-warning">';
|
1116 |
+
$echo_str .= "\n\t\t\t".'<p>This record is old. The file is associated with another record.</p>';
|
1117 |
+
$echo_str .= "\n\t\t".'</div>';
|
1118 |
+
}
|
1119 |
+
$echo_str .= "\n\t".'<div style="margin-top:10px;">';
|
1120 |
+
if ( $is_admin ) {
|
1121 |
+
$invoker_action = ( $invoker == '' ? false : wfu_get_browser_params_from_safe($invoker) );
|
1122 |
+
$goback_action = ( $invoker_action === false ? 'file_browser&dir='.$dir_code : $invoker_action );
|
1123 |
+
if ( substr($goback_action, 0, 18) == "wfu_uploaded_files" )
|
1124 |
+
$echo_str .= "\n\t\t".'<a href="'.$siteurl.'/wp-admin/admin.php?page='.$goback_action.'" class="button" title="go back">Go back</a>';
|
1125 |
+
elseif ( $goback_action != "no_referer" )
|
1126 |
+
$echo_str .= "\n\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action='.$goback_action.'" class="button" title="go back">Go back</a>';
|
1127 |
+
$echo_str .= "\n\t\t".'<form enctype="multipart/form-data" name="editfiledetails" id="editfiledetails" method="post" action="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=edit_filedetails" class="validate">';
|
1128 |
+
}
|
1129 |
+
$echo_str .= "\n\t\t\t".'<h3 style="margin-bottom: 10px; margin-top: 40px;">Upload Details</h3>';
|
1130 |
+
$echo_str .= "\n\t\t\t".'<input type="hidden" name="action" value="edit_filedetails" />';
|
1131 |
+
//$echo_str .= "\n\t\t\t".'<input type="hidden" name="dir" value="'.$dir_code.'">';
|
1132 |
+
$echo_str .= "\n\t\t\t".'<input type="hidden" name="invoker" value="'.$invoker.'">';
|
1133 |
+
$echo_str .= "\n\t\t\t".'<input type="hidden" name="file" value="'.( $allow_obsolete ? 'byID:'.$file_code : $file_code ).'">';
|
1134 |
+
$echo_str .= "\n\t\t\t".'<table class="form-table">';
|
1135 |
+
$echo_str .= "\n\t\t\t\t".'<tbody>';
|
1136 |
+
if ( $is_admin ) {
|
1137 |
+
$echo_str .= "\n\t\t\t\t\t".'<tr>';
|
1138 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<th scope="row">';
|
1139 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<label>Full Path</label>';
|
1140 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</th>';
|
1141 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<td>';
|
1142 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<input type="text" value="'.$filepath.'" readonly="readonly" style="width:50%;" />';
|
1143 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</td>';
|
1144 |
+
$echo_str .= "\n\t\t\t\t\t".'</tr>';
|
1145 |
+
$echo_str .= "\n\t\t\t\t\t".'<tr>';
|
1146 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<th scope="row">';
|
1147 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<label>Uploaded By User</label>';
|
1148 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</th>';
|
1149 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<td>';
|
1150 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<select id="wfu_filedetails_users" disabled="disabled">';
|
1151 |
+
//get all users
|
1152 |
+
$args = array();
|
1153 |
+
$args = apply_filters("_wfu_get_users", $args, "edit_file_details");
|
1154 |
+
$users = get_users($args);
|
1155 |
+
foreach ( $users as $userid => $user )
|
1156 |
+
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<option value="'.$user->ID.'"'.( $filerec->uploaduserid == $user->ID ? ' selected="selected"' : '' ).'>'.$user->display_name.' ('.$user->user_login.')</option>';
|
1157 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'</select>';
|
1158 |
+
if ( $admin_can_edit ) {
|
1159 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<a class="button" id="btn_change" href="" onclick="document.getElementById(\'wfu_filedetails_users\').disabled = false; this.style.display = \'none\'; document.getElementById(\'btn_ok\').style.display = \'inline-block\'; document.getElementById(\'btn_cancel\').style.display = \'inline-block\'; return false;"'.( $is_admin ? '' : ' style="display:none;"' ).'>Change User</a>';
|
1160 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<a class="button" id="btn_ok" href="" onclick="document.getElementById(\'wfu_filedetails_users\').disabled = true; document.getElementById(\'btn_change\').style.display = \'inline-block\'; this.style.display=\'none\'; document.getElementById(\'btn_cancel\').style.display = \'none\'; document.getElementById(\'wfu_filedetails_userid\').value = document.getElementById(\'wfu_filedetails_users\').value; wfu_filedetails_changed(); return false;" style="display:none;">Ok</a>';
|
1161 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<a class="button" id="btn_cancel" href="" onclick="document.getElementById(\'wfu_filedetails_users\').disabled = true; document.getElementById(\'btn_change\').style.display = \'inline-block\'; this.style.display=\'none\'; document.getElementById(\'btn_ok\').style.display = \'none\'; document.getElementById(\'wfu_filedetails_users\').value = document.getElementById(\'wfu_filedetails_userid\').value; return false;" style="display:none;">Cancel</a>';
|
1162 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<input type="hidden" id="wfu_filedetails_userid" name="wfu_filedetails_userid" value="'.$filerec->uploaduserid.'" />';
|
1163 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<input type="hidden" id="wfu_filedetails_userid_default" value="'.$filerec->uploaduserid.'" />';
|
1164 |
+
}
|
1165 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</td>';
|
1166 |
+
$echo_str .= "\n\t\t\t\t\t".'</tr>';
|
1167 |
+
}
|
1168 |
+
$echo_str .= "\n\t\t\t\t\t".'<tr>';
|
1169 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<th scope="row">';
|
1170 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<label>File Size</label>';
|
1171 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</th>';
|
1172 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<td>';
|
1173 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<input type="text" value="'.$filerec->filesize.'" readonly="readonly" style="width:auto;" />';
|
1174 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</td>';
|
1175 |
+
$echo_str .= "\n\t\t\t\t\t".'</tr>';
|
1176 |
+
$echo_str .= "\n\t\t\t\t\t".'<tr>';
|
1177 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<th scope="row">';
|
1178 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<label>File Date</label>';
|
1179 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</th>';
|
1180 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<td>';
|
1181 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<input type="text" value="'.( $file_exists ? get_date_from_gmt(date("Y-m-d H:i:s", $stat['mtime']), "d/m/Y H:i:s") : '' ).'" readonly="readonly" style="width:auto;" />';
|
1182 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</td>';
|
1183 |
+
$echo_str .= "\n\t\t\t\t\t".'</tr>';
|
1184 |
+
$echo_str .= "\n\t\t\t\t\t".'<tr>';
|
1185 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<th scope="row">';
|
1186 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<label>Uploaded From Page</label>';
|
1187 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</th>';
|
1188 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<td>';
|
1189 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<input type="text" value="'.get_the_title($filerec->pageid).' ('.$filerec->pageid.')'.'" readonly="readonly" style="width:50%;" />';
|
1190 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</td>';
|
1191 |
+
$echo_str .= "\n\t\t\t\t\t".'</tr>';
|
1192 |
+
if ( $is_admin ) {
|
1193 |
+
$echo_str .= "\n\t\t\t\t\t".'<tr>';
|
1194 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<th scope="row">';
|
1195 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<label>Upload Plugin ID</label>';
|
1196 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</th>';
|
1197 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<td>';
|
1198 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<input type="text" value="'.$filerec->sid.'" readonly="readonly" style="width:auto;" />';
|
1199 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</td>';
|
1200 |
+
$echo_str .= "\n\t\t\t\t\t".'</tr>';
|
1201 |
+
}
|
1202 |
+
$echo_str .= "\n\t\t\t\t".'</tbody>';
|
1203 |
+
$echo_str .= "\n\t\t\t".'</table>';
|
1204 |
+
if ( $is_admin ) {
|
1205 |
+
//show history details
|
1206 |
+
$echo_str .= "\n\t\t\t".'<h3 style="margin-bottom: 10px; margin-top: 40px;">File History</h3>';
|
1207 |
+
$echo_str .= "\n\t\t\t".'<table class="form-table">';
|
1208 |
+
$echo_str .= "\n\t\t\t\t".'<tbody>';
|
1209 |
+
$echo_str .= "\n\t\t\t\t\t".'<tr>';
|
1210 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<th scope="row">';
|
1211 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<label></label>';
|
1212 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</th>';
|
1213 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<td>';
|
1214 |
+
//read all linked older records
|
1215 |
+
$filerecs = wfu_get_rec_old_history($filerec->idlog);
|
1216 |
+
//construct report from db records
|
1217 |
+
$rep = '';
|
1218 |
+
foreach ( $filerecs as $rec ) {
|
1219 |
+
$username = wfu_get_username_by_id($rec->userid);
|
1220 |
+
$fileparts = pathinfo($rec->filepath);
|
1221 |
+
if ( $rep != '' ) $rep .= "<br />";
|
1222 |
+
$rep .= '<strong>['.get_date_from_gmt($rec->date_from).']</strong> ';
|
1223 |
+
if ( $rec->action == 'upload' )
|
1224 |
+
$rep .= 'File uploaded at <strong>'.$fileparts['dirname'].'</strong> with name <strong>'.$fileparts['basename'].'</strong> by user <strong>'.$username.'</strong>';
|
1225 |
+
elseif ( $rec->action == 'include' )
|
1226 |
+
$rep .= 'File included in database at <strong>'.$fileparts['dirname'].'</strong> with name <strong>'.$fileparts['basename'].'</strong> by user <strong>'.$username.'</strong>';
|
1227 |
+
elseif ( $rec->action == 'download' )
|
1228 |
+
$rep .= 'File downloaded by user <strong>'.$username.'</strong>';
|
1229 |
+
elseif ( $rec->action == 'rename' )
|
1230 |
+
$rep .= 'File renamed to <strong>'.$fileparts['basename'].'</strong> by user <strong>'.$username.'</strong>';
|
1231 |
+
elseif ( $rec->action == 'move' )
|
1232 |
+
$rep .= 'File moved to <strong>'.$fileparts['dirname'].'</strong> by user <strong>'.$username.'</strong>';
|
1233 |
+
elseif ( $rec->action == 'delete' )
|
1234 |
+
$rep .= 'File deleted by user <strong>'.$username.'</strong>';
|
1235 |
+
elseif ( $rec->action == 'modify' )
|
1236 |
+
$rep .= 'File userdata modified by user <strong>'.$username.'</strong>';
|
1237 |
+
elseif ( $rec->action == 'changeuser' )
|
1238 |
+
$rep .= 'File upload user modified by user <strong>'.$username.'</strong>';
|
1239 |
+
}
|
1240 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<div style="border:1px solid #dfdfdf; border-radius:3px; width:50%; overflow:scroll; padding:6px; height:100px; background-color:#eee;">';
|
1241 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<span style="white-space:nowrap;">'.$rep.'</span>';
|
1242 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'</div>';
|
1243 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</td>';
|
1244 |
+
$echo_str .= "\n\t\t\t\t\t".'</tr>';
|
1245 |
+
$echo_str .= "\n\t\t\t\t".'</tbody>';
|
1246 |
+
$echo_str .= "\n\t\t\t".'</table>';
|
1247 |
+
}
|
1248 |
+
|
1249 |
+
$echo_str .= "\n\t\t\t".'<h3 style="margin-bottom: 10px; margin-top: 40px;">User Data Details</h3>';
|
1250 |
+
$echo_str .= "\n\t\t\t".'<table class="form-table">';
|
1251 |
+
$echo_str .= "\n\t\t\t\t".'<tbody>';
|
1252 |
+
if ( count($filerec->userdata) > 0 ) {
|
1253 |
+
foreach ( $filerec->userdata as $userdata ) {
|
1254 |
+
$echo_str .= "\n\t\t\t\t\t".'<tr>';
|
1255 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<th scope="row">';
|
1256 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<label>'.$userdata->property.'</label>';
|
1257 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</th>';
|
1258 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<td>';
|
1259 |
+
// $echo_str .= "\n\t\t\t\t\t\t\t".'<input id="wfu_filedetails_userdata_value_'.$userdata->propkey.'" name="wfu_filedetails_userdata" type="text"'.( $is_admin ? '' : ' readonly="readonly"' ).' value="'.$userdata->propvalue.'" />';
|
1260 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<textarea id="wfu_filedetails_userdata_value_'.$userdata->propkey.'" name="wfu_filedetails_userdata" '.( ($is_admin && $admin_can_edit) ? '' : ' readonly="readonly"' ).' value="'.$userdata->propvalue.'">'.$userdata->propvalue.'</textarea>';
|
1261 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<input id="wfu_filedetails_userdata_default_'.$userdata->propkey.'" type="hidden" value="'.$userdata->propvalue.'" />';
|
1262 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<input id="wfu_filedetails_userdata_'.$userdata->propkey.'" name="wfu_filedetails_userdata_'.$userdata->propkey.'" type="hidden" value="'.$userdata->propvalue.'" />';
|
1263 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</td>';
|
1264 |
+
$echo_str .= "\n\t\t\t\t\t".'</tr>';
|
1265 |
+
}
|
1266 |
+
}
|
1267 |
+
else {
|
1268 |
+
$echo_str .= "\n\t\t\t\t\t".'<tr>';
|
1269 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<th scope="row">';
|
1270 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<label>No user data</label>';
|
1271 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</th>';
|
1272 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<td></td>';
|
1273 |
+
$echo_str .= "\n\t\t\t\t\t".'</tr>';
|
1274 |
+
}
|
1275 |
+
$echo_str .= "\n\t\t\t\t".'</tbody>';
|
1276 |
+
$echo_str .= "\n\t\t\t".'</table>';
|
1277 |
+
if ( ($is_admin && $admin_can_edit) ) {
|
1278 |
+
$echo_str .= "\n\t\t\t".'<p class="submit">';
|
1279 |
+
$echo_str .= "\n\t\t\t\t".'<input id="dp_filedetails_submit_fields" type="submit" class="button-primary" name="submit" value="Update" disabled="disabled" />';
|
1280 |
+
$echo_str .= "\n\t\t\t".'</p>';
|
1281 |
+
}
|
1282 |
+
$echo_str .= "\n\t\t".'</form>';
|
1283 |
+
$echo_str .= "\n\t".'</div>';
|
1284 |
+
$handler = 'function() { wfu_Attach_FileDetails_Admin_Events(); }';
|
1285 |
+
$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>';
|
1286 |
+
$echo_str .= '</div>';
|
1287 |
+
|
1288 |
+
return $echo_str;
|
1289 |
+
}
|
1290 |
+
|
1291 |
+
function wfu_edit_filedetails($file_code) {
|
1292 |
+
global $wpdb;
|
1293 |
+
$table_name2 = $wpdb->prefix . "wfu_userdata";
|
1294 |
+
$allow_obsolete = false;
|
1295 |
+
|
1296 |
+
if ( substr($file_code, 0, 5) == "byID:" ) {
|
1297 |
+
$allow_obsolete = true;
|
1298 |
+
$file_code = substr($file_code, 5);
|
1299 |
+
}
|
1300 |
+
|
1301 |
+
$user = wp_get_current_user();
|
1302 |
+
$is_admin = current_user_can( 'manage_options' );
|
1303 |
+
//check if user is allowed to view file details
|
1304 |
+
if ( !$is_admin ) {
|
1305 |
+
if ( $allow_obsolete ) return;
|
1306 |
+
return;
|
1307 |
+
}
|
1308 |
+
if ( $allow_obsolete ) {
|
1309 |
+
$file_code = wfu_sanitize_int($file_code);
|
1310 |
+
$initialrec = wfu_get_file_rec_from_id($file_code, true);
|
1311 |
+
if ( $initialrec == null ) return;
|
1312 |
+
|
1313 |
+
//get all associated file records
|
1314 |
+
$filerecs = wfu_get_rec_new_history($initialrec->idlog);
|
1315 |
+
//get the latest record of this upload
|
1316 |
+
$filerec = $filerecs[count($filerecs) - 1];
|
1317 |
+
$filerec->userdata = $initialrec->userdata;
|
1318 |
+
|
1319 |
+
$filepath = wfu_path_rel2abs($filerec->filepath);
|
1320 |
+
$latestrec = wfu_get_file_rec($filepath, true);
|
1321 |
+
//if $latestrec is null then this means that file does not exist
|
1322 |
+
if ( $latestrec == null ) return;
|
1323 |
+
//if the record is obsolete then do not proceed
|
1324 |
+
if ( $latestrec->idlog != $filerec->idlog ) return;
|
1325 |
+
}
|
1326 |
+
else {
|
1327 |
+
$file_code = wfu_sanitize_code($file_code);
|
1328 |
+
$dec_file = wfu_get_filepath_from_safe($file_code);
|
1329 |
+
if ( $dec_file === false ) return;
|
1330 |
+
|
1331 |
+
$filepath = wfu_path_rel2abs(wfu_flatten_path($dec_file));
|
1332 |
+
|
1333 |
+
//check if user is allowed to perform this action
|
1334 |
+
if ( !wfu_current_user_owes_file($filepath) ) return;
|
1335 |
+
|
1336 |
+
//get file data from database with user data
|
1337 |
+
$filerec = wfu_get_file_rec($filepath, true);
|
1338 |
+
if ( $filerec == null ) return;
|
1339 |
+
}
|
1340 |
+
|
1341 |
+
if ( isset($_POST['submit']) ) {
|
1342 |
+
if ( $_POST['submit'] == "Update" ) {
|
1343 |
+
if ( !is_array($filerec->userdata) ) $filerec->userdata = array();
|
1344 |
+
//check for errors
|
1345 |
+
$is_error = false;
|
1346 |
+
foreach ( $filerec->userdata as $userdata ) {
|
1347 |
+
if ( !isset($_POST['wfu_filedetails_userdata_'.$userdata->propkey]) ) {
|
1348 |
+
$is_error = true;
|
1349 |
+
break;
|
1350 |
+
}
|
1351 |
+
}
|
1352 |
+
if ( !$is_error ) {
|
1353 |
+
$now_date = date('Y-m-d H:i:s');
|
1354 |
+
$userdata_count = 0;
|
1355 |
+
foreach ( $filerec->userdata as $userdata ) {
|
1356 |
+
$userdata_count ++;
|
1357 |
+
//make existing userdata record obsolete
|
1358 |
+
$wpdb->update($table_name2,
|
1359 |
+
array( 'date_to' => $now_date ),
|
1360 |
+
array( 'uploadid' => $userdata->uploadid, 'propkey' => $userdata->propkey ),
|
1361 |
+
array( '%s' ),
|
1362 |
+
array( '%s', '%s' )
|
1363 |
+
);
|
1364 |
+
//insert new userdata record
|
1365 |
+
$wpdb->insert($table_name2,
|
1366 |
+
array(
|
1367 |
+
'uploadid' => $userdata->uploadid,
|
1368 |
+
'property' => $userdata->property,
|
1369 |
+
'propkey' => $userdata->propkey,
|
1370 |
+
'propvalue' => $_POST['wfu_filedetails_userdata_'.$userdata->propkey],
|
1371 |
+
'date_from' => $now_date,
|
1372 |
+
'date_to' => 0
|
1373 |
+
),
|
1374 |
+
array(
|
1375 |
+
'%s',
|
1376 |
+
'%s',
|
1377 |
+
'%d',
|
1378 |
+
'%s',
|
1379 |
+
'%s',
|
1380 |
+
'%s'
|
1381 |
+
)
|
1382 |
+
);
|
1383 |
+
}
|
1384 |
+
if ( $userdata_count > 0 ) wfu_log_action('modify:'.$now_date, $filepath, $user->ID, '', 0, 0, '', null);
|
1385 |
+
}
|
1386 |
+
if ( isset($_POST['wfu_filedetails_userid']) && $_POST['wfu_filedetails_userid'] != $filerec->uploaduserid ) {
|
1387 |
+
wfu_log_action('changeuser:'.$_POST['wfu_filedetails_userid'], $filepath, $user->ID, '', 0, 0, '', null);
|
1388 |
+
}
|
1389 |
+
}
|
1390 |
+
}
|
1391 |
+
return true;
|
1392 |
+
}
|
1393 |
+
|
1394 |
+
?>
|
lib/wfu_admin_composer.php
CHANGED
@@ -1,899 +1,901 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
function wfu_shortcode_composer($data = '', $shortcode_tag = 'wordpress_file_upload') {
|
4 |
-
global $wp_roles;
|
5 |
-
$siteurl = site_url();
|
6 |
-
|
7 |
-
$plugin_options = wfu_decode_plugin_options(get_option( "wordpress_file_upload_options" ));
|
8 |
-
$components = wfu_component_definitions();
|
9 |
-
if ( $shortcode_tag == 'wordpress_file_upload' ) {
|
10 |
-
$plugin_title = "Uploader";
|
11 |
-
$cats = wfu_category_definitions();
|
12 |
-
$defs = wfu_attribute_definitions();
|
13 |
-
//remove personaldata category if Personal Data are not activated in
|
14 |
-
//plugin's Settings
|
15 |
-
if ($plugin_options["personaldata"] != "1" && isset($cats["personaldata"])) unset($cats["personaldata"]);
|
16 |
-
}
|
17 |
-
else {
|
18 |
-
$plugin_title = "Browser";
|
19 |
-
$cats = wfu_browser_category_definitions();
|
20 |
-
$defs = wfu_browser_attribute_definitions();
|
21 |
-
}
|
22 |
-
|
23 |
-
if ( $data == "" ) {
|
24 |
-
$shortcode = $plugin_options['shortcode'];
|
25 |
-
$shortcode_full = '['.$shortcode_tag.' '.$shortcode.']';
|
26 |
-
$postid = "";
|
27 |
-
$postname = "";
|
28 |
-
$posttype = "";
|
29 |
-
$posthash = "";
|
30 |
-
$shortcode_position = -1;
|
31 |
-
$widgetid = "";
|
32 |
-
$sidebar = "";
|
33 |
-
$autosave = true;
|
34 |
-
}
|
35 |
-
else {
|
36 |
-
$shortcode = trim(substr($data['shortcode'], strlen('['.$shortcode_tag), -1));
|
37 |
-
$shortcode_full = $data['shortcode'];
|
38 |
-
$postid = $data['post_id'];
|
39 |
-
$postname = get_the_title($postid);
|
40 |
-
$posttype_obj = get_post_type_object(get_post_type($postid));
|
41 |
-
$posttype = ( $posttype_obj ? $posttype_obj->labels->singular_name : "" );
|
42 |
-
$posthash = $data['post_hash'];
|
43 |
-
$shortcode_position = $data['position'];
|
44 |
-
$widgetid = ( isset($data['widgetid']) ? $data['widgetid'] : "" );
|
45 |
-
$sidebar = ( isset($data['sidebar']) ? $data['sidebar'] : "" );
|
46 |
-
$autosave = false;
|
47 |
-
}
|
48 |
-
|
49 |
-
// index $components
|
50 |
-
$components_indexed = array();
|
51 |
-
foreach ( $components as $component ) $components_indexed[$component['id']] = $component;
|
52 |
-
// complete defs array and index dependencies
|
53 |
-
$governors = array();
|
54 |
-
$shortcode_attrs = wfu_shortcode_string_to_array($shortcode);
|
55 |
-
//replace old attribute definitions with new ones
|
56 |
-
$shortcode_attrs = wfu_old_to_new_attributes($shortcode_attrs);
|
57 |
-
$shortcode_id = '';
|
58 |
-
foreach ( $defs as $key => $def ) {
|
59 |
-
$attr = $def['attribute'];
|
60 |
-
$defs[$key]['default'] = $def['value'];
|
61 |
-
//'flat' property keeps the original attribute, because 'attribute'
|
62 |
-
//property will change for defs that their occurrence is higher than 1
|
63 |
-
$defs[$key]['flat'] = $attr;
|
64 |
-
if ( array_key_exists($attr, $shortcode_attrs) ) $defs[$key]['value'] = $shortcode_attrs[$attr];
|
65 |
-
$subblock_active = false;
|
66 |
-
//detect if the dependencies of this attribute will be disabled or not
|
67 |
-
if ( ( $def['type'] == "onoff" && $defs[$key]['value'] == "true" ) ||
|
68 |
-
( $def['type'] == "radio" && in_array("*".$defs[$key]['value'], $def['listitems']) ) )
|
69 |
-
$subblock_active = true;
|
70 |
-
// assign dependencies if exist
|
71 |
-
if ( $def['dependencies'] != null )
|
72 |
-
foreach ( $def['dependencies'] as $dependency ) {
|
73 |
-
if ( substr($dependency, 0, 1) == "!" ) //invert state for this dependency if an exclamation mark is defined
|
74 |
-
$governors[substr($dependency, 1)] = array( 'attribute' => $attr, 'active' => !$subblock_active, 'inv' => '_inv' );
|
75 |
-
else
|
76 |
-
$governors[$dependency] = array( 'attribute' => $attr, 'active' => $subblock_active, 'inv' => '' );
|
77 |
-
}
|
78 |
-
if ( $attr == 'uploadid' || $attr == 'browserid' ) $shortcode_id = $defs[$key]['value'];
|
79 |
-
}
|
80 |
-
|
81 |
-
//check if attributes need to be generated more than once because their governor is a component field that appears more than once in placements attribute
|
82 |
-
$key = 0;
|
83 |
-
while ( $key < count($defs) ) {
|
84 |
-
$defs[$key]['additional_values'] = array();
|
85 |
-
$def = $defs[$key];
|
86 |
-
$attr = $def['attribute'];
|
87 |
-
//check if this attribute needs to be generated more than once
|
88 |
-
if ( array_key_exists($attr, $governors) ) $governor = $governors[$attr]['attribute'];
|
89 |
-
else $governor = "";
|
90 |
-
if ( $governor != "" && isset($components_indexed[$governor]) && $components_indexed[$governor]['multiplacements'] && isset($shortcode_attrs['placements']) ) {
|
91 |
-
//count how many occurrences of the governor attribute appear inside placements attribute
|
92 |
-
$occurrences = 0;
|
93 |
-
$sections = explode("/", $shortcode_attrs['placements']);
|
94 |
-
foreach ( $sections as $section ) {
|
95 |
-
$items_in_section = explode("+", trim($section));
|
96 |
-
foreach ( $items_in_section as $item )
|
97 |
-
if ( trim($item) == $governor ) $occurrences++;
|
98 |
-
}
|
99 |
-
//add indexed attributes if there is more than one occurrence
|
100 |
-
for ( $ii = 2; $ii <= $occurrences; $ii++ ) {
|
101 |
-
$def2 = $def;
|
102 |
-
$def2['attribute'] .= $ii;
|
103 |
-
$def2['name'] .= ' ('.$ii.')';
|
104 |
-
if ( array_key_exists($def2['attribute'], $shortcode_attrs) )
|
105 |
-
$def2['value'] = $shortcode_attrs[$def2['attribute']];
|
106 |
-
else $def2['value'] = $def2['default'];
|
107 |
-
array_splice($defs, $key + 1, 0, array($def2));
|
108 |
-
$key++;
|
109 |
-
}
|
110 |
-
//check if the shortcode contains additional indexed definitions and store them in 'additional_values'
|
111 |
-
$ii = max(1, $occurrences) + 1;
|
112 |
-
while ( array_key_exists($attr.$ii, $shortcode_attrs) ) {
|
113 |
-
$defs[$key]['additional_values'][$ii] = $shortcode_attrs[$attr.$ii];
|
114 |
-
$ii++;
|
115 |
-
}
|
116 |
-
}
|
117 |
-
$key++;
|
118 |
-
}
|
119 |
-
|
120 |
-
$echo_str = '<div id="wfu_wrapper" class="wrap">';
|
121 |
-
$echo_str .= "\n\t".'<h2>Wordpress File Upload Control Panel</h2>';
|
122 |
-
$echo_str .= "\n\t".'<div id="wfu_page_obsolete_message" class="error" style="display:none;">';
|
123 |
-
$echo_str .= "\n\t\t".'<p>'.WFU_DASHBOARD_PAGE_OBSOLETE.'</p>';
|
124 |
-
$echo_str .= "\n\t".'</div>';
|
125 |
-
$echo_str .= "\n\t".'<div id="wfu_update_rejected_message" class="error" style="display:none;">';
|
126 |
-
$echo_str .= "\n\t\t".'<p>'.WFU_DASHBOARD_UPDATE_SHORTCODE_REJECTED.'</p>';
|
127 |
-
$echo_str .= "\n\t".'</div>';
|
128 |
-
$echo_str .= "\n\t".'<div id="wfu_update_failed_message" class="error" style="display:none;">';
|
129 |
-
$echo_str .= "\n\t\t".'<p>'.WFU_DASHBOARD_UPDATE_SHORTCODE_FAILED.'</p>';
|
130 |
-
$echo_str .= "\n\t".'</div>';
|
131 |
-
$echo_str .= "\n\t".'<div style="margin-top:20px;">';
|
132 |
-
if (
|
133 |
-
$echo_str .= "\n\t".'</div>';
|
134 |
-
if ( $widgetid == "" ) $echo_str .= "\n\t".'<h2 style="margin-bottom: 10px; margin-top: 20px;">'.( $data == "" ? 'Test' : $posttype.' <strong>'.$postname.'</strong>' ).': Shortcode Composer for '.$plugin_title.' <strong>ID '.$shortcode_id.'</strong></h2>';
|
135 |
-
else $echo_str .= "\n\t".'<h2 style="margin-bottom: 10px; margin-top: 20px;">Sidebar <strong>'.$sidebar.'</strong>: Shortcode Composer for Uploader <strong>ID '.$shortcode_id.'</strong></h2>';
|
136 |
-
$echo_str .= "\n\t".'<div style="margin-top:10px; display:inline-block;">';
|
137 |
-
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>';
|
138 |
-
$echo_str .= "\n\t\t".'<input id="wfu_shortcode_original_enc" type="hidden" value="'.wfu_plugin_encode_string($shortcode_full).'" />';
|
139 |
-
$echo_str .= "\n\t\t".'<input id="wfu_shortcode_tag" type="hidden" value="'.$shortcode_tag.'" />';
|
140 |
-
$echo_str .= "\n\t\t".'<input id="wfu_shortcode_postid" type="hidden" value="'.$postid.'" />';
|
141 |
-
$echo_str .= "\n\t\t".'<input id="wfu_shortcode_posthash" type="hidden" value="'.$posthash.'" />';
|
142 |
-
$echo_str .= "\n\t\t".'<input id="wfu_shortcode_position" type="hidden" value="'.$shortcode_position.'" />';
|
143 |
-
$echo_str .= "\n\t\t".'<input id="wfu_shortcode_widgetid" type="hidden" value="'.$widgetid.'" />';
|
144 |
-
$echo_str .= "\n\t".'</div>';
|
145 |
-
$echo_str .= "\n\t".'<div style="margin-top:20px;">';
|
146 |
-
$echo_str .= "\n\t\t".'<div class="wfu_shortcode_container">';
|
147 |
-
$echo_str .= "\n\t\t\t".'<span><strong>Generated Shortcode</strong></span>';
|
148 |
-
$echo_str .= "\n\t\t\t".'<span id="wfu_save_label" class="wfu_save_label">saved</span>';
|
149 |
-
$echo_str .= "\n\t\t\t".'<textarea id="wfu_shortcode" class="wfu_shortcode" rows="5">['.$shortcode_tag.']</textarea>';
|
150 |
-
$echo_str .= "\n\t\t\t".'<div id="wfu_attribute_defaults" style="display:none;">';
|
151 |
-
// remove hidden attributes from defs array
|
152 |
-
foreach ( $defs as $key => $def ) if ( $def['type'] == "hidden" ) unset($defs[$key]);
|
153 |
-
foreach ( $defs as $def )
|
154 |
-
$echo_str .= "\n\t\t\t\t".'<input id="wfu_attribute_default_'.$def['attribute'].'" type="hidden" value="'.$def['default'].'" />';
|
155 |
-
$echo_str .= "\n\t\t\t".'</div>';
|
156 |
-
$echo_str .= "\n\t\t\t".'<div id="wfu_attribute_values" style="display:none;">';
|
157 |
-
foreach ( $defs as $def ) {
|
158 |
-
$echo_str .= "\n\t\t\t\t".'<input id="wfu_attribute_value_'.$def['attribute'].'" type="hidden" value="'.$def['value'].'" />';
|
159 |
-
//add additional values, if exist
|
160 |
-
foreach( $def['additional_values'] as $key => $val )
|
161 |
-
$echo_str .= "\n\t\t\t\t".'<input id="wfu_attribute_value_'.$def['attribute'].$key.'" type="hidden" value="'.$val.'" />';
|
162 |
-
}
|
163 |
-
$echo_str .= "\n\t\t\t".'</div>';
|
164 |
-
$echo_str .= "\n\t\t".'</div>';
|
165 |
-
$echo_str .= "\n\t".'</div>';
|
166 |
-
$echo_str .= "\n\t".'<h3 id="wfu_tab_container" class="nav-tab-wrapper">';
|
167 |
-
$is_first = true;
|
168 |
-
foreach ( $cats as $key => $cat ) {
|
169 |
-
$echo_str .= "\n\t\t".'<a id="wfu_tab_'.$key.'" class="nav-tab'.( $is_first ? ' nav-tab-active' : '' ).'" href="javascript: wfu_admin_activate_tab(\''.$key.'\');">'.$cat.'</a>';
|
170 |
-
$is_first = false;
|
171 |
-
}
|
172 |
-
$echo_str .= "\n\t".'</h3>';
|
173 |
-
|
174 |
-
$prevcat = "";
|
175 |
-
$prevsubcat = "";
|
176 |
-
$is_first = true;
|
177 |
-
$block_open = false;
|
178 |
-
$subblock_open = false;
|
179 |
-
foreach ( $defs as $def ) {
|
180 |
-
$attr = $def['attribute'];
|
181 |
-
//check if this attribute depends on other
|
182 |
-
if ( !array_key_exists($attr, $governors) ) $governors[$attr] = "";
|
183 |
-
if ( $governors[$attr] != "" ) $governor = $governors[$attr];
|
184 |
-
else $governor = array( 'attribute' => "independent", 'active' => true, 'inv' => '' );
|
185 |
-
|
186 |
-
//close previous blocks
|
187 |
-
if ( $def['parent'] == "" ) {
|
188 |
-
if ( $subblock_open ) {
|
189 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'</tbody>';
|
190 |
-
$echo_str .= "\n\t\t\t\t\t\t".'</table>';
|
191 |
-
$subblock_open = false;
|
192 |
-
}
|
193 |
-
if ( $block_open ) {
|
194 |
-
$echo_str .= "\n\t\t\t\t\t".'</div></td>';
|
195 |
-
$echo_str .= "\n\t\t\t\t".'</tr>';
|
196 |
-
$block_open = false;
|
197 |
-
}
|
198 |
-
}
|
199 |
-
//check if new category must be generated
|
200 |
-
if ( $def['category'] != $prevcat ) {
|
201 |
-
if ( $prevcat != "" ) {
|
202 |
-
$echo_str .= "\n\t\t\t".'</tbody>';
|
203 |
-
$echo_str .= "\n\t\t".'</table>';
|
204 |
-
$echo_str .= "\n\t".'</div>';
|
205 |
-
}
|
206 |
-
$prevcat = $def['category'];
|
207 |
-
$prevsubcat = "";
|
208 |
-
$echo_str .= "\n\t".'<div id="wfu_container_'.$prevcat.'" class="wfu_container"'.( $is_first ? '' : ' style="display:none;"' ).'">';
|
209 |
-
$echo_str .= "\n\t\t".'<table class="form-table wfu_main_table">';
|
210 |
-
$echo_str .= "\n\t\t\t".'<thead><tr><th></th><td></td><td></td></tr></thead>';
|
211 |
-
$echo_str .= "\n\t\t\t".'<tbody>';
|
212 |
-
$is_first = false;
|
213 |
-
}
|
214 |
-
//check if new sub-category must be generated
|
215 |
-
if ( $def['subcategory'] != $prevsubcat ) {
|
216 |
-
$prevsubcat = $def['subcategory'];
|
217 |
-
$echo_str .= "\n\t\t\t\t".'<tr class="wfu_subcategory">';
|
218 |
-
$echo_str .= "\n\t\t\t\t\t".'<th scope="row" colspan="3">';
|
219 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<h3 style="margin-bottom: 10px; margin-top: 10px;">'.$prevsubcat.'</h3>';
|
220 |
-
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
221 |
-
$echo_str .= "\n\t\t\t\t".'</tr>';
|
222 |
-
}
|
223 |
-
//draw attribute element
|
224 |
-
if ( $def['parent'] == "" ) {
|
225 |
-
$dlp = "\n\t\t\t\t";
|
226 |
-
}
|
227 |
-
else {
|
228 |
-
if ( !$subblock_open ) {
|
229 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<div class="wfu_shadow wfu_shadow_'.$def['parent'].$governor['inv'].'" style="display:'.( $governor['active'] ? 'none' : 'block' ).';"></div>';
|
230 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<table class="form-table wfu_inner_table" style="margin:0;">';
|
231 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<tbody>';
|
232 |
-
}
|
233 |
-
$dlp = "\n\t\t\t\t\t\t\t\t";
|
234 |
-
}
|
235 |
-
$echo_str .= $dlp.'<tr>';
|
236 |
-
$echo_str .= $dlp."\t".'<th scope="row"><div class="wfu_td_div">';
|
237 |
-
if ( $def['parent'] == "" ) $echo_str .= $dlp."\t\t".'<div class="wfu_shadow wfu_shadow_'.$governor['attribute'].$governor['inv'].'" style="display:'.( $governor['active'] ? 'none' : 'block' ).';"></div>';
|
238 |
-
$echo_str .= $dlp."\t\t".'<div class="wfu_restore_container" title="Double-click to restore defaults setting"><img src="'.WFU_IMAGE_ADMIN_RESTOREDEFAULT.'" ondblclick="wfu_apply_value(\''.$attr.'\', \''.$def['type'].'\', \''.$def['default'].'\');" /></div>';
|
239 |
-
$echo_str .= $dlp."\t\t".'<label for="wfu_attribute_'.$attr.'">'.$def['name'].'</label>';
|
240 |
-
$echo_str .= $dlp."\t\t".'<input type="hidden" name="wfu_attribute_governor_'.$governor['attribute'].'" class="wfu_attribute_governor" value="'.$attr.'" />';
|
241 |
-
$echo_str .= $dlp."\t\t".'<div class="wfu_help_container" title="'.$def['help'].'"><img src="'.WFU_IMAGE_ADMIN_HELP.'" /></div>';
|
242 |
-
$echo_str .= $dlp."\t".'</div></th>';
|
243 |
-
$echo_str .= $dlp."\t".'<td style="vertical-align:top;"><div class="wfu_td_div">';
|
244 |
-
if ( $def['parent'] == "" ) $echo_str .= $dlp."\t\t".'<div class="wfu_shadow wfu_shadow_'.$governor['attribute'].$governor['inv'].'" style="display:'.( $governor['active'] ? 'none' : 'block' ).';"></div>';
|
245 |
-
if ( $def['type'] == "onoff" ) {
|
246 |
-
$echo_str .= $dlp."\t\t".'<div id="wfu_attribute_'.$attr.'" class="wfu_onoff_container_'.( $def['value'] == "true" ? "on" : "off" ).'" onclick="wfu_admin_onoff_clicked(\''.$attr.'\');">';
|
247 |
-
$echo_str .= $dlp."\t\t\t".'<div class="wfu_onoff_slider"></div>';
|
248 |
-
$echo_str .= $dlp."\t\t\t".'<span class="wfu_onoff_text">ON</span>';
|
249 |
-
$echo_str .= $dlp."\t\t\t".'<span class="wfu_onoff_text">OFF</span>';
|
250 |
-
$echo_str .= $dlp."\t\t".'</div>';
|
251 |
-
}
|
252 |
-
elseif ( $def['type'] == "text" ) {
|
253 |
-
$val = str_replace(array( "%n%", "%dq%", "%brl%", "%brr%" ), array( "\n", """, "[", "]" ), $def['value']);
|
254 |
-
$echo_str .= $dlp."\t\t".'<input id="wfu_attribute_'.$attr.'" type="text" name="wfu_text_elements" value="'.$val.'" style="display:block;" />';
|
255 |
-
if ( $def['variables'] != null ) $echo_str .= $dlp.wfu_insert_variables($def['variables'], 'wfu_variable wfu_variable_'.$attr);
|
256 |
-
}
|
257 |
-
elseif ( $def['type'] == "placements" ) {
|
258 |
-
$components_used = array();
|
259 |
-
foreach ( $components as $component ) $components_used[$component['id']] = 0;
|
260 |
-
$centered_content = '<div class="wfu_component_box_inner"><div class="wfu_component_box_label">XXX</div></div>';
|
261 |
-
$centered_content_multi = '<div class="wfu_component_box_inner"><div class="wfu_component_box_label">XXX</div><div class="wfu_component_box_index">YYY</div></div>';
|
262 |
-
$echo_str .= $dlp."\t\t".'<div class="wfu_placements_wrapper">';
|
263 |
-
$echo_str .= $dlp."\t\t\t".'<div id="wfu_placements_container" class="wfu_placements_container">';
|
264 |
-
$itemplaces = explode("/", $def['value']);
|
265 |
-
foreach ( $itemplaces as $section ) {
|
266 |
-
$echo_str .= $dlp."\t\t\t\t".'<div class="wfu_component_separator_hor"></div>';
|
267 |
-
$echo_str .= $dlp."\t\t\t\t".'<div class="wfu_component_separator_ver"></div>';
|
268 |
-
$items_in_section = explode("+", trim($section));
|
269 |
-
$section_array = array( );
|
270 |
-
foreach ( $items_in_section as $item_in_section ) {
|
271 |
-
if ( key_exists($item_in_section, $components_indexed) ) {
|
272 |
-
if ( $components_indexed[$item_in_section]['multiplacements'] || $components_used[$item_in_section] == 0 ) {
|
273 |
-
$components_used[$item_in_section] ++;
|
274 |
-
if ( $components_indexed[$item_in_section]['multiplacements'] ) {
|
275 |
-
$multi_index = $components_used[$item_in_section];
|
276 |
-
$echo_str .= $dlp."\t\t\t\t".'<div id="wfu_component_box_'.$item_in_section.'_'.$multi_index.'" class="wfu_component_box" draggable="true" title="'.$components_indexed[$item_in_section]['help'].'">'.str_replace(array("XXX", "YYY"), array($components_indexed[$item_in_section]['name'], $multi_index), $centered_content_multi).'</div>';
|
277 |
-
}
|
278 |
-
else
|
279 |
-
$echo_str .= $dlp."\t\t\t\t".'<div id="wfu_component_box_'.$item_in_section.'_0" class="wfu_component_box" draggable="true" title="'.$components_indexed[$item_in_section]['help'].'">'.str_replace("XXX", $components_indexed[$item_in_section]['name'], $centered_content).'</div>';
|
280 |
-
$echo_str .= $dlp."\t\t\t\t".'<div class="wfu_component_separator_ver"></div>';
|
281 |
-
}
|
282 |
-
}
|
283 |
-
}
|
284 |
-
}
|
285 |
-
$echo_str .= $dlp."\t\t\t\t".'<div class="wfu_component_separator_hor"></div>';
|
286 |
-
$echo_str .= $dlp."\t\t\t\t".'<div id="wfu_component_bar_hor" class="wfu_component_bar_hor"></div>';
|
287 |
-
$echo_str .= $dlp."\t\t\t\t".'<div id="wfu_component_bar_ver" class="wfu_component_bar_ver"></div>';
|
288 |
-
$echo_str .= $dlp."\t\t\t".'</div>';
|
289 |
-
$echo_str .= $dlp."\t\t\t".'<div id="wfu_componentlist_container" class="wfu_componentlist_container">';
|
290 |
-
$echo_str .= $dlp."\t\t\t\t".'<div id="wfu_componentlist_dragdrop" class="wfu_componentlist_dragdrop" style="display:none;"></div>';
|
291 |
-
$ii = 1;
|
292 |
-
foreach ( $components as $component ) {
|
293 |
-
$echo_str .= $dlp."\t\t\t\t".'<div id="wfu_component_box_container_'.$component['id'].'" class="wfu_component_box_container">';
|
294 |
-
$echo_str .= $dlp."\t\t\t\t\t".'<div class="wfu_component_box_base">'.str_replace("XXX", $component['name'], $centered_content).'</div>';
|
295 |
-
if ( $component['multiplacements'] ) {
|
296 |
-
$multi_index = $components_used[$component['id']] + 1;
|
297 |
-
$echo_str .= $dlp."\t\t\t\t\t".'<div id="wfu_component_box_'.$component['id'].'_'.$multi_index.'" class="wfu_component_box wfu_inbase" draggable="true" title="'.$component['help'].'">'.str_replace(array("XXX", "YYY"), array($component['name'], $multi_index), $centered_content_multi).'</div>';
|
298 |
-
}
|
299 |
-
elseif ( $components_used[$component['id']] == 0 )
|
300 |
-
$echo_str .= $dlp."\t\t\t\t\t".'<div id="wfu_component_box_'.$component['id'].'_0" class="wfu_component_box wfu_inbase" draggable="true" title="'.$component['help'].'">'.str_replace("XXX", $component['name'], $centered_content).'</div>';
|
301 |
-
$echo_str .= $dlp."\t\t\t\t".'</div>'.( ($ii++) % 3 == 0 ? '<br />' : '' );
|
302 |
-
}
|
303 |
-
$echo_str .= $dlp."\t\t\t".'</div>';
|
304 |
-
$echo_str .= $dlp."\t\t".'</div>';
|
305 |
-
}
|
306 |
-
elseif ( $def['type'] == "ltext" ) {
|
307 |
-
$val = str_replace(array( "%n%", "%dq%", "%brl%", "%brr%" ), array( "\n", """, "[", "]" ), $def['value']);
|
308 |
-
$echo_str .= $dlp."\t\t".'<input id="wfu_attribute_'.$attr.'" type="text" name="wfu_text_elements" class="wfu_long_text" value="'.$val.'" />';
|
309 |
-
if ( $def['variables'] != null ) $echo_str .= $dlp.wfu_insert_variables($def['variables'], 'wfu_variable wfu_variable_'.$attr);
|
310 |
-
}
|
311 |
-
elseif ( $def['type'] == "integer" ) {
|
312 |
-
$val = str_replace(array( "%n%", "%dq%", "%brl%", "%brr%" ), array( "\n", """, "[", "]" ), $def['value']);
|
313 |
-
$echo_str .= $dlp."\t\t".'<input id="wfu_attribute_'.$attr.'" type="number" name="wfu_text_elements" class="wfu_short_text" min="1" value="'.$val.'" />';
|
314 |
-
if ( isset($def['listitems']['unit']) ) $echo_str .= $dlp."\t\t".'<label> '.$def['listitems']['unit'].'</label>';
|
315 |
-
}
|
316 |
-
elseif ( $def['type'] == "float" ) {
|
317 |
-
$val = str_replace(array( "%n%", "%dq%", "%brl%", "%brr%" ), array( "\n", """, "[", "]" ), $def['value']);
|
318 |
-
$echo_str .= $dlp."\t\t".'<input id="wfu_attribute_'.$attr.'" type="number" name="wfu_text_elements" class="wfu_short_text" step="any" min="0" value="'.$val.'" />';
|
319 |
-
if ( isset($def['listitems']['unit']) ) $echo_str .= $dlp."\t\t".'<label> '.$def['listitems']['unit'].'</label>';
|
320 |
-
}
|
321 |
-
elseif ( $def['type'] == "date" ) {
|
322 |
-
$val = $def['value'];
|
323 |
-
$echo_str .= $dlp."\t\t".'<div class="wfu_date_container"><input id="wfu_attribute_'.$attr.'" type="text" value="'.$val.'" readonly style="padding-right:16px; background-color:white; width:auto;" /><img class="wfu_datereset_button" src="'.WFU_IMAGE_ADMIN_SUBFOLDER_CANCEL.'" onclick="var f = document.getElementById(\'wfu_attribute_'.$attr.'\'); f.value = \'\'; wfu_update_date_value({target:f});" /></div><label style="font-size:smaller; margin-left:4px;">format: YYYY-MM-DD</label>';
|
324 |
-
$echo_str .= wfu_inject_js_code('jQuery(function() {jQuery("#wfu_attribute_'.$attr.'").datepicker({dateFormat: "yy-mm-dd", onClose: function(date, picker) {wfu_update_date_value({target:this});}});});');
|
325 |
-
}
|
326 |
-
elseif ( $def['type'] == "radio" ) {
|
327 |
-
$echo_str .= $dlp."\t\t";
|
328 |
-
$ii = 0;
|
329 |
-
foreach ( $def['listitems'] as $item )
|
330 |
-
$echo_str .= '<input name="wfu_radioattribute_'.$attr.'" type="radio" value="'.$item.'" '.( $item == $def['value'] || $item == "*".$def['value'] ? 'checked="checked" ' : '' ).'style="width:auto; margin:0px 2px 0px '.( ($ii++) == 0 ? '0px' : '8px' ).';" onchange="wfu_admin_radio_clicked(\''.$attr.'\');" />'.( $item[0] == "*" ? substr($item, 1) : $item );
|
331 |
-
// $echo_str .= '<input type="button" class="button" value="empty" style="width:auto; margin:-2px 0px 0px 8px;" />';
|
332 |
-
}
|
333 |
-
elseif ( $def['type'] == "ptext" ) {
|
334 |
-
$val = str_replace(array( "%n%", "%dq%", "%brl%", "%brr%" ), array( "\n", """, "[", "]" ), $def['value']);
|
335 |
-
$parts = explode("/", $val);
|
336 |
-
$singular = $parts[0];
|
337 |
-
if ( count($parts) < 2 ) $plural = $singular;
|
338 |
-
else $plural = $parts[1];
|
339 |
-
$echo_str .= $dlp."\t\t".'<span class="wfu_ptext_span">Singular</span><input id="wfu_attribute_s_'.$attr.'" type="text" name="wfu_ptext_elements" value="'.$singular.'" />';
|
340 |
-
if ( $def['variables'] != null ) if ( count($def['variables']) > 0 ) $echo_str .= $dlp."\t\t".'<br /><span class="wfu_ptext_span"> </span>';
|
341 |
-
if ( $def['variables'] != null ) $echo_str .= $dlp.wfu_insert_variables($def['variables'], 'wfu_variable wfu_variable_s_'.$attr);
|
342 |
-
$echo_str .= $dlp."\t\t".'<br /><span class="wfu_ptext_span">Plural</span><input id="wfu_attribute_p_'.$attr.'" type="text" name="wfu_ptext_elements" value="'.$plural.'" />';
|
343 |
-
if ( $def['variables'] != null ) if ( count($def['variables']) > 0 ) $echo_str .= $dlp."\t\t".'<br /><span class="wfu_ptext_span"> </span>';
|
344 |
-
if ( $def['variables'] != null ) $echo_str .= $dlp.wfu_insert_variables($def['variables'], 'wfu_variable wfu_variable_p_'.$attr, $dlp);
|
345 |
-
}
|
346 |
-
elseif ( $def['type'] == "mtext" ) {
|
347 |
-
$val = str_replace(array( "%n%", "%dq%", "%brl%", "%brr%" ), array( "\n", """, "[", "]" ), $def['value']);
|
348 |
-
$echo_str .= $dlp."\t\t".'<textarea id="wfu_attribute_'.$attr.'" name="wfu_text_elements" rows="5">'.$val.'</textarea>';
|
349 |
-
if ( $def['variables'] != null ) $echo_str .= $dlp.wfu_insert_variables($def['variables'], 'wfu_variable wfu_variable_'.$attr);
|
350 |
-
}
|
351 |
-
elseif ( $def['type'] == "folderlist" ) {
|
352 |
-
$echo_str .= $dlp."\t\t".'<div id="wfu_subfolders_inner_shadow_'.$attr.'" class="wfu_subfolders_inner_shadow" style="display:none;"></div>';
|
353 |
-
$subfolders = wfu_parse_folderlist($def['value']);
|
354 |
-
$poptitle = "Populate list automatically with the first-level subfolders of the path defined in uploadpath";
|
355 |
-
$edittitle = "Allow the user to type the subfolder and filter the list during typing";
|
356 |
-
$echo_str .= $dlp."\t\t".'<input type="checkbox" id="wfu_subfolders_auto_'.$attr.'"'.( substr($def['value'], 0, 4) == "auto" ? ' checked="checked"' : '' ).' onchange="wfu_subfolders_auto_changed(\''.$attr.'\');" title="'.$poptitle.'" /><label for="wfu_subfolders_auto_'.$attr.'" title="'.$poptitle.'"> Auto-populate list</label>';
|
357 |
-
$echo_str .= $dlp."\t\t".'<div style="display:'.( substr($def['value'], 0, 4) == "auto" ? 'inline' : 'none' ).'; padding:0; margin:0 0 0 30px; background:none; border:none;"><input type="checkbox" id="wfu_subfolders_editable_'.$attr.'"'.( substr($def['value'], 0, 5) == "auto+" ? ' checked="checked"' : '' ).' onchange="wfu_subfolders_auto_changed(\''.$attr.'\');" title="'.$edittitle.'" /><label for="wfu_subfolders_editable_'.$attr.'" title="'.$edittitle.'"> List is editable</label></div><br />';
|
358 |
-
$echo_str .= $dlp."\t\t".'<input type="hidden" id="wfu_subfolders_manualtext_'.$attr.'" value="'.( substr($def['value'], 0, 4) == "auto" ? "" : $def['value'] ).'" />';
|
359 |
-
$echo_str .= $dlp."\t\t".'<select id="wfu_attribute_'.$attr.'" class="wfu_select_folders'.( count($subfolders['path']) == 0 ? ' wfu_select_folders_empty' : '' ).'" size="7"'.( substr($def['value'], 0, 4) == "auto" ? ' disabled="disabled"' : '' ).' onchange="wfu_subfolders_changed(\''.$attr.'\');">';
|
360 |
-
foreach ($subfolders['path'] as $ind => $subfolder) {
|
361 |
-
if ( substr($subfolder, -1) == '/' ) $subfolder = substr($subfolder, 0, -1);
|
362 |
-
$subfolder_raw = explode('/', $subfolder);
|
363 |
-
$subfolder = $subfolder_raw[count($subfolder_raw) - 1];
|
364 |
-
$text = str_repeat(" ", intval($subfolders['level'][$ind])).$subfolders['label'][$ind];
|
365 |
-
$subvalue = str_repeat("*", intval($subfolders['level'][$ind])).( $subfolders['default'][$ind] ? '&' : '' ).( $subfolder == "" ? '{root}' : $subfolder ).'/'.$subfolders['label'][$ind];
|
366 |
-
$echo_str .= $dlp."\t\t\t".'<option class="'.( $subfolders['default'][$ind] ? 'wfu_select_folders_option_default' : '' ).'" value="'.wfu_plugin_encode_string($subvalue).'">'.$text.'</option>';
|
367 |
-
}
|
368 |
-
$echo_str .= $dlp."\t\t\t".'<option value="">'.( substr($def['value'], 0, 4) != "auto" && count($subfolders['path']) == 0 ? 'press here' : '' ).'</option>';
|
369 |
-
$echo_str .= $dlp."\t\t".'</select>';
|
370 |
-
$echo_str .= $dlp."\t\t".'<div id="wfu_subfolder_nav_'.$attr.'" class="wfu_subfolder_nav_container">';
|
371 |
-
$echo_str .= $dlp."\t\t\t".'<table class="wfu_subfolder_nav"><tbody>';
|
372 |
-
$echo_str .= $dlp."\t\t\t\t".'<tr><td><button id="wfu_subfolders_up_'.$attr.'" name="wfu_subfolder_nav_'.$attr.'" class="button" disabled="disabled" title="move item up" onclick="wfu_subfolders_up_clicked(\''.$attr.'\');">↑</button></tr></td>';
|
373 |
-
$echo_str .= $dlp."\t\t\t\t".'<tr><td><button id="wfu_subfolders_left_'.$attr.'" name="wfu_subfolder_nav_'.$attr.'" class="button" title="make it parent" disabled="disabled" style="height:14px;" onclick="wfu_subfolders_left_clicked(\''.$attr.'\');">←</button>';
|
374 |
-
$echo_str .= $dlp."\t\t\t\t".'<button id="wfu_subfolders_right_'.$attr.'" name="wfu_subfolder_nav_'.$attr.'" class="button" title="make it child" disabled="disabled" style="height:14px;" onclick="wfu_subfolders_right_clicked(\''.$attr.'\');">→</button></tr></td>';
|
375 |
-
$echo_str .= $dlp."\t\t\t\t".'<tr><td><button id="wfu_subfolders_down_'.$attr.'" name="wfu_subfolder_nav_'.$attr.'" class="button" title="move item down" disabled="disabled" onclick="wfu_subfolders_down_clicked(\''.$attr.'\');">↓</button></tr></td>';
|
376 |
-
$echo_str .= $dlp."\t\t\t\t".'<tr><td style="line-height:0;"><button class="button" style="visibility:hidden; height:10px;"></button></tr></td>';
|
377 |
-
$echo_str .= $dlp."\t\t\t\t".'<tr><td><button id="wfu_subfolders_add_'.$attr.'" name="wfu_subfolder_nav_'.$attr.'" class="button" title="add new item" disabled="disabled" style="height:14px;" onclick="wfu_subfolders_add_clicked(\''.$attr.'\');">+</button></tr></td>';
|
378 |
-
$echo_str .= $dlp."\t\t\t\t".'<tr><td><button id="wfu_subfolders_def_'.$attr.'" name="wfu_subfolder_nav_'.$attr.'" class="button" title="make it default" disabled="disabled" style="height:14px;" onclick="wfu_subfolders_def_clicked(\''.$attr.'\');">♦</button></tr></td>';
|
379 |
-
$echo_str .= $dlp."\t\t\t\t".'<tr><td><button id="wfu_subfolders_del_'.$attr.'" name="wfu_subfolder_nav_'.$attr.'" class="button" title="delete item" disabled="disabled" style="height:14px;" onclick="wfu_subfolders_del_clicked(\''.$attr.'\');">-</button></tr></td>';
|
380 |
-
$echo_str .= $dlp."\t\t\t".'</tbody></table>';
|
381 |
-
$echo_str .= $dlp."\t\t".'</div>';
|
382 |
-
$echo_str .= $dlp."\t\t".'<div id="wfu_subfolder_tools_'.$attr.'" class="wfu_subfolder_tools_container wfu_subfolder_tools_disabled">';
|
383 |
-
$echo_str .= $dlp."\t\t\t".'<table class="wfu_subfolder_tools"><tbody><tr>';
|
384 |
-
$echo_str .= $dlp."\t\t\t\t".'<td style="width:40%;">';
|
385 |
-
$echo_str .= $dlp."\t\t\t\t\t".'<label>Label</label>';
|
386 |
-
$echo_str .= $dlp."\t\t\t\t\t".'<input id="wfu_subfolders_label_'.$attr.'" name="wfu_subfolder_tools_input" type="text" disabled="disabled" />';
|
387 |
-
$echo_str .= $dlp."\t\t\t\t".'</td>';
|
388 |
-
$echo_str .= $dlp."\t\t\t\t".'<td style="width:60%;"><div style="padding-right:36px;">';
|
389 |
-
$echo_str .= $dlp."\t\t\t\t\t".'<label>Path</label>';
|
390 |
-
$echo_str .= $dlp."\t\t\t\t\t".'<input id="wfu_subfolders_path_'.$attr.'" name="wfu_subfolder_tools_input" type="text" disabled="disabled" />';
|
391 |
-
$echo_str .= $dlp."\t\t\t\t\t".'<button id="wfu_subfolders_browse_'.$attr.'" class="button" title="browse folders" style="right:18px;" disabled="disabled" onclick="wfu_subfolders_browse_clicked(\''.$attr.'\');"><img src="'.WFU_IMAGE_ADMIN_SUBFOLDER_BROWSE.'" ></button>';
|
392 |
-
$echo_str .= $dlp."\t\t\t\t\t".'<button id="wfu_subfolders_ok_'.$attr.'" class="button" title="save changes" style="right:0px;" disabled="disabled" onclick="wfu_subfolders_ok_clicked(\''.$attr.'\');"><img src="'.WFU_IMAGE_ADMIN_SUBFOLDER_OK.'" ></button>';
|
393 |
-
// file browser dialog
|
394 |
-
$echo_str .= $dlp."\t\t\t\t\t".'<div id="wfu_subfolders_browser_'.$attr.'" class="wfu_subfolders_browser_container" style="display:none;">';
|
395 |
-
$echo_str .= $dlp."\t\t\t\t\t\t".'<table><tbody>';
|
396 |
-
$echo_str .= $dlp."\t\t\t\t\t\t\t".'<tr><td style="height:15px;">';
|
397 |
-
$echo_str .= $dlp."\t\t\t\t\t\t\t\t".'<div>';
|
398 |
-
$echo_str .= $dlp."\t\t\t\t\t\t\t\t\t".'<label>Folder Browser</label>';
|
399 |
-
$echo_str .= $dlp."\t\t\t\t\t\t\t\t\t".'<button class="button wfu_folder_browser_cancel" onclick="wfu_folder_browser_cancel_clicked(\''.$attr.'\');"><img src="'.WFU_IMAGE_ADMIN_SUBFOLDER_CANCEL.'" ></button>';
|
400 |
-
$echo_str .= $dlp."\t\t\t\t\t\t\t\t".'</div>';
|
401 |
-
$echo_str .= $dlp."\t\t\t\t\t\t\t".'</td></tr>';
|
402 |
-
$echo_str .= $dlp."\t\t\t\t\t\t\t".'<tr><td style="height:106px;">';
|
403 |
-
$echo_str .= $dlp."\t\t\t\t\t\t\t\t".'<div>';
|
404 |
-
$echo_str .= $dlp."\t\t\t\t\t\t\t\t\t".'<select id="wfu_subfolders_browser_list_'.$attr.'" size="2" onchange="wfu_subfolders_browser_list_changed(\''.$attr.'\');">';
|
405 |
-
$echo_str .= $dlp."\t\t\t\t\t\t\t\t\t\t".'<option>Value</option>';
|
406 |
-
$echo_str .= $dlp."\t\t\t\t\t\t\t\t\t\t".'<option>Value2</option>';
|
407 |
-
$echo_str .= $dlp."\t\t\t\t\t\t\t\t\t\t".'<option>Value3</option>';
|
408 |
-
$echo_str .= $dlp."\t\t\t\t\t\t\t\t\t".'</select>';
|
409 |
-
$echo_str .= $dlp."\t\t\t\t\t\t\t\t\t".'<div id="wfu_subfolders_browser_msgcont_'.$attr.'" class="wfu_folder_browser_loading_container" style="padding-top:40px;">';
|
410 |
-
$echo_str .= $dlp."\t\t\t\t\t\t\t\t\t\t".'<label id="wfu_subfolders_browser_msg_'.$attr.'" style="margin-bottom:4px;">loading folder contents...</label>';
|
411 |
-
$echo_str .= $dlp."\t\t\t\t\t\t\t\t\t\t".'<img id="wfu_subfolders_browser_img_'.$attr.'" src="'.WFU_IMAGE_ADMIN_SUBFOLDER_LOADING.'" ></button>';
|
412 |
-
$echo_str .= $dlp."\t\t\t\t\t\t\t\t\t".'</div>';
|
413 |
-
$echo_str .= $dlp."\t\t\t\t\t\t\t\t".'</div>';
|
414 |
-
$echo_str .= $dlp."\t\t\t\t\t\t\t".'</td></tr>';
|
415 |
-
$echo_str .= $dlp."\t\t\t\t\t\t\t".'<tr><td align="right" style="height:15px;">';
|
416 |
-
$echo_str .= $dlp."\t\t\t\t\t\t\t\t".'<div>';
|
417 |
-
$echo_str .= $dlp."\t\t\t\t\t\t\t\t\t".'<button class="button" onclick="wfu_folder_browser_cancel_clicked(\''.$attr.'\');">Cancel</button>';
|
418 |
-
$echo_str .= $dlp."\t\t\t\t\t\t\t\t\t".'<button id="wfu_subfolders_browser_ok_'.$attr.'" class="button">Ok</button>';
|
419 |
-
$echo_str .= $dlp."\t\t\t\t\t\t\t\t".'</div>';
|
420 |
-
$echo_str .= $dlp."\t\t\t\t\t\t\t".'</td></tr>';
|
421 |
-
$echo_str .= $dlp."\t\t\t\t\t\t".'</tbody></table>';
|
422 |
-
$echo_str .= $dlp."\t\t\t\t\t".'</div>';
|
423 |
-
|
424 |
-
$echo_str .= $dlp."\t\t\t\t".'</div></td>';
|
425 |
-
$echo_str .= $dlp."\t\t\t".'</tr></tbody></table>';
|
426 |
-
$echo_str .= $dlp."\t\t\t".'<input id="wfu_subfolders_isnewitem_'.$attr.'" type="hidden" value="" />';
|
427 |
-
$echo_str .= $dlp."\t\t\t".'<input id="wfu_subfolders_newitemindex_'.$attr.'" type="hidden" value="" />';
|
428 |
-
$echo_str .= $dlp."\t\t\t".'<input id="wfu_subfolders_newitemlevel_'.$attr.'" type="hidden" value="" />';
|
429 |
-
$echo_str .= $dlp."\t\t\t".'<input id="wfu_subfolders_newitemlevel2_'.$attr.'" type="hidden" value="" />';
|
430 |
-
$echo_str .= $dlp."\t\t".'</div>';
|
431 |
-
}
|
432 |
-
elseif ( $def['type'] == "mchecklist" ) {
|
433 |
-
$help_count = 0;
|
434 |
-
foreach ( $def['listitems'] as $key => $item ) {
|
435 |
-
$parts = explode("/", $item);
|
436 |
-
if ( count($parts) == 1 ) {
|
437 |
-
$items[$key]['id'] = $item;
|
438 |
-
$items[$key]['help'] = '';
|
439 |
-
}
|
440 |
-
else {
|
441 |
-
$items[$key]['id'] = $parts[0];
|
442 |
-
$items[$key]['help'] = $parts[1];
|
443 |
-
$help_count ++;
|
444 |
-
}
|
445 |
-
}
|
446 |
-
$def['value'] = strtolower($def['value']);
|
447 |
-
if ( $def['value'] == "all" ) $selected = array();
|
448 |
-
else $selected = explode(",", $def['value']);
|
449 |
-
foreach ( $selected as $key => $item ) $selected[$key] = trim($item);
|
450 |
-
$echo_str .= $dlp."\t\t".'<div id="wfu_attribute_'.$attr.'" class="wfu_mchecklist_container">';
|
451 |
-
$is_first = true;
|
452 |
-
foreach ( $items as $key => $item ) {
|
453 |
-
if ( !$is_first ) $echo_str .= "<br />";
|
454 |
-
$is_first = false;
|
455 |
-
$echo_str .= $dlp."\t\t\t".'<div class="wfu_mchecklist_item"><input id="wfu_attribute_'.$attr.'_'.$key.'" type="checkbox"'.( $def['value'] == "all" || in_array($item['id'], $selected) ? ' checked="checked"' : '' ).( $def['value'] == "all" ? ' disabled="disabled"' : '' ).' onchange="wfu_update_mchecklist_value(\''.$attr.'\');" /><label for="wfu_attribute_'.$attr.'_'.$key.'">'.$item['id'].'</label>';
|
456 |
-
if ( $item['help'] != '' ) $echo_str .= '<div class="wfu_help_container" title="'.$item['help'].'"><img src="'.WFU_IMAGE_ADMIN_HELP.'" /></div>';
|
457 |
-
$echo_str .= '</div>';
|
458 |
-
}
|
459 |
-
$echo_str .= $dlp."\t\t".'</div>';
|
460 |
-
$echo_str .= $dlp."\t\t".'<div id="wfu_attribute_'.$attr.'_optionhelp" class="wfu_help_container" title="" style="display:none; position:absolute;"><img src="'.WFU_IMAGE_ADMIN_HELP.'" style="visibility:visible;" /></div>';
|
461 |
-
$echo_str .= $dlp."\t\t".'<div class="wfu_mchecklist_checkall"><input id="wfu_attribute_'.$attr.'_all" type="checkbox" onchange="wfu_update_mchecklist_value(\''.$attr.'\');"'.( $def['value'] == "all" ? ' checked="checked"' : '' ).' /> Select all</div>';
|
462 |
-
}
|
463 |
-
elseif ( $def['type'] == "rolelist" ) {
|
464 |
-
$roles = $wp_roles->get_names();
|
465 |
-
$selected = explode(",", $def['value']);
|
466 |
-
$default_administrator = ( is_array($def['listitems']) && in_array('default_administrator', $def['listitems']) );
|
467 |
-
if ( in_array('all', $selected) ) $rolesselected = ( $default_administrator ? array("administrator") : array( ) );
|
468 |
-
else $rolesselected = $selected;
|
469 |
-
foreach ( $selected as $key => $item ) $selected[$key] = trim($item);
|
470 |
-
$echo_str .= $dlp."\t\t".'<table class="wfu_rolelist_container"><tbody><tr><td>';
|
471 |
-
$echo_str .= $dlp."\t\t".'<select id="wfu_attribute_'.$attr.'" multiple="multiple" size="'.count($roles).'" onchange="wfu_update_rolelist_value(\''.$attr.'\');"'.( in_array('all', $selected) ? ' disabled="disabled"' : '' ).'>';
|
472 |
-
foreach ( $roles as $roleid => $rolename )
|
473 |
-
$echo_str .= $dlp."\t\t\t".'<option value="'.$roleid.'"'.( in_array($roleid, $rolesselected) ? ' selected="selected"' : '' ).'>'.$rolename.'</option>';
|
474 |
-
$echo_str .= $dlp."\t\t".'</select>';
|
475 |
-
$echo_str .= $dlp."\t\t".'</td><td>';
|
476 |
-
$echo_str .= $dlp."\t\t".'<div class="wfu_rolelist_checkbtn"><input class="'.( $default_administrator ? 'wfu_default_administrator' : '' ).'" id="wfu_attribute_'.$attr.'_all" type="checkbox" onchange="wfu_update_rolelist_value(\''.$attr.'\');"'.( in_array('all', $selected) ? ' checked="checked"' : '' ).' /><label for="wfu_attribute_'.$attr.'_all"> Select all</label></div><br />';
|
477 |
-
$echo_str .= $dlp."\t\t".'<div class="wfu_rolelist_checkbtn"><input id="wfu_attribute_'.$attr.'_guests" type="checkbox" onchange="wfu_update_rolelist_value(\''.$attr.'\');"'.( in_array("guests", $selected) ? ' checked="checked"' : '' ).' /><label for="wfu_attribute_'.$attr.'_guests"> Include guests</label></div>';
|
478 |
-
$echo_str .= $dlp."\t\t".'</td></tr></tbody></table>';
|
479 |
-
}
|
480 |
-
elseif ( $def['type'] == "userlist" ) {
|
481 |
-
$
|
482 |
-
$
|
483 |
-
$
|
484 |
-
|
485 |
-
|
486 |
-
$
|
487 |
-
$
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
$
|
492 |
-
$
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
$
|
498 |
-
|
499 |
-
$echo_str .= $dlp."\t\t".'
|
500 |
-
$echo_str .= $dlp."\t\t".'
|
501 |
-
$echo_str .= $dlp."\t\t".'</
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
$
|
519 |
-
$
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
$
|
524 |
-
$
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
$
|
529 |
-
$
|
530 |
-
$
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
$
|
535 |
-
$
|
536 |
-
|
537 |
-
|
538 |
-
$
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
$
|
556 |
-
$
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
$
|
561 |
-
$
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
$
|
567 |
-
|
568 |
-
$echo_str .= $dlp."\t\t".'
|
569 |
-
$echo_str .= $dlp."\t\t".'</td
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
$
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
$
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
$echo_str .= $dlp."\t\t".'<
|
589 |
-
$echo_str .= $dlp."\t\t".'<
|
590 |
-
$echo_str .= $dlp."\t\t
|
591 |
-
$echo_str .= $dlp."\t\t
|
592 |
-
$echo_str .= $dlp."\t\t\t".'<option value="
|
593 |
-
$echo_str .= $dlp."\t\t\t".'<option value="
|
594 |
-
$echo_str .= $dlp."\t\t\t".'<option value="
|
595 |
-
$echo_str .= $dlp."\t\t\t".'<option value="
|
596 |
-
$echo_str .= $dlp."\t\t\t".'<option value="
|
597 |
-
$echo_str .= $dlp."\t\t\t".'<option value="does not
|
598 |
-
$echo_str .= $dlp."\t\t".'</
|
599 |
-
$echo_str .= $dlp."\t\t".'<
|
600 |
-
$echo_str .= $dlp."\t\t".'</
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
$
|
607 |
-
|
608 |
-
$
|
609 |
-
$
|
610 |
-
$echo_str .= $dlp."\t
|
611 |
-
$echo_str .= $dlp."\t\t".'<td style="width:45%;">';
|
612 |
-
$echo_str .= $dlp."\t\t\t".'<
|
613 |
-
$echo_str .= $dlp."\t\t
|
614 |
-
$
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
$
|
619 |
-
$
|
620 |
-
$
|
621 |
-
$
|
622 |
-
|
623 |
-
|
624 |
-
$item_parts
|
625 |
-
$
|
626 |
-
|
627 |
-
|
628 |
-
if ( $
|
629 |
-
|
630 |
-
|
631 |
-
$
|
632 |
-
$
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
$item_parts =
|
644 |
-
$
|
645 |
-
$
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
$echo_str .= $dlp."\t\t\t".'</
|
658 |
-
$echo_str .= $dlp."\t\t".'
|
659 |
-
$echo_str .= $dlp."\t\t".'
|
660 |
-
$echo_str .= $dlp."\t\t
|
661 |
-
$echo_str .= $dlp."\t\t
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
$echo_str .= $dlp."\t\t\t\t
|
669 |
-
$echo_str .= $dlp."\t\t\t\t
|
670 |
-
$echo_str .= $dlp."\t\t\t\t\t".'<button class="wfu_columns_addbutton" title="move
|
671 |
-
$echo_str .= $dlp."\t\t\t\t".'
|
672 |
-
$echo_str .= $dlp."\t\t\t".'
|
673 |
-
$echo_str .= $dlp."\t\t\t".'
|
674 |
-
$echo_str .= $dlp."\t\t\t".'
|
675 |
-
$echo_str .= $dlp."\t\t\t
|
676 |
-
$echo_str .= $dlp."\t\t\t
|
677 |
-
$echo_str .= $dlp."\t\t\t\t".'<tr><td style="width:1%; padding-right:10px;
|
678 |
-
$echo_str .= $dlp."\t\t\t\t".'<td><input type="
|
679 |
-
$echo_str .= $dlp."\t\t\t\t".'<tr><td
|
680 |
-
$echo_str .= $dlp."\t\t\t\t".'<
|
681 |
-
$echo_str .= $dlp."\t\t\t\t".'<td><
|
682 |
-
$echo_str .= $dlp."\t\t\t".'</
|
683 |
-
$echo_str .= $dlp."\t\t".'</td>';
|
684 |
-
$echo_str .= $dlp."\t".'</
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
$echo_str .= $dlp."\t\t\t
|
723 |
-
$echo_str .= $dlp."\t\t\t\t".'<
|
724 |
-
$echo_str .= $dlp."\t\t\t\t".'<
|
725 |
-
$echo_str .= $dlp."\t\t\t\t".'<
|
726 |
-
$echo_str .= $dlp."\t\t\t".'
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
$
|
735 |
-
$
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
|
750 |
-
$
|
751 |
-
|
752 |
-
$
|
753 |
-
|
754 |
-
|
755 |
-
$
|
756 |
-
|
757 |
-
|
758 |
-
$template .= $dlp."\t\t\t\t".'
|
759 |
-
$template .= $dlp."\t\t\t\t".'<
|
760 |
-
$template .= $dlp."\t\t\t\t".'
|
761 |
-
$template .= $dlp."\t\t\t\t".'<div class="wfu_formdata_action
|
762 |
-
$template .= $dlp."\t\t\t\t".'<div class="wfu_formdata_action
|
763 |
-
$template .= $dlp."\t\t\t\t".'<
|
764 |
-
$
|
765 |
-
|
766 |
-
$
|
767 |
-
|
768 |
-
$template .= '[[
|
769 |
-
$template .= '[[
|
770 |
-
$
|
771 |
-
|
772 |
-
$
|
773 |
-
|
774 |
-
$template .= '[[
|
775 |
-
$template .= '[[
|
776 |
-
$template .= '[[
|
777 |
-
$template .= '[[
|
778 |
-
$template .=
|
779 |
-
|
780 |
-
$
|
781 |
-
|
782 |
-
$echo_str .= $dlp."\t\t
|
783 |
-
|
784 |
-
$echo_str .= $dlp."\t\t\t
|
785 |
-
|
786 |
-
$echo_str .= $dlp."\t\t\t\t
|
787 |
-
$
|
788 |
-
|
789 |
-
|
790 |
-
$
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
$
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
$echo_str .= $dlp."\t\t\t".'
|
804 |
-
$
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
$
|
809 |
-
$
|
810 |
-
|
811 |
-
$
|
812 |
-
|
813 |
-
|
814 |
-
foreach( $
|
815 |
-
foreach( $
|
816 |
-
$from_template = str_replace('[[
|
817 |
-
$from_template = str_replace('[[
|
818 |
-
$from_template = str_replace('[[
|
819 |
-
|
820 |
-
$from_template =
|
821 |
-
|
822 |
-
$from_template = preg_replace('/\[\[
|
823 |
-
$from_template = preg_replace('/\[\[
|
824 |
-
|
825 |
-
$from_template = preg_replace('/\[\[
|
826 |
-
|
827 |
-
$from_template = preg_replace('/\[\[
|
828 |
-
$from_template = preg_replace('/\[\[
|
829 |
-
$from_template = preg_replace('/\[\[
|
830 |
-
$from_template = preg_replace('/\[\[
|
831 |
-
$from_template = preg_replace('/\[\[
|
832 |
-
$from_template = preg_replace('/\[\[
|
833 |
-
$from_template = preg_replace('/\[\[
|
834 |
-
$from_template = preg_replace('/\[\[
|
835 |
-
$
|
836 |
-
$
|
837 |
-
$
|
838 |
-
|
839 |
-
|
840 |
-
|
841 |
-
|
842 |
-
|
843 |
-
|
844 |
-
|
845 |
-
|
846 |
-
|
847 |
-
|
848 |
-
|
849 |
-
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
$echo_str .= $dlp."\t\t".'<div class="wfu_color_container"><label style="display:inline-block; width:120px; margin-top:-16px;">
|
854 |
-
|
855 |
-
|
856 |
-
|
857 |
-
|
858 |
-
|
859 |
-
|
860 |
-
|
861 |
-
|
862 |
-
|
863 |
-
|
864 |
-
|
865 |
-
|
866 |
-
|
867 |
-
|
868 |
-
|
869 |
-
|
870 |
-
|
871 |
-
|
872 |
-
|
873 |
-
|
874 |
-
|
875 |
-
|
876 |
-
|
877 |
-
|
878 |
-
$echo_str .= "\n\t".'</
|
879 |
-
$echo_str .= "\n\t".'
|
880 |
-
$echo_str .= "\n\t".'</div>';
|
881 |
-
$
|
882 |
-
$echo_str .= "\n\t".'
|
883 |
-
$
|
884 |
-
|
885 |
-
|
886 |
-
// $echo_str .= "\n\t".'
|
887 |
-
|
888 |
-
|
889 |
-
|
890 |
-
|
891 |
-
|
892 |
-
|
893 |
-
|
894 |
-
|
895 |
-
|
896 |
-
|
897 |
-
|
898 |
-
|
899 |
-
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
function wfu_shortcode_composer($data = '', $shortcode_tag = 'wordpress_file_upload', $referer = 'page') {
|
4 |
+
global $wp_roles;
|
5 |
+
$siteurl = site_url();
|
6 |
+
|
7 |
+
$plugin_options = wfu_decode_plugin_options(get_option( "wordpress_file_upload_options" ));
|
8 |
+
$components = wfu_component_definitions();
|
9 |
+
if ( $shortcode_tag == 'wordpress_file_upload' ) {
|
10 |
+
$plugin_title = "Uploader";
|
11 |
+
$cats = wfu_category_definitions();
|
12 |
+
$defs = wfu_attribute_definitions();
|
13 |
+
//remove personaldata category if Personal Data are not activated in
|
14 |
+
//plugin's Settings
|
15 |
+
if ($plugin_options["personaldata"] != "1" && isset($cats["personaldata"])) unset($cats["personaldata"]);
|
16 |
+
}
|
17 |
+
else {
|
18 |
+
$plugin_title = "Browser";
|
19 |
+
$cats = wfu_browser_category_definitions();
|
20 |
+
$defs = wfu_browser_attribute_definitions();
|
21 |
+
}
|
22 |
+
|
23 |
+
if ( $data == "" ) {
|
24 |
+
$shortcode = $plugin_options['shortcode'];
|
25 |
+
$shortcode_full = '['.$shortcode_tag.' '.$shortcode.']';
|
26 |
+
$postid = "";
|
27 |
+
$postname = "";
|
28 |
+
$posttype = "";
|
29 |
+
$posthash = "";
|
30 |
+
$shortcode_position = -1;
|
31 |
+
$widgetid = "";
|
32 |
+
$sidebar = "";
|
33 |
+
$autosave = true;
|
34 |
+
}
|
35 |
+
else {
|
36 |
+
$shortcode = trim(substr($data['shortcode'], strlen('['.$shortcode_tag), -1));
|
37 |
+
$shortcode_full = $data['shortcode'];
|
38 |
+
$postid = $data['post_id'];
|
39 |
+
$postname = get_the_title($postid);
|
40 |
+
$posttype_obj = get_post_type_object(get_post_type($postid));
|
41 |
+
$posttype = ( $posttype_obj ? $posttype_obj->labels->singular_name : "" );
|
42 |
+
$posthash = $data['post_hash'];
|
43 |
+
$shortcode_position = $data['position'];
|
44 |
+
$widgetid = ( isset($data['widgetid']) ? $data['widgetid'] : "" );
|
45 |
+
$sidebar = ( isset($data['sidebar']) ? $data['sidebar'] : "" );
|
46 |
+
$autosave = false;
|
47 |
+
}
|
48 |
+
|
49 |
+
// index $components
|
50 |
+
$components_indexed = array();
|
51 |
+
foreach ( $components as $component ) $components_indexed[$component['id']] = $component;
|
52 |
+
// complete defs array and index dependencies
|
53 |
+
$governors = array();
|
54 |
+
$shortcode_attrs = wfu_shortcode_string_to_array($shortcode);
|
55 |
+
//replace old attribute definitions with new ones
|
56 |
+
$shortcode_attrs = wfu_old_to_new_attributes($shortcode_attrs);
|
57 |
+
$shortcode_id = '';
|
58 |
+
foreach ( $defs as $key => $def ) {
|
59 |
+
$attr = $def['attribute'];
|
60 |
+
$defs[$key]['default'] = $def['value'];
|
61 |
+
//'flat' property keeps the original attribute, because 'attribute'
|
62 |
+
//property will change for defs that their occurrence is higher than 1
|
63 |
+
$defs[$key]['flat'] = $attr;
|
64 |
+
if ( array_key_exists($attr, $shortcode_attrs) ) $defs[$key]['value'] = $shortcode_attrs[$attr];
|
65 |
+
$subblock_active = false;
|
66 |
+
//detect if the dependencies of this attribute will be disabled or not
|
67 |
+
if ( ( $def['type'] == "onoff" && $defs[$key]['value'] == "true" ) ||
|
68 |
+
( $def['type'] == "radio" && in_array("*".$defs[$key]['value'], $def['listitems']) ) )
|
69 |
+
$subblock_active = true;
|
70 |
+
// assign dependencies if exist
|
71 |
+
if ( $def['dependencies'] != null )
|
72 |
+
foreach ( $def['dependencies'] as $dependency ) {
|
73 |
+
if ( substr($dependency, 0, 1) == "!" ) //invert state for this dependency if an exclamation mark is defined
|
74 |
+
$governors[substr($dependency, 1)] = array( 'attribute' => $attr, 'active' => !$subblock_active, 'inv' => '_inv' );
|
75 |
+
else
|
76 |
+
$governors[$dependency] = array( 'attribute' => $attr, 'active' => $subblock_active, 'inv' => '' );
|
77 |
+
}
|
78 |
+
if ( $attr == 'uploadid' || $attr == 'browserid' ) $shortcode_id = $defs[$key]['value'];
|
79 |
+
}
|
80 |
+
|
81 |
+
//check if attributes need to be generated more than once because their governor is a component field that appears more than once in placements attribute
|
82 |
+
$key = 0;
|
83 |
+
while ( $key < count($defs) ) {
|
84 |
+
$defs[$key]['additional_values'] = array();
|
85 |
+
$def = $defs[$key];
|
86 |
+
$attr = $def['attribute'];
|
87 |
+
//check if this attribute needs to be generated more than once
|
88 |
+
if ( array_key_exists($attr, $governors) ) $governor = $governors[$attr]['attribute'];
|
89 |
+
else $governor = "";
|
90 |
+
if ( $governor != "" && isset($components_indexed[$governor]) && $components_indexed[$governor]['multiplacements'] && isset($shortcode_attrs['placements']) ) {
|
91 |
+
//count how many occurrences of the governor attribute appear inside placements attribute
|
92 |
+
$occurrences = 0;
|
93 |
+
$sections = explode("/", $shortcode_attrs['placements']);
|
94 |
+
foreach ( $sections as $section ) {
|
95 |
+
$items_in_section = explode("+", trim($section));
|
96 |
+
foreach ( $items_in_section as $item )
|
97 |
+
if ( trim($item) == $governor ) $occurrences++;
|
98 |
+
}
|
99 |
+
//add indexed attributes if there is more than one occurrence
|
100 |
+
for ( $ii = 2; $ii <= $occurrences; $ii++ ) {
|
101 |
+
$def2 = $def;
|
102 |
+
$def2['attribute'] .= $ii;
|
103 |
+
$def2['name'] .= ' ('.$ii.')';
|
104 |
+
if ( array_key_exists($def2['attribute'], $shortcode_attrs) )
|
105 |
+
$def2['value'] = $shortcode_attrs[$def2['attribute']];
|
106 |
+
else $def2['value'] = $def2['default'];
|
107 |
+
array_splice($defs, $key + 1, 0, array($def2));
|
108 |
+
$key++;
|
109 |
+
}
|
110 |
+
//check if the shortcode contains additional indexed definitions and store them in 'additional_values'
|
111 |
+
$ii = max(1, $occurrences) + 1;
|
112 |
+
while ( array_key_exists($attr.$ii, $shortcode_attrs) ) {
|
113 |
+
$defs[$key]['additional_values'][$ii] = $shortcode_attrs[$attr.$ii];
|
114 |
+
$ii++;
|
115 |
+
}
|
116 |
+
}
|
117 |
+
$key++;
|
118 |
+
}
|
119 |
+
|
120 |
+
$echo_str = '<div id="wfu_wrapper" class="wrap">';
|
121 |
+
$echo_str .= "\n\t".'<h2>Wordpress File Upload Control Panel</h2>';
|
122 |
+
$echo_str .= "\n\t".'<div id="wfu_page_obsolete_message" class="error" style="display:none;">';
|
123 |
+
$echo_str .= "\n\t\t".'<p>'.WFU_DASHBOARD_PAGE_OBSOLETE.'</p>';
|
124 |
+
$echo_str .= "\n\t".'</div>';
|
125 |
+
$echo_str .= "\n\t".'<div id="wfu_update_rejected_message" class="error" style="display:none;">';
|
126 |
+
$echo_str .= "\n\t\t".'<p>'.WFU_DASHBOARD_UPDATE_SHORTCODE_REJECTED.'</p>';
|
127 |
+
$echo_str .= "\n\t".'</div>';
|
128 |
+
$echo_str .= "\n\t".'<div id="wfu_update_failed_message" class="error" style="display:none;">';
|
129 |
+
$echo_str .= "\n\t\t".'<p>'.WFU_DASHBOARD_UPDATE_SHORTCODE_FAILED.'</p>';
|
130 |
+
$echo_str .= "\n\t".'</div>';
|
131 |
+
$echo_str .= "\n\t".'<div style="margin-top:20px;">';
|
132 |
+
if ( $referer == "dashboard" ) $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>';
|
133 |
+
$echo_str .= "\n\t".'</div>';
|
134 |
+
if ( $widgetid == "" ) $echo_str .= "\n\t".'<h2 style="margin-bottom: 10px; margin-top: 20px;">'.( $data == "" ? 'Test' : $posttype.' <strong>'.$postname.'</strong>' ).': Shortcode Composer for '.$plugin_title.' <strong>ID '.$shortcode_id.'</strong></h2>';
|
135 |
+
else $echo_str .= "\n\t".'<h2 style="margin-bottom: 10px; margin-top: 20px;">Sidebar <strong>'.$sidebar.'</strong>: Shortcode Composer for Uploader <strong>ID '.$shortcode_id.'</strong></h2>';
|
136 |
+
$echo_str .= "\n\t".'<div style="margin-top:10px; display:inline-block;">';
|
137 |
+
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>';
|
138 |
+
$echo_str .= "\n\t\t".'<input id="wfu_shortcode_original_enc" type="hidden" value="'.wfu_plugin_encode_string($shortcode_full).'" />';
|
139 |
+
$echo_str .= "\n\t\t".'<input id="wfu_shortcode_tag" type="hidden" value="'.$shortcode_tag.'" />';
|
140 |
+
$echo_str .= "\n\t\t".'<input id="wfu_shortcode_postid" type="hidden" value="'.$postid.'" />';
|
141 |
+
$echo_str .= "\n\t\t".'<input id="wfu_shortcode_posthash" type="hidden" value="'.$posthash.'" />';
|
142 |
+
$echo_str .= "\n\t\t".'<input id="wfu_shortcode_position" type="hidden" value="'.$shortcode_position.'" />';
|
143 |
+
$echo_str .= "\n\t\t".'<input id="wfu_shortcode_widgetid" type="hidden" value="'.$widgetid.'" />';
|
144 |
+
$echo_str .= "\n\t".'</div>';
|
145 |
+
$echo_str .= "\n\t".'<div style="margin-top:20px;">';
|
146 |
+
$echo_str .= "\n\t\t".'<div class="wfu_shortcode_container">';
|
147 |
+
$echo_str .= "\n\t\t\t".'<span><strong>Generated Shortcode</strong></span>';
|
148 |
+
$echo_str .= "\n\t\t\t".'<span id="wfu_save_label" class="wfu_save_label">saved</span>';
|
149 |
+
$echo_str .= "\n\t\t\t".'<textarea id="wfu_shortcode" class="wfu_shortcode" rows="5">['.$shortcode_tag.']</textarea>';
|
150 |
+
$echo_str .= "\n\t\t\t".'<div id="wfu_attribute_defaults" style="display:none;">';
|
151 |
+
// remove hidden attributes from defs array
|
152 |
+
foreach ( $defs as $key => $def ) if ( $def['type'] == "hidden" ) unset($defs[$key]);
|
153 |
+
foreach ( $defs as $def )
|
154 |
+
$echo_str .= "\n\t\t\t\t".'<input id="wfu_attribute_default_'.$def['attribute'].'" type="hidden" value="'.$def['default'].'" />';
|
155 |
+
$echo_str .= "\n\t\t\t".'</div>';
|
156 |
+
$echo_str .= "\n\t\t\t".'<div id="wfu_attribute_values" style="display:none;">';
|
157 |
+
foreach ( $defs as $def ) {
|
158 |
+
$echo_str .= "\n\t\t\t\t".'<input id="wfu_attribute_value_'.$def['attribute'].'" type="hidden" value="'.$def['value'].'" />';
|
159 |
+
//add additional values, if exist
|
160 |
+
foreach( $def['additional_values'] as $key => $val )
|
161 |
+
$echo_str .= "\n\t\t\t\t".'<input id="wfu_attribute_value_'.$def['attribute'].$key.'" type="hidden" value="'.$val.'" />';
|
162 |
+
}
|
163 |
+
$echo_str .= "\n\t\t\t".'</div>';
|
164 |
+
$echo_str .= "\n\t\t".'</div>';
|
165 |
+
$echo_str .= "\n\t".'</div>';
|
166 |
+
$echo_str .= "\n\t".'<h3 id="wfu_tab_container" class="nav-tab-wrapper">';
|
167 |
+
$is_first = true;
|
168 |
+
foreach ( $cats as $key => $cat ) {
|
169 |
+
$echo_str .= "\n\t\t".'<a id="wfu_tab_'.$key.'" class="nav-tab'.( $is_first ? ' nav-tab-active' : '' ).'" href="javascript: wfu_admin_activate_tab(\''.$key.'\');">'.$cat.'</a>';
|
170 |
+
$is_first = false;
|
171 |
+
}
|
172 |
+
$echo_str .= "\n\t".'</h3>';
|
173 |
+
|
174 |
+
$prevcat = "";
|
175 |
+
$prevsubcat = "";
|
176 |
+
$is_first = true;
|
177 |
+
$block_open = false;
|
178 |
+
$subblock_open = false;
|
179 |
+
foreach ( $defs as $def ) {
|
180 |
+
$attr = $def['attribute'];
|
181 |
+
//check if this attribute depends on other
|
182 |
+
if ( !array_key_exists($attr, $governors) ) $governors[$attr] = "";
|
183 |
+
if ( $governors[$attr] != "" ) $governor = $governors[$attr];
|
184 |
+
else $governor = array( 'attribute' => "independent", 'active' => true, 'inv' => '' );
|
185 |
+
|
186 |
+
//close previous blocks
|
187 |
+
if ( $def['parent'] == "" ) {
|
188 |
+
if ( $subblock_open ) {
|
189 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'</tbody>';
|
190 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</table>';
|
191 |
+
$subblock_open = false;
|
192 |
+
}
|
193 |
+
if ( $block_open ) {
|
194 |
+
$echo_str .= "\n\t\t\t\t\t".'</div></td>';
|
195 |
+
$echo_str .= "\n\t\t\t\t".'</tr>';
|
196 |
+
$block_open = false;
|
197 |
+
}
|
198 |
+
}
|
199 |
+
//check if new category must be generated
|
200 |
+
if ( $def['category'] != $prevcat ) {
|
201 |
+
if ( $prevcat != "" ) {
|
202 |
+
$echo_str .= "\n\t\t\t".'</tbody>';
|
203 |
+
$echo_str .= "\n\t\t".'</table>';
|
204 |
+
$echo_str .= "\n\t".'</div>';
|
205 |
+
}
|
206 |
+
$prevcat = $def['category'];
|
207 |
+
$prevsubcat = "";
|
208 |
+
$echo_str .= "\n\t".'<div id="wfu_container_'.$prevcat.'" class="wfu_container"'.( $is_first ? '' : ' style="display:none;"' ).'">';
|
209 |
+
$echo_str .= "\n\t\t".'<table class="form-table wfu_main_table">';
|
210 |
+
$echo_str .= "\n\t\t\t".'<thead><tr><th></th><td></td><td></td></tr></thead>';
|
211 |
+
$echo_str .= "\n\t\t\t".'<tbody>';
|
212 |
+
$is_first = false;
|
213 |
+
}
|
214 |
+
//check if new sub-category must be generated
|
215 |
+
if ( $def['subcategory'] != $prevsubcat ) {
|
216 |
+
$prevsubcat = $def['subcategory'];
|
217 |
+
$echo_str .= "\n\t\t\t\t".'<tr class="wfu_subcategory">';
|
218 |
+
$echo_str .= "\n\t\t\t\t\t".'<th scope="row" colspan="3">';
|
219 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<h3 style="margin-bottom: 10px; margin-top: 10px;">'.$prevsubcat.'</h3>';
|
220 |
+
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
221 |
+
$echo_str .= "\n\t\t\t\t".'</tr>';
|
222 |
+
}
|
223 |
+
//draw attribute element
|
224 |
+
if ( $def['parent'] == "" ) {
|
225 |
+
$dlp = "\n\t\t\t\t";
|
226 |
+
}
|
227 |
+
else {
|
228 |
+
if ( !$subblock_open ) {
|
229 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<div class="wfu_shadow wfu_shadow_'.$def['parent'].$governor['inv'].'" style="display:'.( $governor['active'] ? 'none' : 'block' ).';"></div>';
|
230 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<table class="form-table wfu_inner_table" style="margin:0;">';
|
231 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<tbody>';
|
232 |
+
}
|
233 |
+
$dlp = "\n\t\t\t\t\t\t\t\t";
|
234 |
+
}
|
235 |
+
$echo_str .= $dlp.'<tr>';
|
236 |
+
$echo_str .= $dlp."\t".'<th scope="row"><div class="wfu_td_div">';
|
237 |
+
if ( $def['parent'] == "" ) $echo_str .= $dlp."\t\t".'<div class="wfu_shadow wfu_shadow_'.$governor['attribute'].$governor['inv'].'" style="display:'.( $governor['active'] ? 'none' : 'block' ).';"></div>';
|
238 |
+
$echo_str .= $dlp."\t\t".'<div class="wfu_restore_container" title="Double-click to restore defaults setting"><img src="'.WFU_IMAGE_ADMIN_RESTOREDEFAULT.'" ondblclick="wfu_apply_value(\''.$attr.'\', \''.$def['type'].'\', \''.$def['default'].'\');" /></div>';
|
239 |
+
$echo_str .= $dlp."\t\t".'<label for="wfu_attribute_'.$attr.'">'.$def['name'].'</label>';
|
240 |
+
$echo_str .= $dlp."\t\t".'<input type="hidden" name="wfu_attribute_governor_'.$governor['attribute'].'" class="wfu_attribute_governor" value="'.$attr.'" />';
|
241 |
+
$echo_str .= $dlp."\t\t".'<div class="wfu_help_container" title="'.$def['help'].'"><img src="'.WFU_IMAGE_ADMIN_HELP.'" /></div>';
|
242 |
+
$echo_str .= $dlp."\t".'</div></th>';
|
243 |
+
$echo_str .= $dlp."\t".'<td style="vertical-align:top;"><div class="wfu_td_div">';
|
244 |
+
if ( $def['parent'] == "" ) $echo_str .= $dlp."\t\t".'<div class="wfu_shadow wfu_shadow_'.$governor['attribute'].$governor['inv'].'" style="display:'.( $governor['active'] ? 'none' : 'block' ).';"></div>';
|
245 |
+
if ( $def['type'] == "onoff" ) {
|
246 |
+
$echo_str .= $dlp."\t\t".'<div id="wfu_attribute_'.$attr.'" class="wfu_onoff_container_'.( $def['value'] == "true" ? "on" : "off" ).'" onclick="wfu_admin_onoff_clicked(\''.$attr.'\');">';
|
247 |
+
$echo_str .= $dlp."\t\t\t".'<div class="wfu_onoff_slider"></div>';
|
248 |
+
$echo_str .= $dlp."\t\t\t".'<span class="wfu_onoff_text">ON</span>';
|
249 |
+
$echo_str .= $dlp."\t\t\t".'<span class="wfu_onoff_text">OFF</span>';
|
250 |
+
$echo_str .= $dlp."\t\t".'</div>';
|
251 |
+
}
|
252 |
+
elseif ( $def['type'] == "text" ) {
|
253 |
+
$val = str_replace(array( "%n%", "%dq%", "%brl%", "%brr%" ), array( "\n", """, "[", "]" ), $def['value']);
|
254 |
+
$echo_str .= $dlp."\t\t".'<input id="wfu_attribute_'.$attr.'" type="text" name="wfu_text_elements" value="'.$val.'" style="display:block;" />';
|
255 |
+
if ( $def['variables'] != null ) $echo_str .= $dlp.wfu_insert_variables($def['variables'], 'wfu_variable wfu_variable_'.$attr);
|
256 |
+
}
|
257 |
+
elseif ( $def['type'] == "placements" ) {
|
258 |
+
$components_used = array();
|
259 |
+
foreach ( $components as $component ) $components_used[$component['id']] = 0;
|
260 |
+
$centered_content = '<div class="wfu_component_box_inner"><div class="wfu_component_box_label">XXX</div></div>';
|
261 |
+
$centered_content_multi = '<div class="wfu_component_box_inner"><div class="wfu_component_box_label">XXX</div><div class="wfu_component_box_index">YYY</div></div>';
|
262 |
+
$echo_str .= $dlp."\t\t".'<div class="wfu_placements_wrapper">';
|
263 |
+
$echo_str .= $dlp."\t\t\t".'<div id="wfu_placements_container" class="wfu_placements_container">';
|
264 |
+
$itemplaces = explode("/", $def['value']);
|
265 |
+
foreach ( $itemplaces as $section ) {
|
266 |
+
$echo_str .= $dlp."\t\t\t\t".'<div class="wfu_component_separator_hor"></div>';
|
267 |
+
$echo_str .= $dlp."\t\t\t\t".'<div class="wfu_component_separator_ver"></div>';
|
268 |
+
$items_in_section = explode("+", trim($section));
|
269 |
+
$section_array = array( );
|
270 |
+
foreach ( $items_in_section as $item_in_section ) {
|
271 |
+
if ( key_exists($item_in_section, $components_indexed) ) {
|
272 |
+
if ( $components_indexed[$item_in_section]['multiplacements'] || $components_used[$item_in_section] == 0 ) {
|
273 |
+
$components_used[$item_in_section] ++;
|
274 |
+
if ( $components_indexed[$item_in_section]['multiplacements'] ) {
|
275 |
+
$multi_index = $components_used[$item_in_section];
|
276 |
+
$echo_str .= $dlp."\t\t\t\t".'<div id="wfu_component_box_'.$item_in_section.'_'.$multi_index.'" class="wfu_component_box" draggable="true" title="'.$components_indexed[$item_in_section]['help'].'">'.str_replace(array("XXX", "YYY"), array($components_indexed[$item_in_section]['name'], $multi_index), $centered_content_multi).'</div>';
|
277 |
+
}
|
278 |
+
else
|
279 |
+
$echo_str .= $dlp."\t\t\t\t".'<div id="wfu_component_box_'.$item_in_section.'_0" class="wfu_component_box" draggable="true" title="'.$components_indexed[$item_in_section]['help'].'">'.str_replace("XXX", $components_indexed[$item_in_section]['name'], $centered_content).'</div>';
|
280 |
+
$echo_str .= $dlp."\t\t\t\t".'<div class="wfu_component_separator_ver"></div>';
|
281 |
+
}
|
282 |
+
}
|
283 |
+
}
|
284 |
+
}
|
285 |
+
$echo_str .= $dlp."\t\t\t\t".'<div class="wfu_component_separator_hor"></div>';
|
286 |
+
$echo_str .= $dlp."\t\t\t\t".'<div id="wfu_component_bar_hor" class="wfu_component_bar_hor"></div>';
|
287 |
+
$echo_str .= $dlp."\t\t\t\t".'<div id="wfu_component_bar_ver" class="wfu_component_bar_ver"></div>';
|
288 |
+
$echo_str .= $dlp."\t\t\t".'</div>';
|
289 |
+
$echo_str .= $dlp."\t\t\t".'<div id="wfu_componentlist_container" class="wfu_componentlist_container">';
|
290 |
+
$echo_str .= $dlp."\t\t\t\t".'<div id="wfu_componentlist_dragdrop" class="wfu_componentlist_dragdrop" style="display:none;"></div>';
|
291 |
+
$ii = 1;
|
292 |
+
foreach ( $components as $component ) {
|
293 |
+
$echo_str .= $dlp."\t\t\t\t".'<div id="wfu_component_box_container_'.$component['id'].'" class="wfu_component_box_container">';
|
294 |
+
$echo_str .= $dlp."\t\t\t\t\t".'<div class="wfu_component_box_base">'.str_replace("XXX", $component['name'], $centered_content).'</div>';
|
295 |
+
if ( $component['multiplacements'] ) {
|
296 |
+
$multi_index = $components_used[$component['id']] + 1;
|
297 |
+
$echo_str .= $dlp."\t\t\t\t\t".'<div id="wfu_component_box_'.$component['id'].'_'.$multi_index.'" class="wfu_component_box wfu_inbase" draggable="true" title="'.$component['help'].'">'.str_replace(array("XXX", "YYY"), array($component['name'], $multi_index), $centered_content_multi).'</div>';
|
298 |
+
}
|
299 |
+
elseif ( $components_used[$component['id']] == 0 )
|
300 |
+
$echo_str .= $dlp."\t\t\t\t\t".'<div id="wfu_component_box_'.$component['id'].'_0" class="wfu_component_box wfu_inbase" draggable="true" title="'.$component['help'].'">'.str_replace("XXX", $component['name'], $centered_content).'</div>';
|
301 |
+
$echo_str .= $dlp."\t\t\t\t".'</div>'.( ($ii++) % 3 == 0 ? '<br />' : '' );
|
302 |
+
}
|
303 |
+
$echo_str .= $dlp."\t\t\t".'</div>';
|
304 |
+
$echo_str .= $dlp."\t\t".'</div>';
|
305 |
+
}
|
306 |
+
elseif ( $def['type'] == "ltext" ) {
|
307 |
+
$val = str_replace(array( "%n%", "%dq%", "%brl%", "%brr%" ), array( "\n", """, "[", "]" ), $def['value']);
|
308 |
+
$echo_str .= $dlp."\t\t".'<input id="wfu_attribute_'.$attr.'" type="text" name="wfu_text_elements" class="wfu_long_text" value="'.$val.'" />';
|
309 |
+
if ( $def['variables'] != null ) $echo_str .= $dlp.wfu_insert_variables($def['variables'], 'wfu_variable wfu_variable_'.$attr);
|
310 |
+
}
|
311 |
+
elseif ( $def['type'] == "integer" ) {
|
312 |
+
$val = str_replace(array( "%n%", "%dq%", "%brl%", "%brr%" ), array( "\n", """, "[", "]" ), $def['value']);
|
313 |
+
$echo_str .= $dlp."\t\t".'<input id="wfu_attribute_'.$attr.'" type="number" name="wfu_text_elements" class="wfu_short_text" min="1" value="'.$val.'" />';
|
314 |
+
if ( isset($def['listitems']['unit']) ) $echo_str .= $dlp."\t\t".'<label> '.$def['listitems']['unit'].'</label>';
|
315 |
+
}
|
316 |
+
elseif ( $def['type'] == "float" ) {
|
317 |
+
$val = str_replace(array( "%n%", "%dq%", "%brl%", "%brr%" ), array( "\n", """, "[", "]" ), $def['value']);
|
318 |
+
$echo_str .= $dlp."\t\t".'<input id="wfu_attribute_'.$attr.'" type="number" name="wfu_text_elements" class="wfu_short_text" step="any" min="0" value="'.$val.'" />';
|
319 |
+
if ( isset($def['listitems']['unit']) ) $echo_str .= $dlp."\t\t".'<label> '.$def['listitems']['unit'].'</label>';
|
320 |
+
}
|
321 |
+
elseif ( $def['type'] == "date" ) {
|
322 |
+
$val = $def['value'];
|
323 |
+
$echo_str .= $dlp."\t\t".'<div class="wfu_date_container"><input id="wfu_attribute_'.$attr.'" type="text" value="'.$val.'" readonly style="padding-right:16px; background-color:white; width:auto;" /><img class="wfu_datereset_button" src="'.WFU_IMAGE_ADMIN_SUBFOLDER_CANCEL.'" onclick="var f = document.getElementById(\'wfu_attribute_'.$attr.'\'); f.value = \'\'; wfu_update_date_value({target:f});" /></div><label style="font-size:smaller; margin-left:4px;">format: YYYY-MM-DD</label>';
|
324 |
+
$echo_str .= wfu_inject_js_code('jQuery(function() {jQuery("#wfu_attribute_'.$attr.'").datepicker({dateFormat: "yy-mm-dd", onClose: function(date, picker) {wfu_update_date_value({target:this});}});});');
|
325 |
+
}
|
326 |
+
elseif ( $def['type'] == "radio" ) {
|
327 |
+
$echo_str .= $dlp."\t\t";
|
328 |
+
$ii = 0;
|
329 |
+
foreach ( $def['listitems'] as $item )
|
330 |
+
$echo_str .= '<input name="wfu_radioattribute_'.$attr.'" type="radio" value="'.$item.'" '.( $item == $def['value'] || $item == "*".$def['value'] ? 'checked="checked" ' : '' ).'style="width:auto; margin:0px 2px 0px '.( ($ii++) == 0 ? '0px' : '8px' ).';" onchange="wfu_admin_radio_clicked(\''.$attr.'\');" />'.( $item[0] == "*" ? substr($item, 1) : $item );
|
331 |
+
// $echo_str .= '<input type="button" class="button" value="empty" style="width:auto; margin:-2px 0px 0px 8px;" />';
|
332 |
+
}
|
333 |
+
elseif ( $def['type'] == "ptext" ) {
|
334 |
+
$val = str_replace(array( "%n%", "%dq%", "%brl%", "%brr%" ), array( "\n", """, "[", "]" ), $def['value']);
|
335 |
+
$parts = explode("/", $val);
|
336 |
+
$singular = $parts[0];
|
337 |
+
if ( count($parts) < 2 ) $plural = $singular;
|
338 |
+
else $plural = $parts[1];
|
339 |
+
$echo_str .= $dlp."\t\t".'<span class="wfu_ptext_span">Singular</span><input id="wfu_attribute_s_'.$attr.'" type="text" name="wfu_ptext_elements" value="'.$singular.'" />';
|
340 |
+
if ( $def['variables'] != null ) if ( count($def['variables']) > 0 ) $echo_str .= $dlp."\t\t".'<br /><span class="wfu_ptext_span"> </span>';
|
341 |
+
if ( $def['variables'] != null ) $echo_str .= $dlp.wfu_insert_variables($def['variables'], 'wfu_variable wfu_variable_s_'.$attr);
|
342 |
+
$echo_str .= $dlp."\t\t".'<br /><span class="wfu_ptext_span">Plural</span><input id="wfu_attribute_p_'.$attr.'" type="text" name="wfu_ptext_elements" value="'.$plural.'" />';
|
343 |
+
if ( $def['variables'] != null ) if ( count($def['variables']) > 0 ) $echo_str .= $dlp."\t\t".'<br /><span class="wfu_ptext_span"> </span>';
|
344 |
+
if ( $def['variables'] != null ) $echo_str .= $dlp.wfu_insert_variables($def['variables'], 'wfu_variable wfu_variable_p_'.$attr, $dlp);
|
345 |
+
}
|
346 |
+
elseif ( $def['type'] == "mtext" ) {
|
347 |
+
$val = str_replace(array( "%n%", "%dq%", "%brl%", "%brr%" ), array( "\n", """, "[", "]" ), $def['value']);
|
348 |
+
$echo_str .= $dlp."\t\t".'<textarea id="wfu_attribute_'.$attr.'" name="wfu_text_elements" rows="5">'.$val.'</textarea>';
|
349 |
+
if ( $def['variables'] != null ) $echo_str .= $dlp.wfu_insert_variables($def['variables'], 'wfu_variable wfu_variable_'.$attr);
|
350 |
+
}
|
351 |
+
elseif ( $def['type'] == "folderlist" ) {
|
352 |
+
$echo_str .= $dlp."\t\t".'<div id="wfu_subfolders_inner_shadow_'.$attr.'" class="wfu_subfolders_inner_shadow" style="display:none;"></div>';
|
353 |
+
$subfolders = wfu_parse_folderlist($def['value']);
|
354 |
+
$poptitle = "Populate list automatically with the first-level subfolders of the path defined in uploadpath";
|
355 |
+
$edittitle = "Allow the user to type the subfolder and filter the list during typing";
|
356 |
+
$echo_str .= $dlp."\t\t".'<input type="checkbox" id="wfu_subfolders_auto_'.$attr.'"'.( substr($def['value'], 0, 4) == "auto" ? ' checked="checked"' : '' ).' onchange="wfu_subfolders_auto_changed(\''.$attr.'\');" title="'.$poptitle.'" /><label for="wfu_subfolders_auto_'.$attr.'" title="'.$poptitle.'"> Auto-populate list</label>';
|
357 |
+
$echo_str .= $dlp."\t\t".'<div style="display:'.( substr($def['value'], 0, 4) == "auto" ? 'inline' : 'none' ).'; padding:0; margin:0 0 0 30px; background:none; border:none;"><input type="checkbox" id="wfu_subfolders_editable_'.$attr.'"'.( substr($def['value'], 0, 5) == "auto+" ? ' checked="checked"' : '' ).' onchange="wfu_subfolders_auto_changed(\''.$attr.'\');" title="'.$edittitle.'" /><label for="wfu_subfolders_editable_'.$attr.'" title="'.$edittitle.'"> List is editable</label></div><br />';
|
358 |
+
$echo_str .= $dlp."\t\t".'<input type="hidden" id="wfu_subfolders_manualtext_'.$attr.'" value="'.( substr($def['value'], 0, 4) == "auto" ? "" : $def['value'] ).'" />';
|
359 |
+
$echo_str .= $dlp."\t\t".'<select id="wfu_attribute_'.$attr.'" class="wfu_select_folders'.( count($subfolders['path']) == 0 ? ' wfu_select_folders_empty' : '' ).'" size="7"'.( substr($def['value'], 0, 4) == "auto" ? ' disabled="disabled"' : '' ).' onchange="wfu_subfolders_changed(\''.$attr.'\');">';
|
360 |
+
foreach ($subfolders['path'] as $ind => $subfolder) {
|
361 |
+
if ( substr($subfolder, -1) == '/' ) $subfolder = substr($subfolder, 0, -1);
|
362 |
+
$subfolder_raw = explode('/', $subfolder);
|
363 |
+
$subfolder = $subfolder_raw[count($subfolder_raw) - 1];
|
364 |
+
$text = str_repeat(" ", intval($subfolders['level'][$ind])).$subfolders['label'][$ind];
|
365 |
+
$subvalue = str_repeat("*", intval($subfolders['level'][$ind])).( $subfolders['default'][$ind] ? '&' : '' ).( $subfolder == "" ? '{root}' : $subfolder ).'/'.$subfolders['label'][$ind];
|
366 |
+
$echo_str .= $dlp."\t\t\t".'<option class="'.( $subfolders['default'][$ind] ? 'wfu_select_folders_option_default' : '' ).'" value="'.wfu_plugin_encode_string($subvalue).'">'.$text.'</option>';
|
367 |
+
}
|
368 |
+
$echo_str .= $dlp."\t\t\t".'<option value="">'.( substr($def['value'], 0, 4) != "auto" && count($subfolders['path']) == 0 ? 'press here' : '' ).'</option>';
|
369 |
+
$echo_str .= $dlp."\t\t".'</select>';
|
370 |
+
$echo_str .= $dlp."\t\t".'<div id="wfu_subfolder_nav_'.$attr.'" class="wfu_subfolder_nav_container">';
|
371 |
+
$echo_str .= $dlp."\t\t\t".'<table class="wfu_subfolder_nav"><tbody>';
|
372 |
+
$echo_str .= $dlp."\t\t\t\t".'<tr><td><button id="wfu_subfolders_up_'.$attr.'" name="wfu_subfolder_nav_'.$attr.'" class="button" disabled="disabled" title="move item up" onclick="wfu_subfolders_up_clicked(\''.$attr.'\');">↑</button></tr></td>';
|
373 |
+
$echo_str .= $dlp."\t\t\t\t".'<tr><td><button id="wfu_subfolders_left_'.$attr.'" name="wfu_subfolder_nav_'.$attr.'" class="button" title="make it parent" disabled="disabled" style="height:14px;" onclick="wfu_subfolders_left_clicked(\''.$attr.'\');">←</button>';
|
374 |
+
$echo_str .= $dlp."\t\t\t\t".'<button id="wfu_subfolders_right_'.$attr.'" name="wfu_subfolder_nav_'.$attr.'" class="button" title="make it child" disabled="disabled" style="height:14px;" onclick="wfu_subfolders_right_clicked(\''.$attr.'\');">→</button></tr></td>';
|
375 |
+
$echo_str .= $dlp."\t\t\t\t".'<tr><td><button id="wfu_subfolders_down_'.$attr.'" name="wfu_subfolder_nav_'.$attr.'" class="button" title="move item down" disabled="disabled" onclick="wfu_subfolders_down_clicked(\''.$attr.'\');">↓</button></tr></td>';
|
376 |
+
$echo_str .= $dlp."\t\t\t\t".'<tr><td style="line-height:0;"><button class="button" style="visibility:hidden; height:10px;"></button></tr></td>';
|
377 |
+
$echo_str .= $dlp."\t\t\t\t".'<tr><td><button id="wfu_subfolders_add_'.$attr.'" name="wfu_subfolder_nav_'.$attr.'" class="button" title="add new item" disabled="disabled" style="height:14px;" onclick="wfu_subfolders_add_clicked(\''.$attr.'\');">+</button></tr></td>';
|
378 |
+
$echo_str .= $dlp."\t\t\t\t".'<tr><td><button id="wfu_subfolders_def_'.$attr.'" name="wfu_subfolder_nav_'.$attr.'" class="button" title="make it default" disabled="disabled" style="height:14px;" onclick="wfu_subfolders_def_clicked(\''.$attr.'\');">♦</button></tr></td>';
|
379 |
+
$echo_str .= $dlp."\t\t\t\t".'<tr><td><button id="wfu_subfolders_del_'.$attr.'" name="wfu_subfolder_nav_'.$attr.'" class="button" title="delete item" disabled="disabled" style="height:14px;" onclick="wfu_subfolders_del_clicked(\''.$attr.'\');">-</button></tr></td>';
|
380 |
+
$echo_str .= $dlp."\t\t\t".'</tbody></table>';
|
381 |
+
$echo_str .= $dlp."\t\t".'</div>';
|
382 |
+
$echo_str .= $dlp."\t\t".'<div id="wfu_subfolder_tools_'.$attr.'" class="wfu_subfolder_tools_container wfu_subfolder_tools_disabled">';
|
383 |
+
$echo_str .= $dlp."\t\t\t".'<table class="wfu_subfolder_tools"><tbody><tr>';
|
384 |
+
$echo_str .= $dlp."\t\t\t\t".'<td style="width:40%;">';
|
385 |
+
$echo_str .= $dlp."\t\t\t\t\t".'<label>Label</label>';
|
386 |
+
$echo_str .= $dlp."\t\t\t\t\t".'<input id="wfu_subfolders_label_'.$attr.'" name="wfu_subfolder_tools_input" type="text" disabled="disabled" />';
|
387 |
+
$echo_str .= $dlp."\t\t\t\t".'</td>';
|
388 |
+
$echo_str .= $dlp."\t\t\t\t".'<td style="width:60%;"><div style="padding-right:36px;">';
|
389 |
+
$echo_str .= $dlp."\t\t\t\t\t".'<label>Path</label>';
|
390 |
+
$echo_str .= $dlp."\t\t\t\t\t".'<input id="wfu_subfolders_path_'.$attr.'" name="wfu_subfolder_tools_input" type="text" disabled="disabled" />';
|
391 |
+
$echo_str .= $dlp."\t\t\t\t\t".'<button id="wfu_subfolders_browse_'.$attr.'" class="button" title="browse folders" style="right:18px;" disabled="disabled" onclick="wfu_subfolders_browse_clicked(\''.$attr.'\');"><img src="'.WFU_IMAGE_ADMIN_SUBFOLDER_BROWSE.'" ></button>';
|
392 |
+
$echo_str .= $dlp."\t\t\t\t\t".'<button id="wfu_subfolders_ok_'.$attr.'" class="button" title="save changes" style="right:0px;" disabled="disabled" onclick="wfu_subfolders_ok_clicked(\''.$attr.'\');"><img src="'.WFU_IMAGE_ADMIN_SUBFOLDER_OK.'" ></button>';
|
393 |
+
// file browser dialog
|
394 |
+
$echo_str .= $dlp."\t\t\t\t\t".'<div id="wfu_subfolders_browser_'.$attr.'" class="wfu_subfolders_browser_container" style="display:none;">';
|
395 |
+
$echo_str .= $dlp."\t\t\t\t\t\t".'<table><tbody>';
|
396 |
+
$echo_str .= $dlp."\t\t\t\t\t\t\t".'<tr><td style="height:15px;">';
|
397 |
+
$echo_str .= $dlp."\t\t\t\t\t\t\t\t".'<div>';
|
398 |
+
$echo_str .= $dlp."\t\t\t\t\t\t\t\t\t".'<label>Folder Browser</label>';
|
399 |
+
$echo_str .= $dlp."\t\t\t\t\t\t\t\t\t".'<button class="button wfu_folder_browser_cancel" onclick="wfu_folder_browser_cancel_clicked(\''.$attr.'\');"><img src="'.WFU_IMAGE_ADMIN_SUBFOLDER_CANCEL.'" ></button>';
|
400 |
+
$echo_str .= $dlp."\t\t\t\t\t\t\t\t".'</div>';
|
401 |
+
$echo_str .= $dlp."\t\t\t\t\t\t\t".'</td></tr>';
|
402 |
+
$echo_str .= $dlp."\t\t\t\t\t\t\t".'<tr><td style="height:106px;">';
|
403 |
+
$echo_str .= $dlp."\t\t\t\t\t\t\t\t".'<div>';
|
404 |
+
$echo_str .= $dlp."\t\t\t\t\t\t\t\t\t".'<select id="wfu_subfolders_browser_list_'.$attr.'" size="2" onchange="wfu_subfolders_browser_list_changed(\''.$attr.'\');">';
|
405 |
+
$echo_str .= $dlp."\t\t\t\t\t\t\t\t\t\t".'<option>Value</option>';
|
406 |
+
$echo_str .= $dlp."\t\t\t\t\t\t\t\t\t\t".'<option>Value2</option>';
|
407 |
+
$echo_str .= $dlp."\t\t\t\t\t\t\t\t\t\t".'<option>Value3</option>';
|
408 |
+
$echo_str .= $dlp."\t\t\t\t\t\t\t\t\t".'</select>';
|
409 |
+
$echo_str .= $dlp."\t\t\t\t\t\t\t\t\t".'<div id="wfu_subfolders_browser_msgcont_'.$attr.'" class="wfu_folder_browser_loading_container" style="padding-top:40px;">';
|
410 |
+
$echo_str .= $dlp."\t\t\t\t\t\t\t\t\t\t".'<label id="wfu_subfolders_browser_msg_'.$attr.'" style="margin-bottom:4px;">loading folder contents...</label>';
|
411 |
+
$echo_str .= $dlp."\t\t\t\t\t\t\t\t\t\t".'<img id="wfu_subfolders_browser_img_'.$attr.'" src="'.WFU_IMAGE_ADMIN_SUBFOLDER_LOADING.'" ></button>';
|
412 |
+
$echo_str .= $dlp."\t\t\t\t\t\t\t\t\t".'</div>';
|
413 |
+
$echo_str .= $dlp."\t\t\t\t\t\t\t\t".'</div>';
|
414 |
+
$echo_str .= $dlp."\t\t\t\t\t\t\t".'</td></tr>';
|
415 |
+
$echo_str .= $dlp."\t\t\t\t\t\t\t".'<tr><td align="right" style="height:15px;">';
|
416 |
+
$echo_str .= $dlp."\t\t\t\t\t\t\t\t".'<div>';
|
417 |
+
$echo_str .= $dlp."\t\t\t\t\t\t\t\t\t".'<button class="button" onclick="wfu_folder_browser_cancel_clicked(\''.$attr.'\');">Cancel</button>';
|
418 |
+
$echo_str .= $dlp."\t\t\t\t\t\t\t\t\t".'<button id="wfu_subfolders_browser_ok_'.$attr.'" class="button">Ok</button>';
|
419 |
+
$echo_str .= $dlp."\t\t\t\t\t\t\t\t".'</div>';
|
420 |
+
$echo_str .= $dlp."\t\t\t\t\t\t\t".'</td></tr>';
|
421 |
+
$echo_str .= $dlp."\t\t\t\t\t\t".'</tbody></table>';
|
422 |
+
$echo_str .= $dlp."\t\t\t\t\t".'</div>';
|
423 |
+
|
424 |
+
$echo_str .= $dlp."\t\t\t\t".'</div></td>';
|
425 |
+
$echo_str .= $dlp."\t\t\t".'</tr></tbody></table>';
|
426 |
+
$echo_str .= $dlp."\t\t\t".'<input id="wfu_subfolders_isnewitem_'.$attr.'" type="hidden" value="" />';
|
427 |
+
$echo_str .= $dlp."\t\t\t".'<input id="wfu_subfolders_newitemindex_'.$attr.'" type="hidden" value="" />';
|
428 |
+
$echo_str .= $dlp."\t\t\t".'<input id="wfu_subfolders_newitemlevel_'.$attr.'" type="hidden" value="" />';
|
429 |
+
$echo_str .= $dlp."\t\t\t".'<input id="wfu_subfolders_newitemlevel2_'.$attr.'" type="hidden" value="" />';
|
430 |
+
$echo_str .= $dlp."\t\t".'</div>';
|
431 |
+
}
|
432 |
+
elseif ( $def['type'] == "mchecklist" ) {
|
433 |
+
$help_count = 0;
|
434 |
+
foreach ( $def['listitems'] as $key => $item ) {
|
435 |
+
$parts = explode("/", $item);
|
436 |
+
if ( count($parts) == 1 ) {
|
437 |
+
$items[$key]['id'] = $item;
|
438 |
+
$items[$key]['help'] = '';
|
439 |
+
}
|
440 |
+
else {
|
441 |
+
$items[$key]['id'] = $parts[0];
|
442 |
+
$items[$key]['help'] = $parts[1];
|
443 |
+
$help_count ++;
|
444 |
+
}
|
445 |
+
}
|
446 |
+
$def['value'] = strtolower($def['value']);
|
447 |
+
if ( $def['value'] == "all" ) $selected = array();
|
448 |
+
else $selected = explode(",", $def['value']);
|
449 |
+
foreach ( $selected as $key => $item ) $selected[$key] = trim($item);
|
450 |
+
$echo_str .= $dlp."\t\t".'<div id="wfu_attribute_'.$attr.'" class="wfu_mchecklist_container">';
|
451 |
+
$is_first = true;
|
452 |
+
foreach ( $items as $key => $item ) {
|
453 |
+
if ( !$is_first ) $echo_str .= "<br />";
|
454 |
+
$is_first = false;
|
455 |
+
$echo_str .= $dlp."\t\t\t".'<div class="wfu_mchecklist_item"><input id="wfu_attribute_'.$attr.'_'.$key.'" type="checkbox"'.( $def['value'] == "all" || in_array($item['id'], $selected) ? ' checked="checked"' : '' ).( $def['value'] == "all" ? ' disabled="disabled"' : '' ).' onchange="wfu_update_mchecklist_value(\''.$attr.'\');" /><label for="wfu_attribute_'.$attr.'_'.$key.'">'.$item['id'].'</label>';
|
456 |
+
if ( $item['help'] != '' ) $echo_str .= '<div class="wfu_help_container" title="'.$item['help'].'"><img src="'.WFU_IMAGE_ADMIN_HELP.'" /></div>';
|
457 |
+
$echo_str .= '</div>';
|
458 |
+
}
|
459 |
+
$echo_str .= $dlp."\t\t".'</div>';
|
460 |
+
$echo_str .= $dlp."\t\t".'<div id="wfu_attribute_'.$attr.'_optionhelp" class="wfu_help_container" title="" style="display:none; position:absolute;"><img src="'.WFU_IMAGE_ADMIN_HELP.'" style="visibility:visible;" /></div>';
|
461 |
+
$echo_str .= $dlp."\t\t".'<div class="wfu_mchecklist_checkall"><input id="wfu_attribute_'.$attr.'_all" type="checkbox" onchange="wfu_update_mchecklist_value(\''.$attr.'\');"'.( $def['value'] == "all" ? ' checked="checked"' : '' ).' /> Select all</div>';
|
462 |
+
}
|
463 |
+
elseif ( $def['type'] == "rolelist" ) {
|
464 |
+
$roles = $wp_roles->get_names();
|
465 |
+
$selected = explode(",", $def['value']);
|
466 |
+
$default_administrator = ( is_array($def['listitems']) && in_array('default_administrator', $def['listitems']) );
|
467 |
+
if ( in_array('all', $selected) ) $rolesselected = ( $default_administrator ? array("administrator") : array( ) );
|
468 |
+
else $rolesselected = $selected;
|
469 |
+
foreach ( $selected as $key => $item ) $selected[$key] = trim($item);
|
470 |
+
$echo_str .= $dlp."\t\t".'<table class="wfu_rolelist_container"><tbody><tr><td>';
|
471 |
+
$echo_str .= $dlp."\t\t".'<select id="wfu_attribute_'.$attr.'" multiple="multiple" size="'.count($roles).'" onchange="wfu_update_rolelist_value(\''.$attr.'\');"'.( in_array('all', $selected) ? ' disabled="disabled"' : '' ).'>';
|
472 |
+
foreach ( $roles as $roleid => $rolename )
|
473 |
+
$echo_str .= $dlp."\t\t\t".'<option value="'.$roleid.'"'.( in_array($roleid, $rolesselected) ? ' selected="selected"' : '' ).'>'.$rolename.'</option>';
|
474 |
+
$echo_str .= $dlp."\t\t".'</select>';
|
475 |
+
$echo_str .= $dlp."\t\t".'</td><td>';
|
476 |
+
$echo_str .= $dlp."\t\t".'<div class="wfu_rolelist_checkbtn"><input class="'.( $default_administrator ? 'wfu_default_administrator' : '' ).'" id="wfu_attribute_'.$attr.'_all" type="checkbox" onchange="wfu_update_rolelist_value(\''.$attr.'\');"'.( in_array('all', $selected) ? ' checked="checked"' : '' ).' /><label for="wfu_attribute_'.$attr.'_all"> Select all</label></div><br />';
|
477 |
+
$echo_str .= $dlp."\t\t".'<div class="wfu_rolelist_checkbtn"><input id="wfu_attribute_'.$attr.'_guests" type="checkbox" onchange="wfu_update_rolelist_value(\''.$attr.'\');"'.( in_array("guests", $selected) ? ' checked="checked"' : '' ).' /><label for="wfu_attribute_'.$attr.'_guests"> Include guests</label></div>';
|
478 |
+
$echo_str .= $dlp."\t\t".'</td></tr></tbody></table>';
|
479 |
+
}
|
480 |
+
elseif ( $def['type'] == "userlist" ) {
|
481 |
+
$args = array();
|
482 |
+
$args = apply_filters("_wfu_get_users", $args, "shortcode_composer");
|
483 |
+
$users = get_users($args);
|
484 |
+
$selected = explode(",", $def['value']);
|
485 |
+
$default_0 = ( is_array($def['listitems']) && in_array('default_0', $def['listitems']) );
|
486 |
+
if ( in_array('all', $selected) ) $usersselected = ( $default_0 ? array($users[0]->user_login) : array( ) );
|
487 |
+
else $usersselected = $selected;
|
488 |
+
$only_current = false;
|
489 |
+
$echo_str .= $dlp."\t\t".'<table class="wfu_userlist_container"><tbody><tr>';
|
490 |
+
if ( is_array($def['listitems']) && in_array('include_current', $def['listitems']) ) {
|
491 |
+
$only_current = ( $def['value'] == 'current' );
|
492 |
+
if ( $only_current ) $usersselected = ( $default_0 ? array($users[0]->user_login) : array( ) );
|
493 |
+
$echo_str .= $dlp."\t\t".'<td colspan="2"><div class="wfu_userlist_checkbtn"><input id="wfu_attribute_'.$attr.'_current" type="checkbox" onchange="wfu_update_userlist_value(\''.$attr.'\');"'.( $only_current ? ' checked="checked"' : '' ).' /><label for="wfu_attribute_'.$attr.'_current"> Only From Current User</label></div>';
|
494 |
+
$echo_str .= $dlp."\t\t".'</td></tr><tr>';
|
495 |
+
}
|
496 |
+
$echo_str .= $dlp."\t\t".'<td><select id="wfu_attribute_'.$attr.'" multiple="multiple" size="'.min(count($users), 10).'" onchange="wfu_update_userlist_value(\''.$attr.'\');"'.( $only_current || in_array('all', $selected) ? ' disabled="disabled"' : '' ).'>';
|
497 |
+
foreach ( $users as $userid => $user )
|
498 |
+
$echo_str .= $dlp."\t\t\t".'<option value="'.$user->user_login.'"'.( in_array($user->user_login, $usersselected) ? ' selected="selected"' : '' ).'>'.$user->display_name.' ('.$user->user_login.')</option>';
|
499 |
+
$echo_str .= $dlp."\t\t".'</select>';
|
500 |
+
$echo_str .= $dlp."\t\t".'</td><td>';
|
501 |
+
$echo_str .= $dlp."\t\t".'<div class="wfu_userlist_checkbtn"><input class="'.( $default_0 ? 'wfu_default_0' : '' ).'" id="wfu_attribute_'.$attr.'_all" type="checkbox" onchange="wfu_update_userlist_value(\''.$attr.'\');"'.( in_array('all', $selected) ? ' checked="checked"' : '' ).( $only_current ? ' disabled="disabled"' : '' ).' /><label for="wfu_attribute_'.$attr.'_all"> Select all</label></div><br />';
|
502 |
+
$echo_str .= $dlp."\t\t".'<div class="wfu_userlist_checkbtn"><input id="wfu_attribute_'.$attr.'_guests" type="checkbox" onchange="wfu_update_userlist_value(\''.$attr.'\');"'.( in_array("guests", $selected) ? ' checked="checked"' : '' ).( $only_current ? ' disabled="disabled"' : '' ).' /><label for="wfu_attribute_'.$attr.'_guests"> Include guests</label></div>';
|
503 |
+
$echo_str .= $dlp."\t\t".'</td></tr></tbody></table>';
|
504 |
+
}
|
505 |
+
elseif ( $def['type'] == "postlist" ) {
|
506 |
+
$processed = false;
|
507 |
+
if ( is_array($def['listitems']) ) {
|
508 |
+
$has_current = in_array('include_current', $def['listitems']);
|
509 |
+
if ( $has_current ) unset($def['listitems'][array_search('include_current', $def['listitems'])]);
|
510 |
+
foreach ( $def['listitems'] as $post_type ) {
|
511 |
+
// if a post type cannot be found then we reset the list so that it is not processed at all
|
512 |
+
if ( get_post_type_object( $post_type ) == null ) {
|
513 |
+
$def['listitems'] = array();
|
514 |
+
break;
|
515 |
+
}
|
516 |
+
}
|
517 |
+
if ( count($def['listitems']) > 0 ) {
|
518 |
+
$selected = explode(",", $def['value']);
|
519 |
+
$only_current = false;
|
520 |
+
$echo_str .= $dlp."\t\t".'<input id="wfu_attribute_'.$attr.'_postlist" type="hidden" value="'.implode(",", $def['listitems']).'" />';
|
521 |
+
$echo_str .= $dlp."\t\t".'<table class="wfu_postlist_container"><tbody><tr>';
|
522 |
+
if ( $has_current ) {
|
523 |
+
$only_current = ( $def['value'] == 'current' );
|
524 |
+
if ( $only_current ) $sselected = array();
|
525 |
+
$echo_str .= $dlp."\t\t".'<td colspan="'.count($def['listitems']).'"><div class="wfu_postlist_checkbtn"><input id="wfu_attribute_'.$attr.'_current" type="checkbox" onchange="wfu_update_postlist_value(\''.$attr.'\');"'.( $only_current ? ' checked="checked"' : '' ).' /><label for="wfu_attribute_'.$attr.'_current"> Only From Current Post/Page</label></div>';
|
526 |
+
$echo_str .= $dlp."\t\t".'</td></tr><tr>';
|
527 |
+
}
|
528 |
+
$postargs = array( 'post_type' => $def['listitems'], 'post_status' => "publish,private,draft", 'posts_per_page' => -1 );
|
529 |
+
$postargs = apply_filters("_wfu_get_posts", $postargs, "visual_editor");
|
530 |
+
$posts = get_posts($postargs);
|
531 |
+
$list = wfu_construct_post_list($posts);
|
532 |
+
$td_width = (int)(100 / count($def['listitems']));
|
533 |
+
foreach ( $def['listitems'] as $post_type ) {
|
534 |
+
$flatlist = wfu_flatten_post_list($list[$post_type]);
|
535 |
+
$postobj = get_post_type_object( $post_type );
|
536 |
+
$echo_str .= $dlp."\t\t".'<td style="width:'.$td_width.'%;"><div class="wfu_postlist_header"><label>'.$postobj->label.'</label><div class="wfu_postlist_selectall"><input id="wfu_attribute_'.$attr.'_all_'.$post_type.'" type="checkbox" onchange="wfu_update_postlist_value(\''.$attr.'\');"'.( in_array('all', $selected) || in_array('all'.$post_type, $selected) ? ' checked="checked"' : '' ).( $only_current ? ' disabled="disabled"' : '' ).' /><label for="wfu_attribute_'.$attr.'_all_'.$post_type.'"> Select all</label></div></div>';
|
537 |
+
$echo_str .= $dlp."\t\t".'<select id="wfu_attribute_'.$attr.'_'.$post_type.'" multiple="multiple" size="'.min(count($flatlist), 10).'" onchange="wfu_update_postlist_value(\''.$attr.'\');"'.( $only_current || in_array('all', $selected) || in_array('all'.$post_type, $selected) ? ' disabled="disabled"' : '' ).' style="width:100%; overflow:auto;">';
|
538 |
+
foreach ( $flatlist as $item )
|
539 |
+
$echo_str .= $dlp."\t\t\t".'<option value="'.$item['id'].'"'.( in_array($item['id'], $selected) ? ' selected="selected"' : '' ).'>'.str_repeat(' ', 4 * $item['level']).( $item['status'] == 1 ? '[Private]' : ( $item['status'] == 2 ? '[Draft]' : '' ) ).$item['title'].'</option>';
|
540 |
+
$echo_str .= $dlp."\t\t".'</select></td>';
|
541 |
+
}
|
542 |
+
$echo_str .= $dlp."\t\t".'</tr></tbody></table>';
|
543 |
+
$processed = true;
|
544 |
+
}
|
545 |
+
}
|
546 |
+
if ( !$processed ) {
|
547 |
+
$val = str_replace(array( "%n%", "%dq%", "%brl%", "%brr%" ), array( "\n", """, "[", "]" ), $def['value']);
|
548 |
+
$echo_str .= $dlp."\t\t".'<input id="wfu_attribute_'.$attr.'" type="text" name="wfu_text_elements" value="'.$val.'" />';
|
549 |
+
}
|
550 |
+
}
|
551 |
+
elseif ( $def['type'] == "bloglist" ) {
|
552 |
+
if ( function_exists('wp_get_sites') ) {
|
553 |
+
$blogs = wp_get_sites( );
|
554 |
+
$selected = explode(",", $def['value']);
|
555 |
+
if ( in_array('all', $selected) ) $blogsselected = array( );
|
556 |
+
else $blogsselected = $selected;
|
557 |
+
$only_current = false;
|
558 |
+
$echo_str .= $dlp."\t\t".'<table class="wfu_bloglist_container"><tbody><tr>';
|
559 |
+
if ( is_array($def['listitems']) && in_array('include_current', $def['listitems']) ) {
|
560 |
+
$only_current = ( $def['value'] == 'current' );
|
561 |
+
if ( $only_current ) $blogsselected = array( );
|
562 |
+
$echo_str .= $dlp."\t\t".'<td colspan="2"><div class="wfu_bloglist_checkbtn"><input id="wfu_attribute_'.$attr.'_current" type="checkbox" onchange="wfu_update_bloglist_value(\''.$attr.'\');"'.( $only_current ? ' checked="checked"' : '' ).' /><label for="wfu_attribute_'.$attr.'_current"> Only From Current Site</label></div>';
|
563 |
+
$echo_str .= $dlp."\t\t".'</td></tr><tr>';
|
564 |
+
}
|
565 |
+
$echo_str .= $dlp."\t\t".'<td><select id="wfu_attribute_'.$attr.'" multiple="multiple" size="'.min(count($blogs), 10).'" onchange="wfu_update_bloglist_value(\''.$attr.'\');"'.( $only_current || in_array('all', $selected) ? ' disabled="disabled"' : '' ).'>';
|
566 |
+
foreach ( $blogs as $blog )
|
567 |
+
$echo_str .= $dlp."\t\t\t".'<option value="'.$blog->blog_id.'"'.( in_array($blog->blog_id, $blogsselected) ? ' selected="selected"' : '' ).'>'.$blog->path.'</option>';
|
568 |
+
$echo_str .= $dlp."\t\t".'</select>';
|
569 |
+
$echo_str .= $dlp."\t\t".'</td><td>';
|
570 |
+
$echo_str .= $dlp."\t\t".'<div class="wfu_bloglist_checkbtn"><input id="wfu_attribute_'.$attr.'_all" type="checkbox" onchange="wfu_update_bloglist_value(\''.$attr.'\');"'.( in_array('all', $selected) ? ' checked="checked"' : '' ).( $only_current ? ' disabled="disabled"' : '' ).' /><label for="wfu_attribute_'.$attr.'_all"> Select all</label></div>';
|
571 |
+
$echo_str .= $dlp."\t\t".'</td></tr></tbody></table>';
|
572 |
+
}
|
573 |
+
else {
|
574 |
+
$val = str_replace(array( "%n%", "%dq%", "%brl%", "%brr%" ), array( "\n", """, "[", "]" ), $def['value']);
|
575 |
+
$echo_str .= $dlp."\t\t".'<input id="wfu_attribute_'.$attr.'" type="text" name="wfu_text_elements" value="'.$val.'" />';
|
576 |
+
}
|
577 |
+
}
|
578 |
+
elseif ( $def['type'] == "stringmatch" ) {
|
579 |
+
$matchfield = "";
|
580 |
+
$matchcriterion = "equal to";
|
581 |
+
$matchvalue = "";
|
582 |
+
preg_match('/^field:(.*?);\s*criterion:(.*?)\s*;\s*value:(.*)$/', $def['value'], $matches);
|
583 |
+
if ( count($matches) == 4 ) {
|
584 |
+
$matchfield = $matches[1];
|
585 |
+
$matchcriterion = $matches[2];
|
586 |
+
$matchvalue = $matches[3];
|
587 |
+
}
|
588 |
+
// $echo_str .= $dlp."\t\t".'<div style="white-space:nowrap;">';
|
589 |
+
$echo_str .= $dlp."\t\t".'<table class="wfu_stringmatch_container"><tbody><tr>';
|
590 |
+
$echo_str .= $dlp."\t\t".'<td style="width:40%; white-space:nowrap;"><label>Field </label><input id="wfu_attribute_'.$attr.'_matchfield" type="text" name="wfu_stringmatch_elements" value="'.$matchfield.'" style="width:auto;" /></td>';
|
591 |
+
$echo_str .= $dlp."\t\t".'<td style="width:30%;"><select id="wfu_attribute_'.$attr.'_matchcriterion" value="'.$matchcriterion.'" onchange="wfu_update_stringmatch_value(\''.$attr.'\');">';
|
592 |
+
$echo_str .= $dlp."\t\t\t".'<option value="equal to"'.( $matchcriterion == "equal to" ? 'selected="selected"' : '' ).'>equal to</option>';
|
593 |
+
$echo_str .= $dlp."\t\t\t".'<option value="starts with"'.( $matchcriterion == "starts with" ? 'selected="selected"' : '' ).'>starts with</option>';
|
594 |
+
$echo_str .= $dlp."\t\t\t".'<option value="ends with"'.( $matchcriterion == "ends with" ? 'selected="selected"' : '' ).'>ends with</option>';
|
595 |
+
$echo_str .= $dlp."\t\t\t".'<option value="contains"'.( $matchcriterion == "contains" ? 'selected="selected"' : '' ).'>contains</option>';
|
596 |
+
$echo_str .= $dlp."\t\t\t".'<option value="not equal to"'.( $matchcriterion == "not equal to" ? 'selected="selected"' : '' ).'>not equal to</option>';
|
597 |
+
$echo_str .= $dlp."\t\t\t".'<option value="does not start with"'.( $matchcriterion == "does not start with" ? 'selected="selected"' : '' ).'>does not start with</option>';
|
598 |
+
$echo_str .= $dlp."\t\t\t".'<option value="does not end with"'.( $matchcriterion == "does not end with" ? 'selected="selected"' : '' ).'>does not end with</option>';
|
599 |
+
$echo_str .= $dlp."\t\t\t".'<option value="does not contain"'.( $matchcriterion == "does not contain" ? 'selected="selected"' : '' ).'>does not contain</option>';
|
600 |
+
$echo_str .= $dlp."\t\t".'</select></td>';
|
601 |
+
$echo_str .= $dlp."\t\t".'<td style="width:30%;"><input id="wfu_attribute_'.$attr.'_matchvalue" type="text" name="wfu_stringmatch_elements" value="'.$matchvalue.'" style="width:auto;" /></td>';
|
602 |
+
$echo_str .= $dlp."\t\t".'</tr></tbody></table>';
|
603 |
+
// $echo_str .= $dlp."\t\t".'</div>';
|
604 |
+
}
|
605 |
+
elseif ( $def['type'] == "columns" ) {
|
606 |
+
$selected = explode(",", $def['value']);
|
607 |
+
if ( count($selected) == 1 && $selected[0] == "" ) $selected = array();
|
608 |
+
$selected_flat = array();
|
609 |
+
foreach ( $selected as $ind => $item ) $selected_flat[$ind] = preg_replace("/(:|\/).*$/", "", $item);
|
610 |
+
$echo_str .= $dlp."\t".'<table class="wfu_columns_container"><tbody><tr>';
|
611 |
+
$echo_str .= $dlp."\t\t\t".'<td style="width:45%;"><label class="wfu_columns_listtitle">Available Columns</label></td>';
|
612 |
+
$echo_str .= $dlp."\t\t\t".'<td style="width:55%"><label class="wfu_columns_listtitle">Displayed Columns</label></td></tr><tr>';
|
613 |
+
$echo_str .= $dlp."\t\t".'<td style="width:45%;">';
|
614 |
+
$echo_str .= $dlp."\t\t\t".'<table class="wfu_columns_container" style="table-layout:fixed; width:100%;"><tbody><tr>';
|
615 |
+
$echo_str .= $dlp."\t\t\t\t".'<td><select id="wfu_attribute_'.$attr.'_sourcelist" multiple="multiple" size="'.min(count($def['listitems']), 10).'" style="width:100%; overflow:auto;">';
|
616 |
+
$itemprops = array();
|
617 |
+
foreach ( $def['listitems'] as $item ) {
|
618 |
+
$item_required = ( substr($item, 0, 1) == "*" );
|
619 |
+
if ( $item_required ) $item = substr($item, 1);
|
620 |
+
$item_parts = explode("/", $item, 3);
|
621 |
+
$item_name = $item_parts[0];
|
622 |
+
$item_label = "";
|
623 |
+
$item_title = "";
|
624 |
+
if ( count($item_parts) > 1 ) $item_label = $item_parts[1];
|
625 |
+
if ( count($item_parts) == 3 ) $item_title = $item_parts[2];
|
626 |
+
$item_parts = explode(":", $item_name, 2);
|
627 |
+
$item_name = $item_parts[0];
|
628 |
+
if ( count($item_parts) == 1 ) $item_sort = "";
|
629 |
+
else $item_sort = $item_parts[1];
|
630 |
+
if ( $item_label == "" ) $item_label = $item_name;
|
631 |
+
if ( $item_title == "" ) $item_title = $item_label;
|
632 |
+
$itemprops[$item_name] = array( 'label' => $item_label, 'title' => $item_title, 'required' => $item_required, 'sortable' => ( $item_name == "custom" || $item_sort != "" ), 'sorttype' => $item_sort );
|
633 |
+
$val = $item_name.":".$item_sort."/".$item_title;
|
634 |
+
$echo_str .= $dlp."\t\t\t\t\t".'<option value="'.$val.'"'.( $item_required ? ' class="wfu_columns_item_required"' : '' ).' onclick="wfu_columns_itemclicked(this, \''.$attr.'\');">'.$item_label.'</option>';
|
635 |
+
}
|
636 |
+
foreach ( $itemprops as $item_name => $prop )
|
637 |
+
if ( $prop['required'] && !in_array($item_name, $selected_flat) )
|
638 |
+
array_splice($selected, 0, 0, array( $item_name ));
|
639 |
+
$selprops = array();
|
640 |
+
foreach ( $selected as $item ) {
|
641 |
+
$item_parts = explode("/", $item, 2);
|
642 |
+
$item_name = $item_parts[0];
|
643 |
+
if ( count($item_parts) == 1 ) $item_title = "";
|
644 |
+
else $item_title = $item_parts[1];
|
645 |
+
$item_parts = explode(":", $item_name, 2);
|
646 |
+
$item_name = $item_parts[0];
|
647 |
+
$flat_name = preg_replace("/^custom[0-9]+$/", "custom", $item_name);
|
648 |
+
if ( $item_name != "custom" && isset($itemprops[$flat_name]) ) {
|
649 |
+
$prop = $itemprops[$flat_name];
|
650 |
+
if ( count($item_parts) == 1 ) $item_sort = ( $flat_name == "custom" ? "+-s" : ( $prop['sortable'] ? "-+".$prop['sorttype'] : "" ) );
|
651 |
+
elseif ( $flat_name == "custom" ) $item_sort = "+".($item_parts[1] == "" ? "-s" : "+".$item_parts[1]);
|
652 |
+
else $item_sort = ( $prop['sortable'] ? "-".($item_parts[1] == "" ? "-" : "+").$prop['sorttype'] : "" );
|
653 |
+
if ( $item_title == "" ) $item_title = $prop['title'];
|
654 |
+
array_push($selprops, array( 'name' => $item_name, 'label' => $prop['label'], 'title' => $item_title, 'required' => $prop['required'], 'sorttype' => $item_sort ));
|
655 |
+
}
|
656 |
+
}
|
657 |
+
$echo_str .= $dlp."\t\t\t\t".'</select></td>';
|
658 |
+
$echo_str .= $dlp."\t\t\t\t".'<td style="width:30px; padding:0 6px;"><button class="wfu_columns_addbutton" title="add column" onclick="wfu_columns_buttonaction(\''.$attr.'\', \'add\');" style="width:100%;">>></button></td>';
|
659 |
+
$echo_str .= $dlp."\t\t\t".'</tr></tbody></table>';
|
660 |
+
$echo_str .= $dlp."\t\t".'</td>';
|
661 |
+
$echo_str .= $dlp."\t\t".'<td style="width:55%">';
|
662 |
+
$echo_str .= $dlp."\t\t\t".'<table class="wfu_columns_container" style="table-layout:fixed; width:100%;"><tbody><tr>';
|
663 |
+
$echo_str .= $dlp."\t\t\t\t".'<td><select id="wfu_attribute_'.$attr.'" multiple="multiple" size="'.min(count($def['listitems']), 10).'" onchange="wfu_update_columns(\''.$attr.'\');" style="width:100%; overflow:auto;">';
|
664 |
+
foreach ( $selprops as $prop ) {
|
665 |
+
$val = $prop['name'].":".$prop['sorttype']."/".$prop['label']."/".$prop['title'];
|
666 |
+
$echo_str .= $dlp."\t\t\t\t\t".'<option value="'.$val.'"'.( $prop['required'] ? ' class="wfu_columns_item_required"' : '' ).' onclick="wfu_columns_itemclicked(this, \''.$attr.'\');">'.$prop['label'].( $prop['title'] != "" && $prop['title'] != $prop['label'] ? " (".$prop['title'].")" : "" ).'</option>';
|
667 |
+
}
|
668 |
+
$echo_str .= $dlp."\t\t\t\t".'</select></td>';
|
669 |
+
$echo_str .= $dlp."\t\t\t\t".'<td style="width:30px; padding:0 6px;">';
|
670 |
+
$echo_str .= $dlp."\t\t\t\t\t".'<button class="wfu_columns_addbutton" title="move up" onclick="wfu_columns_buttonaction(\''.$attr.'\', \'up\');" style="width:100%;">↑</button>';
|
671 |
+
$echo_str .= $dlp."\t\t\t\t\t".'<button class="wfu_columns_addbutton" title="remove" onclick="wfu_columns_buttonaction(\''.$attr.'\', \'del\');" style="width:100%;">-</button>';
|
672 |
+
$echo_str .= $dlp."\t\t\t\t\t".'<button class="wfu_columns_addbutton" title="move down" onclick="wfu_columns_buttonaction(\''.$attr.'\', \'down\');" style="width:100%;">↓</button>';
|
673 |
+
$echo_str .= $dlp."\t\t\t\t".'</td>';
|
674 |
+
$echo_str .= $dlp."\t\t\t".'</tr></tbody></table>';
|
675 |
+
$echo_str .= $dlp."\t\t\t".'<label class="wfu_columns_listtitle" style="margin-top:6px; display:block;">Column Properties</label>';
|
676 |
+
$echo_str .= $dlp."\t\t\t".'<table id="wfu_attribute_'.$attr.'_columnprops_container" class="wfu_columnprops_container wfu_columnprops_container_disabled"><tbody>';
|
677 |
+
$echo_str .= $dlp."\t\t\t\t".'<tr><td style="width:1%; padding-right:10px;"><label id="wfu_attribute_'.$attr.'_columnprops_title_label">Title</label></td>';
|
678 |
+
$echo_str .= $dlp."\t\t\t\t".'<td><input type="text" id="wfu_attribute_'.$attr.'_columnprops_title" name="wfu_columnprops_elements" value="" style="width:100%;" disabled="disabled" /></td></tr>';
|
679 |
+
$echo_str .= $dlp."\t\t\t\t".'<tr><td style="width:1%; padding-right:10px; white-space:nowrap;"><label id="wfu_attribute_'.$attr.'_columnprops_id_label">Field ID</label></td>';
|
680 |
+
$echo_str .= $dlp."\t\t\t\t".'<td><input type="number" id="wfu_attribute_'.$attr.'_columnprops_id" name="wfu_columnprops_elements" min="1" value="" style="width:100%;" disabled="disabled" /></td></tr>';
|
681 |
+
$echo_str .= $dlp."\t\t\t\t".'<tr><td colspan="2"><input type="checkbox" id="wfu_attribute_'.$attr.'_columnprops_sort" value="" onchange="wfu_columnprops_element_changed({target:this});" disabled="disabled" /><label id="wfu_attribute_'.$attr.'_columnprops_sort_label" for="wfu_attribute_'.$attr.'_columnprops_sort">Sortable</label></td></tr>';
|
682 |
+
$echo_str .= $dlp."\t\t\t\t".'<tr><td style="width:1%; padding-right:10px;"><label id="wfu_attribute_'.$attr.'_columnprops_sorttype_label" style="white-space:nowrap;">Sort As</label></td>';
|
683 |
+
$echo_str .= $dlp."\t\t\t\t".'<td><select id="wfu_attribute_'.$attr.'_columnprops_sorttype" value="" onchange="wfu_columnprops_element_changed({target:this});" disabled="disabled"><option value=""></option><option value="s">String</option><option value="n">Integer</option></select></td></tr>';
|
684 |
+
$echo_str .= $dlp."\t\t\t".'</tbody></table>';
|
685 |
+
$echo_str .= $dlp."\t\t".'</td>';
|
686 |
+
$echo_str .= $dlp."\t".'</tr></tbody></table>';
|
687 |
+
|
688 |
+
}
|
689 |
+
elseif ( $def['type'] == "dimensions" ) {
|
690 |
+
$vals_arr = explode(",", $def['value']);
|
691 |
+
$vals = array();
|
692 |
+
foreach ( $vals_arr as $val_raw ) {
|
693 |
+
if ( trim($val_raw) != "" ) {
|
694 |
+
list($val_id, $val) = explode(":", $val_raw);
|
695 |
+
$vals[trim($val_id)] = trim($val);
|
696 |
+
}
|
697 |
+
}
|
698 |
+
$dims = array();
|
699 |
+
foreach ( $components as $comp ) {
|
700 |
+
if ( $comp['dimensions'] == null ) $dims[$comp['id']] = $comp['name'];
|
701 |
+
else foreach ( $comp['dimensions'] as $dimraw ) {
|
702 |
+
list($dim_id, $dim_name) = explode("/", $dimraw);
|
703 |
+
$dims[$dim_id] = $dim_name;
|
704 |
+
}
|
705 |
+
}
|
706 |
+
foreach ( $dims as $dim_id => $dim_name ) {
|
707 |
+
if ( !array_key_exists($dim_id, $vals) ) $vals[$dim_id] = "";
|
708 |
+
$echo_str .= $dlp."\t\t".'<span style="display:inline-block; width:130px;">'.$dim_name.'</span><input id="wfu_attribute_'.$attr.'_'.$dim_id.'" type="text" name="wfu_dimension_elements_'.$attr.'" class="wfu_short_text" value="'.$vals[$dim_id].'" /><br />';
|
709 |
+
}
|
710 |
+
}
|
711 |
+
elseif ( $def['type'] == "userfields" ) {
|
712 |
+
$fields_arr = explode("/", $def['value']);
|
713 |
+
$fields = array();
|
714 |
+
foreach ( $fields_arr as $field_raw ) {
|
715 |
+
$is_req = ( substr($field_raw, 0, 1) == "*" );
|
716 |
+
if ( $is_req ) $field_raw = substr($field_raw, 1);
|
717 |
+
if ( $field_raw != "" ) array_push($fields, array( "name" => $field_raw, "required" => $is_req ));
|
718 |
+
}
|
719 |
+
if ( count($fields) == 0 ) array_push($fields, array( "name" => "", "required" => false ));
|
720 |
+
$echo_str .= $dlp."\t\t".'<div id="wfu_attribute_'.$attr.'" class="wfu_userdata_container">';
|
721 |
+
foreach ( $fields as $field ) {
|
722 |
+
$echo_str .= $dlp."\t\t\t".'<div class="wfu_userdata_line">';
|
723 |
+
$echo_str .= $dlp."\t\t\t\t".'<input type="text" name="wfu_userfield_elements" value="'.$field['name'].'" />';
|
724 |
+
$echo_str .= $dlp."\t\t\t\t".'<div class="wfu_userdata_action" onclick="wfu_userdata_add_field(this);"><img src="'.WFU_IMAGE_ADMIN_USERDATA_ADD.'" ></div>';
|
725 |
+
$echo_str .= $dlp."\t\t\t\t".'<div class="wfu_userdata_action wfu_userdata_action_disabled" onclick="wfu_userdata_remove_field(this);"><img src="'.WFU_IMAGE_ADMIN_USERDATA_REMOVE.'" ></div>';
|
726 |
+
$echo_str .= $dlp."\t\t\t\t".'<input type="checkbox"'.( $field['required'] ? 'checked="checked"' : '' ).' onchange="wfu_update_userfield_value({target:this});" />';
|
727 |
+
$echo_str .= $dlp."\t\t\t\t".'<span>Required</span>';
|
728 |
+
$echo_str .= $dlp."\t\t\t".'</div>';
|
729 |
+
}
|
730 |
+
$echo_str .= $dlp."\t\t".'</div>';
|
731 |
+
}
|
732 |
+
elseif ( $def['type'] == "formfields" ) {
|
733 |
+
//find occurrence index of this attribute and total occrrence length
|
734 |
+
$flat = $def['flat'];
|
735 |
+
$attr_occur_index = 0;
|
736 |
+
$attr_occur_length = 0;
|
737 |
+
$all_attributes = array();
|
738 |
+
foreach ( $defs as $def2 ) {
|
739 |
+
if ( $def2['flat'] == $flat ) {
|
740 |
+
$attr_occur_length ++;
|
741 |
+
array_push($all_attributes, $def2['attribute']);
|
742 |
+
if ( $def2['attribute'] == $attr ) $attr_occur_index = $attr_occur_length;
|
743 |
+
}
|
744 |
+
}
|
745 |
+
//get field type definitions
|
746 |
+
$fielddefs_array = $def['listitems'];
|
747 |
+
foreach ( $fielddefs_array as $fielddef ) $fielddefs[$fielddef['type']] = $fielddef;
|
748 |
+
//initialize editable field properties
|
749 |
+
$fieldprops_basic = array('label', 'required', 'donotautocomplete', 'validate', 'typehook', 'labelposition', 'hintposition', 'default', 'data', 'group', 'format');
|
750 |
+
$fieldprops_default = array ( "type" => "text", "label" => "", "labelposition" => "left", "required" => false, "donotautocomplete" => false, "validate" => false, "default" => "", "data" => "", "group" => "", "format" => "", "hintposition" => "right", "typehook" => false );
|
751 |
+
//parse shortcode attribute to $fields
|
752 |
+
$fields = wfu_parse_userdata_attribute($def['value']);
|
753 |
+
$labelpositions = array("none", "top", "right", "bottom", "left", "placeholder");
|
754 |
+
$hintpositions = array("none", "inline", "top", "right", "bottom", "left");
|
755 |
+
if ( count($fields) == 0 ) array_push($fields, $fieldprops_default);
|
756 |
+
//set html template variable
|
757 |
+
$template = $dlp."\t\t\t\t".'<table class="wfu_formdata_props_table"><tbody>';
|
758 |
+
$template .= $dlp."\t\t\t\t".'<tr><td colspan="2"><label class="wfu_formdata_label">Type</label><select id="wfu_formfield_[[key]]_type" value="[[t]]" onchange="wfu_formdata_type_changed(\'[[key]]\');">';
|
759 |
+
foreach( $fielddefs as $item ) $template .= $dlp."\t\t\t\t\t".'<option value="'.$item['type'].'"[[type_'.$item['type'].'_selected]]>'.$item['type_description'].'</option>';
|
760 |
+
$template .= $dlp."\t\t\t\t".'</select></td><td>';
|
761 |
+
$template .= $dlp."\t\t\t\t".'<div class="wfu_formdata_action wfu_formdata_action_add" onclick="wfu_formdata_add_field(\'[[key]]\');"><img src="'.WFU_IMAGE_ADMIN_USERDATA_ADD.'" ></div>';
|
762 |
+
$template .= $dlp."\t\t\t\t".'<div class="wfu_formdata_action wfu_formdata_action_remove[[remove_disabled]]" onclick="wfu_formdata_remove_field(\'[[key]]\');"><img src="'.WFU_IMAGE_ADMIN_USERDATA_REMOVE.'" ></div>';
|
763 |
+
$template .= $dlp."\t\t\t\t".'<div class="wfu_formdata_action wfu_formdata_action_up[[up_disabled]]" onclick="wfu_formdata_move_field(\'[[key]]\', \'up\');"><img src="'.WFU_IMAGE_ADMIN_USERDATA_UP.'" ></div>';
|
764 |
+
$template .= $dlp."\t\t\t\t".'<div class="wfu_formdata_action wfu_formdata_action_down[[down_disabled]]" onclick="wfu_formdata_move_field(\'[[key]]\', \'down\');"><img src="'.WFU_IMAGE_ADMIN_USERDATA_DOWN.'" ></div></td></tr>';
|
765 |
+
$template .= $dlp."\t\t\t\t".'<tr><td class="wfu_formdata_props"><label class="wfu_formdata_label" title="[[label_hint]]">[[label_label]]</label></td><td><input type="text" id="wfu_formfield_[[key]]_label" name="wfu_formfield_elements" value="[[label]]" /></td><td></td></tr>';
|
766 |
+
$labelpos_options = "";
|
767 |
+
foreach ( $labelpositions as $pos ) $labelpos_options .= '<option value="'.$pos.'"[[labelposition_'.$pos.'_selected]]>'.$pos.'</option>';
|
768 |
+
$template .= '[[S->]]'.$dlp."\t\t\t\t".'<tr><td class="wfu_formdata_props"><label class="wfu_formdata_labelposition" title="[[labelposition_hint]]">Label Position</label></td><td><select id="wfu_formfield_[[key]]_labelposition" value="[[s]]" title="[[labelposition_hint]]" onchange="wfu_update_formfield_value({target:this});">'.$labelpos_options.'</select></td><td></td></tr>[[<-S]]';
|
769 |
+
$template .= '[[R->]]'.$dlp."\t\t\t\t".'<tr><td colspan="2" class="wfu_formdata_props"><input id="wfu_formfield_[[key]]_required" type="checkbox"[[r->]] checked="checked"[[<-r]] title="[[required_hint]]" onchange="wfu_update_formfield_value({target:this});" /><label for="wfu_formfield_[[key]]_required" title="[[required_hint]]"> Required</label></td><td></td></tr>[[<-R]]';
|
770 |
+
$template .= '[[A->]]'.$dlp."\t\t\t\t".'<tr><td colspan="2" class="wfu_formdata_props"><input id="wfu_formfield_[[key]]_donotautocomplete" type="checkbox"[[a->]] checked="checked"[[<-a]] title="[[donotautocomplete_hint]]" onchange="wfu_update_formfield_value({target:this});" /><label for="wfu_formfield_[[key]]_donotautocomplete" title="[[donotautocomplete_hint]]"> Do not autocomplete</label></td><td></td></tr>[[<-A]]';
|
771 |
+
$template .= '[[V->]]'.$dlp."\t\t\t\t".'<tr><td colspan="2" class="wfu_formdata_props"><input id="wfu_formfield_[[key]]_validate" type="checkbox"[[v->]] checked="checked"[[<-v]] title="[[validate_hint]]" onchange="wfu_update_formfield_value({target:this});" /><label for="wfu_formfield_[[key]]_validate" title="[[validate_hint]]"> Validate</label></td><td></td></tr>[[<-V]]';
|
772 |
+
$hint_options = "";
|
773 |
+
foreach ( $hintpositions as $pos ) $hint_options .= '<option value="'.$pos.'"[[hintposition_'.$pos.'_selected]]>'.$pos.'</option>';
|
774 |
+
$template .= '[[P->]]'.$dlp."\t\t\t\t".'<tr><td class="wfu_formdata_props"><label class="wfu_formdata_label" title="[[hintposition_hint]]">Hint Position</label></td><td><select id="wfu_formfield_[[key]]_hintposition" value="[[p]]" title="[[hintposition_hint]]" onchange="wfu_update_formfield_value({target:this});">'.$hint_options.'</select></td><td></td></tr>[[<-P]]';
|
775 |
+
$template .= '[[H->]]'.$dlp."\t\t\t\t".'<tr><td colspan="2" class="wfu_formdata_props"><input id="wfu_formfield_[[key]]_typehook" type="checkbox"[[h->]] checked="checked"[[<-h]] title="[[typehook_hint]]" onchange="wfu_update_formfield_value({target:this});" /><label for="wfu_formfield_[[key]]_typehook" title="[[typehook_hint]]"> Type hook</label></td><td></td></tr>[[<-H]]';
|
776 |
+
$template .= '[[D->]]'.$dlp."\t\t\t\t".'<tr><td class="wfu_formdata_props"><label class="wfu_formdata_label" title="[[default_hint]]">Default</label></td><td><input id="wfu_formfield_[[key]]_default" type="text" name="wfu_formfield_elements" value="[[d]]" title="[[default_hint]]" /></td><td></td></tr>[[<-D]]';
|
777 |
+
$template .= '[[L->]]'.$dlp."\t\t\t\t".'<tr><td class="wfu_formdata_props"><label class="wfu_formdata_label" title="[[data_hint]]">[[data_label]]</label></td><td><input id="wfu_formfield_[[key]]_data" type="text" name="wfu_formfield_elements" value="[[l]]" title="[[data_hint]]" /></td><td></td></tr>[[<-L]]';
|
778 |
+
$template .= '[[G->]]'.$dlp."\t\t\t\t".'<tr><td class="wfu_formdata_props"><label class="wfu_formdata_label" title="[[group_hint]]">Group ID</label></td><td><input id="wfu_formfield_[[key]]_group" type="text" name="wfu_formfield_elements" value="[[g]]" title="[[group_hint]]" /></td><td></td></tr>[[<-G]]';
|
779 |
+
$template .= '[[F->]]'.$dlp."\t\t\t\t".'<tr><td class="wfu_formdata_props"><label class="wfu_formdata_label" title="[[format_hint]]">Format</label></td><td><input id="wfu_formfield_[[key]]_format" type="text" name="wfu_formfield_elements" value="[[f]]" title="[[format_hint]]" /></td><td></td></tr>[[<-F]]';
|
780 |
+
$template .= $dlp."\t\t\t\t".'</tbody></table>';
|
781 |
+
//draw html elements
|
782 |
+
$echo_str .= $dlp."\t\t".'<div id="wfu_attribute_'.$attr.'" class="wfu_formdata_container">';
|
783 |
+
$echo_str .= $dlp."\t\t\t".'<input type="hidden" class="wfu_formdata_all_attributes" value="'.implode(",", $all_attributes).'" />';
|
784 |
+
$echo_str .= $dlp."\t\t\t".'<div id="wfu_attribute_'.$attr.'_codeadd" style="display:none;">';
|
785 |
+
//pass template and type props to client javascript variable and then erase the code
|
786 |
+
$echo_str .= $dlp."\t\t\t\t".'<script type="text/javascript">';
|
787 |
+
$echo_str .= $dlp."\t\t\t\t\t".'var wfu_attribute_'.$attr.'_formtemplate = "'.wfu_plugin_encode_string($template).'";';
|
788 |
+
$echo_str .= $dlp."\t\t\t\t\t".'var wfu_attribute_'.$attr.'_typeprops = {};';
|
789 |
+
$fielddef_array = array();
|
790 |
+
foreach( $fielddefs as $item ) array_push($fielddef_array, $item['type']);
|
791 |
+
//prepare storage of field definitions to browser context
|
792 |
+
$echo_str .= $dlp."\t\t\t\t\t".'wfu_attribute_'.$attr.'_typeprops[0] = \''.implode(",", $fielddef_array).'\'';
|
793 |
+
foreach( $fielddefs as $item ) {
|
794 |
+
$typeprops = array();
|
795 |
+
foreach ( $fieldprops_basic as $prop ) {
|
796 |
+
array_push($typeprops, $prop.': \''.$item[$prop].'\'');
|
797 |
+
array_push($typeprops, $prop.'_hint: \''.$item[$prop.'_hint'].'\'');
|
798 |
+
}
|
799 |
+
array_push($typeprops, 'label_label: \''.$item['label_label'].'\'');
|
800 |
+
array_push($typeprops, 'data_label: \''.$item['data_label'].'\'');
|
801 |
+
$echo_str .= $dlp."\t\t\t\t\t".'wfu_attribute_'.$attr.'_typeprops["'.$item['type'].'"] = {'.implode(", ", $typeprops).'};';
|
802 |
+
}
|
803 |
+
$echo_str .= $dlp."\t\t\t\t\t".'var self = document.getElementById("wfu_attribute_'.$attr.'_codeadd"); self.parentNode.removeChild(self);';
|
804 |
+
$echo_str .= $dlp."\t\t\t\t".'</script>';
|
805 |
+
$echo_str .= $dlp."\t\t\t".'</div>';
|
806 |
+
$i = 1;
|
807 |
+
foreach ( $fields as $field ) {
|
808 |
+
$ind = wfu_create_random_string(4);
|
809 |
+
$key = $attr."_".$ind;
|
810 |
+
$fielddef = $fielddefs[$field["type"]];
|
811 |
+
$echo_str .= $dlp."\t\t\t".'<div id="wfu_formfield_'.$key.'_container" class="wfu_formdata_line_container">';
|
812 |
+
//generate html elements from template, replacing variables where applicable
|
813 |
+
$from_template = str_replace(array('[[key]]', '[[t]]', '[[label]]', '[[s]]', '[[d]]', '[[l]]', '[[label_label]]', '[[data_label]]', '[[g]]', '[[f]]', '[[p]]'), array($key, $field['type'], $field['label'], $field['labelposition'], $field['default'], $field['data'], $fielddef['label_label'], $fielddef['data_label'], $field['group'], $field['format'], $field['hintposition']), $template);
|
814 |
+
foreach ( $fieldprops_basic as $prop ) $from_template = str_replace('[['.$prop.'_hint]]', str_replace('\r\n', "\r\n", $fielddef[$prop.'_hint']), $from_template);
|
815 |
+
foreach( $fielddefs as $item ) $from_template = str_replace('[[type_'.$item['type'].'_selected]]', ( $item['type'] == $field['type'] ? ' selected = "selected"' : '' ), $from_template);
|
816 |
+
foreach( $labelpositions as $pos ) $from_template = str_replace('[[labelposition_'.$pos.'_selected]]', ( $pos == $field['labelposition'] ? ' selected = "selected"' : '' ), $from_template);
|
817 |
+
foreach( $hintpositions as $pos ) $from_template = str_replace('[[hintposition_'.$pos.'_selected]]', ( $pos == $field['hintposition'] ? ' selected = "selected"' : '' ), $from_template);
|
818 |
+
$from_template = str_replace('[[remove_disabled]]', ( count($fields) <= 1 ? ' wfu_formdata_action_disabled' : '' ), $from_template);
|
819 |
+
$from_template = str_replace('[[up_disabled]]', ( ( $attr_occur_index == 1 && $i == 1 ) ? ' wfu_formdata_action_disabled' : '' ), $from_template);
|
820 |
+
$from_template = str_replace('[[down_disabled]]', ( ( $attr_occur_index == $attr_occur_length && $i == count($fields) ) ? ' wfu_formdata_action_disabled' : '' ), $from_template);
|
821 |
+
//adjust checkbox field values
|
822 |
+
$from_template = preg_replace('/\[\[r\-\>\]\]'.( $field['required'] ? '|' : '.*' ).'\[\[\<\-r\]\]/', '', $from_template);
|
823 |
+
$from_template = preg_replace('/\[\[a\-\>\]\]'.( $field['donotautocomplete'] ? '|' : '.*' ).'\[\[\<\-a\]\]/', '', $from_template);
|
824 |
+
$from_template = preg_replace('/\[\[v\-\>\]\]'.( $field['validate'] ? '|' : '.*' ).'\[\[\<\-v\]\]/', '', $from_template);
|
825 |
+
$from_template = preg_replace('/\[\[h\-\>\]\]'.( $field['typehook'] ? '|' : '.*' ).'\[\[\<\-h\]\]/', '', $from_template);
|
826 |
+
//adjust visibility of properties
|
827 |
+
$from_template = preg_replace('/\[\[S\-\>\]\]'.( substr($fielddef["labelposition"], 0, 4) == "show" ? '|' : '.*' ).'\[\[\<\-S\]\]/s', '', $from_template);
|
828 |
+
$from_template = preg_replace('/\[\[R\-\>\]\]'.( substr($fielddef["required"], 0, 4) == "show" ? '|' : '.*' ).'\[\[\<\-R\]\]/s', '', $from_template);
|
829 |
+
$from_template = preg_replace('/\[\[A\-\>\]\]'.( substr($fielddef["donotautocomplete"], 0, 4) == "show" ? '|' : '.*' ).'\[\[\<\-A\]\]/s', '', $from_template);
|
830 |
+
$from_template = preg_replace('/\[\[V\-\>\]\]'.( substr($fielddef["validate"], 0, 4) == "show" ? '|' : '.*' ).'\[\[\<\-V\]\]/s', '', $from_template);
|
831 |
+
$from_template = preg_replace('/\[\[P\-\>\]\]'.( substr($fielddef["hintposition"], 0, 4) == "show" ? '|' : '.*' ).'\[\[\<\-P\]\]/s', '', $from_template);
|
832 |
+
$from_template = preg_replace('/\[\[H\-\>\]\]'.( substr($fielddef["typehook"], 0, 4) == "show" ? '|' : '.*' ).'\[\[\<\-H\]\]/s', '', $from_template);
|
833 |
+
$from_template = preg_replace('/\[\[D\-\>\]\]'.( substr($fielddef["default"], 0, 4) == "show" ? '|' : '.*' ).'\[\[\<\-D\]\]/s', '', $from_template);
|
834 |
+
$from_template = preg_replace('/\[\[L\-\>\]\]'.( substr($fielddef["data"], 0, 4) == "show" ? '|' : '.*' ).'\[\[\<\-L\]\]/s', '', $from_template);
|
835 |
+
$from_template = preg_replace('/\[\[G\-\>\]\]'.( substr($fielddef["group"], 0, 4) == "show" ? '|' : '.*' ).'\[\[\<\-G\]\]/s', '', $from_template);
|
836 |
+
$from_template = preg_replace('/\[\[F\-\>\]\]'.( substr($fielddef["format"], 0, 4) == "show" ? '|' : '.*' ).'\[\[\<\-F\]\]/s', '', $from_template);
|
837 |
+
$echo_str .= $from_template;
|
838 |
+
$echo_str .= $dlp."\t\t\t".'</div>';
|
839 |
+
$i++;
|
840 |
+
}
|
841 |
+
$echo_str .= $dlp."\t\t".'</div>';
|
842 |
+
}
|
843 |
+
elseif ( $def['type'] == "color" ) {
|
844 |
+
$val = str_replace(array( "%n%", "%dq%", "%brl%", "%brr%" ), array( "\n", """, "[", "]" ), $def['value']);
|
845 |
+
$echo_str .= $dlp."\t\t".'<input id="wfu_attribute_'.$attr.'" type="text" name="wfu_text_elements" class="wfu_color_field" value="'.$val.'" />';
|
846 |
+
}
|
847 |
+
elseif ( $def['type'] == "color-triplet" ) {
|
848 |
+
$triplet = explode(",", $def['value']);
|
849 |
+
foreach ( $triplet as $key => $item ) $triplet[$key] = trim($item);
|
850 |
+
if ( count($triplet) == 2 ) $triplet = array( $triplet[0], $triplet[1], "#000000");
|
851 |
+
elseif ( count($triplet) == 1 ) $triplet = array( $triplet[0], "#FFFFFF", "#000000");
|
852 |
+
elseif ( count($triplet) < 3 ) $triplet = array( "#000000", "#FFFFFF", "#000000");
|
853 |
+
$echo_str .= $dlp."\t\t".'<div class="wfu_color_container"><label style="display:inline-block; width:120px; margin-top:-16px;">Text Color</label><input id="wfu_attribute_'.$attr.'_color" type="text" class="wfu_color_field" name="wfu_triplecolor_elements" value="'.$triplet[0].'" /></div>';
|
854 |
+
$echo_str .= $dlp."\t\t".'<div class="wfu_color_container"><label style="display:inline-block; width:120px; margin-top:-16px;">Background Color</label><input id="wfu_attribute_'.$attr.'_bgcolor" type="text" class="wfu_color_field" name="wfu_triplecolor_elements" value="'.$triplet[1].'" /></div>';
|
855 |
+
$echo_str .= $dlp."\t\t".'<div class="wfu_color_container"><label style="display:inline-block; width:120px; margin-top:-16px;">Border Color</label><input id="wfu_attribute_'.$attr.'_borcolor" type="text" class="wfu_color_field" name="wfu_triplecolor_elements" value="'.$triplet[2].'" /></div>';
|
856 |
+
}
|
857 |
+
else {
|
858 |
+
$echo_str .= $dlp."\t\t".'<input id="wfu_attribute_'.$attr.'" type="text" name="wfu_text_elements" value="'.$def['value'].'" />';
|
859 |
+
if ( $def['variables'] != null ) $echo_str .= $dlp.wfu_insert_variables($def['variables'], 'wfu_variable wfu_variable_'.$attr);
|
860 |
+
}
|
861 |
+
$echo_str .= $dlp."\t".'</div></td>';
|
862 |
+
if ( $def['parent'] == "" ) {
|
863 |
+
$echo_str .= $dlp."\t".'<td style="position:relative; vertical-align:top; padding:0;"><div class="wfu_td_div">';
|
864 |
+
$block_open = false;
|
865 |
+
}
|
866 |
+
else {
|
867 |
+
$echo_str .= $dlp.'</tr>';
|
868 |
+
$subblock_open = true;
|
869 |
+
}
|
870 |
+
}
|
871 |
+
if ( $subblock_open ) {
|
872 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</div>';
|
873 |
+
}
|
874 |
+
if ( $block_open ) {
|
875 |
+
$echo_str .= "\n\t\t\t\t\t".'</div></td>';
|
876 |
+
$echo_str .= "\n\t\t\t\t".'</tr>';
|
877 |
+
}
|
878 |
+
$echo_str .= "\n\t\t\t".'</tbody>';
|
879 |
+
$echo_str .= "\n\t\t".'</table>';
|
880 |
+
$echo_str .= "\n\t".'</div>';
|
881 |
+
$echo_str .= "\n\t".'<div id="wfu_global_dialog_container" class="wfu_global_dialog_container">';
|
882 |
+
$echo_str .= "\n\t".'</div>';
|
883 |
+
$handler = 'function() { wfu_Attach_Admin_Events('.( $data == "" ? 'true' : 'false' ).'); }';
|
884 |
+
$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>';
|
885 |
+
$echo_str .= "\n".'</div>';
|
886 |
+
// $echo_str .= "\n\t".'<div style="margin-top:10px;">';
|
887 |
+
// $echo_str .= "\n\t\t".'<label>Final shortcode text</label>';
|
888 |
+
// $echo_str .= "\n\t".'</div>';
|
889 |
+
|
890 |
+
echo $echo_str;
|
891 |
+
}
|
892 |
+
|
893 |
+
function wfu_insert_variables($variables, $class) {
|
894 |
+
$ret = "";
|
895 |
+
foreach ( $variables as $variable )
|
896 |
+
if ( $variable == "%userdataXXX%" ) $ret .= "\t\t".'<select class="'.$class.'" name="wfu_formfield_select" title="'.constant("WFU_VARIABLE_TITLE_".strtoupper(str_replace("%", "", $variable))).'" onchange="wfu_insert_userfield_variable(this);"><option style="display:none;">%userdataXXX%</option></select>';
|
897 |
+
elseif ( $variable != "%n%" && $variable != "%dq%" && $variable != "%brl%" && $variable != "%brr%" ) $ret .= "\t\t".'<span class="'.$class.'" title="'.constant("WFU_VARIABLE_TITLE_".strtoupper(str_replace("%", "", $variable))).'" ondblclick="wfu_insert_variable(this);">'.$variable.'</span>';
|
898 |
+
return $ret;
|
899 |
+
}
|
900 |
+
|
901 |
+
?>
|
lib/wfu_admin_log.php
CHANGED
@@ -1,176 +1,176 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
function wfu_view_log($page = 1, $only_table_rows = false, $located_rec = -1) {
|
4 |
-
$a = func_get_args(); $a = WFU_FUNCTION_HOOK(__FUNCTION__, $a, $out); if (isset($out['vars'])) foreach($out['vars'] as $p => $v) $$p = $v; switch($a) { case 'R': return $out['output']; break; case 'D': die($out['output']); }
|
5 |
-
global $wpdb;
|
6 |
-
$siteurl = site_url();
|
7 |
-
$table_name1 = $wpdb->prefix . "wfu_log";
|
8 |
-
$table_name2 = $wpdb->prefix . "wfu_userdata";
|
9 |
-
$plugin_options = wfu_decode_plugin_options(get_option( "wordpress_file_upload_options" ));
|
10 |
-
|
11 |
-
if ( !current_user_can( 'manage_options' ) ) return;
|
12 |
-
|
13 |
-
$maxrows = (int)WFU_VAR("WFU_HISTORYLOG_TABLE_MAXROWS");
|
14 |
-
//get log data from database
|
15 |
-
$files_total = $wpdb->get_var('SELECT COUNT(idlog) FROM '.$table_name1);
|
16 |
-
//if we need to locate and focus on a specific record, then we need to
|
17 |
-
//recalculate and define the right page
|
18 |
-
if ( $located_rec > 0 && $maxrows > 0 ) {
|
19 |
-
$files_before = $wpdb->get_var('SELECT COUNT(idlog) FROM '.$table_name1.' WHERE idlog > '.(int)$located_rec);
|
20 |
-
$page = floor( $files_before / $maxrows ) + 1;
|
21 |
-
}
|
22 |
-
$filerecs = $wpdb->get_results('SELECT * FROM '.$table_name1.' ORDER BY date_from DESC'.( $maxrows > 0 ? ' LIMIT '.$maxrows.' OFFSET '.(($page - 1) * $maxrows) : '' ));
|
23 |
-
|
24 |
-
$echo_str = "";
|
25 |
-
if ( !$only_table_rows ) {
|
26 |
-
$echo_str .= "\n".'<div class="wrap">';
|
27 |
-
$echo_str .= "\n\t".'<h2>Wordpress File Upload Control Panel</h2>';
|
28 |
-
$echo_str .= "\n\t".'<div style="margin-top:20px;">';
|
29 |
-
$echo_str .= wfu_generate_dashboard_menu("\n\t\t", "View Log");
|
30 |
-
$echo_str .= "\n\t".'<div style="position:relative;">';
|
31 |
-
$echo_str .= wfu_add_loading_overlay("\n\t\t", "historylog");
|
32 |
-
$echo_str .= "\n\t\t".'<div class="wfu_historylog_header" style="width: 100%;">';
|
33 |
-
if ( $maxrows > 0 ) {
|
34 |
-
$pages = max(ceil($files_total / $maxrows), 1);
|
35 |
-
if ( $page > $pages ) $page = $pages;
|
36 |
-
$echo_str .= wfu_add_pagination_header("\n\t\t\t", "historylog", $page, $pages);
|
37 |
-
}
|
38 |
-
$echo_str .= "\n\t\t".'</div>';
|
39 |
-
$echo_str .= "\n\t\t".'<table id="wfu_historylog_table" class="wfu-historylog wp-list-table widefat fixed striped">';
|
40 |
-
$echo_str .= "\n\t\t\t".'<thead>';
|
41 |
-
$echo_str .= "\n\t\t\t\t".'<tr>';
|
42 |
-
$echo_str .= "\n\t\t\t\t\t".'<th scope="col" width="5%" class="manage-column">';
|
43 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<label>#</label>';
|
44 |
-
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
45 |
-
$echo_str .= "\n\t\t\t\t\t".'<th scope="col" width="30%" class="manage-column column-primary">';
|
46 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<label>File</label>';
|
47 |
-
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
48 |
-
$echo_str .= "\n\t\t\t\t\t".'<th scope="col" width="10%" class="manage-column">';
|
49 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<label>Action</label>';
|
50 |
-
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
51 |
-
$echo_str .= "\n\t\t\t\t\t".'<th scope="col" width="15%" class="manage-column">';
|
52 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<label>Date</label>';
|
53 |
-
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
54 |
-
$echo_str .= "\n\t\t\t\t\t".'<th scope="col" width="15%" class="manage-column">';
|
55 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<label>User</label>';
|
56 |
-
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
57 |
-
$echo_str .= "\n\t\t\t\t\t".'<th scope="col" width="25%" class="manage-column">';
|
58 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<label>Remarks</label>';
|
59 |
-
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
60 |
-
$echo_str .= "\n\t\t\t\t".'</tr>';
|
61 |
-
$echo_str .= "\n\t\t\t".'</thead>';
|
62 |
-
$echo_str .= "\n\t\t\t".'<tbody>';
|
63 |
-
}
|
64 |
-
|
65 |
-
$userdatarecs = $wpdb->get_results('SELECT * FROM '.$table_name2);
|
66 |
-
$deletedfiles = array();
|
67 |
-
$filecodes = array();
|
68 |
-
$logpagecode = wfu_safe_store_browser_params('view_log&tag='.$page);
|
69 |
-
$time0 = strtotime("0000-00-00 00:00:00");
|
70 |
-
$i = ($page - 1) * $maxrows;
|
71 |
-
$filerecs_count = count($filerecs);
|
72 |
-
foreach ( $filerecs as $ind => $filerec ) {
|
73 |
-
$remarks = '';
|
74 |
-
if ( $filerec->action == 'delete' ) array_push($deletedfiles, $filerec->linkedto);
|
75 |
-
elseif ( $filerec->action == 'rename' || $filerec->action == 'move' ) {
|
76 |
-
$prevfilepath = '';
|
77 |
-
$prevfilerec = wfu_get_file_rec_from_id($filerec->linkedto);
|
78 |
-
if ( $prevfilerec != null ) $prevfilepath = $prevfilerec->filepath;
|
79 |
-
if ( $prevfilepath != '' )
|
80 |
-
$remarks = "\n\t\t\t\t\t\t".'<label>Previous filepath: '.$prevfilepath.'</label>';
|
81 |
-
}
|
82 |
-
elseif ( $filerec->action == 'upload' || $filerec->action == 'modify' || $filerec->action == 'datasubmit' ) {
|
83 |
-
foreach ( $userdatarecs as $userdata ) {
|
84 |
-
if ( $userdata->uploadid == $filerec->uploadid ) {
|
85 |
-
$userdata_datefrom = strtotime($userdata->date_from);
|
86 |
-
$userdata_dateto = strtotime($userdata->date_to);
|
87 |
-
$filerec_datefrom = strtotime($filerec->date_from);
|
88 |
-
if ( $filerec_datefrom >= $userdata_datefrom && ( $userdata_dateto == $time0 || $filerec_datefrom < $userdata_dateto ) )
|
89 |
-
$remarks .= "\n\t\t\t\t\t\t\t".'<option>'.$userdata->property.': '.$userdata->propvalue.'</option>';
|
90 |
-
}
|
91 |
-
}
|
92 |
-
if ( $remarks != '' ) {
|
93 |
-
$remarks = "\n\t\t\t\t\t\t".'<select multiple="multiple" style="width:100%; height:40px; background:none; font-size:small; overflow:scroll; resize:vertical;">'.$remarks;
|
94 |
-
$remarks .= "\n\t\t\t\t\t\t".'</select>';
|
95 |
-
}
|
96 |
-
}
|
97 |
-
elseif ( $filerec->action == 'changeuser' ) {
|
98 |
-
$prevuploaduserid = '';
|
99 |
-
$prevfilerec = wfu_get_file_rec_from_id($filerec->linkedto);
|
100 |
-
if ( $prevfilerec != null ) $prevuploaduserid = $prevfilerec->uploaduserid;
|
101 |
-
if ( $prevuploaduserid != '' ) {
|
102 |
-
$prevuploaduser = wfu_get_username_by_id($prevuploaduserid);
|
103 |
-
$remarks = "\n\t\t\t\t\t\t".'<label>Previous upload user: '.$prevuploaduser.'</label>';
|
104 |
-
}
|
105 |
-
}
|
106 |
-
elseif ( $filerec->action == 'other' ) {
|
107 |
-
$info = $filerec->filepath;
|
108 |
-
$filerec->filepath = '';
|
109 |
-
$remarks = "\n\t\t\t\t\t\t".'<textarea style="width:100%; resize:vertical; background:none;" readonly="readonly">'.$info.'</textarea>';
|
110 |
-
}
|
111 |
-
$i ++;
|
112 |
-
$echo_str .= "\n\t\t\t\t".'<tr'.( $located_rec > 0 && $filerec->idlog == $located_rec ? ' class="wfu-highlighted"' : '' ).'>';
|
113 |
-
$echo_str .= "\n\t\t\t\t\t".'<th style="word-wrap: break-word;">'.$i.'</th>';
|
114 |
-
$echo_str .= "\n\t\t\t\t\t".'<td class="column-primary" data-colname="File">';
|
115 |
-
if ( $filerec->action == 'other' ) $echo_str .= "\n\t\t\t\t\t\t".'<span>Other action not related to file</span>';
|
116 |
-
elseif ( $filerec->action == 'datasubmit' ) $echo_str .= "\n\t\t\t\t\t\t".'<span>Submission of data without file</span>';
|
117 |
-
elseif ( in_array($filerec->linkedto, $deletedfiles) || in_array($filerec->idlog, $deletedfiles) ) $echo_str .= "\n\t\t\t\t\t\t".'<span>'.$filerec->filepath.'</span>';
|
118 |
-
else {
|
119 |
-
//find newest linked record
|
120 |
-
$newestidlog = $filerec->idlog;
|
121 |
-
$newestind = $ind;
|
122 |
-
$parind = $ind;
|
123 |
-
while ( $parind >= 0 && $filerecs[$newestind]->date_to != "0000-00-00 00:00:00" ) {
|
124 |
-
if ( isset($filerecs[$parind]->linkedto) && $filerecs[$parind]->linkedto == $newestidlog ) {
|
125 |
-
$newestind = $parind;
|
126 |
-
$newestidlog = $filerecs[$parind]->idlog;
|
127 |
-
}
|
128 |
-
$parind --;
|
129 |
-
}
|
130 |
-
//find oldest linked record
|
131 |
-
$oldestidlog = $filerec->idlog;
|
132 |
-
$oldestind = $ind;
|
133 |
-
$parind = $ind;
|
134 |
-
while ( $parind < $filerecs_count && isset($filerecs[$oldestind]->linkedto) ) {
|
135 |
-
if ( $filerecs[$parind]->idlog == $filerecs[$oldestind]->linkedto ) {
|
136 |
-
$oldestind = $parind;
|
137 |
-
$oldestidlog = $filerecs[$parind]->idlog;
|
138 |
-
}
|
139 |
-
$parind ++;
|
140 |
-
}
|
141 |
-
$lid = $oldestidlog;
|
142 |
-
//make the file linkable only if the record is still valid, the
|
143 |
-
//filename has not changed (due to a rename action) and the file
|
144 |
-
//exists
|
145 |
-
if ( $filerecs[$newestind]->date_to == "0000-00-00 00:00:00" && $filerec->filepath == $filerecs[$newestind]->filepath && file_exists(wfu_path_rel2abs($filerec->filepath)) ) {
|
146 |
-
if ( !isset($filecodes[$lid]) ) $filecodes[$lid] = wfu_safe_store_filepath($filerec->filepath);
|
147 |
-
$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=file_details&file='.$filecodes[$lid].'&invoker='.$logpagecode.'" title="View and edit file details" style="font-weight:normal;">'.$filerec->filepath.'</a>';
|
148 |
-
}
|
149 |
-
else $echo_str .= "\n\t\t\t\t\t\t".'<span>'.$filerec->filepath.'</span>';
|
150 |
-
}
|
151 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<button type="button" class="toggle-row"><span class="screen-reader-text">Show more details</span></button>';
|
152 |
-
$echo_str .= "\n\t\t\t\t\t".'</td>';
|
153 |
-
$echo_str .= "\n\t\t\t\t\t".'<td data-colname="Action">'.( $filerec->action != 'other' && $filerec->action != 'datasubmit' ? $filerec->action : '' ).'</td>';
|
154 |
-
$echo_str .= "\n\t\t\t\t\t".'<td data-colname="Date">'.get_date_from_gmt($filerec->date_from).'</td>';
|
155 |
-
$echo_str .= "\n\t\t\t\t\t".'<td data-colname="User">'.wfu_get_username_by_id($filerec->userid).'</td>';
|
156 |
-
$echo_str .= "\n\t\t\t\t\t".'<td data-colname="Remarks">';
|
157 |
-
$echo_str .= $remarks;
|
158 |
-
$echo_str .= "\n\t\t\t\t\t".'</td>';
|
159 |
-
$echo_str .= "\n\t\t\t\t".'</tr>';
|
160 |
-
}
|
161 |
-
if ( !$only_table_rows ) {
|
162 |
-
$echo_str .= "\n\t\t\t".'</tbody>';
|
163 |
-
$echo_str .= "\n\t\t".'</table>';
|
164 |
-
$echo_str .= "\n\t".'</div>';
|
165 |
-
$echo_str .= "\n\t".'</div>';
|
166 |
-
$echo_str .= "\n".'</div>';
|
167 |
-
}
|
168 |
-
if ( $located_rec > 0 ) {
|
169 |
-
$handler = 'function() { wfu_focus_table_on_highlighted_file("wfu_historylog_table"); }';
|
170 |
-
$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>';
|
171 |
-
}
|
172 |
-
|
173 |
-
return $echo_str;
|
174 |
-
}
|
175 |
-
|
176 |
-
?>
|
1 |
+
<?php
|
2 |
+
|
3 |
+
function wfu_view_log($page = 1, $only_table_rows = false, $located_rec = -1) {
|
4 |
+
$a = func_get_args(); $a = WFU_FUNCTION_HOOK(__FUNCTION__, $a, $out); if (isset($out['vars'])) foreach($out['vars'] as $p => $v) $$p = $v; switch($a) { case 'R': return $out['output']; break; case 'D': die($out['output']); }
|
5 |
+
global $wpdb;
|
6 |
+
$siteurl = site_url();
|
7 |
+
$table_name1 = $wpdb->prefix . "wfu_log";
|
8 |
+
$table_name2 = $wpdb->prefix . "wfu_userdata";
|
9 |
+
$plugin_options = wfu_decode_plugin_options(get_option( "wordpress_file_upload_options" ));
|
10 |
+
|
11 |
+
if ( !current_user_can( 'manage_options' ) ) return;
|
12 |
+
|
13 |
+
$maxrows = (int)WFU_VAR("WFU_HISTORYLOG_TABLE_MAXROWS");
|
14 |
+
//get log data from database
|
15 |
+
$files_total = $wpdb->get_var('SELECT COUNT(idlog) FROM '.$table_name1);
|
16 |
+
//if we need to locate and focus on a specific record, then we need to
|
17 |
+
//recalculate and define the right page
|
18 |
+
if ( $located_rec > 0 && $maxrows > 0 ) {
|
19 |
+
$files_before = $wpdb->get_var('SELECT COUNT(idlog) FROM '.$table_name1.' WHERE idlog > '.(int)$located_rec);
|
20 |
+
$page = floor( $files_before / $maxrows ) + 1;
|
21 |
+
}
|
22 |
+
$filerecs = $wpdb->get_results('SELECT * FROM '.$table_name1.' ORDER BY date_from DESC'.( $maxrows > 0 ? ' LIMIT '.$maxrows.' OFFSET '.(($page - 1) * $maxrows) : '' ));
|
23 |
+
|
24 |
+
$echo_str = "";
|
25 |
+
if ( !$only_table_rows ) {
|
26 |
+
$echo_str .= "\n".'<div class="wrap">';
|
27 |
+
$echo_str .= "\n\t".'<h2>Wordpress File Upload Control Panel</h2>';
|
28 |
+
$echo_str .= "\n\t".'<div style="margin-top:20px;">';
|
29 |
+
$echo_str .= wfu_generate_dashboard_menu("\n\t\t", "View Log");
|
30 |
+
$echo_str .= "\n\t".'<div style="position:relative;">';
|
31 |
+
$echo_str .= wfu_add_loading_overlay("\n\t\t", "historylog");
|
32 |
+
$echo_str .= "\n\t\t".'<div class="wfu_historylog_header" style="width: 100%;">';
|
33 |
+
if ( $maxrows > 0 ) {
|
34 |
+
$pages = max(ceil($files_total / $maxrows), 1);
|
35 |
+
if ( $page > $pages ) $page = $pages;
|
36 |
+
$echo_str .= wfu_add_pagination_header("\n\t\t\t", "historylog", $page, $pages);
|
37 |
+
}
|
38 |
+
$echo_str .= "\n\t\t".'</div>';
|
39 |
+
$echo_str .= "\n\t\t".'<table id="wfu_historylog_table" class="wfu-historylog wp-list-table widefat fixed striped">';
|
40 |
+
$echo_str .= "\n\t\t\t".'<thead>';
|
41 |
+
$echo_str .= "\n\t\t\t\t".'<tr>';
|
42 |
+
$echo_str .= "\n\t\t\t\t\t".'<th scope="col" width="5%" class="manage-column">';
|
43 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<label>#</label>';
|
44 |
+
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
45 |
+
$echo_str .= "\n\t\t\t\t\t".'<th scope="col" width="30%" class="manage-column column-primary">';
|
46 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<label>File</label>';
|
47 |
+
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
48 |
+
$echo_str .= "\n\t\t\t\t\t".'<th scope="col" width="10%" class="manage-column">';
|
49 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<label>Action</label>';
|
50 |
+
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
51 |
+
$echo_str .= "\n\t\t\t\t\t".'<th scope="col" width="15%" class="manage-column">';
|
52 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<label>Date</label>';
|
53 |
+
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
54 |
+
$echo_str .= "\n\t\t\t\t\t".'<th scope="col" width="15%" class="manage-column">';
|
55 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<label>User</label>';
|
56 |
+
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
57 |
+
$echo_str .= "\n\t\t\t\t\t".'<th scope="col" width="25%" class="manage-column">';
|
58 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<label>Remarks</label>';
|
59 |
+
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
60 |
+
$echo_str .= "\n\t\t\t\t".'</tr>';
|
61 |
+
$echo_str .= "\n\t\t\t".'</thead>';
|
62 |
+
$echo_str .= "\n\t\t\t".'<tbody>';
|
63 |
+
}
|
64 |
+
|
65 |
+
$userdatarecs = $wpdb->get_results('SELECT * FROM '.$table_name2);
|
66 |
+
$deletedfiles = array();
|
67 |
+
$filecodes = array();
|
68 |
+
$logpagecode = wfu_safe_store_browser_params('view_log&tag='.$page);
|
69 |
+
$time0 = strtotime("0000-00-00 00:00:00");
|
70 |
+
$i = ($page - 1) * $maxrows;
|
71 |
+
$filerecs_count = count($filerecs);
|
72 |
+
foreach ( $filerecs as $ind => $filerec ) {
|
73 |
+
$remarks = '';
|
74 |
+
if ( $filerec->action == 'delete' ) array_push($deletedfiles, $filerec->linkedto);
|
75 |
+
elseif ( $filerec->action == 'rename' || $filerec->action == 'move' ) {
|
76 |
+
$prevfilepath = '';
|
77 |
+
$prevfilerec = wfu_get_file_rec_from_id($filerec->linkedto);
|
78 |
+
if ( $prevfilerec != null ) $prevfilepath = $prevfilerec->filepath;
|
79 |
+
if ( $prevfilepath != '' )
|
80 |
+
$remarks = "\n\t\t\t\t\t\t".'<label>Previous filepath: '.$prevfilepath.'</label>';
|
81 |
+
}
|
82 |
+
elseif ( $filerec->action == 'upload' || $filerec->action == 'modify' || $filerec->action == 'datasubmit' ) {
|
83 |
+
foreach ( $userdatarecs as $userdata ) {
|
84 |
+
if ( $userdata->uploadid == $filerec->uploadid ) {
|
85 |
+
$userdata_datefrom = strtotime($userdata->date_from);
|
86 |
+
$userdata_dateto = strtotime($userdata->date_to);
|
87 |
+
$filerec_datefrom = strtotime($filerec->date_from);
|
88 |
+
if ( $filerec_datefrom >= $userdata_datefrom && ( $userdata_dateto == $time0 || $filerec_datefrom < $userdata_dateto ) )
|
89 |
+
$remarks .= "\n\t\t\t\t\t\t\t".'<option>'.$userdata->property.': '.$userdata->propvalue.'</option>';
|
90 |
+
}
|
91 |
+
}
|
92 |
+
if ( $remarks != '' ) {
|
93 |
+
$remarks = "\n\t\t\t\t\t\t".'<select multiple="multiple" style="width:100%; height:40px; background:none; font-size:small; overflow:scroll; resize:vertical;">'.$remarks;
|
94 |
+
$remarks .= "\n\t\t\t\t\t\t".'</select>';
|
95 |
+
}
|
96 |
+
}
|
97 |
+
elseif ( $filerec->action == 'changeuser' ) {
|
98 |
+
$prevuploaduserid = '';
|
99 |
+
$prevfilerec = wfu_get_file_rec_from_id($filerec->linkedto);
|
100 |
+
if ( $prevfilerec != null ) $prevuploaduserid = $prevfilerec->uploaduserid;
|
101 |
+
if ( $prevuploaduserid != '' ) {
|
102 |
+
$prevuploaduser = wfu_get_username_by_id($prevuploaduserid);
|
103 |
+
$remarks = "\n\t\t\t\t\t\t".'<label>Previous upload user: '.$prevuploaduser.'</label>';
|
104 |
+
}
|
105 |
+
}
|
106 |
+
elseif ( $filerec->action == 'other' ) {
|
107 |
+
$info = $filerec->filepath;
|
108 |
+
$filerec->filepath = '';
|
109 |
+
$remarks = "\n\t\t\t\t\t\t".'<textarea style="width:100%; resize:vertical; background:none;" readonly="readonly">'.$info.'</textarea>';
|
110 |
+
}
|
111 |
+
$i ++;
|
112 |
+
$echo_str .= "\n\t\t\t\t".'<tr'.( $located_rec > 0 && $filerec->idlog == $located_rec ? ' class="wfu-highlighted"' : '' ).'>';
|
113 |
+
$echo_str .= "\n\t\t\t\t\t".'<th style="word-wrap: break-word;">'.$i.'</th>';
|
114 |
+
$echo_str .= "\n\t\t\t\t\t".'<td class="column-primary" data-colname="File">';
|
115 |
+
if ( $filerec->action == 'other' ) $echo_str .= "\n\t\t\t\t\t\t".'<span>Other action not related to file</span>';
|
116 |
+
elseif ( $filerec->action == 'datasubmit' ) $echo_str .= "\n\t\t\t\t\t\t".'<span>Submission of data without file</span>';
|
117 |
+
elseif ( in_array($filerec->linkedto, $deletedfiles) || in_array($filerec->idlog, $deletedfiles) ) $echo_str .= "\n\t\t\t\t\t\t".'<span>'.$filerec->filepath.'</span>';
|
118 |
+
else {
|
119 |
+
//find newest linked record
|
120 |
+
$newestidlog = $filerec->idlog;
|
121 |
+
$newestind = $ind;
|
122 |
+
$parind = $ind;
|
123 |
+
while ( $parind >= 0 && $filerecs[$newestind]->date_to != "0000-00-00 00:00:00" ) {
|
124 |
+
if ( isset($filerecs[$parind]->linkedto) && $filerecs[$parind]->linkedto == $newestidlog ) {
|
125 |
+
$newestind = $parind;
|
126 |
+
$newestidlog = $filerecs[$parind]->idlog;
|
127 |
+
}
|
128 |
+
$parind --;
|
129 |
+
}
|
130 |
+
//find oldest linked record
|
131 |
+
$oldestidlog = $filerec->idlog;
|
132 |
+
$oldestind = $ind;
|
133 |
+
$parind = $ind;
|
134 |
+
while ( $parind < $filerecs_count && isset($filerecs[$oldestind]->linkedto) ) {
|
135 |
+
if ( $filerecs[$parind]->idlog == $filerecs[$oldestind]->linkedto ) {
|
136 |
+
$oldestind = $parind;
|
137 |
+
$oldestidlog = $filerecs[$parind]->idlog;
|
138 |
+
}
|
139 |
+
$parind ++;
|
140 |
+
}
|
141 |
+
$lid = $oldestidlog;
|
142 |
+
//make the file linkable only if the record is still valid, the
|
143 |
+
//filename has not changed (due to a rename action) and the file
|
144 |
+
//exists
|
145 |
+
if ( $filerecs[$newestind]->date_to == "0000-00-00 00:00:00" && $filerec->filepath == $filerecs[$newestind]->filepath && file_exists(wfu_path_rel2abs($filerec->filepath)) ) {
|
146 |
+
if ( !isset($filecodes[$lid]) ) $filecodes[$lid] = wfu_safe_store_filepath($filerec->filepath);
|
147 |
+
$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=file_details&file='.$filecodes[$lid].'&invoker='.$logpagecode.'" title="View and edit file details" style="font-weight:normal;">'.$filerec->filepath.'</a>';
|
148 |
+
}
|
149 |
+
else $echo_str .= "\n\t\t\t\t\t\t".'<span>'.$filerec->filepath.'</span>';
|
150 |
+
}
|
151 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<button type="button" class="toggle-row"><span class="screen-reader-text">Show more details</span></button>';
|
152 |
+
$echo_str .= "\n\t\t\t\t\t".'</td>';
|
153 |
+
$echo_str .= "\n\t\t\t\t\t".'<td data-colname="Action">'.( $filerec->action != 'other' && $filerec->action != 'datasubmit' ? $filerec->action : '' ).'</td>';
|
154 |
+
$echo_str .= "\n\t\t\t\t\t".'<td data-colname="Date">'.get_date_from_gmt($filerec->date_from).'</td>';
|
155 |
+
$echo_str .= "\n\t\t\t\t\t".'<td data-colname="User">'.wfu_get_username_by_id($filerec->userid).'</td>';
|
156 |
+
$echo_str .= "\n\t\t\t\t\t".'<td data-colname="Remarks">';
|
157 |
+
$echo_str .= $remarks;
|
158 |
+
$echo_str .= "\n\t\t\t\t\t".'</td>';
|
159 |
+
$echo_str .= "\n\t\t\t\t".'</tr>';
|
160 |
+
}
|
161 |
+
if ( !$only_table_rows ) {
|
162 |
+
$echo_str .= "\n\t\t\t".'</tbody>';
|
163 |
+
$echo_str .= "\n\t\t".'</table>';
|
164 |
+
$echo_str .= "\n\t".'</div>';
|
165 |
+
$echo_str .= "\n\t".'</div>';
|
166 |
+
$echo_str .= "\n".'</div>';
|
167 |
+
}
|
168 |
+
if ( $located_rec > 0 ) {
|
169 |
+
$handler = 'function() { wfu_focus_table_on_highlighted_file("wfu_historylog_table"); }';
|
170 |
+
$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>';
|
171 |
+
}
|
172 |
+
|
173 |
+
return $echo_str;
|
174 |
+
}
|
175 |
+
|
176 |
+
?>
|
lib/wfu_admin_maintenance.php
CHANGED
@@ -1,409 +1,409 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
function wfu_maintenance_actions($message = '') {
|
4 |
-
if ( !current_user_can( 'manage_options' ) ) return wfu_manage_mainmenu();
|
5 |
-
|
6 |
-
$siteurl = site_url();
|
7 |
-
|
8 |
-
$echo_str = '<div class="wrap">';
|
9 |
-
$echo_str .= "\n\t".'<h2>Wordpress File Upload Control Panel</h2>';
|
10 |
-
if ( $message != '' ) {
|
11 |
-
$echo_str .= "\n\t".'<div class="updated">';
|
12 |
-
$echo_str .= "\n\t\t".'<p>'.$message.'</p>';
|
13 |
-
$echo_str .= "\n\t".'</div>';
|
14 |
-
}
|
15 |
-
$echo_str .= "\n\t".'<div style="margin-top:20px;">';
|
16 |
-
$echo_str .= wfu_generate_dashboard_menu("\n\t\t", "Maintenance Actions");
|
17 |
-
//maintenance actions
|
18 |
-
$echo_str .= "\n\t\t".'<h3 style="margin-bottom: 10px;">Maintenance Actions</h3>';
|
19 |
-
$echo_str .= "\n\t\t".'<table class="form-table">';
|
20 |
-
$echo_str .= "\n\t\t\t".'<tbody>';
|
21 |
-
$echo_str .= "\n\t\t\t\t".'<tr>';
|
22 |
-
$echo_str .= "\n\t\t\t\t\t".'<th scope="row">';
|
23 |
-
$wfu_maintenance_nonce = wp_create_nonce("wfu_maintenance_actions");
|
24 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=sync_db&nonce='.$wfu_maintenance_nonce.'" class="button" title="Update database to reflect current status of files">Sync Database</a>';
|
25 |
-
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
26 |
-
$echo_str .= "\n\t\t\t\t\t".'<td>';
|
27 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<label>Update database to reflect current status of files.</label>';
|
28 |
-
$echo_str .= "\n\t\t\t\t\t".'</td>';
|
29 |
-
$echo_str .= "\n\t\t\t\t".'</tr>';
|
30 |
-
$echo_str .= "\n\t\t\t\t".'<tr>';
|
31 |
-
$echo_str .= "\n\t\t\t\t\t".'<th scope="row">';
|
32 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<a href="" class="button" title="Clean database log" onclick="wfu_cleanlog_selector_toggle(true); return false;">Clean Log</a>';
|
33 |
-
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
34 |
-
$echo_str .= "\n\t\t\t\t\t".'<td>';
|
35 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<label>Clean-up database log, either all or of specific period, including file information, user data and optionally the files.</label>';
|
36 |
-
$echo_str .= "\n\t\t\t\t\t".'</td>';
|
37 |
-
$echo_str .= "\n\t\t\t\t".'</tr>';
|
38 |
-
$echo_str .= "\n\t\t\t\t".'<tr class="wfu_cleanlog_tr">';
|
39 |
-
$echo_str .= "\n\t\t\t\t\t".'<th scope="row"></th>';
|
40 |
-
$echo_str .= "\n\t\t\t\t\t".'<td>';
|
41 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<div>';
|
42 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<label>Select Clean-Up Period</label>';
|
43 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<select id="wfu_cleanlog_period" onchange="wfu_cleanlog_period_changed();">';
|
44 |
-
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<option value="older_than_date">Clean-up log older than date</option>';
|
45 |
-
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<option value="older_than_period">Clean-up log older than period</option>';
|
46 |
-
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<option value="between_dates">Clean-up log between dates</option>';
|
47 |
-
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<option value="all">Clean-up all log</option>';
|
48 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'</select>';
|
49 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<div class="wfu_selectdate_container">';
|
50 |
-
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<label>Select date</label>';
|
51 |
-
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<input id="wfu_cleanlog_dateold" type="text" />';
|
52 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'</div>';
|
53 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<div class="wfu_selectperiod_container">';
|
54 |
-
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<label>Select period</label>';
|
55 |
-
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<input id="wfu_cleanlog_periodold" type="number" min="1" />';
|
56 |
-
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<select id="wfu_cleanlog_periodtype">';
|
57 |
-
$echo_str .= "\n\t\t\t\t\t\t\t\t\t".'<option value="days">days</option>';
|
58 |
-
$echo_str .= "\n\t\t\t\t\t\t\t\t\t".'<option value="months">months</option>';
|
59 |
-
$echo_str .= "\n\t\t\t\t\t\t\t\t\t".'<option value="years">years</option>';
|
60 |
-
$echo_str .= "\n\t\t\t\t\t\t\t\t".'</select>';
|
61 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'</div>';
|
62 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<div class="wfu_selectdates_container">';
|
63 |
-
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<label>Select period from</label>';
|
64 |
-
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<input id="wfu_cleanlog_datefrom" type="text" />';
|
65 |
-
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<label>back to</label>';
|
66 |
-
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<input id="wfu_cleanlog_dateto" type="text" />';
|
67 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'</div>';
|
68 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<div class="wfu_includefiles_container">';
|
69 |
-
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<label for="wfu_includefiles">Clean-up also affected files</label>';
|
70 |
-
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<input id="wfu_includefiles" type="checkbox" />';
|
71 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'</div>';
|
72 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<div class="wfu_buttons_container">';
|
73 |
-
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<a href="" class="button" title="Close" onclick="wfu_cleanlog_selector_toggle(false); return false;">Close</a>';
|
74 |
-
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<a href="" class="button wfu_cleanlog_proceed" title="Proceed to log clean-up" onclick="if (wfu_cleanlog_selector_checkproceed()) return true; else return false; ">Proceed</a>';
|
75 |
-
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<span class="wfu_cleanlog_error hidden">Error</span>';
|
76 |
-
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<input id="wfu_cleanlog_href" type="hidden" value="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=clean_log_ask&nonce='.$wfu_maintenance_nonce.'" />';
|
77 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'</div>';
|
78 |
-
$echo_str .= "\n\t\t\t\t\t\t".'</div>';
|
79 |
-
$echo_str .= "\n\t\t\t\t\t".'</td>';
|
80 |
-
$echo_str .= "\n\t\t\t\t".'</tr>';
|
81 |
-
$echo_str .= "\n\t\t\t\t".'<tr>';
|
82 |
-
$echo_str .= "\n\t\t\t\t\t".'<th scope="row">';
|
83 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=purge_data_ask&nonce='.$wfu_maintenance_nonce.'" class="button" title="Remove all plugin data from website" style="color:red;">Purge All Data</a>';
|
84 |
-
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
85 |
-
$echo_str .= "\n\t\t\t\t\t".'<td>';
|
86 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<label>Purge all plugin options and tables from database, as well as any session data. The plugin will be deactivated after this action.</label>';
|
87 |
-
$echo_str .= "\n\t\t\t\t\t".'</td>';
|
88 |
-
$echo_str .= "\n\t\t\t\t".'</tr>';
|
89 |
-
$echo_str .= "\n\t\t\t".'</tbody>';
|
90 |
-
$echo_str .= "\n\t\t".'</table>';
|
91 |
-
$echo_str .= "\n\t".'</div>';
|
92 |
-
//export actions
|
93 |
-
$echo_str .= "\n\t".'<div style="margin-top:20px;">';
|
94 |
-
$echo_str .= "\n\t\t".'<h3 style="margin-bottom: 10px;">Export Actions</h3>';
|
95 |
-
$echo_str .= "\n\t\t".'<table class="form-table">';
|
96 |
-
$echo_str .= "\n\t\t\t".'<tbody>';
|
97 |
-
$echo_str .= "\n\t\t\t\t".'<tr>';
|
98 |
-
$echo_str .= "\n\t\t\t\t\t".'<th scope="row">';
|
99 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<a href="javascript:wfu_download_file(\'exportdata\', 1);" class="button" title="Export uploaded file data">Export Uploaded File Data</a>';
|
100 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<input id="wfu_download_file_nonce" type="hidden" value="'.wp_create_nonce('wfu_download_file_invoker').'" />';
|
101 |
-
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
102 |
-
$echo_str .= "\n\t\t\t\t\t".'<td>';
|
103 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<label>Export uploaded valid file data, together with any userdata fields, to a comma-separated text file.</label>';
|
104 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<div id="wfu_file_download_container_1" style="display: none;"></div>';
|
105 |
-
$echo_str .= "\n\t\t\t\t\t".'</td>';
|
106 |
-
$echo_str .= "\n\t\t\t\t".'</tr>';
|
107 |
-
$echo_str .= "\n\t\t\t".'</tbody>';
|
108 |
-
$echo_str .= "\n\t\t".'</table>';
|
109 |
-
$echo_str .= "\n\t".'</div>';
|
110 |
-
$handler = 'function() { wfu_cleanlog_initialize_elements(); }';
|
111 |
-
$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>';
|
112 |
-
$echo_str .= "\n".'</div>';
|
113 |
-
|
114 |
-
echo $echo_str;
|
115 |
-
}
|
116 |
-
|
117 |
-
function wfu_sync_database_controller($nonce) {
|
118 |
-
if ( !current_user_can( 'manage_options' ) ) return -1;
|
119 |
-
if ( !wp_verify_nonce($nonce, 'wfu_maintenance_actions') ) return -1;
|
120 |
-
|
121 |
-
return wfu_sync_database();
|
122 |
-
}
|
123 |
-
|
124 |
-
function wfu_clean_log_parse_data($data) {
|
125 |
-
$ret = array( "result" => true );
|
126 |
-
$data = sanitize_text_field($data);
|
127 |
-
$data_array = explode(":", $data);
|
128 |
-
if ( count($data_array) == 0 ) $ret["result"] = false;
|
129 |
-
elseif ( $data_array[0] == "00" || $data_array[0] == "01" ) {
|
130 |
-
$ret["code"] = "0";
|
131 |
-
$ret["include_files"] = ( substr($data_array[0], 1, 1) == "1" );
|
132 |
-
if ( count($data_array) != 2 || strlen($data_array[1]) != 8 ) $ret["result"] = false;
|
133 |
-
else {
|
134 |
-
$ret["dateold"] = strtotime(substr($data_array[1], 0, 4)."-".substr($data_array[1], 4, 2)."-".substr($data_array[1], 6, 2)." 00:00");
|
135 |
-
if ( $ret["dateold"] > time() ) $ret["result"] = false;
|
136 |
-
}
|
137 |
-
}
|
138 |
-
elseif ( $data_array[0] == "10" || $data_array[0] == "11" ) {
|
139 |
-
$ret["code"] = "1";
|
140 |
-
$ret["include_files"] = ( substr($data_array[0], 1, 1) == "1" );
|
141 |
-
if ( count($data_array) != 3 ) $ret["result"] = false;
|
142 |
-
else {
|
143 |
-
$ret["periodold"] = (int)$data_array[1];
|
144 |
-
if ( $ret["periodold"] <= 0 ) $ret["result"] = false;
|
145 |
-
elseif ( $data_array[2] == 'd' ) $ret["periodtype"] = 'days';
|
146 |
-
elseif ( $data_array[2] == 'm' ) $ret["periodtype"] = 'months';
|
147 |
-
elseif ( $data_array[2] == 'y' ) $ret["periodtype"] = 'years';
|
148 |
-
else $ret["result"] = false;
|
149 |
-
}
|
150 |
-
}
|
151 |
-
elseif ( $data_array[0] == "20" || $data_array[0] == "21" ) {
|
152 |
-
$ret["code"] = "2";
|
153 |
-
$ret["include_files"] = ( substr($data_array[0], 1, 1) == "1" );
|
154 |
-
if ( count($data_array) != 3 || strlen($data_array[1]) != 8 || strlen($data_array[2]) != 8 ) $ret["result"] = false;
|
155 |
-
$ret["datefrom"] = strtotime(substr($data_array[1], 0, 4)."-".substr($data_array[1], 4, 2)."-".substr($data_array[1], 6, 2)." 00:00");
|
156 |
-
if ( $ret["datefrom"] > time() ) $ret["result"] = false;
|
157 |
-
else {
|
158 |
-
$ret["dateto"] = strtotime(substr($data_array[2], 0, 4)."-".substr($data_array[2], 4, 2)."-".substr($data_array[2], 6, 2)." 00:00");
|
159 |
-
if ( $ret["dateto"] > $ret["datefrom"] ) $ret["result"] = false;
|
160 |
-
}
|
161 |
-
}
|
162 |
-
elseif ( $data_array[0] == "30" || $data_array[0] == "31" ) {
|
163 |
-
$ret["code"] = "3";
|
164 |
-
$ret["include_files"] = ( substr($data_array[0], 1, 1) == "1" );
|
165 |
-
if ( count($data_array) != 1 ) $ret["result"] = false;
|
166 |
-
}
|
167 |
-
else $ret["result"] = false;
|
168 |
-
|
169 |
-
return $ret;
|
170 |
-
}
|
171 |
-
|
172 |
-
function wfu_clean_log_where_query($data) {
|
173 |
-
$query = "";
|
174 |
-
if ( $data["code"] == "0" ) $query = " WHERE date_from < '".date('Y-m-d H:i:s', $data["dateold"])."'";
|
175 |
-
elseif ( $data["code"] == "1" ) {
|
176 |
-
$date = strtotime(date('Y-m-d', strtotime('-'.$data["periodold"].' '.$data["periodtype"]))." 00:00");
|
177 |
-
$query = " WHERE date_from < '".date('Y-m-d H:i:s', $date)."'";
|
178 |
-
}
|
179 |
-
elseif ( $data["code"] == "2" ) $query = " WHERE date_from < '".date('Y-m-d H:i:s', $data["datefrom"] + 86400)."' AND date_from >= '".date('Y-m-d H:i:s', $data["dateto"])."'";
|
180 |
-
|
181 |
-
return $query;
|
182 |
-
}
|
183 |
-
|
184 |
-
function wfu_clean_log_prompt($nonce, $data_enc) {
|
185 |
-
global $wpdb;
|
186 |
-
$table_name1 = $wpdb->prefix . "wfu_log";
|
187 |
-
$siteurl = site_url();
|
188 |
-
|
189 |
-
if ( !current_user_can( 'manage_options' ) || !wp_verify_nonce($nonce, 'wfu_maintenance_actions') ) return wfu_maintenance_actions();
|
190 |
-
//parse data
|
191 |
-
$data = wfu_clean_log_parse_data($data_enc);
|
192 |
-
if ( $data["result"] == false ) return wfu_maintenance_actions();
|
193 |
-
|
194 |
-
$echo_str = "\n".'<div class="wrap">';
|
195 |
-
$echo_str .= "\n\t".'<div style="margin-top:20px;">';
|
196 |
-
$echo_str .= "\n\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=maintenance_actions" class="button" title="go back">Go back</a>';
|
197 |
-
$echo_str .= "\n\t".'</div>';
|
198 |
-
$echo_str .= "\n\t".'<h2 style="margin-bottom: 10px;">Clean Database Log</h2>';
|
199 |
-
$echo_str .= "\n\t".'<form enctype="multipart/form-data" name="clean_log" id="clean_log" method="post" action="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload" class="validate">';
|
200 |
-
$nonce = wp_nonce_field('wfu_clean_log', '_wpnonce', false, false);
|
201 |
-
$nonce_ref = wp_referer_field(false);
|
202 |
-
$echo_str .= "\n\t\t".$nonce;
|
203 |
-
$echo_str .= "\n\t\t".$nonce_ref;
|
204 |
-
$echo_str .= "\n\t\t".'<input type="hidden" name="action" value="clean_log">';
|
205 |
-
$echo_str .= "\n\t\t".'<input type="hidden" name="data" value="'.$data_enc.'">';
|
206 |
-
if ( $data["include_files"] ) {
|
207 |
-
if ( $data["code"] == "0" )
|
208 |
-
$echo_str .= "\n\t\t".'<label>This will erase all files uploaded <strong>before '.date("Y-m-d", $data["dateold"]).'</strong> together with associated records kept by the plugin in the database (like file metadata and userdata).</label><br/>';
|
209 |
-
elseif ( $data["code"] == "1" )
|
210 |
-
$echo_str .= "\n\t\t".'<label>This will erase all files uploaded <strong>'.$data["periodold"].' '.$data["periodtype"].' ago or older</strong> together with associated records kept by the plugin in the database (like file metadata and userdata).</label><br/>';
|
211 |
-
elseif ( $data["code"] == "2" )
|
212 |
-
$echo_str .= "\n\t\t".'<label>This will erase all files uploaded <strong>between '.date("Y-m-d", $data["datefrom"]).' and '.date("Y-m-d", $data["dateto"]).'</strong> together with associated records kept by the plugin in the database (like file metadata and userdata).</label><br/>';
|
213 |
-
else
|
214 |
-
$echo_str .= "\n\t\t".'<label>This will erase <strong>ALL</strong> files and associated records kept by the plugin in the database (like file metadata and userdata).</label><br/>';
|
215 |
-
$affected_recs = $wpdb->get_results("SELECT * FROM $table_name1".wfu_clean_log_where_query($data));
|
216 |
-
$affected_files = wfu_get_valid_affected_files($affected_recs);
|
217 |
-
$echo_str .= "\n\t\t".'<br/><div class="wfu_cleanlog_files">';
|
218 |
-
$echo_str .= "\n\t\t\t".'<div>';
|
219 |
-
$echo_str .= "\n\t\t\t\t".'<label style="vertical-align: middle;"><strong>'.count($affected_files).'</strong> files will be deleted</label>';
|
220 |
-
$echo_str .= "\n\t\t\t\t".'<button id="wfu_cleanlog_prompt_button" onclick="document.querySelector(\'.wfu_cleanlog_files\').classList.toggle(\'visible\');return false;" style="vertical-align: middle;"></button>';
|
221 |
-
$echo_str .= "\n\t\t\t".'</div>';
|
222 |
-
$echo_str .= "\n\t\t\t".'<div id="wfu_cleanlog_prompt_list" style="margin-top:10px;">';
|
223 |
-
$echo_str .= "\n\t\t\t\t".'<textarea readonly="readonly" style="width:250px; height:150px; overflow:scroll; white-space:pre; resize:both;">';
|
224 |
-
foreach ( $affected_files as $file ) {
|
225 |
-
$echo_str .= $file."\n";
|
226 |
-
}
|
227 |
-
$echo_str .= "\n\t\t\t\t".'</textarea>';
|
228 |
-
$echo_str .= "\n\t\t\t".'</div>';
|
229 |
-
$echo_str .= "\n\t\t".'</div>';
|
230 |
-
$echo_str .= "\n\t\t".'<br/><label>Are you sure that you want to continue?</label><br/>';
|
231 |
-
$echo_str .= "\n\t\t".'<style>';
|
232 |
-
$echo_str .= "\n\t\t".'.wfu_cleanlog_files button:before { content: "Click to see affected files"; } ';
|
233 |
-
$echo_str .= "\n\t\t".'.wfu_cleanlog_files.visible button:before { content: "Close list"; } ';
|
234 |
-
$echo_str .= "\n\t\t".'.wfu_cleanlog_files #wfu_cleanlog_prompt_list { display: none; } ';
|
235 |
-
$echo_str .= "\n\t\t".'.wfu_cleanlog_files.visible #wfu_cleanlog_prompt_list { display: block; } ';
|
236 |
-
$echo_str .= "\n\t\t".'</style>';
|
237 |
-
}
|
238 |
-
else {
|
239 |
-
if ( $data["code"] == "0" )
|
240 |
-
$echo_str .= "\n\t\t".'<label>This will erase all records <strong>before '.date("Y-m-d", $data["dateold"]).'</strong> kept by the plugin in the database (like file metadata and userdata, however files uploaded by the plugin will be maintained). Are you sure that you want to continue?</label><br/>';
|
241 |
-
elseif ( $data["code"] == "1" )
|
242 |
-
$echo_str .= "\n\t\t".'<label>This will erase all records <strong>older than '.$data["periodold"].' '.$data["periodtype"].'</strong> kept by the plugin in the database (like file metadata and userdata, however files uploaded by the plugin will be maintained). Are you sure that you want to continue?</label><br/>';
|
243 |
-
elseif ( $data["code"] == "2" )
|
244 |
-
$echo_str .= "\n\t\t".'<label>This will erase all records <strong>between '.date("Y-m-d", $data["datefrom"]).' and '.date("Y-m-d", $data["dateto"]).'</strong> kept by the plugin in the database (like file metadata and userdata, however files uploaded by the plugin will be maintained). Are you sure that you want to continue?</label><br/>';
|
245 |
-
else
|
246 |
-
$echo_str .= "\n\t\t".'<label>This will erase <strong>ALL</strong> records kept by the plugin in the database (like file metadata and userdata, however files uploaded by the plugin will be maintained). Are you sure that you want to continue?</label><br/>';
|
247 |
-
}
|
248 |
-
$echo_str .= "\n\t\t".'<p class="submit">';
|
249 |
-
$echo_str .= "\n\t\t\t".'<input type="submit" class="button-primary" name="submit" value="Yes">';
|
250 |
-
$echo_str .= "\n\t\t\t".'<input type="submit" class="button-primary" name="submit" value="Cancel">';
|
251 |
-
$echo_str .= "\n\t\t".'</p>';
|
252 |
-
$echo_str .= "\n\t".'</form>';
|
253 |
-
$echo_str .= "\n".'</div>';
|
254 |
-
return $echo_str;
|
255 |
-
}
|
256 |
-
|
257 |
-
function wfu_clean_log() {
|
258 |
-
$a = func_get_args(); $a = WFU_FUNCTION_HOOK(__FUNCTION__, $a, $out); if (isset($out['vars'])) foreach($out['vars'] as $p => $v) $$p = $v; switch($a) { case 'R': return $out['output']; break; case 'D': die($out['output']); }
|
259 |
-
global $wpdb;
|
260 |
-
|
261 |
-
if ( !current_user_can( 'manage_options' ) ) return array( "recs_count" => -1, "files_count" => -1 );
|
262 |
-
if ( !check_admin_referer('wfu_clean_log') ) return array( "recs_count" => -1, "files_count" => -1 );
|
263 |
-
|
264 |
-
$recs_count = 0;
|
265 |
-
if ( isset($_POST['data']) && isset($_POST['submit']) && $_POST['submit'] == "Yes" ) {
|
266 |
-
$data = wfu_clean_log_parse_data($_POST['data']);
|
267 |
-
if ( $data["result"] ) {
|
268 |
-
$table_name1 = $wpdb->prefix . "wfu_log";
|
269 |
-
$table_name2 = $wpdb->prefix . "wfu_userdata";
|
270 |
-
//$table_name3 = $wpdb->prefix . "wfu_dbxqueue";
|
271 |
-
|
272 |
-
$affected_files = array();
|
273 |
-
if ( $data["include_files"] ) {
|
274 |
-
$affected_recs = $wpdb->get_results("SELECT * FROM $table_name1".wfu_clean_log_where_query($data));
|
275 |
-
$affected_files = wfu_get_valid_affected_files($affected_recs);
|
276 |
-
}
|
277 |
-
$query1 = "DELETE FROM $table_name1";
|
278 |
-
$query2 = "DELETE FROM $table_name2";
|
279 |
-
//$query3 = "DELETE FROM $table_name3";
|
280 |
-
if ( $data["code"] == "0" ) {
|
281 |
-
$query1 .= " WHERE date_from < '".date('Y-m-d H:i:s', $data["dateold"])."'";
|
282 |
-
$query2 .= " WHERE date_from < '".date('Y-m-d H:i:s', $data["dateold"])."'";
|
283 |
-
}
|
284 |
-
elseif ( $data["code"] == "1" ) {
|
285 |
-
$date = strtotime(date('Y-m-d', strtotime('-'.$data["periodold"].' '.$data["periodtype"]))." 00:00");
|
286 |
-
$query1 .= " WHERE date_from < '".date('Y-m-d H:i:s', $date)."'";
|
287 |
-
$query2 .= " WHERE date_from < '".date('Y-m-d H:i:s', $date)."'";
|
288 |
-
}
|
289 |
-
elseif ( $data["code"] == "2" ) {
|
290 |
-
$query1 .= " WHERE date_from < '".date('Y-m-d H:i:s', $data["datefrom"] + 86400)."' AND date_from >= '".date('Y-m-d H:i:s', $data["dateto"])."'";
|
291 |
-
$query2 .= " WHERE date_from < '".date('Y-m-d H:i:s', $data["datefrom"] + 86400)."' AND date_from >= '".date('Y-m-d H:i:s', $data["dateto"])."'";
|
292 |
-
}
|
293 |
-
$recs_count = $wpdb->query($query1);
|
294 |
-
$recs_count += $wpdb->query($query2);
|
295 |
-
//$recs_count += $wpdb->query($query3);
|
296 |
-
|
297 |
-
//delete affected files
|
298 |
-
$files_count = 0;
|
299 |
-
foreach( $affected_files as $file ) {
|
300 |
-
unlink($file);
|
301 |
-
if ( !file_exists($file) ) $files_count ++;
|
302 |
-
}
|
303 |
-
}
|
304 |
-
}
|
305 |
-
|
306 |
-
return array( "recs_count" => $recs_count, "files_count" => $files_count );
|
307 |
-
}
|
308 |
-
|
309 |
-
function wfu_purge_data_prompt($nonce) {
|
310 |
-
$siteurl = site_url();
|
311 |
-
|
312 |
-
if ( !current_user_can( 'manage_options' ) || !wp_verify_nonce($nonce, 'wfu_maintenance_actions') ) return wfu_maintenance_actions();
|
313 |
-
|
314 |
-
$echo_str = "\n".'<div class="wrap">';
|
315 |
-
$echo_str .= "\n\t".'<div style="margin-top:20px;">';
|
316 |
-
$echo_str .= "\n\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=maintenance_actions" class="button" title="go back">Go back</a>';
|
317 |
-
$echo_str .= "\n\t".'</div>';
|
318 |
-
$echo_str .= "\n\t".'<h2 style="margin-bottom: 10px;">Purge All Data</h2>';
|
319 |
-
$echo_str .= "\n\t".'<form enctype="multipart/form-data" name="purge_data" id="purge_data" method="post" action="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload" class="validate">';
|
320 |
-
$nonce = wp_nonce_field('wfu_purge_data', '_wpnonce', false, false);
|
321 |
-
$nonce_ref = wp_referer_field(false);
|
322 |
-
$echo_str .= "\n\t\t".$nonce;
|
323 |
-
$echo_str .= "\n\t\t".$nonce_ref;
|
324 |
-
$echo_str .= "\n\t\t".'<input type="hidden" name="action" value="purge_data">';
|
325 |
-
$echo_str .= "\n\t\t".'<label>This action will remove all plugin options and records from database, data stored in session and will dectivate the plugin. Use it only if you want to entirely remove the plugin from the website.</label><br/>';
|
326 |
-
$echo_str .= "\n\t\t".'<br/><label>Are you sure you want to continue?</label><br/>';
|
327 |
-
$echo_str .= "\n\t\t".'<p class="submit">';
|
328 |
-
$echo_str .= "\n\t\t\t".'<input type="submit" class="button-primary" name="submit" value="Yes">';
|
329 |
-
$echo_str .= "\n\t\t\t".'<input type="submit" class="button-primary" name="submit" value="Cancel">';
|
330 |
-
$echo_str .= "\n\t\t".'</p>';
|
331 |
-
$echo_str .= "\n\t".'</form>';
|
332 |
-
$echo_str .= "\n".'</div>';
|
333 |
-
return $echo_str;
|
334 |
-
}
|
335 |
-
|
336 |
-
function wfu_purge_data() {
|
337 |
-
$a = func_get_args(); $a = WFU_FUNCTION_HOOK(__FUNCTION__, $a, $out); if (isset($out['vars'])) foreach($out['vars'] as $p => $v) $$p = $v; switch($a) { case 'R': return $out['output']; break; case 'D': die($out['output']); }
|
338 |
-
global $wpdb;
|
339 |
-
|
340 |
-
if ( !current_user_can( 'manage_options' ) ) return;
|
341 |
-
if ( !check_admin_referer('wfu_purge_data') ) return;
|
342 |
-
|
343 |
-
if ( isset($_POST['submit']) && $_POST['submit'] == "Yes" ) {
|
344 |
-
$all_options = array_keys(wp_load_alloptions());
|
345 |
-
$all_session = array_keys($_SESSION);
|
346 |
-
$wfu_options = wfu_get_all_plugin_options();
|
347 |
-
//first delete relevant db options
|
348 |
-
foreach ( $all_options as $opt1 )
|
349 |
-
foreach ( $wfu_options as $opt2 )
|
350 |
-
if ( $opt2[2] && $opt2[1] == "db" ) {
|
351 |
-
if (( substr($opt2[0], 0, 1) != "*" && substr($opt2[0], -1) != "*" && $opt1 == $opt2[0] ) ||
|
352 |
-
( substr($opt2[0], 0, 1) != "*" && substr($opt2[0], -1) == "*" && substr($opt1, 0, strlen($opt2[0])) == substr($opt2[0], 0, -1) ) ||
|
353 |
-
( substr($opt2[0], 0, 1) == "*" && substr($opt2[0], -1) != "*" && substr($opt1, -strlen($opt2[0])) == substr($opt2[0], 1) ) ||
|
354 |
-
( substr($opt2[0], 0, 1) == "*" && substr($opt2[0], -1) == "*" && strpos($opt1, substr($opt2[0], 1, -1)) !== false ))
|
355 |
-
delete_option($opt1);
|
356 |
-
}
|
357 |
-
//then delete relevant session data
|
358 |
-
foreach ( $all_session as $opt1 )
|
359 |
-
foreach ( $wfu_options as $opt2 )
|
360 |
-
if ( $opt2[2] && $opt2[1] == "session" ) {
|
361 |
-
if (( substr($opt2[0], 0, 1) != "*" && substr($opt2[0], -1) != "*" && $opt1 == $opt2[0] ) ||
|
362 |
-
( substr($opt2[0], 0, 1) != "*" && substr($opt2[0], -1) == "*" && substr($opt1, 0, strlen($opt2[0])) == substr($opt2[0], 0, -1) ) ||
|
363 |
-
( substr($opt2[0], 0, 1) == "*" && substr($opt2[0], -1) != "*" && substr($opt1, -strlen($opt2[0])) == substr($opt2[0], 1) ) ||
|
364 |
-
( substr($opt2[0], 0, 1) == "*" && substr($opt2[0], -1) == "*" && strpos($opt1, substr($opt2[0], 1, -1)) !== false ))
|
365 |
-
unset($_SESSION[$opt1]);
|
366 |
-
}
|
367 |
-
//then delete relevant tables
|
368 |
-
$wpdb->query( "DROP TABLE IF EXISTS ".$wpdb->prefix."wfu_log" );
|
369 |
-
$wpdb->query( "DROP TABLE IF EXISTS ".$wpdb->prefix."wfu_userdata" );
|
370 |
-
$wpdb->query( "DROP TABLE IF EXISTS ".$wpdb->prefix."wfu_dbxqueue" );
|
371 |
-
//then deactivate the plugin
|
372 |
-
deactivate_plugins( plugin_basename( WPFILEUPLOAD_PLUGINFILE ) );
|
373 |
-
}
|
374 |
-
else return;
|
375 |
-
|
376 |
-
return true;
|
377 |
-
}
|
378 |
-
|
379 |
-
|
380 |
-
function wfu_process_all_transfers($clearfiles = false) {
|
381 |
-
$a = func_get_args(); $a = WFU_FUNCTION_HOOK(__FUNCTION__, $a, $out); if (isset($out['vars'])) foreach($out['vars'] as $p => $v) $$p = $v; switch($a) { case 'R': return $out['output']; break; case 'D': die($out['output']); }
|
382 |
-
global $wpdb;
|
383 |
-
if ( $clearfiles ) {
|
384 |
-
$table_name1 = $wpdb->prefix . "wfu_log";
|
385 |
-
$table_name3 = $wpdb->prefix . "wfu_dbxqueue";
|
386 |
-
$wpdb->query('DELETE FROM '.$table_name3);
|
387 |
-
}
|
388 |
-
wfu_schedule_transfermanager(true);
|
389 |
-
}
|
390 |
-
|
391 |
-
function wfu_reset_all_transfers_controller($nonce) {
|
392 |
-
if ( !current_user_can( 'manage_options' ) ) return false;
|
393 |
-
if ( !wp_verify_nonce($nonce, 'wfu_maintenance_actions') ) return false;
|
394 |
-
|
395 |
-
wfu_process_all_transfers();
|
396 |
-
|
397 |
-
return true;
|
398 |
-
}
|
399 |
-
|
400 |
-
function wfu_clear_all_transfers_controller($nonce) {
|
401 |
-
if ( !current_user_can( 'manage_options' ) ) return false;
|
402 |
-
if ( !wp_verify_nonce($nonce, 'wfu_maintenance_actions') ) return false;
|
403 |
-
|
404 |
-
wfu_process_all_transfers(true);
|
405 |
-
|
406 |
-
return true;
|
407 |
-
}
|
408 |
-
|
409 |
?>
|
1 |
+
<?php
|
2 |
+
|
3 |
+
function wfu_maintenance_actions($message = '') {
|
4 |
+
if ( !current_user_can( 'manage_options' ) ) return wfu_manage_mainmenu();
|
5 |
+
|
6 |
+
$siteurl = site_url();
|
7 |
+
|
8 |
+
$echo_str = '<div class="wrap">';
|
9 |
+
$echo_str .= "\n\t".'<h2>Wordpress File Upload Control Panel</h2>';
|
10 |
+
if ( $message != '' ) {
|
11 |
+
$echo_str .= "\n\t".'<div class="updated">';
|
12 |
+
$echo_str .= "\n\t\t".'<p>'.$message.'</p>';
|
13 |
+
$echo_str .= "\n\t".'</div>';
|
14 |
+
}
|
15 |
+
$echo_str .= "\n\t".'<div style="margin-top:20px;">';
|
16 |
+
$echo_str .= wfu_generate_dashboard_menu("\n\t\t", "Maintenance Actions");
|
17 |
+
//maintenance actions
|
18 |
+
$echo_str .= "\n\t\t".'<h3 style="margin-bottom: 10px;">Maintenance Actions</h3>';
|
19 |
+
$echo_str .= "\n\t\t".'<table class="form-table">';
|
20 |
+
$echo_str .= "\n\t\t\t".'<tbody>';
|
21 |
+
$echo_str .= "\n\t\t\t\t".'<tr>';
|
22 |
+
$echo_str .= "\n\t\t\t\t\t".'<th scope="row">';
|
23 |
+
$wfu_maintenance_nonce = wp_create_nonce("wfu_maintenance_actions");
|
24 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=sync_db&nonce='.$wfu_maintenance_nonce.'" class="button" title="Update database to reflect current status of files">Sync Database</a>';
|
25 |
+
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
26 |
+
$echo_str .= "\n\t\t\t\t\t".'<td>';
|
27 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<label>Update database to reflect current status of files.</label>';
|
28 |
+
$echo_str .= "\n\t\t\t\t\t".'</td>';
|
29 |
+
$echo_str .= "\n\t\t\t\t".'</tr>';
|
30 |
+
$echo_str .= "\n\t\t\t\t".'<tr>';
|
31 |
+
$echo_str .= "\n\t\t\t\t\t".'<th scope="row">';
|
32 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<a href="" class="button" title="Clean database log" onclick="wfu_cleanlog_selector_toggle(true); return false;">Clean Log</a>';
|
33 |
+
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
34 |
+
$echo_str .= "\n\t\t\t\t\t".'<td>';
|
35 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<label>Clean-up database log, either all or of specific period, including file information, user data and optionally the files.</label>';
|
36 |
+
$echo_str .= "\n\t\t\t\t\t".'</td>';
|
37 |
+
$echo_str .= "\n\t\t\t\t".'</tr>';
|
38 |
+
$echo_str .= "\n\t\t\t\t".'<tr class="wfu_cleanlog_tr">';
|
39 |
+
$echo_str .= "\n\t\t\t\t\t".'<th scope="row"></th>';
|
40 |
+
$echo_str .= "\n\t\t\t\t\t".'<td>';
|
41 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<div>';
|
42 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<label>Select Clean-Up Period</label>';
|
43 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<select id="wfu_cleanlog_period" onchange="wfu_cleanlog_period_changed();">';
|
44 |
+
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<option value="older_than_date">Clean-up log older than date</option>';
|
45 |
+
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<option value="older_than_period">Clean-up log older than period</option>';
|
46 |
+
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<option value="between_dates">Clean-up log between dates</option>';
|
47 |
+
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<option value="all">Clean-up all log</option>';
|
48 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'</select>';
|
49 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<div class="wfu_selectdate_container">';
|
50 |
+
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<label>Select date</label>';
|
51 |
+
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<input id="wfu_cleanlog_dateold" type="text" />';
|
52 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'</div>';
|
53 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<div class="wfu_selectperiod_container">';
|
54 |
+
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<label>Select period</label>';
|
55 |
+
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<input id="wfu_cleanlog_periodold" type="number" min="1" />';
|
56 |
+
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<select id="wfu_cleanlog_periodtype">';
|
57 |
+
$echo_str .= "\n\t\t\t\t\t\t\t\t\t".'<option value="days">days</option>';
|
58 |
+
$echo_str .= "\n\t\t\t\t\t\t\t\t\t".'<option value="months">months</option>';
|
59 |
+
$echo_str .= "\n\t\t\t\t\t\t\t\t\t".'<option value="years">years</option>';
|
60 |
+
$echo_str .= "\n\t\t\t\t\t\t\t\t".'</select>';
|
61 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'</div>';
|
62 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<div class="wfu_selectdates_container">';
|
63 |
+
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<label>Select period from</label>';
|
64 |
+
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<input id="wfu_cleanlog_datefrom" type="text" />';
|
65 |
+
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<label>back to</label>';
|
66 |
+
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<input id="wfu_cleanlog_dateto" type="text" />';
|
67 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'</div>';
|
68 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<div class="wfu_includefiles_container">';
|
69 |
+
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<label for="wfu_includefiles">Clean-up also affected files</label>';
|
70 |
+
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<input id="wfu_includefiles" type="checkbox" />';
|
71 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'</div>';
|
72 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<div class="wfu_buttons_container">';
|
73 |
+
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<a href="" class="button" title="Close" onclick="wfu_cleanlog_selector_toggle(false); return false;">Close</a>';
|
74 |
+
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<a href="" class="button wfu_cleanlog_proceed" title="Proceed to log clean-up" onclick="if (wfu_cleanlog_selector_checkproceed()) return true; else return false; ">Proceed</a>';
|
75 |
+
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<span class="wfu_cleanlog_error hidden">Error</span>';
|
76 |
+
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<input id="wfu_cleanlog_href" type="hidden" value="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=clean_log_ask&nonce='.$wfu_maintenance_nonce.'" />';
|
77 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'</div>';
|
78 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</div>';
|
79 |
+
$echo_str .= "\n\t\t\t\t\t".'</td>';
|
80 |
+
$echo_str .= "\n\t\t\t\t".'</tr>';
|
81 |
+
$echo_str .= "\n\t\t\t\t".'<tr>';
|
82 |
+
$echo_str .= "\n\t\t\t\t\t".'<th scope="row">';
|
83 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=purge_data_ask&nonce='.$wfu_maintenance_nonce.'" class="button" title="Remove all plugin data from website" style="color:red;">Purge All Data</a>';
|
84 |
+
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
85 |
+
$echo_str .= "\n\t\t\t\t\t".'<td>';
|
86 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<label>Purge all plugin options and tables from database, as well as any session data. The plugin will be deactivated after this action.</label>';
|
87 |
+
$echo_str .= "\n\t\t\t\t\t".'</td>';
|
88 |
+
$echo_str .= "\n\t\t\t\t".'</tr>';
|
89 |
+
$echo_str .= "\n\t\t\t".'</tbody>';
|
90 |
+
$echo_str .= "\n\t\t".'</table>';
|
91 |
+
$echo_str .= "\n\t".'</div>';
|
92 |
+
//export actions
|
93 |
+
$echo_str .= "\n\t".'<div style="margin-top:20px;">';
|
94 |
+
$echo_str .= "\n\t\t".'<h3 style="margin-bottom: 10px;">Export Actions</h3>';
|
95 |
+
$echo_str .= "\n\t\t".'<table class="form-table">';
|
96 |
+
$echo_str .= "\n\t\t\t".'<tbody>';
|
97 |
+
$echo_str .= "\n\t\t\t\t".'<tr>';
|
98 |
+
$echo_str .= "\n\t\t\t\t\t".'<th scope="row">';
|
99 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<a href="javascript:wfu_download_file(\'exportdata\', 1);" class="button" title="Export uploaded file data">Export Uploaded File Data</a>';
|
100 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<input id="wfu_download_file_nonce" type="hidden" value="'.wp_create_nonce('wfu_download_file_invoker').'" />';
|
101 |
+
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
102 |
+
$echo_str .= "\n\t\t\t\t\t".'<td>';
|
103 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<label>Export uploaded valid file data, together with any userdata fields, to a comma-separated text file.</label>';
|
104 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<div id="wfu_file_download_container_1" style="display: none;"></div>';
|
105 |
+
$echo_str .= "\n\t\t\t\t\t".'</td>';
|
106 |
+
$echo_str .= "\n\t\t\t\t".'</tr>';
|
107 |
+
$echo_str .= "\n\t\t\t".'</tbody>';
|
108 |
+
$echo_str .= "\n\t\t".'</table>';
|
109 |
+
$echo_str .= "\n\t".'</div>';
|
110 |
+
$handler = 'function() { wfu_cleanlog_initialize_elements(); }';
|
111 |
+
$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>';
|
112 |
+
$echo_str .= "\n".'</div>';
|
113 |
+
|
114 |
+
echo $echo_str;
|
115 |
+
}
|
116 |
+
|
117 |
+
function wfu_sync_database_controller($nonce) {
|
118 |
+
if ( !current_user_can( 'manage_options' ) ) return -1;
|
119 |
+
if ( !wp_verify_nonce($nonce, 'wfu_maintenance_actions') ) return -1;
|
120 |
+
|
121 |
+
return wfu_sync_database();
|
122 |
+
}
|
123 |
+
|
124 |
+
function wfu_clean_log_parse_data($data) {
|
125 |
+
$ret = array( "result" => true );
|
126 |
+
$data = sanitize_text_field($data);
|
127 |
+
$data_array = explode(":", $data);
|
128 |
+
if ( count($data_array) == 0 ) $ret["result"] = false;
|
129 |
+
elseif ( $data_array[0] == "00" || $data_array[0] == "01" ) {
|
130 |
+
$ret["code"] = "0";
|
131 |
+
$ret["include_files"] = ( substr($data_array[0], 1, 1) == "1" );
|
132 |
+
if ( count($data_array) != 2 || strlen($data_array[1]) != 8 ) $ret["result"] = false;
|
133 |
+
else {
|
134 |
+
$ret["dateold"] = strtotime(substr($data_array[1], 0, 4)."-".substr($data_array[1], 4, 2)."-".substr($data_array[1], 6, 2)." 00:00");
|
135 |
+
if ( $ret["dateold"] > time() ) $ret["result"] = false;
|
136 |
+
}
|
137 |
+
}
|
138 |
+
elseif ( $data_array[0] == "10" || $data_array[0] == "11" ) {
|
139 |
+
$ret["code"] = "1";
|
140 |
+
$ret["include_files"] = ( substr($data_array[0], 1, 1) == "1" );
|
141 |
+
if ( count($data_array) != 3 ) $ret["result"] = false;
|
142 |
+
else {
|
143 |
+
$ret["periodold"] = (int)$data_array[1];
|
144 |
+
if ( $ret["periodold"] <= 0 ) $ret["result"] = false;
|
145 |
+
elseif ( $data_array[2] == 'd' ) $ret["periodtype"] = 'days';
|
146 |
+
elseif ( $data_array[2] == 'm' ) $ret["periodtype"] = 'months';
|
147 |
+
elseif ( $data_array[2] == 'y' ) $ret["periodtype"] = 'years';
|
148 |
+
else $ret["result"] = false;
|
149 |
+
}
|
150 |
+
}
|
151 |
+
elseif ( $data_array[0] == "20" || $data_array[0] == "21" ) {
|
152 |
+
$ret["code"] = "2";
|
153 |
+
$ret["include_files"] = ( substr($data_array[0], 1, 1) == "1" );
|
154 |
+
if ( count($data_array) != 3 || strlen($data_array[1]) != 8 || strlen($data_array[2]) != 8 ) $ret["result"] = false;
|
155 |
+
$ret["datefrom"] = strtotime(substr($data_array[1], 0, 4)."-".substr($data_array[1], 4, 2)."-".substr($data_array[1], 6, 2)." 00:00");
|
156 |
+
if ( $ret["datefrom"] > time() ) $ret["result"] = false;
|
157 |
+
else {
|
158 |
+
$ret["dateto"] = strtotime(substr($data_array[2], 0, 4)."-".substr($data_array[2], 4, 2)."-".substr($data_array[2], 6, 2)." 00:00");
|
159 |
+
if ( $ret["dateto"] > $ret["datefrom"] ) $ret["result"] = false;
|
160 |
+
}
|
161 |
+
}
|
162 |
+
elseif ( $data_array[0] == "30" || $data_array[0] == "31" ) {
|
163 |
+
$ret["code"] = "3";
|
164 |
+
$ret["include_files"] = ( substr($data_array[0], 1, 1) == "1" );
|
165 |
+
if ( count($data_array) != 1 ) $ret["result"] = false;
|
166 |
+
}
|
167 |
+
else $ret["result"] = false;
|
168 |
+
|
169 |
+
return $ret;
|
170 |
+
}
|
171 |
+
|
172 |
+
function wfu_clean_log_where_query($data) {
|
173 |
+
$query = "";
|
174 |
+
if ( $data["code"] == "0" ) $query = " WHERE date_from < '".date('Y-m-d H:i:s', $data["dateold"])."'";
|
175 |
+
elseif ( $data["code"] == "1" ) {
|
176 |
+
$date = strtotime(date('Y-m-d', strtotime('-'.$data["periodold"].' '.$data["periodtype"]))." 00:00");
|
177 |
+
$query = " WHERE date_from < '".date('Y-m-d H:i:s', $date)."'";
|
178 |
+
}
|
179 |
+
elseif ( $data["code"] == "2" ) $query = " WHERE date_from < '".date('Y-m-d H:i:s', $data["datefrom"] + 86400)."' AND date_from >= '".date('Y-m-d H:i:s', $data["dateto"])."'";
|
180 |
+
|
181 |
+
return $query;
|
182 |
+
}
|
183 |
+
|
184 |
+
function wfu_clean_log_prompt($nonce, $data_enc) {
|
185 |
+
global $wpdb;
|
186 |
+
$table_name1 = $wpdb->prefix . "wfu_log";
|
187 |
+
$siteurl = site_url();
|
188 |
+
|
189 |
+
if ( !current_user_can( 'manage_options' ) || !wp_verify_nonce($nonce, 'wfu_maintenance_actions') ) return wfu_maintenance_actions();
|
190 |
+
//parse data
|
191 |
+
$data = wfu_clean_log_parse_data($data_enc);
|
192 |
+
if ( $data["result"] == false ) return wfu_maintenance_actions();
|
193 |
+
|
194 |
+
$echo_str = "\n".'<div class="wrap">';
|
195 |
+
$echo_str .= "\n\t".'<div style="margin-top:20px;">';
|
196 |
+
$echo_str .= "\n\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=maintenance_actions" class="button" title="go back">Go back</a>';
|
197 |
+
$echo_str .= "\n\t".'</div>';
|
198 |
+
$echo_str .= "\n\t".'<h2 style="margin-bottom: 10px;">Clean Database Log</h2>';
|
199 |
+
$echo_str .= "\n\t".'<form enctype="multipart/form-data" name="clean_log" id="clean_log" method="post" action="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload" class="validate">';
|
200 |
+
$nonce = wp_nonce_field('wfu_clean_log', '_wpnonce', false, false);
|
201 |
+
$nonce_ref = wp_referer_field(false);
|
202 |
+
$echo_str .= "\n\t\t".$nonce;
|
203 |
+
$echo_str .= "\n\t\t".$nonce_ref;
|
204 |
+
$echo_str .= "\n\t\t".'<input type="hidden" name="action" value="clean_log">';
|
205 |
+
$echo_str .= "\n\t\t".'<input type="hidden" name="data" value="'.$data_enc.'">';
|
206 |
+
if ( $data["include_files"] ) {
|
207 |
+
if ( $data["code"] == "0" )
|
208 |
+
$echo_str .= "\n\t\t".'<label>This will erase all files uploaded <strong>before '.date("Y-m-d", $data["dateold"]).'</strong> together with associated records kept by the plugin in the database (like file metadata and userdata).</label><br/>';
|
209 |
+
elseif ( $data["code"] == "1" )
|
210 |
+
$echo_str .= "\n\t\t".'<label>This will erase all files uploaded <strong>'.$data["periodold"].' '.$data["periodtype"].' ago or older</strong> together with associated records kept by the plugin in the database (like file metadata and userdata).</label><br/>';
|
211 |
+
elseif ( $data["code"] == "2" )
|
212 |
+
$echo_str .= "\n\t\t".'<label>This will erase all files uploaded <strong>between '.date("Y-m-d", $data["datefrom"]).' and '.date("Y-m-d", $data["dateto"]).'</strong> together with associated records kept by the plugin in the database (like file metadata and userdata).</label><br/>';
|
213 |
+
else
|
214 |
+
$echo_str .= "\n\t\t".'<label>This will erase <strong>ALL</strong> files and associated records kept by the plugin in the database (like file metadata and userdata).</label><br/>';
|
215 |
+
$affected_recs = $wpdb->get_results("SELECT * FROM $table_name1".wfu_clean_log_where_query($data));
|
216 |
+
$affected_files = wfu_get_valid_affected_files($affected_recs);
|
217 |
+
$echo_str .= "\n\t\t".'<br/><div class="wfu_cleanlog_files">';
|
218 |
+
$echo_str .= "\n\t\t\t".'<div>';
|
219 |
+
$echo_str .= "\n\t\t\t\t".'<label style="vertical-align: middle;"><strong>'.count($affected_files).'</strong> files will be deleted</label>';
|
220 |
+
$echo_str .= "\n\t\t\t\t".'<button id="wfu_cleanlog_prompt_button" onclick="document.querySelector(\'.wfu_cleanlog_files\').classList.toggle(\'visible\');return false;" style="vertical-align: middle;"></button>';
|
221 |
+
$echo_str .= "\n\t\t\t".'</div>';
|
222 |
+
$echo_str .= "\n\t\t\t".'<div id="wfu_cleanlog_prompt_list" style="margin-top:10px;">';
|
223 |
+
$echo_str .= "\n\t\t\t\t".'<textarea readonly="readonly" style="width:250px; height:150px; overflow:scroll; white-space:pre; resize:both;">';
|
224 |
+
foreach ( $affected_files as $file ) {
|
225 |
+
$echo_str .= $file."\n";
|
226 |
+
}
|
227 |
+
$echo_str .= "\n\t\t\t\t".'</textarea>';
|
228 |
+
$echo_str .= "\n\t\t\t".'</div>';
|
229 |
+
$echo_str .= "\n\t\t".'</div>';
|
230 |
+
$echo_str .= "\n\t\t".'<br/><label>Are you sure that you want to continue?</label><br/>';
|
231 |
+
$echo_str .= "\n\t\t".'<style>';
|
232 |
+
$echo_str .= "\n\t\t".'.wfu_cleanlog_files button:before { content: "Click to see affected files"; } ';
|
233 |
+
$echo_str .= "\n\t\t".'.wfu_cleanlog_files.visible button:before { content: "Close list"; } ';
|
234 |
+
$echo_str .= "\n\t\t".'.wfu_cleanlog_files #wfu_cleanlog_prompt_list { display: none; } ';
|
235 |
+
$echo_str .= "\n\t\t".'.wfu_cleanlog_files.visible #wfu_cleanlog_prompt_list { display: block; } ';
|
236 |
+
$echo_str .= "\n\t\t".'</style>';
|
237 |
+
}
|
238 |
+
else {
|
239 |
+
if ( $data["code"] == "0" )
|
240 |
+
$echo_str .= "\n\t\t".'<label>This will erase all records <strong>before '.date("Y-m-d", $data["dateold"]).'</strong> kept by the plugin in the database (like file metadata and userdata, however files uploaded by the plugin will be maintained). Are you sure that you want to continue?</label><br/>';
|
241 |
+
elseif ( $data["code"] == "1" )
|
242 |
+
$echo_str .= "\n\t\t".'<label>This will erase all records <strong>older than '.$data["periodold"].' '.$data["periodtype"].'</strong> kept by the plugin in the database (like file metadata and userdata, however files uploaded by the plugin will be maintained). Are you sure that you want to continue?</label><br/>';
|
243 |
+
elseif ( $data["code"] == "2" )
|
244 |
+
$echo_str .= "\n\t\t".'<label>This will erase all records <strong>between '.date("Y-m-d", $data["datefrom"]).' and '.date("Y-m-d", $data["dateto"]).'</strong> kept by the plugin in the database (like file metadata and userdata, however files uploaded by the plugin will be maintained). Are you sure that you want to continue?</label><br/>';
|
245 |
+
else
|
246 |
+
$echo_str .= "\n\t\t".'<label>This will erase <strong>ALL</strong> records kept by the plugin in the database (like file metadata and userdata, however files uploaded by the plugin will be maintained). Are you sure that you want to continue?</label><br/>';
|
247 |
+
}
|
248 |
+
$echo_str .= "\n\t\t".'<p class="submit">';
|
249 |
+
$echo_str .= "\n\t\t\t".'<input type="submit" class="button-primary" name="submit" value="Yes">';
|
250 |
+
$echo_str .= "\n\t\t\t".'<input type="submit" class="button-primary" name="submit" value="Cancel">';
|
251 |
+
$echo_str .= "\n\t\t".'</p>';
|
252 |
+
$echo_str .= "\n\t".'</form>';
|
253 |
+
$echo_str .= "\n".'</div>';
|
254 |
+
return $echo_str;
|
255 |
+
}
|
256 |
+
|
257 |
+
function wfu_clean_log() {
|
258 |
+
$a = func_get_args(); $a = WFU_FUNCTION_HOOK(__FUNCTION__, $a, $out); if (isset($out['vars'])) foreach($out['vars'] as $p => $v) $$p = $v; switch($a) { case 'R': return $out['output']; break; case 'D': die($out['output']); }
|
259 |
+
global $wpdb;
|
260 |
+
|
261 |
+
if ( !current_user_can( 'manage_options' ) ) return array( "recs_count" => -1, "files_count" => -1 );
|
262 |
+
if ( !check_admin_referer('wfu_clean_log') ) return array( "recs_count" => -1, "files_count" => -1 );
|
263 |
+
|
264 |
+
$recs_count = 0;
|
265 |
+
if ( isset($_POST['data']) && isset($_POST['submit']) && $_POST['submit'] == "Yes" ) {
|
266 |
+
$data = wfu_clean_log_parse_data($_POST['data']);
|
267 |
+
if ( $data["result"] ) {
|
268 |
+
$table_name1 = $wpdb->prefix . "wfu_log";
|
269 |
+
$table_name2 = $wpdb->prefix . "wfu_userdata";
|
270 |
+
//$table_name3 = $wpdb->prefix . "wfu_dbxqueue";
|
271 |
+
|
272 |
+
$affected_files = array();
|
273 |
+
if ( $data["include_files"] ) {
|
274 |
+
$affected_recs = $wpdb->get_results("SELECT * FROM $table_name1".wfu_clean_log_where_query($data));
|
275 |
+
$affected_files = wfu_get_valid_affected_files($affected_recs);
|
276 |
+
}
|
277 |
+
$query1 = "DELETE FROM $table_name1";
|
278 |
+
$query2 = "DELETE FROM $table_name2";
|
279 |
+
//$query3 = "DELETE FROM $table_name3";
|
280 |
+
if ( $data["code"] == "0" ) {
|
281 |
+
$query1 .= " WHERE date_from < '".date('Y-m-d H:i:s', $data["dateold"])."'";
|
282 |
+
$query2 .= " WHERE date_from < '".date('Y-m-d H:i:s', $data["dateold"])."'";
|
283 |
+
}
|
284 |
+
elseif ( $data["code"] == "1" ) {
|
285 |
+
$date = strtotime(date('Y-m-d', strtotime('-'.$data["periodold"].' '.$data["periodtype"]))." 00:00");
|
286 |
+
$query1 .= " WHERE date_from < '".date('Y-m-d H:i:s', $date)."'";
|
287 |
+
$query2 .= " WHERE date_from < '".date('Y-m-d H:i:s', $date)."'";
|
288 |
+
}
|
289 |
+
elseif ( $data["code"] == "2" ) {
|
290 |
+
$query1 .= " WHERE date_from < '".date('Y-m-d H:i:s', $data["datefrom"] + 86400)."' AND date_from >= '".date('Y-m-d H:i:s', $data["dateto"])."'";
|
291 |
+
$query2 .= " WHERE date_from < '".date('Y-m-d H:i:s', $data["datefrom"] + 86400)."' AND date_from >= '".date('Y-m-d H:i:s', $data["dateto"])."'";
|
292 |
+
}
|
293 |
+
$recs_count = $wpdb->query($query1);
|
294 |
+
$recs_count += $wpdb->query($query2);
|
295 |
+
//$recs_count += $wpdb->query($query3);
|
296 |
+
|
297 |
+
//delete affected files
|
298 |
+
$files_count = 0;
|
299 |
+
foreach( $affected_files as $file ) {
|
300 |
+
unlink($file);
|
301 |
+
if ( !file_exists($file) ) $files_count ++;
|
302 |
+
}
|
303 |
+
}
|
304 |
+
}
|
305 |
+
|
306 |
+
return array( "recs_count" => $recs_count, "files_count" => $files_count );
|
307 |
+
}
|
308 |
+
|
309 |
+
function wfu_purge_data_prompt($nonce) {
|
310 |
+
$siteurl = site_url();
|
311 |
+
|
312 |
+
if ( !current_user_can( 'manage_options' ) || !wp_verify_nonce($nonce, 'wfu_maintenance_actions') ) return wfu_maintenance_actions();
|
313 |
+
|
314 |
+
$echo_str = "\n".'<div class="wrap">';
|
315 |
+
$echo_str .= "\n\t".'<div style="margin-top:20px;">';
|
316 |
+
$echo_str .= "\n\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=maintenance_actions" class="button" title="go back">Go back</a>';
|
317 |
+
$echo_str .= "\n\t".'</div>';
|
318 |
+
$echo_str .= "\n\t".'<h2 style="margin-bottom: 10px;">Purge All Data</h2>';
|
319 |
+
$echo_str .= "\n\t".'<form enctype="multipart/form-data" name="purge_data" id="purge_data" method="post" action="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload" class="validate">';
|
320 |
+
$nonce = wp_nonce_field('wfu_purge_data', '_wpnonce', false, false);
|
321 |
+
$nonce_ref = wp_referer_field(false);
|
322 |
+
$echo_str .= "\n\t\t".$nonce;
|
323 |
+
$echo_str .= "\n\t\t".$nonce_ref;
|
324 |
+
$echo_str .= "\n\t\t".'<input type="hidden" name="action" value="purge_data">';
|
325 |
+
$echo_str .= "\n\t\t".'<label>This action will remove all plugin options and records from database, data stored in session and will dectivate the plugin. Use it only if you want to entirely remove the plugin from the website.</label><br/>';
|
326 |
+
$echo_str .= "\n\t\t".'<br/><label>Are you sure you want to continue?</label><br/>';
|
327 |
+
$echo_str .= "\n\t\t".'<p class="submit">';
|
328 |
+
$echo_str .= "\n\t\t\t".'<input type="submit" class="button-primary" name="submit" value="Yes">';
|
329 |
+
$echo_str .= "\n\t\t\t".'<input type="submit" class="button-primary" name="submit" value="Cancel">';
|
330 |
+
$echo_str .= "\n\t\t".'</p>';
|
331 |
+
$echo_str .= "\n\t".'</form>';
|
332 |
+
$echo_str .= "\n".'</div>';
|
333 |
+
return $echo_str;
|
334 |
+
}
|
335 |
+
|
336 |
+
function wfu_purge_data() {
|
337 |
+
$a = func_get_args(); $a = WFU_FUNCTION_HOOK(__FUNCTION__, $a, $out); if (isset($out['vars'])) foreach($out['vars'] as $p => $v) $$p = $v; switch($a) { case 'R': return $out['output']; break; case 'D': die($out['output']); }
|
338 |
+
global $wpdb;
|
339 |
+
|
340 |
+
if ( !current_user_can( 'manage_options' ) ) return;
|
341 |
+
if ( !check_admin_referer('wfu_purge_data') ) return;
|
342 |
+
|
343 |
+
if ( isset($_POST['submit']) && $_POST['submit'] == "Yes" ) {
|
344 |
+
$all_options = array_keys(wp_load_alloptions());
|
345 |
+
$all_session = array_keys($_SESSION);
|
346 |
+
$wfu_options = wfu_get_all_plugin_options();
|
347 |
+
//first delete relevant db options
|
348 |
+
foreach ( $all_options as $opt1 )
|
349 |
+
foreach ( $wfu_options as $opt2 )
|
350 |
+
if ( $opt2[2] && $opt2[1] == "db" ) {
|
351 |
+
if (( substr($opt2[0], 0, 1) != "*" && substr($opt2[0], -1) != "*" && $opt1 == $opt2[0] ) ||
|
352 |
+
( substr($opt2[0], 0, 1) != "*" && substr($opt2[0], -1) == "*" && substr($opt1, 0, strlen($opt2[0])) == substr($opt2[0], 0, -1) ) ||
|
353 |
+
( substr($opt2[0], 0, 1) == "*" && substr($opt2[0], -1) != "*" && substr($opt1, -strlen($opt2[0])) == substr($opt2[0], 1) ) ||
|
354 |
+
( substr($opt2[0], 0, 1) == "*" && substr($opt2[0], -1) == "*" && strpos($opt1, substr($opt2[0], 1, -1)) !== false ))
|
355 |
+
delete_option($opt1);
|
356 |
+
}
|
357 |
+
//then delete relevant session data
|
358 |
+
foreach ( $all_session as $opt1 )
|
359 |
+
foreach ( $wfu_options as $opt2 )
|
360 |
+
if ( $opt2[2] && $opt2[1] == "session" ) {
|
361 |
+
if (( substr($opt2[0], 0, 1) != "*" && substr($opt2[0], -1) != "*" && $opt1 == $opt2[0] ) ||
|
362 |
+
( substr($opt2[0], 0, 1) != "*" && substr($opt2[0], -1) == "*" && substr($opt1, 0, strlen($opt2[0])) == substr($opt2[0], 0, -1) ) ||
|
363 |
+
( substr($opt2[0], 0, 1) == "*" && substr($opt2[0], -1) != "*" && substr($opt1, -strlen($opt2[0])) == substr($opt2[0], 1) ) ||
|
364 |
+
( substr($opt2[0], 0, 1) == "*" && substr($opt2[0], -1) == "*" && strpos($opt1, substr($opt2[0], 1, -1)) !== false ))
|
365 |
+
unset($_SESSION[$opt1]);
|
366 |
+
}
|
367 |
+
//then delete relevant tables
|
368 |
+
$wpdb->query( "DROP TABLE IF EXISTS ".$wpdb->prefix."wfu_log" );
|
369 |
+
$wpdb->query( "DROP TABLE IF EXISTS ".$wpdb->prefix."wfu_userdata" );
|
370 |
+
$wpdb->query( "DROP TABLE IF EXISTS ".$wpdb->prefix."wfu_dbxqueue" );
|
371 |
+
//then deactivate the plugin
|
372 |
+
deactivate_plugins( plugin_basename( WPFILEUPLOAD_PLUGINFILE ) );
|
373 |
+
}
|
374 |
+
else return;
|
375 |
+
|
376 |
+
return true;
|
377 |
+
}
|
378 |
+
|
379 |
+
|
380 |
+
function wfu_process_all_transfers($clearfiles = false) {
|
381 |
+
$a = func_get_args(); $a = WFU_FUNCTION_HOOK(__FUNCTION__, $a, $out); if (isset($out['vars'])) foreach($out['vars'] as $p => $v) $$p = $v; switch($a) { case 'R': return $out['output']; break; case 'D': die($out['output']); }
|
382 |
+
global $wpdb;
|
383 |
+
if ( $clearfiles ) {
|
384 |
+
$table_name1 = $wpdb->prefix . "wfu_log";
|
385 |
+
$table_name3 = $wpdb->prefix . "wfu_dbxqueue";
|
386 |
+
$wpdb->query('DELETE FROM '.$table_name3);
|
387 |
+
}
|
388 |
+
wfu_schedule_transfermanager(true);
|
389 |
+
}
|
390 |
+
|
391 |
+
function wfu_reset_all_transfers_controller($nonce) {
|
392 |
+
if ( !current_user_can( 'manage_options' ) ) return false;
|
393 |
+
if ( !wp_verify_nonce($nonce, 'wfu_maintenance_actions') ) return false;
|
394 |
+
|
395 |
+
wfu_process_all_transfers();
|
396 |
+
|
397 |
+
return true;
|
398 |
+
}
|
399 |
+
|
400 |
+
function wfu_clear_all_transfers_controller($nonce) {
|
401 |
+
if ( !current_user_can( 'manage_options' ) ) return false;
|
402 |
+
if ( !wp_verify_nonce($nonce, 'wfu_maintenance_actions') ) return false;
|
403 |
+
|
404 |
+
wfu_process_all_transfers(true);
|
405 |
+
|
406 |
+
return true;
|
407 |
+
}
|
408 |
+
|
409 |
?>
|
lib/wfu_admin_settings.php
CHANGED
@@ -1,241 +1,241 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
function wfu_settings_definitions() {
|
4 |
-
$settings = array(
|
5 |
-
"version" => array("number", "1.0"),
|
6 |
-
"shortcode" => array("string", ""),
|
7 |
-
"hashfiles" => array("number", ""),
|
8 |
-
"basedir" => array("string", ""),
|
9 |
-
"personaldata" => array("number", ""),
|
10 |
-
"postmethod" => array("number", ""),
|
11 |
-
"modsecurity" => array("number", ""),
|
12 |
-
"userstatehandler" => array("number", ""),
|
13 |
-
"relaxcss" => array("number", ""),
|
14 |
-
"admindomain" => array("number", ""),
|
15 |
-
"mediacustom" => array("number", ""),
|
16 |
-
"createthumbnails" => array("number", ""),
|
17 |
-
"includeotherfiles" => array("number", ""),
|
18 |
-
"altserver" => array("number", ""),
|
19 |
-
"captcha_sitekey" => array("string", ""),
|
20 |
-
"captcha_secretkey" => array("string", ""),
|
21 |
-
"browser_permissions" => array("array", "")
|
22 |
-
);
|
23 |
-
$settings = apply_filters("_wfu_settings_definitions", $settings);
|
24 |
-
|
25 |
-
return $settings;
|
26 |
-
}
|
27 |
-
|
28 |
-
|
29 |
-
function wfu_encode_plugin_options($plugin_options) {
|
30 |
-
$settings = wfu_settings_definitions();
|
31 |
-
$encoded_options = array();
|
32 |
-
foreach ( $settings as $setting => $data ) {
|
33 |
-
$encoded = $setting."=";
|
34 |
-
if ( !isset($plugin_options[$setting]) ) $encoded .= $data[1];
|
35 |
-
elseif ( $data[0] == "string" ) $encoded .= wfu_plugin_encode_string($plugin_options[$setting]);
|
36 |
-
elseif ( $data[0] == "array" ) $encoded .= wfu_encode_array_to_string($plugin_options[$setting]);
|
37 |
-
else $encoded .= $plugin_options[$setting];
|
38 |
-
array_push($encoded_options, $encoded);
|
39 |
-
}
|
40 |
-
|
41 |
-
return implode(";", $encoded_options);
|
42 |
-
}
|
43 |
-
|
44 |
-
function wfu_decode_plugin_options($encoded_options) {
|
45 |
-
$settings = wfu_settings_definitions();
|
46 |
-
foreach ( $settings as $setting => $data )
|
47 |
-
$plugin_options[$setting] = $data[1];
|
48 |
-
|
49 |
-
$decoded_array = explode(';', $encoded_options);
|
50 |
-
foreach ($decoded_array as $decoded_item) {
|
51 |
-
if ( trim($decoded_item) != "" ) {
|
52 |
-
list($item_key, $item_value) = explode("=", $decoded_item, 2);
|
53 |
-
if ( isset($settings[$item_key]) ) {
|
54 |
-
if ( $settings[$item_key][0] == "string" ) $plugin_options[$item_key] = wfu_plugin_decode_string($item_value);
|
55 |
-
elseif ( $settings[$item_key][0] == "array" ) $plugin_options[$item_key] = wfu_decode_array_from_string($item_value);
|
56 |
-
else $plugin_options[$item_key] = $item_value;
|
57 |
-
}
|
58 |
-
}
|
59 |
-
}
|
60 |
-
|
61 |
-
return $plugin_options;
|
62 |
-
}
|
63 |
-
|
64 |
-
function wfu_manage_settings($message = '') {
|
65 |
-
if ( !current_user_can( 'manage_options' ) ) return;
|
66 |
-
|
67 |
-
$siteurl = site_url();
|
68 |
-
$plugin_options = wfu_decode_plugin_options(get_option( "wordpress_file_upload_options" ));
|
69 |
-
|
70 |
-
$echo_str = '<div class="wrap">';
|
71 |
-
$echo_str .= "\n\t".'<h2>Wordpress File Upload Control Panel</h2>';
|
72 |
-
$echo_str .= "\n\t".'<div style="margin-top:20px;">';
|
73 |
-
$echo_str .= wfu_generate_dashboard_menu("\n\t\t", "Settings");
|
74 |
-
$echo_str .= "\n\t\t".'<form enctype="multipart/form-data" name="editsettings" id="editsettings" method="post" action="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=edit_settings" class="validate">';
|
75 |
-
$nonce = wp_nonce_field('wfu_edit_admin_settings', '_wpnonce', false, false);
|
76 |
-
$nonce_ref = wp_referer_field(false);
|
77 |
-
$echo_str .= "\n\t\t\t".$nonce;
|
78 |
-
$echo_str .= "\n\t\t\t".$nonce_ref;
|
79 |
-
$echo_str .= "\n\t\t\t".'<input type="hidden" name="action" value="edit_settings">';
|
80 |
-
$echo_str .= "\n\t\t\t".'<table class="form-table">';
|
81 |
-
$echo_str .= "\n\t\t\t\t".'<tbody>';
|
82 |
-
$echo_str .= "\n\t\t\t\t\t".'<tr>';
|
83 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<th scope="row">';
|
84 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<h3>General Settings</h3>';
|
85 |
-
$echo_str .= "\n\t\t\t\t\t\t".'</th>';
|
86 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<td>';
|
87 |
-
$echo_str .= "\n\t\t\t\t\t\t".'</td>';
|
88 |
-
$echo_str .= "\n\t\t\t\t\t".'</tr>';
|
89 |
-
$echo_str .= "\n\t\t\t\t\t".'<tr>';
|
90 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<th scope="row">';
|
91 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<label for="wfu_hashfiles">Hash Files</label>';
|
92 |
-
$echo_str .= "\n\t\t\t\t\t\t".'</th>';
|
93 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<td>';
|
94 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<input name="wfu_hashfiles" id="wfu_hashfiles" type="checkbox"'.($plugin_options['hashfiles'] == '1' ? ' checked="checked"' : '' ).' style="width:auto;" /> Enables better control of uploaded files, but slows down performance when uploaded files are larger than 100MBytes';
|
95 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<p style="cursor: text; font-size:9px; padding: 0px; margin: 0px; width: 95%; color: #AAAAAA;">Current value: <strong>'.($plugin_options['hashfiles'] == '1' ? 'Yes' : 'No' ).'</strong></p>';
|
96 |
-
$echo_str .= "\n\t\t\t\t\t\t".'</td>';
|
97 |
-
$echo_str .= "\n\t\t\t\t\t".'</tr>';
|
98 |
-
$echo_str .= "\n\t\t\t\t\t".'<tr>';
|
99 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<th scope="row">';
|
100 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<label for="wfu_basedir">Base Directory</label>';
|
101 |
-
$echo_str .= "\n\t\t\t\t\t\t".'</th>';
|
102 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<td>';
|
103 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<input name="wfu_basedir" id="wfu_basedir" type="text" value="'.$plugin_options['basedir'].'" />';
|
104 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<p style="cursor: text; font-size:9px; padding: 0px; margin: 0px; width: 95%; color: #AAAAAA;">Current value: <strong>'.$plugin_options['basedir'].'</strong></p>';
|
105 |
-
$echo_str .= "\n\t\t\t\t\t\t".'</td>';
|
106 |
-
$echo_str .= "\n\t\t\t\t\t".'</tr>';
|
107 |
-
$echo_str .= "\n\t\t\t\t\t".'<tr>';
|
108 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<th scope="row">';
|
109 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<label for="wfu_personaldata">Personal Data</label>';
|
110 |
-
$echo_str .= "\n\t\t\t\t\t\t".'</th>';
|
111 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<td>';
|
112 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<input name="wfu_personaldata" id="wfu_personaldata" type="checkbox"'.($plugin_options['personaldata'] == '1' ? ' checked="checked"' : '' ).' style="width:auto;" /> Enable this option if your website is subject to EU GDPR regulation and you want to define how to handle personal data';
|
113 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<p style="cursor: text; font-size:9px; padding: 0px; margin: 0px; width: 95%; color: #AAAAAA;">Current value: <strong>'.($plugin_options['personaldata'] == '1' ? 'Yes' : 'No' ).'</strong></p>';
|
114 |
-
$echo_str .= "\n\t\t\t\t\t\t".'</td>';
|
115 |
-
$echo_str .= "\n\t\t\t\t\t".'</tr>';
|
116 |
-
$echo_str .= "\n\t\t\t\t\t".'<tr>';
|
117 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<th scope="row">';
|
118 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<label for="wfu_postmethod">Post Method</label>';
|
119 |
-
$echo_str .= "\n\t\t\t\t\t\t".'</th>';
|
120 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<td>';
|
121 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<select name="wfu_postmethod" id="wfu_postmethod" value="'.$plugin_options['postmethod'].'">';
|
122 |
-
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<option value="fopen"'.( $plugin_options['postmethod'] == 'fopen' || $plugin_options['postmethod'] == '' ? ' selected="selected"' : '' ).'>Using fopen (default)</option>';
|
123 |
-
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<option value="curl"'.( $plugin_options['postmethod'] == 'curl' ? ' selected="selected"' : '' ).'>Using cURL</option>';
|
124 |
-
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<option value="socket"'.( $plugin_options['postmethod'] == 'socket' ? ' selected="selected"' : '' ).'>Using Sockets</option>';
|
125 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'</select>';
|
126 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<p style="cursor: text; font-size:9px; padding: 0px; margin: 0px; width: 95%; color: #AAAAAA;">Current value: <strong>'.( $plugin_options['postmethod'] == 'fopen' || $plugin_options['postmethod'] == '' ? 'Using fopen' : ( $plugin_options['postmethod'] == 'curl' ? 'Using cURL' : 'Using Sockets' ) ).'</strong></p>';
|
127 |
-
$echo_str .= "\n\t\t\t\t\t\t".'</td>';
|
128 |
-
$echo_str .= "\n\t\t\t\t\t".'</tr>';
|
129 |
-
$echo_str .= "\n\t\t\t\t\t".'<tr>';
|
130 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<th scope="row">';
|
131 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<label for="wfu_userstatehandler">User State Handler</label>';
|
132 |
-
$echo_str .= "\n\t\t\t\t\t\t".'</th>';
|
133 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<td>';
|
134 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<select name="wfu_userstatehandler" id="wfu_userstatehandler" value="'.$plugin_options['userstatehandler'].'">';
|
135 |
-
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<option value="session"'.( $plugin_options['userstatehandler'] == 'session' || $plugin_options['userstatehandler'] == '' ? ' selected="selected"' : '' ).'>Session (default)</option>';
|
136 |
-
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<option value="dboption"'.( $plugin_options['userstatehandler'] == 'dboption' ? ' selected="selected"' : '' ).'>DB Option</option>';
|
137 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'</select>';
|
138 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<p style="cursor: text; font-size:9px; padding: 0px; margin: 0px; width: 95%; color: #AAAAAA;">Current value: <strong>'.( $plugin_options['userstatehandler'] == 'session' || $plugin_options['userstatehandler'] == '' ? 'Session' : ( $plugin_options['userstatehandler'] == 'dboption' ? 'DB Option' : 'Session' ) ).'</strong></p>';
|
139 |
-
$echo_str .= "\n\t\t\t\t\t\t".'</td>';
|
140 |
-
$echo_str .= "\n\t\t\t\t\t".'</tr>';
|
141 |
-
$echo_str .= "\n\t\t\t\t\t".'<tr>';
|
142 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<th scope="row">';
|
143 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<label for="wfu_relaxcss">Relax CSS Rules</label>';
|
144 |
-
$echo_str .= "\n\t\t\t\t\t\t".'</th>';
|
145 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<td>';
|
146 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<input name="wfu_relaxcss" id="wfu_relaxcss" type="checkbox"'.($plugin_options['relaxcss'] == '1' ? ' checked="checked"' : '' ).' style="width:auto;" /> If enabled then the textboxes and the buttons of the plugin will inherit the theme\'s styling';
|
147 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<p style="cursor: text; font-size:9px; padding: 0px; margin: 0px; width: 95%; color: #AAAAAA;">Current value: <strong>'.($plugin_options['relaxcss'] == '1' ? 'Yes' : 'No' ).'</strong></p>';
|
148 |
-
$echo_str .= "\n\t\t\t\t\t\t".'</td>';
|
149 |
-
$echo_str .= "\n\t\t\t\t\t".'</tr>';
|
150 |
-
$echo_str .= "\n\t\t\t\t\t".'<tr>';
|
151 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<th scope="row">';
|
152 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<label for="wfu_admindomain">Admin Domain</label>';
|
153 |
-
$echo_str .= "\n\t\t\t\t\t\t".'</th>';
|
154 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<td>';
|
155 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<select name="wfu_admindomain" id="wfu_admindomain" value="'.$plugin_options['admindomain'].'">';
|
156 |
-
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<option value="siteurl"'.( $plugin_options['admindomain'] == 'siteurl' || $plugin_options['admindomain'] == '' ? ' selected="selected"' : '' ).'>Using site_url (default)</option>';
|
157 |
-
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<option value="adminurl"'.( $plugin_options['admindomain'] == 'adminurl' ? ' selected="selected"' : '' ).'>Using admin_url</option>';
|
158 |
-
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<option value="homeurl"'.( $plugin_options['admindomain'] == 'homeurl' ? ' selected="selected"' : '' ).'>Using home_url</option>';
|
159 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'</select>';
|
160 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<p style="cursor: text; font-size:9px; padding: 0px; margin: 0px; width: 95%; color: #AAAAAA;">Current value: <strong>'.( $plugin_options['admindomain'] == 'siteurl' || $plugin_options['admindomain'] == '' ? 'Using site_url' : ( $plugin_options['admindomain'] == 'adminurl' ? 'Using admin_url' : 'Using home_url' ) ).'</strong></p>';
|
161 |
-
$echo_str .= "\n\t\t\t\t\t\t".'</td>';
|
162 |
-
$echo_str .= "\n\t\t\t\t\t".'</tr>';
|
163 |
-
$echo_str .= "\n\t\t\t\t\t".'<tr>';
|
164 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<th scope="row">';
|
165 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<label for="wfu_mediacustom">Show Custom Fields in Media Library</label>';
|
166 |
-
$echo_str .= "\n\t\t\t\t\t\t".'</th>';
|
167 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<td>';
|
168 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<input name="wfu_mediacustom" id="wfu_mediacustom" type="checkbox"'.($plugin_options['mediacustom'] == '1' ? ' checked="checked"' : '' ).' style="width:auto;" /> If enabled and the uploaded files are added to Media Library then any user fields submitted together with the files will be shown in Media Library';
|
169 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<p style="cursor: text; font-size:9px; padding: 0px; margin: 0px; width: 95%; color: #AAAAAA;">Current value: <strong>'.($plugin_options['mediacustom'] == '1' ? 'Yes' : 'No' ).'</strong></p>';
|
170 |
-
$echo_str .= "\n\t\t\t\t\t\t".'</td>';
|
171 |
-
$echo_str .= "\n\t\t\t\t\t".'</tr>';
|
172 |
-
$echo_str .= "\n\t\t\t\t\t".'<tr>';
|
173 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<th scope="row">';
|
174 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<label for="wfu_includeotherfiles">Include Other Files in Plugin\'s Database</label>';
|
175 |
-
$echo_str .= "\n\t\t\t\t\t\t".'</th>';
|
176 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<td>';
|
177 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<input name="wfu_includeotherfiles" id="wfu_includeotherfiles" type="checkbox"'.($plugin_options['includeotherfiles'] == '1' ? ' checked="checked"' : '' ).' style="width:auto;" /> If enabled administrators can include in the plugin\'s database additional files through the File Browser';
|
178 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<p style="cursor: text; font-size:9px; padding: 0px; margin: 0px; width: 95%; color: #AAAAAA;">Current value: <strong>'.($plugin_options['includeotherfiles'] == '1' ? 'Yes' : 'No' ).'</strong></p>';
|
179 |
-
$echo_str .= "\n\t\t\t\t\t\t".'</td>';
|
180 |
-
$echo_str .= "\n\t\t\t\t\t".'</tr>';
|
181 |
-
$echo_str .= "\n\t\t\t\t\t".'<tr>';
|
182 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<th scope="row">';
|
183 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<label for="wfu_altserver">Use Alternative Iptanus Server</label>';
|
184 |
-
$echo_str .= "\n\t\t\t\t\t\t".'</th>';
|
185 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<td>';
|
186 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<input name="wfu_altserver" id="wfu_altserver" type="checkbox"'.($plugin_options['altserver'] == '1' ? ' checked="checked"' : '' ).' style="width:auto;" /> Switches to the alternative Iptanus server, residing on Google Cloud, for getting information such as latest version number.';
|
187 |
-
$echo_str .= "\n\t\t\t\t\t\t\t".'<p style="cursor: text; font-size:9px; padding: 0px; margin: 0px; width: 95%; color: #AAAAAA;">Current value: <strong>'.($plugin_options['altserver'] == '1' ? 'Yes' : 'No' ).'</strong></p>';
|
188 |
-
$echo_str .= "\n\t\t\t\t\t\t".'</td>';
|
189 |
-
$echo_str .= "\n\t\t\t\t\t".'</tr>';
|
190 |
-
$echo_str .= "\n\t\t\t\t".'</tbody>';
|
191 |
-
$echo_str .= "\n\t\t\t".'</table>';
|
192 |
-
$echo_str .= "\n\t\t\t".'<p class="submit">';
|
193 |
-
$echo_str .= "\n\t\t\t\t".'<input type="submit" class="button-primary" name="submitform" value="Update" />';
|
194 |
-
$echo_str .= "\n\t\t\t".'</p>';
|
195 |
-
$echo_str .= "\n\t\t".'</form>';
|
196 |
-
$echo_str .= "\n\t".'</div>';
|
197 |
-
$echo_str .= "\n".'</div>';
|
198 |
-
|
199 |
-
echo $echo_str;
|
200 |
-
}
|
201 |
-
|
202 |
-
|
203 |
-
function wfu_update_settings() {
|
204 |
-
if ( !current_user_can( 'manage_options' ) ) return;
|
205 |
-
if ( !check_admin_referer('wfu_edit_admin_settings') ) return;
|
206 |
-
$plugin_options = wfu_decode_plugin_options(get_option( "wordpress_file_upload_options" ));
|
207 |
-
$new_plugin_options = array();
|
208 |
-
|
209 |
-
// $enabled = ( isset($_POST['wfu_enabled']) ? ( $_POST['wfu_enabled'] == "on" ? 1 : 0 ) : 0 );
|
210 |
-
$hashfiles = ( isset($_POST['wfu_hashfiles']) ? ( $_POST['wfu_hashfiles'] == "on" ? 1 : 0 ) : 0 );
|
211 |
-
$personaldata = ( isset($_POST['wfu_personaldata']) ? ( $_POST['wfu_personaldata'] == "on" ? 1 : 0 ) : 0 );
|
212 |
-
$relaxcss = ( isset($_POST['wfu_relaxcss']) ? ( $_POST['wfu_relaxcss'] == "on" ? 1 : 0 ) : 0 );
|
213 |
-
$mediacustom = ( isset($_POST['wfu_mediacustom']) ? ( $_POST['wfu_mediacustom'] == "on" ? 1 : 0 ) : 0 );
|
214 |
-
$includeotherfiles = ( isset($_POST['wfu_includeotherfiles']) ? ( $_POST['wfu_includeotherfiles'] == "on" ? 1 : 0 ) : 0 );
|
215 |
-
$altserver = ( isset($_POST['wfu_altserver']) ? ( $_POST['wfu_altserver'] == "on" ? 1 : 0 ) : 0 );
|
216 |
-
if ( isset($_POST['wfu_basedir']) && isset($_POST['wfu_postmethod']) && isset($_POST['wfu_userstatehandler']) && isset($_POST['wfu_admindomain']) && isset($_POST['submitform']) ) {
|
217 |
-
if ( $_POST['submitform'] == "Update" ) {
|
218 |
-
$new_plugin_options['version'] = '1.0';
|
219 |
-
$new_plugin_options['shortcode'] = $plugin_options['shortcode'];
|
220 |
-
$new_plugin_options['hashfiles'] = $hashfiles;
|
221 |
-
$new_plugin_options['basedir'] = sanitize_text_field($_POST['wfu_basedir']);
|
222 |
-
$new_plugin_options['personaldata'] = $personaldata;
|
223 |
-
$new_plugin_options['postmethod'] = sanitize_text_field($_POST['wfu_postmethod']);
|
224 |
-
$new_plugin_options['userstatehandler'] = sanitize_text_field($_POST['wfu_userstatehandler']);
|
225 |
-
$new_plugin_options['relaxcss'] = $relaxcss;
|
226 |
-
$new_plugin_options['admindomain'] = sanitize_text_field($_POST['wfu_admindomain']);
|
227 |
-
$new_plugin_options['mediacustom'] = $mediacustom;
|
228 |
-
$new_plugin_options['includeotherfiles'] = $includeotherfiles;
|
229 |
-
$new_plugin_options['altserver'] = $altserver;
|
230 |
-
$encoded_options = wfu_encode_plugin_options($new_plugin_options);
|
231 |
-
update_option( "wordpress_file_upload_options", $encoded_options );
|
232 |
-
if ( $new_plugin_options['hashfiles'] == '1' && $plugin_options['hashfiles'] != '1' )
|
233 |
-
wfu_reassign_hashes();
|
234 |
-
}
|
235 |
-
}
|
236 |
-
|
237 |
-
return true;
|
238 |
-
}
|
239 |
-
|
240 |
-
|
241 |
-
?>
|
1 |
+
<?php
|
2 |
+
|
3 |
+
function wfu_settings_definitions() {
|
4 |
+
$settings = array(
|
5 |
+
"version" => array("number", "1.0"),
|
6 |
+
"shortcode" => array("string", ""),
|
7 |
+
"hashfiles" => array("number", ""),
|
8 |
+
"basedir" => array("string", ""),
|
9 |
+
"personaldata" => array("number", ""),
|
10 |
+
"postmethod" => array("number", ""),
|
11 |
+
"modsecurity" => array("number", ""),
|
12 |
+
"userstatehandler" => array("number", ""),
|
13 |
+
"relaxcss" => array("number", ""),
|
14 |
+
"admindomain" => array("number", ""),
|
15 |
+
"mediacustom" => array("number", ""),
|
16 |
+
"createthumbnails" => array("number", ""),
|
17 |
+
"includeotherfiles" => array("number", ""),
|
18 |
+
"altserver" => array("number", ""),
|
19 |
+
"captcha_sitekey" => array("string", ""),
|
20 |
+
"captcha_secretkey" => array("string", ""),
|
21 |
+
"browser_permissions" => array("array", "")
|
22 |
+
);
|
23 |
+
$settings = apply_filters("_wfu_settings_definitions", $settings);
|
24 |
+
|
25 |
+
return $settings;
|
26 |
+
}
|
27 |
+
|
28 |
+
|
29 |
+
function wfu_encode_plugin_options($plugin_options) {
|
30 |
+
$settings = wfu_settings_definitions();
|
31 |
+
$encoded_options = array();
|
32 |
+
foreach ( $settings as $setting => $data ) {
|
33 |
+
$encoded = $setting."=";
|
34 |
+
if ( !isset($plugin_options[$setting]) ) $encoded .= $data[1];
|
35 |
+
elseif ( $data[0] == "string" ) $encoded .= wfu_plugin_encode_string($plugin_options[$setting]);
|
36 |
+
elseif ( $data[0] == "array" ) $encoded .= wfu_encode_array_to_string($plugin_options[$setting]);
|
37 |
+
else $encoded .= $plugin_options[$setting];
|
38 |
+
array_push($encoded_options, $encoded);
|
39 |
+
}
|
40 |
+
|
41 |
+
return implode(";", $encoded_options);
|
42 |
+
}
|
43 |
+
|
44 |
+
function wfu_decode_plugin_options($encoded_options) {
|
45 |
+
$settings = wfu_settings_definitions();
|
46 |
+
foreach ( $settings as $setting => $data )
|
47 |
+
$plugin_options[$setting] = $data[1];
|
48 |
+
|
49 |
+
$decoded_array = explode(';', $encoded_options);
|
50 |
+
foreach ($decoded_array as $decoded_item) {
|
51 |
+
if ( trim($decoded_item) != "" ) {
|
52 |
+
list($item_key, $item_value) = explode("=", $decoded_item, 2);
|
53 |
+
if ( isset($settings[$item_key]) ) {
|
54 |
+
if ( $settings[$item_key][0] == "string" ) $plugin_options[$item_key] = wfu_plugin_decode_string($item_value);
|
55 |
+
elseif ( $settings[$item_key][0] == "array" ) $plugin_options[$item_key] = wfu_decode_array_from_string($item_value);
|
56 |
+
else $plugin_options[$item_key] = $item_value;
|
57 |
+
}
|
58 |
+
}
|
59 |
+
}
|
60 |
+
|
61 |
+
return $plugin_options;
|
62 |
+
}
|
63 |
+
|
64 |
+
function wfu_manage_settings($message = '') {
|
65 |
+
if ( !current_user_can( 'manage_options' ) ) return;
|
66 |
+
|
67 |
+
$siteurl = site_url();
|
68 |
+
$plugin_options = wfu_decode_plugin_options(get_option( "wordpress_file_upload_options" ));
|
69 |
+
|
70 |
+
$echo_str = '<div class="wrap">';
|
71 |
+
$echo_str .= "\n\t".'<h2>Wordpress File Upload Control Panel</h2>';
|
72 |
+
$echo_str .= "\n\t".'<div style="margin-top:20px;">';
|
73 |
+
$echo_str .= wfu_generate_dashboard_menu("\n\t\t", "Settings");
|
74 |
+
$echo_str .= "\n\t\t".'<form enctype="multipart/form-data" name="editsettings" id="editsettings" method="post" action="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=edit_settings" class="validate">';
|
75 |
+
$nonce = wp_nonce_field('wfu_edit_admin_settings', '_wpnonce', false, false);
|
76 |
+
$nonce_ref = wp_referer_field(false);
|
77 |
+
$echo_str .= "\n\t\t\t".$nonce;
|
78 |
+
$echo_str .= "\n\t\t\t".$nonce_ref;
|
79 |
+
$echo_str .= "\n\t\t\t".'<input type="hidden" name="action" value="edit_settings">';
|
80 |
+
$echo_str .= "\n\t\t\t".'<table class="form-table">';
|
81 |
+
$echo_str .= "\n\t\t\t\t".'<tbody>';
|
82 |
+
$echo_str .= "\n\t\t\t\t\t".'<tr>';
|
83 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<th scope="row">';
|
84 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<h3>General Settings</h3>';
|
85 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</th>';
|
86 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<td>';
|
87 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</td>';
|
88 |
+
$echo_str .= "\n\t\t\t\t\t".'</tr>';
|
89 |
+
$echo_str .= "\n\t\t\t\t\t".'<tr>';
|
90 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<th scope="row">';
|
91 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<label for="wfu_hashfiles">Hash Files</label>';
|
92 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</th>';
|
93 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<td>';
|
94 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<input name="wfu_hashfiles" id="wfu_hashfiles" type="checkbox"'.($plugin_options['hashfiles'] == '1' ? ' checked="checked"' : '' ).' style="width:auto;" /> Enables better control of uploaded files, but slows down performance when uploaded files are larger than 100MBytes';
|
95 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<p style="cursor: text; font-size:9px; padding: 0px; margin: 0px; width: 95%; color: #AAAAAA;">Current value: <strong>'.($plugin_options['hashfiles'] == '1' ? 'Yes' : 'No' ).'</strong></p>';
|
96 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</td>';
|
97 |
+
$echo_str .= "\n\t\t\t\t\t".'</tr>';
|
98 |
+
$echo_str .= "\n\t\t\t\t\t".'<tr>';
|
99 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<th scope="row">';
|
100 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<label for="wfu_basedir">Base Directory</label>';
|
101 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</th>';
|
102 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<td>';
|
103 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<input name="wfu_basedir" id="wfu_basedir" type="text" value="'.$plugin_options['basedir'].'" />';
|
104 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<p style="cursor: text; font-size:9px; padding: 0px; margin: 0px; width: 95%; color: #AAAAAA;">Current value: <strong>'.$plugin_options['basedir'].'</strong></p>';
|
105 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</td>';
|
106 |
+
$echo_str .= "\n\t\t\t\t\t".'</tr>';
|
107 |
+
$echo_str .= "\n\t\t\t\t\t".'<tr>';
|
108 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<th scope="row">';
|
109 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<label for="wfu_personaldata">Personal Data</label>';
|
110 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</th>';
|
111 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<td>';
|
112 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<input name="wfu_personaldata" id="wfu_personaldata" type="checkbox"'.($plugin_options['personaldata'] == '1' ? ' checked="checked"' : '' ).' style="width:auto;" /> Enable this option if your website is subject to EU GDPR regulation and you want to define how to handle personal data';
|
113 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<p style="cursor: text; font-size:9px; padding: 0px; margin: 0px; width: 95%; color: #AAAAAA;">Current value: <strong>'.($plugin_options['personaldata'] == '1' ? 'Yes' : 'No' ).'</strong></p>';
|
114 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</td>';
|
115 |
+
$echo_str .= "\n\t\t\t\t\t".'</tr>';
|
116 |
+
$echo_str .= "\n\t\t\t\t\t".'<tr>';
|
117 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<th scope="row">';
|
118 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<label for="wfu_postmethod">Post Method</label>';
|
119 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</th>';
|
120 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<td>';
|
121 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<select name="wfu_postmethod" id="wfu_postmethod" value="'.$plugin_options['postmethod'].'">';
|
122 |
+
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<option value="fopen"'.( $plugin_options['postmethod'] == 'fopen' || $plugin_options['postmethod'] == '' ? ' selected="selected"' : '' ).'>Using fopen (default)</option>';
|
123 |
+
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<option value="curl"'.( $plugin_options['postmethod'] == 'curl' ? ' selected="selected"' : '' ).'>Using cURL</option>';
|
124 |
+
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<option value="socket"'.( $plugin_options['postmethod'] == 'socket' ? ' selected="selected"' : '' ).'>Using Sockets</option>';
|
125 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'</select>';
|
126 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<p style="cursor: text; font-size:9px; padding: 0px; margin: 0px; width: 95%; color: #AAAAAA;">Current value: <strong>'.( $plugin_options['postmethod'] == 'fopen' || $plugin_options['postmethod'] == '' ? 'Using fopen' : ( $plugin_options['postmethod'] == 'curl' ? 'Using cURL' : 'Using Sockets' ) ).'</strong></p>';
|
127 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</td>';
|
128 |
+
$echo_str .= "\n\t\t\t\t\t".'</tr>';
|
129 |
+
$echo_str .= "\n\t\t\t\t\t".'<tr>';
|
130 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<th scope="row">';
|
131 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<label for="wfu_userstatehandler">User State Handler</label>';
|
132 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</th>';
|
133 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<td>';
|
134 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<select name="wfu_userstatehandler" id="wfu_userstatehandler" value="'.$plugin_options['userstatehandler'].'">';
|
135 |
+
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<option value="session"'.( $plugin_options['userstatehandler'] == 'session' || $plugin_options['userstatehandler'] == '' ? ' selected="selected"' : '' ).'>Session (default)</option>';
|
136 |
+
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<option value="dboption"'.( $plugin_options['userstatehandler'] == 'dboption' ? ' selected="selected"' : '' ).'>DB Option</option>';
|
137 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'</select>';
|
138 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<p style="cursor: text; font-size:9px; padding: 0px; margin: 0px; width: 95%; color: #AAAAAA;">Current value: <strong>'.( $plugin_options['userstatehandler'] == 'session' || $plugin_options['userstatehandler'] == '' ? 'Session' : ( $plugin_options['userstatehandler'] == 'dboption' ? 'DB Option' : 'Session' ) ).'</strong></p>';
|
139 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</td>';
|
140 |
+
$echo_str .= "\n\t\t\t\t\t".'</tr>';
|
141 |
+
$echo_str .= "\n\t\t\t\t\t".'<tr>';
|
142 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<th scope="row">';
|
143 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<label for="wfu_relaxcss">Relax CSS Rules</label>';
|
144 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</th>';
|
145 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<td>';
|
146 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<input name="wfu_relaxcss" id="wfu_relaxcss" type="checkbox"'.($plugin_options['relaxcss'] == '1' ? ' checked="checked"' : '' ).' style="width:auto;" /> If enabled then the textboxes and the buttons of the plugin will inherit the theme\'s styling';
|
147 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<p style="cursor: text; font-size:9px; padding: 0px; margin: 0px; width: 95%; color: #AAAAAA;">Current value: <strong>'.($plugin_options['relaxcss'] == '1' ? 'Yes' : 'No' ).'</strong></p>';
|
148 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</td>';
|
149 |
+
$echo_str .= "\n\t\t\t\t\t".'</tr>';
|
150 |
+
$echo_str .= "\n\t\t\t\t\t".'<tr>';
|
151 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<th scope="row">';
|
152 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<label for="wfu_admindomain">Admin Domain</label>';
|
153 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</th>';
|
154 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<td>';
|
155 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<select name="wfu_admindomain" id="wfu_admindomain" value="'.$plugin_options['admindomain'].'">';
|
156 |
+
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<option value="siteurl"'.( $plugin_options['admindomain'] == 'siteurl' || $plugin_options['admindomain'] == '' ? ' selected="selected"' : '' ).'>Using site_url (default)</option>';
|
157 |
+
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<option value="adminurl"'.( $plugin_options['admindomain'] == 'adminurl' ? ' selected="selected"' : '' ).'>Using admin_url</option>';
|
158 |
+
$echo_str .= "\n\t\t\t\t\t\t\t\t".'<option value="homeurl"'.( $plugin_options['admindomain'] == 'homeurl' ? ' selected="selected"' : '' ).'>Using home_url</option>';
|
159 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'</select>';
|
160 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<p style="cursor: text; font-size:9px; padding: 0px; margin: 0px; width: 95%; color: #AAAAAA;">Current value: <strong>'.( $plugin_options['admindomain'] == 'siteurl' || $plugin_options['admindomain'] == '' ? 'Using site_url' : ( $plugin_options['admindomain'] == 'adminurl' ? 'Using admin_url' : 'Using home_url' ) ).'</strong></p>';
|
161 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</td>';
|
162 |
+
$echo_str .= "\n\t\t\t\t\t".'</tr>';
|
163 |
+
$echo_str .= "\n\t\t\t\t\t".'<tr>';
|
164 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<th scope="row">';
|
165 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<label for="wfu_mediacustom">Show Custom Fields in Media Library</label>';
|
166 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</th>';
|
167 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<td>';
|
168 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<input name="wfu_mediacustom" id="wfu_mediacustom" type="checkbox"'.($plugin_options['mediacustom'] == '1' ? ' checked="checked"' : '' ).' style="width:auto;" /> If enabled and the uploaded files are added to Media Library then any user fields submitted together with the files will be shown in Media Library';
|
169 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<p style="cursor: text; font-size:9px; padding: 0px; margin: 0px; width: 95%; color: #AAAAAA;">Current value: <strong>'.($plugin_options['mediacustom'] == '1' ? 'Yes' : 'No' ).'</strong></p>';
|
170 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</td>';
|
171 |
+
$echo_str .= "\n\t\t\t\t\t".'</tr>';
|
172 |
+
$echo_str .= "\n\t\t\t\t\t".'<tr>';
|
173 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<th scope="row">';
|
174 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<label for="wfu_includeotherfiles">Include Other Files in Plugin\'s Database</label>';
|
175 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</th>';
|
176 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<td>';
|
177 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<input name="wfu_includeotherfiles" id="wfu_includeotherfiles" type="checkbox"'.($plugin_options['includeotherfiles'] == '1' ? ' checked="checked"' : '' ).' style="width:auto;" /> If enabled administrators can include in the plugin\'s database additional files through the File Browser';
|
178 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<p style="cursor: text; font-size:9px; padding: 0px; margin: 0px; width: 95%; color: #AAAAAA;">Current value: <strong>'.($plugin_options['includeotherfiles'] == '1' ? 'Yes' : 'No' ).'</strong></p>';
|
179 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</td>';
|
180 |
+
$echo_str .= "\n\t\t\t\t\t".'</tr>';
|
181 |
+
$echo_str .= "\n\t\t\t\t\t".'<tr>';
|
182 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<th scope="row">';
|
183 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<label for="wfu_altserver">Use Alternative Iptanus Server</label>';
|
184 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</th>';
|
185 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<td>';
|
186 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<input name="wfu_altserver" id="wfu_altserver" type="checkbox"'.($plugin_options['altserver'] == '1' ? ' checked="checked"' : '' ).' style="width:auto;" /> Switches to the alternative Iptanus server, residing on Google Cloud, for getting information such as latest version number.';
|
187 |
+
$echo_str .= "\n\t\t\t\t\t\t\t".'<p style="cursor: text; font-size:9px; padding: 0px; margin: 0px; width: 95%; color: #AAAAAA;">Current value: <strong>'.($plugin_options['altserver'] == '1' ? 'Yes' : 'No' ).'</strong></p>';
|
188 |
+
$echo_str .= "\n\t\t\t\t\t\t".'</td>';
|
189 |
+
$echo_str .= "\n\t\t\t\t\t".'</tr>';
|
190 |
+
$echo_str .= "\n\t\t\t\t".'</tbody>';
|
191 |
+
$echo_str .= "\n\t\t\t".'</table>';
|
192 |
+
$echo_str .= "\n\t\t\t".'<p class="submit">';
|
193 |
+
$echo_str .= "\n\t\t\t\t".'<input type="submit" class="button-primary" name="submitform" value="Update" />';
|
194 |
+
$echo_str .= "\n\t\t\t".'</p>';
|
195 |
+
$echo_str .= "\n\t\t".'</form>';
|
196 |
+
$echo_str .= "\n\t".'</div>';
|
197 |
+
$echo_str .= "\n".'</div>';
|
198 |
+
|
199 |
+
echo $echo_str;
|
200 |
+
}
|
201 |
+
|
202 |
+
|
203 |
+
function wfu_update_settings() {
|
204 |
+
if ( !current_user_can( 'manage_options' ) ) return;
|
205 |
+
if ( !check_admin_referer('wfu_edit_admin_settings') ) return;
|
206 |
+
$plugin_options = wfu_decode_plugin_options(get_option( "wordpress_file_upload_options" ));
|
207 |
+
$new_plugin_options = array();
|
208 |
+
|
209 |
+
// $enabled = ( isset($_POST['wfu_enabled']) ? ( $_POST['wfu_enabled'] == "on" ? 1 : 0 ) : 0 );
|
210 |
+
$hashfiles = ( isset($_POST['wfu_hashfiles']) ? ( $_POST['wfu_hashfiles'] == "on" ? 1 : 0 ) : 0 );
|
211 |
+
$personaldata = ( isset($_POST['wfu_personaldata']) ? ( $_POST['wfu_personaldata'] == "on" ? 1 : 0 ) : 0 );
|
212 |
+
$relaxcss = ( isset($_POST['wfu_relaxcss']) ? ( $_POST['wfu_relaxcss'] == "on" ? 1 : 0 ) : 0 );
|
213 |
+
$mediacustom = ( isset($_POST['wfu_mediacustom']) ? ( $_POST['wfu_mediacustom'] == "on" ? 1 : 0 ) : 0 );
|
214 |
+
$includeotherfiles = ( isset($_POST['wfu_includeotherfiles']) ? ( $_POST['wfu_includeotherfiles'] == "on" ? 1 : 0 ) : 0 );
|
215 |
+
$altserver = ( isset($_POST['wfu_altserver']) ? ( $_POST['wfu_altserver'] == "on" ? 1 : 0 ) : 0 );
|
216 |
+
if ( isset($_POST['wfu_basedir']) && isset($_POST['wfu_postmethod']) && isset($_POST['wfu_userstatehandler']) && isset($_POST['wfu_admindomain']) && isset($_POST['submitform']) ) {
|
217 |
+
if ( $_POST['submitform'] == "Update" ) {
|
218 |
+
$new_plugin_options['version'] = '1.0';
|
219 |
+
$new_plugin_options['shortcode'] = $plugin_options['shortcode'];
|
220 |
+
$new_plugin_options['hashfiles'] = $hashfiles;
|
221 |
+
$new_plugin_options['basedir'] = sanitize_text_field($_POST['wfu_basedir']);
|
222 |
+
$new_plugin_options['personaldata'] = $personaldata;
|
223 |
+
$new_plugin_options['postmethod'] = sanitize_text_field($_POST['wfu_postmethod']);
|
224 |
+
$new_plugin_options['userstatehandler'] = sanitize_text_field($_POST['wfu_userstatehandler']);
|
225 |
+
$new_plugin_options['relaxcss'] = $relaxcss;
|
226 |
+
$new_plugin_options['admindomain'] = sanitize_text_field($_POST['wfu_admindomain']);
|
227 |
+
$new_plugin_options['mediacustom'] = $mediacustom;
|
228 |
+
$new_plugin_options['includeotherfiles'] = $includeotherfiles;
|
229 |
+
$new_plugin_options['altserver'] = $altserver;
|
230 |
+
$encoded_options = wfu_encode_plugin_options($new_plugin_options);
|
231 |
+
update_option( "wordpress_file_upload_options", $encoded_options );
|
232 |
+
if ( $new_plugin_options['hashfiles'] == '1' && $plugin_options['hashfiles'] != '1' )
|
233 |
+
wfu_reassign_hashes();
|
234 |
+
}
|
235 |
+
}
|
236 |
+
|
237 |
+
return true;
|
238 |
+
}
|
239 |
+
|
240 |
+
|
241 |
+
?>
|
lib/wfu_admin_uploadedfiles.php
CHANGED
@@ -1,503 +1,503 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
function wfu_uploadedfiles_menu() {
|
4 |
-
$_GET = stripslashes_deep($_GET);
|
5 |
-
$tag = (!empty($_GET['tag']) ? $_GET['tag'] : '1');
|
6 |
-
$page = max((int)$tag, 1);
|
7 |
-
echo wfu_uploadedfiles_manager($page);
|
8 |
-
}
|
9 |
-
|
10 |
-
function wfu_uploadedfiles_manager($page = 1, $only_table_rows = false) {
|
11 |
-
global $wpdb;
|
12 |
-
$table_name1 = $wpdb->prefix . "wfu_log";
|
13 |
-
$table_name3 = $wpdb->prefix . "wfu_dbxqueue";
|
14 |
-
$def_other_cols = array( 'upload_date', 'user', 'properties', 'remarks', 'actions' );
|
15 |
-
|
16 |
-
if ( !current_user_can( 'manage_options' ) ) return;
|
17 |
-
|
18 |
-
$siteurl = site_url();
|
19 |
-
$maxrows = (int)WFU_VAR("WFU_UPLOADEDFILES_TABLE_MAXROWS");
|
20 |
-
|
21 |
-
//get log data from database
|
22 |
-
//$files_total = $wpdb->get_var('SELECT COUNT(idlog) FROM '.$table_name1.' WHERE action = \'upload\'');
|
23 |
-
//$filerecs = $wpdb->get_results('SELECT * FROM '.$table_name1.' WHERE action = \'upload\' ORDER BY date_from DESC'.( $maxrows > 0 ? ' LIMIT '.$maxrows.' OFFSET '.(($page - 1) * $maxrows) : '' ));
|
24 |
-
$files_total = 0;
|
25 |
-
$filerecs = array();
|
26 |
-
$has_history = false;
|
27 |
-
extract(wfu_uploadedfiles_get_filerecs($page));
|
28 |
-
|
29 |
-
//get last record already read
|
30 |
-
$last_idlog = get_option( "wordpress_file_upload_last_idlog", array( "pre" => 0, "post" => 0, "time" => 0 ) );
|
31 |
-
|
32 |
-
//get visible columns and their order
|
33 |
-
$cols = array();
|
34 |
-
$cols_raw = explode(',', WFU_VAR("WFU_UPLOADEDFILES_COLUMNS"));
|
35 |
-
//normalize column list
|
36 |
-
foreach ( $cols_raw as $ind => $col ) $cols_raw[$ind] = strtolower(trim($col));
|
37 |
-
//check if '#' column is visible
|
38 |
-
$id_visible = in_array('#', $cols_raw);
|
39 |
-
//'file' column is always visible and follows '#' column
|
40 |
-
//create an associative array $cols where keys are the columns and values
|
41 |
-
//are either true for visible columns or false for hidden ones
|
42 |
-
$visible_cols_count = 0;
|
43 |
-
foreach ( $cols_raw as $col )
|
44 |
-
if ( ($key = array_search($col, $def_other_cols)) !== false ) {
|
45 |
-
unset($def_other_cols[$key]);
|
46 |
-
$cols[$col] = true;
|
47 |
-
$visible_cols_count ++;
|
48 |
-
}
|
49 |
-
foreach ( $def_other_cols as $col ) $cols[$col] = false;
|
50 |
-
|
51 |
-
//prepare html
|
52 |
-
$echo_str = "";
|
53 |
-
if ( !$only_table_rows ) {
|
54 |
-
//Update last_idlog option so that next time Uploaded Files menu item is
|
55 |
-
//pressed files have been read.
|
56 |
-
//Option last_idlog requires a minimum interval of some seconds, defined
|
57 |
-
//by advanced variable WFU_UPLOADEDFILES_RESET_TIME, before it can be
|
58 |
-
//updated. This way, if the admin presses Uploaded Files menu item two
|
59 |
-
//times immediately, the same number of unread files will not change.
|
60 |
-
//It is noted that last_idlog option uses two values, 'pre' and 'post'.
|
61 |
-
//The way they are updated makes sure that the number of unread files
|
62 |
-
//gets reset only when Uploaded Files menu item is pressed and not
|
63 |
-
//when the admin browses through the pages of the list (when pagination
|
64 |
-
//is activated).
|
65 |
-
$limit = (int)WFU_VAR("WFU_UPLOADEDFILES_RESET_TIME");
|
66 |
-
if ( $limit == -1 || time() > $last_idlog["time"] + $limit ) {
|
67 |
-
$last_idlog["pre"] = $last_idlog["post"];
|
68 |
-
$last_idlog["post"] = $wpdb->get_var('SELECT MAX(idlog) FROM '.$table_name1);
|
69 |
-
$last_idlog["time"] = time();
|
70 |
-
update_option( "wordpress_file_upload_last_idlog", $last_idlog );
|
71 |
-
}
|
72 |
-
|
73 |
-
$echo_str .= "\n".'<div class="wrap">';
|
74 |
-
$echo_str .= "\n\t".'<h2>List of Uploaded Files</h2>';
|
75 |
-
$echo_str .= "\n\t".'<div style="position:relative;">';
|
76 |
-
$echo_str .= wfu_add_loading_overlay("\n\t\t", "uploadedfiles");
|
77 |
-
$echo_str .= "\n\t\t".'<div class="wfu_uploadedfiles_header" style="width: 100%;">';
|
78 |
-
if ( $maxrows > 0 ) {
|
79 |
-
$pages = ceil($files_total / $maxrows);
|
80 |
-
$echo_str .= wfu_add_pagination_header("\n\t\t\t", "uploadedfiles", $page, $pages);
|
81 |
-
}
|
82 |
-
$echo_str .= "\n\t\t\t".'<input id="wfu_download_file_nonce" type="hidden" value="'.wp_create_nonce('wfu_download_file_invoker').'" />';
|
83 |
-
$echo_str .= "\n\t\t".'</div>';
|
84 |
-
$echo_str .= "\n\t\t".'<table id="wfu_uploadedfiles_table" class="wfu-uploadedfiles wp-list-table widefat fixed striped">';
|
85 |
-
$echo_str .= "\n\t\t\t".'<thead>';
|
86 |
-
$echo_str .= "\n\t\t\t\t".'<tr>';
|
87 |
-
$echo_str .= "\n\t\t\t\t\t".'<th scope="col" width="5%" class="manage-column'.( $id_visible ? '' : ' hidden' ).'">';
|
88 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<label>#</label>';
|
89 |
-
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
90 |
-
$echo_str .= "\n\t\t\t\t\t".'<th scope="col" width="30%" class="manage-column column-primary">';
|
91 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<label>File</label>';
|
92 |
-
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
93 |
-
foreach ( $cols as $col => $is_visible ) {
|
94 |
-
if ( $col == 'upload_date' ) {
|
95 |
-
$echo_str .= "\n\t\t\t\t\t".'<th scope="col" width="10%" class="manage-column'.( $is_visible ? '' : ' hidden' ).'">';
|
96 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<label>Upload Date</label>';
|
97 |
-
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
98 |
-
}
|
99 |
-
elseif ( $col == 'user' ) {
|
100 |
-
$echo_str .= "\n\t\t\t\t\t".'<th scope="col" width="10%" class="manage-column'.( $is_visible ? '' : ' hidden' ).'">';
|
101 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<label>User</label>';
|
102 |
-
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
103 |
-
}
|
104 |
-
elseif ( $col == 'properties' ) {
|
105 |
-
$echo_str .= "\n\t\t\t\t\t".'<th scope="col" width="10%" class="manage-column'.( $is_visible ? '' : ' hidden' ).'">';
|
106 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<label>Properties</label>';
|
107 |
-
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
108 |
-
}
|
109 |
-
elseif ( $col == 'remarks' ) {
|
110 |
-
$echo_str .= "\n\t\t\t\t\t".'<th scope="col" width="25%" class="manage-column'.( $is_visible ? '' : ' hidden' ).'">';
|
111 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<label>Remarks</label>';
|
112 |
-
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
113 |
-
}
|
114 |
-
elseif ( $col == 'actions' ) {
|
115 |
-
$echo_str .= "\n\t\t\t\t\t".'<th scope="col" width="10%" class="manage-column'.( $is_visible ? '' : ' hidden' ).'">';
|
116 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<label>Actions</label>';
|
117 |
-
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
118 |
-
}
|
119 |
-
}
|
120 |
-
$echo_str .= "\n\t\t\t\t".'</tr>';
|
121 |
-
$echo_str .= "\n\t\t\t".'</thead>';
|
122 |
-
$echo_str .= "\n\t\t\t".'<tbody>';
|
123 |
-
}
|
124 |
-
//echo the number of unread uploaded files in order to update the
|
125 |
-
//notification bubble of the toplevel menu item
|
126 |
-
$unread_files_count = wfu_get_new_files_count($last_idlog["pre"]);
|
127 |
-
$echo_str .= "\n\t\t\t".'<!-- wfu_uploadedfiles_unread['.$unread_files_count.'] -->';
|
128 |
-
|
129 |
-
$i = ($page - 1) * $maxrows;
|
130 |
-
$abspath_notrailing_slash = substr(wfu_abspath(), 0, -1);
|
131 |
-
$pagecode = wfu_safe_store_browser_params('wfu_uploaded_files&tag='.$page);
|
132 |
-
$nopagecode = wfu_safe_store_browser_params('no_referer');
|
133 |
-
foreach ( $filerecs as $filerec ) {
|
134 |
-
$i ++;
|
135 |
-
$initialrec = $filerec;
|
136 |
-
//get all newer associated file records
|
137 |
-
$historyrecs = array();
|
138 |
-
if ( $has_history ) $historyrecs = $filerec->history;
|
139 |
-
else $historyrecs = wfu_get_rec_new_history($initialrec->idlog);
|
140 |
-
//get the latest record of this upload
|
141 |
-
$filerec = $historyrecs[count($historyrecs) - 1];
|
142 |
-
$filedata = wfu_get_filedata_from_rec($filerec, false, true, false);
|
143 |
-
if ( $filedata == null ) $filedata = array();
|
144 |
-
|
145 |
-
$echo_str .= "\n\t\t\t\t".'<tr class="wfu_row-'.$i.( $initialrec->idlog > $last_idlog["pre"] ? ' wfu_unread' : '' ).'">';
|
146 |
-
$file_relpath = ( substr($filerec->filepath, 0, 4) == 'abs:' ? substr($filerec->filepath, 4) : $filerec->filepath );
|
147 |
-
$file_abspath = wfu_path_rel2abs($filerec->filepath);
|
148 |
-
$displayed_data = array(
|
149 |
-
"file" => $file_relpath,
|
150 |
-
"date" => get_date_from_gmt($initialrec->date_from),
|
151 |
-
"user" => wfu_get_username_by_id($filerec->uploaduserid),
|
152 |
-
"properties" => '',
|
153 |
-
"remarks" => '<div class="wfu-remarks-container"></div>',
|
154 |
-
"actions" => ''
|
155 |
-
);
|
156 |
-
$properties = wfu_init_uploadedfiles_properties();
|
157 |
-
$actions = wfu_init_uploadedfiles_actions();
|
158 |
-
$remarks = '';
|
159 |
-
//check if file is stored in FTP location
|
160 |
-
$file_in_ftp = ( substr($file_abspath, 0, 6) == 'ftp://' || substr($file_abspath, 0, 7) == 'ftps://' || substr($file_abspath, 0, 7) == 'sftp://' );
|
161 |
-
//check if file resides inside WP root
|
162 |
-
$file_in_root = ( !$file_in_ftp && substr($file_abspath, 0, strlen($abspath_notrailing_slash)) == $abspath_notrailing_slash );
|
163 |
-
//check if file exists for non-ftp uploads
|
164 |
-
$file_exists = ( $file_in_ftp ? true : file_exists($file_abspath) );
|
165 |
-
//check if record is obsolete
|
166 |
-
$obsolete = ( $filerec->date_to != "0000-00-00 00:00:00" );
|
167 |
-
//check if file is associated with Media item
|
168 |
-
$has_media = ( $file_in_root && $file_exists && !$obsolete && isset($filedata["media"]) );
|
169 |
-
|
170 |
-
//update properties
|
171 |
-
$properties['status']['icon'] = ( $file_exists ? ( $obsolete ? "obsolete" : "ok" ) : "notexists" );
|
172 |
-
$properties['userdata']['visible'] = ( count(wfu_get_userdata_from_rec($filerec)) > 0 );
|
173 |
-
if ( $has_media ) {
|
174 |
-
$properties['media']['visible'] = true;
|
175 |
-
$properties['media']['remarks'] = 'File is associated with Media item ID <strong>'.$filedata["media"]["attach_id"].'</strong>';
|
176 |
-
}
|
177 |
-
$properties['ftp']['visible'] = $file_in_ftp;
|
178 |
-
//allow scripts to customize $properties
|
179 |
-
$properties = apply_filters("_wfu_uploadefiles_file_properties", $properties, $filerec, $i);
|
180 |
-
|
181 |
-
//update actions
|
182 |
-
$details_href_net = $siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=file_details&file=byID:'.$filerec->idlog;
|
183 |
-
if ( $actions['details']['allowed'] ) {
|
184 |
-
$actions['details']['visible'] = true;
|
185 |
-
$actions['details']['href'] = $details_href_net.'&invoker='.$nopagecode;
|
186 |
-
}
|
187 |
-
$media_href = null;
|
188 |
-
if ( $has_media && $actions['media']['allowed'] ) {
|
189 |
-
$actions['media']['visible'] = true;
|
190 |
-
$media_href = get_attachment_link( $filedata["media"]["attach_id"] );
|
191 |
-
$actions['media']['href'] = $media_href;
|
192 |
-
}
|
193 |
-
$adminbrowser_href = false;
|
194 |
-
if ( $file_in_root && $file_exists && !$obsolete && $actions['adminbrowser']['allowed'] ) {
|
195 |
-
$only_path = wfu_basedir($file_relpath);
|
196 |
-
$dir_code = wfu_safe_store_filepath($only_path.'{{'.wfu_basename($file_relpath).'}}');
|
197 |
-
$adminbrowser_href = $siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=file_browser&dir='.$dir_code;
|
198 |
-
$actions['adminbrowser']['visible'] = true;
|
199 |
-
$actions['adminbrowser']['href'] = $adminbrowser_href;
|
200 |
-
}
|
201 |
-
$historylog_href = $siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=view_log&invoker='.$initialrec->idlog;
|
202 |
-
if ( $actions['historylog']['allowed'] ) {
|
203 |
-
$actions['historylog']['visible'] = true;
|
204 |
-
$actions['historylog']['href'] = $historylog_href;
|
205 |
-
}
|
206 |
-
$link_href = ( $file_in_root ? site_url().( substr($file_relpath, 0, 1) == '/' ? '' : '/' ) : '' ).$file_relpath;
|
207 |
-
if ( ( $file_in_ftp || $file_in_root ) && $file_exists && !$obsolete && $actions['link']['allowed'] ) {
|
208 |
-
$actions['link']['visible'] = true;
|
209 |
-
$actions['link']['href'] = $link_href;
|
210 |
-
}
|
211 |
-
$download_href = false;
|
212 |
-
if ( !$file_in_ftp && $file_exists && !$obsolete && $actions['download']['allowed'] ) {
|
213 |
-
$file_code = wfu_safe_store_filepath(wfu_path_abs2rel($file_abspath));
|
214 |
-
$download_href = 'javascript:wfu_download_file(\''.$file_code.'\', '.$i.');';
|
215 |
-
$actions['download']['visible'] = true;
|
216 |
-
$actions['download']['href'] = $download_href;
|
217 |
-
}
|
218 |
-
//allow scripts to customize $actions
|
219 |
-
$actions = apply_filters("_wfu_uploadefiles_file_actions", $actions, $filerec, $i);
|
220 |
-
|
221 |
-
//update default file link action
|
222 |
-
$default_link = $displayed_data["file"];
|
223 |
-
if ( WFU_VAR("WFU_UPLOADEDFILES_DEFACTION") == "details" )
|
224 |
-
$default_link = '<a href="'.$details_href_net.'&invoker='.$pagecode.'" title="Go to file details">'.$file_relpath.'</a>';
|
225 |
-
elseif ( $file_in_root && $file_exists && !$obsolete && WFU_VAR("WFU_UPLOADEDFILES_DEFACTION") == "adminbrowser" ) {
|
226 |
-
if ( $adminbrowser_href === false ) {
|
227 |
-
$only_path = wfu_basedir($file_relpath);
|
228 |
-
$dir_code = wfu_safe_store_filepath($only_path.'{{'.wfu_basename($file_relpath).'}}');
|
229 |
-
$adminbrowser_href = $siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=file_browser&dir='.$dir_code;
|
230 |
-
}
|
231 |
-
$default_link = '<a href="'.$adminbrowser_href.'" title="Open file in File Browser">'.$file_relpath.'</a>';
|
232 |
-
}
|
233 |
-
elseif ( WFU_VAR("WFU_UPLOADEDFILES_DEFACTION") == "historylog" )
|
234 |
-
$default_link = '<a href="'.$historylog_href.'" title="Go to View Log record of file">'.$file_relpath.'</a>';
|
235 |
-
elseif ( ( $file_in_ftp || $file_in_root ) && $file_exists && !$obsolete && WFU_VAR("WFU_UPLOADEDFILES_DEFACTION") == "link" )
|
236 |
-
$default_link = '<a href="'.$link_href.'" title="Open file link">'.$file_relpath.'</a>';
|
237 |
-
elseif ( !$file_in_ftp && $file_exists && !$obsolete && WFU_VAR("WFU_UPLOADEDFILES_DEFACTION") == "download" ) {
|
238 |
-
if ( $download_href === false ) {
|
239 |
-
$file_code = wfu_safe_store_filepath(wfu_path_abs2rel($file_abspath));
|
240 |
-
$download_href = 'javascript:wfu_download_file(\''.$file_code.'\', '.$i.');';
|
241 |
-
}
|
242 |
-
$default_link = '<a href="'.$download_href.'" title="Download file">'.$file_relpath.'</a>';
|
243 |
-
}
|
244 |
-
//allow scripts to customize default file link action
|
245 |
-
$default_link = apply_filters("_wfu_uploadefiles_file_link", $default_link, $filerec, $i);
|
246 |
-
|
247 |
-
$displayed_data["file"] = $default_link;
|
248 |
-
$displayed_data["properties"] = wfu_render_uploadedfiles_properties($properties, $i);
|
249 |
-
$displayed_data["actions"] = wfu_render_uploadedfiles_actions($actions);
|
250 |
-
$echo_str .= "\n\t\t\t\t\t".'<th style="word-wrap: break-word;"'.( $id_visible ? '' : ' class="hidden"' ).'>'.$i.'</th>';
|
251 |
-
$echo_str .= "\n\t\t\t\t\t".'<td class="column-primary" data-colname="File">'.$displayed_data["file"];
|
252 |
-
$echo_str .= "\n\t\t\t\t\t\t".'<div id="wfu_file_download_container_'.$i.'" style="display: none;"></div>';
|
253 |
-
if ( $visible_cols_count > 0 ) $echo_str .= "\n\t\t\t\t\t\t".'<button type="button" class="toggle-row"><span class="screen-reader-text">Show more details</span></button>';
|
254 |
-
$echo_str .= "\n\t\t\t\t\t".'</td>';
|
255 |
-
foreach ( $cols as $col => $is_visible )
|
256 |
-
if ( $col == 'upload_date' ) $echo_str .= "\n\t\t\t\t\t".'<td data-colname="Upload Date"'.( $is_visible ? '' : ' class="hidden"' ).'>'.$displayed_data["date"].'</td>';
|
257 |
-
elseif ( $col == 'user' ) $echo_str .= "\n\t\t\t\t\t".'<td data-colname="User"'.( $is_visible ? '' : ' class="hidden"' ).'>'.$displayed_data["user"].'</td>';
|
258 |
-
elseif ( $col == 'properties' ) $echo_str .= "\n\t\t\t\t\t".'<td data-colname="Properties"'.( $is_visible ? '' : ' class="hidden"' ).'>'.$displayed_data["properties"].'</td>';
|
259 |
-
elseif ( $col == 'remarks' ) $echo_str .= "\n\t\t\t\t\t".'<td data-colname="Remarks"'.( $is_visible ? '' : ' class="hidden"' ).'>'.$displayed_data["remarks"].'</td>';
|
260 |
-
elseif ( $col == 'actions' ) $echo_str .= "\n\t\t\t\t\t".'<td data-colname="Actions"'.( $is_visible ? '' : ' class="hidden"' ).'>'.$displayed_data["actions"].'</td>';
|
261 |
-
$echo_str .= "\n\t\t\t\t".'</tr>';
|
262 |
-
}
|
263 |
-
if ( !$only_table_rows ) {
|
264 |
-
$echo_str .= "\n\t\t\t".'</tbody>';
|
265 |
-
$echo_str .= "\n\t\t".'</table>';
|
266 |
-
$echo_str .= "\n\t".'</div>';
|
267 |
-
$handler = 'function() { wfu_attach_uploadedfiles_events(); }';
|
268 |
-
$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>';
|
269 |
-
$echo_str .= "\n".'</div>';
|
270 |
-
}
|
271 |
-
|
272 |
-
//allow scripts to customize HTML output before return
|
273 |
-
$echo_str = apply_filters("_wfu_uploadedfiles_output", $echo_str, $page, $only_table_rows);
|
274 |
-
return $echo_str;
|
275 |
-
}
|
276 |
-
|
277 |
-
function wfu_uploadedfiles_get_filerecs($page) {
|
278 |
-
$a = func_get_args(); $a = WFU_FUNCTION_HOOK(__FUNCTION__, $a, $out); if (isset($out['vars'])) foreach($out['vars'] as $p => $v) $$p = $v; switch($a) { case 'R': return $out['output']; break; case 'D': die($out['output']); }
|
279 |
-
global $wpdb;
|
280 |
-
$table_name1 = $wpdb->prefix . "wfu_log";
|
281 |
-
$maxrows = (int)WFU_VAR("WFU_UPLOADEDFILES_TABLE_MAXROWS");
|
282 |
-
$ret = array(
|
283 |
-
"files_total" => 0,
|
284 |
-
"filerecs" => array(),
|
285 |
-
"has_history" => false
|
286 |
-
);
|
287 |
-
|
288 |
-
if ( WFU_VAR("WFU_UPLOADEDFILES_HIDEINVALID") != "true" ) {
|
289 |
-
$ret["files_total"] = $wpdb->get_var('SELECT COUNT(idlog) FROM '.$table_name1.' WHERE action = \'upload\'');
|
290 |
-
$ret["filerecs"] = $wpdb->get_results('SELECT * FROM '.$table_name1.' WHERE action = \'upload\' ORDER BY date_from DESC'.( $maxrows > 0 ? ' LIMIT '.$maxrows.' OFFSET '.(($page - 1) * $maxrows) : '' ));
|
291 |
-
}
|
292 |
-
else {
|
293 |
-
$filerecs = $wpdb->get_results('SELECT * FROM '.$table_name1.' WHERE action = \'upload\' ORDER BY date_from DESC');
|
294 |
-
foreach ( $filerecs as $ind => $filerec ) {
|
295 |
-
$initialrec = $filerec;
|
296 |
-
//get all newer associated file records
|
297 |
-
$historyrecs = wfu_get_rec_new_history($initialrec->idlog);
|
298 |
-
//get the latest record of this upload
|
299 |
-
$filerec = $historyrecs[count($historyrecs) - 1];
|
300 |
-
$file_abspath = wfu_path_rel2abs($filerec->filepath);
|
301 |
-
//check if file is stored in FTP location
|
302 |
-
$file_in_ftp = ( substr($file_abspath, 0, 6) == 'ftp://' || substr($file_abspath, 0, 7) == 'ftps://' || substr($file_abspath, 0, 7) == 'sftp://' );
|
303 |
-
//check if file exists for non-ftp uploads
|
304 |
-
$file_exists = ( $file_in_ftp ? true : file_exists($file_abspath) );
|
305 |
-
//check if record is obsolete
|
306 |
-
$obsolete = ( $filerec->date_to != "0000-00-00 00:00:00" );
|
307 |
-
if ( !$file_exists || $obsolete ) unset($filerecs[$ind]);
|
308 |
-
else $filerecs[$ind]->history = $historyrecs;
|
309 |
-
}
|
310 |
-
$ret["files_total"] = count($filerecs);
|
311 |
-
if ( $maxrows > 0 ) $filerecs = array_slice($filerecs, ($page - 1) * $maxrows, $maxrows);
|
312 |
-
$ret["filerecs"] = $filerecs;
|
313 |
-
$ret["has_history"] = true;
|
314 |
-
}
|
315 |
-
|
316 |
-
return $ret;
|
317 |
-
}
|
318 |
-
|
319 |
-
function wfu_init_uploadedfiles_properties() {
|
320 |
-
$props["status"] = array(
|
321 |
-
"icon" => "obsolete",
|
322 |
-
"icon-list" => array(
|
323 |
-
"ok" => "dashicons-yes",
|
324 |
-
"notexists" => "dashicons-trash",
|
325 |
-
"obsolete" => "dashicons-warning"
|
326 |
-
),
|
327 |
-
"title" => "",
|
328 |
-
"title-list" => array(
|
329 |
-
"ok" => "File is Ok",
|
330 |
-
"notexists" => "File does not exist",
|
331 |
-
"obsolete" => "Record is invalid"
|
332 |
-
),
|
333 |
-
"visible" => true,
|
334 |
-
"remarks" => '',
|
335 |
-
"remarks-list" => array(
|
336 |
-
"ok" => "File uploaded successfully to the website",
|
337 |
-
"notexists" => "File does not exist anymore in the website",
|
338 |
-
"obsolete" => "Record is not valid anymore"
|
339 |
-
),
|
340 |
-
"code" => wfu_create_random_string(6)
|
341 |
-
);
|
342 |
-
$props["userdata"] = array(
|
343 |
-
"icon" => "dashicons-id-alt",
|
344 |
-
"title" => "File has user data",
|
345 |
-
"visible" => false,
|
346 |
-
"remarks" => 'File has user data, accessible in File Details',
|
347 |
-
"code" => wfu_create_random_string(6)
|
348 |
-
);
|
349 |
-
$props["media"] = array(
|
350 |
-
"icon" => "dashicons-admin-media",
|
351 |
-
"title" => "File is associated with Media item",
|
352 |
-
"visible" => false,
|
353 |
-
"remarks" => 'File is associated with Media item',
|
354 |
-
"code" => wfu_create_random_string(6)
|
355 |
-
);
|
356 |
-
$props["ftp"] = array(
|
357 |
-
"icon" => "wfu-dashicons-ftp",
|
358 |
-
"title" => "File saved in FTP",
|
359 |
-
"visible" => false,
|
360 |
-
"remarks" => 'File has been saved in FTP location',
|
361 |
-
"code" => wfu_create_random_string(6)
|
362 |
-
);
|
363 |
-
|
364 |
-
return $props;
|
365 |
-
}
|
366 |
-
|
367 |
-
function wfu_init_uploadedfiles_actions() {
|
368 |
-
$def_actions["details"] = array(
|
369 |
-
"icon" => "dashicons-info",
|
370 |
-
"title" => "View file details",
|
371 |
-
"allowed" => false,
|
372 |
-
"visible" => false,
|
373 |
-
"href" => ""
|
374 |
-
);
|
375 |
-
$def_actions["media"] = array(
|
376 |
-
"icon" => "wfu-dashicons-media-external",
|
377 |
-
"title" => "Open associated Media item",
|
378 |
-
"allowed" => false,
|
379 |
-
"visible" => false,
|
380 |
-
"href" => ""
|
381 |
-
);
|
382 |
-
$def_actions["adminbrowser"] = array(
|
383 |
-
"icon" => "dashicons-portfolio",
|
384 |
-
"title" => "Locate file in File Browser",
|
385 |
-
"allowed" => false,
|
386 |
-
"visible" => false,
|
387 |
-
"href" => ""
|
388 |
-
);
|
389 |
-
$def_actions["historylog"] = array(
|
390 |
-
"icon" => "dashicons-backup",
|
391 |
-
"title" => "Locate file record in View Log",
|
392 |
-
"allowed" => false,
|
393 |
-
"visible" => false,
|
394 |
-
"href" => ""
|
395 |
-
);
|
396 |
-
$def_actions["link"] = array(
|
397 |
-
"icon" => "dashicons-external",
|
398 |
-
"title" => "Open file link",
|
399 |
-
"allowed" => false,
|
400 |
-
"visible" => false,
|
401 |
-
"href" => ""
|
402 |
-
);
|
403 |
-
$def_actions["download"] = array(
|
404 |
-
"icon" => "dashicons-download",
|
405 |
-
"title" => "Download file",
|
406 |
-
"allowed" => false,
|
407 |
-
"visible" => false,
|
408 |
-
"href" => ""
|
409 |
-
);
|
410 |
-
|
411 |
-
//get visible actions and their order
|
412 |
-
$actions = array();
|
413 |
-
$actions_raw = explode(',', WFU_VAR("WFU_UPLOADEDFILES_ACTIONS"));
|
414 |
-
//normalize action list
|
415 |
-
foreach ( $actions_raw as $ind => $action ) $actions_raw[$ind] = strtolower(trim($action));
|
416 |
-
//generate associative array of actions adjusting order and 'allowed'
|
417 |
-
//property
|
418 |
-
foreach ( $actions_raw as $ind => $action )
|
419 |
-
if ( isset($def_actions[$action]) ) {
|
420 |
-
$actions[$action] = $def_actions[$action];
|
421 |
-
$actions[$action]['allowed'] = true;
|
422 |
-
unset($def_actions[$action]);
|
423 |
-
}
|
424 |
-
foreach ( $def_actions as $action => $props ) $actions[$action] = $props;
|
425 |
-
|
426 |
-
return $actions;
|
427 |
-
}
|
428 |
-
|
429 |
-
function wfu_render_uploadedfiles_properties($props, $index) {
|
430 |
-
$a = func_get_args(); switch(WFU_FUNCTION_HOOK(__FUNCTION__, $a, $out)) { case 'X': break; case 'R': return $out; break; case 'D': die($out); break; }
|
431 |
-
$i = 0;
|
432 |
-
$echo_str = "";
|
433 |
-
foreach ( $props as $key => $prop ) {
|
434 |
-
$ii = $i + 1;
|
435 |
-
$iconclass = $prop['icon'];
|
436 |
-
if ( isset($prop['icon-list']) ) $iconclass = $prop['icon-list'][$prop['icon']];
|
437 |
-
$title = $prop['title'];
|
438 |
-
if ( isset($prop['title-list']) ) $title = $prop['title-list'][$prop['icon']];
|
439 |
-
$remarks = $prop['remarks'];
|
440 |
-
if ( isset($prop['remarks-list']) ) $remarks = $prop['remarks-list'][$prop['icon']];
|
441 |
-
$echo_str .= '<div id="p_'.$index.'_'.$ii.'" class="wfu-properties dashicons '.$iconclass.( $i == 0 ? '' : ' wfu-dashicons-after' ).( $prop['visible'] ? '' : ' wfu-dashicons-hidden' ).'" title="'.$title.'"><input type="hidden" class="wfu-remarks" value="'.wfu_plugin_encode_string($remarks).'" /></div>';
|
442 |
-
$i ++;
|
443 |
-
}
|
444 |
-
|
445 |
-
return $echo_str;
|
446 |
-
}
|
447 |
-
|
448 |
-
function wfu_render_uploadedfiles_actions($actions) {
|
449 |
-
$a = func_get_args(); switch(WFU_FUNCTION_HOOK(__FUNCTION__, $a, $out)) { case 'X': break; case 'R': return $out; break; case 'D': die($out); break; }
|
450 |
-
$i = 0;
|
451 |
-
$echo_str = "";
|
452 |
-
foreach ( $actions as $key => $action ) {
|
453 |
-
$iconclass = $action['icon'];
|
454 |
-
if ( isset($action['icon-list']) ) $iconclass = $action['icon-list'][$action['icon']];
|
455 |
-
$title = $action['title'];
|
456 |
-
if ( isset($action['title-list']) ) $title = $action['title-list'][$action['icon']];
|
457 |
-
$echo_str .= '<a class="dashicons '.$iconclass.( $i == 0 ? '' : ' wfu-dashicons-after' ).( $action['visible'] ? '' : ' wfu-dashicons-hidden' ).'" href="'.$action['href'].'" target="_blank" title="'.$title.'"></a>';
|
458 |
-
$i ++;
|
459 |
-
}
|
460 |
-
|
461 |
-
return $echo_str;
|
462 |
-
}
|
463 |
-
|
464 |
-
function wfu_admin_toolbar_new_uploads() {
|
465 |
-
global $wp_admin_bar;
|
466 |
-
|
467 |
-
if ( WFU_VAR("WFU_UPLOADEDFILES_BARMENU") == "true" ) {
|
468 |
-
//get the number of new (unread) uploaded files
|
469 |
-
$unread_files_count = wfu_get_unread_files_count();
|
470 |
-
$text = $unread_files_count;
|
471 |
-
if ( $unread_files_count > 99 ) $text = "99+";
|
472 |
-
$title = ( $unread_files_count == 0 ? 'No new files uploaded' : ( $unread_files_count == 1 ? '1 new file uploaded' : $unread_files_count.' files uploaded' ) );
|
473 |
-
|
474 |
-
$args = array(
|
475 |
-
'id' => 'wfu_uploads',
|
476 |
-
'title' => '<span class="ab-icon"></span><span class="ab-label">'.$unread_files_count.'</span><span class="screen-reader-text">'.$title.'</span>',
|
477 |
-
'href' => admin_url( 'admin.php?page=wfu_uploaded_files' ),
|
478 |
-
'group' => false,
|
479 |
-
'meta' => array(
|
480 |
-
'title' => $title,
|
481 |
-
'class' => ( $unread_files_count == 0 && WFU_VAR("WFU_UPLOADEDFILES_BARAUTOHIDE") == "true" ? 'hidden' : '' )
|
482 |
-
),
|
483 |
-
);
|
484 |
-
$wp_admin_bar->add_menu( $args );
|
485 |
-
}
|
486 |
-
}
|
487 |
-
|
488 |
-
function wfu_uploadedfiles_screen_options() {
|
489 |
-
global $wfu_uploadedfiles_hook_suffix;
|
490 |
-
|
491 |
-
$screen = get_current_screen();
|
492 |
-
// get out of here if we are not on uploadedfiles page
|
493 |
-
if( !is_object($screen) || $screen->id != $wfu_uploadedfiles_hook_suffix ) return;
|
494 |
-
|
495 |
-
$args = array(
|
496 |
-
'label' => 'Files per page',
|
497 |
-
'default' => WFU_VAR("WFU_UPLOADEDFILES_TABLE_MAXROWS"),
|
498 |
-
'option' => 'wfu_uploadedfiles_per_page'
|
499 |
-
);
|
500 |
-
add_screen_option( 'per_page', $args );
|
501 |
-
}
|
502 |
-
|
503 |
-
?>
|
1 |
+
<?php
|
2 |
+
|
3 |
+
function wfu_uploadedfiles_menu() {
|
4 |
+
$_GET = stripslashes_deep($_GET);
|
5 |
+
$tag = (!empty($_GET['tag']) ? $_GET['tag'] : '1');
|
6 |
+
$page = max((int)$tag, 1);
|
7 |
+
echo wfu_uploadedfiles_manager($page);
|
8 |
+
}
|
9 |
+
|
10 |
+
function wfu_uploadedfiles_manager($page = 1, $only_table_rows = false) {
|
11 |
+
global $wpdb;
|
12 |
+
$table_name1 = $wpdb->prefix . "wfu_log";
|
13 |
+
$table_name3 = $wpdb->prefix . "wfu_dbxqueue";
|
14 |
+
$def_other_cols = array( 'upload_date', 'user', 'properties', 'remarks', 'actions' );
|
15 |
+
|
16 |
+
if ( !current_user_can( 'manage_options' ) ) return;
|
17 |
+
|
18 |
+
$siteurl = site_url();
|
19 |
+
$maxrows = (int)WFU_VAR("WFU_UPLOADEDFILES_TABLE_MAXROWS");
|
20 |
+
|
21 |
+
//get log data from database
|
22 |
+
//$files_total = $wpdb->get_var('SELECT COUNT(idlog) FROM '.$table_name1.' WHERE action = \'upload\'');
|
23 |
+
//$filerecs = $wpdb->get_results('SELECT * FROM '.$table_name1.' WHERE action = \'upload\' ORDER BY date_from DESC'.( $maxrows > 0 ? ' LIMIT '.$maxrows.' OFFSET '.(($page - 1) * $maxrows) : '' ));
|
24 |
+
$files_total = 0;
|
25 |
+
$filerecs = array();
|
26 |
+
$has_history = false;
|
27 |
+
extract(wfu_uploadedfiles_get_filerecs($page));
|
28 |
+
|
29 |
+
//get last record already read
|
30 |
+
$last_idlog = get_option( "wordpress_file_upload_last_idlog", array( "pre" => 0, "post" => 0, "time" => 0 ) );
|
31 |
+
|
32 |
+
//get visible columns and their order
|
33 |
+
$cols = array();
|
34 |
+
$cols_raw = explode(',', WFU_VAR("WFU_UPLOADEDFILES_COLUMNS"));
|
35 |
+
//normalize column list
|
36 |
+
foreach ( $cols_raw as $ind => $col ) $cols_raw[$ind] = strtolower(trim($col));
|
37 |
+
//check if '#' column is visible
|
38 |
+
$id_visible = in_array('#', $cols_raw);
|
39 |
+
//'file' column is always visible and follows '#' column
|
40 |
+
//create an associative array $cols where keys are the columns and values
|
41 |
+
//are either true for visible columns or false for hidden ones
|
42 |
+
$visible_cols_count = 0;
|
43 |
+
foreach ( $cols_raw as $col )
|
44 |
+
if ( ($key = array_search($col, $def_other_cols)) !== false ) {
|
45 |
+
unset($def_other_cols[$key]);
|
46 |
+
$cols[$col] = true;
|
47 |
+
$visible_cols_count ++;
|
48 |
+
}
|
49 |
+
foreach ( $def_other_cols as $col ) $cols[$col] = false;
|
50 |
+
|
51 |
+
//prepare html
|
52 |
+
$echo_str = "";
|
53 |
+
if ( !$only_table_rows ) {
|
54 |
+
//Update last_idlog option so that next time Uploaded Files menu item is
|
55 |
+
//pressed files have been read.
|
56 |
+
//Option last_idlog requires a minimum interval of some seconds, defined
|
57 |
+
//by advanced variable WFU_UPLOADEDFILES_RESET_TIME, before it can be
|
58 |
+
//updated. This way, if the admin presses Uploaded Files menu item two
|
59 |
+
//times immediately, the same number of unread files will not change.
|
60 |
+
//It is noted that last_idlog option uses two values, 'pre' and 'post'.
|
61 |
+
//The way they are updated makes sure that the number of unread files
|
62 |
+
//gets reset only when Uploaded Files menu item is pressed and not
|
63 |
+
//when the admin browses through the pages of the list (when pagination
|
64 |
+
//is activated).
|
65 |
+
$limit = (int)WFU_VAR("WFU_UPLOADEDFILES_RESET_TIME");
|
66 |
+
if ( $limit == -1 || time() > $last_idlog["time"] + $limit ) {
|
67 |
+
$last_idlog["pre"] = $last_idlog["post"];
|
68 |
+
$last_idlog["post"] = $wpdb->get_var('SELECT MAX(idlog) FROM '.$table_name1);
|
69 |
+
$last_idlog["time"] = time();
|
70 |
+
update_option( "wordpress_file_upload_last_idlog", $last_idlog );
|
71 |
+
}
|
72 |
+
|
73 |
+
$echo_str .= "\n".'<div class="wrap">';
|
74 |
+
$echo_str .= "\n\t".'<h2>List of Uploaded Files</h2>';
|
75 |
+
$echo_str .= "\n\t".'<div style="position:relative;">';
|
76 |
+
$echo_str .= wfu_add_loading_overlay("\n\t\t", "uploadedfiles");
|
77 |
+
$echo_str .= "\n\t\t".'<div class="wfu_uploadedfiles_header" style="width: 100%;">';
|
78 |
+
if ( $maxrows > 0 ) {
|
79 |
+
$pages = ceil($files_total / $maxrows);
|
80 |
+
$echo_str .= wfu_add_pagination_header("\n\t\t\t", "uploadedfiles", $page, $pages);
|
81 |
+
}
|
82 |
+
$echo_str .= "\n\t\t\t".'<input id="wfu_download_file_nonce" type="hidden" value="'.wp_create_nonce('wfu_download_file_invoker').'" />';
|
83 |
+
$echo_str .= "\n\t\t".'</div>';
|
84 |
+
$echo_str .= "\n\t\t".'<table id="wfu_uploadedfiles_table" class="wfu-uploadedfiles wp-list-table widefat fixed striped">';
|
85 |
+
$echo_str .= "\n\t\t\t".'<thead>';
|
86 |
+
$echo_str .= "\n\t\t\t\t".'<tr>';
|
87 |
+
$echo_str .= "\n\t\t\t\t\t".'<th scope="col" width="5%" class="manage-column'.( $id_visible ? '' : ' hidden' ).'">';
|
88 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<label>#</label>';
|
89 |
+
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
90 |
+
$echo_str .= "\n\t\t\t\t\t".'<th scope="col" width="30%" class="manage-column column-primary">';
|
91 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<label>File</label>';
|
92 |
+
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
93 |
+
foreach ( $cols as $col => $is_visible ) {
|
94 |
+
if ( $col == 'upload_date' ) {
|
95 |
+
$echo_str .= "\n\t\t\t\t\t".'<th scope="col" width="10%" class="manage-column'.( $is_visible ? '' : ' hidden' ).'">';
|
96 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<label>Upload Date</label>';
|
97 |
+
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
98 |
+
}
|
99 |
+
elseif ( $col == 'user' ) {
|
100 |
+
$echo_str .= "\n\t\t\t\t\t".'<th scope="col" width="10%" class="manage-column'.( $is_visible ? '' : ' hidden' ).'">';
|
101 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<label>User</label>';
|
102 |
+
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
103 |
+
}
|
104 |
+
elseif ( $col == 'properties' ) {
|
105 |
+
$echo_str .= "\n\t\t\t\t\t".'<th scope="col" width="10%" class="manage-column'.( $is_visible ? '' : ' hidden' ).'">';
|
106 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<label>Properties</label>';
|
107 |
+
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
108 |
+
}
|
109 |
+
elseif ( $col == 'remarks' ) {
|
110 |
+
$echo_str .= "\n\t\t\t\t\t".'<th scope="col" width="25%" class="manage-column'.( $is_visible ? '' : ' hidden' ).'">';
|
111 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<label>Remarks</label>';
|
112 |
+
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
113 |
+
}
|
114 |
+
elseif ( $col == 'actions' ) {
|
115 |
+
$echo_str .= "\n\t\t\t\t\t".'<th scope="col" width="10%" class="manage-column'.( $is_visible ? '' : ' hidden' ).'">';
|
116 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<label>Actions</label>';
|
117 |
+
$echo_str .= "\n\t\t\t\t\t".'</th>';
|
118 |
+
}
|
119 |
+
}
|
120 |
+
$echo_str .= "\n\t\t\t\t".'</tr>';
|
121 |
+
$echo_str .= "\n\t\t\t".'</thead>';
|
122 |
+
$echo_str .= "\n\t\t\t".'<tbody>';
|
123 |
+
}
|
124 |
+
//echo the number of unread uploaded files in order to update the
|
125 |
+
//notification bubble of the toplevel menu item
|
126 |
+
$unread_files_count = wfu_get_new_files_count($last_idlog["pre"]);
|
127 |
+
$echo_str .= "\n\t\t\t".'<!-- wfu_uploadedfiles_unread['.$unread_files_count.'] -->';
|
128 |
+
|
129 |
+
$i = ($page - 1) * $maxrows;
|
130 |
+
$abspath_notrailing_slash = substr(wfu_abspath(), 0, -1);
|
131 |
+
$pagecode = wfu_safe_store_browser_params('wfu_uploaded_files&tag='.$page);
|
132 |
+
$nopagecode = wfu_safe_store_browser_params('no_referer');
|
133 |
+
foreach ( $filerecs as $filerec ) {
|
134 |
+
$i ++;
|
135 |
+
$initialrec = $filerec;
|
136 |
+
//get all newer associated file records
|
137 |
+
$historyrecs = array();
|
138 |
+
if ( $has_history ) $historyrecs = $filerec->history;
|
139 |
+
else $historyrecs = wfu_get_rec_new_history($initialrec->idlog);
|
140 |
+
//get the latest record of this upload
|
141 |
+
$filerec = $historyrecs[count($historyrecs) - 1];
|
142 |
+
$filedata = wfu_get_filedata_from_rec($filerec, false, true, false);
|
143 |
+
if ( $filedata == null ) $filedata = array();
|
144 |
+
|
145 |
+
$echo_str .= "\n\t\t\t\t".'<tr class="wfu_row-'.$i.( $initialrec->idlog > $last_idlog["pre"] ? ' wfu_unread' : '' ).'">';
|
146 |
+
$file_relpath = ( substr($filerec->filepath, 0, 4) == 'abs:' ? substr($filerec->filepath, 4) : $filerec->filepath );
|
147 |
+
$file_abspath = wfu_path_rel2abs($filerec->filepath);
|
148 |
+
$displayed_data = array(
|
149 |
+
"file" => $file_relpath,
|
150 |
+
"date" => get_date_from_gmt($initialrec->date_from),
|
151 |
+
"user" => wfu_get_username_by_id($filerec->uploaduserid),
|
152 |
+
"properties" => '',
|
153 |
+
"remarks" => '<div class="wfu-remarks-container"></div>',
|
154 |
+
"actions" => ''
|
155 |
+
);
|
156 |
+
$properties = wfu_init_uploadedfiles_properties();
|
157 |
+
$actions = wfu_init_uploadedfiles_actions();
|
158 |
+
$remarks = '';
|
159 |
+
//check if file is stored in FTP location
|
160 |
+
$file_in_ftp = ( substr($file_abspath, 0, 6) == 'ftp://' || substr($file_abspath, 0, 7) == 'ftps://' || substr($file_abspath, 0, 7) == 'sftp://' );
|
161 |
+
//check if file resides inside WP root
|
162 |
+
$file_in_root = ( !$file_in_ftp && substr($file_abspath, 0, strlen($abspath_notrailing_slash)) == $abspath_notrailing_slash );
|
163 |
+
//check if file exists for non-ftp uploads
|
164 |
+
$file_exists = ( $file_in_ftp ? true : file_exists($file_abspath) );
|
165 |
+
//check if record is obsolete
|
166 |
+
$obsolete = ( $filerec->date_to != "0000-00-00 00:00:00" );
|
167 |
+
//check if file is associated with Media item
|
168 |
+
$has_media = ( $file_in_root && $file_exists && !$obsolete && isset($filedata["media"]) );
|
169 |
+
|
170 |
+
//update properties
|
171 |
+
$properties['status']['icon'] = ( $file_exists ? ( $obsolete ? "obsolete" : "ok" ) : "notexists" );
|
172 |
+
$properties['userdata']['visible'] = ( count(wfu_get_userdata_from_rec($filerec)) > 0 );
|
173 |
+
if ( $has_media ) {
|
174 |
+
$properties['media']['visible'] = true;
|
175 |
+
$properties['media']['remarks'] = 'File is associated with Media item ID <strong>'.$filedata["media"]["attach_id"].'</strong>';
|
176 |
+
}
|
177 |
+
$properties['ftp']['visible'] = $file_in_ftp;
|
178 |
+
//allow scripts to customize $properties
|
179 |
+
$properties = apply_filters("_wfu_uploadefiles_file_properties", $properties, $filerec, $i);
|
180 |
+
|
181 |
+
//update actions
|
182 |
+
$details_href_net = $siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=file_details&file=byID:'.$filerec->idlog;
|
183 |
+
if ( $actions['details']['allowed'] ) {
|
184 |
+
$actions['details']['visible'] = true;
|
185 |
+
$actions['details']['href'] = $details_href_net.'&invoker='.$nopagecode;
|
186 |
+
}
|
187 |
+
$media_href = null;
|
188 |
+
if ( $has_media && $actions['media']['allowed'] ) {
|
189 |
+
$actions['media']['visible'] = true;
|
190 |
+
$media_href = get_attachment_link( $filedata["media"]["attach_id"] );
|
191 |
+
$actions['media']['href'] = $media_href;
|
192 |
+
}
|
193 |
+
$adminbrowser_href = false;
|
194 |
+
if ( $file_in_root && $file_exists && !$obsolete && $actions['adminbrowser']['allowed'] ) {
|
195 |
+
$only_path = wfu_basedir($file_relpath);
|
196 |
+
$dir_code = wfu_safe_store_filepath($only_path.'{{'.wfu_basename($file_relpath).'}}');
|
197 |
+
$adminbrowser_href = $siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=file_browser&dir='.$dir_code;
|
198 |
+
$actions['adminbrowser']['visible'] = true;
|
199 |
+
$actions['adminbrowser']['href'] = $adminbrowser_href;
|
200 |
+
}
|
201 |
+
$historylog_href = $siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=view_log&invoker='.$initialrec->idlog;
|
202 |
+
if ( $actions['historylog']['allowed'] ) {
|
203 |
+
$actions['historylog']['visible'] = true;
|
204 |
+
$actions['historylog']['href'] = $historylog_href;
|
205 |
+
}
|
206 |
+
$link_href = ( $file_in_root ? site_url().( substr($file_relpath, 0, 1) == '/' ? '' : '/' ) : '' ).$file_relpath;
|
207 |
+
if ( ( $file_in_ftp || $file_in_root ) && $file_exists && !$obsolete && $actions['link']['allowed'] ) {
|
208 |
+
$actions['link']['visible'] = true;
|
209 |
+
$actions['link']['href'] = $link_href;
|
210 |
+
}
|
211 |
+
$download_href = false;
|
212 |
+
if ( !$file_in_ftp && $file_exists && !$obsolete && $actions['download']['allowed'] ) {
|
213 |
+
$file_code = wfu_safe_store_filepath(wfu_path_abs2rel($file_abspath));
|
214 |
+
$download_href = 'javascript:wfu_download_file(\''.$file_code.'\', '.$i.');';
|
215 |
+
$actions['download']['visible'] = true;
|
216 |
+
$actions['download']['href'] = $download_href;
|
217 |
+
}
|
218 |
+
//allow scripts to customize $actions
|
219 |
+
$actions = apply_filters("_wfu_uploadefiles_file_actions", $actions, $filerec, $i);
|
220 |
+
|
221 |
+
//update default file link action
|
222 |
+
$default_link = $displayed_data["file"];
|
223 |
+
if ( WFU_VAR("WFU_UPLOADEDFILES_DEFACTION") == "details" )
|
224 |
+
$default_link = '<a href="'.$details_href_net.'&invoker='.$pagecode.'" title="Go to file details">'.$file_relpath.'</a>';
|
225 |
+
elseif ( $file_in_root && $file_exists && !$obsolete && WFU_VAR("WFU_UPLOADEDFILES_DEFACTION") == "adminbrowser" ) {
|
226 |
+
if ( $adminbrowser_href === false ) {
|
227 |
+
$only_path = wfu_basedir($file_relpath);
|
228 |
+
$dir_code = wfu_safe_store_filepath($only_path.'{{'.wfu_basename($file_relpath).'}}');
|
229 |
+
$adminbrowser_href = $siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=file_browser&dir='.$dir_code;
|
230 |
+
}
|
231 |
+
$default_link = '<a href="'.$adminbrowser_href.'" title="Open file in File Browser">'.$file_relpath.'</a>';
|
232 |
+
}
|
233 |
+
elseif ( WFU_VAR("WFU_UPLOADEDFILES_DEFACTION") == "historylog" )
|
234 |
+
$default_link = '<a href="'.$historylog_href.'" title="Go to View Log record of file">'.$file_relpath.'</a>';
|
235 |
+
elseif ( ( $file_in_ftp || $file_in_root ) && $file_exists && !$obsolete && WFU_VAR("WFU_UPLOADEDFILES_DEFACTION") == "link" )
|
236 |
+
$default_link = '<a href="'.$link_href.'" title="Open file link">'.$file_relpath.'</a>';
|
237 |
+
elseif ( !$file_in_ftp && $file_exists && !$obsolete && WFU_VAR("WFU_UPLOADEDFILES_DEFACTION") == "download" ) {
|
238 |
+
if ( $download_href === false ) {
|
239 |
+
$file_code = wfu_safe_store_filepath(wfu_path_abs2rel($file_abspath));
|
240 |
+
$download_href = 'javascript:wfu_download_file(\''.$file_code.'\', '.$i.');';
|
241 |
+
}
|
242 |
+
$default_link = '<a href="'.$download_href.'" title="Download file">'.$file_relpath.'</a>';
|
243 |
+
}
|
244 |
+
//allow scripts to customize default file link action
|
245 |
+
$default_link = apply_filters("_wfu_uploadefiles_file_link", $default_link, $filerec, $i);
|
246 |
+
|
247 |
+
$displayed_data["file"] = $default_link;
|
248 |
+
$displayed_data["properties"] = wfu_render_uploadedfiles_properties($properties, $i);
|
249 |
+
$displayed_data["actions"] = wfu_render_uploadedfiles_actions($actions);
|
250 |
+
$echo_str .= "\n\t\t\t\t\t".'<th style="word-wrap: break-word;"'.( $id_visible ? '' : ' class="hidden"' ).'>'.$i.'</th>';
|
251 |
+
$echo_str .= "\n\t\t\t\t\t".'<td class="column-primary" data-colname="File">'.$displayed_data["file"];
|
252 |
+
$echo_str .= "\n\t\t\t\t\t\t".'<div id="wfu_file_download_container_'.$i.'" style="display: none;"></div>';
|
253 |
+
if ( $visible_cols_count > 0 ) $echo_str .= "\n\t\t\t\t\t\t".'<button type="button" class="toggle-row"><span class="screen-reader-text">Show more details</span></button>';
|
254 |
+
$echo_str .= "\n\t\t\t\t\t".'</td>';
|
255 |
+
foreach ( $cols as $col => $is_visible )
|
256 |
+
if ( $col == 'upload_date' ) $echo_str .= "\n\t\t\t\t\t".'<td data-colname="Upload Date"'.( $is_visible ? '' : ' class="hidden"' ).'>'.$displayed_data["date"].'</td>';
|
257 |
+
elseif ( $col == 'user' ) $echo_str .= "\n\t\t\t\t\t".'<td data-colname="User"'.( $is_visible ? '' : ' class="hidden"' ).'>'.$displayed_data["user"].'</td>';
|
258 |
+
elseif ( $col == 'properties' ) $echo_str .= "\n\t\t\t\t\t".'<td data-colname="Properties"'.( $is_visible ? '' : ' class="hidden"' ).'>'.$displayed_data["properties"].'</td>';
|
259 |
+
elseif ( $col == 'remarks' ) $echo_str .= "\n\t\t\t\t\t".'<td data-colname="Remarks"'.( $is_visible ? '' : ' class="hidden"' ).'>'.$displayed_data["remarks"].'</td>';
|
260 |
+
elseif ( $col == 'actions' ) $echo_str .= "\n\t\t\t\t\t".'<td data-colname="Actions"'.( $is_visible ? '' : ' class="hidden"' ).'>'.$displayed_data["actions"].'</td>';
|
261 |
+
$echo_str .= "\n\t\t\t\t".'</tr>';
|
262 |
+
}
|
263 |
+
if ( !$only_table_rows ) {
|
264 |
+
$echo_str .= "\n\t\t\t".'</tbody>';
|
265 |
+
$echo_str .= "\n\t\t".'</table>';
|
266 |
+
$echo_str .= "\n\t".'</div>';
|
267 |
+
$handler = 'function() { wfu_attach_uploadedfiles_events(); }';
|
268 |
+
$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>';
|
269 |
+
$echo_str .= "\n".'</div>';
|
270 |
+
}
|
271 |
+
|
272 |
+
//allow scripts to customize HTML output before return
|
273 |
+
$echo_str = apply_filters("_wfu_uploadedfiles_output", $echo_str, $page, $only_table_rows);
|
274 |
+
return $echo_str;
|
275 |
+
}
|
276 |
+
|
277 |
+
function wfu_uploadedfiles_get_filerecs($page) {
|
278 |
+
$a = func_get_args(); $a = WFU_FUNCTION_HOOK(__FUNCTION__, $a, $out); if (isset($out['vars'])) foreach($out['vars'] as $p => $v) $$p = $v; switch($a) { case 'R': return $out['output']; break; case 'D': die($out['output']); }
|
279 |
+
global $wpdb;
|
280 |
+
$table_name1 = $wpdb->prefix . "wfu_log";
|
281 |
+
$maxrows = (int)WFU_VAR("WFU_UPLOADEDFILES_TABLE_MAXROWS");
|
282 |
+
$ret = array(
|
283 |
+
"files_total" => 0,
|
284 |
+
"filerecs" => array(),
|
285 |
+
"has_history" => false
|
286 |
+
);
|
287 |
+
|
288 |
+
if ( WFU_VAR("WFU_UPLOADEDFILES_HIDEINVALID") != "true" ) {
|
289 |
+
$ret["files_total"] = $wpdb->get_var('SELECT COUNT(idlog) FROM '.$table_name1.' WHERE action = \'upload\'');
|
290 |
+
$ret["filerecs"] = $wpdb->get_results('SELECT * FROM '.$table_name1.' WHERE action = \'upload\' ORDER BY date_from DESC'.( $maxrows > 0 ? ' LIMIT '.$maxrows.' OFFSET '.(($page - 1) * $maxrows) : '' ));
|
291 |
+
}
|
292 |
+
else {
|
293 |
+
$filerecs = $wpdb->get_results('SELECT * FROM '.$table_name1.' WHERE action = \'upload\' ORDER BY date_from DESC');
|
294 |
+
foreach ( $filerecs as $ind => $filerec ) {
|
295 |
+
$initialrec = $filerec;
|
296 |
+
//get all newer associated file records
|
297 |
+
$historyrecs = wfu_get_rec_new_history($initialrec->idlog);
|
298 |
+
//get the latest record of this upload
|
299 |
+
$filerec = $historyrecs[count($historyrecs) - 1];
|
300 |
+
$file_abspath = wfu_path_rel2abs($filerec->filepath);
|
301 |
+
//check if file is stored in FTP location
|
302 |
+
$file_in_ftp = ( substr($file_abspath, 0, 6) == 'ftp://' || substr($file_abspath, 0, 7) == 'ftps://' || substr($file_abspath, 0, 7) == 'sftp://' );
|
303 |
+
//check if file exists for non-ftp uploads
|
304 |
+
$file_exists = ( $file_in_ftp ? true : file_exists($file_abspath) );
|
305 |
+
//check if record is obsolete
|
306 |
+
$obsolete = ( $filerec->date_to != "0000-00-00 00:00:00" );
|
307 |
+
if ( !$file_exists || $obsolete ) unset($filerecs[$ind]);
|
308 |
+
else $filerecs[$ind]->history = $historyrecs;
|
309 |
+
}
|
310 |
+
$ret["files_total"] = count($filerecs);
|
311 |
+
if ( $maxrows > 0 ) $filerecs = array_slice($filerecs, ($page - 1) * $maxrows, $maxrows);
|
312 |
+
$ret["filerecs"] = $filerecs;
|
313 |
+
$ret["has_history"] = true;
|
314 |
+
}
|
315 |
+
|
316 |
+
return $ret;
|
317 |
+
}
|
318 |
+
|
319 |
+
function wfu_init_uploadedfiles_properties() {
|
320 |
+
$props["status"] = array(
|
321 |
+
"icon" => "obsolete",
|
322 |
+
"icon-list" => array(
|
323 |
+
"ok" => "dashicons-yes",
|
324 |
+
"notexists" => "dashicons-trash",
|
325 |
+
"obsolete" => "dashicons-warning"
|
326 |
+
),
|
327 |
+
"title" => "",
|
328 |
+
"title-list" => array(
|
329 |
+
"ok" => "File is Ok",
|
330 |
+
"notexists" => "File does not exist",
|
331 |
+
"obsolete" => "Record is invalid"
|
332 |
+
),
|
333 |
+
"visible" => true,
|
334 |
+
"remarks" => '',
|
335 |
+
"remarks-list" => array(
|
336 |
+
"ok" => "File uploaded successfully to the website",
|
337 |
+
"notexists" => "File does not exist anymore in the website",
|
338 |
+
"obsolete" => "Record is not valid anymore"
|
339 |
+
),
|
340 |
+
"code" => wfu_create_random_string(6)
|
341 |
+
);
|
342 |
+
$props["userdata"] = array(
|
343 |
+
"icon" => "dashicons-id-alt",
|
344 |
+
"title" => "File has user data",
|
345 |
+
"visible" => false,
|
346 |
+
"remarks" => 'File has user data, accessible in File Details',
|
347 |
+
"code" => wfu_create_random_string(6)
|
348 |
+
);
|
349 |
+
$props["media"] = array(
|
350 |
+
"icon" => "dashicons-admin-media",
|
351 |
+
"title" => "File is associated with Media item",
|
352 |
+
"visible" => false,
|
353 |
+
"remarks" => 'File is associated with Media item',
|
354 |
+
"code" => wfu_create_random_string(6)
|
355 |
+
);
|
356 |
+
$props["ftp"] = array(
|
357 |
+
"icon" => "wfu-dashicons-ftp",
|
358 |
+
"title" => "File saved in FTP",
|
359 |
+
"visible" => false,
|
360 |
+
"remarks" => 'File has been saved in FTP location',
|
361 |
+
"code" => wfu_create_random_string(6)
|
362 |
+
);
|
363 |
+
|
364 |
+
return $props;
|
365 |
+
}
|
366 |
+
|
367 |
+
function wfu_init_uploadedfiles_actions() {
|
368 |
+
$def_actions["details"] = array(
|
369 |
+
"icon" => "dashicons-info",
|
370 |
+
"title" => "View file details",
|
371 |
+
"allowed" => false,
|
372 |
+
"visible" => false,
|
373 |
+
"href" => ""
|
374 |
+
);
|
375 |
+
$def_actions["media"] = array(
|
376 |
+
"icon" => "wfu-dashicons-media-external",
|
377 |
+
"title" => "Open associated Media item",
|
378 |
+
"allowed" => false,
|
379 |
+
"visible" => false,
|
380 |
+
"href" => ""
|
381 |
+
);
|
382 |
+
$def_actions["adminbrowser"] = array(
|
383 |
+
"icon" => "dashicons-portfolio",
|
384 |
+
"title" => "Locate file in File Browser",
|
385 |
+
"allowed" => false,
|
386 |
+
"visible" => false,
|
387 |
+
"href" => ""
|
388 |
+
);
|
389 |
+
$def_actions["historylog"] = array(
|
390 |
+
"icon" => "dashicons-backup",
|
391 |
+
"title" => "Locate file record in View Log",
|
392 |
+
"allowed" => false,
|
393 |
+
"visible" => false,
|
394 |
+
"href" => ""
|
395 |
+
);
|
396 |
+
$def_actions["link"] = array(
|
397 |
+
"icon" => "dashicons-external",
|
398 |
+
"title" => "Open file link",
|
399 |
+
"allowed" => false,
|
400 |
+
"visible" => false,
|
401 |
+
"href" => ""
|
402 |
+
);
|
403 |
+
$def_actions["download"] = array(
|
404 |
+
"icon" => "dashicons-download",
|
405 |
+
"title" => "Download file",
|
406 |
+
"allowed" => false,
|
407 |
+
"visible" => false,
|
408 |
+
"href" => ""
|
409 |
+
);
|
410 |
+
|
411 |
+
//get visible actions and their order
|
412 |
+
$actions = array();
|
413 |
+
$actions_raw = explode(',', WFU_VAR("WFU_UPLOADEDFILES_ACTIONS"));
|
414 |
+
//normalize action list
|
415 |
+
foreach ( $actions_raw as $ind => $action ) $actions_raw[$ind] = strtolower(trim($action));
|
416 |
+
//generate associative array of actions adjusting order and 'allowed'
|
417 |
+
//property
|
418 |
+
foreach ( $actions_raw as $ind => $action )
|
419 |
+
if ( isset($def_actions[$action]) ) {
|
420 |
+
$actions[$action] = $def_actions[$action];
|
421 |
+
$actions[$action]['allowed'] = true;
|
422 |
+
unset($def_actions[$action]);
|
423 |
+
}
|
424 |
+
foreach ( $def_actions as $action => $props ) $actions[$action] = $props;
|
425 |
+
|
426 |
+
return $actions;
|
427 |
+
}
|
428 |
+
|
429 |
+
function wfu_render_uploadedfiles_properties($props, $index) {
|
430 |
+
$a = func_get_args(); switch(WFU_FUNCTION_HOOK(__FUNCTION__, $a, $out)) { case 'X': break; case 'R': return $out; break; case 'D': die($out); break; }
|
431 |
+
$i = 0;
|
432 |
+
$echo_str = "";
|
433 |
+
foreach ( $props as $key => $prop ) {
|
434 |
+
$ii = $i + 1;
|
435 |
+
$iconclass = $prop['icon'];
|
436 |
+
if ( isset($prop['icon-list']) ) $iconclass = $prop['icon-list'][$prop['icon']];
|
437 |
+
$title = $prop['title'];
|
438 |
+
if ( isset($prop['title-list']) ) $title = $prop['title-list'][$prop['icon']];
|
439 |
+
$remarks = $prop['remarks'];
|
440 |
+
if ( isset($prop['remarks-list']) ) $remarks = $prop['remarks-list'][$prop['icon']];
|
441 |
+
$echo_str .= '<div id="p_'.$index.'_'.$ii.'" class="wfu-properties dashicons '.$iconclass.( $i == 0 ? '' : ' wfu-dashicons-after' ).( $prop['visible'] ? '' : ' wfu-dashicons-hidden' ).'" title="'.$title.'"><input type="hidden" class="wfu-remarks" value="'.wfu_plugin_encode_string($remarks).'" /></div>';
|
442 |
+
$i ++;
|
443 |
+
}
|
444 |
+
|
445 |
+
return $echo_str;
|
446 |
+
}
|
447 |
+
|
448 |
+
function wfu_render_uploadedfiles_actions($actions) {
|
449 |
+
$a = func_get_args(); switch(WFU_FUNCTION_HOOK(__FUNCTION__, $a, $out)) { case 'X': break; case 'R': return $out; break; case 'D': die($out); break; }
|
450 |
+
$i = 0;
|
451 |
+
$echo_str = "";
|
452 |
+
foreach ( $actions as $key => $action ) {
|
453 |
+
$iconclass = $action['icon'];
|
454 |
+
if ( isset($action['icon-list']) ) $iconclass = $action['icon-list'][$action['icon']];
|
455 |
+
$title = $action['title'];
|
456 |
+
if ( isset($action['title-list']) ) $title = $action['title-list'][$action['icon']];
|
457 |
+
$echo_str .= '<a class="dashicons '.$iconclass.( $i == 0 ? '' : ' wfu-dashicons-after' ).( $action['visible'] ? '' : ' wfu-dashicons-hidden' ).'" href="'.$action['href'].'" target="_blank" title="'.$title.'"></a>';
|
458 |
+
$i ++;
|
459 |
+
}
|
460 |
+
|
461 |
+
return $echo_str;
|
462 |
+
}
|
463 |
+
|
464 |
+
function wfu_admin_toolbar_new_uploads() {
|
465 |
+
global $wp_admin_bar;
|
466 |
+
|
467 |
+
if ( WFU_VAR("WFU_UPLOADEDFILES_BARMENU") == "true" ) {
|
468 |
+
//get the number of new (unread) uploaded files
|
469 |
+
$unread_files_count = wfu_get_unread_files_count();
|
470 |
+
$text = $unread_files_count;
|
471 |
+
if ( $unread_files_count > 99 ) $text = "99+";
|
472 |
+
$title = ( $unread_files_count == 0 ? 'No new files uploaded' : ( $unread_files_count == 1 ? '1 new file uploaded' : $unread_files_count.' files uploaded' ) );
|
473 |
+
|
474 |
+
$args = array(
|
475 |
+
'id' => 'wfu_uploads',
|
476 |
+
'title' => '<span class="ab-icon"></span><span class="ab-label">'.$unread_files_count.'</span><span class="screen-reader-text">'.$title.'</span>',
|
477 |
+
'href' => admin_url( 'admin.php?page=wfu_uploaded_files' ),
|
478 |
+
'group' => false,
|
479 |
+
'meta' => array(
|
480 |
+
'title' => $title,
|
481 |
+
'class' => ( $unread_files_count == 0 && WFU_VAR("WFU_UPLOADEDFILES_BARAUTOHIDE") == "true" ? 'hidden' : '' )
|
482 |
+
),
|
483 |
+
);
|
484 |
+
$wp_admin_bar->add_menu( $args );
|
485 |
+
}
|
486 |
+
}
|
487 |
+
|
488 |
+
function wfu_uploadedfiles_screen_options() {
|
489 |
+
global $wfu_uploadedfiles_hook_suffix;
|
490 |
+
|
491 |
+
$screen = get_current_screen();
|
492 |
+
// get out of here if we are not on uploadedfiles page
|
493 |
+
if( !is_object($screen) || $screen->id != $wfu_uploadedfiles_hook_suffix ) return;
|
494 |
+
|
495 |
+
$args = array(
|
496 |
+
'label' => 'Files per page',
|
497 |
+
'default' => WFU_VAR("WFU_UPLOADEDFILES_TABLE_MAXROWS"),
|
498 |
+
'option' => 'wfu_uploadedfiles_per_page'
|
499 |
+
);
|
500 |
+
add_screen_option( 'per_page', $args );
|
501 |
+
}
|
502 |
+
|
503 |
+
?>
|
lib/wfu_ajaxactions.php
CHANGED
@@ -1,763 +1,803 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
function wfu_ajax_action_send_email_notification() {
|
4 |
-
$_POST = stripslashes_deep($_POST);
|
5 |
-
|
6 |
-
$user = wp_get_current_user();
|
7 |
-
if ( 0 == $user->ID ) $is_admin = false;
|
8 |
-
else $is_admin = current_user_can('manage_options');
|
9 |
-
|
10 |
-
$params_index = sanitize_text_field($_POST['params_index']);
|
11 |
-
$session_token = sanitize_text_field($_POST['session_token']);
|
12 |
-
|
13 |
-
$arr = wfu_get_params_fields_from_index($params_index, $session_token);
|
14 |
-
//check referer using server sessions to avoid CSRF attacks
|
15 |
-
$sid = $arr['shortcode_id'];
|
16 |
-
if ( WFU_USVAR("wfu_token_".$sid) != $session_token ) die();
|
17 |
-
if ( $user->user_login != $arr['user_login'] ) die();
|
18 |
-
|
19 |
-
$params_str = get_option('wfu_params_'.$arr['unique_id']);
|
20 |
-
$params = wfu_decode_array_from_string($params_str);
|
21 |
-
|
22 |
-
//check whether email notifications are activated
|
23 |
-
if ( $params["notify"] != "true" ) die();
|
24 |
-
|
25 |
-
$uniqueid = ( isset($_POST['uniqueuploadid_'.$sid]) ? sanitize_text_field($_POST['uniqueuploadid_'.$sid]) : "" );
|
26 |
-
//uniqueid cannot be empty and cannot be "no-ajax"
|
27 |
-
if ( $uniqueid == "" || $uniqueid == "no-ajax" ) die();
|
28 |
-
|
29 |
-
//retrieve the list of uploaded files from session
|
30 |
-
$target_path_list = array();
|
31 |
-
$all_files_count = 0;
|
32 |
-
if ( WFU_USVAR_exists("filedata_".$uniqueid) && is_array(WFU_USVAR("filedata_".$uniqueid)) ) {
|
33 |
-
$all_files_count = count(WFU_USVAR("filedata_".$uniqueid));
|
34 |
-
foreach ( WFU_USVAR("filedata_".$uniqueid) as $file ) {
|
35 |
-
if ( $file["upload_result"] == "success" || $file["upload_result"] == "warning" )
|
36 |
-
array_push($target_path_list, $file["filepath"]);
|
37 |
-
}
|
38 |
-
}
|
39 |
-
$uploaded_files_count = count($target_path_list);
|
40 |
-
$nofileupload = ( $params["allownofile"] == "true" && $all_files_count == 0 );
|
41 |
-
$force_notifications = ( WFU_VAR("WFU_FORCE_NOTIFICATIONS") == "true" );
|
42 |
-
|
43 |
-
//in case no files have been uploaded and this is not a nofileupload
|
44 |
-
//situation and Force Email Notifications option is not active then abort
|
45 |
-
if ( $uploaded_files_count == 0 && !$nofileupload && !$force_notifications ) die();
|
46 |
-
|
47 |
-
/* initialize return array */
|
48 |
-
$params_output_array["version"] = "full";
|
49 |
-
$params_output_array["general"]['shortcode_id'] = $params["uploadid"];
|
50 |
-
$params_output_array["general"]['unique_id'] = $uniqueid;
|
51 |
-
$params_output_array["general"]['state'] = 0;
|
52 |
-
$params_output_array["general"]['files_count'] = 0;
|
53 |
-
$params_output_array["general"]['update_wpfilebase'] = "";
|
54 |
-
$params_output_array["general"]['redirect_link'] = "";
|
55 |
-
$params_output_array["general"]['upload_finish_time'] = "";
|
56 |
-
$params_output_array["general"]['message'] = "";
|
57 |
-
$params_output_array["general"]['message_type'] = "";
|
58 |
-
$params_output_array["general"]['admin_messages']['wpfilebase'] = "";
|
59 |
-
$params_output_array["general"]['admin_messages']['notify'] = "";
|
60 |
-
$params_output_array["general"]['admin_messages']['redirect'] = "";
|
61 |
-
$params_output_array["general"]['admin_messages']['other'] = "";
|
62 |
-
$params_output_array["general"]['errors']['wpfilebase'] = "";
|
63 |
-
$params_output_array["general"]['errors']['notify'] = "";
|
64 |
-
$params_output_array["general"]['errors']['redirect'] = "";
|
65 |
-
$params_output_array["general"]['color'] = "black";
|
66 |
-
$params_output_array["general"]['bgcolor'] = "#F5F5F5";
|
67 |
-
$params_output_array["general"]['borcolor'] = "#D3D3D3";
|
68 |
-
$params_output_array["general"]['notify_by_email'] = 0;
|
69 |
-
$params_output_array["general"]['fail_message'] = WFU_ERROR_UNKNOWN;
|
70 |
-
|
71 |
-
//retrieve userdata, first get default userdata from $params
|
72 |
-
$userdata_fields = $params["userdata_fields"];
|
73 |
-
//remove any honeypot fields and initialize default values
|
74 |
-
foreach ( $userdata_fields as $userdata_key => $userdata_field )
|
75 |
-
if ( $userdata_field["type"] == "honeypot" ) unset($userdata_fields[$userdata_key]);
|
76 |
-
else $userdata_fields[$userdata_key]["value"] = "";
|
77 |
-
//then retrieve userdata from session if files exist
|
78 |
-
if ( $all_files_count > 0 && WFU_USVAR_exists("filedata_".$uniqueid) && is_array(WFU_USVAR("filedata_".$uniqueid)) ) {
|
79 |
-
foreach ( WFU_USVAR("filedata_".$uniqueid) as $file ) {
|
80 |
-
if ( isset($file["user_data"]) ) {
|
81 |
-
$userdata_fields = array();
|
82 |
-
foreach ( $file["user_data"] as $userdata_key => $userdata_field )
|
83 |
-
$userdata_fields[$userdata_key] = array( "label" => $userdata_field["label"], "value" => $userdata_field["value"] );
|
84 |
-
break;
|
85 |
-
}
|
86 |
-
}
|
87 |
-
}
|
88 |
-
//in case there are no files in session (because allownofile attribute is
|
89 |
-
//active and the user did not select any files for upload) then retrieve
|
90 |
-
//userdata from the database based on uploadid
|
91 |
-
else {
|
92 |
-
$userdata_saved = wfu_get_userdata_from_uploadid($uniqueid);
|
93 |
-
if ( $userdata_saved != null && is_array($userdata_saved) ) {
|
94 |
-
$userdata_fields = array();
|
95 |
-
foreach ( $userdata_saved as $userdata_saved_rec )
|
96 |
-
$userdata_fields[$userdata_saved_rec->propkey] = array( "label" => $userdata_saved_rec->property, "value" => $userdata_saved_rec->propvalue );
|
97 |
-
}
|
98 |
-
}
|
99 |
-
|
100 |
-
$send_error = wfu_send_notification_email($user, $target_path_list, $userdata_fields, $params);
|
101 |
-
|
102 |
-
/* suppress any errors if user is not admin */
|
103 |
-
if ( !$is_admin ) $send_error = "";
|
104 |
-
|
105 |
-
if ( $send_error != "" ) {
|
106 |
-
$params_output_array["general"]['admin_messages']['notify'] = $send_error;
|
107 |
-
$params_output_array["general"]['errors']['notify'] = "error";
|
108 |
-
}
|
109 |
-
|
110 |
-
/* construct safe output */
|
111 |
-
$sout = "0;".WFU_VAR("WFU_DEFAULTMESSAGECOLORS").";0";
|
112 |
-
|
113 |
-
$echo_str = "wfu_fileupload_success::".$sout.":".wfu_encode_array_to_string($params_output_array);
|
114 |
-
// allow an internal hook to process the final output
|
115 |
-
$echo_str = apply_filters('_wfu_ajax_action_send_email_notification', $echo_str);
|
116 |
-
|
117 |
-
die($echo_str);
|
118 |
-
}
|
119 |
-
|
120 |
-
function wfu_ajax_action_ask_server() {
|
121 |
-
if ( !isset($_REQUEST['session_token']) || !isset($_REQUEST['sid']) || !isset($_REQUEST['unique_id']) ) die();
|
122 |
-
|
123 |
-
$_REQUEST = stripslashes_deep($_REQUEST);
|
124 |
-
|
125 |
-
$session_token = sanitize_text_field( $_REQUEST["session_token"] );
|
126 |
-
$sid = sanitize_text_field( $_REQUEST["sid"] );
|
127 |
-
$unique_id = wfu_sanitize_code($_REQUEST['unique_id']);
|
128 |
-
if ( $session_token == "" ) die();
|
129 |
-
//check referrer using Wordpress nonces and server sessions to avoid CSRF attacks
|
130 |
-
check_ajax_referer( 'wfu-uploader-nonce', 'wfu_uploader_nonce' );
|
131 |
-
if ( WFU_USVAR("wfu_token_".$sid) != $session_token ) die();
|
132 |
-
|
133 |
-
//prepare parameters for before-upload filters
|
134 |
-
$ret = array( "status" => "", "echo" => "" );
|
135 |
-
//retrieve file names and sizes from request parameters
|
136 |
-
$filenames_raw = ( isset($_REQUEST['filenames']) ? $_REQUEST['filenames'] : "" );
|
137 |
-
$filenames = array();
|
138 |
-
if ( trim($filenames_raw) != "" ) $filenames = explode(";", $filenames_raw);
|
139 |
-
foreach ( $filenames as $ind => $filename ) $filenames[$ind] = esc_attr(wfu_plugin_decode_string(trim($filename)));
|
140 |
-
$filesizes_raw = ( isset($_REQUEST['filesizes']) ? $_REQUEST['filesizes'] : "" );
|
141 |
-
$filesizes = array();
|
142 |
-
if ( trim($filesizes_raw) != "" ) $filesizes = explode(";", $filesizes_raw);
|
143 |
-
foreach ( $filesizes as $ind => $filesize ) $filesizes[$ind] = wfu_sanitize_int($filesize);
|
144 |
-
$files = array();
|
145 |
-
foreach ( $filenames as $ind => $filename ) {
|
146 |
-
$filesize = "";
|
147 |
-
if ( isset($filesizes[$ind]) ) $filesize = $filesizes[$ind];
|
148 |
-
array_push($files, array( "filename" => $filename, "filesize" => $filesize ));
|
149 |
-
}
|
150 |
-
$attr = array( "sid" => $sid, "unique_id" => $unique_id, "files" => $files );
|
151 |
-
//execute before upload filters
|
152 |
-
$echo_str = "";
|
153 |
-
//first execute any custom filters created by admin
|
154 |
-
if ( has_filter("wfu_before_upload") ) {
|
155 |
-
$changable_data = array( "error_message" => "", "js_script" => "" );
|
156 |
-
$changable_data = apply_filters("wfu_before_upload", $changable_data, $attr);
|
157 |
-
if ( $changable_data["error_message"] == "" ) $ret["status"] = "success";
|
158 |
-
else {
|
159 |
-
$ret["status"] = "error";
|
160 |
-
$echo_str .= "CBUV[".$changable_data["error_message"]."]";
|
161 |
-
}
|
162 |
-
if ( $changable_data["js_script"] != "" ) $echo_str .= "CBUVJS[".wfu_plugin_encode_string($changable_data["js_script"])."]";
|
163 |
-
}
|
164 |
-
//then execute internal filters of extensions
|
165 |
-
$ret = apply_filters("_wfu_before_upload", $ret, $attr);
|
166 |
-
$echo_str .= $ret["echo"];
|
167 |
-
//in case that no filters were executed, because $ret["status"] is
|
168 |
-
//empty, then this call to wfu_ajax_action_ask_server was erroneous
|
169 |
-
if ( $ret["status"] == "" ) $ret["status"] = "die";
|
170 |
-
//create an internal flag stored in session regarding the status of this
|
171 |
-
//upload, that will be used to verify or not the upload
|
172 |
-
if ( $ret["status"] == "success" ) WFU_USVAR_store("wfu_uploadstatus_".$attr["unique_id"], 1);
|
173 |
-
else WFU_USVAR_store("wfu_uploadstatus_".$attr["unique_id"], 0);
|
174 |
-
|
175 |
-
if ( $ret["status"] == "success" || $ret["status"] == "error" )
|
176 |
-
echo "wfu_askserver_".$ret["status"].":".$echo_str;
|
177 |
-
|
178 |
-
die();
|
179 |
-
}
|
180 |
-
|
181 |
-
function wfu_ajax_action_cancel_upload() {
|
182 |
-
if ( !isset($_REQUEST['session_token']) || !isset($_REQUEST['sid']) || !isset($_REQUEST['unique_id']) ) die();
|
183 |
-
|
184 |
-
$_REQUEST = stripslashes_deep($_REQUEST);
|
185 |
-
|
186 |
-
$session_token = sanitize_text_field( $_REQUEST["session_token"] );
|
187 |
-
$sid = sanitize_text_field( $_REQUEST["sid"] );
|
188 |
-
$unique_id = wfu_sanitize_code($_REQUEST['unique_id']);
|
189 |
-
if ( $session_token == "" ) die();
|
190 |
-
//check referrer using Wordpress nonces and server sessions to avoid CSRF attacks
|
191 |
-
check_ajax_referer( 'wfu-uploader-nonce', 'wfu_uploader_nonce' );
|
192 |
-
if ( WFU_USVAR("wfu_token_".$sid) != $session_token ) die();
|
193 |
-
|
194 |
-
//setting status to 0 denotes cancelling of the upload
|
195 |
-
WFU_USVAR_store("wfu_uploadstatus_".$unique_id, 0);
|
196 |
-
|
197 |
-
die("success");
|
198 |
-
}
|
199 |
-
|
200 |
-
function wfu_ajax_action_callback() {
|
201 |
-
if ( !isset($_REQUEST['session_token']) ) die();
|
202 |
-
|
203 |
-
$_REQUEST = stripslashes_deep($_REQUEST);
|
204 |
-
$_POST = stripslashes_deep($_POST);
|
205 |
-
|
206 |
-
$session_token = sanitize_text_field( $_REQUEST["session_token"] );
|
207 |
-
if ( $session_token == "" ) die();
|
208 |
-
check_ajax_referer( 'wfu-uploader-nonce', 'wfu_uploader_nonce' );
|
209 |
-
|
210 |
-
if ( !isset($_REQUEST['params_index']) ) die();
|
211 |
-
|
212 |
-
$params_index = sanitize_text_field( $_REQUEST["params_index"] );
|
213 |
-
|
214 |
-
if ( $params_index == "" ) die();
|
215 |
-
|
216 |
-
$user = wp_get_current_user();
|
217 |
-
$arr = wfu_get_params_fields_from_index($params_index, $session_token);
|
218 |
-
$sid = $arr['shortcode_id'];
|
219 |
-
//check referrer using server sessions to avoid CSRF attacks
|
220 |
-
if ( WFU_USVAR("wfu_token_".$sid) != $session_token ) {
|
221 |
-
$echo_str = "Session failed!<br/><br/>Session Data:<br/>";
|
222 |
-
$echo_str .= print_r(wfu_sanitize(WFU_USALL()), true);
|
223 |
-
$echo_str .= "<br/><br/>Post Data:<br/>";
|
224 |
-
$echo_str .= print_r(wfu_sanitize($_POST), true);
|
225 |
-
$echo_str .= 'force_errorabort_code';
|
226 |
-
$echo_str = apply_filters('_wfu_upload_session_failed', $echo_str);
|
227 |
-
die($echo_str);
|
228 |
-
}
|
229 |
-
|
230 |
-
if ( $user->user_login != $arr['user_login'] ) {
|
231 |
-
$echo_str = "User failed!<br/><br/>User Data:<br/>";
|
232 |
-
$echo_str .= print_r(wfu_sanitize($user), true);
|
233 |
-
$echo_str .= "<br/><br/>Post Data:<br/>";
|
234 |
-
$echo_str .= print_r(wfu_sanitize($_POST), true);
|
235 |
-
$echo_str .= "<br/><br/>Params Data:<br/>";
|
236 |
-
$echo_str .= print_r(wfu_sanitize($arr), true);
|
237 |
-
$echo_str .= 'force_errorabort_code';
|
238 |
-
$echo_str = apply_filters('_wfu_upload_user_failed', $echo_str);
|
239 |
-
die($echo_str);
|
240 |
-
}
|
241 |
-
|
242 |
-
//if force_connection_close is set, then the first pass to this callback script is for closing the previous connection
|
243 |
-
if ( isset($_POST["force_connection_close"]) && $_POST["force_connection_close"] === "1" ) {
|
244 |
-
header("Connection: Close");
|
245 |
-
die(apply_filters('_wfu_upload_force_connection_close', 'success'));
|
246 |
-
}
|
247 |
-
|
248 |
-
//get the unique id of the upload
|
249 |
-
$unique_id = ( isset($_POST['uniqueuploadid_'.$sid]) ? sanitize_text_field($_POST['uniqueuploadid_'.$sid]) : "" );
|
250 |
-
if ( strlen($unique_id) != 10 ) die(apply_filters('_wfu_upload_uniqueid_failed', 'force_errorabort_code'));
|
251 |
-
|
252 |
-
//if before upload actions have been executed and they have rejected the
|
253 |
-
//upload, but for some reason (hack attempt) the upload continued, then
|
254 |
-
//terminate it
|
255 |
-
if ( WFU_USVAR_exists("wfu_uploadstatus_".$unique_id) && WFU_USVAR("wfu_uploadstatus_".$unique_id) == 0 ) die('force_errorabort_code');
|
256 |
-
|
257 |
-
//get stored shortcode parameters
|
258 |
-
$params_str = get_option('wfu_params_'.$arr['unique_id']);
|
259 |
-
$params = wfu_decode_array_from_string($params_str);
|
260 |
-
|
261 |
-
//if upload has finished then perform post upload actions
|
262 |
-
if ( isset($_POST["upload_finished"]) && $_POST["upload_finished"] === "1" ) {
|
263 |
-
$echo_str = "";
|
264 |
-
//execute after upload filters
|
265 |
-
$ret = wfu_execute_after_upload_filters($sid, $unique_id, $params);
|
266 |
-
if ( $ret["js_script"] != "" ) $echo_str = "CBUVJS[".wfu_plugin_encode_string($ret["js_script"])."]";
|
267 |
-
die($echo_str);
|
268 |
-
}
|
269 |
-
|
270 |
-
//check if honeypot userdata fields have been added to the form and if they
|
271 |
-
//contain any data; if wfu_check_remove_honeypot_fields returns true this
|
272 |
-
//means that at least one honeypot field has beed filled with a value and
|
273 |
-
//the upload must be aborted because it was not done by a human
|
274 |
-
if ( $params["userdata"] == "true" && wfu_check_remove_honeypot_fields($params["userdata_fields"], 'hiddeninput_'.$sid.'_userdata_') ) die("force_abortsuccess_code");
|
275 |
-
|
276 |
-
//apply filters to determine if the upload will continue or stop
|
277 |
-
$ret = array( "status" => "", "echo" => "" );
|
278 |
-
$attr = array( "sid" => $sid, "unique_id" => $unique_id, "params" => $params );
|
279 |
-
$ret = apply_filters("_wfu_pre_upload_check", $ret, $attr);
|
280 |
-
if ( $ret["status"] == "die" ) die($ret["echo"]);
|
281 |
-
|
282 |
-
//if this is the first pass of an upload attempt then perform pre-upload actions
|
283 |
-
if ( !WFU_USVAR_exists('wfu_upload_first_pass_'.$unique_id) || WFU_USVAR('wfu_upload_first_pass_'.$unique_id) != 'true' ) {
|
284 |
-
WFU_USVAR_store('wfu_upload_first_pass_'.$unique_id, 'true');
|
285 |
-
}
|
286 |
-
|
287 |
-
if ( !isset($_POST["subdir_sel_index"]) ) die();
|
288 |
-
$subdir_sel_index = sanitize_text_field( $_POST["subdir_sel_index"] );
|
289 |
-
$params['subdir_selection_index'] = $subdir_sel_index;
|
290 |
-
WFU_USVAR_store('wfu_check_refresh_'.$params["uploadid"], 'do not process');
|
291 |
-
|
292 |
-
//update consent status of user
|
293 |
-
$plugin_options = wfu_decode_plugin_options(get_option( "wordpress_file_upload_options" ));
|
294 |
-
$params["consent_result"] = wfu_check_user_consent($user);
|
295 |
-
$require_consent = ( $plugin_options["personaldata"] == "1" && ( $params["notrememberconsent"] == "true" || $params["consent_result"] == "" ) && $params["askconsent"] == "true" );
|
296 |
-
if ( $require_consent ) {
|
297 |
-
if ( !isset($_POST['consent_result']) ) die();
|
298 |
-
$consent_result = ( $_POST['consent_result'] == "yes" ? "yes" : ( $_POST['consent_result'] == "no" ? "no" : "" ) );
|
299 |
-
$params["consent_result"] = ( $_POST['consent_result'] == "yes" ? "1" : ( $_POST['consent_result'] == "no" ? "0" : "" ) );
|
300 |
-
wfu_update_user_consent($user, $consent_result);
|
301 |
-
}
|
302 |
-
|
303 |
-
$wfu_process_file_array = wfu_process_files($params, 'ajax');
|
304 |
-
// extract safe_output from wfu_process_file_array and pass it as separate part of the response text
|
305 |
-
$safe_output = $wfu_process_file_array["general"]['safe_output'];
|
306 |
-
unset($wfu_process_file_array["general"]['safe_output']);
|
307 |
-
// get javascript code that has been defined in wfu_after_file_upload action
|
308 |
-
$js_script = wfu_plugin_encode_string($wfu_process_file_array["general"]['js_script']);
|
309 |
-
unset($wfu_process_file_array["general"]['js_script']);
|
310 |
-
|
311 |
-
$echo_str = "wfu_fileupload_success:".$js_script.":".$safe_output.":".wfu_encode_array_to_string($wfu_process_file_array);
|
312 |
-
$echo_str = apply_filters('_wfu_upload_callback_success', $echo_str);
|
313 |
-
die($echo_str);
|
314 |
-
}
|
315 |
-
|
316 |
-
function wfu_ajax_action_save_shortcode() {
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
$_POST
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
$
|
326 |
-
$
|
327 |
-
$
|
328 |
-
$
|
329 |
-
$
|
330 |
-
|
331 |
-
$
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
$data['
|
340 |
-
$data['
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
$
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
$
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
if (
|
376 |
-
|
377 |
-
$_POST
|
378 |
-
|
379 |
-
$
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
$echo_str =
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
$
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
$
|
400 |
-
|
401 |
-
|
402 |
-
$
|
403 |
-
|
404 |
-
$
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
$
|
409 |
-
if (
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
$
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
$
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
$
|
447 |
-
|
448 |
-
$
|
449 |
-
$
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
$
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
$
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
$
|
477 |
-
$
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
$
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
$
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
//
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
//
|
618 |
-
//
|
619 |
-
|
620 |
-
//
|
621 |
-
//
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
//
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
$
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
$
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
die();
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
$
|
753 |
-
'
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
-
|
760 |
-
|
761 |
-
|
762 |
-
|
763 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
function wfu_ajax_action_send_email_notification() {
|
4 |
+
$_POST = stripslashes_deep($_POST);
|
5 |
+
|
6 |
+
$user = wp_get_current_user();
|
7 |
+
if ( 0 == $user->ID ) $is_admin = false;
|
8 |
+
else $is_admin = current_user_can('manage_options');
|
9 |
+
|
10 |
+
$params_index = sanitize_text_field($_POST['params_index']);
|
11 |
+
$session_token = sanitize_text_field($_POST['session_token']);
|
12 |
+
|
13 |
+
$arr = wfu_get_params_fields_from_index($params_index, $session_token);
|
14 |
+
//check referer using server sessions to avoid CSRF attacks
|
15 |
+
$sid = $arr['shortcode_id'];
|
16 |
+
if ( WFU_USVAR("wfu_token_".$sid) != $session_token ) die();
|
17 |
+
if ( $user->user_login != $arr['user_login'] ) die();
|
18 |
+
|
19 |
+
$params_str = get_option('wfu_params_'.$arr['unique_id']);
|
20 |
+
$params = wfu_decode_array_from_string($params_str);
|
21 |
+
|
22 |
+
//check whether email notifications are activated
|
23 |
+
if ( $params["notify"] != "true" ) die();
|
24 |
+
|
25 |
+
$uniqueid = ( isset($_POST['uniqueuploadid_'.$sid]) ? sanitize_text_field($_POST['uniqueuploadid_'.$sid]) : "" );
|
26 |
+
//uniqueid cannot be empty and cannot be "no-ajax"
|
27 |
+
if ( $uniqueid == "" || $uniqueid == "no-ajax" ) die();
|
28 |
+
|
29 |
+
//retrieve the list of uploaded files from session
|
30 |
+
$target_path_list = array();
|
31 |
+
$all_files_count = 0;
|
32 |
+
if ( WFU_USVAR_exists("filedata_".$uniqueid) && is_array(WFU_USVAR("filedata_".$uniqueid)) ) {
|
33 |
+
$all_files_count = count(WFU_USVAR("filedata_".$uniqueid));
|
34 |
+
foreach ( WFU_USVAR("filedata_".$uniqueid) as $file ) {
|
35 |
+
if ( $file["upload_result"] == "success" || $file["upload_result"] == "warning" )
|
36 |
+
array_push($target_path_list, $file["filepath"]);
|
37 |
+
}
|
38 |
+
}
|
39 |
+
$uploaded_files_count = count($target_path_list);
|
40 |
+
$nofileupload = ( $params["allownofile"] == "true" && $all_files_count == 0 );
|
41 |
+
$force_notifications = ( WFU_VAR("WFU_FORCE_NOTIFICATIONS") == "true" );
|
42 |
+
|
43 |
+
//in case no files have been uploaded and this is not a nofileupload
|
44 |
+
//situation and Force Email Notifications option is not active then abort
|
45 |
+
if ( $uploaded_files_count == 0 && !$nofileupload && !$force_notifications ) die();
|
46 |
+
|
47 |
+
/* initialize return array */
|
48 |
+
$params_output_array["version"] = "full";
|
49 |
+
$params_output_array["general"]['shortcode_id'] = $params["uploadid"];
|
50 |
+
$params_output_array["general"]['unique_id'] = $uniqueid;
|
51 |
+
$params_output_array["general"]['state'] = 0;
|
52 |
+
$params_output_array["general"]['files_count'] = 0;
|
53 |
+
$params_output_array["general"]['update_wpfilebase'] = "";
|
54 |
+
$params_output_array["general"]['redirect_link'] = "";
|
55 |
+
$params_output_array["general"]['upload_finish_time'] = "";
|
56 |
+
$params_output_array["general"]['message'] = "";
|
57 |
+
$params_output_array["general"]['message_type'] = "";
|
58 |
+
$params_output_array["general"]['admin_messages']['wpfilebase'] = "";
|
59 |
+
$params_output_array["general"]['admin_messages']['notify'] = "";
|
60 |
+
$params_output_array["general"]['admin_messages']['redirect'] = "";
|
61 |
+
$params_output_array["general"]['admin_messages']['other'] = "";
|
62 |
+
$params_output_array["general"]['errors']['wpfilebase'] = "";
|
63 |
+
$params_output_array["general"]['errors']['notify'] = "";
|
64 |
+
$params_output_array["general"]['errors']['redirect'] = "";
|
65 |
+
$params_output_array["general"]['color'] = "black";
|
66 |
+
$params_output_array["general"]['bgcolor'] = "#F5F5F5";
|
67 |
+
$params_output_array["general"]['borcolor'] = "#D3D3D3";
|
68 |
+
$params_output_array["general"]['notify_by_email'] = 0;
|
69 |
+
$params_output_array["general"]['fail_message'] = WFU_ERROR_UNKNOWN;
|
70 |
+
|
71 |
+
//retrieve userdata, first get default userdata from $params
|
72 |
+
$userdata_fields = $params["userdata_fields"];
|
73 |
+
//remove any honeypot fields and initialize default values
|
74 |
+
foreach ( $userdata_fields as $userdata_key => $userdata_field )
|
75 |
+
if ( $userdata_field["type"] == "honeypot" ) unset($userdata_fields[$userdata_key]);
|
76 |
+
else $userdata_fields[$userdata_key]["value"] = "";
|
77 |
+
//then retrieve userdata from session if files exist
|
78 |
+
if ( $all_files_count > 0 && WFU_USVAR_exists("filedata_".$uniqueid) && is_array(WFU_USVAR("filedata_".$uniqueid)) ) {
|
79 |
+
foreach ( WFU_USVAR("filedata_".$uniqueid) as $file ) {
|
80 |
+
if ( isset($file["user_data"]) ) {
|
81 |
+
$userdata_fields = array();
|
82 |
+
foreach ( $file["user_data"] as $userdata_key => $userdata_field )
|
83 |
+
$userdata_fields[$userdata_key] = array( "label" => $userdata_field["label"], "value" => $userdata_field["value"] );
|
84 |
+
break;
|
85 |
+
}
|
86 |
+
}
|
87 |
+
}
|
88 |
+
//in case there are no files in session (because allownofile attribute is
|
89 |
+
//active and the user did not select any files for upload) then retrieve
|
90 |
+
//userdata from the database based on uploadid
|
91 |
+
else {
|
92 |
+
$userdata_saved = wfu_get_userdata_from_uploadid($uniqueid);
|
93 |
+
if ( $userdata_saved != null && is_array($userdata_saved) ) {
|
94 |
+
$userdata_fields = array();
|
95 |
+
foreach ( $userdata_saved as $userdata_saved_rec )
|
96 |
+
$userdata_fields[$userdata_saved_rec->propkey] = array( "label" => $userdata_saved_rec->property, "value" => $userdata_saved_rec->propvalue );
|
97 |
+
}
|
98 |
+
}
|
99 |
+
|
100 |
+
$send_error = wfu_send_notification_email($user, $target_path_list, $userdata_fields, $params);
|
101 |
+
|
102 |
+
/* suppress any errors if user is not admin */
|
103 |
+
if ( !$is_admin ) $send_error = "";
|
104 |
+
|
105 |
+
if ( $send_error != "" ) {
|
106 |
+
$params_output_array["general"]['admin_messages']['notify'] = $send_error;
|
107 |
+
$params_output_array["general"]['errors']['notify'] = "error";
|
108 |
+
}
|
109 |
+
|
110 |
+
/* construct safe output */
|
111 |
+
$sout = "0;".WFU_VAR("WFU_DEFAULTMESSAGECOLORS").";0";
|
112 |
+
|
113 |
+
$echo_str = "wfu_fileupload_success::".$sout.":".wfu_encode_array_to_string($params_output_array);
|
114 |
+
// allow an internal hook to process the final output
|
115 |
+
$echo_str = apply_filters('_wfu_ajax_action_send_email_notification', $echo_str);
|
116 |
+
|
117 |
+
die($echo_str);
|
118 |
+
}
|
119 |
+
|
120 |
+
function wfu_ajax_action_ask_server() {
|
121 |
+
if ( !isset($_REQUEST['session_token']) || !isset($_REQUEST['sid']) || !isset($_REQUEST['unique_id']) ) die();
|
122 |
+
|
123 |
+
$_REQUEST = stripslashes_deep($_REQUEST);
|
124 |
+
|
125 |
+
$session_token = sanitize_text_field( $_REQUEST["session_token"] );
|
126 |
+
$sid = sanitize_text_field( $_REQUEST["sid"] );
|
127 |
+
$unique_id = wfu_sanitize_code($_REQUEST['unique_id']);
|
128 |
+
if ( $session_token == "" ) die();
|
129 |
+
//check referrer using Wordpress nonces and server sessions to avoid CSRF attacks
|
130 |
+
check_ajax_referer( 'wfu-uploader-nonce', 'wfu_uploader_nonce' );
|
131 |
+
if ( WFU_USVAR("wfu_token_".$sid) != $session_token ) die();
|
132 |
+
|
133 |
+
//prepare parameters for before-upload filters
|
134 |
+
$ret = array( "status" => "", "echo" => "" );
|
135 |
+
//retrieve file names and sizes from request parameters
|
136 |
+
$filenames_raw = ( isset($_REQUEST['filenames']) ? $_REQUEST['filenames'] : "" );
|
137 |
+
$filenames = array();
|
138 |
+
if ( trim($filenames_raw) != "" ) $filenames = explode(";", $filenames_raw);
|
139 |
+
foreach ( $filenames as $ind => $filename ) $filenames[$ind] = esc_attr(wfu_plugin_decode_string(trim($filename)));
|
140 |
+
$filesizes_raw = ( isset($_REQUEST['filesizes']) ? $_REQUEST['filesizes'] : "" );
|
141 |
+
$filesizes = array();
|
142 |
+
if ( trim($filesizes_raw) != "" ) $filesizes = explode(";", $filesizes_raw);
|
143 |
+
foreach ( $filesizes as $ind => $filesize ) $filesizes[$ind] = wfu_sanitize_int($filesize);
|
144 |
+
$files = array();
|
145 |
+
foreach ( $filenames as $ind => $filename ) {
|
146 |
+
$filesize = "";
|
147 |
+
if ( isset($filesizes[$ind]) ) $filesize = $filesizes[$ind];
|
148 |
+
array_push($files, array( "filename" => $filename, "filesize" => $filesize ));
|
149 |
+
}
|
150 |
+
$attr = array( "sid" => $sid, "unique_id" => $unique_id, "files" => $files );
|
151 |
+
//execute before upload filters
|
152 |
+
$echo_str = "";
|
153 |
+
//first execute any custom filters created by admin
|
154 |
+
if ( has_filter("wfu_before_upload") ) {
|
155 |
+
$changable_data = array( "error_message" => "", "js_script" => "" );
|
156 |
+
$changable_data = apply_filters("wfu_before_upload", $changable_data, $attr);
|
157 |
+
if ( $changable_data["error_message"] == "" ) $ret["status"] = "success";
|
158 |
+
else {
|
159 |
+
$ret["status"] = "error";
|
160 |
+
$echo_str .= "CBUV[".$changable_data["error_message"]."]";
|
161 |
+
}
|
162 |
+
if ( $changable_data["js_script"] != "" ) $echo_str .= "CBUVJS[".wfu_plugin_encode_string($changable_data["js_script"])."]";
|
163 |
+
}
|
164 |
+
//then execute internal filters of extensions
|
165 |
+
$ret = apply_filters("_wfu_before_upload", $ret, $attr);
|
166 |
+
$echo_str .= $ret["echo"];
|
167 |
+
//in case that no filters were executed, because $ret["status"] is
|
168 |
+
//empty, then this call to wfu_ajax_action_ask_server was erroneous
|
169 |
+
if ( $ret["status"] == "" ) $ret["status"] = "die";
|
170 |
+
//create an internal flag stored in session regarding the status of this
|
171 |
+
//upload, that will be used to verify or not the upload
|
172 |
+
if ( $ret["status"] == "success" ) WFU_USVAR_store("wfu_uploadstatus_".$attr["unique_id"], 1);
|
173 |
+
else WFU_USVAR_store("wfu_uploadstatus_".$attr["unique_id"], 0);
|
174 |
+
|
175 |
+
if ( $ret["status"] == "success" || $ret["status"] == "error" )
|
176 |
+
echo "wfu_askserver_".$ret["status"].":".$echo_str;
|
177 |
+
|
178 |
+
die();
|
179 |
+
}
|
180 |
+
|
181 |
+
function wfu_ajax_action_cancel_upload() {
|
182 |
+
if ( !isset($_REQUEST['session_token']) || !isset($_REQUEST['sid']) || !isset($_REQUEST['unique_id']) ) die();
|
183 |
+
|
184 |
+
$_REQUEST = stripslashes_deep($_REQUEST);
|
185 |
+
|
186 |
+
$session_token = sanitize_text_field( $_REQUEST["session_token"] );
|
187 |
+
$sid = sanitize_text_field( $_REQUEST["sid"] );
|
188 |
+
$unique_id = wfu_sanitize_code($_REQUEST['unique_id']);
|
189 |
+
if ( $session_token == "" ) die();
|
190 |
+
//check referrer using Wordpress nonces and server sessions to avoid CSRF attacks
|
191 |
+
check_ajax_referer( 'wfu-uploader-nonce', 'wfu_uploader_nonce' );
|
192 |
+
if ( WFU_USVAR("wfu_token_".$sid) != $session_token ) die();
|
193 |
+
|
194 |
+
//setting status to 0 denotes cancelling of the upload
|
195 |
+
WFU_USVAR_store("wfu_uploadstatus_".$unique_id, 0);
|
196 |
+
|
197 |
+
die("success");
|
198 |
+
}
|
199 |
+
|
200 |
+
function wfu_ajax_action_callback() {
|
201 |
+
if ( !isset($_REQUEST['session_token']) ) die();
|
202 |
+
|
203 |
+
$_REQUEST = stripslashes_deep($_REQUEST);
|
204 |
+
$_POST = stripslashes_deep($_POST);
|
205 |
+
|
206 |
+
$session_token = sanitize_text_field( $_REQUEST["session_token"] );
|
207 |
+
if ( $session_token == "" ) die();
|
208 |
+
check_ajax_referer( 'wfu-uploader-nonce', 'wfu_uploader_nonce' );
|
209 |
+
|
210 |
+
if ( !isset($_REQUEST['params_index']) ) die();
|
211 |
+
|
212 |
+
$params_index = sanitize_text_field( $_REQUEST["params_index"] );
|
213 |
+
|
214 |
+
if ( $params_index == "" ) die();
|
215 |
+
|
216 |
+
$user = wp_get_current_user();
|
217 |
+
$arr = wfu_get_params_fields_from_index($params_index, $session_token);
|
218 |
+
$sid = $arr['shortcode_id'];
|
219 |
+
//check referrer using server sessions to avoid CSRF attacks
|
220 |
+
if ( WFU_USVAR("wfu_token_".$sid) != $session_token ) {
|
221 |
+
$echo_str = "Session failed!<br/><br/>Session Data:<br/>";
|
222 |
+
$echo_str .= print_r(wfu_sanitize(WFU_USALL()), true);
|
223 |
+
$echo_str .= "<br/><br/>Post Data:<br/>";
|
224 |
+
$echo_str .= print_r(wfu_sanitize($_POST), true);
|
225 |
+
$echo_str .= 'force_errorabort_code';
|
226 |
+
$echo_str = apply_filters('_wfu_upload_session_failed', $echo_str);
|
227 |
+
die($echo_str);
|
228 |
+
}
|
229 |
+
|
230 |
+
if ( $user->user_login != $arr['user_login'] ) {
|
231 |
+
$echo_str = "User failed!<br/><br/>User Data:<br/>";
|
232 |
+
$echo_str .= print_r(wfu_sanitize($user), true);
|
233 |
+
$echo_str .= "<br/><br/>Post Data:<br/>";
|
234 |
+
$echo_str .= print_r(wfu_sanitize($_POST), true);
|
235 |
+
$echo_str .= "<br/><br/>Params Data:<br/>";
|
236 |
+
$echo_str .= print_r(wfu_sanitize($arr), true);
|
237 |
+
$echo_str .= 'force_errorabort_code';
|
238 |
+
$echo_str = apply_filters('_wfu_upload_user_failed', $echo_str);
|
239 |
+
die($echo_str);
|
240 |
+
}
|
241 |
+
|
242 |
+
//if force_connection_close is set, then the first pass to this callback script is for closing the previous connection
|
243 |
+
if ( isset($_POST["force_connection_close"]) && $_POST["force_connection_close"] === "1" ) {
|
244 |
+
header("Connection: Close");
|
245 |
+
die(apply_filters('_wfu_upload_force_connection_close', 'success'));
|
246 |
+
}
|
247 |
+
|
248 |
+
//get the unique id of the upload
|
249 |
+
$unique_id = ( isset($_POST['uniqueuploadid_'.$sid]) ? sanitize_text_field($_POST['uniqueuploadid_'.$sid]) : "" );
|
250 |
+
if ( strlen($unique_id) != 10 ) die(apply_filters('_wfu_upload_uniqueid_failed', 'force_errorabort_code'));
|
251 |
+
|
252 |
+
//if before upload actions have been executed and they have rejected the
|
253 |
+
//upload, but for some reason (hack attempt) the upload continued, then
|
254 |
+
//terminate it
|
255 |
+
if ( WFU_USVAR_exists("wfu_uploadstatus_".$unique_id) && WFU_USVAR("wfu_uploadstatus_".$unique_id) == 0 ) die('force_errorabort_code');
|
256 |
+
|
257 |
+
//get stored shortcode parameters
|
258 |
+
$params_str = get_option('wfu_params_'.$arr['unique_id']);
|
259 |
+
$params = wfu_decode_array_from_string($params_str);
|
260 |
+
|
261 |
+
//if upload has finished then perform post upload actions
|
262 |
+
if ( isset($_POST["upload_finished"]) && $_POST["upload_finished"] === "1" ) {
|
263 |
+
$echo_str = "";
|
264 |
+
//execute after upload filters
|
265 |
+
$ret = wfu_execute_after_upload_filters($sid, $unique_id, $params);
|
266 |
+
if ( $ret["js_script"] != "" ) $echo_str = "CBUVJS[".wfu_plugin_encode_string($ret["js_script"])."]";
|
267 |
+
die($echo_str);
|
268 |
+
}
|
269 |
+
|
270 |
+
//check if honeypot userdata fields have been added to the form and if they
|
271 |
+
//contain any data; if wfu_check_remove_honeypot_fields returns true this
|
272 |
+
//means that at least one honeypot field has beed filled with a value and
|
273 |
+
//the upload must be aborted because it was not done by a human
|
274 |
+
if ( $params["userdata"] == "true" && wfu_check_remove_honeypot_fields($params["userdata_fields"], 'hiddeninput_'.$sid.'_userdata_') ) die("force_abortsuccess_code");
|
275 |
+
|
276 |
+
//apply filters to determine if the upload will continue or stop
|
277 |
+
$ret = array( "status" => "", "echo" => "" );
|
278 |
+
$attr = array( "sid" => $sid, "unique_id" => $unique_id, "params" => $params );
|
279 |
+
$ret = apply_filters("_wfu_pre_upload_check", $ret, $attr);
|
280 |
+
if ( $ret["status"] == "die" ) die($ret["echo"]);
|
281 |
+
|
282 |
+
//if this is the first pass of an upload attempt then perform pre-upload actions
|
283 |
+
if ( !WFU_USVAR_exists('wfu_upload_first_pass_'.$unique_id) || WFU_USVAR('wfu_upload_first_pass_'.$unique_id) != 'true' ) {
|
284 |
+
WFU_USVAR_store('wfu_upload_first_pass_'.$unique_id, 'true');
|
285 |
+
}
|
286 |
+
|
287 |
+
if ( !isset($_POST["subdir_sel_index"]) ) die();
|
288 |
+
$subdir_sel_index = sanitize_text_field( $_POST["subdir_sel_index"] );
|
289 |
+
$params['subdir_selection_index'] = $subdir_sel_index;
|
290 |
+
WFU_USVAR_store('wfu_check_refresh_'.$params["uploadid"], 'do not process');
|
291 |
+
|
292 |
+
//update consent status of user
|
293 |
+
$plugin_options = wfu_decode_plugin_options(get_option( "wordpress_file_upload_options" ));
|
294 |
+
$params["consent_result"] = wfu_check_user_consent($user);
|
295 |
+
$require_consent = ( $plugin_options["personaldata"] == "1" && ( $params["notrememberconsent"] == "true" || $params["consent_result"] == "" ) && $params["askconsent"] == "true" );
|
296 |
+
if ( $require_consent ) {
|
297 |
+
if ( !isset($_POST['consent_result']) ) die();
|
298 |
+
$consent_result = ( $_POST['consent_result'] == "yes" ? "yes" : ( $_POST['consent_result'] == "no" ? "no" : "" ) );
|
299 |
+
$params["consent_result"] = ( $_POST['consent_result'] == "yes" ? "1" : ( $_POST['consent_result'] == "no" ? "0" : "" ) );
|
300 |
+
wfu_update_user_consent($user, $consent_result);
|
301 |
+
}
|
302 |
+
|
303 |
+
$wfu_process_file_array = wfu_process_files($params, 'ajax');
|
304 |
+
// extract safe_output from wfu_process_file_array and pass it as separate part of the response text
|
305 |
+
$safe_output = $wfu_process_file_array["general"]['safe_output'];
|
306 |
+
unset($wfu_process_file_array["general"]['safe_output']);
|
307 |
+
// get javascript code that has been defined in wfu_after_file_upload action
|
308 |
+
$js_script = wfu_plugin_encode_string($wfu_process_file_array["general"]['js_script']);
|
309 |
+
unset($wfu_process_file_array["general"]['js_script']);
|
310 |
+
|
311 |
+
$echo_str = "wfu_fileupload_success:".$js_script.":".$safe_output.":".wfu_encode_array_to_string($wfu_process_file_array);
|
312 |
+
$echo_str = apply_filters('_wfu_upload_callback_success', $echo_str);
|
313 |
+
die($echo_str);
|
314 |
+
}
|
315 |
+
|
316 |
+
function wfu_ajax_action_save_shortcode() {
|
317 |
+
$is_admin = current_user_can( 'manage_options' );
|
318 |
+
$can_open_composer = ( WFU_VAR("WFU_SHORTCODECOMPOSER_NOADMIN") == "true" && ( current_user_can( 'edit_pages' ) || current_user_can( 'edit_posts' ) ) );
|
319 |
+
if ( !$is_admin && !$can_open_composer ) die();
|
320 |
+
if ( !isset($_POST['shortcode']) || !isset($_POST['shortcode_original']) || !isset($_POST['post_id']) || !isset($_POST['post_hash']) || !isset($_POST['shortcode_position']) || !isset($_POST['shortcode_tag']) || !isset($_POST['widget_id']) ) die();
|
321 |
+
|
322 |
+
$_POST = stripslashes_deep($_POST);
|
323 |
+
|
324 |
+
//sanitize parameters
|
325 |
+
$shortcode = wfu_sanitize_code($_POST['shortcode']);
|
326 |
+
$shortcode_original = wfu_sanitize_code($_POST['shortcode_original']);
|
327 |
+
$post_id = wfu_sanitize_int($_POST['post_id']);
|
328 |
+
$post_hash = wfu_sanitize_code($_POST['post_hash']);
|
329 |
+
$shortcode_position = wfu_sanitize_int($_POST['shortcode_position']);
|
330 |
+
$shortcode_tag = wfu_sanitize_tag($_POST['shortcode_tag']);
|
331 |
+
$widget_id = sanitize_text_field($_POST['widget_id']);
|
332 |
+
|
333 |
+
$shortcode = wfu_sanitize_shortcode(wfu_plugin_decode_string($shortcode), $shortcode_tag);
|
334 |
+
|
335 |
+
if ( $post_id == "" && $widget_id == "" ) {
|
336 |
+
die();
|
337 |
+
}
|
338 |
+
else {
|
339 |
+
$data['post_id'] = $post_id;
|
340 |
+
$data['post_hash'] = $post_hash;
|
341 |
+
$data['shortcode'] = wfu_plugin_decode_string($shortcode_original);
|
342 |
+
$data['position'] = $shortcode_position;
|
343 |
+
if ( $post_id != "" && !wfu_check_edit_shortcode($data) ) $echo_str = "wfu_save_shortcode:fail:post_modified";
|
344 |
+
else {
|
345 |
+
if ( $widget_id == "" ) {
|
346 |
+
$new_shortcode = "[".$shortcode_tag." ".$shortcode."]";
|
347 |
+
if ( wfu_replace_shortcode($data, $new_shortcode) ) {
|
348 |
+
$post = get_post($post_id);
|
349 |
+
$hash = hash('md5', $post->post_content);
|
350 |
+
$echo_str = "wfu_save_shortcode:success:".$hash;
|
351 |
+
}
|
352 |
+
else $echo_str = "wfu_save_shortcode:fail:post_update_failed";
|
353 |
+
}
|
354 |
+
else {
|
355 |
+
$widget_obj = wfu_get_widget_obj_from_id($widget_id);
|
356 |
+
if ( $widget_obj === false ) $echo_str = "wfu_save_shortcode:fail:post_update_failed";
|
357 |
+
else {
|
358 |
+
$widget_sidebar = is_active_widget(false, $widget_id, "wordpress_file_upload_widget");
|
359 |
+
if ( !$widget_sidebar ) $echo_str = "wfu_save_shortcode:fail:post_update_failed";
|
360 |
+
else {
|
361 |
+
$widget_obj->update_external($shortcode);
|
362 |
+
$hash = $data['post_hash'];
|
363 |
+
$echo_str = "wfu_save_shortcode:success:".$hash;
|
364 |
+
}
|
365 |
+
}
|
366 |
+
}
|
367 |
+
}
|
368 |
+
}
|
369 |
+
|
370 |
+
$echo_str = apply_filters('_wfu_ajax_action_save_shortcode', $echo_str);
|
371 |
+
die($echo_str);
|
372 |
+
}
|
373 |
+
|
374 |
+
function wfu_ajax_action_check_page_contents() {
|
375 |
+
if ( !current_user_can( 'manage_options' ) ) die();
|
376 |
+
if ( !isset($_POST['post_id']) || !isset($_POST['post_hash']) ) die();
|
377 |
+
if ( $_POST['post_id'] == "" ) die();
|
378 |
+
|
379 |
+
$_POST = stripslashes_deep($_POST);
|
380 |
+
|
381 |
+
$data['post_id'] = wfu_sanitize_int($_POST['post_id']);
|
382 |
+
$data['post_hash'] = wfu_sanitize_code($_POST['post_hash']);
|
383 |
+
if ( wfu_check_edit_shortcode($data) ) $echo_str = "wfu_check_page_contents:current:";
|
384 |
+
else $echo_str = "wfu_check_page_contents:obsolete:";
|
385 |
+
|
386 |
+
$echo_str = apply_filters('_wfu_ajax_action_check_page_contents', $echo_str);
|
387 |
+
die($echo_str);
|
388 |
+
}
|
389 |
+
|
390 |
+
function wfu_ajax_action_edit_shortcode() {
|
391 |
+
global $wp_registered_widgets;
|
392 |
+
global $wp_registered_sidebars;
|
393 |
+
|
394 |
+
$is_admin = current_user_can( 'manage_options' );
|
395 |
+
$can_open_composer = ( WFU_VAR("WFU_SHORTCODECOMPOSER_NOADMIN") == "true" && ( current_user_can( 'edit_pages' ) || current_user_can( 'edit_posts' ) ) );
|
396 |
+
if ( !$is_admin && !$can_open_composer ) die();
|
397 |
+
if ( !isset($_POST['upload_id']) || !isset($_POST['post_id']) || !isset($_POST['post_hash']) || !isset($_POST['shortcode_tag']) || !isset($_POST['widget_id']) ) die();
|
398 |
+
|
399 |
+
$_POST = stripslashes_deep($_POST);
|
400 |
+
|
401 |
+
//sanitize parameters
|
402 |
+
$upload_id = sanitize_text_field($_POST['upload_id']);
|
403 |
+
$widget_id = sanitize_text_field($_POST['widget_id']);
|
404 |
+
$post_id = wfu_sanitize_int($_POST['post_id']);
|
405 |
+
$post_hash = wfu_sanitize_code($_POST['post_hash']);
|
406 |
+
$shortcode_tag = wfu_sanitize_tag($_POST['shortcode_tag']);
|
407 |
+
|
408 |
+
$keyname = "uploadid";
|
409 |
+
if ( $shortcode_tag == "wordpress_file_upload_browser" ) $keyname = "browserid";
|
410 |
+
|
411 |
+
$data['post_id'] = $post_id;
|
412 |
+
$data['post_hash'] = $post_hash;
|
413 |
+
if ( wfu_check_edit_shortcode($data) ) {
|
414 |
+
if ( $widget_id == "" ) {
|
415 |
+
$post = get_post($data['post_id']);
|
416 |
+
//get default value for uploadid
|
417 |
+
if ( $shortcode_tag == "wordpress_file_upload_browser" ) $defs = wfu_browser_attribute_definitions();
|
418 |
+
else $defs = wfu_attribute_definitions();
|
419 |
+
$default = "";
|
420 |
+
foreach ( $defs as $key => $def ) {
|
421 |
+
if ( $def['attribute'] == $keyname ) {
|
422 |
+
$default = $def['value'];
|
423 |
+
break;
|
424 |
+
}
|
425 |
+
}
|
426 |
+
//get page shortcodes
|
427 |
+
$wfu_shortcodes = wfu_get_content_shortcodes($post, $shortcode_tag);
|
428 |
+
//find the shortcodes' uploadid and the correct one
|
429 |
+
$validkey = -1;
|
430 |
+
foreach ( $wfu_shortcodes as $key => $data ) {
|
431 |
+
$shortcode = trim(substr($data['shortcode'], strlen('['.$shortcode_tag), -1));
|
432 |
+
$shortcode_attrs = wfu_shortcode_string_to_array($shortcode);
|
433 |
+
if ( array_key_exists($keyname, $shortcode_attrs) ) $uploadid = $shortcode_attrs[$keyname];
|
434 |
+
else $uploadid = $default;
|
435 |
+
if ( $uploadid == $upload_id ) {
|
436 |
+
$validkey = $key;
|
437 |
+
break;
|
438 |
+
}
|
439 |
+
}
|
440 |
+
if ( $validkey == -1 ) die();
|
441 |
+
$data_enc = wfu_safe_store_shortcode_data(wfu_encode_array_to_string($wfu_shortcodes[$validkey]));
|
442 |
+
}
|
443 |
+
else {
|
444 |
+
$widget_obj = wfu_get_widget_obj_from_id($widget_id);
|
445 |
+
if ( $widget_obj === false ) die();
|
446 |
+
$widget_sidebar = is_active_widget(false, $widget_id, "wordpress_file_upload_widget");
|
447 |
+
if ( !$widget_sidebar ) die();
|
448 |
+
if ( isset($wp_registered_sidebars[$widget_sidebar]) && isset($wp_registered_sidebars[$widget_sidebar]['name']) ) $widget_sidebar = $wp_registered_sidebars[$widget_sidebar]['name'];
|
449 |
+
$data['shortcode'] = $widget_obj->shortcode();
|
450 |
+
$data['position'] = 0;
|
451 |
+
$data['widgetid'] = $widget_id;
|
452 |
+
$data['sidebar'] = $widget_sidebar;
|
453 |
+
$data_enc = wfu_safe_store_shortcode_data(wfu_encode_array_to_string($data));
|
454 |
+
}
|
455 |
+
if( $is_admin ) $url = site_url().'/wp-admin/options-general.php?page=wordpress_file_upload&tag='.$shortcode_tag.'&action=edit_shortcode&data='.$data_enc;
|
456 |
+
//conditional that will open the shortcode composer for non-admin users
|
457 |
+
//who can edit posts or pages
|
458 |
+
else $url = site_url().'/wp-admin/admin.php?page=wordpress_file_upload&tag='.$shortcode_tag.'&action=edit_shortcode&data='.$data_enc;
|
459 |
+
$echo_str = "wfu_edit_shortcode:success:".wfu_plugin_encode_string($url);
|
460 |
+
}
|
461 |
+
else $echo_str = "wfu_edit_shortcode:check_page_obsolete:".WFU_ERROR_PAGE_OBSOLETE;
|
462 |
+
|
463 |
+
$echo_str = apply_filters('_wfu_ajax_action_edit_shortcode', $echo_str);
|
464 |
+
die($echo_str);
|
465 |
+
}
|
466 |
+
|
467 |
+
function wfu_ajax_action_gutedit_shortcode() {
|
468 |
+
$is_admin = current_user_can( 'manage_options' );
|
469 |
+
$can_open_composer = ( WFU_VAR("WFU_SHORTCODECOMPOSER_NOADMIN") == "true" && ( current_user_can( 'edit_pages' ) || current_user_can( 'edit_posts' ) ) );
|
470 |
+
if ( !$is_admin && !$can_open_composer ) die();
|
471 |
+
if ( !isset($_POST['shortcode']) || !isset($_POST['post_id']) || !isset($_POST['shortcode_tag']) ) die();
|
472 |
+
|
473 |
+
$_POST = stripslashes_deep($_POST);
|
474 |
+
|
475 |
+
//sanitize parameters
|
476 |
+
$shortcode = wfu_sanitize_code($_POST['shortcode']);
|
477 |
+
$post_id = wfu_sanitize_int($_POST['post_id']);
|
478 |
+
$shortcode_tag = wfu_sanitize_tag($_POST['shortcode_tag']);
|
479 |
+
|
480 |
+
$shortcode = wfu_sanitize_shortcode(wfu_plugin_decode_string($shortcode), $shortcode_tag);
|
481 |
+
|
482 |
+
if ( $post_id == "" ) die();
|
483 |
+
|
484 |
+
$data['shortcode'] = '['.$shortcode_tag.' '.$shortcode.']';
|
485 |
+
$data['post_id'] = $post_id;
|
486 |
+
$data['post_hash'] = '';
|
487 |
+
$data['position'] = 0;
|
488 |
+
$data_enc = wfu_safe_store_shortcode_data(wfu_encode_array_to_string($data));
|
489 |
+
if ( $is_admin ) $url = site_url().'/wp-admin/options-general.php?page=wordpress_file_upload&tag='.$shortcode_tag.'&action=edit_shortcode&data='.$data_enc.'&referer=guteditor';
|
490 |
+
//conditional that will open the shortcode composer for non-admin users who
|
491 |
+
//can edit posts or pages
|
492 |
+
else $url = site_url().'/wp-admin/admin.php?page=wordpress_file_upload&tag='.$shortcode_tag.'&action=edit_shortcode&data='.$data_enc.'&referer=guteditor';
|
493 |
+
|
494 |
+
$echo_str = "wfu_gutedit_shortcode:success:".wfu_plugin_encode_string($url);
|
495 |
+
$echo_str = apply_filters('_wfu_ajax_action_gutedit_shortcode', $echo_str);
|
496 |
+
die($echo_str);
|
497 |
+
}
|
498 |
+
|
499 |
+
function wfu_ajax_action_read_subfolders() {
|
500 |
+
if ( !isset($_POST['folder1']) || !isset($_POST['folder2']) ) die();
|
501 |
+
|
502 |
+
$_POST = stripslashes_deep($_POST);
|
503 |
+
|
504 |
+
$folder1 = wfu_sanitize_code($_POST['folder1']);
|
505 |
+
$folder1 = wfu_sanitize_url(wfu_plugin_decode_string($folder1));
|
506 |
+
$folder2 = wfu_sanitize_code($_POST['folder2']);
|
507 |
+
$folder2 = wfu_sanitize_url(wfu_plugin_decode_string($folder2));
|
508 |
+
if ( wfu_plugin_encode_string($folder1) != $_POST['folder1'] || wfu_plugin_encode_string($folder2) != $_POST['folder2'] ) die();
|
509 |
+
|
510 |
+
$temp_params = array( 'uploadpath' => $folder1, 'accessmethod' => 'normal', 'ftpinfo' => '', 'useftpdomain' => 'false' );
|
511 |
+
$path = wfu_upload_plugin_full_path($temp_params);
|
512 |
+
|
513 |
+
if ( !is_dir($path) ) die(apply_filters('_wfu_ajax_action_read_subfolders', 'wfu_read_subfolders:error:Parent folder is not valid! Cannot retrieve subfolder list.'));
|
514 |
+
|
515 |
+
$path2 = $folder2;
|
516 |
+
$dirlist = "";
|
517 |
+
if ( $handle = opendir($path) ) {
|
518 |
+
$blacklist = array('.', '..');
|
519 |
+
while ( false !== ($file = readdir($handle)) )
|
520 |
+
if ( !in_array($file, $blacklist) ) {
|
521 |
+
$filepath = $path.$file;
|
522 |
+
if ( is_dir($filepath) ) {
|
523 |
+
if ( $file == $path2 ) $file = '[['.$file.']]';
|
524 |
+
$dirlist .= ( $dirlist == "" ? "" : "," ).$file;
|
525 |
+
}
|
526 |
+
}
|
527 |
+
closedir($handle);
|
528 |
+
}
|
529 |
+
if ( $path2 != "" ) {
|
530 |
+
$dirlist2 = $path2;
|
531 |
+
$path .= $path2."/";
|
532 |
+
if ( is_dir($path) ) {
|
533 |
+
if ( $handle = opendir($path) ) {
|
534 |
+
$blacklist = array('.', '..');
|
535 |
+
while ( false !== ($file = readdir($handle)) )
|
536 |
+
if ( !in_array($file, $blacklist) ) {
|
537 |
+
$filepath = $path.$file;
|
538 |
+
if ( is_dir($filepath) )
|
539 |
+
$dirlist2 .= ",*".$file;
|
540 |
+
}
|
541 |
+
closedir($handle);
|
542 |
+
}
|
543 |
+
}
|
544 |
+
$dirlist = str_replace('[['.$path2.']]', $dirlist2, $dirlist);
|
545 |
+
}
|
546 |
+
|
547 |
+
die(apply_filters('_wfu_ajax_action_read_subfolders', "wfu_read_subfolders:success:".wfu_plugin_encode_string($dirlist)));
|
548 |
+
}
|
549 |
+
|
550 |
+
function wfu_ajax_action_download_file_invoker() {
|
551 |
+
global $wfu_user_state_handler;
|
552 |
+
|
553 |
+
$_POST = stripslashes_deep($_POST);
|
554 |
+
$_GET = stripslashes_deep($_GET);
|
555 |
+
|
556 |
+
$file_code = (isset($_POST['file']) ? $_POST['file'] : (isset($_GET['file']) ? $_GET['file'] : ''));
|
557 |
+
$nonce = (isset($_POST['nonce']) ? $_POST['nonce'] : (isset($_GET['nonce']) ? $_GET['nonce'] : ''));
|
558 |
+
if ( $file_code == '' || $nonce == '' ) die();
|
559 |
+
|
560 |
+
//security check to avoid CSRF attacks
|
561 |
+
if ( !wp_verify_nonce($nonce, 'wfu_download_file_invoker') ) die();
|
562 |
+
|
563 |
+
//check if user is allowed to download files
|
564 |
+
if ( !current_user_can( 'manage_options' ) ) {
|
565 |
+
die();
|
566 |
+
}
|
567 |
+
|
568 |
+
$file_code = sanitize_text_field($file_code);
|
569 |
+
//if file_code is exportdata, then export of data has been requested and
|
570 |
+
//we need to create a file with export data and recreate file_code
|
571 |
+
if ( substr($file_code, 0, 10) == "exportdata" && current_user_can( 'manage_options' ) ) {
|
572 |
+
$params = null;
|
573 |
+
$params_str = substr($file_code, 11);
|
574 |
+
if ( trim($params_str) != "" ) $params = json_decode($params_str, true);
|
575 |
+
$filepath = wfu_export_uploaded_files($params);
|
576 |
+
if ( $filepath === false ) die();
|
577 |
+
$file_code = "exportdata".wfu_safe_store_filepath($filepath);
|
578 |
+
//store filepath in session otherwise it can not be retrieved by
|
579 |
+
//downloader script
|
580 |
+
WFU_USVAR_store_session('wfu_storage_'.substr($file_code, 10), $filepath);
|
581 |
+
}
|
582 |
+
//else get the file path from the safe
|
583 |
+
else {
|
584 |
+
$filepath = wfu_get_filepath_from_safe($file_code);
|
585 |
+
if ( $filepath === false ) die();
|
586 |
+
$filepath = wfu_path_rel2abs(wfu_flatten_path($filepath));
|
587 |
+
//reject download of blacklisted file types for security reasons
|
588 |
+
if ( wfu_file_extension_blacklisted($filepath) ) {
|
589 |
+
die(apply_filters('_wfu_ajax_action_download_file_invoker', 'wfu_ajax_action_download_file_invoker:not_allowed:'.( isset($_POST['browser']) ? WFU_BROWSER_DOWNLOADFILE_NOTALLOWED : 'You are not allowed to download this file!' )));
|
590 |
+
}
|
591 |
+
//for front-end browser apply wfu_browser_check_file_action filter to allow or restrict the download
|
592 |
+
if ( isset($_POST['browser']) ) {
|
593 |
+
$changable_data["error_message"] = "";
|
594 |
+
$filerec = wfu_get_file_rec($filepath, true);
|
595 |
+
$userdata = array();
|
596 |
+
foreach ( $filerec->userdata as $data )
|
597 |
+
array_push($userdata, array( "label" => $data->property, "value" => $data->propvalue ));
|
598 |
+
$additional_data = array(
|
599 |
+
"file_action" => "download",
|
600 |
+
"filepath" => $filepath,
|
601 |
+
"uploaduser" => $filerec->uploaduserid,
|
602 |
+
"userdata" => $userdata
|
603 |
+
);
|
604 |
+
$changable_data = apply_filters("wfu_browser_check_file_action", $changable_data, $additional_data);
|
605 |
+
if ( $changable_data["error_message"] != "" )
|
606 |
+
die(apply_filters('_wfu_ajax_action_download_file_invoker', 'wfu_ajax_action_download_file_invoker:not_allowed:'.$changable_data["error_message"]));
|
607 |
+
}
|
608 |
+
//for back-end browser check if user is allowed to perform this action on this file
|
609 |
+
if ( !wfu_current_user_owes_file($filepath) ) die();
|
610 |
+
//store filepath in session otherwise it can not be retrieved by
|
611 |
+
//downloader script
|
612 |
+
WFU_USVAR_store_session('wfu_storage_'.$file_code, wfu_get_filepath_from_safe($file_code));
|
613 |
+
}
|
614 |
+
|
615 |
+
//generate download unique id to monitor this download
|
616 |
+
$download_id = wfu_create_random_string(16);
|
617 |
+
//store download status of this download in session, so that it can be
|
618 |
+
//retrieved by downloader script
|
619 |
+
WFU_USVAR_store_session('wfu_download_status_'.$download_id, 'starting');
|
620 |
+
//generate download ticket which expires in 30sec and store it in session
|
621 |
+
//it will be used as security measure for the downloader script, which runs outside Wordpress environment
|
622 |
+
WFU_USVAR_store_session('wfu_download_ticket_'.$download_id, time() + 30);
|
623 |
+
//generate download monitor ticket which expires in 30sec and store it in session
|
624 |
+
//it will be used as security measure for the monitor script that will check download status
|
625 |
+
WFU_USVAR_store_session('wfu_download_monitor_ticket_'.$download_id, time() + 30);
|
626 |
+
|
627 |
+
//store translatable strings to session so that they can be used by a script
|
628 |
+
//that runs outside Wordpress environment
|
629 |
+
WFU_USVAR_store_session('wfu_browser_downloadfile_notexist', ( isset($_POST['browser']) ? WFU_BROWSER_DOWNLOADFILE_NOTEXIST : 'File does not exist!' ));
|
630 |
+
WFU_USVAR_store_session('wfu_browser_downloadfile_failed', ( isset($_POST['browser']) ? WFU_BROWSER_DOWNLOADFILE_FAILED : 'Could not download file!' ));
|
631 |
+
|
632 |
+
//this routine returns a dynamically created iframe element, that will call the actual download script;
|
633 |
+
//the actual download script runs outside Wordpress environment in order to ensure that no php warnings
|
634 |
+
//or echo from other plugins is generated, that could scramble the downloaded file;
|
635 |
+
//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
|
636 |
+
//by the time it is consumed by the download script, so it cannot be used again
|
637 |
+
$response = '<iframe src="'.WFU_DOWNLOADER_URL.'?file='.$file_code.'&ticket='.$download_id.'" style="display: none;"></iframe>';
|
638 |
+
|
639 |
+
die(apply_filters('_wfu_ajax_action_download_file_invoker', 'wfu_ajax_action_download_file_invoker:wfu_download_id;'.$download_id.':'.$response));
|
640 |
+
}
|
641 |
+
|
642 |
+
function wfu_ajax_action_download_file_monitor() {
|
643 |
+
$_POST = stripslashes_deep($_POST);
|
644 |
+
$_GET = stripslashes_deep($_GET);
|
645 |
+
|
646 |
+
$file_code = (isset($_POST['file']) ? $_POST['file'] : (isset($_GET['file']) ? $_GET['file'] : ''));
|
647 |
+
$id = (isset($_POST['id']) ? $_POST['id'] : (isset($_GET['id']) ? $_GET['id'] : ''));
|
648 |
+
if ( $file_code == '' || $id == '' ) die();
|
649 |
+
$id = wfu_sanitize_code($id);
|
650 |
+
|
651 |
+
//ensure that this is not a CSRF attack by checking validity of a security ticket
|
652 |
+
if ( !WFU_USVAR_exists_session('wfu_download_monitor_ticket_'.$id) || time() > WFU_USVAR_session('wfu_download_monitor_ticket_'.$id) ) die();
|
653 |
+
//destroy monitor ticket so it cannot be used again
|
654 |
+
WFU_USVAR_unset_session('wfu_download_monitor_ticket_'.$id);
|
655 |
+
|
656 |
+
//initiate loop of 30secs to check the download status of the file;
|
657 |
+
//the download status is controlled by the actual download script;
|
658 |
+
//if the file finishes within the 30secs of the loop, then this routine logs the action and notifies
|
659 |
+
//the client side about the download status of the file, otherwise an instruction
|
660 |
+
//to the client side to repeat this routine and wait for another 30secs is dispatched
|
661 |
+
$end_time = time() + 30;
|
662 |
+
$upload_ended = false;
|
663 |
+
while ( time() < $end_time ) {
|
664 |
+
$upload_ended = ( WFU_USVAR_exists_session('wfu_download_status_'.$id) ? ( WFU_USVAR_session('wfu_download_status_'.$id) == 'downloaded' || WFU_USVAR_session('wfu_download_status_'.$id) == 'failed' ? true : false ) : false );
|
665 |
+
if ( $upload_ended ) break;
|
666 |
+
usleep(100);
|
667 |
+
}
|
668 |
+
|
669 |
+
if ( $upload_ended ) {
|
670 |
+
$user = wp_get_current_user();
|
671 |
+
// $filepath = wfu_plugin_decode_string($file_code);
|
672 |
+
$filepath = wfu_get_filepath_from_safe($file_code);
|
673 |
+
if ( $filepath === false ) die();
|
674 |
+
$filepath = wfu_path_rel2abs(wfu_flatten_path($filepath));
|
675 |
+
wfu_log_action('download', $filepath, $user->ID, '', 0, 0, '', null);
|
676 |
+
die(apply_filters('_wfu_ajax_action_download_file_monitor', 'wfu_ajax_action_download_file_monitor:'.WFU_USVAR_session('wfu_download_status_'.$id).':'));
|
677 |
+
}
|
678 |
+
else {
|
679 |
+
//regenerate monitor ticket
|
680 |
+
WFU_USVAR_store_session('wfu_download_monitor_ticket_'.$id, time() + 30);
|
681 |
+
die(apply_filters('_wfu_ajax_action_download_file_monitor', 'wfu_ajax_action_download_file_monitor:repeat:'.$id));
|
682 |
+
}
|
683 |
+
}
|
684 |
+
|
685 |
+
function wfu_ajax_action_get_historylog_page() {
|
686 |
+
if ( !isset($_POST['token']) || !isset($_POST['page']) ) die();
|
687 |
+
check_ajax_referer( 'wfu-historylog-page', 'token' );
|
688 |
+
if ( !current_user_can( 'manage_options' ) ) die();
|
689 |
+
if ( WFU_VAR("WFU_HISTORYLOG_TABLE_MAXROWS") <= 0 ) die();
|
690 |
+
|
691 |
+
$_POST = stripslashes_deep($_POST);
|
692 |
+
|
693 |
+
$page = wfu_sanitize_int($_POST['page']);
|
694 |
+
$rows = wfu_view_log($page, true);
|
695 |
+
|
696 |
+
die(apply_filters('_wfu_ajax_action_get_historylog_page', 'wfu_historylog_page_success:'.wfu_plugin_encode_string($rows)));
|
697 |
+
}
|
698 |
+
|
699 |
+
function wfu_ajax_action_get_uploadedfiles_page() {
|
700 |
+
if ( !isset($_POST['token']) || !isset($_POST['page']) ) die();
|
701 |
+
check_ajax_referer( 'wfu-uploadedfiles-page', 'token' );
|
702 |
+
if ( !current_user_can( 'manage_options' ) ) die();
|
703 |
+
if ( WFU_VAR("WFU_UPLOADEDFILES_TABLE_MAXROWS") <= 0 ) die();
|
704 |
+
|
705 |
+
$_POST = stripslashes_deep($_POST);
|
706 |
+
|
707 |
+
$page = wfu_sanitize_int($_POST['page']);
|
708 |
+
$rows = wfu_uploadedfiles_manager($page, true);
|
709 |
+
|
710 |
+
die(apply_filters('_wfu_ajax_action_get_uploadedfiles_page', 'wfu_uploadedfiles_page_success:'.wfu_plugin_encode_string($rows)));
|
711 |
+
}
|
712 |
+
|
713 |
+
function wfu_ajax_action_get_adminbrowser_page() {
|
714 |
+
if ( !isset($_POST['code']) || !isset($_POST['token']) || !isset($_POST['page']) ) die();
|
715 |
+
|
716 |
+
$_POST = stripslashes_deep($_POST);
|
717 |
+
|
718 |
+
check_ajax_referer( 'wfu-adminbrowser-page', 'token' );
|
719 |
+
if ( !current_user_can( 'manage_options' ) ) die();
|
720 |
+
if ( WFU_VAR("WFU_ADMINBROWSER_TABLE_MAXROWS") <= 0 ) die();
|
721 |
+
|
722 |
+
$code = wfu_sanitize_code($_POST['code']);
|
723 |
+
$page = wfu_sanitize_int($_POST['page']);
|
724 |
+
//get list of files
|
725 |
+
$rows = wfu_browse_files($code, $page, true);
|
726 |
+
|
727 |
+
die(apply_filters('_wfu_ajax_action_get_adminbrowser_page', 'wfu_adminbrowser_page_success:'.wfu_plugin_encode_string($rows)));
|
728 |
+
}
|
729 |
+
|
730 |
+
function wfu_ajax_action_include_file() {
|
731 |
+
$_POST = stripslashes_deep($_POST);
|
732 |
+
$_GET = stripslashes_deep($_GET);
|
733 |
+
|
734 |
+
$file_code = (isset($_POST['file']) ? $_POST['file'] : (isset($_GET['file']) ? $_GET['file'] : ''));
|
735 |
+
$nonce = (isset($_POST['nonce']) ? $_POST['nonce'] : (isset($_GET['nonce']) ? $_GET['nonce'] : ''));
|
736 |
+
if ( $file_code == '' || $nonce == '' ) die();
|
737 |
+
|
738 |
+
if ( !current_user_can( 'manage_options' ) ) die();
|
739 |
+
//security check to avoid CSRF attacks
|
740 |
+
if ( !wp_verify_nonce($nonce, 'wfu_include_file') ) die();
|
741 |
+
|
742 |
+
$plugin_options = wfu_decode_plugin_options(get_option( "wordpress_file_upload_options" ));
|
743 |
+
if ( $plugin_options['includeotherfiles'] != "1" ) die();
|
744 |
+
|
745 |
+
$dec_file = wfu_get_filepath_from_safe($file_code);
|
746 |
+
if ( $dec_file === false ) die();
|
747 |
+
|
748 |
+
$user = wp_get_current_user();
|
749 |
+
$dec_file = wfu_path_rel2abs(wfu_flatten_path($dec_file));
|
750 |
+
$fileid = wfu_log_action('include', $dec_file, $user->ID, '', '', get_current_blog_id(), '', null);
|
751 |
+
|
752 |
+
if ( $fileid !== false ) {
|
753 |
+
die(apply_filters('_wfu_ajax_action_include_file', "wfu_include_file:success:".$fileid));
|
754 |
+
}
|
755 |
+
else die(apply_filters('_wfu_ajax_action_include_file', 'wfu_include_file:fail:'));
|
756 |
+
}
|
757 |
+
|
758 |
+
function wfu_ajax_action_notify_wpfilebase() {
|
759 |
+
$_POST = stripslashes_deep($_POST);
|
760 |
+
$_GET = stripslashes_deep($_GET);
|
761 |
+
|
762 |
+
$params_index = (isset($_POST['params_index']) ? $_POST['params_index'] : (isset($_GET['params_index']) ? $_GET['params_index'] : ''));
|
763 |
+
$session_token = (isset($_POST['session_token']) ? $_POST['session_token'] : (isset($_GET['session_token']) ? $_GET['session_token'] : ''));
|
764 |
+
if ( $params_index == '' || $session_token == '' ) die();
|
765 |
+
|
766 |
+
$params_index = sanitize_text_field($params_index);
|
767 |
+
$session_token = sanitize_text_field($session_token);
|
768 |
+
|
769 |
+
$arr = wfu_get_params_fields_from_index($params_index, $session_token);
|
770 |
+
//check referer using server sessions to avoid CSRF attacks
|
771 |
+
if ( WFU_USVAR("wfu_token_".$arr['shortcode_id']) != $session_token ) die();
|
772 |
+
|
773 |
+
do_action('wpfilebase_sync');
|
774 |
+
|
775 |
+
die();
|
776 |
+
}
|
777 |
+
|
778 |
+
function wfu_ajax_action_pdusers_get_users() {
|
779 |
+
$_POST = stripslashes_deep($_POST);
|
780 |
+
$_GET = stripslashes_deep($_GET);
|
781 |
+
|
782 |
+
$nonce = (isset($_POST['nonce']) ? $_POST['nonce'] : (isset($_GET['nonce']) ? $_GET['nonce'] : ''));
|
783 |
+
$query = (isset($_POST['query']) ? $_POST['query'] : (isset($_GET['query']) ? $_GET['query'] : ''));
|
784 |
+
if ( $nonce == '' || $query == '' ) die();
|
785 |
+
|
786 |
+
if ( !current_user_can( 'manage_options' ) ) die();
|
787 |
+
//security check to avoid CSRF attacks
|
788 |
+
if ( !wp_verify_nonce($nonce, 'wfu_edit_policy') ) die();
|
789 |
+
|
790 |
+
$query = sanitize_text_field($query);
|
791 |
+
$args = array(
|
792 |
+
'search' => $query,
|
793 |
+
'search_columns' => array( 'user_login', 'display_name' ),
|
794 |
+
'fields' => array( 'user_login', 'display_name' ),
|
795 |
+
'number' => 100
|
796 |
+
);
|
797 |
+
$args = apply_filters("_wfu_get_users", $args, "manage_pdusers");
|
798 |
+
$users = get_users($args);
|
799 |
+
|
800 |
+
die("pdusers_get_users:".wfu_encode_array_to_string($users));
|
801 |
+
}
|
802 |
+
|
803 |
+
?>
|
lib/wfu_attributes.php
CHANGED
@@ -1,1803 +1,1803 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
function wfu_component_definitions() {
|
4 |
-
$components = array(
|
5 |
-
array(
|
6 |
-
"id" => "title",
|
7 |
-
"name" => "Title",
|
8 |
-
"mode" => "free",
|
9 |
-
"dimensions" => array("plugin/Plugin", "title/Title"),
|
10 |
-
"multiplacements" => false,
|
11 |
-
"help" => "A title text for the plugin"
|
12 |
-
),
|
13 |
-
array(
|
14 |
-
"id" => "filename",
|
15 |
-
"name" => "Filename",
|
16 |
-
"mode" => "free",
|
17 |
-
"dimensions" => null,
|
18 |
-
"multiplacements" => false,
|
19 |
-
"help" => "It shows the name of the selected file (useful only for single file uploads)."
|
20 |
-
),
|
21 |
-
array(
|
22 |
-
"id" => "selectbutton",
|
23 |
-
"name" => "Select Button",
|
24 |
-
"mode" => "free",
|
25 |
-
"dimensions" => null,
|
26 |
-
"multiplacements" => false,
|
27 |
-
"help" => "Represents the button to select the files for upload."
|
28 |
-
),
|
29 |
-
array(
|
30 |
-
"id" => "uploadbutton",
|
31 |
-
"name" => "Upload Button",
|
32 |
-
"mode" => "free",
|
33 |
-
"dimensions" => null,
|
34 |
-
"multiplacements" => false,
|
35 |
-
"help" => "Represents the button to execute the upload after some files have been selected."
|
36 |
-
),
|
37 |
-
array(
|
38 |
-
"id" => "subfolders",
|
39 |
-
"name" => "Subfolders",
|
40 |
-
"mode" => "free",
|
41 |
-
"dimensions" => array("uploadfolder_label/Upload Folder Label", "subfolders/Subfolders", "subfolders_label/Subfolders Label", "subfolders_select/Subfolders List"),
|
42 |
-
"multiplacements" => false,
|
43 |
-
"help" => "Allows the user to select the upload folder from a dropdown list."
|
44 |
-
),
|
45 |
-
array(
|
46 |
-
"id" => "webcam",
|
47 |
-
"name" => "Webcam",
|
48 |
-
"mode" => "commercial",
|
49 |
-
"dimensions" => array("webcam/Webcam Box"),
|
50 |
-
"multiplacements" => false,
|
51 |
-
"help" => "Displays video from the device's webcam. The user can capture and upload screenshots or video streams."
|
52 |
-
),
|
53 |
-
array(
|
54 |
-
"id" => "progressbar",
|
55 |
-
"name" => "Progressbar",
|
56 |
-
"mode" => "free",
|
57 |
-
"dimensions" => null,
|
58 |
-
"multiplacements" => false,
|
59 |
-
"help" => "Displays a simple progress bar, showing total progress of upload."
|
60 |
-
),
|
61 |
-
array(
|
62 |
-
"id" => "userdata",
|
63 |
-
"name" => "User Fields",
|
64 |
-
"mode" => "free",
|
65 |
-
"dimensions" => array("userdata/User Fields", "userdata_label/User Fields Label", "userdata_value/User Fields Value"),
|
66 |
-
"multiplacements" => true,
|
67 |
-
"help" => "Displays additional fields that the user must fill-in together with the uploaded files."
|
68 |
-
),
|
69 |
-
array(
|
70 |
-
"id" => "consent",
|
71 |
-
"name" => "Consent",
|
72 |
-
"mode" => "free",
|
73 |
-
"dimensions" => array("consent/Consent Block"),
|
74 |
-
"multiplacements" => false,
|
75 |
-
"help" => "Displays a checkbox asking user's consent for storing personal data."
|
76 |
-
),
|
77 |
-
array(
|
78 |
-
"id" => "message",
|
79 |
-
"name" => "Message",
|
80 |
-
"mode" => "free",
|
81 |
-
"dimensions" => null,
|
82 |
-
"multiplacements" => false,
|
83 |
-
"help" => "Displays a message block with information about the upload, together with any warnings or errors."
|
84 |
-
)
|
85 |
-
);
|
86 |
-
|
87 |
-
wfu_array_remove_nulls($components);
|
88 |
-
|
89 |
-
return $components;
|
90 |
-
}
|
91 |
-
|
92 |
-
function wfu_category_definitions() {
|
93 |
-
$cats = array(
|
94 |
-
"general" => "General",
|
95 |
-
"placements" => "Placements",
|
96 |
-
"labels" => "Labels",
|
97 |
-
"notifications" => "Notifications",
|
98 |
-
"personaldata" => "Personal Data",
|
99 |
-
"colors" => "Colors",
|
100 |
-
"dimensions" => "Dimensions",
|
101 |
-
"userdata" => "Additional Fields",
|
102 |
-
"interoperability" => "Interoperability",
|
103 |
-
"webcam" => "Webcam"
|
104 |
-
);
|
105 |
-
|
106 |
-
return $cats;
|
107 |
-
}
|
108 |
-
|
109 |
-
function wfu_formfield_definitions() {
|
110 |
-
//field properties have 2 parts separated by "/"; the first part determines if the property will be shown to the user (show or hide); the second part determines default value)
|
111 |
-
//when making changes in the structure of formfield definitions, the following are affected:
|
112 |
-
// - wfu_admin_composer.php function wfu_shortcode_composer
|
113 |
-
// variable $fieldprops_basic
|
114 |
-
// variable $fieldprops_default
|
115 |
-
// variable $template
|
116 |
-
// variable wfu_attribute_..._typeprops
|
117 |
-
// variable $from_template
|
118 |
-
// - wfu_functions.php function wfu_parse_userdata_attribute
|
119 |
-
// variable $default
|
120 |
-
// variable $fieldprops
|
121 |
-
// - wfu_blocks.php function wfu_userdata_apply_template
|
122 |
-
// return variable
|
123 |
-
// - wordpress_file_upload_adminfuctions.js function wfu_formdata_type_changed
|
124 |
-
// variable field
|
125 |
-
// - wordpress_file_upload_adminfuctions.js function wfu_formdata_add_field
|
126 |
-
// variable field
|
127 |
-
// - wordpress_file_upload_adminfuctions.js function wfu_formdata_prepare_template
|
128 |
-
// variable fieldprops_basic
|
129 |
-
// variable template
|
130 |
-
// - wordpress_file_upload_adminfuctions.js function wfu_update_formfield_value
|
131 |
-
// variable part
|
132 |
-
// - wordpress_file_upload_adminfuctions.js function wfu_apply_value
|
133 |
-
// variable def
|
134 |
-
// variable fieldprops
|
135 |
-
$formfields = array(
|
136 |
-
array(
|
137 |
-
"type" => "text",
|
138 |
-
"type_description" => "Simple Text",
|
139 |
-
//label properties
|
140 |
-
"label" => "",
|
141 |
-
"label_label" => "Label",
|
142 |
-
"label_hint" => "enter the label that will be shown next to the field",
|
143 |
-
//checkbox properties
|
144 |
-
"required" => "show/false",
|
145 |
-
"required_hint" => "if checked, then this field must have a non-empty value for the file to be uploaded",
|
146 |
-
"donotautocomplete" => "show/false",
|
147 |
-
"donotautocomplete_hint" => "if checked, then the field will notify the browsers not to fill it with autocomplete data when the plugin is reloaded",
|
148 |
-
"validate" => "hide/false",
|
149 |
-
"validate_hint" => "if checked, then the field value entered by the user will be validated before file upload",
|
150 |
-
"typehook" => "hide/false",
|
151 |
-
"typehook_hint" => "if checked, then text suggestions will be shown below the field as the user types more text inside",
|
152 |
-
//dropdown properties
|
153 |
-
"labelposition" => "show/left",
|
154 |
-
"labelposition_hint" => "select the position of the field's label; the position is relative to the field",
|
155 |
-
"hintposition" => "show/right",
|
156 |
-
"hintposition_hint" => "select the position of the hint that will be shown to notify the user that something is wrong\\r\\nthe position is relative to the field",
|
157 |
-
//text properties
|
158 |
-
"default" => "show/",
|
159 |
-
"default_hint" => "enter a default value for the field or leave it empty if you do not want a default value",
|
160 |
-
"data" => "hide/",
|
161 |
-
"data_label" => "Data",
|
162 |
-
"data_hint" => "complete a list of values to be shown to the user",
|
163 |
-
"group" => "hide/",
|
164 |
-
"group_hint" => "if a value is set, then all fields having the same value will belong to the same group",
|
165 |
-
"format" => "hide/",
|
166 |
-
"format_hint" => "enter a format to format user selection"
|
167 |
-
),
|
168 |
-
array(
|
169 |
-
"type" => "multitext",
|
170 |
-
"type_description" => "Multiple Lines Text",
|
171 |
-
//label properties
|
172 |
-
"label" => "",
|
173 |
-
"label_label" => "Label",
|
174 |
-
"label_hint" => "enter the label that will be shown next to the field",
|
175 |
-
//checkbox properties
|
176 |
-
"required" => "show/false",
|
177 |
-
"required_hint" => "if checked, then this field must have a non-empty value for the file to be uploaded",
|
178 |
-
"donotautocomplete" => "hide/true",
|
179 |
-
"donotautocomplete_hint" => "if checked, then the field will notify the browsers not to fill it with autocomplete data when the plugin is reloaded",
|
180 |
-
"validate" => "hide/false",
|
181 |
-
"validate_hint" => "if checked, then the field value entered by the user will be validated before file upload",
|
182 |
-
"typehook" => "hide/false",
|
183 |
-
"typehook_hint" => "if checked, then text suggestions will be shown below the field as the user types more text inside",
|
184 |
-
//dropdown properties
|
185 |
-
"labelposition" => "show/left",
|
186 |
-
"labelposition_hint" => "select the position of the field's label; the position is relative to the field",
|
187 |
-
"hintposition" => "show/right",
|
188 |
-
"hintposition_hint" => "select the position of the hint that will be shown to notify the user that something is wrong\\r\\nthe position is relative to the field",
|
189 |
-
//text properties
|
190 |
-
"default" => "hide/",
|
191 |
-
"default_hint" => "enter a default value for the field or leave it empty if you do not want a default value",
|
192 |
-
"data" => "hide/",
|
193 |
-
"data_label" => "Data",
|
194 |
-
"data_hint" => "complete a list of values to be shown to the user",
|
195 |
-
"group" => "hide/",
|
196 |
-
"group_hint" => "if a value is set, then all fields having the same value will belong to the same group",
|
197 |
-
"format" => "hide/",
|
198 |
-
"format_hint" => "enter a format to format user selection"
|
199 |
-
),
|
200 |
-
array(
|
201 |
-
"type" => "number",
|
202 |
-
"type_description" => "Number",
|
203 |
-
//label properties
|
204 |
-
"label" => "",
|
205 |
-
"label_label" => "Label",
|
206 |
-
"label_hint" => "enter the label that will be shown next to the field",
|
207 |
-
//checkbox properties
|
208 |
-
"required" => "show/false",
|
209 |
-
"required_hint" => "if checked, then this field must have a non-empty value for the file to be uploaded",
|
210 |
-
"donotautocomplete" => "show/true",
|
211 |
-
"donotautocomplete_hint" => "if checked, then the field will notify the browsers not to fill it with autocomplete data when the plugin is reloaded",
|
212 |
-
"validate" => "show/true",
|
213 |
-
"validate_hint" => "if checked, then the number entered by the user will be checked if it is a valid number, based on the format defined, before file upload",
|
214 |
-
"typehook" => "show/false",
|
215 |
-
"typehook_hint" => "if checked, then only valid characters will be allowed during typing",
|
216 |
-
//dropdown properties
|
217 |
-
"labelposition" => "show/left",
|
218 |
-
"labelposition_hint" => "select the position of the field's label; the position is relative to the field",
|
219 |
-
"hintposition" => "show/right",
|
220 |
-
"hintposition_hint" => "select the position of the hint that will be shown to notify the user that something is wrong\\r\\nthe position is relative to the field",
|
221 |
-
//text properties
|
222 |
-
"default" => "show/",
|
223 |
-
"default_hint" => "enter a default value for the field or leave it empty if you do not want a default value",
|
224 |
-
"data" => "hide/",
|
225 |
-
"data_label" => "Data",
|
226 |
-
"data_hint" => "complete a list of values to be shown to the user",
|
227 |
-
"group" => "hide/",
|
228 |
-
"group_hint" => "if a non-empty group value is set, then another email confirmation field belonging to the same group must have the same email value",
|
229 |
-
"format" => "show/d",
|
230 |
-
"format_hint" => "enter a format for the number:\\r\\n d for integers\\r\\n f for floating point numbers\\r\\nthe dot (.) symbol is used as a decimal separator"
|
231 |
-
),
|
232 |
-
array(
|
233 |
-
"type" => "email",
|
234 |
-
"type_description" => "Email",
|
235 |
-
//label properties
|
236 |
-
"label" => "",
|
237 |
-
"label_label" => "Label",
|
238 |
-
"label_hint" => "enter the label that will be shown next to the field",
|
239 |
-
//checkbox properties
|
240 |
-
"required" => "show/false",
|
241 |
-
"required_hint" => "if checked, then this field must have a non-empty value for the file to be uploaded",
|
242 |
-
"donotautocomplete" => "show/true",
|
243 |
-
"donotautocomplete_hint" => "if checked, then the field will notify the browsers not to fill it with autocomplete data when the plugin is reloaded",
|
244 |
-
"validate" => "show/true",
|
245 |
-
"validate_hint" => "if checked, then the email entered by the user will be checked if it is valid before file upload",
|
246 |
-
"typehook" => "hide/false",
|
247 |
-
"typehook_hint" => "if checked, then text suggestions will be shown below the field as the user types more text inside",
|
248 |
-
//dropdown properties
|
249 |
-
"labelposition" => "show/left",
|
250 |
-
"labelposition_hint" => "select the position of the field's label; the position is relative to the field",
|
251 |
-
"hintposition" => "show/right",
|
252 |
-
"hintposition_hint" => "select the position of the hint that will be shown to notify the user that something is wrong\\r\\nthe position is relative to the field",
|
253 |
-
//text properties
|
254 |
-
"default" => "show/",
|
255 |
-
"default_hint" => "enter a default value for the field or leave it empty if you do not want a default value",
|
256 |
-
"data" => "hide/",
|
257 |
-
"data_label" => "Data",
|
258 |
-
"data_hint" => "complete a list of values to be shown to the user",
|
259 |
-
"group" => "show/0",
|
260 |
-
"group_hint" => "if a non-empty group value is set, then another email confirmation field belonging to the same group must have the same email value",
|
261 |
-
"format" => "hide/",
|
262 |
-
"format_hint" => "enter a format to format user selection"
|
263 |
-
),
|
264 |
-
array(
|
265 |
-
"type" => "confirmemail",
|
266 |
-
"type_description" => "Confirmation Email",
|
267 |
-
//label properties
|
268 |
-
"label" => "",
|
269 |
-
"label_label" => "Label",
|
270 |
-
"label_hint" => "enter the label that will be shown next to the field",
|
271 |
-
//checkbox properties
|
272 |
-
"required" => "show/true",
|
273 |
-
"required_hint" => "if checked, then this field must have a non-empty value for the file to be uploaded",
|
274 |
-
"donotautocomplete" => "show/true",
|
275 |
-
"donotautocomplete_hint" => "if checked, then the field will notify the browsers not to fill it with autocomplete data when the plugin is reloaded",
|
276 |
-
"validate" => "hide/true",
|
277 |
-
"validate_hint" => "if checked, then the confirmation email entered by the user will be checked if it is the same with the email belonging to the same group",
|
278 |
-
"typehook" => "hide/false",
|
279 |
-
"typehook_hint" => "if checked, then text suggestions will be shown below the field as the user types more text inside",
|
280 |
-
//dropdown properties
|
281 |
-
"labelposition" => "show/left",
|
282 |
-
"labelposition_hint" => "select the position of the field's label; the position is relative to the field",
|
283 |
-
"hintposition" => "show/right",
|
284 |
-
"hintposition_hint" => "select the position of the hint that will be shown to notify the user that something is wrong\\r\\nthe position is relative to the field",
|
285 |
-
//text properties
|
286 |
-
"default" => "hide/",
|
287 |
-
"default_hint" => "enter a default value for the field or leave it empty if you do not want a default value",
|
288 |
-
"data" => "hide/",
|
289 |
-
"data_label" => "Data",
|
290 |
-
"data_hint" => "complete a list of values to be shown to the user",
|
291 |
-
"group" => "show/0",
|
292 |
-
"group_hint" => "enter a non-empty value to match this email confirmation field with another email field",
|
293 |
-
"format" => "hide/",
|
294 |
-
"format_hint" => "enter a format to format user selection"
|
295 |
-
),
|
296 |
-
array(
|
297 |
-
"type" => "password",
|
298 |
-
"type_description" => "Password",
|
299 |
-
//label properties
|
300 |
-
"label" => "",
|
301 |
-
"label_label" => "Label",
|
302 |
-
"label_hint" => "enter the label that will be shown next to the field",
|
303 |
-
//checkbox properties
|
304 |
-
"required" => "show/true",
|
305 |
-
"required_hint" => "if checked, then this field must have a non-empty value for the file to be uploaded",
|
306 |
-
"donotautocomplete" => "false/true",
|
307 |
-
"donotautocomplete_hint" => "if checked, then the field will notify the browsers not to fill it with autocomplete data when the plugin is reloaded",
|
308 |
-
"validate" => "hide/false",
|
309 |
-
"validate_hint" => "if checked, then the value entered by the user will be validated",
|
310 |
-
"typehook" => "hide/false",
|
311 |
-
"typehook_hint" => "if checked, then text suggestions will be shown below the field as the user types more text inside",
|
312 |
-
//dropdown properties
|
313 |
-
"labelposition" => "show/left",
|
314 |
-
"labelposition_hint" => "select the position of the field's label; the position is relative to the field",
|
315 |
-
"hintposition" => "show/right",
|
316 |
-
"hintposition_hint" => "select the position of the hint that will be shown to notify the user that something is wrong\\r\\nthe position is relative to the field",
|
317 |
-
//text properties
|
318 |
-
"default" => "hide/",
|
319 |
-
"default_hint" => "enter a default value for the field or leave it empty if you do not want a default value",
|
320 |
-
"data" => "hide/",
|
321 |
-
"data_label" => "Data",
|
322 |
-
"data_hint" => "complete a list of values to be shown to the user",
|
323 |
-
"group" => "show/0",
|
324 |
-
"group_hint" => "if a non-empty group value is set, then another password confirmation field belonging to the same group must have the same password",
|
325 |
-
"format" => "hide/",
|
326 |
-
"format_hint" => "enter a format to format user selection"
|
327 |
-
),
|
328 |
-
array(
|
329 |
-
"type" => "confirmpassword",
|
330 |
-
"type_description" => "Confirmation Password",
|
331 |
-
//label properties
|
332 |
-
"label" => "",
|
333 |
-
"label_label" => "Label",
|
334 |
-
"label_hint" => "enter the label that will be shown next to the field",
|
335 |
-
//checkbox properties
|
336 |
-
"required" => "show/true",
|
337 |
-
"required_hint" => "if checked, then this field must have a non-empty value for the file to be uploaded",
|
338 |
-
"donotautocomplete" => "false/true",
|
339 |
-
"donotautocomplete_hint" => "if checked, then the field will notify the browsers not to fill it with autocomplete data when the plugin is reloaded",
|
340 |
-
"validate" => "hide/true",
|
341 |
-
"validate_hint" => "if checked, then the value entered by the user will be validated",
|
342 |
-
"typehook" => "hide/false",
|
343 |
-
"typehook_hint" => "if checked, then text suggestions will be shown below the field as the user types more text inside",
|
344 |
-
//dropdown properties
|
345 |
-
"labelposition" => "show/left",
|
346 |
-
"labelposition_hint" => "select the position of the field's label; the position is relative to the field",
|
347 |
-
"hintposition" => "show/right",
|
348 |
-
"hintposition_hint" => "select the position of the hint that will be shown to notify the user that something is wrong\\r\\nthe position is relative to the field",
|
349 |
-
//text properties
|
350 |
-
"default" => "hide/",
|
351 |
-
"default_hint" => "enter a default value for the field or leave it empty if you do not want a default value",
|
352 |
-
"data" => "hide/",
|
353 |
-
"data_label" => "Data",
|
354 |
-
"data_hint" => "complete a list of values to be shown to the user",
|
355 |
-
"group" => "show/0",
|
356 |
-
"group_hint" => "if a non-empty group value is set, then another password confirmation field belonging to the same group must have the same password",
|
357 |
-
"format" => "hide/",
|
358 |
-
"format_hint" => "enter a format to format user selection"
|
359 |
-
),
|
360 |
-
array(
|
361 |
-
"type" => "checkbox",
|
362 |
-
"type_description" => "Checkbox",
|
363 |
-
//label properties
|
364 |
-
"label" => "",
|
365 |
-
"label_label" => "Label",
|
366 |
-
"label_hint" => "enter the label that will be shown next to the field",
|
367 |
-
//checkbox properties
|
368 |
-
"required" => "show/false",
|
369 |
-
"required_hint" => "if checked, then this checkbox field must be checked before file upload",
|
370 |
-
"donotautocomplete" => "show/true",
|
371 |
-
"donotautocomplete_hint" => "if checked, then the field will not be autocompleted by browsers",
|
372 |
-
"validate" => "hide/false",
|
373 |
-
"validate_hint" => "if checked, then the field value entered by the user will be validated before file upload",
|
374 |
-
"typehook" => "hide/false",
|
375 |
-
"typehook_hint" => "if checked, then text suggestions will be shown below the field as the user types more text inside",
|
376 |
-
//dropdown properties
|
377 |
-
"labelposition" => "show/none",
|
378 |
-
"labelposition_hint" => "select the position of the field's label; the position is relative to the field",
|
379 |
-
"hintposition" => "show/right",
|
380 |
-
"hintposition_hint" => "select the position of the hint that will be shown to notify the user that something is wrong\\r\\nthe position is relative to the field",
|
381 |
-
//text properties
|
382 |
-
"default" => "show/false",
|
383 |
-
"default_hint" => "enter a default value (true or false) for the field or leave it empty if you do not want a default value",
|
384 |
-
"data" => "show/",
|
385 |
-
"data_label" => "Description",
|
386 |
-
"data_hint" => "enter a description for the checkbox",
|
387 |
-
"group" => "hide/",
|
388 |
-
"group_hint" => "if a value is set, then all fields having the same value will belong to the same group",
|
389 |
-
"format" => "show/right",
|
390 |
-
"format_hint" => "define the location of the description in relation to the check box\\r\\npossible values are: top, right, bottom, left"
|
391 |
-
),
|
392 |
-
array(
|
393 |
-
"type" => "radiobutton",
|
394 |
-
"type_description" => "Radio button",
|
395 |
-
//label properties
|
396 |
-
"label" => "",
|
397 |
-
"label_label" => "Label",
|
398 |
-
"label_hint" => "enter the label that will be shown next to the field",
|
399 |
-
//checkbox properties
|
400 |
-
"required" => "show/false",
|
401 |
-
"required_hint" => "if checked, then a radio button must be selected before file upload",
|
402 |
-
"donotautocomplete" => "show/true",
|
403 |
-
"donotautocomplete_hint" => "if checked, then the field will not be autocompleted by browsers",
|
404 |
-
"validate" => "hide/false",
|
405 |
-
"validate_hint" => "if checked, then the field value entered by the user will be validated before file upload",
|
406 |
-
"typehook" => "hide/false",
|
407 |
-
"typehook_hint" => "if checked, then text suggestions will be shown below the field as the user types more text inside",
|
408 |
-
//dropdown properties
|
409 |
-
"labelposition" => "show/left",
|
410 |
-
"labelposition_hint" => "select the position of the field's label; the position is relative to the field",
|
411 |
-
"hintposition" => "show/right",
|
412 |
-
"hintposition_hint" => "select the position of the hint that will be shown to notify the user that something is wrong\\r\\nthe position is relative to the field",
|
413 |
-
//text properties
|
414 |
-
"default" => "show/",
|
415 |
-
"default_hint" => "enter a default value for the field or leave it empty if you do not want a default value",
|
416 |
-
"data" => "show/",
|
417 |
-
"data_label" => "Items",
|
418 |
-
"data_hint" => "enter a comma delimited list of radio button items",
|
419 |
-
"group" => "show/0",
|
420 |
-
"group_hint" => "all radio buttons having the same group id belong to the same group",
|
421 |
-
"format" => "show/",
|
422 |
-
"format_hint" => "define the location of the radio labels in relation to their radio buttons (top, right, bottom, left)\\r\\nand the placement of the radio buttons (horizontal, vertical)"
|
423 |
-
),
|
424 |
-
array(
|
425 |
-
"type" => "date",
|
426 |
-
"type_description" => "Date",
|
427 |
-
//label properties
|
428 |
-
"label" => "",
|
429 |
-
"label_label" => "Label",
|
430 |
-
"label_hint" => "enter the label that will be shown next to the field",
|
431 |
-
//checkbox properties
|
432 |
-
"required" => "show/false",
|
433 |
-
"required_hint" => "if checked, then a date must be entered before file upload",
|
434 |
-
"donotautocomplete" => "show/true",
|
435 |
-
"donotautocomplete_hint" => "if checked, then the field will not be autocompleted by browsers",
|
436 |
-
"validate" => "hide/false",
|
437 |
-
"validate_hint" => "if checked, then the field value entered by the user will be validated before file upload",
|
438 |
-
"typehook" => "hide/false",
|
439 |
-
"typehook_hint" => "if checked, then text suggestions will be shown below the field as the user types more text inside",
|
440 |
-
//dropdown properties
|
441 |
-
"labelposition" => "show/left",
|
442 |
-
"labelposition_hint" => "select the position of the field's label; the position is relative to the field",
|
443 |
-
"hintposition" => "show/right",
|
444 |
-
"hintposition_hint" => "select the position of the hint that will be shown to notify the user that something is wrong\\r\\nthe position is relative to the field",
|
445 |
-
//text properties
|
446 |
-
"default" => "show/",
|
447 |
-
"default_hint" => "enter a default date for the field or leave it empty if you do not want a default value",
|
448 |
-
"data" => "hide/",
|
449 |
-
"data_label" => "Data",
|
450 |
-
"data_hint" => "enter data items",
|
451 |
-
"group" => "hide/",
|
452 |
-
"group_hint" => "enter a group value",
|
453 |
-
"format" => "show/",
|
454 |
-
"format_hint" => "define the format of the date field as follows:\\r\\n d - day of month (no leading zero)\\r\\n dd - day of month (two digit)\\r\\n o - day of the year (no leading zeros)\\r\\n oo - day of the year (three digit)\\r\\n D - day name short\\r\\n DD - day name long\\r\\n m - month of year (no leading zero)\\r\\n mm - month of year (two digit)\\r\\n M - month name short\\r\\n MM - month name long\\r\\n y - year (two digit)\\r\\n yy - year (four digit)\\r\\n @ - Unix timestamp (ms since 01/01/1970)\\r\\n ! - Windows ticks (100ns since 01/01/0001)\\r\\n '...' - literal text\\r\\n '' - single quote\\r\\n anything else - literal text\\r\\nthe format must be in parenthesis ()"
|
455 |
-
),
|
456 |
-
array(
|
457 |
-
"type" => "time",
|
458 |
-
"type_description" => "Time",
|
459 |
-
//label properties
|
460 |
-
"label" => "",
|
461 |
-
"label_label" => "Label",
|
462 |
-
"label_hint" => "enter the label that will be shown next to the field",
|
463 |
-
//checkbox properties
|
464 |
-
"required" => "show/false",
|
465 |
-
"required_hint" => "if checked, then a time must be entered before file upload",
|
466 |
-
"donotautocomplete" => "show/true",
|
467 |
-
"donotautocomplete_hint" => "if checked, then the field will not be autocompleted by browsers",
|
468 |
-
"validate" => "hide/false",
|
469 |
-
"validate_hint" => "if checked, then the field value entered by the user will be validated before file upload",
|
470 |
-
"typehook" => "hide/false",
|
471 |
-
"typehook_hint" => "if checked, then text suggestions will be shown below the field as the user types more text inside",
|
472 |
-
//dropdown properties
|
473 |
-
"labelposition" => "show/left",
|
474 |
-
"labelposition_hint" => "select the position of the field's label; the position is relative to the field",
|
475 |
-
"hintposition" => "show/right",
|
476 |
-
"hintposition_hint" => "select the position of the hint that will be shown to notify the user that something is wrong\\r\\nthe position is relative to the field",
|
477 |
-
//text properties
|
478 |
-
"default" => "show/",
|
479 |
-
"default_hint" => "enter a default time for the field or leave it empty if you do not want a default value",
|
480 |
-
"data" => "hide/",
|
481 |
-
"data_label" => "Data",
|
482 |
-
"data_hint" => "enter data items",
|
483 |
-
"group" => "hide/",
|
484 |
-
"group_hint" => "enter a group value",
|
485 |
-
"format" => "show/",
|
486 |
-
"format_hint" => "define the format of the time field as follows:\\r\\n H - hour with no leading 0 (24 hour)\\r\\n HH - hour with leading 0 (24 hour)\\r\\n h - hour with no leading 0 (12 hour)\\r\\n hh - hour with leading 0 (12 hour)\\r\\n m - minute with no leading 0\\r\\n mm - minute with leading 0\\r\\n s - second with no leading 0\\r\\n ss - second with leading 0\\r\\n l - milliseconds always with leading 0\\r\\n c - microseconds always with leading 0\\r\\n t - a or p for AM/PM\\r\\n T - A or P for AM/PM\\r\\n tt - am or pm for AM/PM\\r\\n TT - AM or PM for AM/PM\\r\\n z - timezone as defined by timezoneList\\r\\n Z - timezone in Iso 8601 format (+04:45)\\r\\n '...' - literal text\\r\\nthe format must be in parenthesis ()"
|
487 |
-
),
|
488 |
-
array(
|
489 |
-
"type" => "datetime",
|
490 |
-
"type_description" => "DateTime",
|
491 |
-
//label properties
|
492 |
-
"label" => "",
|
493 |
-
"label_label" => "Label",
|
494 |
-
"label_hint" => "enter the label that will be shown next to the field",
|
495 |
-
//checkbox properties
|
496 |
-
"required" => "show/false",
|
497 |
-
"required_hint" => "if checked, then a date and time must be entered before file upload",
|
498 |
-
"donotautocomplete" => "show/true",
|
499 |
-
"donotautocomplete_hint" => "if checked, then the field will not be autocompleted by browsers",
|
500 |
-
"validate" => "hide/false",
|
501 |
-
"validate_hint" => "if checked, then the field value entered by the user will be validated before file upload",
|
502 |
-
"typehook" => "hide/false",
|
503 |
-
"typehook_hint" => "if checked, then text suggestions will be shown below the field as the user types more text inside",
|
504 |
-
//dropdown properties
|
505 |
-
"labelposition" => "show/left",
|
506 |
-
"labelposition_hint" => "select the position of the field's label; the position is relative to the field",
|
507 |
-
"hintposition" => "show/right",
|
508 |
-
"hintposition_hint" => "select the position of the hint that will be shown to notify the user that something is wrong\\r\\nthe position is relative to the field",
|
509 |
-
//text properties
|
510 |
-
"default" => "show/",
|
511 |
-
"default_hint" => "enter a default date and time for the field or leave it empty if you do not want a default value",
|
512 |
-
"data" => "hide/",
|
513 |
-
"data_label" => "Data",
|
514 |
-
"data_hint" => "enter data items",
|
515 |
-
"group" => "hide/",
|
516 |
-
"group_hint" => "enter a group value",
|
517 |
-
"format" => "show/",
|
518 |
-
"format_hint" => "define the format of the datetime field as follows:\\r\\n date(dateformat) where dateformat is:\\r\\n d - day of month (no leading zero)\\r\\n dd - day of month (two digit)\\r\\n o - day of the year (no leading zeros)\\r\\n oo - day of the year (three digit)\\r\\n D - day name short\\r\\n DD - day name long\\r\\n m - month of year (no leading zero)\\r\\n mm - month of year (two digit)\\r\\n M - month name short\\r\\n MM - month name long\\r\\n y - year (two digit)\\r\\n yy - year (four digit)\\r\\n @ - Unix timestamp (ms since 01/01/1970)\\r\\n ! - Windows ticks (100ns since 01/01/0001)\\r\\n '...' - literal text\\r\\n '' - single quote\\r\\n anything else - literal text\\r\\n time(timeformat) where timeformat is:\\r\\n H - hour with no leading 0 (24 hour)\\r\\n HH - hour with leading 0 (24 hour)\\r\\n h - hour with no leading 0 (12 hour)\\r\\n hh - hour with leading 0 (12 hour)\\r\\n m - minute with no leading 0\\r\\n mm - minute with leading 0\\r\\n s - second with no leading 0\\r\\n ss - second with leading 0\\r\\n l - milliseconds always with leading 0\\r\\n c - microseconds always with leading 0\\r\\n t - a or p for AM/PM\\r\\n T - A or P for AM/PM\\r\\n tt - am or pm for AM/PM\\r\\n TT - AM or PM for AM/PM\\r\\n z - timezone as defined by timezoneList\\r\\n Z - timezone in Iso 8601 format (+04:45)\\r\\n '...' - literal text"
|
519 |
-
),
|
520 |
-
array(
|
521 |
-
"type" => "list",
|
522 |
-
"type_description" => "Listbox",
|
523 |
-
//label properties
|
524 |
-
"label" => "",
|
525 |
-
"label_label" => "Label",
|
526 |
-
"label_hint" => "enter the label that will be shown next to the field",
|
527 |
-
//checkbox properties
|
528 |
-
"required" => "show/false",
|
529 |
-
"required_hint" => "if checked, then a list item must be selected before file upload",
|
530 |
-
"donotautocomplete" => "show/true",
|
531 |
-
"donotautocomplete_hint" => "if checked, then the field will not be autocompleted by browsers",
|
532 |
-
"validate" => "hide/false",
|
533 |
-
"validate_hint" => "if checked, then the field value entered by the user will be validated before file upload",
|
534 |
-
"typehook" => "hide/false",
|
535 |
-
"typehook_hint" => "if checked, then text suggestions will be shown below the field as the user types more text inside",
|
536 |
-
//dropdown properties
|
537 |
-
"labelposition" => "show/left",
|
538 |
-
"labelposition_hint" => "select the position of the field's label; the position is relative to the field",
|
539 |
-
"hintposition" => "show/right",
|
540 |
-
"hintposition_hint" => "select the position of the hint that will be shown to notify the user that something is wrong\\r\\nthe position is relative to the field",
|
541 |
-
//text properties
|
542 |
-
"default" => "show/",
|
543 |
-
"default_hint" => "enter a default value for the field or leave it empty if you do not want a default value",
|
544 |
-
"data" => "show/",
|
545 |
-
"data_label" => "List Items",
|
546 |
-
"data_hint" => "enter a comma delimited list of items",
|
547 |
-
"group" => "hide/",
|
548 |
-
"group_hint" => "all items having the same group id belong to the same group",
|
549 |
-
"format" => "hide/",
|
550 |
-
"format_hint" => "enter the format of the list"
|
551 |
-
),
|
552 |
-
array(
|
553 |
-
"type" => "dropdown",
|
554 |
-
"type_description" => "Dropdown",
|
555 |
-
//label properties
|
556 |
-
"label" => "",
|
557 |
-
"label_label" => "Label",
|
558 |
-
"label_hint" => "enter the label that will be shown next to the field",
|
559 |
-
//checkbox properties
|
560 |
-
"required" => "show/false",
|
561 |
-
"required_hint" => "if checked, then an item from the dropdown list must be selected before file upload",
|
562 |
-
"donotautocomplete" => "show/true",
|
563 |
-
"donotautocomplete_hint" => "if checked, then the field will not be autocompleted by browsers",
|
564 |
-
"validate" => "hide/false",
|
565 |
-
"validate_hint" => "if checked, then the field value entered by the user will be validated before file upload",
|
566 |
-
"typehook" => "hide/false",
|
567 |
-
"typehook_hint" => "if checked, then text suggestions will be shown below the field as the user types more text inside",
|
568 |
-
//dropdown properties
|
569 |
-
"labelposition" => "show/left",
|
570 |
-
"labelposition_hint" => "select the position of the field's label; the position is relative to the field",
|
571 |
-
"hintposition" => "show/right",
|
572 |
-
"hintposition_hint" => "select the position of the hint that will be shown to notify the user that something is wrong\\r\\nthe position is relative to the field",
|
573 |
-
//text properties
|
574 |
-
"default" => "show/",
|
575 |
-
"default_hint" => "enter a default value for the field or leave it empty if you do not want a default value",
|
576 |
-
"data" => "show/",
|
577 |
-
"data_label" => "List Items",
|
578 |
-
"data_hint" => "enter a comma delimited list of items",
|
579 |
-
"group" => "hide/",
|
580 |
-
"group_hint" => "all items having the same group id belong to the same group",
|
581 |
-
"format" => "hide/",
|
582 |
-
"format_hint" => "enter the format of the list"
|
583 |
-
),
|
584 |
-
array(
|
585 |
-
"type" => "honeypot",
|
586 |
-
"type_description" => "Hidden Honeypot",
|
587 |
-
//label properties
|
588 |
-
"label" => "website",
|
589 |
-
"label_label" => "Name",
|
590 |
-
"label_hint" => "enter the name of the honeypot field; it must be a value that bots can easily recognize, like \'website\' or \'URL\'",
|
591 |
-
//checkbox properties
|
592 |
-
"required" => "hide/false",
|
593 |
-
"required_hint" => "if checked, then this field must have a non-empty value for the file to be uploaded",
|
594 |
-
"donotautocomplete" => "hide/true",
|
595 |
-
"donotautocomplete_hint" => "if checked, then the field will notify the browsers not to fill it with autocomplete data when the plugin is reloaded",
|
596 |
-
"validate" => "hide/false",
|
597 |
-
"validate_hint" => "if checked, then the field value entered by the user will be validated before file upload",
|
598 |
-
"typehook" => "hide/false",
|
599 |
-
"typehook_hint" => "if checked, then text suggestions will be shown below the field as the user types more text inside",
|
600 |
-
//dropdown properties
|
601 |
-
"labelposition" => "hide/none",
|
602 |
-
"labelposition_hint" => "select the position of the field's label; the position is relative to the field",
|
603 |
-
"hintposition" => "hide/none",
|
604 |
-
"hintposition_hint" => "select the position of the hint that will be shown to notify the user that something is wrong\\r\\nthe position is relative to the field",
|
605 |
-
//text properties
|
606 |
-
"default" => "hide/",
|
607 |
-
"default_hint" => "enter a default value for the field or leave it empty if you do not want a default value",
|
608 |
-
"data" => "hide/",
|
609 |
-
"data_label" => "Data",
|
610 |
-
"data_hint" => "complete a list of values to be shown to the user",
|
611 |
-
"group" => "hide/",
|
612 |
-
"group_hint" => "if a value is set, then all fields having the same value will belong to the same group",
|
613 |
-
"format" => "hide/",
|
614 |
-
"format_hint" => "enter a format to format user selection"
|
615 |
-
)
|
616 |
-
);
|
617 |
-
|
618 |
-
return $formfields;
|
619 |
-
}
|
620 |
-
|
621 |
-
function wfu_attribute_definitions() {
|
622 |
-
$defs = array(
|
623 |
-
array(
|
624 |
-
"name" => "Widget ID",
|
625 |
-
"attribute" => "widgetid",
|
626 |
-
"type" => "hidden",
|
627 |
-
"validator" => "text",
|
628 |
-
"listitems" => null,
|
629 |
-
"value" => "",
|
630 |
-
"mode" => "free",
|
631 |
-
"category" => "",
|
632 |
-
"subcategory" => "Basic ",
|
633 |
-
"parent" => "",
|
634 |
-
"dependencies" => null,
|
635 |
-
"variables" => null,
|
636 |
-
"help" => ""
|
637 |
-
),
|
638 |
-
array(
|
639 |
-
"name" => "Plugin ID",
|
640 |
-
"attribute" => "uploadid",
|
641 |
-
"type" => "integer",
|
642 |
-
"validator" => "text",
|
643 |
-
"listitems" => null,
|
644 |
-
"value" => WFU_VAR("WFU_UPLOADID"),
|
645 |
-
"mode" => "free",
|
646 |
-
"category" => "general",
|
647 |
-
"subcategory" => "Basic Functionalities",
|
648 |
-
"parent" => "",
|
649 |
-
"dependencies" => null,
|
650 |
-
"variables" => null,
|
651 |
-
"help" => "The unique id of each shortcode. When you have many shortcodes of this plugin in the same page, then you must use different id for each one."
|
652 |
-
),
|
653 |
-
array(
|
654 |
-
"name" => "Single Button Operation",
|
655 |
-
"attribute" => "singlebutton",
|
656 |
-
"type" => "onoff",
|
657 |
-
"validator" => "text",
|
658 |
-
"listitems" => null,
|
659 |
-
"value" => WFU_VAR("WFU_SINGLEBUTTON"),
|
660 |
-
"mode" => "free",
|
661 |
-
"category" => "general",
|
662 |
-
"subcategory" => "Basic Functionalities",
|
663 |
-
"parent" => "",
|
664 |
-
"dependencies" => array("!uploadbutton"),
|
665 |
-
"variables" => null,
|
666 |
-
"help" => "When it is activated, no Upload button will be shown, but upload will start automatically as soon as files are selected."
|
667 |
-
),
|
668 |
-
array(
|
669 |
-
"name" => "Upload Path",
|
670 |
-
"attribute" => "uploadpath",
|
671 |
-
"type" => "ltext",
|
672 |
-
"validator" => "path",
|
673 |
-
"listitems" => null,
|
674 |
-
"value" => WFU_VAR("WFU_UPLOADPATH"),
|
675 |
-
"mode" => "free",
|
676 |
-
"category" => "general",
|
677 |
-
"subcategory" => "Basic Functionalities",
|
678 |
-
"parent" => "",
|
679 |
-
"dependencies" => null,
|
680 |
-
"variables" => array("%userid%", "%username%", "%blogid%", "%pageid%", "%pagetitle%", "%userdataXXX%"),
|
681 |
-
"help" => "This is the folder where the files will be uploaded. The path is relative to wp-contents folder of your Wordpress website. The path can be dynamic by including variables such as %username% or %blogid%. Please check Documentation on how to use variables inside uploadpath."
|
682 |
-
),
|
683 |
-
array(
|
684 |
-
"name" => "Plugin Fit Mode",
|
685 |
-
"attribute" => "fitmode",
|
686 |
-
"type" => "radio",
|
687 |
-
"validator" => "text",
|
688 |
-
"listitems" => array("fixed", "responsive"),
|
689 |
-
"value" => WFU_VAR("WFU_FITMODE"),
|
690 |
-
"mode" => "free",
|
691 |
-
"category" => "general",
|
692 |
-
"subcategory" => "Basic Functionalities",
|
693 |
-
"parent" => "",
|
694 |
-
"dependencies" => null,
|
695 |
-
"variables" => null,
|
696 |
-
"help" => "This defines how the plugin's elements will fit inside the page/post. If it is set to fixed, then the plugin's element positions will remain fixed no matter the width of the container page/post. If it is set to responsive, then the plugin's elements will wrap to fit the width of the container page/post."
|
697 |
-
),
|
698 |
-
array(
|
699 |
-
"name" => "Allow No File",
|
700 |
-
"attribute" => "allownofile",
|
701 |
-
"type" => "onoff",
|
702 |
-
"validator" => "text",
|
703 |
-
"listitems" => null,
|
704 |
-
"value" => WFU_VAR("WFU_ALLOWNOFILE"),
|
705 |
-
"mode" => "free",
|
706 |
-
"category" => "general",
|
707 |
-
"subcategory" => "Basic Functionalities",
|
708 |
-
"parent" => "",
|
709 |
-
"dependencies" => null,
|
710 |
-
"variables" => null,
|
711 |
-
"help" => "When it is activated a user can submit the upload form even if a file is not selected."
|
712 |
-
),
|
713 |
-
array(
|
714 |
-
"name" => "Reset Form Mode",
|
715 |
-
"attribute" => "resetmode",
|
716 |
-
"type" => "radio",
|
717 |
-
"validator" => "text",
|
718 |
-
"listitems" => array("always", "onsuccess", "never"),
|
719 |
-
"value" => WFU_VAR("WFU_RESETMODE"),
|
720 |
-
"mode" => "free",
|
721 |
-
"category" => "general",
|
722 |
-
"subcategory" => "Basic Functionalities",
|
723 |
-
"parent" => "",
|
724 |
-
"dependencies" => null,
|
725 |
-
"variables" => null,
|
726 |
-
"help" => "It defines whether the form will be reset after upload; 'always' means that it will be reset in any case, 'onsuccess' means that it will be reset only if upload was successful, 'never' means that it will never be reset."
|
727 |
-
),
|
728 |
-
array(
|
729 |
-
"name" => "Upload Roles",
|
730 |
-
"attribute" => "uploadrole",
|
731 |
-
"type" => "rolelist",
|
732 |
-
"validator" => "text",
|
733 |
-
"listitems" => array("default_administrator"),
|
734 |
-
"value" => WFU_VAR("WFU_UPLOADROLE"),
|
735 |
-
"mode" => "free",
|
736 |
-
"category" => "general",
|
737 |
-
"subcategory" => "Filters",
|
738 |
-
"parent" => "",
|
739 |
-
"dependencies" => null,
|
740 |
-
"variables" => null,
|
741 |
-
"help" => "Defines the categories (roles) of users allowed to upload files. Multiple selections can be made. If 'Select All' is checked, then all logged users can upload files. If 'Include Guests' is checked, then guests (not logged users) can also upload files. Default value is 'all,guests'."
|
742 |
-
),
|
743 |
-
array(
|
744 |
-
"name" => "Allowed File Extensions",
|
745 |
-
"attribute" => "uploadpatterns",
|
746 |
-
"type" => "text",
|
747 |
-
"validator" => "text",
|
748 |
-
"listitems" => null,
|
749 |
-
"value" => WFU_VAR("WFU_UPLOADPATTERNS"),
|
750 |
-
"mode" => "free",
|
751 |
-
"category" => "general",
|
752 |
-
"subcategory" => "Filters",
|
753 |
-
"parent" => "",
|
754 |
-
"dependencies" => null,
|
755 |
-
"variables" => null,
|
756 |
-
"help" => "Defines the allowed file extensions. Multiple extentions can be defined, separated with comma (,)."
|
757 |
-
),
|
758 |
-
array(
|
759 |
-
"name" => "Allowed File Size",
|
760 |
-
"attribute" => "maxsize",
|
761 |
-
"type" => "float",
|
762 |
-
"validator" => "float",
|
763 |
-
"listitems" => null,
|
764 |
-
"value" => WFU_VAR("WFU_MAXSIZE"),
|
765 |
-
"mode" => "free",
|
766 |
-
"category" => "general",
|
767 |
-
"subcategory" => "Filters",
|
768 |
-
"parent" => "",
|
769 |
-
"dependencies" => null,
|
770 |
-
"variables" => null,
|
771 |
-
"help" => "Defines the allowed file size in MBytes. Files larger than maxsize will not be uploaded. Floating point numbers can be used (e.g. '2.5')."
|
772 |
-
),
|
773 |
-
array(
|
774 |
-
"name" => "Create Upload Path",
|
775 |
-
"attribute" => "createpath",
|
776 |
-
"type" => "onoff",
|
777 |
-
"validator" => "text",
|
778 |
-
"listitems" => null,
|
779 |
-
"value" => WFU_VAR("WFU_CREATEPATH"),
|
780 |
-
"mode" => "free",
|
781 |
-
"category" => "general",
|
782 |
-
"subcategory" => "Upload Path and Files",
|
783 |
-
"parent" => "",
|
784 |
-
"dependencies" => null,
|
785 |
-
"variables" => null,
|
786 |
-
"help" => "If activated then the plugin will attempt to create the upload path, if it does not exist."
|
787 |
-
),
|
788 |
-
array(
|
789 |
-
"name" => "Do Not Change Filename",
|
790 |
-
"attribute" => "forcefilename",
|
791 |
-
"type" => "onoff",
|
792 |
-
"validator" => "text",
|
793 |
-
"listitems" => null,
|
794 |
-
"value" => WFU_VAR("WFU_FORCEFILENAME"),
|
795 |
-
"mode" => "free",
|
796 |
-
"category" => "general",
|
797 |
-
"subcategory" => "Upload Path and Files",
|
798 |
-
"parent" => "",
|
799 |
-
"dependencies" => null,
|
800 |
-
"variables" => null,
|
801 |
-
"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."
|
802 |
-
),
|
803 |
-
array(
|
804 |
-
"name" => "Folder Access Method",
|
805 |
-
"attribute" => "accessmethod",
|
806 |
-
"type" => "radio",
|
807 |
-
"validator" => "text",
|
808 |
-
"listitems" => array("normal", "*ftp"),
|
809 |
-
"value" => WFU_VAR("WFU_ACCESSMETHOD"),
|
810 |
-
"mode" => "free",
|
811 |
-
"category" => "general",
|
812 |
-
"subcategory" => "Upload Path and Files",
|
813 |
-
"parent" => "",
|
814 |
-
"dependencies" => array("ftpinfo", "userftpdomain", "ftppassivemode", "ftpfilepermissions"),
|
815 |
-
"variables" => null,
|
816 |
-
"help" => "Some times files cannot be uploaded to the upload folder because of read/write permissions. A workaround is to use ftp to transfer the files, however ftp credentials must be declared, so use carefully and only if necessary."
|
817 |
-
),
|
818 |
-
array(
|
819 |
-
"name" => "FTP Access Credentials",
|
820 |
-
"attribute" => "ftpinfo",
|
821 |
-
"type" => "ltext",
|
822 |
-
"validator" => "text",
|
823 |
-
"listitems" => null,
|
824 |
-
"value" => WFU_VAR("WFU_FTPINFO"),
|
825 |
-
"mode" => "free",
|
826 |
-
"category" => "general",
|
827 |
-
"subcategory" => "Upload Path and Files",
|
828 |
-
"parent" => "accessmethod",
|
829 |
-
"dependencies" => null,
|
830 |
-
"variables" => null,
|
831 |
-
"help" => "If FTP access method is selected, then FTP credentials must be declared here, in the form username:password@ftpdomain:port, e.g. myusername:mypass@ftpdomain.com:80. Port can be ommitted. The user can use Secure FTP (sftp) by putting the prefix 's' before the port number, e.g. myusername:mypass@ftpdomain.com:s22."
|
832 |
-
),
|
833 |
-
array(
|
834 |
-
"name" => "Use FTP Domain",
|
835 |
-
"attribute" => "useftpdomain",
|
836 |
-
"type" => "onoff",
|
837 |
-
"validator" => "text",
|
838 |
-
"listitems" => null,
|
839 |
-
"value" => WFU_VAR("WFU_USEFTPDOMAIN"),
|
840 |
-
"mode" => "free",
|
841 |
-
"category" => "general",
|
842 |
-
"subcategory" => "Upload Path and Files",
|
843 |
-
"parent" => "accessmethod",
|
844 |
-
"dependencies" => null,
|
845 |
-
"variables" => null,
|
846 |
-
"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."
|
847 |
-
),
|
848 |
-
array(
|
849 |
-
"name" => "FTP Passive Mode",
|
850 |
-
"attribute" => "ftppassivemode",
|
851 |
-
"type" => "onoff",
|
852 |
-
"validator" => "text",
|
853 |
-
"listitems" => null,
|
854 |
-
"value" => WFU_VAR("WFU_FTPPASSIVEMODE"),
|
855 |
-
"mode" => "free",
|
856 |
-
"category" => "general",
|
857 |
-
"subcategory" => "Upload Path and Files",
|
858 |
-
"parent" => "accessmethod",
|
859 |
-
"dependencies" => null,
|
860 |
-
"variables" => null,
|
861 |
-
"help" => "If files fail to upload to the ftp domain then switching to passive FTP mode may solve the problem."
|
862 |
-
),
|
863 |
-
array(
|
864 |
-
"name" => "Permissions of Uploaded File",
|
865 |
-
"attribute" => "ftpfilepermissions",
|
866 |
-
"type" => "text",
|
867 |
-
"validator" => "integer",
|
868 |
-
"listitems" => null,
|
869 |
-
"value" => WFU_VAR("WFU_FTPFILEPERMISSIONS"),
|
870 |
-
"mode" => "free",
|
871 |
-
"category" => "general",
|
872 |
-
"subcategory" => "Upload Path and Files",
|
873 |
-
"parent" => "accessmethod",
|
874 |
-
"dependencies" => null,
|
875 |
-
"variables" => null,
|
876 |
-
"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."
|
877 |
-
),
|
878 |
-
array(
|
879 |
-
"name" => "Show Upload Folder Path",
|
880 |
-
"attribute" => "showtargetfolder",
|
881 |
-
"type" => "onoff",
|
882 |
-
"validator" => "text",
|
883 |
-
"listitems" => null,
|
884 |
-
"value" => WFU_VAR("WFU_SHOWTARGETFOLDER"),
|
885 |
-
"mode" => "free",
|
886 |
-
"category" => "general",
|
887 |
-
"subcategory" => "Upload Path and Files",
|
888 |
-
"parent" => "",
|
889 |
-
"dependencies" => array("targetfolderlabel"),
|
890 |
-
"variables" => null,
|
891 |
-
"help" => "It defines if a label with the upload directory will be shown."
|
892 |
-
),
|
893 |
-
array(
|
894 |
-
"name" => "Select Subfolder",
|
895 |
-
"attribute" => "askforsubfolders",
|
896 |
-
"type" => "onoff",
|
897 |
-
"validator" => "text",
|
898 |
-
"listitems" => null,
|
899 |
-
"value" => WFU_VAR("WFU_ASKFORSUBFOLDERS"),
|
900 |
-
"mode" => "free",
|
901 |
-
"category" => "general",
|
902 |
-
"subcategory" => "Upload Path and Files",
|
903 |
-
"parent" => "",
|
904 |
-
"dependencies" => array("subfoldertree", "subfolderlabel"),
|
905 |
-
"variables" => null,
|
906 |
-
"help" => "If enabled then user can select the upload folder from a drop down list. The list is defined in subfoldertree attribute. The folder paths are relative to the path defined in uploadpath."
|
907 |
-
),
|
908 |
-
array(
|
909 |
-
"name" => "List of Subfolders",
|
910 |
-
"attribute" => "subfoldertree",
|
911 |
-
"type" => "folderlist",
|
912 |
-
"validator" => "text",
|
913 |
-
"listitems" => null,
|
914 |
-
"value" => WFU_VAR("WFU_SUBFOLDERTREE"),
|
915 |
-
"mode" => "free",
|
916 |
-
"category" => "general",
|
917 |
-
"subcategory" => "Upload Path and Files",
|
918 |
-
"parent" => "askforsubfolders",
|
919 |
-
"dependencies" => null,
|
920 |
-
"variables" => null,
|
921 |
-
"help" => "The list of folders a user can select. Please see documentation on how to create the list of folders. If 'Auto-populate list' is selected, then the list will be filled automatically with the first-level subfolders inside the directory defined by uploadpath. If 'List is editable' is selected, then the user will have the capability to type the subfolder and filter the subfolder list and/or define a new subfolder."
|
922 |
-
),
|
923 |
-
array(
|
924 |
-
"name" => "File Duplicates Policy",
|
925 |
-
"attribute" => "duplicatespolicy",
|
926 |
-
"type" => "radio",
|
927 |
-
"validator" => "text",
|
928 |
-
"listitems" => array("overwrite", "reject", "*maintain both"),
|
929 |
-
"value" => WFU_VAR("WFU_DUBLICATESPOLICY"),
|
930 |
-
"mode" => "free",
|
931 |
-
"category" => "general",
|
932 |
-
"subcategory" => "Upload Path and Files",
|
933 |
-
"parent" => "",
|
934 |
-
"dependencies" => array("uniquepattern"),
|
935 |
-
"variables" => null,
|
936 |
-
"help" => "It determines what happens when an uploaded file has the same name with an existing file. The uploaded file can overwrite the existing one, be rejected or both can be kept by renaming the uploaded file according to a rule defined in uniquepattern attribute."
|
937 |
-
),
|
938 |
-
array(
|
939 |
-
"name" => "File Rename Rule",
|
940 |
-
"attribute" => "uniquepattern",
|
941 |
-
"type" => "radio",
|
942 |
-
"validator" => "text",
|
943 |
-
"listitems" => array("index", "datetimestamp"),
|
944 |
-
"value" => WFU_VAR("WFU_UNIQUEPATTERN"),
|
945 |
-
"mode" => "free",
|
946 |
-
"category" => "general",
|
947 |
-
"subcategory" => "Upload Path and Files",
|
948 |
-
"parent" => "duplicatespolicy",
|
949 |
-
"dependencies" => null,
|
950 |
-
"variables" => null,
|
951 |
-
"help" => "If duplicatespolicy is set to 'maintain both', then this rule defines how the uploaded file will be renamed, in order not to match an existing file. An incremental index number or a datetime stamp can be included in the uploaded file name to make it unique."
|
952 |
-
),
|
953 |
-
array(
|
954 |
-
"name" => "Redirect after Upload",
|
955 |
-
"attribute" => "redirect",
|
956 |
-
"type" => "onoff",
|
957 |
-
"validator" => "text",
|
958 |
-
"listitems" => null,
|
959 |
-
"value" => WFU_VAR("WFU_REDIRECT"),
|
960 |
-
"mode" => "free",
|
961 |
-
"category" => "general",
|
962 |
-
"subcategory" => "Redirection",
|
963 |
-
"parent" => "",
|
964 |
-
"dependencies" => array("redirectlink"),
|
965 |
-
"variables" => null,
|
966 |
-
"help" => "If enabled, the user will be redirected to a url defined in redirectlink attribute upon successful upload of all the files."
|
967 |
-
),
|
968 |
-
array(
|
969 |
-
"name" => "Redirection URL",
|
970 |
-
"attribute" => "redirectlink",
|
971 |
-
"type" => "ltext",
|
972 |
-
"validator" => "link",
|
973 |
-
"listitems" => null,
|
974 |
-
"value" => WFU_VAR("WFU_REDIRECTLINK"),
|
975 |
-
"mode" => "free",
|
976 |
-
"category" => "general",
|
977 |
-
"subcategory" => "Redirection",
|
978 |
-
"parent" => "redirect",
|
979 |
-
"dependencies" => null,
|
980 |
-
"variables" => array("%filename%", "%username%"),
|
981 |
-
"help" => "This is the redirect URL. The URL can be dynamic by using variables. Please see Documentation on how to use variables inside attributes."
|
982 |
-
),
|
983 |
-
array(
|
984 |
-
"name" => "Show Detailed Admin Messages",
|
985 |
-
"attribute" => "adminmessages",
|
986 |
-
"type" => "onoff",
|
987 |
-
"validator" => "text",
|
988 |
-
"listitems" => null,
|
989 |
-
"value" => WFU_VAR("WFU_ADMINMESSAGES"),
|
990 |
-
"mode" => "free",
|
991 |
-
"category" => "general",
|
992 |
-
"subcategory" => "Other Administrator Options",
|
993 |
-
"parent" => "",
|
994 |
-
"dependencies" => null,
|
995 |
-
"variables" => null,
|
996 |
-
"help" => "If enabled then more detailed messages about upload operations will be shown to administrators for debugging or error detection."
|
997 |
-
),
|
998 |
-
array(
|
999 |
-
"name" => "Disable AJAX",
|
1000 |
-
"attribute" => "forceclassic",
|
1001 |
-
"type" => "onoff",
|
1002 |
-
"validator" => "text",
|
1003 |
-
"listitems" => null,
|
1004 |
-
"value" => WFU_VAR("WFU_FORCECLASSIC"),
|
1005 |
-
"mode" => "free",
|
1006 |
-
"category" => "general",
|
1007 |
-
"subcategory" => "Other Administrator Options",
|
1008 |
-
"parent" => "",
|
1009 |
-
"dependencies" => null,
|
1010 |
-
"variables" => null,
|
1011 |
-
"help" => "If AJAX is disabled, then upload of files will be performed using HTML forms, meaning that page will refresh to complete the upload. Use it in case that AJAX is causing problems with your page (although the plugin has an auto-detection feature for checking if user's browser supports AJAX or not)."
|
1012 |
-
),
|
1013 |
-
array(
|
1014 |
-
"name" => "Test Mode",
|
1015 |
-
"attribute" => "testmode",
|
1016 |
-
"type" => "onoff",
|
1017 |
-
"validator" => "text",
|
1018 |
-
"listitems" => null,
|
1019 |
-
"value" => WFU_VAR("WFU_TESTMODE"),
|
1020 |
-
"mode" => "free",
|
1021 |
-
"category" => "general",
|
1022 |
-
"subcategory" => "Other Administrator Options",
|
1023 |
-
"parent" => "",
|
1024 |
-
"dependencies" => null,
|
1025 |
-
"variables" => null,
|
1026 |
-
"help" => "If enabled then the plugin will be shown in test mode, meaning that all selected features will be shown but no upload will be possible. Use it to review how the plugin looks like and style it according to your needs."
|
1027 |
-
),
|
1028 |
-
array(
|
1029 |
-
"name" => "Debug Mode",
|
1030 |
-
"attribute" => "debugmode",
|
1031 |
-
"type" => "onoff",
|
1032 |
-
"validator" => "text",
|
1033 |
-
"listitems" => null,
|
1034 |
-
"value" => WFU_VAR("WFU_DEBUGMODE"),
|
1035 |
-
"mode" => "free",
|
1036 |
-
"category" => "general",
|
1037 |
-
"subcategory" => "Other Administrator Options",
|
1038 |
-
"parent" => "",
|
1039 |
-
"dependencies" => null,
|
1040 |
-
"variables" => null,
|
1041 |
-
"help" => "If enabled then the plugin will show to administrators any internal PHP warnings and errors generated during the upload process inside the message box."
|
1042 |
-
),
|
1043 |
-
array(
|
1044 |
-
"name" => "Plugin Component Positions",
|
1045 |
-
"attribute" => "placements",
|
1046 |
-
"type" => "placements",
|
1047 |
-
"validator" => "text",
|
1048 |
-
"listitems" => null,
|
1049 |
-
"value" => WFU_VAR("WFU_PLACEMENTS"),
|
1050 |
-
"mode" => "free",
|
1051 |
-
"category" => "placements",
|
1052 |
-
"subcategory" => "Plugin Component Positions",
|
1053 |
-
"parent" => "",
|
1054 |
-
"dependencies" => null,
|
1055 |
-
"variables" => null,
|
1056 |
-
"help" => "It defines the positions of the selected plugin components. Drag the components from the right pane and drop them to the left one to define your own component positions."
|
1057 |
-
),
|
1058 |
-
array(
|
1059 |
-
"name" => "Plugin Title",
|
1060 |
-
"attribute" => "uploadtitle",
|
1061 |
-
"type" => "text",
|
1062 |
-
"validator" => "text",
|
1063 |
-
"listitems" => null,
|
1064 |
-
"value" => WFU_UPLOADTITLE,
|
1065 |
-
"mode" => "free",
|
1066 |
-
"category" => "labels",
|
1067 |
-
"subcategory" => "Title",
|
1068 |
-
"parent" => "",
|
1069 |
-
"dependencies" => null,
|
1070 |
-
"variables" => null,
|
1071 |
-
"help" => "A text representing the title of the plugin."
|
1072 |
-
),
|
1073 |
-
array(
|
1074 |
-
"name" => "Select Button Caption",
|
1075 |
-
"attribute" => "selectbutton",
|
1076 |
-
"type" => "text",
|
1077 |
-
"validator" => "text",
|
1078 |
-
"listitems" => null,
|
1079 |
-
"value" => WFU_SELECTBUTTON,
|
1080 |
-
"mode" => "free",
|
1081 |
-
"category" => "labels",
|
1082 |
-
"subcategory" => "Buttons",
|
1083 |
-
"parent" => "",
|
1084 |
-
"dependencies" => null,
|
1085 |
-
"variables" => null,
|
1086 |
-
"help" => "The caption of the button that selects the files for upload."
|
1087 |
-
),
|
1088 |
-
array(
|
1089 |
-
"name" => "Upload Button Caption",
|
1090 |
-
"attribute" => "uploadbutton",
|
1091 |
-
"type" => "text",
|
1092 |
-
"validator" => "text",
|
1093 |
-
"listitems" => null,
|
1094 |
-
"value" => WFU_UPLOADBUTTON,
|
1095 |
-
"mode" => "free",
|
1096 |
-
"category" => "labels",
|
1097 |
-
"subcategory" => "Buttons",
|
1098 |
-
"parent" => "",
|
1099 |
-
"dependencies" => null,
|
1100 |
-
"variables" => null,
|
1101 |
-
"help" => "The caption of the button that starts the upload."
|
1102 |
-
),
|
1103 |
-
array(
|
1104 |
-
"name" => "Upload Folder Label",
|
1105 |
-
"attribute" => "targetfolderlabel",
|
1106 |
-
"type" => "text",
|
1107 |
-
"validator" => "text",
|
1108 |
-
"listitems" => null,
|
1109 |
-
"value" => WFU_VAR("WFU_TARGETFOLDERLABEL"),
|
1110 |
-
"mode" => "free",
|
1111 |
-
"category" => "labels",
|
1112 |
-
"subcategory" => "Upload Folder",
|
1113 |
-
"parent" => "",
|
1114 |
-
"dependencies" => null,
|
1115 |
-
"variables" => null,
|
1116 |
-
"help" => "This is the label before the upload folder path, if the path is selected to be shown using the showtargetfolder attribute."
|
1117 |
-
),
|
1118 |
-
array(
|
1119 |
-
"name" => "Select Subfolder Label",
|
1120 |
-
"attribute" => "subfolderlabel",
|
1121 |
-
"type" => "text",
|
1122 |
-
"validator" => "text",
|
1123 |
-
"listitems" => null,
|
1124 |
-
"value" => WFU_VAR("WFU_SUBFOLDERLABEL"),
|
1125 |
-
"mode" => "free",
|
1126 |
-
"category" => "labels",
|
1127 |
-
"subcategory" => "Upload Folder",
|
1128 |
-
"parent" => "",
|
1129 |
-
"dependencies" => null,
|
1130 |
-
"variables" => null,
|
1131 |
-
"help" => "This is the label of the subfolder dropdown list. It is active when askforsubfolders attribute is on."
|
1132 |
-
),
|
1133 |
-
array(
|
1134 |
-
"name" => "Success Upload Message",
|
1135 |
-
"attribute" => "successmessage",
|
1136 |
-
"type" => "ltext",
|
1137 |
-
"validator" => "text",
|
1138 |
-
"listitems" => null,
|
1139 |
-
"value" => WFU_SUCCESSMESSAGE,
|
1140 |
-
"mode" => "free",
|
1141 |
-
"category" => "labels",
|
1142 |
-
"subcategory" => "Upload Messages",
|
1143 |
-
"parent" => "",
|
1144 |
-
"dependencies" => null,
|
1145 |
-
"variables" => array("%filename%", "%filepath%"),
|
1146 |
-
"help" => "This is the message that will be shown for every file that has been uploaded successfully."
|
1147 |
-
),
|
1148 |
-
array(
|
1149 |
-
"name" => "Warning Upload Message",
|
1150 |
-
"attribute" => "warningmessage",
|
1151 |
-
"type" => "ltext",
|
1152 |
-
"validator" => "text",
|
1153 |
-
"listitems" => null,
|
1154 |
-
"value" => WFU_WARNINGMESSAGE,
|
1155 |
-
"mode" => "free",
|
1156 |
-
"category" => "labels",
|
1157 |
-
"subcategory" => "Upload Messages",
|
1158 |
-
"parent" => "",
|
1159 |
-
"dependencies" => null,
|
1160 |
-
"variables" => array("%filename%", "%filepath%"),
|
1161 |
-
"help" => "This is the message that will be shown for every file that has been uploaded with warnings."
|
1162 |
-
),
|
1163 |
-
array(
|
1164 |
-
"name" => "Error Upload Message",
|
1165 |
-
"attribute" => "errormessage",
|
1166 |
-
"type" => "ltext",
|
1167 |
-
"validator" => "text",
|
1168 |
-
"listitems" => null,
|
1169 |
-
"value" => WFU_ERRORMESSAGE,
|
1170 |
-
"mode" => "free",
|
1171 |
-
"category" => "labels",
|
1172 |
-
"subcategory" => "Upload Messages",
|
1173 |
-
"parent" => "",
|
1174 |
-
"dependencies" => null,
|
1175 |
-
"variables" => array("%filename%", "%filepath%"),
|
1176 |
-
"help" => "This is the message that will be shown for every file that has failed to upload."
|
1177 |
-
),
|
1178 |
-
array(
|
1179 |
-
"name" => "Wait Upload Message",
|
1180 |
-
"attribute" => "waitmessage",
|
1181 |
-
"type" => "ltext",
|
1182 |
-
"validator" => "text",
|
1183 |
-
"listitems" => null,
|
1184 |
-
"value" => WFU_WAITMESSAGE,
|
1185 |
-
"mode" => "free",
|
1186 |
-
"category" => "labels",
|
1187 |
-
"subcategory" => "Upload Messages",
|
1188 |
-
"parent" => "",
|
1189 |
-
"dependencies" => null,
|
1190 |
-
"variables" => array("%filename%", "%filepath%"),
|
1191 |
-
"help" => "This is the message that will be shown while file is uploading."
|
1192 |
-
),
|
1193 |
-
array(
|
1194 |
-
"name" => "Upload Media Button Caption",
|
1195 |
-
"attribute" => "uploadmediabutton",
|
1196 |
-
"type" => "text",
|
1197 |
-
"validator" => "text",
|
1198 |
-
"listitems" => null,
|
1199 |
-
"value" => WFU_UPLOADMEDIABUTTON,
|
1200 |
-
"mode" => "free",
|
1201 |
-
"category" => "labels",
|
1202 |
-
"subcategory" => "Webcam Labels",
|
1203 |
-
"parent" => "",
|
1204 |
-
"dependencies" => null,
|
1205 |
-
"variables" => null,
|
1206 |
-
"help" => "The caption of the button that starts the upload when media capture from the webcam has been activated."
|
1207 |
-
),
|
1208 |
-
array(
|
1209 |
-
"name" => "Video Filename",
|
1210 |
-
"attribute" => "videoname",
|
1211 |
-
"type" => "text",
|
1212 |
-
"validator" => "text",
|
1213 |
-
"listitems" => null,
|
1214 |
-
"value" => WFU_VIDEONAME,
|
1215 |
-
"mode" => "free",
|
1216 |
-
"category" => "labels",
|
1217 |
-
"subcategory" => "Webcam Labels",
|
1218 |
-
"parent" => "",
|
1219 |
-
"dependencies" => null,
|
1220 |
-
"variables" => array("%userid%", "%username%", "%blogid%", "%pageid%", "%pagetitle%", "%userdataXXX%"),
|
1221 |
-
"help" => "This is the file name of the captured video file."
|
1222 |
-
),
|
1223 |
-
array(
|
1224 |
-
"name" => "Image Filename",
|
1225 |
-
"attribute" => "imagename",
|
1226 |
-
"type" => "text",
|
1227 |
-
"validator" => "text",
|
1228 |
-
"listitems" => null,
|
1229 |
-
"value" => WFU_IMAGENAME,
|
1230 |
-
"mode" => "free",
|
1231 |
-
"category" => "labels",
|
1232 |
-
"subcategory" => "Webcam Labels",
|
1233 |
-
"parent" => "",
|
1234 |
-
"dependencies" => null,
|
1235 |
-
"variables" => array("%userid%", "%username%", "%blogid%", "%pageid%", "%pagetitle%", "%userdataXXX%"),
|
1236 |
-
"help" => "This is the file name of the captured image file."
|
1237 |
-
),
|
1238 |
-
array(
|
1239 |
-
"name" => "Required Fields Suffix",
|
1240 |
-
"attribute" => "requiredlabel",
|
1241 |
-
"type" => "text",
|
1242 |
-
"validator" => "text",
|
1243 |
-
"listitems" => null,
|
1244 |
-
"value" => WFU_USERDATA_REQUIREDLABEL,
|
1245 |
-
"mode" => "free",
|
1246 |
-
"category" => "labels",
|
1247 |
-
"subcategory" => "Other Labels",
|
1248 |
-
"parent" => "",
|
1249 |
-
"dependencies" => null,
|
1250 |
-
"variables" => null,
|
1251 |
-
"help" => "This is the keyword that shows up next to user field labels in order to denote that they are required."
|
1252 |
-
),
|
1253 |
-
array(
|
1254 |
-
"name" => "Notify by Email",
|
1255 |
-
"attribute" => "notify",
|
1256 |
-
"type" => "onoff",
|
1257 |
-
"validator" => "text",
|
1258 |
-
"listitems" => null,
|
1259 |
-
"value" => WFU_VAR("WFU_NOTIFY"),
|
1260 |
-
"mode" => "free",
|
1261 |
-
"category" => "notifications",
|
1262 |
-
"subcategory" => "Email Notifications",
|
1263 |
-
"parent" => "",
|
1264 |
-
"dependencies" => array("notifyrecipients", "notifysubject", "notifymessage", "notifyheaders", "attachfile"),
|
1265 |
-
"variables" => null,
|
1266 |
-
"help" => "If activated then email will be sent to inform about successful file uploads."
|
1267 |
-
),
|
1268 |
-
array(
|
1269 |
-
"name" => "Email Recipients",
|
1270 |
-
"attribute" => "notifyrecipients",
|
1271 |
-
"type" => "mtext",
|
1272 |
-
"validator" => "text",
|
1273 |
-
"listitems" => null,
|
1274 |
-
"value" => WFU_VAR("WFU_NOTIFYRECIPIENTS"),
|
1275 |
-
"mode" => "free",
|
1276 |
-
"category" => "notifications",
|
1277 |
-
"subcategory" => "Email Notifications",
|
1278 |
-
"parent" => "notify",
|
1279 |
-
"dependencies" => null,
|
1280 |
-
"variables" => array("%useremail%", "%userdataXXX%", "%n%", "%dq%"),
|
1281 |
-
"help" => "Defines the recipients of the email notification. Can be dynamic by using variables. Please check Documentation on how to use variables in atributes."
|
1282 |
-
),
|
1283 |
-
array(
|
1284 |
-
"name" => "Email Headers",
|
1285 |
-
"attribute" => "notifyheaders",
|
1286 |
-
"type" => "mtext",
|
1287 |
-
"validator" => "emailheaders",
|
1288 |
-
"listitems" => null,
|
1289 |
-
"value" => WFU_VAR("WFU_NOTIFYHEADERS"),
|
1290 |
-
"mode" => "free",
|
1291 |
-
"category" => "notifications",
|
1292 |
-
"subcategory" => "Email Notifications",
|
1293 |
-
"parent" => "notify",
|
1294 |
-
"dependencies" => null,
|
1295 |
-
"variables" => array("%n%", "%dq%"),
|
1296 |
-
"help" => "Defines additional email headers, in case you want to sent an HTML message, or use Bcc list, or use a different From address and name or other more advanced email options."
|
1297 |
-
),
|
1298 |
-
array(
|
1299 |
-
"name" => "Email Subject",
|
1300 |
-
"attribute" => "notifysubject",
|
1301 |
-
"type" => "ltext",
|
1302 |
-
"validator" => "emailsubject",
|
1303 |
-
"listitems" => null,
|
1304 |
-
"value" => WFU_NOTIFYSUBJECT,
|
1305 |
-
"mode" => "free",
|
1306 |
-
"category" => "notifications",
|
1307 |
-
"subcategory" => "Email Notifications",
|
1308 |
-
"parent" => "notify",
|
1309 |
-
"dependencies" => null,
|
1310 |
-
"variables" => array("%username%", "%useremail%", "%filename%", "%filepath%", "%blogid%", "%pageid%", "%pagetitle%", "%userdataXXX%", "%dq%"),
|
1311 |
-
"help" => "Defines the email subject. Can be dynamic by using variables. Please check Documentation on how to use variables in atributes."
|
1312 |
-
),
|
1313 |
-
array(
|
1314 |
-
"name" => "Email Body",
|
1315 |
-
"attribute" => "notifymessage",
|
1316 |
-
"type" => "mtext",
|
1317 |
-
"validator" => "emailbody",
|
1318 |
-
"listitems" => null,
|
1319 |
-
"value" => WFU_NOTIFYMESSAGE,
|
1320 |
-
"mode" => "free",
|
1321 |
-
"category" => "notifications",
|
1322 |
-
"subcategory" => "Email Notifications",
|
1323 |
-
"parent" => "notify",
|
1324 |
-
"dependencies" => null,
|
1325 |
-
"variables" => array("%username%", "%useremail%", "%filename%", "%filepath%", "%blogid%", "%pageid%", "%pagetitle%", "%userdataXXX%", "%n%", "%dq%"),
|
1326 |
-
"help" => "Defines the email body. Can be dynamic by using variables. Please check Documentation on how to use variables in atributes."
|
1327 |
-
),
|
1328 |
-
array(
|
1329 |
-
"name" => "Attach Uploaded Files",
|
1330 |
-
"attribute" => "attachfile",
|
1331 |
-
"type" => "onoff",
|
1332 |
-
"validator" => "text",
|
1333 |
-
"listitems" => null,
|
1334 |
-
"value" => WFU_VAR("WFU_ATTACHFILE"),
|
1335 |
-
"mode" => "free",
|
1336 |
-
"category" => "notifications",
|
1337 |
-
"subcategory" => "Email Notifications",
|
1338 |
-
"parent" => "notify",
|
1339 |
-
"dependencies" => null,
|
1340 |
-
"variables" => null,
|
1341 |
-
"help" => "If activated, then uploaded files will be included in the notification email as attachments. Please use carefully."
|
1342 |
-
),
|
1343 |
-
array(
|
1344 |
-
"name" => "Ask for Consent",
|
1345 |
-
"attribute" => "askconsent",
|
1346 |
-
"type" => "onoff",
|
1347 |
-
"validator" => "text",
|
1348 |
-
"listitems" => null,
|
1349 |
-
"value" => WFU_VAR("WFU_ASKCONSENT"),
|
1350 |
-
"mode" => "free",
|
1351 |
-
"category" => "personaldata",
|
1352 |
-
"subcategory" => "General Personal Data Options",
|
1353 |
-
"parent" => "",
|
1354 |
-
"dependencies" => array("personaldatatypes"),
|
1355 |
-
"variables" => null,
|
1356 |
-
"help" => "If activated, then consent from users will be asked for storing their personal data. If users do not give consent, then their data will not be stored in the database, they will only be included in the notification email, if email notifications are active."
|
1357 |
-
),
|
1358 |
-
array(
|
1359 |
-
"name" => "Personal Data Types",
|
1360 |
-
"attribute" => "personaldatatypes",
|
1361 |
-
"type" => "radio",
|
1362 |
-
"validator" => "text",
|
1363 |
-
"listitems" => array("userdata", "userdata and files"),
|
1364 |
-
"value" => WFU_VAR("WFU_PERSONALDATATYPES"),
|
1365 |
-
"mode" => "free",
|
1366 |
-
"category" => "personaldata",
|
1367 |
-
"subcategory" => "General Personal Data Options",
|
1368 |
-
"parent" => "askconsent",
|
1369 |
-
"dependencies" => null,
|
1370 |
-
"variables" => null,
|
1371 |
-
"help" => "Determines which data are considered as personal data. By default only userdata are considered as personal data. If the 2nd option is selected, then files will also be considered as personal data. This means that if the users do not give their consent, then the files will not be uploaded on the website, they will only be inluded in the notification email as attachments, if email notifications are active."
|
1372 |
-
),
|
1373 |
-
array(
|
1374 |
-
"name" => "Do Not Remember Consent Answer",
|
1375 |
-
"attribute" => "notrememberconsent",
|
1376 |
-
"type" => "onoff",
|
1377 |
-
"validator" => "text",
|
1378 |
-
"listitems" => null,
|
1379 |
-
"value" => WFU_VAR("WFU_NOTREMEMBERCONSENT"),
|
1380 |
-
"mode" => "free",
|
1381 |
-
"category" => "personaldata",
|
1382 |
-
"subcategory" => "Consent Behaviour",
|
1383 |
-
"parent" => "",
|
1384 |
-
"dependencies" => null,
|
1385 |
-
"variables" => null,
|
1386 |
-
"help" => "If activated the plugin will not remember the consent answer provided by the user and the consent question will always show."
|
1387 |
-
),
|
1388 |
-
array(
|
1389 |
-
"name" => "Consent Denial Rejects Upload",
|
1390 |
-
"attribute" => "consentrejectupload",
|
1391 |
-
"type" => "onoff",
|
1392 |
-
"validator" => "text",
|
1393 |
-
"listitems" => null,
|
1394 |
-
"value" => WFU_VAR("WFU_CONSENTREJECTUPLOAD"),
|
1395 |
-
"mode" => "free",
|
1396 |
-
"category" => "personaldata",
|
1397 |
-
"subcategory" => "Consent Behaviour",
|
1398 |
-
"parent" => "",
|
1399 |
-
"dependencies" => array("consentrejectmessage"),
|
1400 |
-
"variables" => null,
|
1401 |
-
"help" => "If activated and user has denied consent then the upload will be rejected. If deactivated, then the upload will continue regardless of consent answer."
|
1402 |
-
),
|
1403 |
-
array(
|
1404 |
-
"name" => "Reject Message",
|
1405 |
-
"attribute" => "consentrejectmessage",
|
1406 |
-
"type" => "ltext",
|
1407 |
-
"validator" => "text",
|
1408 |
-
"listitems" => null,
|
1409 |
-
"value" => WFU_CONSENTREJECTMESSAGE,
|
1410 |
-
"mode" => "free",
|
1411 |
-
"category" => "personaldata",
|
1412 |
-
"subcategory" => "Consent Behaviour",
|
1413 |
-
"parent" => "consentrejectupload",
|
1414 |
-
"dependencies" => null,
|
1415 |
-
"variables" => null,
|
1416 |
-
"help" => "It defines the message that will appear to the user if upload cannot continue due to consent denial."
|
1417 |
-
),
|
1418 |
-
array(
|
1419 |
-
"name" => "Consent Format",
|
1420 |
-
"attribute" => "consentformat",
|
1421 |
-
"type" => "radio",
|
1422 |
-
"validator" => "text",
|
1423 |
-
"listitems" => array("checkbox", "radio", "prompt"),
|
1424 |
-
"value" => WFU_VAR("WFU_CONSENTFORMAT"),
|
1425 |
-
"mode" => "free",
|
1426 |
-
"category" => "personaldata",
|
1427 |
-
"subcategory" => "Consent Appearance",
|
1428 |
-
"parent" => "",
|
1429 |
-
"dependencies" => null,
|
1430 |
-
"variables" => null,
|
1431 |
-
"help" => "Determines how consent question will appear to the user. If 'checkbox' is selected then a checkbox will appear inside the upload form which the user needs to tick. If 'radio' is selected then a radio button with 'Yes' and 'No' answers will appear inside the form (this makes sure that the user will select something after all. If 'prompt' is selected then a dialog will appear on the user when pressing the upload button asking for consent."
|
1432 |
-
),
|
1433 |
-
array(
|
1434 |
-
"name" => "Preselected Answer",
|
1435 |
-
"attribute" => "consentpreselect",
|
1436 |
-
"type" => "radio",
|
1437 |
-
"validator" => "text",
|
1438 |
-
"listitems" => array("none", "yes", "no"),
|
1439 |
-
"value" => WFU_VAR("WFU_CONSENTPRESELECT"),
|
1440 |
-
"mode" => "free",
|
1441 |
-
"category" => "personaldata",
|
1442 |
-
"subcategory" => "Consent Appearance",
|
1443 |
-
"parent" => "",
|
1444 |
-
"dependencies" => null,
|
1445 |
-
"variables" => null,
|
1446 |
-
"help" => "Determines whether a default answer will be selected."
|
1447 |
-
),
|
1448 |
-
array(
|
1449 |
-
"name" => "Consent Question for Checkbox",
|
1450 |
-
"attribute" => "consentquestion",
|
1451 |
-
"type" => "ltext",
|
1452 |
-
"validator" => "text",
|
1453 |
-
"listitems" => null,
|
1454 |
-
"value" => WFU_CONSENTQUESTION,
|
1455 |
-
"mode" => "free",
|
1456 |
-
"category" => "personaldata",
|
1457 |
-
"subcategory" => "Consent Appearance",
|
1458 |
-
"parent" => "",
|
1459 |
-
"dependencies" => null,
|
1460 |
-
"variables" => null,
|
1461 |
-
"help" => "Defines the question that will appear to the user next to the checkbox, or radio buttons or inside the prompt dialog. If a word starting and ending with semicolon (:) is added in the question, e.g. :link:, then it will be replaced by a link defined in 'Consent Disclaimer Link' attribute. This way a link to a disclaimer can be added."
|
1462 |
-
),
|
1463 |
-
array(
|
1464 |
-
"name" => "Consent Disclaimer Link",
|
1465 |
-
"attribute" => "consentdisclaimer",
|
1466 |
-
"type" => "ltext",
|
1467 |
-
"validator" => "text",
|
1468 |
-
"listitems" => null,
|
1469 |
-
"value" => WFU_VAR("WFU_CONSENTDISCLAIMER"),
|
1470 |
-
"mode" => "free",
|
1471 |
-
"category" => "personaldata",
|
1472 |
-
"subcategory" => "Consent Appearance",
|
1473 |
-
"parent" => "",
|
1474 |
-
"dependencies" => null,
|
1475 |
-
"variables" => null,
|
1476 |
-
"help" => "Defines a link that displays a disclaimer to the user if the user presses the relevant link that is included inside the consent question."
|
1477 |
-
),
|
1478 |
-
array(
|
1479 |
-
"name" => "Success Upload Message Color",
|
1480 |
-
"attribute" => "successmessagecolor",
|
1481 |
-
"type" => "hidden",
|
1482 |
-
"validator" => "colors",
|
1483 |
-
"listitems" => null,
|
1484 |
-
"value" => WFU_SUCCESSMESSAGECOLOR,
|
1485 |
-
"mode" => "free",
|
1486 |
-
"category" => "colors",
|
1487 |
-
"subcategory" => "Upload Message Colors",
|
1488 |
-
"parent" => "",
|
1489 |
-
"dependencies" => null,
|
1490 |
-
"variables" => null,
|
1491 |
-
"help" => "It defines the color of the success message. This attribute has been replaced by successmessagecolors, however it is kept here for backward compatibility."
|
1492 |
-
),
|
1493 |
-
array(
|
1494 |
-
"name" => "Success Message Colors",
|
1495 |
-
"attribute" => "successmessagecolors",
|
1496 |
-
"type" => "color-triplet",
|
1497 |
-
"validator" => "colors",
|
1498 |
-
"listitems" => null,
|
1499 |
-
"value" => WFU_VAR("WFU_SUCCESSMESSAGECOLORS"),
|
1500 |
-
"mode" => "free",
|
1501 |
-
"category" => "colors",
|
1502 |
-
"subcategory" => "Upload Message Colors",
|
1503 |
-
"parent" => "",
|
1504 |
-
"dependencies" => null,
|
1505 |
-
"variables" => null,
|
1506 |
-
"help" => "It defines the text, background and border color of the success message."
|
1507 |
-
),
|
1508 |
-
array(
|
1509 |
-
"name" => "Warning Message Colors",
|
1510 |
-
"attribute" => "warningmessagecolors",
|
1511 |
-
"type" => "color-triplet",
|
1512 |
-
"validator" => "colors",
|
1513 |
-
"listitems" => null,
|
1514 |
-
"value" => WFU_VAR("WFU_WARNINGMESSAGECOLORS"),
|
1515 |
-
"mode" => "free",
|
1516 |
-
"category" => "colors",
|
1517 |
-
"subcategory" => "Upload Message Colors",
|
1518 |
-
"parent" => "",
|
1519 |
-
"dependencies" => null,
|
1520 |
-
"variables" => null,
|
1521 |
-
"help" => "It defines the text, background and border color of the warning message."
|
1522 |
-
),
|
1523 |
-
array(
|
1524 |
-
"name" => "Fail Message Colors",
|
1525 |
-
"attribute" => "failmessagecolors",
|
1526 |
-
"type" => "color-triplet",
|
1527 |
-
"validator" => "colors",
|
1528 |
-
"listitems" => null,
|
1529 |
-
"value" => WFU_VAR("WFU_FAILMESSAGECOLORS"),
|
1530 |
-
"mode" => "free",
|
1531 |
-
"category" => "colors",
|
1532 |
-
"subcategory" => "Upload Message Colors",
|
1533 |
-
"parent" => "",
|
1534 |
-
"dependencies" => null,
|
1535 |
-
"variables" => null,
|
1536 |
-
"help" => "It defines the text, background and border color of the fail (error) message."
|
1537 |
-
),
|
1538 |
-
array(
|
1539 |
-
"name" => "Wait Message Colors",
|
1540 |
-
"attribute" => "waitmessagecolors",
|
1541 |
-
"type" => "hidden",
|
1542 |
-
"validator" => "colors",
|
1543 |
-
"listitems" => null,
|
1544 |
-
"value" => WFU_VAR("WFU_WAITMESSAGECOLORS"),
|
1545 |
-
"mode" => "free",
|
1546 |
-
"category" => "colors",
|
1547 |
-
"subcategory" => "Upload Message Colors",
|
1548 |
-
"parent" => "",
|
1549 |
-
"dependencies" => null,
|
1550 |
-
"variables" => null,
|
1551 |
-
"help" => "It defines the text, background and border color of the wait message."
|
1552 |
-
),
|
1553 |
-
array(
|
1554 |
-
"name" => "Plugin Component Widths",
|
1555 |
-
"attribute" => "widths",
|
1556 |
-
"type" => "dimensions",
|
1557 |
-
"validator" => "text",
|
1558 |
-
"listitems" => null,
|
1559 |
-
"value" => WFU_VAR("WFU_WIDTHS"),
|
1560 |
-
"mode" => "free",
|
1561 |
-
"category" => "dimensions",
|
1562 |
-
"subcategory" => "Plugin Component Widths",
|
1563 |
-
"parent" => "",
|
1564 |
-
"dependencies" => null,
|
1565 |
-
"variables" => null,
|
1566 |
-
"help" => "It defines the widths of the selected plugin components."
|
1567 |
-
),
|
1568 |
-
array(
|
1569 |
-
"name" => "Plugin Component Heights",
|
1570 |
-
"attribute" => "heights",
|
1571 |
-
"type" => "dimensions",
|
1572 |
-
"validator" => "text",
|
1573 |
-
"listitems" => null,
|
1574 |
-
"value" => WFU_VAR("WFU_HEIGHTS"),
|
1575 |
-
"mode" => "free",
|
1576 |
-
"category" => "dimensions",
|
1577 |
-
"subcategory" => "Plugin Component Heights",
|
1578 |
-
"parent" => "",
|
1579 |
-
"dependencies" => null,
|
1580 |
-
"variables" => null,
|
1581 |
-
"help" => "It defines the heights of the selected plugin components."
|
1582 |
-
),
|
1583 |
-
array(
|
1584 |
-
"name" => "Include Additional Data Fields",
|
1585 |
-
"attribute" => "userdata",
|
1586 |
-
"type" => "onoff",
|
1587 |
-
"validator" => "text",
|
1588 |
-
"listitems" => null,
|
1589 |
-
"value" => WFU_VAR("WFU_USERDATA"),
|
1590 |
-
"mode" => "free",
|
1591 |
-
"category" => "userdata",
|
1592 |
-
"subcategory" => "Additional Data Fields",
|
1593 |
-
"parent" => "",
|
1594 |
-
"dependencies" => array("userdatalabel"),
|
1595 |
-
"variables" => null,
|
1596 |
-
"help" => "If enabled, then user can send additional information together with uploaded files (e.g. name, email etc), defined in userdatalabel attribute."
|
1597 |
-
),
|
1598 |
-
array(
|
1599 |
-
"name" => "Additional Data Fields",
|
1600 |
-
"attribute" => "userdatalabel",
|
1601 |
-
"type" => "formfields",
|
1602 |
-
"validator" => "text",
|
1603 |
-
"listitems" => wfu_formfield_definitions(),
|
1604 |
-
"value" => WFU_USERDATALABEL,
|
1605 |
-
"mode" => "free",
|
1606 |
-
"category" => "userdata",
|
1607 |
-
"subcategory" => "Additional Data Fields",
|
1608 |
-
"parent" => "userdata",
|
1609 |
-
"dependencies" => null,
|
1610 |
-
"variables" => null,
|
1611 |
-
"help" => "It defines the labels of the additional data fields and whether they are required or not."
|
1612 |
-
),
|
1613 |
-
array(
|
1614 |
-
"name" => "WP Filebase Plugin Connection",
|
1615 |
-
"attribute" => "filebaselink",
|
1616 |
-
"type" => "onoff",
|
1617 |
-
"validator" => "text",
|
1618 |
-
"listitems" => null,
|
1619 |
-
"value" => WFU_VAR("WFU_FILEBASELINK"),
|
1620 |
-
"mode" => "free",
|
1621 |
-
"category" => "interoperability",
|
1622 |
-
"subcategory" => "Connection With Other Plugins",
|
1623 |
-
"parent" => "",
|
1624 |
-
"dependencies" => null,
|
1625 |
-
"variables" => null,
|
1626 |
-
"help" => "If enabled then the WP Filebase Plugin will be informed about new file uploads."
|
1627 |
-
),
|
1628 |
-
array(
|
1629 |
-
"name" => "Add Uploaded Files To Media",
|
1630 |
-
"attribute" => "medialink",
|
1631 |
-
"type" => "onoff",
|
1632 |
-
"validator" => "text",
|
1633 |
-
"listitems" => null,
|
1634 |
-
"value" => WFU_VAR("WFU_MEDIALINK"),
|
1635 |
-
"mode" => "free",
|
1636 |
-
"category" => "interoperability",
|
1637 |
-
"subcategory" => "Connection With Other Wordpress Features",
|
1638 |
-
"parent" => "",
|
1639 |
-
"dependencies" => null,
|
1640 |
-
"variables" => null,
|
1641 |
-
"help" => "If enabled then the uploaded files will be added to the Media library of your Wordpress website. Please note that the upload path must be inside the wp-content/uploads directory (which is the default upload path)."
|
1642 |
-
),
|
1643 |
-
array(
|
1644 |
-
"name" => "Attach Uploaded Files To Post",
|
1645 |
-
"attribute" => "postlink",
|
1646 |
-
"type" => "onoff",
|
1647 |
-
"validator" => "text",
|
1648 |
-
"listitems" => null,
|
1649 |
-
"value" => WFU_VAR("WFU_POSTLINK"),
|
1650 |
-
"mode" => "free",
|
1651 |
-
"category" => "interoperability",
|
1652 |
-
"subcategory" => "Connection With Other Wordpress Features",
|
1653 |
-
"parent" => "",
|
1654 |
-
"dependencies" => null,
|
1655 |
-
"variables" => null,
|
1656 |
-
"help" => "If enabled then the uploaded files will be added to the current post as attachments. Please note that the upload path must be inside the wp-content/uploads directory (which is the default upload path)."
|
1657 |
-
),
|
1658 |
-
array(
|
1659 |
-
"name" => "Enable Webcam",
|
1660 |
-
"attribute" => "webcam",
|
1661 |
-
"type" => "onoff",
|
1662 |
-
"validator" => "text",
|
1663 |
-
"listitems" => null,
|
1664 |
-
"value" => WFU_VAR("WFU_WEBCAM"),
|
1665 |
-
"mode" => "free",
|
1666 |
-
"category" => "webcam",
|
1667 |
-
"subcategory" => "Capture from Webcam (experimental)",
|
1668 |
-
"parent" => "",
|
1669 |
-
"dependencies" => array("webcammode", "audiocapture", "videowidth", "videoheight", "videoaspectratio", "videoframerate", "camerafacing", "maxrecordtime", "uploadmediabutton", "videoname", "imagename"),
|
1670 |
-
"variables" => null,
|
1671 |
-
"help" => "This enables capturing of video or still pictures from the computer's webcam. It is experimental because it is not supported by all browsers yet."
|
1672 |
-
),
|
1673 |
-
array(
|
1674 |
-
"name" => "Capture Mode",
|
1675 |
-
"attribute" => "webcammode",
|
1676 |
-
"type" => "radio",
|
1677 |
-
"validator" => "text",
|
1678 |
-
"listitems" => array("capture video", "take photos", "both"),
|
1679 |
-
"value" => WFU_VAR("WFU_WEBCAMMODE"),
|
1680 |
-
"mode" => "free",
|
1681 |
-
"category" => "webcam",
|
1682 |
-
"subcategory" => "Capture from Webcam (experimental)",
|
1683 |
-
"parent" => "webcam",
|
1684 |
-
"dependencies" => null,
|
1685 |
-
"variables" => null,
|
1686 |
-
"help" => "It defines the webcam capture mode. The webcam can either capture video, still photos or both."
|
1687 |
-
),
|
1688 |
-
array(
|
1689 |
-
"name" => "Capture Audio",
|
1690 |
-
"attribute" => "audiocapture",
|
1691 |
-
"type" => "onoff",
|
1692 |
-
"validator" => "text",
|
1693 |
-
"listitems" => null,
|
1694 |
-
"value" => WFU_VAR("WFU_AUDIOCAPTURE"),
|
1695 |
-
"mode" => "free",
|
1696 |
-
"category" => "webcam",
|
1697 |
-
"subcategory" => "Capture from Webcam (experimental)",
|
1698 |
-
"parent" => "webcam",
|
1699 |
-
"dependencies" => null,
|
1700 |
-
"variables" => null,
|
1701 |
-
"help" => "It defines whether audio will be captured together with video from the webcam."
|
1702 |
-
),
|
1703 |
-
array(
|
1704 |
-
"name" => "Video Width",
|
1705 |
-
"attribute" => "videowidth",
|
1706 |
-
"type" => "text",
|
1707 |
-
"validator" => "text",
|
1708 |
-
"listitems" => null,
|
1709 |
-
"value" => WFU_VAR("WFU_VIDEOWIDTH"),
|
1710 |
-
"mode" => "free",
|
1711 |
-
"category" => "webcam",
|
1712 |
-
"subcategory" => "Capture from Webcam (experimental)",
|
1713 |
-
"parent" => "webcam",
|
1714 |
-
"dependencies" => null,
|
1715 |
-
"variables" => null,
|
1716 |
-
"help" => "It requests a preferable video width for the webcam. The plugin will try to match this setting as close as possible depending on webcam capabilities."
|
1717 |
-
),
|
1718 |
-
array(
|
1719 |
-
"name" => "Video Height",
|
1720 |
-
"attribute" => "videoheight",
|
1721 |
-
"type" => "text",
|
1722 |
-
"validator" => "text",
|
1723 |
-
"listitems" => null,
|
1724 |
-
"value" => WFU_VAR("WFU_VIDEOHEIGHT"),
|
1725 |
-
"mode" => "free",
|
1726 |
-
"category" => "webcam",
|
1727 |
-
"subcategory" => "Capture from Webcam (experimental)",
|
1728 |
-
"parent" => "webcam",
|
1729 |
-
"dependencies" => null,
|
1730 |
-
"variables" => null,
|
1731 |
-
"help" => "It requests a preferable video height for the webcam. The plugin will try to match this setting as close as possible depending on webcam capabilities."
|
1732 |
-
),
|
1733 |
-
array(
|
1734 |
-
"name" => "Video Aspect Ratio",
|
1735 |
-
"attribute" => "videoaspectratio",
|
1736 |
-
"type" => "text",
|
1737 |
-
"validator" => "text",
|
1738 |
-
"listitems" => null,
|
1739 |
-
"value" => WFU_VAR("WFU_VIDEOASPECTRATIO"),
|
1740 |
-
"mode" => "free",
|
1741 |
-
"category" => "webcam",
|
1742 |
-
"subcategory" => "Capture from Webcam (experimental)",
|
1743 |
-
"parent" => "webcam",
|
1744 |
-
"dependencies" => null,
|
1745 |
-
"variables" => null,
|
1746 |
-
"help" => "It requests a preferable video aspect ratio for the webcam. The plugin will try to match this setting as close as possible depending on webcam capabilities."
|
1747 |
-
),
|
1748 |
-
array(
|
1749 |
-
"name" => "Video Frame Rate",
|
1750 |
-
"attribute" => "videoframerate",
|
1751 |
-
"type" => "text",
|
1752 |
-
"validator" => "text",
|
1753 |
-
"listitems" => null,
|
1754 |
-
"value" => WFU_VAR("WFU_VIDEOFRAMERATE"),
|
1755 |
-
"mode" => "free",
|
1756 |
-
"category" => "webcam",
|
1757 |
-
"subcategory" => "Capture from Webcam (experimental)",
|
1758 |
-
"parent" => "webcam",
|
1759 |
-
"dependencies" => null,
|
1760 |
-
"variables" => null,
|
1761 |
-
"help" => "It requests a preferable video frame rate for video recording. The plugin will try to match this setting as close as possible depending on webcam capabilities."
|
1762 |
-
),
|
1763 |
-
array(
|
1764 |
-
"name" => "Camera Facing Mode",
|
1765 |
-
"attribute" => "camerafacing",
|
1766 |
-
"type" => "radio",
|
1767 |
-
"validator" => "text",
|
1768 |
-
"listitems" => array("any", "front", "back"),
|
1769 |
-
"value" => WFU_VAR("WFU_CAMERAFACING"),
|
1770 |
-
"mode" => "free",
|
1771 |
-
"category" => "webcam",
|
1772 |
-
"subcategory" => "Capture from Webcam (experimental)",
|
1773 |
-
"parent" => "webcam",
|
1774 |
-
"dependencies" => null,
|
1775 |
-
"variables" => null,
|
1776 |
-
"help" => "It defines if the front or back camera will be preferred (for mobile devices with 2 cameras). The plugin will try to match this setting depending on webcam capabilities."
|
1777 |
-
),
|
1778 |
-
array(
|
1779 |
-
"name" => "Max Record Time",
|
1780 |
-
"attribute" => "maxrecordtime",
|
1781 |
-
"type" => "integer",
|
1782 |
-
"validator" => "integer",
|
1783 |
-
"listitems" => null,
|
1784 |
-
"value" => WFU_VAR("WFU_MAXRECORDTIME"),
|
1785 |
-
"mode" => "free",
|
1786 |
-
"category" => "webcam",
|
1787 |
-
"subcategory" => "Capture from Webcam (experimental)",
|
1788 |
-
"parent" => "webcam",
|
1789 |
-
"dependencies" => null,
|
1790 |
-
"variables" => null,
|
1791 |
-
"help" => "It defines the maximum time of video recording (in seconds). If it is set to -1, then there is no time limit."
|
1792 |
-
),
|
1793 |
-
null
|
1794 |
-
);
|
1795 |
-
|
1796 |
-
wfu_array_remove_nulls($defs);
|
1797 |
-
|
1798 |
-
|
1799 |
-
return $defs;
|
1800 |
-
}
|
1801 |
-
|
1802 |
-
|
1803 |
-
?>
|
1 |
+
<?php
|
2 |
+
|
3 |
+
function wfu_component_definitions() {
|
4 |
+
$components = array(
|
5 |
+
array(
|
6 |
+
"id" => "title",
|
7 |
+
"name" => "Title",
|
8 |
+
"mode" => "free",
|
9 |
+
"dimensions" => array("plugin/Plugin", "title/Title"),
|
10 |
+
"multiplacements" => false,
|
11 |
+
"help" => "A title text for the plugin"
|
12 |
+
),
|
13 |
+
array(
|
14 |
+
"id" => "filename",
|
15 |
+
"name" => "Filename",
|
16 |
+
"mode" => "free",
|
17 |
+
"dimensions" => null,
|
18 |
+
"multiplacements" => false,
|
19 |
+
"help" => "It shows the name of the selected file (useful only for single file uploads)."
|
20 |
+
),
|
21 |
+
array(
|
22 |
+
"id" => "selectbutton",
|
23 |
+
"name" => "Select Button",
|
24 |
+
"mode" => "free",
|
25 |
+
"dimensions" => null,
|
26 |
+
"multiplacements" => false,
|
27 |
+
"help" => "Represents the button to select the files for upload."
|
28 |
+
),
|
29 |
+
array(
|
30 |
+
"id" => "uploadbutton",
|
31 |
+
"name" => "Upload Button",
|
32 |
+
"mode" => "free",
|
33 |
+
"dimensions" => null,
|
34 |
+
"multiplacements" => false,
|
35 |
+
"help" => "Represents the button to execute the upload after some files have been selected."
|
36 |
+
),
|
37 |
+
array(
|
38 |
+
"id" => "subfolders",
|
39 |
+
"name" => "Subfolders",
|
40 |
+
"mode" => "free",
|
41 |
+
"dimensions" => array("uploadfolder_label/Upload Folder Label", "subfolders/Subfolders", "subfolders_label/Subfolders Label", "subfolders_select/Subfolders List"),
|
42 |
+
"multiplacements" => false,
|
43 |
+
"help" => "Allows the user to select the upload folder from a dropdown list."
|
44 |
+
),
|
45 |
+
array(
|
46 |
+
"id" => "webcam",
|
47 |
+
"name" => "Webcam",
|
48 |
+
"mode" => "commercial",
|
49 |
+
"dimensions" => array("webcam/Webcam Box"),
|
50 |
+
"multiplacements" => false,
|
51 |
+
"help" => "Displays video from the device's webcam. The user can capture and upload screenshots or video streams."
|
52 |
+
),
|
53 |
+
array(
|
54 |
+
"id" => "progressbar",
|
55 |
+
"name" => "Progressbar",
|
56 |
+
"mode" => "free",
|
57 |
+
"dimensions" => null,
|
58 |
+
"multiplacements" => false,
|
59 |
+
"help" => "Displays a simple progress bar, showing total progress of upload."
|
60 |
+
),
|
61 |
+
array(
|
62 |
+
"id" => "userdata",
|
63 |
+
"name" => "User Fields",
|
64 |
+
"mode" => "free",
|
65 |
+
"dimensions" => array("userdata/User Fields", "userdata_label/User Fields Label", "userdata_value/User Fields Value"),
|
66 |
+
"multiplacements" => true,
|
67 |
+
"help" => "Displays additional fields that the user must fill-in together with the uploaded files."
|
68 |
+
),
|
69 |
+
array(
|
70 |
+
"id" => "consent",
|
71 |
+
"name" => "Consent",
|
72 |
+
"mode" => "free",
|
73 |
+
"dimensions" => array("consent/Consent Block"),
|
74 |
+
"multiplacements" => false,
|
75 |
+
"help" => "Displays a checkbox asking user's consent for storing personal data."
|
76 |
+
),
|
77 |
+
array(
|
78 |
+
"id" => "message",
|
79 |
+
"name" => "Message",
|
80 |
+
"mode" => "free",
|
81 |
+
"dimensions" => null,
|
82 |
+
"multiplacements" => false,
|
83 |
+
"help" => "Displays a message block with information about the upload, together with any warnings or errors."
|
84 |
+
)
|
85 |
+
);
|
86 |
+
|
87 |
+
wfu_array_remove_nulls($components);
|
88 |
+
|
89 |
+
return $components;
|
90 |
+
}
|
91 |
+
|
92 |
+
function wfu_category_definitions() {
|
93 |
+
$cats = array(
|
94 |
+
"general" => "General",
|
95 |
+
"placements" => "Placements",
|
96 |
+
"labels" => "Labels",
|
97 |
+
"notifications" => "Notifications",
|
98 |
+
"personaldata" => "Personal Data",
|
99 |
+
"colors" => "Colors",
|
100 |
+
"dimensions" => "Dimensions",
|
101 |
+
"userdata" => "Additional Fields",
|
102 |
+
"interoperability" => "Interoperability",
|
103 |
+
"webcam" => "Webcam"
|
104 |
+
);
|
105 |
+
|
106 |
+
return $cats;
|
107 |
+
}
|
108 |
+
|
109 |
+
function wfu_formfield_definitions() {
|
110 |
+
//field properties have 2 parts separated by "/"; the first part determines if the property will be shown to the user (show or hide); the second part determines default value)
|
111 |
+
//when making changes in the structure of formfield definitions, the following are affected:
|
112 |
+
// - wfu_admin_composer.php function wfu_shortcode_composer
|
113 |
+
// variable $fieldprops_basic
|
114 |
+
// variable $fieldprops_default
|
115 |
+
// variable $template
|
116 |
+
// variable wfu_attribute_..._typeprops
|
117 |
+
// variable $from_template
|
118 |
+
// - wfu_functions.php function wfu_parse_userdata_attribute
|
119 |
+
// variable $default
|
120 |
+
// variable $fieldprops
|
121 |
+
// - wfu_blocks.php function wfu_userdata_apply_template
|
122 |
+
// return variable
|
123 |
+
// - wordpress_file_upload_adminfuctions.js function wfu_formdata_type_changed
|
124 |
+
// variable field
|
125 |
+
// - wordpress_file_upload_adminfuctions.js function wfu_formdata_add_field
|
126 |
+
// variable field
|
127 |
+
// - wordpress_file_upload_adminfuctions.js function wfu_formdata_prepare_template
|
128 |
+
// variable fieldprops_basic
|
129 |
+
// variable template
|
130 |
+
// - wordpress_file_upload_adminfuctions.js function wfu_update_formfield_value
|
131 |
+
// variable part
|
132 |
+
// - wordpress_file_upload_adminfuctions.js function wfu_apply_value
|
133 |
+
// variable def
|
134 |
+
// variable fieldprops
|
135 |
+
$formfields = array(
|
136 |
+
array(
|
137 |
+
"type" => "text",
|
138 |
+
"type_description" => "Simple Text",
|
139 |
+
//label properties
|
140 |
+
"label" => "",
|
141 |
+
"label_label" => "Label",
|
142 |
+
"label_hint" => "enter the label that will be shown next to the field",
|
143 |
+
//checkbox properties
|
144 |
+
"required" => "show/false",
|
145 |
+
"required_hint" => "if checked, then this field must have a non-empty value for the file to be uploaded",
|
146 |
+
"donotautocomplete" => "show/false",
|
147 |
+
"donotautocomplete_hint" => "if checked, then the field will notify the browsers not to fill it with autocomplete data when the plugin is reloaded",
|
148 |
+
"validate" => "hide/false",
|
149 |
+
"validate_hint" => "if checked, then the field value entered by the user will be validated before file upload",
|
150 |
+
"typehook" => "hide/false",
|
151 |
+
"typehook_hint" => "if checked, then text suggestions will be shown below the field as the user types more text inside",
|
152 |
+
//dropdown properties
|
153 |
+
"labelposition" => "show/left",
|
154 |
+
"labelposition_hint" => "select the position of the field's label; the position is relative to the field",
|
155 |
+
"hintposition" => "show/right",
|
156 |
+
"hintposition_hint" => "select the position of the hint that will be shown to notify the user that something is wrong\\r\\nthe position is relative to the field",
|
157 |
+
//text properties
|
158 |
+
"default" => "show/",
|
159 |
+
"default_hint" => "enter a default value for the field or leave it empty if you do not want a default value",
|
160 |
+
"data" => "hide/",
|
161 |
+
"data_label" => "Data",
|
162 |
+
"data_hint" => "complete a list of values to be shown to the user",
|
163 |
+
"group" => "hide/",
|
164 |
+
"group_hint" => "if a value is set, then all fields having the same value will belong to the same group",
|
165 |
+
"format" => "hide/",
|
166 |
+
"format_hint" => "enter a format to format user selection"
|
167 |
+
),
|
168 |
+
array(
|
169 |
+
"type" => "multitext",
|
170 |
+
"type_description" => "Multiple Lines Text",
|
171 |
+
//label properties
|
172 |
+
"label" => "",
|
173 |
+
"label_label" => "Label",
|
174 |
+
"label_hint" => "enter the label that will be shown next to the field",
|
175 |
+
//checkbox properties
|
176 |
+
"required" => "show/false",
|
177 |
+
"required_hint" => "if checked, then this field must have a non-empty value for the file to be uploaded",
|
178 |
+
"donotautocomplete" => "hide/true",
|
179 |
+
"donotautocomplete_hint" => "if checked, then the field will notify the browsers not to fill it with autocomplete data when the plugin is reloaded",
|
180 |
+
"validate" => "hide/false",
|
181 |
+
"validate_hint" => "if checked, then the field value entered by the user will be validated before file upload",
|
182 |
+
"typehook" => "hide/false",
|
183 |
+
"typehook_hint" => "if checked, then text suggestions will be shown below the field as the user types more text inside",
|
184 |
+
//dropdown properties
|
185 |
+
"labelposition" => "show/left",
|
186 |
+
"labelposition_hint" => "select the position of the field's label; the position is relative to the field",
|
187 |
+
"hintposition" => "show/right",
|
188 |
+
"hintposition_hint" => "select the position of the hint that will be shown to notify the user that something is wrong\\r\\nthe position is relative to the field",
|
189 |
+
//text properties
|
190 |
+
"default" => "hide/",
|
191 |
+
"default_hint" => "enter a default value for the field or leave it empty if you do not want a default value",
|
192 |
+
"data" => "hide/",
|
193 |
+
"data_label" => "Data",
|
194 |
+
"data_hint" => "complete a list of values to be shown to the user",
|
195 |
+
"group" => "hide/",
|
196 |
+
"group_hint" => "if a value is set, then all fields having the same value will belong to the same group",
|
197 |
+
"format" => "hide/",
|
198 |
+
"format_hint" => "enter a format to format user selection"
|
199 |
+
),
|
200 |
+
array(
|
201 |
+
"type" => "number",
|
202 |
+
"type_description" => "Number",
|
203 |
+
//label properties
|
204 |
+
"label" => "",
|
205 |
+
"label_label" => "Label",
|
206 |
+
"label_hint" => "enter the label that will be shown next to the field",
|
207 |
+
//checkbox properties
|
208 |
+
"required" => "show/false",
|
209 |
+
"required_hint" => "if checked, then this field must have a non-empty value for the file to be uploaded",
|
210 |
+
"donotautocomplete" => "show/true",
|
211 |
+
"donotautocomplete_hint" => "if checked, then the field will notify the browsers not to fill it with autocomplete data when the plugin is reloaded",
|
212 |
+
"validate" => "show/true",
|
213 |
+
"validate_hint" => "if checked, then the number entered by the user will be checked if it is a valid number, based on the format defined, before file upload",
|
214 |
+
"typehook" => "show/false",
|
215 |
+
"typehook_hint" => "if checked, then only valid characters will be allowed during typing",
|
216 |
+
//dropdown properties
|
217 |
+
"labelposition" => "show/left",
|
218 |
+
"labelposition_hint" => "select the position of the field's label; the position is relative to the field",
|
219 |
+
"hintposition" => "show/right",
|
220 |
+
"hintposition_hint" => "select the position of the hint that will be shown to notify the user that something is wrong\\r\\nthe position is relative to the field",
|
221 |
+
//text properties
|
222 |
+
"default" => "show/",
|
223 |
+
"default_hint" => "enter a default value for the field or leave it empty if you do not want a default value",
|
224 |
+
"data" => "hide/",
|
225 |
+
"data_label" => "Data",
|
226 |
+
"data_hint" => "complete a list of values to be shown to the user",
|
227 |
+
"group" => "hide/",
|
228 |
+
"group_hint" => "if a non-empty group value is set, then another email confirmation field belonging to the same group must have the same email value",
|
229 |
+
"format" => "show/d",
|
230 |
+
"format_hint" => "enter a format for the number:\\r\\n d for integers\\r\\n f for floating point numbers\\r\\nthe dot (.) symbol is used as a decimal separator"
|
231 |
+
),
|
232 |
+
array(
|
233 |
+
"type" => "email",
|
234 |
+
"type_description" => "Email",
|
235 |
+
//label properties
|
236 |
+
"label" => "",
|
237 |
+
"label_label" => "Label",
|
238 |
+
"label_hint" => "enter the label that will be shown next to the field",
|
239 |
+
//checkbox properties
|
240 |
+
"required" => "show/false",
|
241 |
+
"required_hint" => "if checked, then this field must have a non-empty value for the file to be uploaded",
|
242 |
+
"donotautocomplete" => "show/true",
|
243 |
+
"donotautocomplete_hint" => "if checked, then the field will notify the browsers not to fill it with autocomplete data when the plugin is reloaded",
|
244 |
+
"validate" => "show/true",
|
245 |
+
"validate_hint" => "if checked, then the email entered by the user will be checked if it is valid before file upload",
|
246 |
+
"typehook" => "hide/false",
|
247 |
+
"typehook_hint" => "if checked, then text suggestions will be shown below the field as the user types more text inside",
|
248 |
+
//dropdown properties
|
249 |
+
"labelposition" => "show/left",
|
250 |
+
"labelposition_hint" => "select the position of the field's label; the position is relative to the field",
|
251 |
+
"hintposition" => "show/right",
|
252 |
+
"hintposition_hint" => "select the position of the hint that will be shown to notify the user that something is wrong\\r\\nthe position is relative to the field",
|
253 |
+
//text properties
|
254 |
+
"default" => "show/",
|
255 |
+
"default_hint" => "enter a default value for the field or leave it empty if you do not want a default value",
|
256 |
+
"data" => "hide/",
|
257 |
+
"data_label" => "Data",
|
258 |
+
"data_hint" => "complete a list of values to be shown to the user",
|
259 |
+
"group" => "show/0",
|
260 |
+
"group_hint" => "if a non-empty group value is set, then another email confirmation field belonging to the same group must have the same email value",
|
261 |
+
"format" => "hide/",
|
262 |
+
"format_hint" => "enter a format to format user selection"
|
263 |
+
),
|
264 |
+
array(
|
265 |
+
"type" => "confirmemail",
|
266 |
+
"type_description" => "Confirmation Email",
|
267 |
+
//label properties
|
268 |
+
"label" => "",
|
269 |
+
"label_label" => "Label",
|
270 |
+
"label_hint" => "enter the label that will be shown next to the field",
|
271 |
+
//checkbox properties
|
272 |
+
"required" => "show/true",
|
273 |
+
"required_hint" => "if checked, then this field must have a non-empty value for the file to be uploaded",
|
274 |
+
"donotautocomplete" => "show/true",
|
275 |
+
"donotautocomplete_hint" => "if checked, then the field will notify the browsers not to fill it with autocomplete data when the plugin is reloaded",
|
276 |
+
"validate" => "hide/true",
|
277 |
+
"validate_hint" => "if checked, then the confirmation email entered by the user will be checked if it is the same with the email belonging to the same group",
|
278 |
+
"typehook" => "hide/false",
|
279 |
+
"typehook_hint" => "if checked, then text suggestions will be shown below the field as the user types more text inside",
|
280 |
+
//dropdown properties
|
281 |
+
"labelposition" => "show/left",
|
282 |
+
"labelposition_hint" => "select the position of the field's label; the position is relative to the field",
|
283 |
+
"hintposition" => "show/right",
|
284 |
+
"hintposition_hint" => "select the position of the hint that will be shown to notify the user that something is wrong\\r\\nthe position is relative to the field",
|
285 |
+
//text properties
|
286 |
+
"default" => "hide/",
|
287 |
+
"default_hint" => "enter a default value for the field or leave it empty if you do not want a default value",
|
288 |
+
"data" => "hide/",
|
289 |
+
"data_label" => "Data",
|
290 |
+
"data_hint" => "complete a list of values to be shown to the user",
|
291 |
+
"group" => "show/0",
|
292 |
+
"group_hint" => "enter a non-empty value to match this email confirmation field with another email field",
|
293 |
+
"format" => "hide/",
|
294 |
+
"format_hint" => "enter a format to format user selection"
|
295 |
+
),
|
296 |
+
array(
|
297 |
+
"type" => "password",
|
298 |
+
"type_description" => "Password",
|
299 |
+
//label properties
|
300 |
+
"label" => "",
|
301 |
+
"label_label" => "Label",
|
302 |
+
"label_hint" => "enter the label that will be shown next to the field",
|
303 |
+
//checkbox properties
|
304 |
+
"required" => "show/true",
|
305 |
+
"required_hint" => "if checked, then this field must have a non-empty value for the file to be uploaded",
|
306 |
+
"donotautocomplete" => "false/true",
|
307 |
+
"donotautocomplete_hint" => "if checked, then the field will notify the browsers not to fill it with autocomplete data when the plugin is reloaded",
|
308 |
+
"validate" => "hide/false",
|
309 |
+
"validate_hint" => "if checked, then the value entered by the user will be validated",
|
310 |
+
"typehook" => "hide/false",
|
311 |
+
"typehook_hint" => "if checked, then text suggestions will be shown below the field as the user types more text inside",
|
312 |
+
//dropdown properties
|
313 |
+
"labelposition" => "show/left",
|
314 |
+
"labelposition_hint" => "select the position of the field's label; the position is relative to the field",
|
315 |
+
"hintposition" => "show/right",
|
316 |
+
"hintposition_hint" => "select the position of the hint that will be shown to notify the user that something is wrong\\r\\nthe position is relative to the field",
|
317 |
+
//text properties
|
318 |
+
"default" => "hide/",
|
319 |
+
"default_hint" => "enter a default value for the field or leave it empty if you do not want a default value",
|
320 |
+
"data" => "hide/",
|
321 |
+
"data_label" => "Data",
|
322 |
+
"data_hint" => "complete a list of values to be shown to the user",
|
323 |
+
"group" => "show/0",
|
324 |
+
"group_hint" => "if a non-empty group value is set, then another password confirmation field belonging to the same group must have the same password",
|
325 |
+
"format" => "hide/",
|
326 |
+
"format_hint" => "enter a format to format user selection"
|
327 |
+
),
|
328 |
+
array(
|
329 |
+
"type" => "confirmpassword",
|
330 |
+
"type_description" => "Confirmation Password",
|
331 |
+
//label properties
|
332 |
+
"label" => "",
|
333 |
+
"label_label" => "Label",
|
334 |
+
"label_hint" => "enter the label that will be shown next to the field",
|
335 |
+
//checkbox properties
|
336 |
+
"required" => "show/true",
|
337 |
+
"required_hint" => "if checked, then this field must have a non-empty value for the file to be uploaded",
|
338 |
+
"donotautocomplete" => "false/true",
|
339 |
+
"donotautocomplete_hint" => "if checked, then the field will notify the browsers not to fill it with autocomplete data when the plugin is reloaded",
|
340 |
+
"validate" => "hide/true",
|
341 |
+
"validate_hint" => "if checked, then the value entered by the user will be validated",
|
342 |
+
"typehook" => "hide/false",
|
343 |
+
"typehook_hint" => "if checked, then text suggestions will be shown below the field as the user types more text inside",
|
344 |
+
//dropdown properties
|
345 |
+
"labelposition" => "show/left",
|
346 |
+
"labelposition_hint" => "select the position of the field's label; the position is relative to the field",
|
347 |
+
"hintposition" => "show/right",
|
348 |
+
"hintposition_hint" => "select the position of the hint that will be shown to notify the user that something is wrong\\r\\nthe position is relative to the field",
|
349 |
+
//text properties
|
350 |
+
"default" => "hide/",
|
351 |
+
"default_hint" => "enter a default value for the field or leave it empty if you do not want a default value",
|
352 |
+
"data" => "hide/",
|
353 |
+
"data_label" => "Data",
|
354 |
+
"data_hint" => "complete a list of values to be shown to the user",
|
355 |
+
"group" => "show/0",
|
356 |
+
"group_hint" => "if a non-empty group value is set, then another password confirmation field belonging to the same group must have the same password",
|
357 |
+
"format" => "hide/",
|
358 |
+
"format_hint" => "enter a format to format user selection"
|
359 |
+
),
|
360 |
+
array(
|
361 |
+
"type" => "checkbox",
|
362 |
+
"type_description" => "Checkbox",
|
363 |
+
//label properties
|
364 |
+
"label" => "",
|
365 |
+
"label_label" => "Label",
|
366 |
+
"label_hint" => "enter the label that will be shown next to the field",
|
367 |
+
//checkbox properties
|
368 |
+
"required" => "show/false",
|
369 |
+
"required_hint" => "if checked, then this checkbox field must be checked before file upload",
|
370 |
+
"donotautocomplete" => "show/true",
|
371 |
+
"donotautocomplete_hint" => "if checked, then the field will not be autocompleted by browsers",
|
372 |
+
"validate" => "hide/false",
|
373 |
+
"validate_hint" => "if checked, then the field value entered by the user will be validated before file upload",
|
374 |
+
"typehook" => "hide/false",
|
375 |
+
"typehook_hint" => "if checked, then text suggestions will be shown below the field as the user types more text inside",
|
376 |
+
//dropdown properties
|
377 |
+
"labelposition" => "show/none",
|
378 |
+
"labelposition_hint" => "select the position of the field's label; the position is relative to the field",
|
379 |
+
"hintposition" => "show/right",
|
380 |
+
"hintposition_hint" => "select the position of the hint that will be shown to notify the user that something is wrong\\r\\nthe position is relative to the field",
|
381 |
+
//text properties
|
382 |
+
"default" => "show/false",
|
383 |
+
"default_hint" => "enter a default value (true or false) for the field or leave it empty if you do not want a default value",
|
384 |
+
"data" => "show/",
|
385 |
+
"data_label" => "Description",
|
386 |
+
"data_hint" => "enter a description for the checkbox",
|
387 |
+
"group" => "hide/",
|
388 |
+
"group_hint" => "if a value is set, then all fields having the same value will belong to the same group",
|
389 |
+
"format" => "show/right",
|
390 |
+
"format_hint" => "define the location of the description in relation to the check box\\r\\npossible values are: top, right, bottom, left"
|
391 |
+
),
|
392 |
+
array(
|
393 |
+
"type" => "radiobutton",
|
394 |
+
"type_description" => "Radio button",
|
395 |
+
//label properties
|
396 |
+
"label" => "",
|
397 |
+
"label_label" => "Label",
|
398 |
+
"label_hint" => "enter the label that will be shown next to the field",
|
399 |
+
//checkbox properties
|
400 |
+
"required" => "show/false",
|
401 |
+
"required_hint" => "if checked, then a radio button must be selected before file upload",
|
402 |
+
"donotautocomplete" => "show/true",
|
403 |
+
"donotautocomplete_hint" => "if checked, then the field will not be autocompleted by browsers",
|
404 |
+
"validate" => "hide/false",
|
405 |
+
"validate_hint" => "if checked, then the field value entered by the user will be validated before file upload",
|
406 |
+
"typehook" => "hide/false",
|
407 |
+
"typehook_hint" => "if checked, then text suggestions will be shown below the field as the user types more text inside",
|
408 |
+
//dropdown properties
|
409 |
+
"labelposition" => "show/left",
|
410 |
+
"labelposition_hint" => "select the position of the field's label; the position is relative to the field",
|
411 |
+
"hintposition" => "show/right",
|
412 |
+
"hintposition_hint" => "select the position of the hint that will be shown to notify the user that something is wrong\\r\\nthe position is relative to the field",
|
413 |
+
//text properties
|
414 |
+
"default" => "show/",
|
415 |
+
"default_hint" => "enter a default value for the field or leave it empty if you do not want a default value",
|
416 |
+
"data" => "show/",
|
417 |
+
"data_label" => "Items",
|
418 |
+
"data_hint" => "enter a comma delimited list of radio button items",
|
419 |
+
"group" => "show/0",
|
420 |
+
"group_hint" => "all radio buttons having the same group id belong to the same group",
|
421 |
+
"format" => "show/",
|
422 |
+
"format_hint" => "define the location of the radio labels in relation to their radio buttons (top, right, bottom, left)\\r\\nand the placement of the radio buttons (horizontal, vertical)"
|
423 |
+
),
|
424 |
+
array(
|
425 |
+
"type" => "date",
|
426 |
+
"type_description" => "Date",
|
427 |
+
//label properties
|
428 |
+
"label" => "",
|
429 |
+
"label_label" => "Label",
|
430 |
+
"label_hint" => "enter the label that will be shown next to the field",
|
431 |
+
//checkbox properties
|
432 |
+
"required" => "show/false",
|
433 |
+
"required_hint" => "if checked, then a date must be entered before file upload",
|
434 |
+
"donotautocomplete" => "show/true",
|
435 |
+
"donotautocomplete_hint" => "if checked, then the field will not be autocompleted by browsers",
|
436 |
+
"validate" => "hide/false",
|
437 |
+
"validate_hint" => "if checked, then the field value entered by the user will be validated before file upload",
|
438 |
+
"typehook" => "hide/false",
|
439 |
+
"typehook_hint" => "if checked, then text suggestions will be shown below the field as the user types more text inside",
|
440 |
+
//dropdown properties
|
441 |
+
"labelposition" => "show/left",
|
442 |
+
"labelposition_hint" => "select the position of the field's label; the position is relative to the field",
|
443 |
+
"hintposition" => "show/right",
|
444 |
+
"hintposition_hint" => "select the position of the hint that will be shown to notify the user that something is wrong\\r\\nthe position is relative to the field",
|
445 |
+
//text properties
|
446 |
+
"default" => "show/",
|
447 |
+
"default_hint" => "enter a default date for the field or leave it empty if you do not want a default value",
|
448 |
+
"data" => "hide/",
|
449 |
+
"data_label" => "Data",
|
450 |
+
"data_hint" => "enter data items",
|
451 |
+
"group" => "hide/",
|
452 |
+
"group_hint" => "enter a group value",
|
453 |
+
"format" => "show/",
|
454 |
+
"format_hint" => "define the format of the date field as follows:\\r\\n d - day of month (no leading zero)\\r\\n dd - day of month (two digit)\\r\\n o - day of the year (no leading zeros)\\r\\n oo - day of the year (three digit)\\r\\n D - day name short\\r\\n DD - day name long\\r\\n m - month of year (no leading zero)\\r\\n mm - month of year (two digit)\\r\\n M - month name short\\r\\n MM - month name long\\r\\n y - year (two digit)\\r\\n yy - year (four digit)\\r\\n @ - Unix timestamp (ms since 01/01/1970)\\r\\n ! - Windows ticks (100ns since 01/01/0001)\\r\\n '...' - literal text\\r\\n '' - single quote\\r\\n anything else - literal text\\r\\nthe format must be in parenthesis ()"
|
455 |
+
),
|
456 |
+
array(
|
457 |
+
"type" => "time",
|
458 |
+
"type_description" => "Time",
|
459 |
+
//label properties
|
460 |
+
"label" => "",
|
461 |
+
"label_label" => "Label",
|
462 |
+
"label_hint" => "enter the label that will be shown next to the field",
|
463 |
+
//checkbox properties
|
464 |
+
"required" => "show/false",
|
465 |
+
"required_hint" => "if checked, then a time must be entered before file upload",
|
466 |
+
"donotautocomplete" => "show/true",
|
467 |
+
"donotautocomplete_hint" => "if checked, then the field will not be autocompleted by browsers",
|
468 |
+
"validate" => "hide/false",
|
469 |
+
"validate_hint" => "if checked, then the field value entered by the user will be validated before file upload",
|
470 |
+
"typehook" => "hide/false",
|
471 |
+
"typehook_hint" => "if checked, then text suggestions will be shown below the field as the user types more text inside",
|
472 |
+
//dropdown properties
|
473 |
+
"labelposition" => "show/left",
|
474 |
+
"labelposition_hint" => "select the position of the field's label; the position is relative to the field",
|
475 |
+
"hintposition" => "show/right",
|
476 |
+
"hintposition_hint" => "select the position of the hint that will be shown to notify the user that something is wrong\\r\\nthe position is relative to the field",
|
477 |
+
//text properties
|
478 |
+
"default" => "show/",
|
479 |
+
"default_hint" => "enter a default time for the field or leave it empty if you do not want a default value",
|
480 |
+
"data" => "hide/",
|
481 |
+
"data_label" => "Data",
|
482 |
+
"data_hint" => "enter data items",
|
483 |
+
"group" => "hide/",
|
484 |
+
"group_hint" => "enter a group value",
|
485 |
+
"format" => "show/",
|
486 |
+
"format_hint" => "define the format of the time field as follows:\\r\\n H - hour with no leading 0 (24 hour)\\r\\n HH - hour with leading 0 (24 hour)\\r\\n h - hour with no leading 0 (12 hour)\\r\\n hh - hour with leading 0 (12 hour)\\r\\n m - minute with no leading 0\\r\\n mm - minute with leading 0\\r\\n s - second with no leading 0\\r\\n ss - second with leading 0\\r\\n l - milliseconds always with leading 0\\r\\n c - microseconds always with leading 0\\r\\n t - a or p for AM/PM\\r\\n T - A or P for AM/PM\\r\\n tt - am or pm for AM/PM\\r\\n TT - AM or PM for AM/PM\\r\\n z - timezone as defined by timezoneList\\r\\n Z - timezone in Iso 8601 format (+04:45)\\r\\n '...' - literal text\\r\\nthe format must be in parenthesis ()"
|
487 |
+
),
|
488 |
+
array(
|
489 |
+
"type" => "datetime",
|
490 |
+
"type_description" => "DateTime",
|
491 |
+
//label properties
|
492 |
+
"label" => "",
|
493 |
+
"label_label" => "Label",
|
494 |
+
"label_hint" => "enter the label that will be shown next to the field",
|
495 |
+
//checkbox properties
|
496 |
+
"required" => "show/false",
|
497 |
+
"required_hint" => "if checked, then a date and time must be entered before file upload",
|
498 |
+
"donotautocomplete" => "show/true",
|
499 |
+
"donotautocomplete_hint" => "if checked, then the field will not be autocompleted by browsers",
|
500 |
+
"validate" => "hide/false",
|
501 |
+
"validate_hint" => "if checked, then the field value entered by the user will be validated before file upload",
|
502 |
+
"typehook" => "hide/false",
|
503 |
+
"typehook_hint" => "if checked, then text suggestions will be shown below the field as the user types more text inside",
|
504 |
+
//dropdown properties
|
505 |
+
"labelposition" => "show/left",
|
506 |
+
"labelposition_hint" => "select the position of the field's label; the position is relative to the field",
|
507 |
+
"hintposition" => "show/right",
|
508 |
+
"hintposition_hint" => "select the position of the hint that will be shown to notify the user that something is wrong\\r\\nthe position is relative to the field",
|
509 |
+
//text properties
|
510 |
+
"default" => "show/",
|
511 |
+
"default_hint" => "enter a default date and time for the field or leave it empty if you do not want a default value",
|
512 |
+
"data" => "hide/",
|
513 |
+
"data_label" => "Data",
|
514 |
+
"data_hint" => "enter data items",
|
515 |
+
"group" => "hide/",
|
516 |
+
"group_hint" => "enter a group value",
|
517 |
+
"format" => "show/",
|
518 |
+
"format_hint" => "define the format of the datetime field as follows:\\r\\n date(dateformat) where dateformat is:\\r\\n d - day of month (no leading zero)\\r\\n dd - day of month (two digit)\\r\\n o - day of the year (no leading zeros)\\r\\n oo - day of the year (three digit)\\r\\n D - day name short\\r\\n DD - day name long\\r\\n m - month of year (no leading zero)\\r\\n mm - month of year (two digit)\\r\\n M - month name short\\r\\n MM - month name long\\r\\n y - year (two digit)\\r\\n yy - year (four digit)\\r\\n @ - Unix timestamp (ms since 01/01/1970)\\r\\n ! - Windows ticks (100ns since 01/01/0001)\\r\\n '...' - literal text\\r\\n '' - single quote\\r\\n anything else - literal text\\r\\n time(timeformat) where timeformat is:\\r\\n H - hour with no leading 0 (24 hour)\\r\\n HH - hour with leading 0 (24 hour)\\r\\n h - hour with no leading 0 (12 hour)\\r\\n hh - hour with leading 0 (12 hour)\\r\\n m - minute with no leading 0\\r\\n mm - minute with leading 0\\r\\n s - second with no leading 0\\r\\n ss - second with leading 0\\r\\n l - milliseconds always with leading 0\\r\\n c - microseconds always with leading 0\\r\\n t - a or p for AM/PM\\r\\n T - A or P for AM/PM\\r\\n tt - am or pm for AM/PM\\r\\n TT - AM or PM for AM/PM\\r\\n z - timezone as defined by timezoneList\\r\\n Z - timezone in Iso 8601 format (+04:45)\\r\\n '...' - literal text"
|
519 |
+
),
|
520 |
+
array(
|
521 |
+
"type" => "list",
|
522 |
+
"type_description" => "Listbox",
|
523 |
+
//label properties
|
524 |
+
"label" => "",
|
525 |
+
"label_label" => "Label",
|
526 |
+
"label_hint" => "enter the label that will be shown next to the field",
|
527 |
+
//checkbox properties
|
528 |
+
"required" => "show/false",
|
529 |
+
"required_hint" => "if checked, then a list item must be selected before file upload",
|
530 |
+
"donotautocomplete" => "show/true",
|
531 |
+
"donotautocomplete_hint" => "if checked, then the field will not be autocompleted by browsers",
|
532 |
+
"validate" => "hide/false",
|
533 |
+
"validate_hint" => "if checked, then the field value entered by the user will be validated before file upload",
|
534 |
+
"typehook" => "hide/false",
|
535 |
+
"typehook_hint" => "if checked, then text suggestions will be shown below the field as the user types more text inside",
|
536 |
+
//dropdown properties
|
537 |
+
"labelposition" => "show/left",
|
538 |
+
"labelposition_hint" => "select the position of the field's label; the position is relative to the field",
|
539 |
+
"hintposition" => "show/right",
|
540 |
+
"hintposition_hint" => "select the position of the hint that will be shown to notify the user that something is wrong\\r\\nthe position is relative to the field",
|
541 |
+
//text properties
|
542 |
+
"default" => "show/",
|
543 |
+
"default_hint" => "enter a default value for the field or leave it empty if you do not want a default value",
|
544 |
+
"data" => "show/",
|
545 |
+
"data_label" => "List Items",
|
546 |
+
"data_hint" => "enter a comma delimited list of items",
|
547 |
+
"group" => "hide/",
|
548 |
+
"group_hint" => "all items having the same group id belong to the same group",
|
549 |
+
"format" => "hide/",
|
550 |
+
"format_hint" => "enter the format of the list"
|
551 |
+
),
|
552 |
+
array(
|
553 |
+
"type" => "dropdown",
|
554 |
+
"type_description" => "Dropdown",
|
555 |
+
//label properties
|
556 |
+
"label" => "",
|
557 |
+
"label_label" => "Label",
|
558 |
+
"label_hint" => "enter the label that will be shown next to the field",
|
559 |
+
//checkbox properties
|
560 |
+
"required" => "show/false",
|
561 |
+
"required_hint" => "if checked, then an item from the dropdown list must be selected before file upload",
|
562 |
+
"donotautocomplete" => "show/true",
|
563 |
+
"donotautocomplete_hint" => "if checked, then the field will not be autocompleted by browsers",
|
564 |
+
"validate" => "hide/false",
|
565 |
+
"validate_hint" => "if checked, then the field value entered by the user will be validated before file upload",
|
566 |
+
"typehook" => "hide/false",
|
567 |
+
"typehook_hint" => "if checked, then text suggestions will be shown below the field as the user types more text inside",
|
568 |
+
//dropdown properties
|
569 |
+
"labelposition" => "show/left",
|
570 |
+
"labelposition_hint" => "select the position of the field's label; the position is relative to the field",
|
571 |
+
"hintposition" => "show/right",
|
572 |
+
"hintposition_hint" => "select the position of the hint that will be shown to notify the user that something is wrong\\r\\nthe position is relative to the field",
|
573 |
+
//text properties
|
574 |
+
"default" => "show/",
|
575 |
+
"default_hint" => "enter a default value for the field or leave it empty if you do not want a default value",
|
576 |
+
"data" => "show/",
|
577 |
+
"data_label" => "List Items",
|
578 |
+
"data_hint" => "enter a comma delimited list of items",
|
579 |
+
"group" => "hide/",
|
580 |
+
"group_hint" => "all items having the same group id belong to the same group",
|
581 |
+
"format" => "hide/",
|
582 |
+
"format_hint" => "enter the format of the list"
|
583 |
+
),
|
584 |
+
array(
|
585 |
+
"type" => "honeypot",
|
586 |
+
"type_description" => "Hidden Honeypot",
|
587 |
+
//label properties
|
588 |
+
"label" => "website",
|
589 |
+
"label_label" => "Name",
|
590 |
+
"label_hint" => "enter the name of the honeypot field; it must be a value that bots can easily recognize, like \'website\' or \'URL\'",
|
591 |
+
//checkbox properties
|
592 |
+
"required" => "hide/false",
|
593 |
+
"required_hint" => "if checked, then this field must have a non-empty value for the file to be uploaded",
|
594 |
+
"donotautocomplete" => "hide/true",
|
595 |
+
"donotautocomplete_hint" => "if checked, then the field will notify the browsers not to fill it with autocomplete data when the plugin is reloaded",
|
596 |
+
"validate" => "hide/false",
|
597 |
+
"validate_hint" => "if checked, then the field value entered by the user will be validated before file upload",
|
598 |
+
"typehook" => "hide/false",
|
599 |
+
"typehook_hint" => "if checked, then text suggestions will be shown below the field as the user types more text inside",
|
600 |
+
//dropdown properties
|
601 |
+
"labelposition" => "hide/none",
|
602 |
+
"labelposition_hint" => "select the position of the field's label; the position is relative to the field",
|
603 |
+
"hintposition" => "hide/none",
|
604 |
+
"hintposition_hint" => "select the position of the hint that will be shown to notify the user that something is wrong\\r\\nthe position is relative to the field",
|
605 |
+
//text properties
|
606 |
+
"default" => "hide/",
|
607 |
+
"default_hint" => "enter a default value for the field or leave it empty if you do not want a default value",
|
608 |
+
"data" => "hide/",
|
609 |
+
"data_label" => "Data",
|
610 |
+
"data_hint" => "complete a list of values to be shown to the user",
|
611 |
+
"group" => "hide/",
|
612 |
+
"group_hint" => "if a value is set, then all fields having the same value will belong to the same group",
|
613 |
+
"format" => "hide/",
|
614 |
+
"format_hint" => "enter a format to format user selection"
|
615 |
+
)
|
616 |
+
);
|
617 |
+
|
618 |
+
return $formfields;
|
619 |
+
}
|
620 |
+
|
621 |
+
function wfu_attribute_definitions() {
|
622 |
+
$defs = array(
|
623 |
+
array(
|
624 |
+
"name" => "Widget ID",
|
625 |
+
"attribute" => "widgetid",
|
626 |
+
"type" => "hidden",
|
627 |
+
"validator" => "text",
|
628 |
+
"listitems" => null,
|
629 |
+
"value" => "",
|
630 |
+
"mode" => "free",
|
631 |
+
"category" => "",
|
632 |
+
"subcategory" => "Basic ",
|
633 |
+
"parent" => "",
|
634 |
+
"dependencies" => null,
|
635 |
+
"variables" => null,
|
636 |
+
"help" => ""
|
637 |
+
),
|
638 |
+
array(
|
639 |
+
"name" => "Plugin ID",
|
640 |
+
"attribute" => "uploadid",
|
641 |
+
"type" => "integer",
|
642 |
+
"validator" => "text",
|
643 |
+
"listitems" => null,
|
644 |
+
"value" => WFU_VAR("WFU_UPLOADID"),
|
645 |
+
"mode" => "free",
|
646 |
+
"category" => "general",
|
647 |
+
"subcategory" => "Basic Functionalities",
|
648 |
+
"parent" => "",
|
649 |
+
"dependencies" => null,
|
650 |
+
"variables" => null,
|
651 |
+
"help" => "The unique id of each shortcode. When you have many shortcodes of this plugin in the same page, then you must use different id for each one."
|
652 |
+
),
|
653 |
+
array(
|
654 |
+
"name" => "Single Button Operation",
|
655 |
+
"attribute" => "singlebutton",
|
656 |
+
"type" => "onoff",
|
657 |
+
"validator" => "text",
|
658 |
+
"listitems" => null,
|
659 |
+
"value" => WFU_VAR("WFU_SINGLEBUTTON"),
|
660 |
+
"mode" => "free",
|
661 |
+
"category" => "general",
|
662 |
+
"subcategory" => "Basic Functionalities",
|
663 |
+
"parent" => "",
|
664 |
+
"dependencies" => array("!uploadbutton"),
|
665 |
+
"variables" => null,
|
666 |
+
"help" => "When it is activated, no Upload button will be shown, but upload will start automatically as soon as files are selected."
|
667 |
+
),
|
668 |
+
array(
|
669 |
+
"name" => "Upload Path",
|
670 |
+
"attribute" => "uploadpath",
|
671 |
+
"type" => "ltext",
|
672 |
+
"validator" => "path",
|
673 |
+
"listitems" => null,
|
674 |
+
"value" => WFU_VAR("WFU_UPLOADPATH"),
|
675 |
+
"mode" => "free",
|
676 |
+
"category" => "general",
|
677 |
+
"subcategory" => "Basic Functionalities",
|
678 |
+
"parent" => "",
|
679 |
+
"dependencies" => null,
|
680 |
+
"variables" => array("%userid%", "%username%", "%blogid%", "%pageid%", "%pagetitle%", "%userdataXXX%"),
|
681 |
+
"help" => "This is the folder where the files will be uploaded. The path is relative to wp-contents folder of your Wordpress website. The path can be dynamic by including variables such as %username% or %blogid%. Please check Documentation on how to use variables inside uploadpath."
|
682 |
+
),
|
683 |
+
array(
|
684 |
+
"name" => "Plugin Fit Mode",
|
685 |
+
"attribute" => "fitmode",
|
686 |
+
"type" => "radio",
|
687 |
+
"validator" => "text",
|
688 |
+
"listitems" => array("fixed", "responsive"),
|
689 |
+
"value" => WFU_VAR("WFU_FITMODE"),
|
690 |
+
"mode" => "free",
|
691 |
+
"category" => "general",
|
692 |
+
"subcategory" => "Basic Functionalities",
|
693 |
+
"parent" => "",
|
694 |
+
"dependencies" => null,
|
695 |
+
"variables" => null,
|
696 |
+
"help" => "This defines how the plugin's elements will fit inside the page/post. If it is set to fixed, then the plugin's element positions will remain fixed no matter the width of the container page/post. If it is set to responsive, then the plugin's elements will wrap to fit the width of the container page/post."
|
697 |
+
),
|
698 |
+
array(
|
699 |
+
"name" => "Allow No File",
|
700 |
+
"attribute" => "allownofile",
|
701 |
+
"type" => "onoff",
|
702 |
+
"validator" => "text",
|
703 |
+
"listitems" => null,
|
704 |
+
"value" => WFU_VAR("WFU_ALLOWNOFILE"),
|
705 |
+
"mode" => "free",
|
706 |
+
"category" => "general",
|
707 |
+
"subcategory" => "Basic Functionalities",
|
708 |
+
"parent" => "",
|
709 |
+
"dependencies" => null,
|
710 |
+
"variables" => null,
|
711 |
+
"help" => "When it is activated a user can submit the upload form even if a file is not selected."
|
712 |
+
),
|
713 |
+
array(
|
714 |
+
"name" => "Reset Form Mode",
|
715 |
+
"attribute" => "resetmode",
|
716 |
+
"type" => "radio",
|
717 |
+
"validator" => "text",
|
718 |
+
"listitems" => array("always", "onsuccess", "never"),
|
719 |
+
"value" => WFU_VAR("WFU_RESETMODE"),
|
720 |
+
"mode" => "free",
|
721 |
+
"category" => "general",
|
722 |
+
"subcategory" => "Basic Functionalities",
|
723 |
+
"parent" => "",
|
724 |
+
"dependencies" => null,
|
725 |
+
"variables" => null,
|
726 |
+
"help" => "It defines whether the form will be reset after upload; 'always' means that it will be reset in any case, 'onsuccess' means that it will be reset only if upload was successful, 'never' means that it will never be reset."
|
727 |
+
),
|
728 |
+
array(
|
729 |
+
"name" => "Upload Roles",
|
730 |
+
"attribute" => "uploadrole",
|
731 |
+
"type" => "rolelist",
|
732 |
+
"validator" => "text",
|
733 |
+
"listitems" => array("default_administrator"),
|
734 |
+
"value" => WFU_VAR("WFU_UPLOADROLE"),
|
735 |
+
"mode" => "free",
|
736 |
+
"category" => "general",
|
737 |
+
"subcategory" => "Filters",
|
738 |
+
"parent" => "",
|
739 |
+
"dependencies" => null,
|
740 |
+
"variables" => null,
|
741 |
+
"help" => "Defines the categories (roles) of users allowed to upload files. Multiple selections can be made. If 'Select All' is checked, then all logged users can upload files. If 'Include Guests' is checked, then guests (not logged users) can also upload files. Default value is 'all,guests'."
|
742 |
+
),
|
743 |
+
array(
|
744 |
+
"name" => "Allowed File Extensions",
|
745 |
+
"attribute" => "uploadpatterns",
|
746 |
+
"type" => "text",
|
747 |
+
"validator" => "text",
|
748 |
+
"listitems" => null,
|
749 |
+
"value" => WFU_VAR("WFU_UPLOADPATTERNS"),
|
750 |
+
"mode" => "free",
|
751 |
+
"category" => "general",
|
752 |
+
"subcategory" => "Filters",
|
753 |
+
"parent" => "",
|
754 |
+
"dependencies" => null,
|
755 |
+
"variables" => null,
|
756 |
+
"help" => "Defines the allowed file extensions. Multiple extentions can be defined, separated with comma (,)."
|
757 |
+
),
|
758 |
+
array(
|
759 |
+
"name" => "Allowed File Size",
|
760 |
+
"attribute" => "maxsize",
|
761 |
+
"type" => "float",
|
762 |
+
"validator" => "float",
|
763 |
+
"listitems" => null,
|
764 |
+
"value" => WFU_VAR("WFU_MAXSIZE"),
|
765 |
+
"mode" => "free",
|
766 |
+
"category" => "general",
|
767 |
+
"subcategory" => "Filters",
|
768 |
+
"parent" => "",
|
769 |
+
"dependencies" => null,
|
770 |
+
"variables" => null,
|
771 |
+
"help" => "Defines the allowed file size in MBytes. Files larger than maxsize will not be uploaded. Floating point numbers can be used (e.g. '2.5')."
|
772 |
+
),
|
773 |
+
array(
|
774 |
+
"name" => "Create Upload Path",
|
775 |
+
"attribute" => "createpath",
|
776 |
+
"type" => "onoff",
|
777 |
+
"validator" => "text",
|
778 |
+
"listitems" => null,
|
779 |
+
"value" => WFU_VAR("WFU_CREATEPATH"),
|
780 |
+
"mode" => "free",
|
781 |
+
"category" => "general",
|
782 |
+
"subcategory" => "Upload Path and Files",
|
783 |
+
"parent" => "",
|
784 |
+
"dependencies" => null,
|
785 |
+
"variables" => null,
|
786 |
+
"help" => "If activated then the plugin will attempt to create the upload path, if it does not exist."
|
787 |
+
),
|
788 |
+
array(
|
789 |
+
"name" => "Do Not Change Filename",
|
790 |
+
"attribute" => "forcefilename",
|
791 |
+
"type" => "onoff",
|
792 |
+
"validator" => "text",
|
793 |
+
"listitems" => null,
|
794 |
+
"value" => WFU_VAR("WFU_FORCEFILENAME"),
|
795 |
+
"mode" => "free",
|
796 |
+
"category" => "general",
|
797 |
+
"subcategory" => "Upload Path and Files",
|
798 |
+
"parent" => "",
|
799 |
+
"dependencies" => null,
|
800 |
+
"variables" => null,
|
801 |
+
"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."
|
802 |
+
),
|
803 |
+
array(
|
804 |
+
"name" => "Folder Access Method",
|
805 |
+
"attribute" => "accessmethod",
|
806 |
+
"type" => "radio",
|
807 |
+
"validator" => "text",
|
808 |
+
"listitems" => array("normal", "*ftp"),
|
809 |
+
"value" => WFU_VAR("WFU_ACCESSMETHOD"),
|
810 |
+
"mode" => "free",
|
811 |
+
"category" => "general",
|
812 |
+
"subcategory" => "Upload Path and Files",
|
813 |
+
"parent" => "",
|
814 |
+
"dependencies" => array("ftpinfo", "userftpdomain", "ftppassivemode", "ftpfilepermissions"),
|
815 |
+
"variables" => null,
|
816 |
+
"help" => "Some times files cannot be uploaded to the upload folder because of read/write permissions. A workaround is to use ftp to transfer the files, however ftp credentials must be declared, so use carefully and only if necessary."
|
817 |
+
),
|
818 |
+
array(
|
819 |
+
"name" => "FTP Access Credentials",
|
820 |
+
"attribute" => "ftpinfo",
|
821 |
+
"type" => "ltext",
|
822 |
+
"validator" => "text",
|
823 |
+
"listitems" => null,
|
824 |
+
"value" => WFU_VAR("WFU_FTPINFO"),
|
825 |
+
"mode" => "free",
|
826 |
+
"category" => "general",
|
827 |
+
"subcategory" => "Upload Path and Files",
|
828 |
+
"parent" => "accessmethod",
|
829 |
+
"dependencies" => null,
|
830 |
+
"variables" => null,
|
831 |
+
"help" => "If FTP access method is selected, then FTP credentials must be declared here, in the form username:password@ftpdomain:port, e.g. myusername:mypass@ftpdomain.com:80. Port can be ommitted. The user can use Secure FTP (sftp) by putting the prefix 's' before the port number, e.g. myusername:mypass@ftpdomain.com:s22."
|
832 |
+
),
|
833 |
+
array(
|
834 |
+
"name" => "Use FTP Domain",
|
835 |
+
"attribute" => "useftpdomain",
|
836 |
+
"type" => "onoff",
|
837 |
+
"validator" => "text",
|
838 |
+
"listitems" => null,
|
839 |
+
"value" => WFU_VAR("WFU_USEFTPDOMAIN"),
|
840 |
+
"mode" => "free",
|
841 |
+
"category" => "general",
|
842 |
+
"subcategory" => "Upload Path and Files",
|
843 |
+
"parent" => "accessmethod",
|
844 |
+
"dependencies" => null,
|
845 |
+
"variables" => null,
|
846 |
+
"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."
|
847 |
+
),
|
848 |
+
array(
|
849 |
+
"name" => "FTP Passive Mode",
|
850 |
+
"attribute" => "ftppassivemode",
|
851 |
+
"type" => "onoff",
|
852 |
+
"validator" => "text",
|
853 |
+
"listitems" => null,
|
854 |
+
"value" => WFU_VAR("WFU_FTPPASSIVEMODE"),
|
855 |
+
"mode" => "free",
|
856 |
+
"category" => "general",
|
857 |
+
"subcategory" => "Upload Path and Files",
|
858 |
+
"parent" => "accessmethod",
|
859 |
+
"dependencies" => null,
|
860 |
+
"variables" => null,
|
861 |
+
"help" => "If files fail to upload to the ftp domain then switching to passive FTP mode may solve the problem."
|
862 |
+
),
|
863 |
+
array(
|
864 |
+
"name" => "Permissions of Uploaded File",
|
865 |
+
"attribute" => "ftpfilepermissions",
|
866 |
+
"type" => "text",
|
867 |
+
"validator" => "integer",
|
868 |
+
"listitems" => null,
|
869 |
+
"value" => WFU_VAR("WFU_FTPFILEPERMISSIONS"),
|
870 |
+
"mode" => "free",
|
871 |
+
"category" => "general",
|
872 |
+
"subcategory" => "Upload Path and Files",
|
873 |
+
"parent" => "accessmethod",
|
874 |
+
"dependencies" => null,
|
875 |
+
"variables" => null,
|
876 |
+
"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."
|
877 |
+
),
|
878 |
+
array(
|
879 |
+
"name" => "Show Upload Folder Path",
|
880 |
+
"attribute" => "showtargetfolder",
|
881 |
+
"type" => "onoff",
|
882 |
+
"validator" => "text",
|
883 |
+
"listitems" => null,
|
884 |
+
"value" => WFU_VAR("WFU_SHOWTARGETFOLDER"),
|
885 |
+
"mode" => "free",
|
886 |
+
"category" => "general",
|
887 |
+
"subcategory" => "Upload Path and Files",
|
888 |
+
"parent" => "",
|
889 |
+
"dependencies" => array("targetfolderlabel"),
|
890 |
+
"variables" => null,
|
891 |
+
"help" => "It defines if a label with the upload directory will be shown."
|
892 |
+
),
|
893 |
+
array(
|
894 |
+
"name" => "Select Subfolder",
|
895 |
+
"attribute" => "askforsubfolders",
|
896 |
+
"type" => "onoff",
|
897 |
+
"validator" => "text",
|
898 |
+
"listitems" => null,
|
899 |
+
"value" => WFU_VAR("WFU_ASKFORSUBFOLDERS"),
|
900 |
+
"mode" => "free",
|
901 |
+
"category" => "general",
|
902 |
+
"subcategory" => "Upload Path and Files",
|
903 |
+
"parent" => "",
|
904 |
+
"dependencies" => array("subfoldertree", "subfolderlabel"),
|
905 |
+
"variables" => null,
|
906 |
+
"help" => "If enabled then user can select the upload folder from a drop down list. The list is defined in subfoldertree attribute. The folder paths are relative to the path defined in uploadpath."
|
907 |
+
),
|
908 |
+
array(
|
909 |
+
"name" => "List of Subfolders",
|
910 |
+
"attribute" => "subfoldertree",
|
911 |
+
"type" => "folderlist",
|
912 |
+
"validator" => "text",
|
913 |
+
"listitems" => null,
|
914 |
+
"value" => WFU_VAR("WFU_SUBFOLDERTREE"),
|
915 |
+
"mode" => "free",
|
916 |
+
"category" => "general",
|
917 |
+
"subcategory" => "Upload Path and Files",
|
918 |
+
"parent" => "askforsubfolders",
|
919 |
+
"dependencies" => null,
|
920 |
+
"variables" => null,
|
921 |
+
"help" => "The list of folders a user can select. Please see documentation on how to create the list of folders. If 'Auto-populate list' is selected, then the list will be filled automatically with the first-level subfolders inside the directory defined by uploadpath. If 'List is editable' is selected, then the user will have the capability to type the subfolder and filter the subfolder list and/or define a new subfolder."
|
922 |
+
),
|
923 |
+
array(
|
924 |
+
"name" => "File Duplicates Policy",
|
925 |
+
"attribute" => "duplicatespolicy",
|
926 |
+
"type" => "radio",
|
927 |
+
"validator" => "text",
|
928 |
+
"listitems" => array("overwrite", "reject", "*maintain both"),
|
929 |
+
"value" => WFU_VAR("WFU_DUBLICATESPOLICY"),
|
930 |
+
"mode" => "free",
|
931 |
+
"category" => "general",
|
932 |
+
"subcategory" => "Upload Path and Files",
|
933 |
+
"parent" => "",
|
934 |
+
"dependencies" => array("uniquepattern"),
|
935 |
+
"variables" => null,
|
936 |
+
"help" => "It determines what happens when an uploaded file has the same name with an existing file. The uploaded file can overwrite the existing one, be rejected or both can be kept by renaming the uploaded file according to a rule defined in uniquepattern attribute."
|
937 |
+
),
|
938 |
+
array(
|
939 |
+
"name" => "File Rename Rule",
|
940 |
+
"attribute" => "uniquepattern",
|
941 |
+
"type" => "radio",
|
942 |
+
"validator" => "text",
|
943 |
+
"listitems" => array("index", "datetimestamp"),
|
944 |
+
"value" => WFU_VAR("WFU_UNIQUEPATTERN"),
|
945 |
+
"mode" => "free",
|
946 |
+
"category" => "general",
|
947 |
+
"subcategory" => "Upload Path and Files",
|
948 |
+
"parent" => "duplicatespolicy",
|
949 |
+
"dependencies" => null,
|
950 |
+
"variables" => null,
|
951 |
+
"help" => "If duplicatespolicy is set to 'maintain both', then this rule defines how the uploaded file will be renamed, in order not to match an existing file. An incremental index number or a datetime stamp can be included in the uploaded file name to make it unique."
|
952 |
+
),
|
953 |
+
array(
|
954 |
+
"name" => "Redirect after Upload",
|
955 |
+
"attribute" => "redirect",
|
956 |
+
"type" => "onoff",
|
957 |
+
"validator" => "text",
|
958 |
+
"listitems" => null,
|
959 |
+
"value" => WFU_VAR("WFU_REDIRECT"),
|
960 |
+
"mode" => "free",
|
961 |
+
"category" => "general",
|
962 |
+
"subcategory" => "Redirection",
|
963 |
+
"parent" => "",
|
964 |
+
"dependencies" => array("redirectlink"),
|
965 |
+
"variables" => null,
|
966 |
+
"help" => "If enabled, the user will be redirected to a url defined in redirectlink attribute upon successful upload of all the files."
|
967 |
+
),
|
968 |
+
array(
|
969 |
+
"name" => "Redirection URL",
|
970 |
+
"attribute" => "redirectlink",
|
971 |
+
"type" => "ltext",
|
972 |
+
"validator" => "link",
|
973 |
+
"listitems" => null,
|
974 |
+
"value" => WFU_VAR("WFU_REDIRECTLINK"),
|
975 |
+
"mode" => "free",
|
976 |
+
"category" => "general",
|
977 |
+
"subcategory" => "Redirection",
|
978 |
+
"parent" => "redirect",
|
979 |
+
"dependencies" => null,
|
980 |
+
"variables" => array("%filename%", "%username%"),
|
981 |
+
"help" => "This is the redirect URL. The URL can be dynamic by using variables. Please see Documentation on how to use variables inside attributes."
|
982 |
+
),
|
983 |
+
array(
|
984 |
+
"name" => "Show Detailed Admin Messages",
|
985 |
+
"attribute" => "adminmessages",
|
986 |
+
"type" => "onoff",
|
987 |
+
"validator" => "text",
|
988 |
+
"listitems" => null,
|
989 |
+
"value" => WFU_VAR("WFU_ADMINMESSAGES"),
|
990 |
+
"mode" => "free",
|
991 |
+
"category" => "general",
|
992 |
+
"subcategory" => "Other Administrator Options",
|
993 |
+
"parent" => "",
|
994 |
+
"dependencies" => null,
|
995 |
+
"variables" => null,
|
996 |
+
"help" => "If enabled then more detailed messages about upload operations will be shown to administrators for debugging or error detection."
|
997 |
+
),
|
998 |
+
array(
|
999 |
+
"name" => "Disable AJAX",
|
1000 |
+
"attribute" => "forceclassic",
|
1001 |
+
"type" => "onoff",
|
1002 |
+
"validator" => "text",
|
1003 |
+
"listitems" => null,
|
1004 |
+
"value" => WFU_VAR("WFU_FORCECLASSIC"),
|
1005 |
+
"mode" => "free",
|
1006 |
+
"category" => "general",
|
1007 |
+
"subcategory" => "Other Administrator Options",
|
1008 |
+
"parent" => "",
|
1009 |
+
"dependencies" => null,
|
1010 |
+
"variables" => null,
|
1011 |
+
"help" => "If AJAX is disabled, then upload of files will be performed using HTML forms, meaning that page will refresh to complete the upload. Use it in case that AJAX is causing problems with your page (although the plugin has an auto-detection feature for checking if user's browser supports AJAX or not)."
|
1012 |
+
),
|
1013 |
+
array(
|
1014 |
+
"name" => "Test Mode",
|
1015 |
+
"attribute" => "testmode",
|
1016 |
+
"type" => "onoff",
|
1017 |
+
"validator" => "text",
|
1018 |
+
"listitems" => null,
|
1019 |
+
"value" => WFU_VAR("WFU_TESTMODE"),
|
1020 |
+
"mode" => "free",
|
1021 |
+
"category" => "general",
|
1022 |
+
"subcategory" => "Other Administrator Options",
|
1023 |
+
"parent" => "",
|
1024 |
+
"dependencies" => null,
|
1025 |
+
"variables" => null,
|
1026 |
+
"help" => "If enabled then the plugin will be shown in test mode, meaning that all selected features will be shown but no upload will be possible. Use it to review how the plugin looks like and style it according to your needs."
|
1027 |
+
),
|
1028 |
+
array(
|
1029 |
+
"name" => "Debug Mode",
|
1030 |
+
"attribute" => "debugmode",
|
1031 |
+
"type" => "onoff",
|
1032 |
+
"validator" => "text",
|
1033 |
+
"listitems" => null,
|
1034 |
+
"value" => WFU_VAR("WFU_DEBUGMODE"),
|
1035 |
+
"mode" => "free",
|
1036 |
+
"category" => "general",
|
1037 |
+
"subcategory" => "Other Administrator Options",
|
1038 |
+
"parent" => "",
|
1039 |
+
"dependencies" => null,
|
1040 |
+
"variables" => null,
|
1041 |
+
"help" => "If enabled then the plugin will show to administrators any internal PHP warnings and errors generated during the upload process inside the message box."
|
1042 |
+
),
|
1043 |
+
array(
|
1044 |
+
"name" => "Plugin Component Positions",
|
1045 |
+
"attribute" => "placements",
|
1046 |
+
"type" => "placements",
|
1047 |
+
"validator" => "text",
|
1048 |
+
"listitems" => null,
|
1049 |
+
"value" => WFU_VAR("WFU_PLACEMENTS"),
|
1050 |
+
"mode" => "free",
|
1051 |
+
"category" => "placements",
|
1052 |
+
"subcategory" => "Plugin Component Positions",
|
1053 |
+
"parent" => "",
|
1054 |
+
"dependencies" => null,
|
1055 |
+
"variables" => null,
|
1056 |
+
"help" => "It defines the positions of the selected plugin components. Drag the components from the right pane and drop them to the left one to define your own component positions."
|
1057 |
+
),
|
1058 |
+
array(
|
1059 |
+
"name" => "Plugin Title",
|
1060 |
+
"attribute" => "uploadtitle",
|
1061 |
+
"type" => "text",
|
1062 |
+
"validator" => "text",
|
1063 |
+
"listitems" => null,
|
1064 |
+
"value" => WFU_UPLOADTITLE,
|
1065 |
+
"mode" => "free",
|
1066 |
+
"category" => "labels",
|
1067 |
+
"subcategory" => "Title",
|
1068 |
+
"parent" => "",
|
1069 |
+
"dependencies" => null,
|
1070 |
+
"variables" => null,
|
1071 |
+
"help" => "A text representing the title of the plugin."
|
1072 |
+
),
|
1073 |
+
array(
|
1074 |
+
"name" => "Select Button Caption",
|
1075 |
+
"attribute" => "selectbutton",
|
1076 |
+
"type" => "text",
|
1077 |
+
"validator" => "text",
|
1078 |
+
"listitems" => null,
|
1079 |
+
"value" => WFU_SELECTBUTTON,
|
1080 |
+
"mode" => "free",
|
1081 |
+
"category" => "labels",
|
1082 |
+
"subcategory" => "Buttons",
|
1083 |
+
"parent" => "",
|
1084 |
+
"dependencies" => null,
|
1085 |
+
"variables" => null,
|
1086 |
+
"help" => "The caption of the button that selects the files for upload."
|
1087 |
+
),
|
1088 |
+
array(
|
1089 |
+
"name" => "Upload Button Caption",
|
1090 |
+
"attribute" => "uploadbutton",
|
1091 |
+
"type" => "text",
|
1092 |
+
"validator" => "text",
|
1093 |
+
"listitems" => null,
|
1094 |
+
"value" => WFU_UPLOADBUTTON,
|
1095 |
+
"mode" => "free",
|
1096 |
+
"category" => "labels",
|
1097 |
+
"subcategory" => "Buttons",
|
1098 |
+
"parent" => "",
|
1099 |
+
"dependencies" => null,
|
1100 |
+
"variables" => null,
|
1101 |
+
"help" => "The caption of the button that starts the upload."
|
1102 |
+
),
|
1103 |
+
array(
|
1104 |
+
"name" => "Upload Folder Label",
|
1105 |
+
"attribute" => "targetfolderlabel",
|
1106 |
+
"type" => "text",
|
1107 |
+
"validator" => "text",
|
1108 |
+
"listitems" => null,
|
1109 |
+
"value" => WFU_VAR("WFU_TARGETFOLDERLABEL"),
|
1110 |
+
"mode" => "free",
|
1111 |
+
"category" => "labels",
|
1112 |
+
"subcategory" => "Upload Folder",
|
1113 |
+
"parent" => "",
|
1114 |
+
"dependencies" => null,
|
1115 |
+
"variables" => null,
|
1116 |
+
"help" => "This is the label before the upload folder path, if the path is selected to be shown using the showtargetfolder attribute."
|
1117 |
+
),
|
1118 |
+
array(
|
1119 |
+
"name" => "Select Subfolder Label",
|
1120 |
+
"attribute" => "subfolderlabel",
|
1121 |
+
"type" => "text",
|
1122 |
+
"validator" => "text",
|
1123 |
+
"listitems" => null,
|
1124 |
+
"value" => WFU_VAR("WFU_SUBFOLDERLABEL"),
|
1125 |
+
"mode" => "free",
|
1126 |
+
"category" => "labels",
|
1127 |
+
"subcategory" => "Upload Folder",
|
1128 |
+
"parent" => "",
|
1129 |
+
"dependencies" => null,
|
1130 |
+
"variables" => null,
|
1131 |
+
"help" => "This is the label of the subfolder dropdown list. It is active when askforsubfolders attribute is on."
|
1132 |
+
),
|
1133 |
+
array(
|
1134 |
+
"name" => "Success Upload Message",
|
1135 |
+
"attribute" => "successmessage",
|
1136 |
+
"type" => "ltext",
|
1137 |
+
"validator" => "text",
|
1138 |
+
"listitems" => null,
|
1139 |
+
"value" => WFU_SUCCESSMESSAGE,
|
1140 |
+
"mode" => "free",
|
1141 |
+
"category" => "labels",
|
1142 |
+
"subcategory" => "Upload Messages",
|
1143 |
+
"parent" => "",
|
1144 |
+
"dependencies" => null,
|
1145 |
+
"variables" => array("%filename%", "%filepath%"),
|
1146 |
+
"help" => "This is the message that will be shown for every file that has been uploaded successfully."
|
1147 |
+
),
|
1148 |
+
array(
|
1149 |
+
"name" => "Warning Upload Message",
|
1150 |
+
"attribute" => "warningmessage",
|
1151 |
+
"type" => "ltext",
|
1152 |
+
"validator" => "text",
|
1153 |
+
"listitems" => null,
|
1154 |
+
"value" => WFU_WARNINGMESSAGE,
|
1155 |
+
"mode" => "free",
|
1156 |
+
"category" => "labels",
|
1157 |
+
"subcategory" => "Upload Messages",
|
1158 |
+
"parent" => "",
|
1159 |
+
"dependencies" => null,
|
1160 |
+
"variables" => array("%filename%", "%filepath%"),
|
1161 |
+
"help" => "This is the message that will be shown for every file that has been uploaded with warnings."
|
1162 |
+
),
|
1163 |
+
array(
|
1164 |
+
"name" => "Error Upload Message",
|
1165 |
+
"attribute" => "errormessage",
|
1166 |
+
"type" => "ltext",
|
1167 |
+
"validator" => "text",
|
1168 |
+
"listitems" => null,
|
1169 |
+
"value" => WFU_ERRORMESSAGE,
|
1170 |
+
"mode" => "free",
|
1171 |
+
"category" => "labels",
|
1172 |
+
"subcategory" => "Upload Messages",
|
1173 |
+
"parent" => "",
|
1174 |
+
"dependencies" => null,
|
1175 |
+
"variables" => array("%filename%", "%filepath%"),
|
1176 |
+
"help" => "This is the message that will be shown for every file that has failed to upload."
|
1177 |
+
),
|
1178 |
+
array(
|
1179 |
+
"name" => "Wait Upload Message",
|
1180 |
+
"attribute" => "waitmessage",
|
1181 |
+
"type" => "ltext",
|
1182 |
+
"validator" => "text",
|
1183 |
+
"listitems" => null,
|
1184 |
+
"value" => WFU_WAITMESSAGE,
|
1185 |
+
"mode" => "free",
|
1186 |
+
"category" => "labels",
|
1187 |
+
"subcategory" => "Upload Messages",
|
1188 |
+
"parent" => "",
|
1189 |
+
"dependencies" => null,
|
1190 |
+
"variables" => array("%filename%", "%filepath%"),
|
1191 |
+
"help" => "This is the message that will be shown while file is uploading."
|
1192 |
+
),
|
1193 |
+
array(
|
1194 |
+
"name" => "Upload Media Button Caption",
|
1195 |
+
"attribute" => "uploadmediabutton",
|
1196 |
+
"type" => "text",
|
1197 |
+
"validator" => "text",
|
1198 |
+
"listitems" => null,
|
1199 |
+
"value" => WFU_UPLOADMEDIABUTTON,
|
1200 |
+
"mode" => "free",
|
1201 |
+
"category" => "labels",
|
1202 |
+
"subcategory" => "Webcam Labels",
|
1203 |
+
"parent" => "",
|
1204 |
+
"dependencies" => null,
|
1205 |
+
"variables" => null,
|
1206 |
+
"help" => "The caption of the button that starts the upload when media capture from the webcam has been activated."
|
1207 |
+
),
|
1208 |
+
array(
|
1209 |
+
"name" => "Video Filename",
|
1210 |
+
"attribute" => "videoname",
|
1211 |
+
"type" => "text",
|
1212 |
+
"validator" => "text",
|
1213 |
+
"listitems" => null,
|
1214 |
+
"value" => WFU_VIDEONAME,
|
1215 |
+
"mode" => "free",
|
1216 |
+
"category" => "labels",
|
1217 |
+
"subcategory" => "Webcam Labels",
|
1218 |
+
"parent" => "",
|
1219 |
+
"dependencies" => null,
|
1220 |
+
"variables" => array("%userid%", "%username%", "%blogid%", "%pageid%", "%pagetitle%", "%userdataXXX%"),
|
1221 |
+
"help" => "This is the file name of the captured video file."
|
1222 |
+
),
|
1223 |
+
array(
|
1224 |
+
"name" => "Image Filename",
|
1225 |
+
"attribute" => "imagename",
|
1226 |
+
"type" => "text",
|
1227 |
+
"validator" => "text",
|
1228 |
+
"listitems" => null,
|
1229 |
+
"value" => WFU_IMAGENAME,
|
1230 |
+
"mode" => "free",
|
1231 |
+
"category" => "labels",
|
1232 |
+
"subcategory" => "Webcam Labels",
|
1233 |
+
"parent" => "",
|
1234 |
+
"dependencies" => null,
|
1235 |
+
"variables" => array("%userid%", "%username%", "%blogid%", "%pageid%", "%pagetitle%", "%userdataXXX%"),
|
1236 |
+
"help" => "This is the file name of the captured image file."
|
1237 |
+
),
|
1238 |
+
array(
|
1239 |
+
"name" => "Required Fields Suffix",
|
1240 |
+
"attribute" => "requiredlabel",
|
1241 |
+
"type" => "text",
|
1242 |
+
"validator" => "text",
|
1243 |
+
"listitems" => null,
|
1244 |
+
"value" => WFU_USERDATA_REQUIREDLABEL,
|
1245 |
+
"mode" => "free",
|
1246 |
+
"category" => "labels",
|
1247 |
+
"subcategory" => "Other Labels",
|
1248 |
+
"parent" => "",
|
1249 |
+
"dependencies" => null,
|
1250 |
+
"variables" => null,
|
1251 |
+
"help" => "This is the keyword that shows up next to user field labels in order to denote that they are required."
|
1252 |
+
),
|
1253 |
+
array(
|
1254 |
+
"name" => "Notify by Email",
|
1255 |
+
"attribute" => "notify",
|
1256 |
+
"type" => "onoff",
|
1257 |
+
"validator" => "text",
|
1258 |
+
"listitems" => null,
|
1259 |
+
"value" => WFU_VAR("WFU_NOTIFY"),
|
1260 |
+
"mode" => "free",
|
1261 |
+
"category" => "notifications",
|
1262 |
+
"subcategory" => "Email Notifications",
|
1263 |
+
"parent" => "",
|
1264 |
+
"dependencies" => array("notifyrecipients", "notifysubject", "notifymessage", "notifyheaders", "attachfile"),
|
1265 |
+
"variables" => null,
|
1266 |
+
"help" => "If activated then email will be sent to inform about successful file uploads."
|
1267 |
+
),
|
1268 |
+
array(
|
1269 |
+
"name" => "Email Recipients",
|
1270 |
+
"attribute" => "notifyrecipients",
|
1271 |
+
"type" => "mtext",
|
1272 |
+
"validator" => "text",
|
1273 |
+
"listitems" => null,
|
1274 |
+
"value" => WFU_VAR("WFU_NOTIFYRECIPIENTS"),
|
1275 |
+
"mode" => "free",
|
1276 |
+
"category" => "notifications",
|
1277 |
+
"subcategory" => "Email Notifications",
|
1278 |
+
"parent" => "notify",
|
1279 |
+
"dependencies" => null,
|
1280 |
+
"variables" => array("%useremail%", "%userdataXXX%", "%n%", "%dq%"),
|
1281 |
+
"help" => "Defines the recipients of the email notification. Can be dynamic by using variables. Please check Documentation on how to use variables in atributes."
|
1282 |
+
),
|
1283 |
+
array(
|
1284 |
+
"name" => "Email Headers",
|
1285 |
+
"attribute" => "notifyheaders",
|
1286 |
+
"type" => "mtext",
|
1287 |
+
"validator" => "emailheaders",
|
1288 |
+
"listitems" => null,
|
1289 |
+
"value" => WFU_VAR("WFU_NOTIFYHEADERS"),
|
1290 |
+
"mode" => "free",
|
1291 |
+
"category" => "notifications",
|
1292 |
+
"subcategory" => "Email Notifications",
|
1293 |
+
"parent" => "notify",
|
1294 |
+
"dependencies" => null,
|
1295 |
+
"variables" => array("%n%", "%dq%"),
|
1296 |
+
"help" => "Defines additional email headers, in case you want to sent an HTML message, or use Bcc list, or use a different From address and name or other more advanced email options."
|
1297 |
+
),
|
1298 |
+
array(
|
1299 |
+
"name" => "Email Subject",
|
1300 |
+
"attribute" => "notifysubject",
|
1301 |
+
"type" => "ltext",
|
1302 |
+
"validator" => "emailsubject",
|
1303 |
+
"listitems" => null,
|
1304 |
+
"value" => WFU_NOTIFYSUBJECT,
|
1305 |
+
"mode" => "free",
|
1306 |
+
"category" => "notifications",
|
1307 |
+
"subcategory" => "Email Notifications",
|
1308 |
+
"parent" => "notify",
|
1309 |
+
"dependencies" => null,
|
1310 |
+
"variables" => array("%username%", "%useremail%", "%filename%", "%filepath%", "%blogid%", "%pageid%", "%pagetitle%", "%userdataXXX%", "%dq%"),
|
1311 |
+
"help" => "Defines the email subject. Can be dynamic by using variables. Please check Documentation on how to use variables in atributes."
|
1312 |
+
),
|
1313 |
+
array(
|
1314 |
+
"name" => "Email Body",
|
1315 |
+
"attribute" => "notifymessage",
|
1316 |
+
"type" => "mtext",
|
1317 |
+
"validator" => "emailbody",
|
1318 |
+
"listitems" => null,
|
1319 |
+
"value" => WFU_NOTIFYMESSAGE,
|
1320 |
+
"mode" => "free",
|
1321 |
+
"category" => "notifications",
|
1322 |
+
"subcategory" => "Email Notifications",
|
1323 |
+
"parent" => "notify",
|
1324 |
+
"dependencies" => null,
|
1325 |
+
"variables" => array("%username%", "%useremail%", "%filename%", "%filepath%", "%blogid%", "%pageid%", "%pagetitle%", "%userdataXXX%", "%n%", "%dq%"),
|
1326 |
+
"help" => "Defines the email body. Can be dynamic by using variables. Please check Documentation on how to use variables in atributes."
|
1327 |
+
),
|
1328 |
+
array(
|
1329 |
+
"name" => "Attach Uploaded Files",
|
1330 |
+
"attribute" => "attachfile",
|
1331 |
+
"type" => "onoff",
|
1332 |
+
"validator" => "text",
|
1333 |
+
"listitems" => null,
|
1334 |
+
"value" => WFU_VAR("WFU_ATTACHFILE"),
|
1335 |
+
"mode" => "free",
|
1336 |
+
"category" => "notifications",
|
1337 |
+
"subcategory" => "Email Notifications",
|
1338 |
+
"parent" => "notify",
|
1339 |
+
"dependencies" => null,
|
1340 |
+
"variables" => null,
|
1341 |
+
"help" => "If activated, then uploaded files will be included in the notification email as attachments. Please use carefully."
|
1342 |
+
),
|
1343 |
+
array(
|
1344 |
+
"name" => "Ask for Consent",
|
1345 |
+
"attribute" => "askconsent",
|
1346 |
+
"type" => "onoff",
|
1347 |
+
"validator" => "text",
|
1348 |
+
"listitems" => null,
|
1349 |
+
"value" => WFU_VAR("WFU_ASKCONSENT"),
|
1350 |
+
"mode" => "free",
|
1351 |
+
"category" => "personaldata",
|
1352 |
+
"subcategory" => "General Personal Data Options",
|
1353 |
+
"parent" => "",
|
1354 |
+
"dependencies" => array("personaldatatypes"),
|
1355 |
+
"variables" => null,
|
1356 |
+
"help" => "If activated, then consent from users will be asked for storing their personal data. If users do not give consent, then their data will not be stored in the database, they will only be included in the notification email, if email notifications are active."
|
1357 |
+
),
|
1358 |
+
array(
|
1359 |
+
"name" => "Personal Data Types",
|
1360 |
+
"attribute" => "personaldatatypes",
|
1361 |
+
"type" => "radio",
|
1362 |
+
"validator" => "text",
|
1363 |
+
"listitems" => array("userdata", "userdata and files"),
|
1364 |
+
"value" => WFU_VAR("WFU_PERSONALDATATYPES"),
|
1365 |
+
"mode" => "free",
|
1366 |
+
"category" => "personaldata",
|
1367 |
+
"subcategory" => "General Personal Data Options",
|
1368 |
+
"parent" => "askconsent",
|
1369 |
+
"dependencies" => null,
|
1370 |
+
"variables" => null,
|
1371 |
+
"help" => "Determines which data are considered as personal data. By default only userdata are considered as personal data. If the 2nd option is selected, then files will also be considered as personal data. This means that if the users do not give their consent, then the files will not be uploaded on the website, they will only be inluded in the notification email as attachments, if email notifications are active."
|
1372 |
+
),
|
1373 |
+
array(
|
1374 |
+
"name" => "Do Not Remember Consent Answer",
|
1375 |
+
"attribute" => "notrememberconsent",
|
1376 |
+
"type" => "onoff",
|
1377 |
+
"validator" => "text",
|
1378 |
+
"listitems" => null,
|
1379 |
+
"value" => WFU_VAR("WFU_NOTREMEMBERCONSENT"),
|
1380 |
+
"mode" => "free",
|
1381 |
+
"category" => "personaldata",
|
1382 |
+
"subcategory" => "Consent Behaviour",
|
1383 |
+
"parent" => "",
|
1384 |
+
"dependencies" => null,
|
1385 |
+
"variables" => null,
|
1386 |
+
"help" => "If activated the plugin will not remember the consent answer provided by the user and the consent question will always show."
|
1387 |
+
),
|
1388 |
+
array(
|
1389 |
+
"name" => "Consent Denial Rejects Upload",
|
1390 |
+
"attribute" => "consentrejectupload",
|
1391 |
+
"type" => "onoff",
|
1392 |
+
"validator" => "text",
|
1393 |
+
"listitems" => null,
|
1394 |
+
"value" => WFU_VAR("WFU_CONSENTREJECTUPLOAD"),
|
1395 |
+
"mode" => "free",
|
1396 |
+
"category" => "personaldata",
|
1397 |
+
"subcategory" => "Consent Behaviour",
|
1398 |
+
"parent" => "",
|
1399 |
+
"dependencies" => array("consentrejectmessage"),
|
1400 |
+
"variables" => null,
|
1401 |
+
"help" => "If activated and user has denied consent then the upload will be rejected. If deactivated, then the upload will continue regardless of consent answer."
|
1402 |
+
),
|
1403 |
+
array(
|
1404 |
+
"name" => "Reject Message",
|
1405 |
+
"attribute" => "consentrejectmessage",
|
1406 |
+
"type" => "ltext",
|
1407 |
+
"validator" => "text",
|
1408 |
+
"listitems" => null,
|
1409 |
+
"value" => WFU_CONSENTREJECTMESSAGE,
|
1410 |
+
"mode" => "free",
|
1411 |
+
"category" => "personaldata",
|
1412 |
+
"subcategory" => "Consent Behaviour",
|
1413 |
+
"parent" => "consentrejectupload",
|
1414 |
+
"dependencies" => null,
|
1415 |
+
"variables" => null,
|
1416 |
+
"help" => "It defines the message that will appear to the user if upload cannot continue due to consent denial."
|
1417 |
+
),
|
1418 |
+
array(
|
1419 |
+
"name" => "Consent Format",
|
1420 |
+
"attribute" => "consentformat",
|
1421 |
+
"type" => "radio",
|
1422 |
+
"validator" => "text",
|
1423 |
+
"listitems" => array("checkbox", "radio", "prompt"),
|
1424 |
+
"value" => WFU_VAR("WFU_CONSENTFORMAT"),
|
1425 |
+
"mode" => "free",
|
1426 |
+
"category" => "personaldata",
|
1427 |
+
"subcategory" => "Consent Appearance",
|
1428 |
+
"parent" => "",
|
1429 |
+
"dependencies" => null,
|
1430 |
+
"variables" => null,
|
1431 |
+
"help" => "Determines how consent question will appear to the user. If 'checkbox' is selected then a checkbox will appear inside the upload form which the user needs to tick. If 'radio' is selected then a radio button with 'Yes' and 'No' answers will appear inside the form (this makes sure that the user will select something after all. If 'prompt' is selected then a dialog will appear on the user when pressing the upload button asking for consent."
|
1432 |
+
),
|
1433 |
+
array(
|
1434 |
+
"name" => "Preselected Answer",
|
1435 |
+
"attribute" => "consentpreselect",
|
1436 |
+
"type" => "radio",
|
1437 |
+
"validator" => "text",
|
1438 |
+
"listitems" => array("none", "yes", "no"),
|
1439 |
+
"value" => WFU_VAR("WFU_CONSENTPRESELECT"),
|
1440 |
+
"mode" => "free",
|
1441 |
+
"category" => "personaldata",
|
1442 |
+
"subcategory" => "Consent Appearance",
|
1443 |
+
"parent" => "",
|
1444 |
+
"dependencies" => null,
|
1445 |
+
"variables" => null,
|
1446 |
+
"help" => "Determines whether a default answer will be selected."
|
1447 |
+
),
|
1448 |
+
array(
|
1449 |
+
"name" => "Consent Question for Checkbox",
|
1450 |
+
"attribute" => "consentquestion",
|
1451 |
+
"type" => "ltext",
|
1452 |
+
"validator" => "text",
|
1453 |
+
"listitems" => null,
|
1454 |
+
"value" => WFU_CONSENTQUESTION,
|
1455 |
+
"mode" => "free",
|
1456 |
+
"category" => "personaldata",
|
1457 |
+
"subcategory" => "Consent Appearance",
|
1458 |
+
"parent" => "",
|
1459 |
+
"dependencies" => null,
|
1460 |
+
"variables" => null,
|
1461 |
+
"help" => "Defines the question that will appear to the user next to the checkbox, or radio buttons or inside the prompt dialog. If a word starting and ending with semicolon (:) is added in the question, e.g. :link:, then it will be replaced by a link defined in 'Consent Disclaimer Link' attribute. This way a link to a disclaimer can be added."
|
1462 |
+
),
|
1463 |
+
array(
|
1464 |
+
"name" => "Consent Disclaimer Link",
|
1465 |
+
"attribute" => "consentdisclaimer",
|
1466 |
+
"type" => "ltext",
|
1467 |
+
"validator" => "text",
|
1468 |
+
"listitems" => null,
|
1469 |
+
"value" => WFU_VAR("WFU_CONSENTDISCLAIMER"),
|
1470 |
+
"mode" => "free",
|
1471 |
+
"category" => "personaldata",
|
1472 |
+
"subcategory" => "Consent Appearance",
|
1473 |
+
"parent" => "",
|
1474 |
+
"dependencies" => null,
|
1475 |
+
"variables" => null,
|
1476 |
+
"help" => "Defines a link that displays a disclaimer to the user if the user presses the relevant link that is included inside the consent question."
|
1477 |
+
),
|
1478 |
+
array(
|
1479 |
+
"name" => "Success Upload Message Color",
|
1480 |
+
"attribute" => "successmessagecolor",
|
1481 |
+
"type" => "hidden",
|
1482 |
+
"validator" => "colors",
|
1483 |
+
"listitems" => null,
|
1484 |
+
"value" => WFU_SUCCESSMESSAGECOLOR,
|
1485 |
+
"mode" => "free",
|
1486 |
+
"category" => "colors",
|
1487 |
+
"subcategory" => "Upload Message Colors",
|
1488 |
+
"parent" => "",
|
1489 |
+
"dependencies" => null,
|
1490 |
+
"variables" => null,
|
1491 |
+
"help" => "It defines the color of the success message. This attribute has been replaced by successmessagecolors, however it is kept here for backward compatibility."
|
1492 |
+
),
|
1493 |
+
array(
|
1494 |
+
"name" => "Success Message Colors",
|
1495 |
+
"attribute" => "successmessagecolors",
|
1496 |
+
"type" => "color-triplet",
|
1497 |
+
"validator" => "colors",
|
1498 |
+
"listitems" => null,
|
1499 |
+
"value" => WFU_VAR("WFU_SUCCESSMESSAGECOLORS"),
|
1500 |
+
"mode" => "free",
|
1501 |
+
"category" => "colors",
|
1502 |
+
"subcategory" => "Upload Message Colors",
|
1503 |
+
"parent" => "",
|
1504 |
+
"dependencies" => null,
|
1505 |
+
"variables" => null,
|
1506 |
+
"help" => "It defines the text, background and border color of the success message."
|
1507 |
+
),
|
1508 |
+
array(
|
1509 |
+
"name" => "Warning Message Colors",
|
1510 |
+
"attribute" => "warningmessagecolors",
|
1511 |
+
"type" => "color-triplet",
|
1512 |
+
"validator" => "colors",
|
1513 |
+
"listitems" => null,
|
1514 |
+
"value" => WFU_VAR("WFU_WARNINGMESSAGECOLORS"),
|
1515 |
+
"mode" => "free",
|
1516 |
+
"category" => "colors",
|
1517 |
+
"subcategory" => "Upload Message Colors",
|
1518 |
+
"parent" => "",
|
1519 |
+
"dependencies" => null,
|
1520 |
+
"variables" => null,
|
1521 |
+
"help" => "It defines the text, background and border color of the warning message."
|
1522 |
+
),
|
1523 |
+
array(
|
1524 |
+
"name" => "Fail Message Colors",
|
1525 |
+
"attribute" => "failmessagecolors",
|
1526 |
+
"type" => "color-triplet",
|
1527 |
+
"validator" => "colors",
|
1528 |
+
"listitems" => null,
|
1529 |
+
"value" => WFU_VAR("WFU_FAILMESSAGECOLORS"),
|
1530 |
+
"mode" => "free",
|
1531 |
+
"category" => "colors",
|
1532 |
+
"subcategory" => "Upload Message Colors",
|
1533 |
+
"parent" => "",
|
1534 |
+
"dependencies" => null,
|
1535 |
+
"variables" => null,
|
1536 |
+
"help" => "It defines the text, background and border color of the fail (error) message."
|
1537 |
+
),
|
1538 |
+
array(
|
1539 |
+
"name" => "Wait Message Colors",
|
1540 |
+
"attribute" => "waitmessagecolors",
|
1541 |
+
"type" => "hidden",
|
1542 |
+
"validator" => "colors",
|
1543 |
+
"listitems" => null,
|
1544 |
+
"value" => WFU_VAR("WFU_WAITMESSAGECOLORS"),
|
1545 |
+
"mode" => "free",
|
1546 |
+
"category" => "colors",
|
1547 |
+
"subcategory" => "Upload Message Colors",
|
1548 |
+
"parent" => "",
|
1549 |
+
"dependencies" => null,
|
1550 |
+
"variables" => null,
|
1551 |
+
"help" => "It defines the text, background and border color of the wait message."
|
1552 |
+
),
|
1553 |
+
array(
|
1554 |
+
"name" => "Plugin Component Widths",
|
1555 |
+
"attribute" => "widths",
|
1556 |
+
"type" => "dimensions",
|
1557 |
+
"validator" => "text",
|
1558 |
+
"listitems" => null,
|
1559 |
+
"value" => WFU_VAR("WFU_WIDTHS"),
|
1560 |
+
"mode" => "free",
|
1561 |
+
"category" => "dimensions",
|
1562 |
+
"subcategory" => "Plugin Component Widths",
|
1563 |
+
"parent" => "",
|
1564 |
+
"dependencies" => null,
|
1565 |
+
"variables" => null,
|
1566 |
+
"help" => "It defines the widths of the selected plugin components."
|
1567 |
+
),
|
1568 |
+
array(
|
1569 |
+
"name" => "Plugin Component Heights",
|
1570 |
+
"attribute" => "heights",
|
1571 |
+
"type" => "dimensions",
|
1572 |
+
"validator" => "text",
|
1573 |
+
"listitems" => null,
|
1574 |
+
"value" => WFU_VAR("WFU_HEIGHTS"),
|
1575 |
+
"mode" => "free",
|
1576 |
+
"category" => "dimensions",
|
1577 |
+
"subcategory" => "Plugin Component Heights",
|
1578 |
+
"parent" => "",
|
1579 |
+
"dependencies" => null,
|
1580 |
+
"variables" => null,
|
1581 |
+
"help" => "It defines the heights of the selected plugin components."
|
1582 |
+
),
|
1583 |
+
array(
|
1584 |
+
"name" => "Include Additional Data Fields",
|
1585 |
+
"attribute" => "userdata",
|
1586 |
+
"type" => "onoff",
|
1587 |
+
"validator" => "text",
|
1588 |
+
"listitems" => null,
|
1589 |
+
"value" => WFU_VAR("WFU_USERDATA"),
|
1590 |
+
"mode" => "free",
|
1591 |
+
"category" => "userdata",
|
1592 |
+
"subcategory" => "Additional Data Fields",
|
1593 |
+
"parent" => "",
|
1594 |
+
"dependencies" => array("userdatalabel"),
|
1595 |
+
"variables" => null,
|
1596 |
+
"help" => "If enabled, then user can send additional information together with uploaded files (e.g. name, email etc), defined in userdatalabel attribute."
|
1597 |
+
),
|
1598 |
+
array(
|
1599 |
+
"name" => "Additional Data Fields",
|
1600 |
+
"attribute" => "userdatalabel",
|
1601 |
+
"type" => "formfields",
|
1602 |
+
"validator" => "text",
|
1603 |
+
"listitems" => wfu_formfield_definitions(),
|
1604 |
+
"value" => WFU_USERDATALABEL,
|
1605 |
+
"mode" => "free",
|
1606 |
+
"category" => "userdata",
|
1607 |
+
"subcategory" => "Additional Data Fields",
|
1608 |
+
"parent" => "userdata",
|
1609 |
+
"dependencies" => null,
|
1610 |
+
"variables" => null,
|
1611 |
+
"help" => "It defines the labels of the additional data fields and whether they are required or not."
|
1612 |
+
),
|
1613 |
+
array(
|
1614 |
+
"name" => "WP Filebase Plugin Connection",
|
1615 |
+
"attribute" => "filebaselink",
|
1616 |
+
"type" => "onoff",
|
1617 |
+
"validator" => "text",
|
1618 |
+
"listitems" => null,
|
1619 |
+
"value" => WFU_VAR("WFU_FILEBASELINK"),
|
1620 |
+
"mode" => "free",
|
1621 |
+
"category" => "interoperability",
|
1622 |
+
"subcategory" => "Connection With Other Plugins",
|
1623 |
+
"parent" => "",
|
1624 |
+
"dependencies" => null,
|
1625 |
+
"variables" => null,
|
1626 |
+
"help" => "If enabled then the WP Filebase Plugin will be informed about new file uploads."
|
1627 |
+
),
|
1628 |
+
array(
|
1629 |
+
"name" => "Add Uploaded Files To Media",
|
1630 |
+
"attribute" => "medialink",
|
1631 |
+
"type" => "onoff",
|
1632 |
+
"validator" => "text",
|
1633 |
+
"listitems" => null,
|
1634 |
+
"value" => WFU_VAR("WFU_MEDIALINK"),
|
1635 |
+
"mode" => "free",
|
1636 |
+
"category" => "interoperability",
|
1637 |
+
"subcategory" => "Connection With Other Wordpress Features",
|
1638 |
+
"parent" => "",
|
1639 |
+
"dependencies" => null,
|
1640 |
+
"variables" => null,
|
1641 |
+
"help" => "If enabled then the uploaded files will be added to the Media library of your Wordpress website. Please note that the upload path must be inside the wp-content/uploads directory (which is the default upload path)."
|
1642 |
+
),
|
1643 |
+
array(
|
1644 |
+
"name" => "Attach Uploaded Files To Post",
|
1645 |
+
"attribute" => "postlink",
|
1646 |
+
"type" => "onoff",
|
1647 |
+
"validator" => "text",
|
1648 |
+
"listitems" => null,
|
1649 |
+
"value" => WFU_VAR("WFU_POSTLINK"),
|
1650 |
+
"mode" => "free",
|
1651 |
+
"category" => "interoperability",
|
1652 |
+
"subcategory" => "Connection With Other Wordpress Features",
|
1653 |
+
"parent" => "",
|
1654 |
+
"dependencies" => null,
|
1655 |
+
"variables" => null,
|
1656 |
+
"help" => "If enabled then the uploaded files will be added to the current post as attachments. Please note that the upload path must be inside the wp-content/uploads directory (which is the default upload path)."
|
1657 |
+
),
|
1658 |
+
array(
|
1659 |
+
"name" => "Enable Webcam",
|
1660 |
+
"attribute" => "webcam",
|
1661 |
+
"type" => "onoff",
|
1662 |
+
"validator" => "text",
|
1663 |
+
"listitems" => null,
|
1664 |
+
"value" => WFU_VAR("WFU_WEBCAM"),
|
1665 |
+
"mode" => "free",
|
1666 |
+
"category" => "webcam",
|
1667 |
+
"subcategory" => "Capture from Webcam (experimental)",
|
1668 |
+
"parent" => "",
|
1669 |
+
"dependencies" => array("webcammode", "audiocapture", "videowidth", "videoheight", "videoaspectratio", "videoframerate", "camerafacing", "maxrecordtime", "uploadmediabutton", "videoname", "imagename"),
|
1670 |
+
"variables" => null,
|
1671 |
+
"help" => "This enables capturing of video or still pictures from the computer's webcam. It is experimental because it is not supported by all browsers yet."
|
1672 |
+
),
|
1673 |
+
array(
|
1674 |
+
"name" => "Capture Mode",
|
1675 |
+
"attribute" => "webcammode",
|
1676 |
+
"type" => "radio",
|
1677 |
+
"validator" => "text",
|
1678 |
+
"listitems" => array("capture video", "take photos", "both"),
|
1679 |
+
"value" => WFU_VAR("WFU_WEBCAMMODE"),
|
1680 |
+
"mode" => "free",
|
1681 |
+
"category" => "webcam",
|
1682 |
+
"subcategory" => "Capture from Webcam (experimental)",
|
1683 |
+
"parent" => "webcam",
|
1684 |
+
"dependencies" => null,
|
1685 |
+
"variables" => null,
|
1686 |
+
"help" => "It defines the webcam capture mode. The webcam can either capture video, still photos or both."
|
1687 |
+
),
|
1688 |
+
array(
|
1689 |
+
"name" => "Capture Audio",
|
1690 |
+
"attribute" => "audiocapture",
|
1691 |
+
"type" => "onoff",
|
1692 |
+
"validator" => "text",
|
1693 |
+
"listitems" => null,
|
1694 |
+
"value" => WFU_VAR("WFU_AUDIOCAPTURE"),
|
1695 |
+
"mode" => "free",
|
1696 |
+
"category" => "webcam",
|
1697 |
+
"subcategory" => "Capture from Webcam (experimental)",
|
1698 |
+
"parent" => "webcam",
|
1699 |
+
"dependencies" => null,
|
1700 |
+
"variables" => null,
|
1701 |
+
"help" => "It defines whether audio will be captured together with video from the webcam."
|
1702 |
+
),
|
1703 |
+
array(
|
1704 |
+
"name" => "Video Width",
|
1705 |
+
"attribute" => "videowidth",
|
1706 |
+
"type" => "text",
|
1707 |
+
"validator" => "text",
|
1708 |
+
"listitems" => null,
|
1709 |
+
"value" => WFU_VAR("WFU_VIDEOWIDTH"),
|
1710 |
+
"mode" => "free",
|
1711 |
+
"category" => "webcam",
|
1712 |
+
"subcategory" => "Capture from Webcam (experimental)",
|
1713 |
+
"parent" => "webcam",
|
1714 |
+
"dependencies" => null,
|
1715 |
+
"variables" => null,
|
1716 |
+
"help" => "It requests a preferable video width for the webcam. The plugin will try to match this setting as close as possible depending on webcam capabilities."
|
1717 |
+
),
|
1718 |
+
array(
|
1719 |
+
"name" => "Video Height",
|
1720 |
+
"attribute" => "videoheight",
|
1721 |
+
"type" => "text",
|
1722 |
+
"validator" => "text",
|
1723 |
+
"listitems" => null,
|
1724 |
+
"value" => WFU_VAR("WFU_VIDEOHEIGHT"),
|
1725 |
+
"mode" => "free",
|
1726 |
+
"category" => "webcam",
|
1727 |
+
"subcategory" => "Capture from Webcam (experimental)",
|
1728 |
+
"parent" => "webcam",
|
1729 |
+
"dependencies" => null,
|
1730 |
+
"variables" => null,
|
1731 |
+
"help" => "It requests a preferable video height for the webcam. The plugin will try to match this setting as close as possible depending on webcam capabilities."
|
1732 |
+
),
|
1733 |
+
array(
|
1734 |
+
"name" => "Video Aspect Ratio",
|
1735 |
+
"attribute" => "videoaspectratio",
|
1736 |
+
"type" => "text",
|
1737 |
+
"validator" => "text",
|
1738 |
+
"listitems" => null,
|
1739 |
+
"value" => WFU_VAR("WFU_VIDEOASPECTRATIO"),
|
1740 |
+
"mode" => "free",
|
1741 |
+
"category" => "webcam",
|
1742 |
+
"subcategory" => "Capture from Webcam (experimental)",
|
1743 |
+
"parent" => "webcam",
|
1744 |
+
"dependencies" => null,
|
1745 |
+
"variables" => null,
|
1746 |
+
"help" => "It requests a preferable video aspect ratio for the webcam. The plugin will try to match this setting as close as possible depending on webcam capabilities."
|
1747 |
+
),
|
1748 |
+
array(
|
1749 |
+
"name" => "Video Frame Rate",
|
1750 |
+
"attribute" => "videoframerate",
|
1751 |
+
"type" => "text",
|
1752 |
+
"validator" => "text",
|
1753 |
+
"listitems" => null,
|
1754 |
+
"value" => WFU_VAR("WFU_VIDEOFRAMERATE"),
|
1755 |
+
"mode" => "free",
|
1756 |
+
"category" => "webcam",
|
1757 |
+
"subcategory" => "Capture from Webcam (experimental)",
|
1758 |
+
"parent" => "webcam",
|
1759 |
+
"dependencies" => null,
|
1760 |
+
"variables" => null,
|
1761 |
+
"help" => "It requests a preferable video frame rate for video recording. The plugin will try to match this setting as close as possible depending on webcam capabilities."
|
1762 |
+
),
|
1763 |
+
array(
|
1764 |
+
"name" => "Camera Facing Mode",
|
1765 |
+
"attribute" => "camerafacing",
|
1766 |
+
"type" => "radio",
|
1767 |
+
"validator" => "text",
|
1768 |
+
"listitems" => array("any", "front", "back"),
|
1769 |
+
"value" => WFU_VAR("WFU_CAMERAFACING"),
|
1770 |
+
"mode" => "free",
|
1771 |
+
"category" => "webcam",
|
1772 |
+
"subcategory" => "Capture from Webcam (experimental)",
|
1773 |
+
"parent" => "webcam",
|
1774 |
+
"dependencies" => null,
|
1775 |
+
"variables" => null,
|
1776 |
+
"help" => "It defines if the front or back camera will be preferred (for mobile devices with 2 cameras). The plugin will try to match this setting depending on webcam capabilities."
|
1777 |
+
),
|
1778 |
+
array(
|
1779 |
+
"name" => "Max Record Time",
|
1780 |
+
"attribute" => "maxrecordtime",
|
1781 |
+
"type" => "integer",
|
1782 |
+
"validator" => "integer",
|
1783 |
+
"listitems" => null,
|
1784 |
+
"value" => WFU_VAR("WFU_MAXRECORDTIME"),
|
1785 |
+
"mode" => "free",
|
1786 |
+
"category" => "webcam",
|
1787 |
+
"subcategory" => "Capture from Webcam (experimental)",
|
1788 |
+
"parent" => "webcam",
|
1789 |
+
"dependencies" => null,
|
1790 |
+
"variables" => null,
|
1791 |
+
"help" => "It defines the maximum time of video recording (in seconds). If it is set to -1, then there is no time limit."
|
1792 |
+
),
|
1793 |
+
null
|
1794 |
+
);
|
1795 |
+
|
1796 |
+
wfu_array_remove_nulls($defs);
|
1797 |
+
|
1798 |
+
|
1799 |
+
return $defs;
|
1800 |
+
}
|
1801 |
+
|
1802 |
+
|
1803 |
+
?>
|
lib/wfu_blocks.php
CHANGED
@@ -1,627 +1,627 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/* Prepare the uploadform generic element */
|
4 |
-
function wfu_prepare_base_block($params, $additional_params, $occurrence_index) {
|
5 |
-
//prepare data for template
|
6 |
-
$data["ID"] = $params["uploadid"];
|
7 |
-
$data["responsive"] = ( $params["fitmode"] == "responsive" );
|
8 |
-
$data["testmode"] = ( $params["testmode"] == "true" );
|
9 |
-
$data["params"] = $params;
|
10 |
-
|
11 |
-
$base_item["title"] = '';
|
12 |
-
$base_item["hidden"] = false;
|
13 |
-
$base_item["width"] = "";
|
14 |
-
$base_item["object"] = "GlobalData.WFU[".$data["ID"]."].base";
|
15 |
-
//read html output from template
|
16 |
-
$base_item += wfu_read_template_output("base", $data);
|
17 |
-
|
18 |
-
return $base_item;
|
19 |
-
}
|
20 |
-
|
21 |
-
/* Prepare the visual editor button */
|
22 |
-
function wfu_prepare_visualeditorbutton_block($params, $additional_params, $occurrence_index) {
|
23 |
-
if ( isset($params["uploadid"]) ) {
|
24 |
-
$ID = $params["uploadid"];
|
25 |
-
$JS_Object = "GlobalData.WFU[".$ID."].visualeditorbutton";
|
26 |
-
}
|
27 |
-
else {
|
28 |
-
$ID = $params["browserid"];
|
29 |
-
$JS_Object = "GlobalData.WFUB[".$ID."].visualeditorbutton";
|
30 |
-
}
|
31 |
-
//prepare data for template
|
32 |
-
$data["ID"] = $ID;
|
33 |
-
$data["shortcode_tag"] = $additional_params['shortcode_tag'];
|
34 |
-
$data["JS_Object"] = $JS_Object;
|
35 |
-
$data["params"] = $params;
|
36 |
-
|
37 |
-
$visualeditorbutton_item["title"] = '';
|
38 |
-
$visualeditorbutton_item["hidden"] = false;
|
39 |
-
$visualeditorbutton_item["width"] = "";
|
40 |
-
$visualeditorbutton_item["object"] = $JS_Object;
|
41 |
-
//read html output from template
|
42 |
-
$visualeditorbutton_item += wfu_read_template_output("visualeditorbutton", $data);
|
43 |
-
//initialize title object properties
|
44 |
-
$visualeditorbutton_item["js"] = $JS_Object." = { ".
|
45 |
-
"shortcode_tag: \"".$data["shortcode_tag"]."\", ".
|
46 |
-
"attachInvokeHandler: function(invoke_function) {}, ".
|
47 |
-
"onInvoke: function() {}, ".
|
48 |
-
"afterInvoke: function() {}".
|
49 |
-
"};\n\n".$visualeditorbutton_item["js"];
|
50 |
-
//append javascript variable that checks if title exists or not
|
51 |
-
$visualeditorbutton_item["js"] .= "\n\n".$JS_Object."_exist = true;";
|
52 |
-
|
53 |
-
return $visualeditorbutton_item;
|
54 |
-
}
|
55 |
-
|
56 |
-
|
57 |
-
/* Prepare information about directory or selection of target subdirectory */
|
58 |
-
function wfu_prepare_subfolders_block($params, $additional_params, $occurrence_index) {
|
59 |
-
//prepare data for template
|
60 |
-
$data["ID"] = $params["uploadid"];
|
61 |
-
$data["widths"] = $additional_params['widths'];
|
62 |
-
$data["heights"] = $additional_params['heights'];
|
63 |
-
$data["responsive"] = ( $params["fitmode"] == "responsive" );
|
64 |
-
$data["testmode"] = ( $params["testmode"] == "true" );
|
65 |
-
$data["show_uploadfolder"] = ( $params["showtargetfolder"] == "true" );
|
66 |
-
$data["show_subfolders"] = ( $params["askforsubfolders"] == "true" );
|
67 |
-
$data["editable"] = ( substr($params["subfoldertree"], 0, 5) == "auto+" );
|
68 |
-
$data["uploadfolder"] = wfu_upload_plugin_directory($params["uploadpath"]);
|
69 |
-
$data["uploadfolder_title"] = $params["targetfolderlabel"];
|
70 |
-
$data["subfolders"] = array( 'path' => array(), 'label' => array(), 'level' => array(), 'default' => array() );
|
71 |
-
$data["subfolders_title"] = $params["subfolderlabel"];
|
72 |
-
$data["index"] = $occurrence_index;
|
73 |
-
$data["params"] = $params;
|
74 |
-
//prepare data of subfolders
|
75 |
-
if ( $data["show_subfolders"] && !$data["testmode"] ) {
|
76 |
-
if ( substr($params["subfoldertree"], 0, 4) == "auto" ) {
|
77 |
-
$upload_directory = wfu_upload_plugin_full_path($params);
|
78 |
-
$dirtree = wfu_getTree($upload_directory);
|
79 |
-
foreach ( $dirtree as &$dir ) $dir = '*'.$dir;
|
80 |
-
$params["subfoldertree"] = implode(',', $dirtree);
|
81 |
-
}
|
82 |
-
$subfolders = wfu_parse_folderlist($params["subfoldertree"]);
|
83 |
-
if ( count($subfolders['path']) == 0 ) {
|
84 |
-
array_push($subfolders['path'], "");
|
85 |
-
array_push($subfolders['label'], wfu_upload_plugin_directory($params["uploadpath"]));
|
86 |
-
array_push($subfolders['level'], 0);
|
87 |
-
array_push($subfolders['default'], false);
|
88 |
-
}
|
89 |
-
$data["subfolders"] = $subfolders;
|
90 |
-
}
|
91 |
-
|
92 |
-
$subfolders_item = null;
|
93 |
-
if ( $data["show_uploadfolder"] || $data["show_subfolders"] ) {
|
94 |
-
$subfolders_item["title"] = 'wordpress_file_upload_subfolders_'.$data["ID"];
|
95 |
-
$subfolders_item["hidden"] = false;
|
96 |
-
$subfolders_item["width"] = "";
|
97 |
-
$subfolders_item["object"] = "GlobalData.WFU[".$data["ID"]."].subfolders";
|
98 |
-
//for responsive plugin adjust width
|
99 |
-
if ( $data["responsive"] ) $subfolders_item["width"] = $data["width"];
|
100 |
-
//read html output from template
|
101 |
-
$subfolders_item += wfu_read_template_output("subfolders", $data);
|
102 |
-
//initialize subfolders object properties
|
103 |
-
$subfolders_item["js"] = "GlobalData.WFU[".$data["ID"]."].subfolders = { ".
|
104 |
-
"update_handler: function(new_value) { document.getElementById('hiddeninput_".$data["ID"]."').value = new_value; }, ".
|
105 |
-
"check: function() { return true; }, ".
|
106 |
-
"index: function() { return -1; }, ".
|
107 |
-
"reset: function() {}, ".
|
108 |
-
"toggle: function(enabled) {}".
|
109 |
-
"};\n\n".$subfolders_item["js"];
|
110 |
-
//append javascript variable that checks if subfolders element exists or not
|
111 |
-
if ( $data["show_subfolders"] ) $subfolders_item["js"] .= "\n\nGlobalData.WFU[".$data["ID"]."].subfolders_exist = true;";
|
112 |
-
}
|
113 |
-
|
114 |
-
return $subfolders_item;
|
115 |
-
}
|
116 |
-
|
117 |
-
/* Prepare the title */
|
118 |
-
function wfu_prepare_title_block($params, $additional_params, $occurrence_index) {
|
119 |
-
//prepare data for template
|
120 |
-
$data["ID"] = $params["uploadid"];
|
121 |
-
$data["width"] = $additional_params['widths']['title'];
|
122 |
-
$data["height"] = $additional_params['heights']['title'];
|
123 |
-
$data["responsive"] = ( $params["fitmode"] == "responsive" );
|
124 |
-
$data["testmode"] = ( $params["testmode"] == "true" );
|
125 |
-
$data["title"] = $params["uploadtitle"];
|
126 |
-
$data["index"] = $occurrence_index;
|
127 |
-
$data["params"] = $params;
|
128 |
-
|
129 |
-
$title_item["title"] = 'wordpress_file_upload_title_'.$data["ID"];
|
130 |
-
$title_item["hidden"] = false;
|
131 |
-
$title_item["width"] = "";
|
132 |
-
$title_item["object"] = "GlobalData.WFU[".$data["ID"]."].title";
|
133 |
-
//for responsive plugin adjust container and container's parent widths if a % width has been defined
|
134 |
-
if ( $data["responsive"] && strlen($data["width"]) > 1 && substr($data["width"], -1, 1) == "%" ) $title_item["width"] = $data["width"];
|
135 |
-
//read html output from template
|
136 |
-
$title_item += wfu_read_template_output("title", $data);
|
137 |
-
//initialize title object properties
|
138 |
-
$title_item["js"] = "GlobalData.WFU[".$data["ID"]."].title = {};\n\n".$title_item["js"];
|
139 |
-
//append javascript variable that checks if title exists or not
|
140 |
-
$title_item["js"] .= "\n\nGlobalData.WFU[".$data["ID"]."].title_exist = true;";
|
141 |
-
|
142 |
-
return $title_item;
|
143 |
-
}
|
144 |
-
|
145 |
-
/* Prepare the text box showing filename */
|
146 |
-
function wfu_prepare_textbox_block($params, $additional_params, $occurrence_index) {
|
147 |
-
//prepare data for template
|
148 |
-
$data["ID"] = $params["uploadid"];
|
149 |
-
$data["width"] = $additional_params['widths']['filename'];
|
150 |
-
$data["height"] = $additional_params['heights']['filename'];
|
151 |
-
$data["responsive"] = ( $params["fitmode"] == "responsive" );
|
152 |
-
$data["testmode"] = ( $params["testmode"] == "true" );
|
153 |
-
$data["index"] = $occurrence_index;
|
154 |
-
$data["params"] = $params;
|
155 |
-
|
156 |
-
|
157 |
-
$textbox_item["title"] = 'wordpress_file_upload_textbox_'.$data["ID"];
|
158 |
-
$textbox_item["hidden"] = false;
|
159 |
-
$textbox_item["width"] = "";
|
160 |
-
$textbox_item["object"] = "GlobalData.WFU[".$data["ID"]."].textbox";
|
161 |
-
//for responsive plugin adjust container and container's parent widths if a % width has been defined
|
162 |
-
if ( $data["responsive"] && strlen($data["width"]) > 1 && substr($data["width"], -1, 1) == "%" ) $textbox_item["width"] = $data["width"];
|
163 |
-
//read html output from template
|
164 |
-
$textbox_item += wfu_read_template_output("textbox", $data);
|
165 |
-
//initialize textbox object properties
|
166 |
-
$textbox_item["js"] = "GlobalData.WFU[".$data["ID"]."].textbox = { ".
|
167 |
-
"attachCancelHandler: function(cancel_function) {}, ".
|
168 |
-
"dettachCancelHandler: function() {}, ".
|
169 |
-
"update: function(action, filenames) {} ".
|
170 |
-
"};\n\n".$textbox_item["js"];
|
171 |
-
//append javascript variable that checks if textbox exists or not
|
172 |
-
$textbox_item["js"] .= "\n\nGlobalData.WFU[".$data["ID"]."].textbox_exist = true;";
|
173 |
-
|
174 |
-
return $textbox_item;
|
175 |
-
}
|
176 |
-
|
177 |
-
/* Prepare the upload form (required) */
|
178 |
-
function wfu_prepare_uploadform_block($params, $additional_params, $occurrence_index) {
|
179 |
-
//prepare data for template
|
180 |
-
$data["ID"] = $params["uploadid"];
|
181 |
-
$data["width"] = $additional_params['widths']['selectbutton'];
|
182 |
-
$data["height"] = $additional_params['heights']['selectbutton'];
|
183 |
-
$data["responsive"] = ( $params["fitmode"] == "responsive" );
|
184 |
-
$data["testmode"] = ( $params["testmode"] == "true" );
|
185 |
-
$data["label"] = $params["selectbutton"];
|
186 |
-
$data["filename"] = "uploadedfile_".$data["ID"];
|
187 |
-
$data["hidden_elements"] = array(
|
188 |
-
array( "id" => "wfu_uploader_nonce_".$data["ID"], "name" => "wfu_uploader_nonce", "value" => wp_create_nonce("wfu-uploader-nonce") ),
|
189 |
-
array( "id" => "hiddeninput_".$data["ID"], "name" => "hiddeninput_".$data["ID"], "value" => "" ),
|
190 |
-
array( "id" => "uniqueuploadid_".$data["ID"], "name" => "uniqueuploadid_".$data["ID"], "value" => "" ),
|
191 |
-
array( "id" => "nofileupload_".$data["ID"], "name" => "nofileupload_".$data["ID"], "value" => "0" ),
|
192 |
-
array( "id" => "uploadedfile_".$data["ID"]."_name", "name" => "uploadedfile_".$data["ID"]."_name", "value" => wfu_plugin_encode_string("dummy.txt") ),
|
193 |
-
array( "id" => "uploadedfile_".$data["ID"]."_size", "name" => "uploadedfile_".$data["ID"]."_size", "value" => "0" ),
|
194 |
-
array( "id" => "adminerrorcodes_".$data["ID"], "name" => "adminerrorcodes_".$data["ID"], "value" => "" )
|
195 |
-
);
|
196 |
-
if ( $additional_params["require_consent"] ) array_push( $data["hidden_elements"],
|
197 |
-
array( "id" => "consentresult_".$data["ID"], "name" => "consentresult_".$data["ID"], "value" => "" )
|
198 |
-
);
|
199 |
-
foreach ($params["userdata_fields"] as $userdata_key => $userdata_field)
|
200 |
-
array_push($data["hidden_elements"], array( "id" => "hiddeninput_".$data["ID"]."_userdata_".$userdata_key, "name" => "hiddeninput_".$data["ID"]."_userdata_".$userdata_key, "value" => "" ));
|
201 |
-
$data["index"] = $occurrence_index;
|
202 |
-
$data["params"] = $params;
|
203 |
-
|
204 |
-
$uploadform_item["title"] = 'wordpress_file_upload_form_'.$data["ID"];
|
205 |
-
// selectbutton block is mandatory because it contains the upload form element, so in case it is not included in the placements
|
206 |
-
// attribute then we set its visibility to hidden
|
207 |
-
$uploadform_item["hidden"] = ( strpos($params["placements"], "selectbutton") === false );
|
208 |
-
$uploadform_item["width"] = "";
|
209 |
-
$uploadform_item["object"] = "GlobalData.WFU[".$data["ID"]."].uploadform";
|
210 |
-
//for responsive plugin adjust container and container's parent widths if a % width has been defined
|
211 |
-
if ( $data["responsive"] && strlen($data["width"]) > 1 && substr($data["width"], -1, 1) == "%" ) $uploadform_item["width"] = $data["width"];
|
212 |
-
|
213 |
-
//read html output from template
|
214 |
-
$uploadform_item += wfu_read_template_output("uploadform", $data);
|
215 |
-
//initialize uploadform object properties
|
216 |
-
$uploadform_item["js"] = "GlobalData.WFU[".$data["ID"]."].uploadform = { ".
|
217 |
-
"attachActions: function(clickaction, changeaction) {}, ".
|
218 |
-
"reset: function() {}, ".
|
219 |
-
"resetDummy: function() {}, ".
|
220 |
-
"submit: function() {}, ".
|
221 |
-
"lock: function() {}, ".
|
222 |
-
"unlock: function() {}, ".
|
223 |
-
"changeFileName: function(new_filename) {}, ".
|
224 |
-
"files: function() { return []; } ".
|
225 |
-
"};\n\n".$uploadform_item["js"];
|
226 |
-
//append javascript variable that checks if uploadform element exists or not
|
227 |
-
$uploadform_item["js"] .= "\n\nGlobalData.WFU[".$data["ID"]."].uploadform_exist = true;";
|
228 |
-
|
229 |
-
return $uploadform_item;
|
230 |
-
}
|
231 |
-
|
232 |
-
/* Prepare the submit button */
|
233 |
-
function wfu_prepare_submit_block($params, $additional_params, $occurrence_index) {
|
234 |
-
//prepare data for template
|
235 |
-
$data["ID"] = $params["uploadid"];
|
236 |
-
$data["width"] = $additional_params['widths']['uploadbutton'];
|
237 |
-
$data["height"] = $additional_params['heights']['uploadbutton'];
|
238 |
-
$data["responsive"] = ( $params["fitmode"] == "responsive" );
|
239 |
-
$data["testmode"] = ( $params["testmode"] == "true" );
|
240 |
-
$data["allownofile"] = ( $params["allownofile"] == "true" );
|
241 |
-
$data["label"] = $params["uploadbutton"];
|
242 |
-
$data["index"] = $occurrence_index;
|
243 |
-
$data["params"] = $params;
|
244 |
-
|
245 |
-
$submit_item["title"] = 'wordpress_file_upload_submit_'.$data["ID"];
|
246 |
-
$submit_item["hidden"] = false;
|
247 |
-
$submit_item["width"] = "";
|
248 |
-
$submit_item["object"] = "GlobalData.WFU[".$data["ID"]."].submit";
|
249 |
-
//for responsive plugin adjust container and container's parent widths if a % width has been defined
|
250 |
-
if ( $data["responsive"] && strlen($data["width"]) > 1 && substr($data["width"], -1, 1) == "%" ) $submit_item["width"] = $data["width"];
|
251 |
-
|
252 |
-
//read html output from template
|
253 |
-
$submit_item += wfu_read_template_output("submit", $data);
|
254 |
-
//initialize submit element (upload button) object properties
|
255 |
-
$submit_item["js"] = "GlobalData.WFU[".$data["ID"]."].submit = { ".
|
256 |
-
"label_default: '".$data["label"]."', ".
|
257 |
-
"attachClickAction: function(clickaction) { }, ".
|
258 |
-
"updateLabel: function(new_label) { }, ".
|
259 |
-
"toggle: function(status) { } ".
|
260 |
-
"};\n\n".$submit_item["js"];
|
261 |
-
//append javascript variable that checks if upload button element exists
|
262 |
-
$submit_item["js"] .= "\n\nGlobalData.WFU[".$data["ID"]."].submit_exist = true;";
|
263 |
-
|
264 |
-
return $submit_item;
|
265 |
-
}
|
266 |
-
|
267 |
-
|
268 |
-
/* Prepare the webcam */
|
269 |
-
function wfu_prepare_webcam_block($params, $additional_params, $occurrence_index) {
|
270 |
-
//prepare data for template
|
271 |
-
$data["ID"] = $params["uploadid"];
|
272 |
-
$data["width"] = $additional_params['widths']['webcam'];
|
273 |
-
$data["height"] = $additional_params['heights']['webcam'];
|
274 |
-
$data["responsive"] = ( $params["fitmode"] == "responsive" );
|
275 |
-
$data["testmode"] = ( $params["testmode"] == "true" );
|
276 |
-
$data["index"] = $occurrence_index;
|
277 |
-
$data["params"] = $params;
|
278 |
-
|
279 |
-
$webcam_item["title"] = 'wordpress_file_upload_webcam_'.$data["ID"];
|
280 |
-
$webcam_item["hidden"] = false;
|
281 |
-
$webcam_item["width"] = "";
|
282 |
-
$webcam_item["object"] = "GlobalData.WFU[".$data["ID"]."].webcam";
|
283 |
-
|
284 |
-
$webcam_init = "\n".'var wfu_webrtc_ref = document.createElement("SCRIPT");';
|
285 |
-
$webcam_init .= "\n".'wfu_webrtc_ref.setAttribute("type", "text/javascript");';
|
286 |
-
$webcam_init .= "\n".'wfu_webrtc_ref.setAttribute("src", "https://webrtc.github.io/adapter/adapter-latest.js");';
|
287 |
-
$webcam_init .= "\n".'document.getElementById(GlobalData.WFU['.$data["ID"].'].container_id).appendChild(wfu_webrtc_ref);';
|
288 |
-
$webcam_init .= "\n".'var wfu_initialize_webcam_loader_'.$data["ID"].' = function() { wfu_initialize_webcam('.$data["ID"].', "'.$params["webcammode"].'", "'.$params["audiocapture"].'", "'.$params["videowidth"].'", "'.$params["videoheight"].'", "'.$params["videoaspectratio"].'", "'.$params["videoframerate"].'", "'.$params["camerafacing"].'", '.$params["maxrecordtime"].'); }';
|
289 |
-
$webcam_init .= "\n".'if(window.addEventListener) { window.addEventListener("load", wfu_initialize_webcam_loader_'.$data["ID"].', false); } else if(window.attachEvent) { window.attachEvent("onload", wfu_initialize_webcam_loader_'.$data["ID"].'); } else { window["onload"] = wfu_initialize_webcam_loader_'.$data["ID"].'; }';
|
290 |
-
|
291 |
-
//read html output from template
|
292 |
-
$webcam_item += wfu_read_template_output("webcam", $data);
|
293 |
-
//initialize captcha object properties
|
294 |
-
$webcam_item["js"] = "GlobalData.WFU[".$data["ID"]."].webcam = { ".
|
295 |
-
"initCallback: function() {},".
|
296 |
-
"initButtons: function(mode) {},".
|
297 |
-
"updateStatus: function(status) {},".
|
298 |
-
"updateButtonStatus: function(status) {},".
|
299 |
-
"updateTimer: function(time) {},".
|
300 |
-
"updatePlayProgress: function(duration) {},".
|
301 |
-
"setVideoProperties: function(props) {},".
|
302 |
-
"videoSize: function() { return null; },".
|
303 |
-
"readyState: function() { return -1; },".
|
304 |
-
"screenshot: function(savefunc, image_type) {},".
|
305 |
-
"play: function() {},".
|
306 |
-
"pause: function() {},".
|
307 |
-
"back: function() {},".
|
308 |
-
"fwd: function(duration) {},".
|
309 |
-
"ended: function() {}".
|
310 |
-
"};\n\n".$webcam_item["js"].$webcam_init;
|
311 |
-
//append javascript variable that checks if webcam element exists or not
|
312 |
-
$webcam_item["js"] .= "\n\nGlobalData.WFU[".$data["ID"]."].webcam_exist = true;";
|
313 |
-
|
314 |
-
return $webcam_item;
|
315 |
-
}
|
316 |
-
|
317 |
-
/* Prepare the progress bar */
|
318 |
-
function wfu_prepare_progressbar_block($params, $additional_params, $occurrence_index) {
|
319 |
-
//prepare data for template
|
320 |
-
$data["ID"] = $params["uploadid"];
|
321 |
-
$data["width"] = $additional_params['widths']['progressbar'];
|
322 |
-
$data["height"] = $additional_params['heights']['progressbar'];
|
323 |
-
$data["responsive"] = ( $params["fitmode"] == "responsive" );
|
324 |
-
$data["testmode"] = ( $params["testmode"] == "true" );
|
325 |
-
$data["index"] = $occurrence_index;
|
326 |
-
$data["params"] = $params;
|
327 |
-
|
328 |
-
$progressbar_item["title"] = 'wordpress_file_upload_progressbar_'.$data["ID"];
|
329 |
-
$progressbar_item["hidden"] = ( $params["testmode"] != "true" );
|
330 |
-
$progressbar_item["width"] = "";
|
331 |
-
$progressbar_item["object"] = "GlobalData.WFU[".$data["ID"]."].progressbar";
|
332 |
-
//for responsive plugin adjust container's parent width if a % width has been defined
|
333 |
-
if ( $data["responsive"] && strlen($data["width"]) > 1 && substr($data["width"], -1, 1) == "%" ) $progressbar_item["width"] = $data["width"];
|
334 |
-
//read html output from template
|
335 |
-
$progressbar_item += wfu_read_template_output("progressbar", $data);
|
336 |
-
//initialize progressbar object properties
|
337 |
-
$progressbar_item["js"] = "GlobalData.WFU[".$data["ID"]."].progressbar = { ".
|
338 |
-
"show: function(mode) {}, ".
|
339 |
-
"hide: function() {}, ".
|
340 |
-
"update: function(progress) {} ".
|
341 |
-
"};\n\n".$progressbar_item["js"];
|
342 |
-
//append javascript variable that checks if progress bar exists or not
|
343 |
-
$progressbar_item["js"] .= "\n\nGlobalData.WFU[".$data["ID"]."].progressbar_exist = true;";
|
344 |
-
|
345 |
-
return $progressbar_item;
|
346 |
-
}
|
347 |
-
|
348 |
-
/* Prepare the message block */
|
349 |
-
function wfu_prepare_message_block($params, $additional_params, $occurrence_index) {
|
350 |
-
//prepare data for template
|
351 |
-
$data["ID"] = $params["uploadid"];
|
352 |
-
$data["width"] = $additional_params['widths']['message'];
|
353 |
-
$data["height"] = $additional_params['heights']['message'];
|
354 |
-
$data["responsive"] = ( $params["fitmode"] == "responsive" );
|
355 |
-
$data["testmode"] = ( $params["testmode"] == "true" );
|
356 |
-
$data["index"] = $occurrence_index;
|
357 |
-
$data["params"] = $params;
|
358 |
-
|
359 |
-
$header_styles["State0"] = wfu_prepare_message_colors(WFU_VAR("WFU_HEADERMESSAGECOLORS_STATE0"));
|
360 |
-
$header_styles["State0"]['message'] = WFU_UPLOAD_STATE0;
|
361 |
-
$header_styles["State1"] = wfu_prepare_message_colors(WFU_VAR("WFU_HEADERMESSAGECOLORS_STATE1"));
|
362 |
-
$header_styles["State1"]['message'] = WFU_UPLOAD_STATE1;
|
363 |
-
$header_styles["State2"] = wfu_prepare_message_colors(WFU_VAR("WFU_HEADERMESSAGECOLORS_STATE2"));
|
364 |
-
$header_styles["State2"]['message'] = WFU_UPLOAD_STATE2;
|
365 |
-
$header_styles["State3"] = wfu_prepare_message_colors(WFU_VAR("WFU_HEADERMESSAGECOLORS_STATE3"));
|
366 |
-
$header_styles["State3"]['message'] = WFU_UPLOAD_STATE3;
|
367 |
-
$header_styles["State4"] = wfu_prepare_message_colors(WFU_VAR("WFU_HEADERMESSAGECOLORS_STATE4"));
|
368 |
-
$header_styles["State4"]['message'] = WFU_UPLOAD_STATE4;
|
369 |
-
$header_styles["State5"] = wfu_prepare_message_colors(WFU_VAR("WFU_HEADERMESSAGECOLORS_STATE5"));
|
370 |
-
$header_styles["State5"]['message'] = WFU_UPLOAD_STATE5;
|
371 |
-
$header_styles["State5_singlefile"] = wfu_prepare_message_colors(WFU_VAR("WFU_HEADERMESSAGECOLORS_STATE5"));
|
372 |
-
$header_styles["State5_singlefile"]['message'] = WFU_UPLOAD_STATE5_SINGLEFILE;
|
373 |
-
$header_styles["State6"] = wfu_prepare_message_colors(WFU_VAR("WFU_HEADERMESSAGECOLORS_STATE6"));
|
374 |
-
$header_styles["State6"]['message'] = WFU_UPLOAD_STATE6;
|
375 |
-
$header_styles["State7"] = wfu_prepare_message_colors(WFU_VAR("WFU_HEADERMESSAGECOLORS_STATE7"));
|
376 |
-
$header_styles["State7"]['message'] = WFU_UPLOAD_STATE7;
|
377 |
-
$header_styles["State7_singlefile"] = wfu_prepare_message_colors(WFU_VAR("WFU_HEADERMESSAGECOLORS_STATE7"));
|
378 |
-
$header_styles["State7_singlefile"]['message'] = WFU_UPLOAD_STATE7_SINGLEFILE;
|
379 |
-
$header_styles["State8"] = wfu_prepare_message_colors(WFU_VAR("WFU_HEADERMESSAGECOLORS_STATE8"));
|
380 |
-
$header_styles["State8"]['message'] = WFU_UPLOAD_STATE8;
|
381 |
-
$header_styles["State9"] = wfu_prepare_message_colors(WFU_VAR("WFU_HEADERMESSAGECOLORS_STATE9"));
|
382 |
-
$header_styles["State9"]['message'] = WFU_UPLOAD_STATE9;
|
383 |
-
$header_styles["State10"] = wfu_prepare_message_colors(WFU_VAR("WFU_HEADERMESSAGECOLORS_STATE10"));
|
384 |
-
$header_styles["State10"]['message'] = WFU_UPLOAD_STATE10;
|
385 |
-
$header_styles["State11"] = wfu_prepare_message_colors(WFU_VAR("WFU_HEADERMESSAGECOLORS_STATE11"));
|
386 |
-
$header_styles["State11"]['message'] = WFU_UPLOAD_STATE11;
|
387 |
-
$header_styles["State12"] = wfu_prepare_message_colors(WFU_VAR("WFU_HEADERMESSAGECOLORS_STATE12"));
|
388 |
-
$header_styles["State12"]['message'] = WFU_UPLOAD_STATE12;
|
389 |
-
$header_styles["State13"] = wfu_prepare_message_colors(WFU_VAR("WFU_HEADERMESSAGECOLORS_STATE13"));
|
390 |
-
$header_styles["State13"]['message'] = WFU_UPLOAD_STATE13;
|
391 |
-
$header_styles["State14"] = wfu_prepare_message_colors(WFU_VAR("WFU_HEADERMESSAGECOLORS_STATE14"));
|
392 |
-
$header_styles["State14"]['message'] = WFU_UPLOAD_STATE14;
|
393 |
-
$header_styles["State15"] = wfu_prepare_message_colors(WFU_VAR("WFU_HEADERMESSAGECOLORS_STATE15"));
|
394 |
-
$header_styles["State15"]['message'] = WFU_UPLOAD_STATE15;
|
395 |
-
$header_styles["State16"] = wfu_prepare_message_colors(WFU_VAR("WFU_HEADERMESSAGECOLORS_STATE16"));
|
396 |
-
$header_styles["State16"]['message'] = WFU_UPLOAD_STATE16;
|
397 |
-
$header_styles["State17"] = wfu_prepare_message_colors(WFU_VAR("WFU_HEADERMESSAGECOLORS_STATE17"));
|
398 |
-
$header_styles["State17"]['message'] = WFU_UPLOAD_STATE17;
|
399 |
-
$header_styles["State18"] = wfu_prepare_message_colors(WFU_VAR("WFU_HEADERMESSAGECOLORS_STATE18"));
|
400 |
-
$header_styles["State18"]['message'] = WFU_UPLOAD_STATE18;
|
401 |
-
$header_styles["State19"] = wfu_prepare_message_colors(WFU_VAR("WFU_HEADERMESSAGECOLORS_STATE19"));
|
402 |
-
$header_styles["State19"]['message'] = WFU_UPLOAD_STATE19;
|
403 |
-
$data["header_styles"] = $header_styles;
|
404 |
-
|
405 |
-
$message_item["title"] = 'wordpress_file_upload_message_'.$data["ID"];
|
406 |
-
$message_item["hidden"] = false;
|
407 |
-
$message_item["width"] = "";
|
408 |
-
$message_item["object"] = "GlobalData.WFU[".$data["ID"]."].message";
|
409 |
-
//for responsive plugin adjust container and container's parent widths if a % width has been defined
|
410 |
-
if ( $data["responsive"] && strlen($data["width"]) > 1 && substr($data["width"], -1, 1) == "%" ) $message_item["width"] = $data["width"];
|
411 |
-
|
412 |
-
// $message_block = wfu_prepare_message_block_skeleton($sid, $styles, ( $params["testmode"] == "true" ));
|
413 |
-
// $message_item = $message_block["msgblock"];
|
414 |
-
|
415 |
-
$message_init = "\n".'if (!GlobalData.States) {';
|
416 |
-
$message_init .= "\n\t".'GlobalData.States = {};';
|
417 |
-
foreach ( $data["header_styles"] as $state => $statedata )
|
418 |
-
$message_init .= "\n\t\t".'GlobalData.States.'.$state.' = { color:"'.$statedata["color"].'", bgcolor:"'.$statedata["bgcolor"].'", borcolor:"'.$statedata["borcolor"].'", message:"'.$statedata["message"].'" };';
|
419 |
-
$message_init .= "\n\t".'GlobalData.Colors = {';
|
420 |
-
$message_init .= "\n\t\t".'default: "'.WFU_VAR("WFU_DEFAULTMESSAGECOLORS").'".split(","),';
|
421 |
-
$message_init .= "\n\t\t".'success: "'.$params['successmessagecolors'].'".split(","),';
|
422 |
-
$message_init .= "\n\t\t".'warning: "'.$params['warningmessagecolors'].'".split(","),';
|
423 |
-
$message_init .= "\n\t\t".'error: "'.$params['failmessagecolors'].'".split(",")';
|
424 |
-
$message_init .= "\n\t".'};';
|
425 |
-
$message_init .= "\n".'}';
|
426 |
-
|
427 |
-
//read html output from template
|
428 |
-
$message_item += wfu_read_template_output("message", $data);
|
429 |
-
//extract header_template and file_template
|
430 |
-
$header_template = "";
|
431 |
-
$header_template_line = "";
|
432 |
-
$in_header_template_block = false;
|
433 |
-
$file_template = "";
|
434 |
-
$file_template_line = "";
|
435 |
-
$in_file_template_block = false;
|
436 |
-
foreach ( $message_item as $key => $item ) {
|
437 |
-
if ( $in_header_template_block ) {
|
438 |
-
unset($message_item[$key]);
|
439 |
-
if ( $item != "</header_template><file_template>" ) $header_template .= $item."\n";
|
440 |
-
else {
|
441 |
-
$in_header_template_block = false;
|
442 |
-
$in_file_template_block = true;
|
443 |
-
}
|
444 |
-
}
|
445 |
-
elseif ( $in_file_template_block ) {
|
446 |
-
unset($message_item[$key]);
|
447 |
-
if ( $item != "</file_template>" ) $file_template .= $item."\n";
|
448 |
-
else $in_file_template_block = false;
|
449 |
-
}
|
450 |
-
elseif ( substr($key, 0, 4) == "line" ) {
|
451 |
-
if ( $item == "<header_template>" ) {
|
452 |
-
unset($message_item[$key]);
|
453 |
-
$in_header_template_block = true;
|
454 |
-
}
|
455 |
-
elseif ( strpos($item, "[header_template]") !== false ) $header_template_line = $key;
|
456 |
-
elseif ( strpos($item, "[file_template]") !== false ) $file_template_line = $key;
|
457 |
-
}
|
458 |
-
}
|
459 |
-
if ( $header_template_line != "" )
|
460 |
-
$message_item[$header_template_line] = str_replace("[header_template]", wfu_plugin_encode_string(trim($header_template)), $message_item[$header_template_line]);
|
461 |
-
if ( $file_template_line != "" )
|
462 |
-
$message_item[$file_template_line] = str_replace("[file_template]", wfu_plugin_encode_string(trim($file_template)), $message_item[$file_template_line]);
|
463 |
-
//initialize message object properties
|
464 |
-
$message_item["js"] = "GlobalData.WFU[".$data["ID"]."].message = { ".
|
465 |
-
"update: function(data) {},".
|
466 |
-
"reset: function() {}".
|
467 |
-
"};\n\n".$message_item["js"].$message_init;
|
468 |
-
//append javascript variable that checks if message block exists or not
|
469 |
-
$message_item["js"] .= "\n\nGlobalData.WFU[".$data["ID"]."].message_exist = true;";
|
470 |
-
|
471 |
-
return $message_item;
|
472 |
-
}
|
473 |
-
|
474 |
-
/* Prepare the user data block */
|
475 |
-
function wfu_prepare_userdata_block($params, $additional_params, $occurrence_index) {
|
476 |
-
$data["ID"] = $params["uploadid"];
|
477 |
-
$data["width"] = $additional_params['widths']['userdata'];
|
478 |
-
$data["height"] = $additional_params['heights']['userdata'];
|
479 |
-
$data["width_label"] = $additional_params['widths']['userdata_label'];
|
480 |
-
$data["height_label"] = $additional_params['heights']['userdata_label'];
|
481 |
-
$data["width_value"] = $additional_params['widths']['userdata_value'];
|
482 |
-
$data["height_value"] = $additional_params['heights']['userdata_value'];
|
483 |
-
$data["responsive"] = ( $params["fitmode"] == "responsive" );
|
484 |
-
$data["testmode"] = ( $params["testmode"] == "true" );
|
485 |
-
$data["props"] = array();
|
486 |
-
$data["index"] = $occurrence_index;
|
487 |
-
$data["params"] = $params;
|
488 |
-
//fill $data["props"] variable with properties of existing userdata fields
|
489 |
-
foreach ($params["userdata_fields"] as $userdata_key => $userdata_field) {
|
490 |
-
//use only fields belonging to $occurrence_index
|
491 |
-
if ( $occurrence_index == 0 || $userdata_field["occurrence"] == $occurrence_index ) {
|
492 |
-
$props = $userdata_field;
|
493 |
-
$props["key"] = $userdata_key;
|
494 |
-
array_push($data["props"], $props);
|
495 |
-
}
|
496 |
-
}
|
497 |
-
|
498 |
-
$userdata_item["title"] = 'wordpress_file_upload_userdata_'.$data["ID"].( $occurrence_index == 0 ? "" : "_".($occurrence_index - 1) );
|
499 |
-
$userdata_item["hidden"] = false;
|
500 |
-
$userdata_item["width"] = "";
|
501 |
-
$userdata_item["object"] = "GlobalData.WFU[".$data["ID"]."].userdata";
|
502 |
-
//for responsive plugin adjust container and container's parent widths if a % width has been defined
|
503 |
-
if ( $data["responsive"] && strlen($data["width"]) > 1 && substr($data["width"], -1, 1) == "%" ) $userdata_item["width"] = $data["width"];
|
504 |
-
$userdata_item += wfu_read_template_output("userdata", $data);
|
505 |
-
//extract templates of field types
|
506 |
-
$templates_html = "";
|
507 |
-
foreach ( $userdata_item as $key => $item ) {
|
508 |
-
if ( substr($key, 0, 4) == "line" ) {
|
509 |
-
$templates_html .= ( $templates_html == "" ? "" : "\r\n" ).$item;
|
510 |
-
unset($userdata_item[$key]);
|
511 |
-
}
|
512 |
-
}
|
513 |
-
//subclass init() function of userdata object so that it fills WFU.userdata
|
514 |
-
//object with properties and code handlers of the userdata fields;
|
515 |
-
//the subclassed init() function is carefully written because userdata is a
|
516 |
-
//multiplacements component, so init() function will run more than once
|
517 |
-
//and every time it runs we need to make sure that only the elements
|
518 |
-
//corresponding to the specific $occurrence_index will be initialized
|
519 |
-
$init_index = ( $occurrence_index <= 1 ? 0 : $occurrence_index - 1 );
|
520 |
-
$userdata_init = "";
|
521 |
-
$userdata_init .= "\n".'GlobalData.WFU['.$data["ID"].'].userdata._init'.$init_index.' = GlobalData.WFU['.$data["ID"].'].userdata.init;';
|
522 |
-
$userdata_init .= "\n".'GlobalData.WFU['.$data["ID"].'].userdata.init = function() {';
|
523 |
-
$userdata_init .= "\n\t".'GlobalData.WFU['.$data["ID"].'].userdata._init'.$init_index.'();';
|
524 |
-
$userdata_init .= "\n\t".'var WFU = GlobalData.WFU['.$data["ID"].'];';
|
525 |
-
if ( $init_index == 0 ) {
|
526 |
-
$userdata_init .= "\n\t".'if (typeof WFU.userdata.init_count == "undefined") {';
|
527 |
-
$userdata_init .= "\n\t\t".'WFU.userdata.init_count = 0;';
|
528 |
-
$userdata_init .= "\n\t\t".'WFU.userdata.codes = [];';
|
529 |
-
$userdata_init .= "\n\t\t".'WFU.userdata.props = [];';
|
530 |
-
$userdata_init .= "\n\t".'}';
|
531 |
-
$userdata_init .= "\n\t".'else WFU.userdata.init_count ++;';
|
532 |
-
}
|
533 |
-
$userdata_init .= "\n\t".'if (WFU.userdata.init_count == '.$init_index.') {';
|
534 |
-
$i = 1;
|
535 |
-
foreach ($params["userdata_fields"] as $userdata_key => $userdata_field) {
|
536 |
-
//show only fields belonging to $occurrence_index
|
537 |
-
if ( $occurrence_index == 0 || $userdata_field["occurrence"] == $occurrence_index ) {
|
538 |
-
$userdata_field["key"] = $userdata_key;
|
539 |
-
//get field template
|
540 |
-
$template = "";
|
541 |
-
$matches = array();
|
542 |
-
preg_match("/<userdata_".$userdata_field["key"]."_template>(.*?)<\/userdata_".$userdata_field["key"]."_template>/s", $templates_html, $matches);
|
543 |
-
if ( isset($matches[1]) ) $template = $matches[1];
|
544 |
-
//generate html code
|
545 |
-
foreach ( explode("\r\n", $template) as $line ) $userdata_item["line".$i++] = $line;
|
546 |
-
//generate javascript code
|
547 |
-
$userdata_init .= "\n\t\t".'WFU.userdata.codes['.$userdata_field["key"].'] = {};';
|
548 |
-
$userdata_init .= "\n\t\t".'WFU.userdata.props['.$userdata_field["key"].'] = '.wfu_PHP_array_to_JS_object($userdata_field).';';
|
549 |
-
$userdata_init .= "\n\t\t".'WFU.userdata.props['.$userdata_field["key"].'].store = function() { document.getElementById("hiddeninput_'.$data["ID"].'_userdata_'.$userdata_field["key"].'").value = WFU.userdata.codes['.$userdata_field["key"].'].value(); };';
|
550 |
-
$userdata_init .= "\n\t\t".'WFU.userdata.props['.$userdata_field["key"].'].getstored = function() { return document.getElementById("hiddeninput_'.$data["ID"].'_userdata_'.$userdata_field["key"].'").value; };';
|
551 |
-
$userdata_init .= "\n\t\t".'wfu_init_userdata_handlers('.$data["ID"].', '.$userdata_field["key"].');';
|
552 |
-
}
|
553 |
-
}
|
554 |
-
$userdata_init .= "\n\t".'}';
|
555 |
-
$userdata_init .= "\n".'}';
|
556 |
-
//initialize userdata object properties only for the first $occurrence_index
|
557 |
-
if ( $init_index == 0 ) {
|
558 |
-
$userdata_item["js"] = "GlobalData.WFU[".$data["ID"]."].userdata = { ".
|
559 |
-
"initField: function(props) {}, ".
|
560 |
-
"attachHandlers: function(props, handlerfunc) {}, ".
|
561 |
-
"getValue: function(props) { return ''; }, ".
|
562 |
-
"setValue: function(props, value) {}, ".
|
563 |
-
"enable: function(props) {}, ".
|
564 |
-
"disable: function(props) {}, ".
|
565 |
-
"prompt: function(props, message) {}".
|
566 |
-
"};\n\n".$userdata_item["js"];
|
567 |
-
}
|
568 |
-
else $userdata_item["js"] = "";
|
569 |
-
$userdata_item["js"] .= $userdata_init;
|
570 |
-
//append javascript additional userdata variables only for the first
|
571 |
-
//$occurrence_index
|
572 |
-
if ( $init_index == 0 ) {
|
573 |
-
$userdata_item["js"] .= "\n\nGlobalData.WFU[".$data["ID"]."].userdata_exist = true;";
|
574 |
-
$userdata_item["js"] .= "\n\nGlobalData.WFU[".$data["ID"]."].userdata.error_empty = \"".WFU_ERROR_USERDATA_EMPTY."\";";
|
575 |
-
$userdata_item["js"] .= "\n\nGlobalData.WFU[".$data["ID"]."].userdata.error_invalid_number = \"".WFU_ERROR_USERDATANUMBER_INVALID."\";";
|
576 |
-
$userdata_item["js"] .= "\n\nGlobalData.WFU[".$data["ID"]."].userdata.error_invalid_email = \"".WFU_ERROR_USERDATAEMAIL_INVALID."\";";
|
577 |
-
$userdata_item["js"] .= "\n\nGlobalData.WFU[".$data["ID"]."].userdata.error_confirm_email_nomatch = \"".WFU_ERROR_USERDATACONFIRMEMAIL_NOMATCH."\";";
|
578 |
-
$userdata_item["js"] .= "\n\nGlobalData.WFU[".$data["ID"]."].userdata.error_confirm_email_nobase = \"".WFU_ERROR_USERDATACONFIRMEMAIL_NOBASE."\";";
|
579 |
-
$userdata_item["js"] .= "\n\nGlobalData.WFU[".$data["ID"]."].userdata.error_confirm_password_nomatch = \"".WFU_ERROR_USERDATACONFIRMPASSWORD_NOMATCH."\";";
|
580 |
-
$userdata_item["js"] .= "\n\nGlobalData.WFU[".$data["ID"]."].userdata.error_confirm_password_nobase = \"".WFU_ERROR_USERDATACONFIRMPASSWORD_NOBASE."\";";
|
581 |
-
$userdata_item["js"] .= "\n\nGlobalData.WFU[".$data["ID"]."].userdata.error_checkbox_notchecked = \"".WFU_ERROR_USERDATACHECKBOX_NOTCHECKED."\";";
|
582 |
-
$userdata_item["js"] .= "\n\nGlobalData.WFU[".$data["ID"]."].userdata.error_radio_notselected = \"".WFU_ERROR_USERDATARADIO_NOTSELECTED."\";";
|
583 |
-
}
|
584 |
-
|
585 |
-
return $userdata_item;
|
586 |
-
}
|
587 |
-
|
588 |
-
/* Prepare the consent question block */
|
589 |
-
function wfu_prepare_consent_block($params, $additional_params, $occurrence_index) {
|
590 |
-
//prepare data for template
|
591 |
-
$data["ID"] = $params["uploadid"];
|
592 |
-
$data["width"] = $additional_params['widths']['consent'];
|
593 |
-
$data["height"] = $additional_params['heights']['consent'];
|
594 |
-
$data["responsive"] = ( $params["fitmode"] == "responsive" );
|
595 |
-
$data["testmode"] = ( $params["testmode"] == "true" );
|
596 |
-
$data["index"] = $occurrence_index;
|
597 |
-
$data["format"] = $params["consentformat"];
|
598 |
-
$data["preselected"] = $params["consentpreselect"];
|
599 |
-
$data["question"] = preg_replace("/:(\w*):/", "<a href=\"".$params["consentdisclaimer"]."\">$1</a>", $params["consentquestion"]);
|
600 |
-
$data["params"] = $params;
|
601 |
-
|
602 |
-
$consent_item["title"] = 'wordpress_file_upload_consent_'.$data["ID"];
|
603 |
-
$consent_item["hidden"] = ( $params["consentformat"] == "prompt" );
|
604 |
-
$consent_item["width"] = "";
|
605 |
-
$consent_item["object"] = "GlobalData.WFU[".$data["ID"]."].consent";
|
606 |
-
//for responsive plugin adjust container and container's parent widths if a % width has been defined
|
607 |
-
if ( $data["responsive"] && strlen($data["width"]) > 1 && substr($data["width"], -1, 1) == "%" ) $consent_item["width"] = $data["width"];
|
608 |
-
//read html output from template
|
609 |
-
$consent_item += wfu_read_template_output("consent", $data);
|
610 |
-
//initialize consent object properties
|
611 |
-
$consent_item["js"] = "GlobalData.WFU[".$data["ID"]."].consent = { ".
|
612 |
-
"consentCompleted: function() { return false; }, ".
|
613 |
-
"attachActions: function(completeaction) {}, ".
|
614 |
-
"update: function(action) {} ".
|
615 |
-
"};\n\n".$consent_item["js"];
|
616 |
-
//append javascript variable that checks if consent exists or not
|
617 |
-
$consent_item["js"] .= "\n\nGlobalData.WFU[".$data["ID"]."].consent_exist = true;";
|
618 |
-
//append additional consent parameters
|
619 |
-
$consent_item["js"] .= "\n\nGlobalData.WFU[".$data["ID"]."].consent.remember_consent = ".( $params["notrememberconsent"] != "true" ? "true" : "false" ).";";
|
620 |
-
$consent_item["js"] .= "\n\nGlobalData.WFU[".$data["ID"]."].consent.no_rejects_upload = ".( $params["consentrejectupload"] == "true" ? "true" : "false" ).";";
|
621 |
-
$consent_item["js"] .= "\n\nGlobalData.WFU[".$data["ID"]."].consent.consent_format = '".$params["consentformat"]."';";
|
622 |
-
$consent_item["js"] .= "\n\nGlobalData.WFU[".$data["ID"]."].consent.consent_question = '".preg_replace("/:(\w):/", "<a href=\"".$params["consentdisclaimer"]."\">$1</a>", $params["consentquestion"])."';";
|
623 |
-
|
624 |
-
return $consent_item;
|
625 |
-
}
|
626 |
-
|
627 |
-
?>
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/* Prepare the uploadform generic element */
|
4 |
+
function wfu_prepare_base_block($params, $additional_params, $occurrence_index) {
|
5 |
+
//prepare data for template
|
6 |
+
$data["ID"] = $params["uploadid"];
|
7 |
+
$data["responsive"] = ( $params["fitmode"] == "responsive" );
|
8 |
+
$data["testmode"] = ( $params["testmode"] == "true" );
|
9 |
+
$data["params"] = $params;
|
10 |
+
|
11 |
+
$base_item["title"] = '';
|
12 |
+
$base_item["hidden"] = false;
|
13 |
+
$base_item["width"] = "";
|
14 |
+
$base_item["object"] = "GlobalData.WFU[".$data["ID"]."].base";
|
15 |
+
//read html output from template
|
16 |
+
$base_item += wfu_read_template_output("base", $data);
|
17 |
+
|
18 |
+
return $base_item;
|
19 |
+
}
|
20 |
+
|
21 |
+
/* Prepare the visual editor button */
|
22 |
+
function wfu_prepare_visualeditorbutton_block($params, $additional_params, $occurrence_index) {
|
23 |
+
if ( isset($params["uploadid"]) ) {
|
24 |
+
$ID = $params["uploadid"];
|
25 |
+
$JS_Object = "GlobalData.WFU[".$ID."].visualeditorbutton";
|
26 |
+
}
|
27 |
+
else {
|
28 |
+
$ID = $params["browserid"];
|
29 |
+
$JS_Object = "GlobalData.WFUB[".$ID."].visualeditorbutton";
|
30 |
+
}
|
31 |
+
//prepare data for template
|
32 |
+
$data["ID"] = $ID;
|
33 |
+
$data["shortcode_tag"] = $additional_params['shortcode_tag'];
|
34 |
+
$data["JS_Object"] = $JS_Object;
|
35 |
+
$data["params"] = $params;
|
36 |
+
|
37 |
+
$visualeditorbutton_item["title"] = '';
|
38 |
+
$visualeditorbutton_item["hidden"] = false;
|
39 |
+
$visualeditorbutton_item["width"] = "";
|
40 |
+
$visualeditorbutton_item["object"] = $JS_Object;
|
41 |
+
//read html output from template
|
42 |
+
$visualeditorbutton_item += wfu_read_template_output("visualeditorbutton", $data);
|
43 |
+
//initialize title object properties
|
44 |
+
$visualeditorbutton_item["js"] = $JS_Object." = { ".
|
45 |
+
"shortcode_tag: \"".$data["shortcode_tag"]."\", ".
|
46 |
+
"attachInvokeHandler: function(invoke_function) {}, ".
|
47 |
+
"onInvoke: function() {}, ".
|
48 |
+
"afterInvoke: function() {}".
|
49 |
+
"};\n\n".$visualeditorbutton_item["js"];
|
50 |
+
//append javascript variable that checks if title exists or not
|
51 |
+
$visualeditorbutton_item["js"] .= "\n\n".$JS_Object."_exist = true;";
|
52 |
+
|
53 |
+
return $visualeditorbutton_item;
|
54 |
+
}
|
55 |
+
|
56 |
+
|
57 |
+
/* Prepare information about directory or selection of target subdirectory */
|
58 |
+
function wfu_prepare_subfolders_block($params, $additional_params, $occurrence_index) {
|
59 |
+
//prepare data for template
|
60 |
+
$data["ID"] = $params["uploadid"];
|
61 |
+
$data["widths"] = $additional_params['widths'];
|
62 |
+
$data["heights"] = $additional_params['heights'];
|
63 |
+
$data["responsive"] = ( $params["fitmode"] == "responsive" );
|
64 |
+
$data["testmode"] = ( $params["testmode"] == "true" );
|
65 |
+
$data["show_uploadfolder"] = ( $params["showtargetfolder"] == "true" );
|
66 |
+
$data["show_subfolders"] = ( $params["askforsubfolders"] == "true" );
|
67 |
+
$data["editable"] = ( substr($params["subfoldertree"], 0, 5) == "auto+" );
|
68 |
+
$data["uploadfolder"] = wfu_upload_plugin_directory($params["uploadpath"]);
|
69 |
+
$data["uploadfolder_title"] = $params["targetfolderlabel"];
|
70 |
+
$data["subfolders"] = array( 'path' => array(), 'label' => array(), 'level' => array(), 'default' => array() );
|
71 |
+
$data["subfolders_title"] = $params["subfolderlabel"];
|
72 |
+
$data["index"] = $occurrence_index;
|
73 |
+
$data["params"] = $params;
|
74 |
+
//prepare data of subfolders
|
75 |
+
if ( $data["show_subfolders"] && !$data["testmode"] ) {
|
76 |
+
if ( substr($params["subfoldertree"], 0, 4) == "auto" ) {
|
77 |
+
$upload_directory = wfu_upload_plugin_full_path($params);
|
78 |
+
$dirtree = wfu_getTree($upload_directory);
|
79 |
+
foreach ( $dirtree as &$dir ) $dir = '*'.$dir;
|
80 |
+
$params["subfoldertree"] = implode(',', $dirtree);
|
81 |
+
}
|
82 |
+
$subfolders = wfu_parse_folderlist($params["subfoldertree"]);
|
83 |
+
if ( count($subfolders['path']) == 0 ) {
|
84 |
+
array_push($subfolders['path'], "");
|
85 |
+
array_push($subfolders['label'], wfu_upload_plugin_directory($params["uploadpath"]));
|
86 |
+
array_push($subfolders['level'], 0);
|
87 |
+
array_push($subfolders['default'], false);
|
88 |
+
}
|
89 |
+
$data["subfolders"] = $subfolders;
|
90 |
+
}
|
91 |
+
|
92 |
+
$subfolders_item = null;
|
93 |
+
if ( $data["show_uploadfolder"] || $data["show_subfolders"] ) {
|
94 |
+
$subfolders_item["title"] = 'wordpress_file_upload_subfolders_'.$data["ID"];
|
95 |
+
$subfolders_item["hidden"] = false;
|
96 |
+
$subfolders_item["width"] = "";
|
97 |
+
$subfolders_item["object"] = "GlobalData.WFU[".$data["ID"]."].subfolders";
|
98 |
+
//for responsive plugin adjust width
|
99 |
+
if ( $data["responsive"] ) $subfolders_item["width"] = $data["width"];
|
100 |
+
//read html output from template
|
101 |
+
$subfolders_item += wfu_read_template_output("subfolders", $data);
|
102 |
+
//initialize subfolders object properties
|
103 |
+
$subfolders_item["js"] = "GlobalData.WFU[".$data["ID"]."].subfolders = { ".
|
104 |
+
"update_handler: function(new_value) { document.getElementById('hiddeninput_".$data["ID"]."').value = new_value; }, ".
|
105 |
+
"check: function() { return true; }, ".
|
106 |
+
"index: function() { return -1; }, ".
|
107 |
+
"reset: function() {}, ".
|
108 |
+
"toggle: function(enabled) {}".
|
109 |
+
"};\n\n".$subfolders_item["js"];
|
110 |
+
//append javascript variable that checks if subfolders element exists or not
|
111 |
+
if ( $data["show_subfolders"] ) $subfolders_item["js"] .= "\n\nGlobalData.WFU[".$data["ID"]."].subfolders_exist = true;";
|
112 |
+
}
|
113 |
+
|
114 |
+
return $subfolders_item;
|
115 |
+
}
|
116 |
+
|
117 |
+
/* Prepare the title */
|
118 |
+
function wfu_prepare_title_block($params, $additional_params, $occurrence_index) {
|
119 |
+
//prepare data for template
|
120 |
+
$data["ID"] = $params["uploadid"];
|
121 |
+
$data["width"] = $additional_params['widths']['title'];
|
122 |
+
$data["height"] = $additional_params['heights']['title'];
|
123 |
+
$data["responsive"] = ( $params["fitmode"] == "responsive" );
|
124 |
+
$data["testmode"] = ( $params["testmode"] == "true" );
|
125 |
+
$data["title"] = $params["uploadtitle"];
|
126 |
+
$data["index"] = $occurrence_index;
|
127 |
+
$data["params"] = $params;
|
128 |
+
|
129 |
+
$title_item["title"] = 'wordpress_file_upload_title_'.$data["ID"];
|
130 |
+
$title_item["hidden"] = false;
|
131 |
+
$title_item["width"] = "";
|
132 |
+
$title_item["object"] = "GlobalData.WFU[".$data["ID"]."].title";
|
133 |
+
//for responsive plugin adjust container and container's parent widths if a % width has been defined
|
134 |
+
if ( $data["responsive"] && strlen($data["width"]) > 1 && substr($data["width"], -1, 1) == "%" ) $title_item["width"] = $data["width"];
|
135 |
+
//read html output from template
|
136 |
+
$title_item += wfu_read_template_output("title", $data);
|
137 |
+
//initialize title object properties
|
138 |
+
$title_item["js"] = "GlobalData.WFU[".$data["ID"]."].title = {};\n\n".$title_item["js"];
|
139 |
+
//append javascript variable that checks if title exists or not
|
140 |
+
$title_item["js"] .= "\n\nGlobalData.WFU[".$data["ID"]."].title_exist = true;";
|
141 |
+
|
142 |
+
return $title_item;
|
143 |
+
}
|
144 |
+
|
145 |
+
/* Prepare the text box showing filename */
|
146 |
+
function wfu_prepare_textbox_block($params, $additional_params, $occurrence_index) {
|
147 |
+
//prepare data for template
|
148 |
+
$data["ID"] = $params["uploadid"];
|
149 |
+
$data["width"] = $additional_params['widths']['filename'];
|
150 |
+
$data["height"] = $additional_params['heights']['filename'];
|
151 |
+
$data["responsive"] = ( $params["fitmode"] == "responsive" );
|
152 |
+
$data["testmode"] = ( $params["testmode"] == "true" );
|
153 |
+
$data["index"] = $occurrence_index;
|
154 |
+
$data["params"] = $params;
|
155 |
+
|
156 |
+
|
157 |
+
$textbox_item["title"] = 'wordpress_file_upload_textbox_'.$data["ID"];
|
158 |
+
$textbox_item["hidden"] = false;
|
159 |
+
$textbox_item["width"] = "";
|
160 |
+
$textbox_item["object"] = "GlobalData.WFU[".$data["ID"]."].textbox";
|
161 |
+
//for responsive plugin adjust container and container's parent widths if a % width has been defined
|
162 |
+
if ( $data["responsive"] && strlen($data["width"]) > 1 && substr($data["width"], -1, 1) == "%" ) $textbox_item["width"] = $data["width"];
|
163 |
+
//read html output from template
|
164 |
+
$textbox_item += wfu_read_template_output("textbox", $data);
|
165 |
+
//initialize textbox object properties
|
166 |
+
$textbox_item["js"] = "GlobalData.WFU[".$data["ID"]."].textbox = { ".
|
167 |
+
"attachCancelHandler: function(cancel_function) {}, ".
|
168 |
+
"dettachCancelHandler: function() {}, ".
|
169 |
+
"update: function(action, filenames) {} ".
|
170 |
+
"};\n\n".$textbox_item["js"];
|
171 |
+
//append javascript variable that checks if textbox exists or not
|
172 |
+
$textbox_item["js"] .= "\n\nGlobalData.WFU[".$data["ID"]."].textbox_exist = true;";
|
173 |
+
|
174 |
+
return $textbox_item;
|
175 |
+
}
|
176 |
+
|
177 |
+
/* Prepare the upload form (required) */
|
178 |
+
function wfu_prepare_uploadform_block($params, $additional_params, $occurrence_index) {
|
179 |
+
//prepare data for template
|
180 |
+
$data["ID"] = $params["uploadid"];
|
181 |
+
$data["width"] = $additional_params['widths']['selectbutton'];
|
182 |
+
$data["height"] = $additional_params['heights']['selectbutton'];
|
183 |
+
$data["responsive"] = ( $params["fitmode"] == "responsive" );
|
184 |
+
$data["testmode"] = ( $params["testmode"] == "true" );
|
185 |
+
$data["label"] = $params["selectbutton"];
|
186 |
+
$data["filename"] = "uploadedfile_".$data["ID"];
|
187 |
+
$data["hidden_elements"] = array(
|
188 |
+
array( "id" => "wfu_uploader_nonce_".$data["ID"], "name" => "wfu_uploader_nonce", "value" => wp_create_nonce("wfu-uploader-nonce") ),
|
189 |
+
array( "id" => "hiddeninput_".$data["ID"], "name" => "hiddeninput_".$data["ID"], "value" => "" ),
|
190 |
+
array( "id" => "uniqueuploadid_".$data["ID"], "name" => "uniqueuploadid_".$data["ID"], "value" => "" ),
|
191 |
+
array( "id" => "nofileupload_".$data["ID"], "name" => "nofileupload_".$data["ID"], "value" => "0" ),
|
192 |
+
array( "id" => "uploadedfile_".$data["ID"]."_name", "name" => "uploadedfile_".$data["ID"]."_name", "value" => wfu_plugin_encode_string("dummy.txt") ),
|
193 |
+
array( "id" => "uploadedfile_".$data["ID"]."_size", "name" => "uploadedfile_".$data["ID"]."_size", "value" => "0" ),
|
194 |
+
array( "id" => "adminerrorcodes_".$data["ID"], "name" => "adminerrorcodes_".$data["ID"], "value" => "" )
|
195 |
+
);
|
196 |
+
if ( $additional_params["require_consent"] ) array_push( $data["hidden_elements"],
|
197 |
+
array( "id" => "consentresult_".$data["ID"], "name" => "consentresult_".$data["ID"], "value" => "" )
|
198 |
+
);
|
199 |
+
foreach ($params["userdata_fields"] as $userdata_key => $userdata_field)
|
200 |
+
array_push($data["hidden_elements"], array( "id" => "hiddeninput_".$data["ID"]."_userdata_".$userdata_key, "name" => "hiddeninput_".$data["ID"]."_userdata_".$userdata_key, "value" => "" ));
|
201 |
+
$data["index"] = $occurrence_index;
|
202 |
+
$data["params"] = $params;
|
203 |
+
|
204 |
+
$uploadform_item["title"] = 'wordpress_file_upload_form_'.$data["ID"];
|
205 |
+
// selectbutton block is mandatory because it contains the upload form element, so in case it is not included in the placements
|
206 |
+
// attribute then we set its visibility to hidden
|
207 |
+
$uploadform_item["hidden"] = ( strpos($params["placements"], "selectbutton") === false );
|
208 |
+
$uploadform_item["width"] = "";
|
209 |
+
$uploadform_item["object"] = "GlobalData.WFU[".$data["ID"]."].uploadform";
|
210 |
+
//for responsive plugin adjust container and container's parent widths if a % width has been defined
|
211 |
+
if ( $data["responsive"] && strlen($data["width"]) > 1 && substr($data["width"], -1, 1) == "%" ) $uploadform_item["width"] = $data["width"];
|
212 |
+
|
213 |
+
//read html output from template
|
214 |
+
$uploadform_item += wfu_read_template_output("uploadform", $data);
|
215 |
+
//initialize uploadform object properties
|
216 |
+
$uploadform_item["js"] = "GlobalData.WFU[".$data["ID"]."].uploadform = { ".
|
217 |
+
"attachActions: function(clickaction, changeaction) {}, ".
|
218 |
+
"reset: function() {}, ".
|
219 |
+
"resetDummy: function() {}, ".
|
220 |
+
"submit: function() {}, ".
|
221 |
+
"lock: function() {}, ".
|
222 |
+
"unlock: function() {}, ".
|
223 |
+
"changeFileName: function(new_filename) {}, ".
|
224 |
+
"files: function() { return []; } ".
|
225 |
+
"};\n\n".$uploadform_item["js"];
|
226 |
+
//append javascript variable that checks if uploadform element exists or not
|
227 |
+
$uploadform_item["js"] .= "\n\nGlobalData.WFU[".$data["ID"]."].uploadform_exist = true;";
|
228 |
+
|
229 |
+
return $uploadform_item;
|
230 |
+
}
|
231 |
+
|
232 |
+
/* Prepare the submit button */
|
233 |
+
function wfu_prepare_submit_block($params, $additional_params, $occurrence_index) {
|
234 |
+
//prepare data for template
|
235 |
+
$data["ID"] = $params["uploadid"];
|
236 |
+
$data["width"] = $additional_params['widths']['uploadbutton'];
|
237 |
+
$data["height"] = $additional_params['heights']['uploadbutton'];
|
238 |
+
$data["responsive"] = ( $params["fitmode"] == "responsive" );
|
239 |
+
$data["testmode"] = ( $params["testmode"] == "true" );
|
240 |
+
$data["allownofile"] = ( $params["allownofile"] == "true" );
|
241 |
+
$data["label"] = $params["uploadbutton"];
|
242 |
+
$data["index"] = $occurrence_index;
|
243 |
+
$data["params"] = $params;
|
244 |
+
|
245 |
+
$submit_item["title"] = 'wordpress_file_upload_submit_'.$data["ID"];
|
246 |
+
$submit_item["hidden"] = false;
|
247 |
+
$submit_item["width"] = "";
|
248 |
+
$submit_item["object"] = "GlobalData.WFU[".$data["ID"]."].submit";
|
249 |
+
//for responsive plugin adjust container and container's parent widths if a % width has been defined
|
250 |
+
if ( $data["responsive"] && strlen($data["width"]) > 1 && substr($data["width"], -1, 1) == "%" ) $submit_item["width"] = $data["width"];
|
251 |
+
|
252 |
+
//read html output from template
|
253 |
+
$submit_item += wfu_read_template_output("submit", $data);
|
254 |
+
//initialize submit element (upload button) object properties
|
255 |
+
$submit_item["js"] = "GlobalData.WFU[".$data["ID"]."].submit = { ".
|
256 |
+
"label_default: '".$data["label"]."', ".
|
257 |
+
"attachClickAction: function(clickaction) { }, ".
|
258 |
+
"updateLabel: function(new_label) { }, ".
|
259 |
+
"toggle: function(status) { } ".
|
260 |
+
"};\n\n".$submit_item["js"];
|
261 |
+
//append javascript variable that checks if upload button element exists
|
262 |
+
$submit_item["js"] .= "\n\nGlobalData.WFU[".$data["ID"]."].submit_exist = true;";
|
263 |
+
|
264 |
+
return $submit_item;
|
265 |
+
}
|
266 |
+
|
267 |
+
|
268 |
+
/* Prepare the webcam */
|
269 |
+
function wfu_prepare_webcam_block($params, $additional_params, $occurrence_index) {
|
270 |
+
//prepare data for template
|
271 |
+
$data["ID"] = $params["uploadid"];
|
272 |
+
$data["width"] = $additional_params['widths']['webcam'];
|
273 |
+
$data["height"] = $additional_params['heights']['webcam'];
|
274 |
+
$data["responsive"] = ( $params["fitmode"] == "responsive" );
|
275 |
+
$data["testmode"] = ( $params["testmode"] == "true" );
|
276 |
+
$data["index"] = $occurrence_index;
|
277 |
+
$data["params"] = $params;
|
278 |
+
|
279 |
+
$webcam_item["title"] = 'wordpress_file_upload_webcam_'.$data["ID"];
|
280 |
+
$webcam_item["hidden"] = false;
|
281 |
+
$webcam_item["width"] = "";
|
282 |
+
$webcam_item["object"] = "GlobalData.WFU[".$data["ID"]."].webcam";
|
283 |
+
|
284 |
+
$webcam_init = "\n".'var wfu_webrtc_ref = document.createElement("SCRIPT");';
|
285 |
+
$webcam_init .= "\n".'wfu_webrtc_ref.setAttribute("type", "text/javascript");';
|
286 |
+
$webcam_init .= "\n".'wfu_webrtc_ref.setAttribute("src", "https://webrtc.github.io/adapter/adapter-latest.js");';
|
287 |
+
$webcam_init .= "\n".'document.getElementById(GlobalData.WFU['.$data["ID"].'].container_id).appendChild(wfu_webrtc_ref);';
|
288 |
+
$webcam_init .= "\n".'var wfu_initialize_webcam_loader_'.$data["ID"].' = function() { wfu_initialize_webcam('.$data["ID"].', "'.$params["webcammode"].'", "'.$params["audiocapture"].'", "'.$params["videowidth"].'", "'.$params["videoheight"].'", "'.$params["videoaspectratio"].'", "'.$params["videoframerate"].'", "'.$params["camerafacing"].'", '.$params["maxrecordtime"].'); }';
|
289 |
+
$webcam_init .= "\n".'if(window.addEventListener) { window.addEventListener("load", wfu_initialize_webcam_loader_'.$data["ID"].', false); } else if(window.attachEvent) { window.attachEvent("onload", wfu_initialize_webcam_loader_'.$data["ID"].'); } else { window["onload"] = wfu_initialize_webcam_loader_'.$data["ID"].'; }';
|
290 |
+
|
291 |
+
//read html output from template
|
292 |
+
$webcam_item += wfu_read_template_output("webcam", $data);
|
293 |
+
//initialize captcha object properties
|
294 |
+
$webcam_item["js"] = "GlobalData.WFU[".$data["ID"]."].webcam = { ".
|
295 |
+
"initCallback: function() {},".
|
296 |
+
"initButtons: function(mode) {},".
|
297 |
+
"updateStatus: function(status) {},".
|
298 |
+
"updateButtonStatus: function(status) {},".
|
299 |
+
"updateTimer: function(time) {},".
|
300 |
+
"updatePlayProgress: function(duration) {},".
|
301 |
+
"setVideoProperties: function(props) {},".
|
302 |
+
"videoSize: function() { return null; },".
|
303 |
+
"readyState: function() { return -1; },".
|
304 |
+
"screenshot: function(savefunc, image_type) {},".
|
305 |
+
"play: function() {},".
|
306 |
+
"pause: function() {},".
|
307 |
+
"back: function() {},".
|
308 |
+
"fwd: function(duration) {},".
|
309 |
+
"ended: function() {}".
|
310 |
+
"};\n\n".$webcam_item["js"].$webcam_init;
|
311 |
+
//append javascript variable that checks if webcam element exists or not
|
312 |
+
$webcam_item["js"] .= "\n\nGlobalData.WFU[".$data["ID"]."].webcam_exist = true;";
|
313 |
+
|
314 |
+
return $webcam_item;
|
315 |
+
}
|
316 |
+
|
317 |
+
/* Prepare the progress bar */
|
318 |
+
function wfu_prepare_progressbar_block($params, $additional_params, $occurrence_index) {
|
319 |
+
//prepare data for template
|
320 |
+
$data["ID"] = $params["uploadid"];
|
321 |
+
$data["width"] = $additional_params['widths']['progressbar'];
|
322 |
+
$data["height"] = $additional_params['heights']['progressbar'];
|
323 |
+
$data["responsive"] = ( $params["fitmode"] == "responsive" );
|
324 |
+
$data["testmode"] = ( $params["testmode"] == "true" );
|
325 |
+
$data["index"] = $occurrence_index;
|
326 |
+
$data["params"] = $params;
|
327 |
+
|
328 |
+
$progressbar_item["title"] = 'wordpress_file_upload_progressbar_'.$data["ID"];
|
329 |
+
$progressbar_item["hidden"] = ( $params["testmode"] != "true" );
|
330 |
+
$progressbar_item["width"] = "";
|
331 |
+
$progressbar_item["object"] = "GlobalData.WFU[".$data["ID"]."].progressbar";
|
332 |
+
//for responsive plugin adjust container's parent width if a % width has been defined
|
333 |
+
if ( $data["responsive"] && strlen($data["width"]) > 1 && substr($data["width"], -1, 1) == "%" ) $progressbar_item["width"] = $data["width"];
|
334 |
+
//read html output from template
|
335 |
+
$progressbar_item += wfu_read_template_output("progressbar", $data);
|
336 |
+
//initialize progressbar object properties
|
337 |
+
$progressbar_item["js"] = "GlobalData.WFU[".$data["ID"]."].progressbar = { ".
|
338 |
+
"show: function(mode) {}, ".
|
339 |
+
"hide: function() {}, ".
|
340 |
+
"update: function(progress) {} ".
|
341 |
+
"};\n\n".$progressbar_item["js"];
|
342 |
+
//append javascript variable that checks if progress bar exists or not
|
343 |
+
$progressbar_item["js"] .= "\n\nGlobalData.WFU[".$data["ID"]."].progressbar_exist = true;";
|
344 |
+
|
345 |
+
return $progressbar_item;
|
346 |
+
}
|
347 |
+
|
348 |
+
/* Prepare the message block */
|
349 |
+
function wfu_prepare_message_block($params, $additional_params, $occurrence_index) {
|
350 |
+
//prepare data for template
|
351 |
+
$data["ID"] = $params["uploadid"];
|
352 |
+
$data["width"] = $additional_params['widths']['message'];
|
353 |
+
$data["height"] = $additional_params['heights']['message'];
|
354 |
+
$data["responsive"] = ( $params["fitmode"] == "responsive" );
|
355 |
+
$data["testmode"] = ( $params["testmode"] == "true" );
|
356 |
+
$data["index"] = $occurrence_index;
|
357 |
+
$data["params"] = $params;
|
358 |
+
|
359 |
+
$header_styles["State0"] = wfu_prepare_message_colors(WFU_VAR("WFU_HEADERMESSAGECOLORS_STATE0"));
|
360 |
+
$header_styles["State0"]['message'] = WFU_UPLOAD_STATE0;
|
361 |
+
$header_styles["State1"] = wfu_prepare_message_colors(WFU_VAR("WFU_HEADERMESSAGECOLORS_STATE1"));
|
362 |
+
$header_styles["State1"]['message'] = WFU_UPLOAD_STATE1;
|
363 |
+
$header_styles["State2"] = wfu_prepare_message_colors(WFU_VAR("WFU_HEADERMESSAGECOLORS_STATE2"));
|
364 |
+
$header_styles["State2"]['message'] = WFU_UPLOAD_STATE2;
|
365 |
+
$header_styles["State3"] = wfu_prepare_message_colors(WFU_VAR("WFU_HEADERMESSAGECOLORS_STATE3"));
|
366 |
+
$header_styles["State3"]['message'] = WFU_UPLOAD_STATE3;
|
367 |
+
$header_styles["State4"] = wfu_prepare_message_colors(WFU_VAR("WFU_HEADERMESSAGECOLORS_STATE4"));
|
368 |
+
$header_styles["State4"]['message'] = WFU_UPLOAD_STATE4;
|
369 |
+
$header_styles["State5"] = wfu_prepare_message_colors(WFU_VAR("WFU_HEADERMESSAGECOLORS_STATE5"));
|
370 |
+
$header_styles["State5"]['message'] = WFU_UPLOAD_STATE5;
|
371 |
+
$header_styles["State5_singlefile"] = wfu_prepare_message_colors(WFU_VAR("WFU_HEADERMESSAGECOLORS_STATE5"));
|
372 |
+
$header_styles["State5_singlefile"]['message'] = WFU_UPLOAD_STATE5_SINGLEFILE;
|
373 |
+
$header_styles["State6"] = wfu_prepare_message_colors(WFU_VAR("WFU_HEADERMESSAGECOLORS_STATE6"));
|
374 |
+
$header_styles["State6"]['message'] = WFU_UPLOAD_STATE6;
|
375 |
+
$header_styles["State7"] = wfu_prepare_message_colors(WFU_VAR("WFU_HEADERMESSAGECOLORS_STATE7"));
|
376 |
+
$header_styles["State7"]['message'] = WFU_UPLOAD_STATE7;
|
377 |
+
$header_styles["State7_singlefile"] = wfu_prepare_message_colors(WFU_VAR("WFU_HEADERMESSAGECOLORS_STATE7"));
|
378 |
+
$header_styles["State7_singlefile"]['message'] = WFU_UPLOAD_STATE7_SINGLEFILE;
|
379 |
+
$header_styles["State8"] = wfu_prepare_message_colors(WFU_VAR("WFU_HEADERMESSAGECOLORS_STATE8"));
|
380 |
+
$header_styles["State8"]['message'] = WFU_UPLOAD_STATE8;
|
381 |
+
$header_styles["State9"] = wfu_prepare_message_colors(WFU_VAR("WFU_HEADERMESSAGECOLORS_STATE9"));
|
382 |
+
$header_styles["State9"]['message'] = WFU_UPLOAD_STATE9;
|
383 |
+
$header_styles["State10"] = wfu_prepare_message_colors(WFU_VAR("WFU_HEADERMESSAGECOLORS_STATE10"));
|
384 |
+
$header_styles["State10"]['message'] = WFU_UPLOAD_STATE10;
|
385 |
+
$header_styles["State11"] = wfu_prepare_message_colors(WFU_VAR("WFU_HEADERMESSAGECOLORS_STATE11"));
|
386 |
+
$header_styles["State11"]['message'] = WFU_UPLOAD_STATE11;
|
387 |
+
$header_styles["State12"] = wfu_prepare_message_colors(WFU_VAR("WFU_HEADERMESSAGECOLORS_STATE12"));
|
388 |
+
$header_styles["State12"]['message'] = WFU_UPLOAD_STATE12;
|
389 |
+
$header_styles["State13"] = wfu_prepare_message_colors(WFU_VAR("WFU_HEADERMESSAGECOLORS_STATE13"));
|
390 |
+
$header_styles["State13"]['message'] = WFU_UPLOAD_STATE13;
|
391 |
+
$header_styles["State14"] = wfu_prepare_message_colors(WFU_VAR("WFU_HEADERMESSAGECOLORS_STATE14"));
|
392 |
+
$header_styles["State14"]['message'] = WFU_UPLOAD_STATE14;
|
393 |
+
$header_styles["State15"] = wfu_prepare_message_colors(WFU_VAR("WFU_HEADERMESSAGECOLORS_STATE15"));
|
394 |
+
$header_styles["State15"]['message'] = WFU_UPLOAD_STATE15;
|
395 |
+
$header_styles["State16"] = wfu_prepare_message_colors(WFU_VAR("WFU_HEADERMESSAGECOLORS_STATE16"));
|
396 |
+
$header_styles["State16"]['message'] = WFU_UPLOAD_STATE16;
|
397 |
+
$header_styles["State17"] = wfu_prepare_message_colors(WFU_VAR("WFU_HEADERMESSAGECOLORS_STATE17"));
|
398 |
+
$header_styles["State17"]['message'] = WFU_UPLOAD_STATE17;
|
399 |
+
$header_styles["State18"] = wfu_prepare_message_colors(WFU_VAR("WFU_HEADERMESSAGECOLORS_STATE18"));
|
400 |
+
$header_styles["State18"]['message'] = WFU_UPLOAD_STATE18;
|
401 |
+
$header_styles["State19"] = wfu_prepare_message_colors(WFU_VAR("WFU_HEADERMESSAGECOLORS_STATE19"));
|
402 |
+
$header_styles["State19"]['message'] = WFU_UPLOAD_STATE19;
|
403 |
+
$data["header_styles"] = $header_styles;
|
404 |
+
|
405 |
+
$message_item["title"] = 'wordpress_file_upload_message_'.$data["ID"];
|
406 |
+
$message_item["hidden"] = false;
|
407 |
+
$message_item["width"] = "";
|
408 |
+
$message_item["object"] = "GlobalData.WFU[".$data["ID"]."].message";
|
409 |
+
//for responsive plugin adjust container and container's parent widths if a % width has been defined
|
410 |
+
if ( $data["responsive"] && strlen($data["width"]) > 1 && substr($data["width"], -1, 1) == "%" ) $message_item["width"] = $data["width"];
|
411 |
+
|
412 |
+
// $message_block = wfu_prepare_message_block_skeleton($sid, $styles, ( $params["testmode"] == "true" ));
|
413 |
+
// $message_item = $message_block["msgblock"];
|
414 |
+
|
415 |
+
$message_init = "\n".'if (!GlobalData.States) {';
|
416 |
+
$message_init .= "\n\t".'GlobalData.States = {};';
|
417 |
+
foreach ( $data["header_styles"] as $state => $statedata )
|
418 |
+
$message_init .= "\n\t\t".'GlobalData.States.'.$state.' = { color:"'.$statedata["color"].'", bgcolor:"'.$statedata["bgcolor"].'", borcolor:"'.$statedata["borcolor"].'", message:"'.$statedata["message"].'" };';
|
419 |
+
$message_init .= "\n\t".'GlobalData.Colors = {';
|
420 |
+
$message_init .= "\n\t\t".'default: "'.WFU_VAR("WFU_DEFAULTMESSAGECOLORS").'".split(","),';
|
421 |
+
$message_init .= "\n\t\t".'success: "'.$params['successmessagecolors'].'".split(","),';
|
422 |
+
$message_init .= "\n\t\t".'warning: "'.$params['warningmessagecolors'].'".split(","),';
|
423 |
+
$message_init .= "\n\t\t".'error: "'.$params['failmessagecolors'].'".split(",")';
|
424 |
+
$message_init .= "\n\t".'};';
|
425 |
+
$message_init .= "\n".'}';
|
426 |
+
|
427 |
+
//read html output from template
|
428 |
+
$message_item += wfu_read_template_output("message", $data);
|
429 |
+
//extract header_template and file_template
|
430 |
+
$header_template = "";
|
431 |
+
$header_template_line = "";
|
432 |
+
$in_header_template_block = false;
|
433 |
+
$file_template = "";
|
434 |
+
$file_template_line = "";
|
435 |
+
$in_file_template_block = false;
|
436 |
+
foreach ( $message_item as $key => $item ) {
|
437 |
+
if ( $in_header_template_block ) {
|
438 |
+
unset($message_item[$key]);
|
439 |
+
if ( $item != "</header_template><file_template>" ) $header_template .= $item."\n";
|
440 |
+
else {
|
441 |
+
$in_header_template_block = false;
|
442 |
+
$in_file_template_block = true;
|
443 |
+
}
|
444 |
+
}
|
445 |
+
elseif ( $in_file_template_block ) {
|
446 |
+
unset($message_item[$key]);
|
447 |
+
if ( $item != "</file_template>" ) $file_template .= $item."\n";
|
448 |
+
else $in_file_template_block = false;
|
449 |
+
}
|
450 |
+
elseif ( substr($key, 0, 4) == "line" ) {
|
451 |
+
if ( $item == "<header_template>" ) {
|
452 |
+
unset($message_item[$key]);
|
453 |
+
$in_header_template_block = true;
|
454 |
+
}
|
455 |
+
elseif ( strpos($item, "[header_template]") !== false ) $header_template_line = $key;
|
456 |
+
elseif ( strpos($item, "[file_template]") !== false ) $file_template_line = $key;
|
457 |
+
}
|
458 |
+
}
|
459 |
+
if ( $header_template_line != "" )
|
460 |
+
$message_item[$header_template_line] = str_replace("[header_template]", wfu_plugin_encode_string(trim($header_template)), $message_item[$header_template_line]);
|
461 |
+
if ( $file_template_line != "" )
|
462 |
+
$message_item[$file_template_line] = str_replace("[file_template]", wfu_plugin_encode_string(trim($file_template)), $message_item[$file_template_line]);
|
463 |
+
//initialize message object properties
|
464 |
+
$message_item["js"] = "GlobalData.WFU[".$data["ID"]."].message = { ".
|
465 |
+
"update: function(data) {},".
|
466 |
+
"reset: function() {}".
|
467 |
+
"};\n\n".$message_item["js"].$message_init;
|
468 |
+
//append javascript variable that checks if message block exists or not
|
469 |
+
$message_item["js"] .= "\n\nGlobalData.WFU[".$data["ID"]."].message_exist = true;";
|
470 |
+
|
471 |
+
return $message_item;
|
472 |
+
}
|
473 |
+
|
474 |
+
/* Prepare the user data block */
|
475 |
+
function wfu_prepare_userdata_block($params, $additional_params, $occurrence_index) {
|
476 |
+
$data["ID"] = $params["uploadid"];
|
477 |
+
$data["width"] = $additional_params['widths']['userdata'];
|
478 |
+
$data["height"] = $additional_params['heights']['userdata'];
|
479 |
+
$data["width_label"] = $additional_params['widths']['userdata_label'];
|
480 |
+
$data["height_label"] = $additional_params['heights']['userdata_label'];
|
481 |
+
$data["width_value"] = $additional_params['widths']['userdata_value'];
|
482 |
+
$data["height_value"] = $additional_params['heights']['userdata_value'];
|
483 |
+
$data["responsive"] = ( $params["fitmode"] == "responsive" );
|
484 |
+
$data["testmode"] = ( $params["testmode"] == "true" );
|
485 |
+
$data["props"] = array();
|
486 |
+
$data["index"] = $occurrence_index;
|
487 |
+
$data["params"] = $params;
|
488 |
+
//fill $data["props"] variable with properties of existing userdata fields
|
489 |
+
foreach ($params["userdata_fields"] as $userdata_key => $userdata_field) {
|
490 |
+
//use only fields belonging to $occurrence_index
|
491 |
+
if ( $occurrence_index == 0 || $userdata_field["occurrence"] == $occurrence_index ) {
|
492 |
+
$props = $userdata_field;
|
493 |
+
$props["key"] = $userdata_key;
|
494 |
+
array_push($data["props"], $props);
|
495 |
+
}
|
496 |
+
}
|
497 |
+
|
498 |
+
$userdata_item["title"] = 'wordpress_file_upload_userdata_'.$data["ID"].( $occurrence_index == 0 ? "" : "_".($occurrence_index - 1) );
|
499 |
+
$userdata_item["hidden"] = false;
|
500 |
+
$userdata_item["width"] = "";
|
501 |
+
$userdata_item["object"] = "GlobalData.WFU[".$data["ID"]."].userdata";
|
502 |
+
//for responsive plugin adjust container and container's parent widths if a % width has been defined
|
503 |
+
if ( $data["responsive"] && strlen($data["width"]) > 1 && substr($data["width"], -1, 1) == "%" ) $userdata_item["width"] = $data["width"];
|
504 |
+
$userdata_item += wfu_read_template_output("userdata", $data);
|
505 |
+
//extract templates of field types
|
506 |
+
$templates_html = "";
|
507 |
+
foreach ( $userdata_item as $key => $item ) {
|
508 |
+
if ( substr($key, 0, 4) == "line" ) {
|
509 |
+
$templates_html .= ( $templates_html == "" ? "" : "\r\n" ).$item;
|
510 |
+
unset($userdata_item[$key]);
|
511 |
+
}
|
512 |
+
}
|
513 |
+
//subclass init() function of userdata object so that it fills WFU.userdata
|
514 |
+
//object with properties and code handlers of the userdata fields;
|
515 |
+
//the subclassed init() function is carefully written because userdata is a
|
516 |
+
//multiplacements component, so init() function will run more than once
|
517 |
+
//and every time it runs we need to make sure that only the elements
|
518 |
+
//corresponding to the specific $occurrence_index will be initialized
|
519 |
+
$init_index = ( $occurrence_index <= 1 ? 0 : $occurrence_index - 1 );
|
520 |
+
$userdata_init = "";
|
521 |
+
$userdata_init .= "\n".'GlobalData.WFU['.$data["ID"].'].userdata._init'.$init_index.' = GlobalData.WFU['.$data["ID"].'].userdata.init;';
|
522 |
+
$userdata_init .= "\n".'GlobalData.WFU['.$data["ID"].'].userdata.init = function() {';
|
523 |
+
$userdata_init .= "\n\t".'GlobalData.WFU['.$data["ID"].'].userdata._init'.$init_index.'();';
|
524 |
+
$userdata_init .= "\n\t".'var WFU = GlobalData.WFU['.$data["ID"].'];';
|
525 |
+
if ( $init_index == 0 ) {
|
526 |
+
$userdata_init .= "\n\t".'if (typeof WFU.userdata.init_count == "undefined") {';
|
527 |
+
$userdata_init .= "\n\t\t".'WFU.userdata.init_count = 0;';
|
528 |
+
$userdata_init .= "\n\t\t".'WFU.userdata.codes = [];';
|
529 |
+
$userdata_init .= "\n\t\t".'WFU.userdata.props = [];';
|
530 |
+
$userdata_init .= "\n\t".'}';
|
531 |
+
$userdata_init .= "\n\t".'else WFU.userdata.init_count ++;';
|
532 |
+
}
|
533 |
+
$userdata_init .= "\n\t".'if (WFU.userdata.init_count == '.$init_index.') {';
|
534 |
+
$i = 1;
|
535 |
+
foreach ($params["userdata_fields"] as $userdata_key => $userdata_field) {
|
536 |
+
//show only fields belonging to $occurrence_index
|
537 |
+
if ( $occurrence_index == 0 || $userdata_field["occurrence"] == $occurrence_index ) {
|
538 |
+
$userdata_field["key"] = $userdata_key;
|
539 |
+
//get field template
|
540 |
+
$template = "";
|
541 |
+
$matches = array();
|
542 |
+
preg_match("/<userdata_".$userdata_field["key"]."_template>(.*?)<\/userdata_".$userdata_field["key"]."_template>/s", $templates_html, $matches);
|
543 |
+
if ( isset($matches[1]) ) $template = $matches[1];
|
544 |
+
//generate html code
|
545 |
+
foreach ( explode("\r\n", $template) as $line ) $userdata_item["line".$i++] = $line;
|
546 |
+
//generate javascript code
|
547 |
+
$userdata_init .= "\n\t\t".'WFU.userdata.codes['.$userdata_field["key"].'] = {};';
|
548 |
+
$userdata_init .= "\n\t\t".'WFU.userdata.props['.$userdata_field["key"].'] = '.wfu_PHP_array_to_JS_object($userdata_field).';';
|
549 |
+
$userdata_init .= "\n\t\t".'WFU.userdata.props['.$userdata_field["key"].'].store = function() { document.getElementById("hiddeninput_'.$data["ID"].'_userdata_'.$userdata_field["key"].'").value = WFU.userdata.codes['.$userdata_field["key"].'].value(); };';
|
550 |
+
$userdata_init .= "\n\t\t".'WFU.userdata.props['.$userdata_field["key"].'].getstored = function() { return document.getElementById("hiddeninput_'.$data["ID"].'_userdata_'.$userdata_field["key"].'").value; };';
|
551 |
+
$userdata_init .= "\n\t\t".'wfu_init_userdata_handlers('.$data["ID"].', '.$userdata_field["key"].');';
|
552 |
+
}
|
553 |
+
}
|
554 |
+
$userdata_init .= "\n\t".'}';
|
555 |
+
$userdata_init .= "\n".'}';
|
556 |
+
//initialize userdata object properties only for the first $occurrence_index
|
557 |
+
if ( $init_index == 0 ) {
|
558 |
+
$userdata_item["js"] = "GlobalData.WFU[".$data["ID"]."].userdata = { ".
|
559 |
+
"initField: function(props) {}, ".
|
560 |
+
"attachHandlers: function(props, handlerfunc) {}, ".
|
561 |
+
"getValue: function(props) { return ''; }, ".
|
562 |
+
"setValue: function(props, value) {}, ".
|
563 |
+
"enable: function(props) {}, ".
|
564 |
+
"disable: function(props) {}, ".
|
565 |
+
"prompt: function(props, message) {}".
|
566 |
+
"};\n\n".$userdata_item["js"];
|
567 |
+
}
|
568 |
+
else $userdata_item["js"] = "";
|
569 |
+
$userdata_item["js"] .= $userdata_init;
|
570 |
+
//append javascript additional userdata variables only for the first
|
571 |
+
//$occurrence_index
|
572 |
+
if ( $init_index == 0 ) {
|
573 |
+
$userdata_item["js"] .= "\n\nGlobalData.WFU[".$data["ID"]."].userdata_exist = true;";
|
574 |
+
$userdata_item["js"] .= "\n\nGlobalData.WFU[".$data["ID"]."].userdata.error_empty = \"".WFU_ERROR_USERDATA_EMPTY."\";";
|
575 |
+
$userdata_item["js"] .= "\n\nGlobalData.WFU[".$data["ID"]."].userdata.error_invalid_number = \"".WFU_ERROR_USERDATANUMBER_INVALID."\";";
|
576 |
+
$userdata_item["js"] .= "\n\nGlobalData.WFU[".$data["ID"]."].userdata.error_invalid_email = \"".WFU_ERROR_USERDATAEMAIL_INVALID."\";";
|
577 |
+
$userdata_item["js"] .= "\n\nGlobalData.WFU[".$data["ID"]."].userdata.error_confirm_email_nomatch = \"".WFU_ERROR_USERDATACONFIRMEMAIL_NOMATCH."\";";
|
578 |
+
$userdata_item["js"] .= "\n\nGlobalData.WFU[".$data["ID"]."].userdata.error_confirm_email_nobase = \"".WFU_ERROR_USERDATACONFIRMEMAIL_NOBASE."\";";
|
579 |
+
$userdata_item["js"] .= "\n\nGlobalData.WFU[".$data["ID"]."].userdata.error_confirm_password_nomatch = \"".WFU_ERROR_USERDATACONFIRMPASSWORD_NOMATCH."\";";
|
580 |
+
$userdata_item["js"] .= "\n\nGlobalData.WFU[".$data["ID"]."].userdata.error_confirm_password_nobase = \"".WFU_ERROR_USERDATACONFIRMPASSWORD_NOBASE."\";";
|
581 |
+
$userdata_item["js"] .= "\n\nGlobalData.WFU[".$data["ID"]."].userdata.error_checkbox_notchecked = \"".WFU_ERROR_USERDATACHECKBOX_NOTCHECKED."\";";
|
582 |
+
$userdata_item["js"] .= "\n\nGlobalData.WFU[".$data["ID"]."].userdata.error_radio_notselected = \"".WFU_ERROR_USERDATARADIO_NOTSELECTED."\";";
|
583 |
+
}
|
584 |
+
|
585 |
+
return $userdata_item;
|
586 |
+
}
|
587 |
+
|
588 |
+
/* Prepare the consent question block */
|
589 |
+
function wfu_prepare_consent_block($params, $additional_params, $occurrence_index) {
|
590 |
+
//prepare data for template
|
591 |
+
$data["ID"] = $params["uploadid"];
|
592 |
+
$data["width"] = $additional_params['widths']['consent'];
|
593 |
+
$data["height"] = $additional_params['heights']['consent'];
|
594 |
+
$data["responsive"] = ( $params["fitmode"] == "responsive" );
|
595 |
+
$data["testmode"] = ( $params["testmode"] == "true" );
|
596 |
+
$data["index"] = $occurrence_index;
|
597 |
+
$data["format"] = $params["consentformat"];
|
598 |
+
$data["preselected"] = $params["consentpreselect"];
|
599 |
+
$data["question"] = preg_replace("/:(\w*):/", "<a href=\"".$params["consentdisclaimer"]."\">$1</a>", $params["consentquestion"]);
|
600 |
+
$data["params"] = $params;
|
601 |
+
|
602 |
+
$consent_item["title"] = 'wordpress_file_upload_consent_'.$data["ID"];
|
603 |
+
$consent_item["hidden"] = ( $params["consentformat"] == "prompt" );
|
604 |
+
$consent_item["width"] = "";
|
605 |
+
$consent_item["object"] = "GlobalData.WFU[".$data["ID"]."].consent";
|
606 |
+
//for responsive plugin adjust container and container's parent widths if a % width has been defined
|
607 |
+
if ( $data["responsive"] && strlen($data["width"]) > 1 && substr($data["width"], -1, 1) == "%" ) $consent_item["width"] = $data["width"];
|
608 |
+
//read html output from template
|
609 |
+
$consent_item += wfu_read_template_output("consent", $data);
|
610 |
+
//initialize consent object properties
|
611 |
+
$consent_item["js"] = "GlobalData.WFU[".$data["ID"]."].consent = { ".
|
612 |
+
"consentCompleted: function() { return false; }, ".
|
613 |
+
"attachActions: function(completeaction) {}, ".
|
614 |
+
"update: function(action) {} ".
|
615 |
+
"};\n\n".$consent_item["js"];
|
616 |
+
//append javascript variable that checks if consent exists or not
|
617 |
+
$consent_item["js"] .= "\n\nGlobalData.WFU[".$data["ID"]."].consent_exist = true;";
|
618 |
+
//append additional consent parameters
|
619 |
+
$consent_item["js"] .= "\n\nGlobalData.WFU[".$data["ID"]."].consent.remember_consent = ".( $params["notrememberconsent"] != "true" ? "true" : "false" ).";";
|
620 |
+
$consent_item["js"] .= "\n\nGlobalData.WFU[".$data["ID"]."].consent.no_rejects_upload = ".( $params["consentrejectupload"] == "true" ? "true" : "false" ).";";
|
621 |
+
$consent_item["js"] .= "\n\nGlobalData.WFU[".$data["ID"]."].consent.consent_format = '".$params["consentformat"]."';";
|
622 |
+
$consent_item["js"] .= "\n\nGlobalData.WFU[".$data["ID"]."].consent.consent_question = '".preg_replace("/:(\w):/", "<a href=\"".$params["consentdisclaimer"]."\">$1</a>", $params["consentquestion"])."';";
|
623 |
+
|
624 |
+
return $consent_item;
|
625 |
+
}
|
626 |
+
|
627 |
+
?>
|
lib/wfu_constants.php
CHANGED
@@ -1,466 +1,467 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
$siteurl = site_url();
|
4 |
-
|
5 |
-
/************ Translatable Strings ************/
|
6 |
-
function wfu_initialize_i18n_strings() {
|
7 |
-
if ( defined("WFU_I18_LOADED") ) return;
|
8 |
-
DEFINE("WFU_I18_LOADED", 1);
|
9 |
-
//plugin default values
|
10 |
-
DEFINE("WFU_UPLOADTITLE", __('Upload files', 'wp-file-upload'));
|
11 |
-
DEFINE("WFU_SELECTBUTTON", __('Select File', 'wp-file-upload'));
|
12 |
-
DEFINE("WFU_UPLOADBUTTON", __('Upload File', 'wp-file-upload'));
|
13 |
-
DEFINE("WFU_NOTIFYSUBJECT", __('File Upload Notification', 'wp-file-upload'));
|
14 |
-
DEFINE("WFU_NOTIFYMESSAGE", __("Dear Recipient,%n%%n% This is an automatic delivery message to notify you that a new file has been uploaded.%n%%n%Best Regards", 'wp-file-upload'));
|
15 |
-
DEFINE("WFU_SUCCESSMESSAGE", __('File %filename% uploaded successfully', 'wp-file-upload'));
|
16 |
-
DEFINE("WFU_WARNINGMESSAGE", __('File %filename% uploaded successfully but with warnings', 'wp-file-upload'));
|
17 |
-
DEFINE("WFU_ERRORMESSAGE", __('File %filename% not uploaded', 'wp-file-upload'));
|
18 |
-
DEFINE("WFU_WAITMESSAGE", __('File %filename% is being uploaded', 'wp-file-upload'));
|
19 |
-
DEFINE("WFU_USERDATALABEL", __('Your message', 'wp-file-upload')."|t:text|s:left|r:0|a:0|p:inline|d:");
|
20 |
-
DEFINE("WFU_CAPTCHAPROMPT", __('Please fill in the above words: ', 'wp-file-upload'));
|
21 |
-
DEFINE("WFU_UPLOADMEDIABUTTON", __('Upload Media', 'wp-file-upload'));
|
22 |
-
DEFINE("WFU_VIDEONAME", __('videostream', 'wp-file-upload'));
|
23 |
-
DEFINE("WFU_IMAGENAME", __('screenshot', 'wp-file-upload'));
|
24 |
-
DEFINE("WFU_CONSENTQUESTION", __('By activating this option I agree to let the website keep my personal data', 'wp-file-upload'));
|
25 |
-
DEFINE("WFU_CONSENTREJECTMESSAGE", __('You have denied to let the website keep your personal data. Upload cannot continue!', 'wp-file-upload'));
|
26 |
-
//browser default values
|
27 |
-
DEFINE("WFU_FILETITLE", __('File', 'wp-file-upload'));
|
28 |
-
DEFINE("WFU_DATETITLE", __('Date', 'wp-file-upload'));
|
29 |
-
DEFINE("WFU_SIZETITLE", __('Size', 'wp-file-upload'));
|
30 |
-
DEFINE("WFU_USERTITLE", __('User', 'wp-file-upload'));
|
31 |
-
DEFINE("WFU_POSTTITLE", __('Page', 'wp-file-upload'));
|
32 |
-
DEFINE("WFU_FIELDSTITLE", __('User Fields', 'wp-file-upload'));
|
33 |
-
DEFINE("WFU_DOWNLOADLABEL", __('Download', 'wp-file-upload'));
|
34 |
-
DEFINE("WFU_DOWNLOADTITLE", __('Download this file', 'wp-file-upload'));
|
35 |
-
DEFINE("WFU_DELETELABEL", __('Delete', 'wp-file-upload'));
|
36 |
-
DEFINE("WFU_DELETETITLE", __('Delete this file', 'wp-file-upload'));
|
37 |
-
DEFINE("WFU_SORTTITLE", __('Sort list based on this column', 'wp-file-upload'));
|
38 |
-
DEFINE("WFU_GUESTTITLE", __('guest', 'wp-file-upload'));
|
39 |
-
DEFINE("WFU_UNKNOWNTITLE", __('unknown', 'wp-file-upload'));
|
40 |
-
//error messages
|
41 |
-
DEFINE("WFU_ERROR_ADMIN_FTPDIR_RESOLVE", __("Error. Could not resolve ftp target filedir. Check the domain in 'ftpinfo' attribute.", "wp-file-upload"));
|
42 |
-
DEFINE("WFU_ERROR_ADMIN_FTPINFO_INVALID", __("Error. Invalid ftp information. Check 'ftpinfo' attribute.", "wp-file-upload"));
|
43 |
-
DEFINE("WFU_ERROR_ADMIN_FTPINFO_EXTRACT", __("Error. Could not extract ftp information from 'ftpinfo' attribute. Check its syntax.", "wp-file-upload"));
|
44 |
-
DEFINE("WFU_ERROR_ADMIN_FTPFILE_RESOLVE", __("Error. Could not resolve ftp target filename. Check the domain in 'ftpinfo' attribute.", "wp-file-upload"));
|
45 |
-
DEFINE("WFU_ERROR_ADMIN_FTPSOURCE_FAIL", __("Error. Could not open source file for ftp upload. Check if file is accessible.", "wp-file-upload"));
|
46 |
-
DEFINE("WFU_ERROR_ADMIN_FTPTRANSFER_FAIL", __("Error. Could not send data to ftp target file.", "wp-file-upload"));
|
47 |
-
DEFINE("WFU_ERROR_ADMIN_FTPHOST_FAIL", __("Error. Could not connect to ftp host. Check the domain in 'ftpinfo' attribute.", "wp-file-upload"));
|
48 |
-
DEFINE("WFU_ERROR_ADMIN_FTPLOGIN_FAIL", __("Error. Could not authenticate to ftp host. Check username and password in 'ftpinfo' attribute.", "wp-file-upload"));
|
49 |
-
DEFINE("WFU_ERROR_ADMIN_SFTPINIT_FAIL", __("Error. Could not initialize sftp subsystem. Please check if the server supports sftp.", "wp-file-upload"));
|
50 |
-
DEFINE("WFU_ERROR_ADMIN_SFTP_UNSUPPORTED", __("Error. The web server does not support sftp.", "wp-file-upload"));
|
51 |
-
DEFINE("WFU_ERROR_ADMIN_FILE_PHP_SIZE", __("Error. The upload size limit of PHP directive upload_max_filesize is preventing the upload of big files.\nPHP directive upload_max_filesize limit is: ".ini_get("upload_max_filesize").".\nTo increase the limit change the value of the directive from php.ini.\nIf you don't have access to php.ini, then try adding the following line to your .htaccess file:\n\nphp_value upload_max_filesize 10M\n\n(adjust the size according to your needs)\n\nThe file .htaccess is found in your website root directory (where index.php is found).\nIf your don't have this file, then create it.\nIf this does not work either, then contact your domain provider.", "wp-file-upload"));
|
52 |
-
DEFINE("WFU_ERROR_ADMIN_FILE_PHP_TIME", __("The upload time limit of PHP directive max_input_time is preventing the upload of big files.\nPHP directive max_input_time limit is: ".ini_get("max_input_time")." seconds.\nTo increase the limit change the value of the directive from php.ini.\nIf you don't have access to php.ini, then add the following line to your .htaccess file:\n\nphp_value max_input_time 500\n\n(adjust the time according to your needs)\n\nThe file .htaccess is found in your website root directory (where index.php is found).\nIf your don't have this file, then create it.\nIf this does not work either, then contact your domain provider.", "wp-file-upload"));
|
53 |
-
DEFINE("WFU_ERROR_ADMIN_DIR_PERMISSION", __("Error. Permission denied to write to target folder.\nCheck and correct read/write permissions of target folder.", "wp-file-upload"));
|
54 |
-
DEFINE("WFU_ERROR_ADMIN_FILE_WRONGEXT", __("Error. This file was rejected because its extension is not correct. Its proper filename is: ", "wp-file-upload"));
|
55 |
-
DEFINE("WFU_ERROR_ADMIN_DOS_ATTACK", __("Too many files are uploaded in a short period of time. This may be a Denial-Of-Service attack, so file was rejected. Please check the upload log for suspicious behaviour.", "wp-file-upload"));
|
56 |
-
DEFINE("WFU_ERROR_DOS_ATTACK", __("File not uploaded in order to prevent overflow of the website. Please contact administrator.", "wp-file-upload"));
|
57 |
-
DEFINE("WFU_ERROR_DIR_EXIST", __("Target folder doesn't exist.", "wp-file-upload"));
|
58 |
-
DEFINE("WFU_ERROR_DIR_NOTEMP", __("Upload failed! Missing a temporary folder.", "wp-file-upload"));
|
59 |
-
DEFINE("WFU_ERROR_DIR_PERMISSION", __("Upload failed! Permission denied to write to target folder.", "wp-file-upload"));
|
60 |
-
DEFINE("WFU_ERROR_FILE_ALLOW", __("File not allowed.", "wp-file-upload"));
|
61 |
-
DEFINE("WFU_ERROR_FILE_REJECT", __("File is suspicious and was rejected.", "wp-file-upload"));
|
62 |
-
DEFINE("WFU_ERROR_FILE_PLUGIN_SIZE", __("The uploaded file exceeds the file size limit.", "wp-file-upload"));
|
63 |
-
DEFINE("WFU_ERROR_FILE_PLUGIN_2GBSIZE", __("The uploaded file exceeds 2GB and is not supported by this server.", "wp-file-upload"));
|
64 |
-
DEFINE("WFU_ERROR_FILE_PHP_SIZE", __("Upload failed! The uploaded file exceeds the file size limit of the server. Please contact the administrator.", "wp-file-upload"));
|
65 |
-
DEFINE("WFU_ERROR_FILE_PHP_TIME", __("Upload failed! The duration of the upload exceeded the time limit of the server. Please contact the administrator.", "wp-file-upload"));
|
66 |
-
DEFINE("WFU_ERROR_FILE_HTML_SIZE", __("Upload failed! The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.", "wp-file-upload"));
|
67 |
-
DEFINE("WFU_ERROR_FILE_PARTIAL", __("Upload failed! The uploaded file was only partially uploaded.", "wp-file-upload"));
|
68 |
-
DEFINE("WFU_ERROR_FILE_NOTHING", __("Upload failed! No file was uploaded.", "wp-file-upload"));
|
69 |
-
DEFINE("WFU_ERROR_FILE_WRITE", __("Upload failed! Failed to write file to disk.", "wp-file-upload"));
|
70 |
-
DEFINE("WFU_ERROR_FILE_MOVE", __("Upload failed! Error occured while moving temporary file. Please contact administrator.", "wp-file-upload"));
|
71 |
-
DEFINE("WFU_ERROR_FILE_CANCELLED", __("Upload cancelled!", "wp-file-upload"));
|
72 |
-
DEFINE("WFU_ERROR_UPLOAD_STOPPED", __("Upload failed! A PHP extension stopped the file upload. PHP does not provide a way to ascertain which extension caused the file upload to stop; examining the list of loaded extensions with phpinfo() may help.", "wp-file-upload"));
|
73 |
-
DEFINE("WFU_ERROR_UPLOAD_FAILED_WHILE", __("Upload failed! Error occured while attemting to upload the file.", "wp-file-upload"));
|
74 |
-
DEFINE("WFU_ERROR_UPLOAD_FAILED", __("Upload failed!", "wp-file-upload"));
|
75 |
-
DEFINE("WFU_ERROR_UPLOAD_NOFILESELECTED", __("No file!", "wp-file-upload"));
|
76 |
-
DEFINE("WFU_ERROR_UPLOAD_CANCELLED", __("Upload failed! The upload has been canceled by the user or the browser dropped the connection.", "wp-file-upload"));
|
77 |
-
DEFINE("WFU_ERROR_UNKNOWN", __("Upload failed! Unknown error.", "wp-file-upload"));
|
78 |
-
DEFINE("WFU_ERROR_CONTACT_ADMIN", __("Please contact the administrator.", "wp-file-upload"));
|
79 |
-
DEFINE("WFU_ERROR_REMOTESERVER_NORESULT", __("No result from remote server!", "wp-file-upload"));
|
80 |
-
DEFINE("WFU_ERROR_JSONPARSE_FILEMESSAGE", __(" but with warnings", "wp-file-upload"));
|
81 |
-
DEFINE("WFU_ERROR_JSONPARSE_MESSAGE", __("Warning: JSON parse error.", "wp-file-upload"));
|
82 |
-
DEFINE("WFU_ERROR_JSONPARSE_ADMINMESSAGE", __("Upload parameters of this file, passed as JSON string to the handler, could not be parsed.", "wp-file-upload"));
|
83 |
-
DEFINE("WFU_ERROR_JSONPARSE_HEADERMESSAGE", __("Warning: JSON parse error.", "wp-file-upload"));
|
84 |
-
DEFINE("WFU_ERROR_JSONPARSE_HEADERADMINMESSAGE", __("UploadStates, passed as JSON string to the handler, could not be parsed.", "wp-file-upload"));
|
85 |
-
DEFINE("WFU_ERROR_REDIRECTION_ERRORCODE0", __("Redirection to classic form functionality occurred due to unknown error.", "wp-file-upload"));
|
86 |
-
DEFINE("WFU_ERROR_REDIRECTION_ERRORCODE1", __("Redirection to classic form functionality occurred because AJAX is not supported.", "wp-file-upload"));
|
87 |
-
DEFINE("WFU_ERROR_REDIRECTION_ERRORCODE2", __("Redirection to classic form functionality occurred because HTML5 is not supported.", "wp-file-upload"));
|
88 |
-
DEFINE("WFU_ERROR_REDIRECTION_ERRORCODE3", __("Redirection to classic form functionality occurred due to JSON parse error.", "wp-file-upload"));
|
89 |
-
DEFINE("WFU_ERROR_ENABLE_POPUPS", __("Please enable popup windows from the browser's settings!", "wp-file-upload"));
|
90 |
-
DEFINE("WFU_ERROR_USERDATA_EMPTY", __("cannot be empty!", "wp-file-upload"));
|
91 |
-
DEFINE("WFU_ERROR_USERDATANUMBER_INVALID", __("number not valid!", "wp-file-upload"));
|
92 |
-
DEFINE("WFU_ERROR_USERDATAEMAIL_INVALID", __("email not valid!", "wp-file-upload"));
|
93 |
-
DEFINE("WFU_ERROR_USERDATACONFIRMEMAIL_NOMATCH", __("emails do not match!", "wp-file-upload"));
|
94 |
-
DEFINE("WFU_ERROR_USERDATACONFIRMEMAIL_NOBASE", __("no base email field in group!", "wp-file-upload"));
|
95 |
-
DEFINE("WFU_ERROR_USERDATACONFIRMPASSWORD_NOMATCH", __("passwords do not match!", "wp-file-upload"));
|
96 |
-
DEFINE("WFU_ERROR_USERDATACONFIRMPASSWORD_NOBASE", __("no base password field in group!", "wp-file-upload"));
|
97 |
-
DEFINE("WFU_ERROR_USERDATACHECKBOX_NOTCHECKED", __("checkbox unchecked!", "wp-file-upload"));
|
98 |
-
DEFINE("WFU_ERROR_USERDATARADIO_NOTSELECTED", __("no option selected!", "wp-file-upload"));
|
99 |
-
DEFINE("WFU_ERROR_USERDATALIST_NOITEMSELECTED", __("no item selected!", "wp-file-upload"));
|
100 |
-
DEFINE("WFU_ERROR_SAME_PLUGINID", __("There are more than one instances of the plugin in this page with the same id. Please change it.", "wp-file-upload"));
|
101 |
-
DEFINE("WFU_ERROR_PAGE_OBSOLETE", __("Cannot edit the shortcode because the page has been modified. Please reload the page.", "wp-file-upload"));
|
102 |
-
DEFINE("WFU_ERROR_WEBCAM_NOTSUPPORTED", __("Your browser does not support webcam capture!", "wp-file-upload"));
|
103 |
-
DEFINE("WFU_ERROR_WEBCAM_VIDEO_NOTSUPPORTED", __("Your browser does not support video recording from the webcam!", "wp-file-upload"));
|
104 |
-
DEFINE("WFU_ERROR_WEBCAM_VIDEO_NOTHINGRECORDED", __("No video was recorded!", "wp-file-upload"));
|
105 |
-
DEFINE("WFU_ERROR_CAPTCHA_OLDPHP", __("ERROR: Captcha not supported! You have an old PHP version. Upgrade your PHP or use RecaptchaV2 (no account).", "wp-file-upload"));
|
106 |
-
DEFINE("WFU_ERROR_CAPTCHA_MULTIPLE_NOTALLOWED", __("ERROR: Only one instance of RecaptchaV1 can exist on the same page. Please notify administrator.", "wp-file-upload"));
|
107 |
-
DEFINE("WFU_ERROR_CAPTCHA_MULTIPLE_NOTALLOWED_ADMIN", __("ERROR: Only one instance of RecaptchaV1 can exist on the same page. Please use RecaptchaV1 (no account).", "wp-file-upload"));
|
108 |
-
DEFINE("WFU_ERROR_CAPTCHA_NOSITEKEY", __("ERROR: No site key. Please contact administrator!", "wp-file-upload"));
|
109 |
-
DEFINE("WFU_ERROR_CAPTCHA_NOSITEKEY_ADMIN", __("ERROR: No site key defined! Please go to the plugin settings in Dashboard to define Google Recaptcha keys.", "wp-file-upload"));
|
110 |
-
DEFINE("WFU_ERROR_CAPTCHA_NOCHALLENGE", __("Bad captcha image!", "wp-file-upload"));
|
111 |
-
DEFINE("WFU_ERROR_CAPTCHA_NOINPUT", __("No input!", "wp-file-upload"));
|
112 |
-
DEFINE("WFU_ERROR_CAPTCHA_EMPTY", __("Captcha not completed!", "wp-file-upload"));
|
113 |
-
DEFINE("WFU_ERROR_CAPTCHA_WRONGCAPTCHA", __("Wrong captcha!", "wp-file-upload"));
|
114 |
-
DEFINE("WFU_ERROR_CAPTCHA_REFRESHING", __("Error refreshing captcha!", "wp-file-upload"));
|
115 |
-
DEFINE("WFU_ERROR_CAPTCHA_UNKNOWNERROR", __("Unknown captcha error!", "wp-file-upload"));
|
116 |
-
DEFINE("WFU_ERROR_CAPTCHA_NOTSUPPORTED", __("Captcha not supported by your browser!", "wp-file-upload"));
|
117 |
-
DEFINE("WFU_ERROR_CAPTCHA_MISSINGINPUTSECRET", __("the secret parameter is missing", "wp-file-upload"));
|
118 |
-
DEFINE("WFU_ERROR_CAPTCHA_INVALIDINPUTSECRET", __("the secret parameter is invalid or malformed", "wp-file-upload"));
|
119 |
-
DEFINE("WFU_ERROR_CAPTCHA_MISSINGINPUTRESPONSE", __("the response parameter is missing", "wp-file-upload"));
|
120 |
-
DEFINE("WFU_ERROR_CAPTCHA_INVALIDINPUTRESPONSE", __("the response parameter is invalid or malformed", "wp-file-upload"));
|
121 |
-
DEFINE("WFU_ERROR_REDIRECTION_NODRAGDROP", __("Please do not use drag drop due to an internal problem.", "wp-file-upload"));
|
122 |
-
DEFINE("WFU_ERROR_CHUNKEDUPLOAD_UNIQUEIDEMPTY", __("Error during chunked upload. Unique ID empty in chunk %d", "wp-file-upload"));
|
123 |
-
DEFINE("WFU_ERROR_CHUNKEDUPLOAD_NOTALLOWED", __("Chunked upload is not allowed!", "wp-file-upload"));
|
124 |
-
DEFINE("WFU_ERROR_CHUNKEDUPLOAD_ABORTED", __("Chunked upload aborted due to error in previous chunk!", "wp-file-upload"));
|
125 |
-
DEFINE("WFU_ERROR_CHUNKEDUPLOAD_CONCATFAILED", __("Chunked upload failed, final file could not be created!", "wp-file-upload"));
|
126 |
-
DEFINE("WFU_ERROR_ADMIN_CHUNKWRITEFAILED", __("Could not write file chuck to destination on chunk %d", "wp-file-upload"));
|
127 |
-
DEFINE("WFU_ERROR_ADMIN_CHUNKENLARGEFAILED", __("Could not enlarge destination file on chunk %d", "wp-file-upload"));
|
128 |
-
DEFINE("WFU_ERROR_ADMIN_CHUNKHANDLEFAILED", __("Could not open file handles on chunk %d", "wp-file-upload"));
|
129 |
-
DEFINE("WFU_BROWSER_DOWNLOADFILE_NOTALLOWED", __("You are not allowed to download this file!", "wp-file-upload"));
|
130 |
-
DEFINE("WFU_BROWSER_DOWNLOADFILE_NOTEXIST", __("File does not exist!", "wp-file-upload"));
|
131 |
-
DEFINE("WFU_BROWSER_DOWNLOADFILE_FAILED", __("Could not download file!", "wp-file-upload"));
|
132 |
-
DEFINE("WFU_BROWSER_DELETEFILE_NOTALLOWED", __("You are not allowed to delete this file!", "wp-file-upload"));
|
133 |
-
DEFINE("WFU_BROWSER_DELETEFILE_FAILED", __("File was not deleted!", "wp-file-upload"));
|
134 |
-
DEFINE("WFU_BROWSER_DELETEFILES_ALLFAILED", __("No file was deleted!", "wp-file-upload"));
|
135 |
-
DEFINE("WFU_BROWSER_DELETEFILES_SOMEFAILED", __("Some files were not deleted!", "wp-file-upload"));
|
136 |
-
//warning messages
|
137 |
-
DEFINE("WFU_WARNING_FILE_EXISTS", __("Upload skipped! File already exists.", "wp-file-upload"));
|
138 |
-
DEFINE("WFU_WARNING_FILE_SUSPICIOUS", __("The extension of the file does not match its contents.", "wp-file-upload"));
|
139 |
-
DEFINE("WFU_WARNING_ADMIN_FILE_SUSPICIOUS", __("Upload succeeded but the file is suspicious because its contents do not match its extension. Its proper filename is: ", "wp-file-upload"));
|
140 |
-
DEFINE("WFU_WARNING_NOFILES_SELECTED", __("No files have been selected!", "wp-file-upload"));
|
141 |
-
DEFINE("WFU_WARNING_CONSENT_NOTCOMPLETED", __("Please complete the consent question before continuing the upload!", "wp-file-upload"));
|
142 |
-
DEFINE("WFU_WARNING_WPFILEBASE_NOTUPDATED_NOFILES", __("WPFilebase Plugin not updated because there were no files uploaded.", "wp-file-upload"));
|
143 |
-
DEFINE("WFU_WARNING_NOTIFY_NOTSENT_NOFILES", __("Notification email was not sent because there were no files uploaded.", "wp-file-upload"));
|
144 |
-
DEFINE("WFU_WARNING_NOTIFY_NOTSENT_NORECIPIENTS", __("Notification email was not sent because no recipients were defined. Please check notifyrecipients attribute in the shortcode.", "wp-file-upload"));
|
145 |
-
DEFINE("WFU_WARNING_NOTIFY_NOTSENT_UNKNOWNERROR", __("Notification email was not sent due to an error. Please check notifyrecipients, notifysubject and notifymessage attributes for errors.", "wp-file-upload"));
|
146 |
-
DEFINE("WFU_WARNING_REDIRECT_NOTEXECUTED_EMPTY", __("Redirection not executed because redirection link is empty. Please check redirectlink attribute.", "wp-file-upload"));
|
147 |
-
DEFINE("WFU_WARNING_REDIRECT_NOTEXECUTED_FILESFAILED", __("Redirection not executed because not all files were successfully uploaded.", "wp-file-upload"));
|
148 |
-
DEFINE("WFU_WARNING_POTENTIAL_DOS_EMAIL_SUBJECT", __("Potential Denial-Of-Service Attack on {SITE}", "wp-file-upload"));
|
149 |
-
DEFINE("WFU_WARNING_POTENTIAL_DOS_EMAIL_MESSAGE", __("Hello admin\n\nThis is a message from Wordpress File Upload Plugin to notify you that a potential Denial-Of-Service attack has been detected on {SITE}.\n\nThe plugin detected more than {FILENUM} uploads within {INTERVAL} seconds.\n\nAll file uploads that exceed this limit are rejected to protect the website from overflowing.\n\nPlease check the upload history log in the plugin's area in Dashboard for any suspicious behaviour.\n\nA new message will follow if the situation remains.\n\nThanks", "wp-file-upload"));
|
150 |
-
DEFINE("WFU_WARNING_ALT_IPTANUS_SERVER_ACTIVATED", __("You have activated an alternative insecure Iptanus Services Server. For details please contact info@iptanus.com.", "wp-file-upload"));
|
151 |
-
DEFINE("WFU_WARNING_IPTANUS_SERVER_UNREACHABLE", __("Iptanus Services Server is unreachable. This may cause problems on some plugin functions. Please read this :article: for resolution.", "wp-file-upload"));
|
152 |
-
//admin area messages
|
153 |
-
DEFINE("WFU_DASHBOARD_ADD_SHORTCODE_REJECTED", __("Failed to add the shortcode to the page/post. Please try again. If the message persists, contact administrator.", "wp-file-upload"));
|
154 |
-
DEFINE("WFU_DASHBOARD_EDIT_SHORTCODE_REJECTED", __("Failed to edit the shortcode because the contents of the page changed. Try again to edit the shortcode.", "wp-file-upload"));
|
155 |
-
DEFINE("WFU_DASHBOARD_DELETE_SHORTCODE_REJECTED", __("Failed to delete the shortcode because the contents of the page changed. Try again to delete it.", "wp-file-upload"));
|
156 |
-
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.", "wp-file-upload"));
|
157 |
-
DEFINE("WFU_DASHBOARD_UPDATE_SHORTCODE_REJECTED", __("Failed to update the shortcode because the contents of the page changed. Go back to reload the shortcode.", "wp-file-upload"));
|
158 |
-
DEFINE("WFU_DASHBOARD_UPDATE_SHORTCODE_FAILED", __("Failed to update the shortcode. Please try again. If the problem persists, go back and reload the shortcode.", "wp-file-upload"));
|
159 |
-
//test messages
|
160 |
-
DEFINE("WFU_TESTMESSAGE_MESSAGE", __('This is a test message', 'wp-file-upload'));
|
161 |
-
DEFINE("WFU_TESTMESSAGE_ADMINMESSAGE", __('This is a test administrator message', 'wp-file-upload'));
|
162 |
-
DEFINE("WFU_TESTMESSAGE_FILE1_HEADER", __('File testfile 1 under test', 'wp-file-upload'));
|
163 |
-
DEFINE("WFU_TESTMESSAGE_FILE1_MESSAGE", __('File testfile 1 message', 'wp-file-upload'));
|
164 |
-
DEFINE("WFU_TESTMESSAGE_FILE1_ADMINMESSAGE", __('File testfile 1 administrator message', 'wp-file-upload'));
|
165 |
-
DEFINE("WFU_TESTMESSAGE_FILE2_HEADER", __('File testfile 2 under test', 'wp-file-upload'));
|
166 |
-
DEFINE("WFU_TESTMESSAGE_FILE2_MESSAGE", __('File testfile 2 message', 'wp-file-upload'));
|
167 |
-
DEFINE("WFU_TESTMESSAGE_FILE2_ADMINMESSAGE", __('File testfile 2 administrator message', 'wp-file-upload'));
|
168 |
-
//variables tool-tips
|
169 |
-
DEFINE("WFU_VARIABLE_TITLE_USERID", __("Insert variable %userid% inside text. It will be replaced by the id of the current user.", "wp-file-upload"));
|
170 |
-
DEFINE("WFU_VARIABLE_TITLE_USERNAME", __("Insert variable %username% inside text. It will be replaced by the username of the current user.", "wp-file-upload"));
|
171 |
-
DEFINE("WFU_VARIABLE_TITLE_USEREMAIL", __("Insert variable %useremail% inside text. It will be replaced by the email of the current user.", "wp-file-upload"));
|
172 |
-
DEFINE("WFU_VARIABLE_TITLE_FILENAME", __("Insert variable %filename% inside text. It will be replaced by the filename of the uploaded file.", "wp-file-upload"));
|
173 |
-
DEFINE("WFU_VARIABLE_TITLE_FILEPATH", __("Insert variable %filepath% inside text. It will be replaced by the full filepath of the uploaded file.", "wp-file-upload"));
|
174 |
-
DEFINE("WFU_VARIABLE_TITLE_BLOGID", __("Insert variable %blogid% inside text. It will be replaced by the blog id of the website.", "wp-file-upload"));
|
175 |
-
DEFINE("WFU_VARIABLE_TITLE_PAGEID", __("Insert variable %pageid% inside text. It will be replaced by the id of the current page.", "wp-file-upload"));
|
176 |
-
DEFINE("WFU_VARIABLE_TITLE_PAGETITLE", __("Insert variable %pagetitle% inside text. It will be replaced by the title of the current page.", "wp-file-upload"));
|
177 |
-
DEFINE("WFU_VARIABLE_TITLE_USERDATAXXX", __("Insert variable %userdataXXX% inside text. Select the user field from the drop-down list. It will be replaced by the value that the user entered in this field.", "wp-file-upload"));
|
178 |
-
DEFINE("WFU_VARIABLE_TITLE_N", __("Insert variable %n% inside text to denote a line change.", "wp-file-upload"));
|
179 |
-
//other plugin values
|
180 |
-
DEFINE("WFU_WARNINGMESSAGE_NOSAVE", __('File %filename% uploaded successfully but not saved', 'wp-file-upload'));
|
181 |
-
DEFINE("WFU_NOTIFY_TESTMODE", __("Test Mode", "wp-file-upload"));
|
182 |
-
DEFINE("WFU_SUBDIR_SELECTDIR", __("select dir...", "wp-file-upload"));
|
183 |
-
DEFINE("WFU_SUBDIR_TYPEDIR", __("type dir", "wp-file-upload"));
|
184 |
-
DEFINE("WFU_SUCCESSMESSAGE_DETAILS", __('Upload path: %filepath%', 'wp-file-upload'));
|
185 |
-
DEFINE("WFU_FAILMESSAGE_DETAILS", __('Failed upload path: %filepath%', 'wp-file-upload'));
|
186 |
-
DEFINE("WFU_USERDATA_REQUIREDLABEL", __(' (required)', 'wp-file-upload'));
|
187 |
-
DEFINE("WFU_PAGEEXIT_PROMPT", __('Files are being uploaded. Are you sure you want to exit the page?', 'wp-file-upload'));
|
188 |
-
DEFINE("WFU_MESSAGE_CAPTCHA_CHECKING", __("checking captcha...", "wp-file-upload"));
|
189 |
-
DEFINE("WFU_MESSAGE_CAPTCHA_REFRESHING", __("refreshing...", "wp-file-upload"));
|
190 |
-
DEFINE("WFU_MESSAGE_CAPTCHA_OK", __("correct captcha", "wp-file-upload"));
|
191 |
-
DEFINE("WFU_CONFIRMBOX_CAPTION", __("click to continue the upload", "wp-file-upload"));
|
192 |
-
DEFINE("WFU_BROWSER_DELETEFILE_PROMPT", __("Are you sure you want to delete this file?", "wp-file-upload"));
|
193 |
-
DEFINE("WFU_BROWSER_DELETEFILES_PROMPT", __("Are you sure you want to delete these files?", "wp-file-upload"));
|
194 |
-
DEFINE("WFU_BROWSER_BULKACTION_TITLE", __("Bulk Actions", "wp-file-upload"));
|
195 |
-
DEFINE("WFU_BROWSER_BULKACTION_LABEL", __("Apply", "wp-file-upload"));
|
196 |
-
DEFINE("WFU_PAGINATION_PAGE", __("Page", "wp-file-upload"));
|
197 |
-
DEFINE("WFU_PAGINATION_OF", __("of ", "wp-file-upload"));
|
198 |
-
DEFINE("WFU_CANCEL_UPLOAD_PROMPT", __("Are you sure that you want to cancel the upload?", "wp-file-upload"));
|
199 |
-
DEFINE("WFU_FILE_CANCEL_HINT", __("cancel upload of this file", "wp-file-upload"));
|
200 |
-
DEFINE("WFU_UPLOAD_STATE0", __("Upload in progress", "wp-file-upload"));
|
201 |
-
DEFINE("WFU_UPLOAD_STATE1", __("Upload in progress with warnings!", "wp-file-upload"));
|
202 |
-
DEFINE("WFU_UPLOAD_STATE2", __("Upload in progress but some files already failed!", "wp-file-upload"));
|
203 |
-
DEFINE("WFU_UPLOAD_STATE3", __("Upload in progress but no files uploaded so far!", "wp-file-upload"));
|
204 |
-
DEFINE("WFU_UPLOAD_STATE4", __("All files uploaded successfully", "wp-file-upload"));
|
205 |
-
DEFINE("WFU_UPLOAD_STATE5", __("All files uploaded successfully but there are warnings!", "wp-file-upload"));
|
206 |
-
DEFINE("WFU_UPLOAD_STATE5_SINGLEFILE", __("File uploaded successfully but there are warnings!", "wp-file-upload"));
|
207 |
-
DEFINE("WFU_UPLOAD_STATE6", __("Some files failed to upload!", "wp-file-upload"));
|
208 |
-
DEFINE("WFU_UPLOAD_STATE7", __("All files failed to upload", "wp-file-upload"));
|
209 |
-
DEFINE("WFU_UPLOAD_STATE7_SINGLEFILE", __("File failed to upload", "wp-file-upload"));
|
210 |
-
DEFINE("WFU_UPLOAD_STATE8", __("There are no files to upload!", "wp-file-upload"));
|
211 |
-
DEFINE("WFU_UPLOAD_STATE9", __("Test upload message", "wp-file-upload"));
|
212 |
-
DEFINE("WFU_UPLOAD_STATE10", __("JSON parse warning!", "wp-file-upload"));
|
213 |
-
DEFINE("WFU_UPLOAD_STATE11", __("please wait while redirecting...", "wp-file-upload"));
|
214 |
-
DEFINE("WFU_UPLOAD_STATE12", __("Upload failed!", "wp-file-upload"));
|
215 |
-
DEFINE("WFU_UPLOAD_STATE13", __("Submitting data", "wp-file-upload"));
|
216 |
-
DEFINE("WFU_UPLOAD_STATE14", __("Data submitted successfully!", "wp-file-upload"));
|
217 |
-
DEFINE("WFU_UPLOAD_STATE15", __("Data were not submitted!", "wp-file-upload"));
|
218 |
-
DEFINE("WFU_UPLOAD_STATE16", __("Cancelling upload", "wp-file-upload"));
|
219 |
-
DEFINE("WFU_UPLOAD_STATE17", __("Upload cancelled!", "wp-file-upload"));
|
220 |
-
DEFINE("WFU_UPLOAD_STATE18", __("Upload succeeded!", "wp-file-upload"));
|
221 |
-
DEFINE("WFU_UPLOAD_STATE19", __("Upload completed but no files were saved!", "wp-file-upload"));
|
222 |
-
DEFINE("WFU_UPLOAD_STATE19_SINGLEFILE", __("File was not saved due to personal data policy!", "wp-file-upload"));
|
223 |
-
DEFINE("WFU_PAGE_PLUGINEDITOR_BUTTONTITLE", __("Open visual shortcode editor in new window", "wp-file-upload"));
|
224 |
-
DEFINE("WFU_PAGE_PLUGINEDITOR_LOADING", __("loading visual editor", "wp-file-upload"));
|
225 |
-
DEFINE("WFU_CONFIRM_CLEARFILES", __("Clear file list?", "wp-file-upload"));
|
226 |
-
DEFINE("WFU_DROP_HERE_MESSAGE", __('DROP HERE', 'wp-file-upload'));
|
227 |
-
//webcam values
|
228 |
-
DEFINE("WFU_WEBCAM_RECVIDEO_BTN", __('record video', 'wp-file-upload'));
|
229 |
-
DEFINE("WFU_WEBCAM_TAKEPIC_BTN", __('take a picture', 'wp-file-upload'));
|
230 |
-
DEFINE("WFU_WEBCAM_TURNONOFF_BTN", __('turn webcam on/off', 'wp-file-upload'));
|
231 |
-
DEFINE("WFU_WEBCAM_GOLIVE_BTN", __('go live again', 'wp-file-upload'));
|
232 |
-
DEFINE("WFU_WEBCAM_STOPREC_BTN", __('end recording', 'wp-file-upload'));
|
233 |
-
DEFINE("WFU_WEBCAM_PLAY_BTN", __('play', 'wp-file-upload'));
|
234 |
-
DEFINE("WFU_WEBCAM_PAUSE_BTN", __('pause', 'wp-file-upload'));
|
235 |
-
DEFINE("WFU_WEBCAM_GOBACK_BTN", __('go to the beginning', 'wp-file-upload'));
|
236 |
-
DEFINE("WFU_WEBCAM_GOFWD_BTN", __('go to the end', 'wp-file-upload'));
|
237 |
-
//widget values
|
238 |
-
DEFINE("WFU_WIDGET_PLUGINFORM_TITLE", __('Wordpress File Upload Form', 'wp-file-upload'));
|
239 |
-
DEFINE("WFU_WIDGET_PLUGINFORM_DESCRIPTION", __('Wordpress File Upload plugin uploader for sidebars', 'wp-file-upload'));
|
240 |
-
DEFINE("WFU_WIDGET_SIDEBAR_DEFAULTTITLE", __('Upload Files', 'wp-file-upload'));
|
241 |
-
}
|
242 |
-
|
243 |
-
/*********** Environment Variables ************/
|
244 |
-
//plugin default values
|
245 |
-
$GLOBALS["WFU_GLOBALS"] = array(
|
246 |
-
"WFU_UPLOADID" => array( "Default Upload ID", "string", "1", "The default upload ID of the uploader shortcode. It can be any integer from 1 and above." ),
|
247 |
-
"WFU_SINGLEBUTTON" => array( "Default Single-Button Status", "string", "false", "The default single-button status of the uploader shortcode. It can be 'true' or 'false'." ),
|
248 |
-
"WFU_UPLOADROLE" => array( "Default Upload Role", "string", "all,guests", "The default upload role of the uploader shortcode. It can be a comma-separated list of role slugs, including keywords 'all' and 'guests'." ),
|
249 |
-
"WFU_UPLOADPATH" => array( "Default Upload Path", "string", "uploads", "The default upload path of the uploader shortcode. It must be a folder relative to wp-content dir." ),
|
250 |
-
"WFU_FITMODE" => array( "Default Fit Mode", "string", "fixed", "The default fit mode of the uploader shortcode. It can be 'fixed' or 'responsive'." ),
|
251 |
-
"WFU_ALLOWNOFILE" => array( "Default Allow No File Mode", "string", "false", "The default mode for allowing no file uploads. If it is set to 'true' then an upload form can be submitted even if a file has not been selected. It can be 'true' or 'false'." ),
|
252 |
-
"WFU_ALLOWNOFILE" => array( "Default Allow No File Mode", "string", "false", "The default mode for allowing no file uploads. If it is set to 'true' then an upload form can be submitted even if a file has not been selected. It can be 'true' or 'false'." ),
|
253 |
-
"WFU_RESETMODE" => array( "Default Reset Form Mode", "string", "always", "The default reset mode of the upload form. It can be 'always', 'onsuccess' or 'never'." ),
|
254 |
-
"WFU_FORCEFILENAME" => array( "Default Force Filename State", "string", "false", "The default force filename state (force plugin to leave filename unchanged) of the uploader shortcode. It can be 'true' or 'false'." ),
|
255 |
-
"WFU_UPLOADPATTERNS" => array( "Default Upload Extensions", "string", "*.*", "The default allowed file extensions of the uploader shortcode. It can be a comma-separated list of wildcard extensions." ),
|
256 |
-
"WFU_MAXSIZE" => array( "Default Maximum File Size", "string", "50", "The default maximum allowed file size of the uploader shortcode in Megabytes. It can be any positive number." ),
|
257 |
-
"WFU_ACCESSMETHOD" => array( "Default Access Method", "string", "normal", "The default access method (of the website filesystem) of the uploader shortcode. It can be 'normal' or 'ftp'." ),
|
258 |
-
"WFU_FTPINFO" => array( "Default FTP Access Information", "string", "", "The default FTP access parameters of the uploader shortcode. It's syntax is 'username:password@ftp_domain'." ),
|
259 |
-
"WFU_USEFTPDOMAIN" => array( "Default Use FTP Domain State", "string", "false", "The default use FTP domain state (use the FTP domain defined in ftpinfo to store the uploaded files) of the uploader shortcode. It can be 'true' or 'false'." ),
|
260 |
-
"WFU_FTPPASSIVEMODE" => array( "Default FTP Passive Mode State", "string", "false", "The default FTP passive mode (use passive mode or not for FTP access) of the uploader shortcode. It can be 'true' or 'false'." ),
|
261 |
-
"WFU_FTPFILEPERMISSIONS" => array( "Default FTP File Permissions", "string", "", "The default FTP passive mode (use passive mode or not for FTP access) of the uploader shortcode. It can be 'true' or 'false'." ),
|
262 |
-
"WFU_DUBLICATESPOLICY" => array( "Default Duplicate File Action", "string", "overwrite", "The default duplicate file action of the uploader shortcode. It can be 'overwrite', 'reject' or 'mantain both'." ),
|
263 |
-
"WFU_UNIQUEPATTERN" => array( "Default Duplicate File Pattern", "string", "index", "The default duplicate file pattern of the uploader shortcode. It can be 'index' or 'datetimestamp'." ),
|
264 |
-
"WFU_FILEBASELINK" => array( "Default WPFilebase Update State", "string", "false", "The default WPFilebase plugin update state of the uploader shortcode. It can be 'true' or 'false'." ),
|
265 |
-
"WFU_NOTIFY" => array( "Default Email Notification State", "string", "false", "The default email notification state of the uploader shortcode. It can be 'true' or 'false'." ),
|
266 |
-
"WFU_NOTIFYRECIPIENTS" => array( "Default Email Recipients", "string", "", "The default email recipients of the uploader shortcode. It can be a comma-separated list of email addresses." ),
|
267 |
-
"WFU_NOTIFYHEADERS" => array( "Default Email Headers", "string", "", "The default email headers of the uploader shortcode." ),
|
268 |
-
"WFU_ATTACHFILE" => array( "Default Attach File State", "string", "false", "The default attach file to email state of the uploader shortcode. It can be 'true' or 'false'." ),
|
269 |
-
"WFU_REDIRECT" => array( "Default Redirection State", "string", "false", "The default redirection state of the uploader shortcode. It can be 'true' or 'false'." ),
|
270 |
-
"WFU_REDIRECTLINK" => array( "Default Redirect URL", "string", "", "The default redirect URL of the uploader shortcode." ),
|
271 |
-
"WFU_ADMINMESSAGES" => array( "Default State for Admin Messages", "string", "false", "The default state of displaying or not admin messages of the uploader shortcode. It can be 'true' or 'false'." ),
|
272 |
-
"WFU_SUCCESSMESSAGECOLORS" => array( "Default Colors for Success Message", "string", "#006600,#EEFFEE,#006666", "The default color triplet (text, background and border colors) of success message of the uploader shortcode." ),
|
273 |
-
"WFU_WARNINGMESSAGECOLORS" => array( "Default Colors for Warning Message", "string", "#F88017,#FEF2E7,#633309", "The default color triplet (text, background and border colors) of warning message of the uploader shortcode." ),
|
274 |
-
"WFU_FAILMESSAGECOLORS" => array( "Default Colors for Fail Message", "string", "#660000,#FFEEEE,#666600", "The default color triplet (text, background and border colors) of fail message of the uploader shortcode." ),
|
275 |
-
"WFU_WAITMESSAGECOLORS" => array( "Default Colors for Wait Message", "string", "#666666,#EEEEEE,#333333", "The default color triplet (text, background and border colors) of wait message of the uploader shortcode." ),
|
276 |
-
"WFU_SHOWTARGETFOLDER" => array( "Default State for Target Folder", "string", "false", "The default state of displaying or not the target folder of the uploader shortcode. It can be 'true' or 'false'." ),
|
277 |
-
"WFU_TARGETFOLDERLABEL" => array( "Default Text for Target Folder Label", "string", "Upload Directory", "The default text of the target folder label of the uploader shortcode." ),
|
278 |
-
"WFU_ASKFORSUBFOLDERS" => array( "Default Subfolders State", "string", "false", "The default state of displaying or not a list of subfolders of the uploader shortcode. It can be 'true' or 'false'." ),
|
279 |
-
"WFU_SUBFOLDERLABEL" => array( "Default Text of Subfolders Label", "string", "Select Subfolder", "The default text of subfolders label of the uploader shortcode." ),
|
280 |
-
"WFU_SUBFOLDERTREE" => array( "Default Subfolders List", "string", "", "The default list of subfolders of the uploader shortcode. Check plugin's support page for syntax." ),
|
281 |
-
"WFU_FORCECLASSIC" => array( "Default Disable AJAX State", "string", "false", "The default state of disabling or not AJAX functionality of the uploader shortcode. It can be 'true' or 'false'." ),
|
282 |
-
"WFU_TESTMODE" => array( "Default Test Mode State", "string", "false", "The default state of test mode of the uploader shortcode. It can be 'true' or 'false'." ),
|
283 |
-
"WFU_DEBUGMODE" => array( "Default Debug Mode State", "string", "false", "The default state of debug mode of the uploader shortcode. It can be 'true' or 'false'." ),
|
284 |
-
"WFU_WIDTHS" => array( "Default Element Widths", "string", "", "The default widths of the elements of the uploader shortcode. It is a comma-separated list of element widths." ),
|
285 |
-
"WFU_HEIGHTS" => array( "Default Element Heights", "string", "", "The default heights of the elements of the uploader shortcode. It is a comma-separated list of element heights." ),
|
286 |
-
"WFU_PLACEMENTS" => array( "Default Element Placements", "string", "title/filename+selectbutton+uploadbutton/subfolders"."/userdata"."/message", "The default placements of the elements of the uploader shortcode. Check plugin's support page for syntax." ),
|
287 |
-
"WFU_USERDATA" => array( "Default User Fields State", "string", "false", "The default state of custom user fields of the uploader shortcode. It can be 'true' or 'false'." ),
|
288 |
-
"WFU_MEDIALINK" => array( "Default Add to Media State", "string", "false", "The default state for adding files to Media of the uploader shortcode. It can be 'true' or 'false'." ),
|
289 |
-
"WFU_POSTLINK" => array( "Default Attachment to Post State", "string", "false", "The default state for attaching files to current post of the uploader shortcode. It can be 'true' or 'false'." ),
|
290 |
-
"WFU_WEBCAM" => array( "Default Webcam State", "string", "false", "The default state for webcam capture. It can be 'true' or 'false'." ),
|
291 |
-
"WFU_AUDIOCAPTURE" => array( "Default Capture Audio State", "string", "false", "The default state of audio capture. If it is set to 'true' then audio will be captured, together with video from the webcam. It can be 'true' or 'false'." ),
|
292 |
-
"WFU_WEBCAMMODE" => array( "Default Webcam Mode", "string", "capture video", "The default webcam capture mode. It can be 'capture video', 'take photos' or 'both'." ),
|
293 |
-
"WFU_VIDEOWIDTH" => array( "Default Video Width", "string", "", "The default preferable video width for webcam capture. It can be any positive integer in pixels." ),
|
294 |
-
"WFU_VIDEOHEIGHT" => array( "Default Video Height", "string", "", "The default preferable video height for webcam capture. It can be any positive integer in pixels." ),
|
295 |
-
"WFU_VIDEOASPECTRATIO" => array( "Default Video Aspect Ratio", "string", "", "The default preferable video aspect ratio for webcam video capture. It can be any positive value." ),
|
296 |
-
"WFU_VIDEOFRAMERATE" => array( "Default Video Frame Rate", "string", "", "The default preferable video frame rate for webcam video capture. It can be any positive value in frames/sec." ),
|
297 |
-
"WFU_CAMERAFACING" => array( "Default Camera Facing Mode", "string", "any", "The default preferable camera to be used for video/screenshot capture. It can be 'any', 'front' or 'back'." ),
|
298 |
-
"WFU_MAXRECORDTIME" => array( "Default Maximum Record Time", "string", "10", "The default maximum video recording time in seconds. The default value is 10 seconds." ),
|
299 |
-
"WFU_ASKCONSENT" => array( "Default Ask Consent State", "string", "false", "The default state of personal data consent request. The default value is false." ),
|
300 |
-
"WFU_PERSONALDATATYPES" => array( "Default Personal Data Types", "string", "userdata", "The default personal data types. The default value is 'userdata'." ),
|
301 |
-
"WFU_NOTREMEMBERCONSENT" => array( "Default Do Not Remember Consent Answer State", "string", "false", "The default state about remembering or not user's answer on consent question. The default value is true." ),
|
302 |
-
"WFU_CONSENTREJECTUPLOAD" => array( "Default Reject Upload on Consent Denial State", "string", "false", "The default state of continuing or rejecting the upload depending on consent answer. The default value is true." ),
|
303 |
-
"WFU_CONSENTFORMAT" => array( "Default Consent Format", "string", "radio", "The default format of consent question. The default value is 'checkbox'." ),
|
304 |
-
"WFU_CONSENTPRESELECT" => array( "Default Consent Preselect State", "string", "none", "The default preselect state of consent question when checkbox format is active. The default value is false." )
|
305 |
-
);
|
306 |
-
//other plugin values
|
307 |
-
$GLOBALS["WFU_GLOBALS"] += array(
|
308 |
-
"WFU_DEBUG" => array( "Plugin Debug Mode", "string", "OFF", "If DEBUG mode is activated then advanced hook of plugin's function can be performed. This option may make the plugin slower, so use it very carefully. It can be 'OFF' or 'ON'." ),
|
309 |
-
"WFU_RESTRICT_FRONTEND_LOADING" => array( "Restrict Front-End Loading", "string", "false", "It defines whether the plugin will load on all pages or specific ones. If it is 'false' then it will load on all pages. To restrict loading only on specific pages set a comma-separated list of page or post IDs." ),
|
310 |
-
"WFU_UPLOADPROGRESS_MODE" => array( "Upload Progress Mode", "string", "incremental", "Defines how the upload progress is calculated. It can be 'incremental' or 'absolute'. Default value is 'incremental'." ),
|
311 |
-
"WFU_DOS_ATTACKS_CHECK" => array( "Check for Denial-Of-Service Attacks", "string", "true", "If it is true then then plugin will check if the number of files uploaded within a specific amount of time exceeds the limit, thus protecting from DOS attacks. It can be 'true' or 'false'." ),
|
312 |
-
"WFU_DOS_ATTACKS_FILE_LIMIT" => array( "Denial-Of-Service File Limit", "integer", 10000, "Defines the maximum number of files that are allowed to be uploaded within a specific amount of time. It can be any positive integer." ),
|
313 |
-
"WFU_DOS_ATTACKS_TIME_INTERVAL" => array( "Denial-Of-Service Time Interval", "integer", 3600, "Defines the time interval for DOS attacks check. The time interval is given in seconds." ),
|
314 |
-
"WFU_DOS_ATTACKS_ADMIN_EMAIL_FREQUENCY" => array( "Denial-Of-Service Admin Email Frequency", "integer", 3600, "Defines how frequently an email will be sent to administrator notifying for Denial-Of-Service attacks. The time interval is given in seconds." ),
|
315 |
-
"WFU_SANITIZE_FILENAME_MODE" => array( "Filename Sanitization Mode", "string", "strict", "The sanitization mode for filenames. It can be 'strict' or 'loose'." ),
|
316 |
-
"WFU_SANITIZE_FILENAME_DOTS" => array( "Sanitize Filename Dots", "string", "true", "Convert dot symbols (.) in filename into dashes, in order to avoid double extensions. It can be 'true' or 'false'." ),
|
317 |
-
"WFU_WILDCARD_ASTERISK_MODE" => array( "Wildcard Asterisk Mode", "string", "strict", "The mode of wildcard pattern asterisk symbol. If it is strict, then the asterisk will not match dot (.) characters. It can be 'strict' or 'loose'." ),
|
318 |
-
"WFU_PHP_ARRAY_MAXLEN" => array( "Max PHP Array Length", "string", "10000", "The maximum allowable number of items of a PHP array." ),
|
319 |
-
"WFU_ADMINBROWSER_TABLE_MAXROWS" => array( "Admin Browser Rows Per Page", "integer", 25, "The number of rows per page of the admin browser. A value equal to zero or less denotes no pagination." ),
|
320 |
-
"WFU_HISTORYLOG_TABLE_MAXROWS" => array( "History Log Table Rows Per Page", "integer", 25, "The number of rows per page of the History Log table." ),
|
321 |
-
"WFU_UPLOADEDFILES_TABLE_MAXROWS" => array( "Uploaded Files Table Rows Per Page", "integer", 25, "The number of rows per page of the Uploaded Files table." ),
|
322 |
-
"WFU_ALTERNATIVE_RANDOMIZER" => array( "Use Alternative Randomizer", "string", "false", "On fast web servers the plugin's generator of random strings may not work properly causing various problems. If it is set to true, an alternative randomizer method is employed that works for fast web servers. It can be 'true' or 'false'." ),
|
323 |
-
"WFU_FORCE_NOTIFICATIONS" => array( "Force Email Notifications", "string", "false", "Send email notifications (if they are activated) even if no file has been uploaded. It can be 'true' or 'false'." ),
|
324 |
-
"WFU_UPDATE_MEDIA_ON_DELETE" => array( "Update Media on Delete", "string", "true", "When an uploaded file is deleted then delete also the corresponding Media Library item if exists. It can be 'true' or 'false'." ),
|
325 |
-
"WFU_DASHBOARD_PROTECTED" => array( "Dashboard Is Protected", "string", "false", "If /wp-admin folder is password protected then this variable should be set to 'true' so that internal operations of the plugin can work. The username and password should also be set." ),
|
326 |
-
"WFU_DASHBOARD_USERNAME" => array( "Protected Dashboard Username", "string", "", "Username entry for accessing protected /wp-admin folder." ),
|
327 |
-
"WFU_DASHBOARD_PASSWORD" => array( "Protected Dashboard Password", "string", "", "Password entry for accessing protected /wp-admin folder." ),
|
328 |
-
"WFU_EXPORT_DATA_SEPARATOR" => array( "Export Data Separator", "string", ",", "This is the delimiter of the exported file data columns. It can be any symbol. Default value is comma (,)." ),
|
329 |
-
"WFU_EXPORT_USERDATA_SEPARATOR" => array( "Export User Data Separator", "string", ";", "This is the delimiter of the exported user data of each file. It can be any symbol. Default value is semicolon (;)." ),
|
330 |
-
"WFU_DISABLE_VERSION_CHECK" => array( "Disable Version Check", "string", "false", "If it is set to 'true' then the plugin will not check if there are any new versions available. This is a temporary solution to problems having some users accessing Iptanus Services server causing the plugin to stall. It can be 'true' or 'false'." ),
|
331 |
-
"WFU_RELAX_CURL_VERIFY_HOST" => array( "Relax cURL Host Verification", "string", "false", "If it is set to 'true' then CURLOPT_SSL_VERIFYHOST will be disabled when executing a cURL POST request. This is required in some cases so that the plugin can reach https://services2.iptanus.com, because on some servers it fails with a file_get_contents warning. It can be 'true' or 'false'." ),
|
332 |
-
"WFU_USE_ALT_IPTANUS_SERVER" => array( "Use Alternative Iptanus Server", "string", "false", "If it is set to 'true' then the alternative Iptanus server will be used. This is a work-around in some cases where the website cannot reach https://services2.iptanus.com. It can be 'true' or 'false'." ),
|
333 |
-
"WFU_ALT_IPTANUS_SERVER" => array( "Alternative Iptanus Server", "string", "https://iptanusservices.appspot.com", "If it is set then this is the URL of the alternative Iptanus server." ),
|
334 |
-
"WFU_ALT_VERSION_SERVER" => array( "Alternative Version Server", "string", "https://iptanusservices.appspot.com/g79xo30q8s", "If the alternative Iptanus server is used and this variable is not empty, then it will be used as the alternative Version Server URL." ),
|
335 |
-
"WFU_MINIFY_INLINE_CSS" => array( "Minify Inline CSS Code", "string", "true", "Defines whether the inline CSS code will be minified. It can be 'true' or 'false'." ),
|
336 |
-
"WFU_MINIFY_INLINE_JS" => array( "Minify Inline JS Code", "string", "true", "Defines whether the inline Javascript code will be minified. It can be 'true' or 'false'." ),
|
337 |
-
"WFU_US_DBOPTION_CHECK" => array( "DB Option User State Check Interval", "integer", 7200, "Defines how often (in seconds) the plugin will update user state list, when user state is saved in DB option table." ),
|
338 |
-
"WFU_US_DBOPTION_LIFE" => array( "DB Option User State Life", "integer", 1800, "Defines the maximum time of inactivity of a user state, when user state is saved in DB option table." ),
|
339 |
-
"WFU_PD_VISIBLE_OPLEVELS" => array( "Personal Data Visible Operation Levels", "integer", 3, "Defines how deep administrators can go into personal data operation details. A value of -1 denotes that there is no limit." ),
|
340 |
-
"WFU_PD_VISIBLE_PERLEVELS" => array( "Personal Data Visible Permission Levels", "integer", 2, "Defines how deep administrators can go into personal data permission details. A value of -1 denotes that there is no limit." ),
|
341 |
-
"WFU_PD_VISIBLE_LOGLEVELS" => array( "Personal Data Visible Log Action Levels", "integer", 2, "Defines how deep administrators can go into personal data log action details. A value of -1 denotes that there is no limit." ),
|
342 |
-
"WFU_UPLOADEDFILES_MENU" => array( "Uploaded Files Menu State", "string", "true", "Defines whether the Uploaded Files Dashboard menu item will be shown or not. It can be 'true' or 'false'." ),
|
343 |
-
"WFU_UPLOADEDFILES_DEFACTION" => array( "Uploaded Files Default Action", "string", "adminbrowser", "Defines the default action that will be executed when a file link is pressed in Uploaded Files page. It can be 'details', 'adminbrowser', 'historylog', 'link', 'download' and 'none'." ),
|
344 |
-
"WFU_UPLOADEDFILES_COLUMNS" => array( "Uploaded Files Columns", "string", "#, file, upload_date, user, properties, remarks, actions", "Defines the visible columns of the Uploaded Files list as well as their order. It is noted that 'File' column is always visible and it is the second column if '#' column is visible, or the first one if '#' column is hidden." ),
|
345 |
-
"WFU_UPLOADEDFILES_ACTIONS" => array( "Uploaded Files Actions", "string", "details, media, adminbrowser, historylog, link, download", "Defines the allowable actions and their order for each file in Uploaded Files list. It is noted that the actions shown for each file depend on its properties." ),
|
346 |
-
"WFU_UPLOADEDFILES_HIDEINVALID" => array( "Hide Invalid Uploaded Files", "string", "false", "Defines whether all uploaded file records will be shown in Uploaded File menu or only the valid ones. Invalid are the records who are obsolete or their files do not exist anymore." ),
|
347 |
-
"WFU_UPLOADEDFILES_RESET_TIME" => array( "Uploaded Files Reset Time", "integer", 5, "Defines the interval in seconds before the unread uploaded files can be marked as read. A value of -1 denotes that there is no interval." ),
|
348 |
-
"WFU_UPLOADEDFILES_BARMENU" => array(
|
349 |
-
"WFU_UPLOADEDFILES_BARAUTOHIDE" => array( "Uploaded Files Auto-Hide on Toolbar", "string", "false", "Defines whether the Uploaded Files Toolbar (Admin Bar) menu item will be hidden when there are no new uploads. It can be 'true' or 'false'." )
|
350 |
-
);
|
351 |
-
//color definitions
|
352 |
-
$GLOBALS["WFU_GLOBALS"] += array(
|
353 |
-
"WFU_TESTMESSAGECOLORS" => array( "Colors for Message in Test Mode", "string", "#666666,#EEEEEE,#333333", "The color triplet (text, background and border colors) of message in Test mode of the uploader shortcode." ),
|
354 |
-
"WFU_DEFAULTMESSAGECOLORS" => array( "Defaults Message Colors", "string", "#666666,#EEEEEE,#333333", "The default color triplet (text, background and border colors) of message of the uploader shortcode." ),
|
355 |
-
"WFU_HEADERMESSAGECOLORS_STATE0" => array( "State 0 Message Colors", "string", "#666666,#EEEEEE,#333333", "The color triplet (text, background and border colors) of message of upload state 0 (upload in progress with no messages) of the uploader shortcode." ),
|
356 |
-
"WFU_HEADERMESSAGECOLORS_STATE1" => array( "State 1 Message Colors", "string", "#F88017,#FEF2E7,#633309", "The color triplet (text, background and border colors) of message of upload state 1 (upload in progress with messages) of the uploader shortcode." ),
|
357 |
-
"WFU_HEADERMESSAGECOLORS_STATE2" => array( "State 2 Message Colors", "string", "#660000,#FFEEEE,#666600", "The color triplet (text, background and border colors) of message of upload state 2 (upload in progress with some files not uploaded) of the uploader shortcode." ),
|
358 |
-
"WFU_HEADERMESSAGECOLORS_STATE3" => array( "State 3 Message Colors", "string", "#660000,#FFEEEE,#666600", "The color triplet (text, background and border colors) of message of upload state 3 (upload in progress with no files uploaded so far) of the uploader shortcode." ),
|
359 |
-
"WFU_HEADERMESSAGECOLORS_STATE4" => array( "State 4 Message Colors", "string", "#006600,#EEFFEE,#006666", "The color triplet (text, background and border colors) of message of upload state 4 (all files uploaded) of the uploader shortcode." ),
|
360 |
-
"WFU_HEADERMESSAGECOLORS_STATE5" => array( "State 5 Message Colors", "string", "#F88017,#FEF2E7,#633309", "The color triplet (text, background and border colors) of message of upload state 5 (all files uploaded with messages) of the uploader shortcode." ),
|
361 |
-
"WFU_HEADERMESSAGECOLORS_STATE6" => array( "State 6 Message Colors", "string", "#660000,#FFEEEE,#666600", "The color triplet (text, background and border colors) of message of upload state 6 (some files not uploaded) of the uploader shortcode." ),
|
362 |
-
"WFU_HEADERMESSAGECOLORS_STATE7" => array( "State 7 Message Colors", "string", "#660000,#FFEEEE,#666600", "The color triplet (text, background and border colors) of message of upload state 7 (no files uploaded) of the uploader shortcode." ),
|
363 |
-
"WFU_HEADERMESSAGECOLORS_STATE8" => array( "State 8 Message Colors", "string", "#660000,#FFEEEE,#666600", "The color triplet (text, background and border colors) of message of upload state 8 (there are no files to upload) of the uploader shortcode." ),
|
364 |
-
"WFU_HEADERMESSAGECOLORS_STATE9" => array( "State 9 Message Colors", "string", "#666666,#EEEEEE,#333333", "The color triplet (text, background and border colors) of message of upload state 9 (test state) of the uploader shortcode." ),
|
365 |
-
"WFU_HEADERMESSAGECOLORS_STATE10" => array( "State 10 Message Colors", "string", "#F88017,#FEF2E7,#633309", "The color triplet (text, background and border colors) of message of upload state 10 (JSON parse error) of the uploader shortcode." ),
|
366 |
-
"WFU_HEADERMESSAGECOLORS_STATE11" => array( "State 11 Message Colors", "string", "#666666,#EEEEEE,#333333", "The color triplet (text, background and border colors) of message of upload state 11 (redirecting) of the uploader shortcode." ),
|
367 |
-
"WFU_HEADERMESSAGECOLORS_STATE12" => array( "State 12 Message Colors", "string", "#660000,#FFEEEE,#666600", "The color triplet (text, background and border colors) of message of upload state 12 (upload failed) of the uploader shortcode." ),
|
368 |
-
"WFU_HEADERMESSAGECOLORS_STATE13" => array( "State 13 Message Colors", "string", "#666666,#EEEEEE,#333333", "The color triplet (text, background and border colors) of message of upload state 13 (sending data) of the uploader shortcode." ),
|
369 |
-
"WFU_HEADERMESSAGECOLORS_STATE14" => array( "State 14 Message Colors", "string", "#006600,#EEFFEE,#006666", "The color triplet (text, background and border colors) of message of upload state 14 (data submit succeeded) of the uploader shortcode." ),
|
370 |
-
"WFU_HEADERMESSAGECOLORS_STATE15" => array( "State 15 Message Colors", "string", "#660000,#FFEEEE,#666600", "The color triplet (text, background and border colors) of message of upload state 15 (data submit failed) of the uploader shortcode." ),
|
371 |
-
"WFU_HEADERMESSAGECOLORS_STATE16" => array( "State 16 Message Colors", "string", "#666666,#EEEEEE,#333333", "The color triplet (text, background and border colors) of message of upload state 16 (cancelling upload) of the uploader shortcode." ),
|
372 |
-
"WFU_HEADERMESSAGECOLORS_STATE17" => array( "State 17 Message Colors", "string", "#660000,#FFEEEE,#666600", "The color triplet (text, background and border colors) of message of upload state 17 (upload cancelled) of the uploader shortcode." ),
|
373 |
-
"WFU_HEADERMESSAGECOLORS_STATE18" => array( "State 18 Message Colors", "string", "#006600,#EEFFEE,#006666", "The color triplet (text, background and border colors) of message of upload state 18 (upload succeeded) of the uploader shortcode." ),
|
374 |
-
"WFU_HEADERMESSAGECOLORS_STATE19" => array( "State 19 Message Colors", "string", "#F88017,#FEF2E7,#633309", "The color triplet (text, background and border colors) of message of upload state 19 (upload completed but no files were saved due to personal data policy) of the uploader shortcode." )
|
375 |
-
);
|
376 |
-
//insert saved values to array
|
377 |
-
$envars = get_option("wfu_environment_variables", array());
|
378 |
-
foreach ( $GLOBALS["WFU_GLOBALS"] as $ind => $envar ) {
|
379 |
-
if ( isset($envars[$ind]) ) {
|
380 |
-
if ( $envar[1] == "integer" ) $saved = (int)$envars[$ind];
|
381 |
-
else $saved = (string)$envars[$ind];
|
382 |
-
}
|
383 |
-
else $saved = $envar[2];
|
384 |
-
array_splice($GLOBALS["WFU_GLOBALS"][$ind], 3, 0, array( $saved ));
|
385 |
-
//add visibility
|
386 |
-
$GLOBALS["WFU_GLOBALS"][$ind][5] = true;
|
387 |
-
}
|
388 |
-
|
389 |
-
//hide unwanted environment variables
|
390 |
-
$GLOBALS["WFU_GLOBALS"]["WFU_RELAX_CURL_VERIFY_HOST"][5] = false;
|
391 |
-
$GLOBALS["WFU_GLOBALS"]["WFU_USE_ALT_IPTANUS_SERVER"][5] = false;
|
392 |
-
|
393 |
-
/************** Constant Values ***************/
|
394 |
-
//other plugin values
|
395 |
-
DEFINE("WFU_SUCCESSMESSAGECOLOR", "green");
|
396 |
-
DEFINE("WFU_MAX_TIME_LIMIT", ini_get("max_input_time"));
|
397 |
-
DEFINE("WFU_RESPONSE_URL", WPFILEUPLOAD_DIR."wfu_response.php");
|
398 |
-
DEFINE("WFU_AJAX_URL", $siteurl."/wp-admin/admin-ajax.php");
|
399 |
-
DEFINE("WFU_SERVICES_SERVER_URL", 'https://services2.iptanus.com');
|
400 |
-
DEFINE("WFU_VERSION_SERVER_URL", WFU_SERVICES_SERVER_URL.'/wp-admin/admin-ajax.php');
|
401 |
-
DEFINE("WFU_VERSION_HASH", '9npWpXMhAQ5e6AGJ5zqbaPxLk9ePD3eSu3WKeN9p89E9wmgL2PHtrqXPzBVpStzh');
|
402 |
-
DEFINE("WFU_DOWNLOADER_URL", WPFILEUPLOAD_DIR."wfu_file_downloader.php");
|
403 |
-
DEFINE("WFU_IPTANUS_SERVER_UNREACHABLE_ARTICLE", 'https://www.iptanus.com/iptanus-services-server-unreachable-error-wfu-plugin/');
|
404 |
-
//alternative insecure server
|
405 |
-
DEFINE("WFU_SERVICES_SERVER_ALT_URL", 'http://services.iptanus.com');
|
406 |
-
DEFINE("WFU_VERSION_SERVER_ALT_URL", WFU_SERVICES_SERVER_ALT_URL.'/wp-admin/admin-ajax.php');
|
407 |
-
DEFINE("WFU_PRO_VERSION_URL", 'https://www.iptanus.com/product/wordpress-file-upload-pro/');
|
408 |
-
//define images
|
409 |
-
DEFINE("WFU_IMAGE_ADMIN_HELP", WPFILEUPLOAD_DIR.'images/help_16.png');
|
410 |
-
DEFINE("WFU_IMAGE_ADMIN_RESTOREDEFAULT", WPFILEUPLOAD_DIR.'images/restore_16.png');
|
411 |
-
DEFINE("WFU_IMAGE_ADMIN_USERDATA_ADD", WPFILEUPLOAD_DIR.'images/add_12.png');
|
412 |
-
DEFINE("WFU_IMAGE_ADMIN_USERDATA_REMOVE", WPFILEUPLOAD_DIR.'images/remove_12.png');
|
413 |
-
DEFINE("WFU_IMAGE_ADMIN_USERDATA_UP", WPFILEUPLOAD_DIR.'images/up_12.png');
|
414 |
-
DEFINE("WFU_IMAGE_ADMIN_USERDATA_DOWN", WPFILEUPLOAD_DIR.'images/down_12.png');
|
415 |
-
DEFINE("WFU_IMAGE_ADMIN_SUBFOLDER_BROWSE", WPFILEUPLOAD_DIR.'images/tree_16.gif');
|
416 |
-
DEFINE("WFU_IMAGE_ADMIN_SUBFOLDER_OK", WPFILEUPLOAD_DIR.'images/ok_12.gif');
|
417 |
-
DEFINE("WFU_IMAGE_ADMIN_SUBFOLDER_CANCEL", WPFILEUPLOAD_DIR.'images/cancel_12.gif');
|
418 |
-
DEFINE("WFU_IMAGE_ADMIN_SUBFOLDER_LOADING", WPFILEUPLOAD_DIR.'images/refresh_16.gif');
|
419 |
-
DEFINE("WFU_IMAGE_SIMPLE_PROGBAR", WPFILEUPLOAD_DIR.'images/progbar.gif');
|
420 |
-
DEFINE("WFU_IMAGE_OVERLAY_EDITOR", WPFILEUPLOAD_DIR.'images/pencil.svg');
|
421 |
-
DEFINE("WFU_IMAGE_OVERLAY_LOADING", WPFILEUPLOAD_DIR.'images/loading_icon.gif');
|
422 |
-
DEFINE("WFU_IMAGE_FILE_CANCEL", WPFILEUPLOAD_DIR.'images/cancel_16.png');
|
423 |
-
DEFINE("WFU_IMAGE_MEDIA_BUTTONS", WPFILEUPLOAD_DIR.'images/open-iconic.svg');
|
424 |
-
DEFINE("WFU_IMAGE_VERSION_COMPARISON", WPFILEUPLOAD_DIR.'images/Version Comparison.png');
|
425 |
-
|
426 |
-
function wfu_set_javascript_constants() {
|
427 |
-
$consts = array(
|
428 |
-
"notify_testmode" => WFU_NOTIFY_TESTMODE,
|
429 |
-
"nofilemessage" => WFU_ERROR_UPLOAD_NOFILESELECTED,
|
430 |
-
"enable_popups" => WFU_ERROR_ENABLE_POPUPS,
|
431 |
-
"remoteserver_noresult" => WFU_ERROR_REMOTESERVER_NORESULT,
|
432 |
-
"message_header" => WFU_ERRORMESSAGE,
|
433 |
-
"message_failed" => WFU_ERROR_UPLOAD_FAILED_WHILE,
|
434 |
-
"message_cancelled" => WFU_ERROR_UPLOAD_CANCELLED,
|
435 |
-
"message_unknown" => WFU_ERROR_UNKNOWN,
|
436 |
-
"adminmessage_unknown" => WFU_FAILMESSAGE_DETAILS,
|
437 |
-
"message_timelimit" => WFU_ERROR_FILE_PHP_TIME,
|
438 |
-
"message_admin_timelimit" => WFU_ERROR_ADMIN_FILE_PHP_TIME,
|
439 |
-
"cancel_upload_prompt" => WFU_CANCEL_UPLOAD_PROMPT,
|
440 |
-
"file_cancelled" => WFU_ERROR_FILE_CANCELLED,
|
441 |
-
"jsonparse_filemessage" => WFU_ERROR_JSONPARSE_FILEMESSAGE,
|
442 |
-
"jsonparse_message" => WFU_ERROR_JSONPARSE_MESSAGE,
|
443 |
-
"jsonparse_adminmessage" => WFU_ERROR_JSONPARSE_ADMINMESSAGE,
|
444 |
-
"jsonparse_headermessage" => WFU_ERROR_JSONPARSE_HEADERMESSAGE,
|
445 |
-
"jsonparse_headeradminmessage" => WFU_ERROR_JSONPARSE_HEADERADMINMESSAGE,
|
446 |
-
"same_pluginid" => WFU_ERROR_SAME_PLUGINID,
|
447 |
-
"webcam_video_notsupported" => WFU_ERROR_WEBCAM_VIDEO_NOTSUPPORTED,
|
448 |
-
"webcam_video_nothingrecorded" => WFU_ERROR_WEBCAM_VIDEO_NOTHINGRECORDED,
|
449 |
-
"default_colors" => WFU_VAR("WFU_DEFAULTMESSAGECOLORS"),
|
450 |
-
"fail_colors" => WFU_VAR("WFU_FAILMESSAGECOLORS"),
|
451 |
-
"max_time_limit" => WFU_MAX_TIME_LIMIT,
|
452 |
-
"response_url" => WFU_RESPONSE_URL,
|
453 |
-
"ajax_url" => wfu_ajaxurl(),
|
454 |
-
"wfu_pageexit_prompt" => WFU_PAGEEXIT_PROMPT,
|
455 |
-
"wfu_subdir_typedir" => WFU_SUBDIR_TYPEDIR,
|
456 |
-
"wfu_uploadprogress_mode" => WFU_VAR("WFU_UPLOADPROGRESS_MODE"),
|
457 |
-
"wfu_consent_notcompleted" => WFU_WARNING_CONSENT_NOTCOMPLETED
|
458 |
-
);
|
459 |
-
$consts_txt = "";
|
460 |
-
foreach ( $consts as $key => $val )
|
461 |
-
$consts_txt .= ( $consts_txt == "" ? "" : ";" ).wfu_plugin_encode_string($key).":".wfu_plugin_encode_string($val);
|
462 |
-
|
463 |
-
return $consts_txt;
|
464 |
-
}
|
465 |
-
|
466 |
-
?>
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$siteurl = site_url();
|
4 |
+
|
5 |
+
/************ Translatable Strings ************/
|
6 |
+
function wfu_initialize_i18n_strings() {
|
7 |
+
if ( defined("WFU_I18_LOADED") ) return;
|
8 |
+
DEFINE("WFU_I18_LOADED", 1);
|
9 |
+
//plugin default values
|
10 |
+
DEFINE("WFU_UPLOADTITLE", __('Upload files', 'wp-file-upload'));
|
11 |
+
DEFINE("WFU_SELECTBUTTON", __('Select File', 'wp-file-upload'));
|
12 |
+
DEFINE("WFU_UPLOADBUTTON", __('Upload File', 'wp-file-upload'));
|
13 |
+
DEFINE("WFU_NOTIFYSUBJECT", __('File Upload Notification', 'wp-file-upload'));
|
14 |
+
DEFINE("WFU_NOTIFYMESSAGE", __("Dear Recipient,%n%%n% This is an automatic delivery message to notify you that a new file has been uploaded.%n%%n%Best Regards", 'wp-file-upload'));
|
15 |
+
DEFINE("WFU_SUCCESSMESSAGE", __('File %filename% uploaded successfully', 'wp-file-upload'));
|
16 |
+
DEFINE("WFU_WARNINGMESSAGE", __('File %filename% uploaded successfully but with warnings', 'wp-file-upload'));
|
17 |
+
DEFINE("WFU_ERRORMESSAGE", __('File %filename% not uploaded', 'wp-file-upload'));
|
18 |
+
DEFINE("WFU_WAITMESSAGE", __('File %filename% is being uploaded', 'wp-file-upload'));
|
19 |
+
DEFINE("WFU_USERDATALABEL", __('Your message', 'wp-file-upload')."|t:text|s:left|r:0|a:0|p:inline|d:");
|
20 |
+
DEFINE("WFU_CAPTCHAPROMPT", __('Please fill in the above words: ', 'wp-file-upload'));
|
21 |
+
DEFINE("WFU_UPLOADMEDIABUTTON", __('Upload Media', 'wp-file-upload'));
|
22 |
+
DEFINE("WFU_VIDEONAME", __('videostream', 'wp-file-upload'));
|
23 |
+
DEFINE("WFU_IMAGENAME", __('screenshot', 'wp-file-upload'));
|
24 |
+
DEFINE("WFU_CONSENTQUESTION", __('By activating this option I agree to let the website keep my personal data', 'wp-file-upload'));
|
25 |
+
DEFINE("WFU_CONSENTREJECTMESSAGE", __('You have denied to let the website keep your personal data. Upload cannot continue!', 'wp-file-upload'));
|
26 |
+
//browser default values
|
27 |
+
DEFINE("WFU_FILETITLE", __('File', 'wp-file-upload'));
|
28 |
+
DEFINE("WFU_DATETITLE", __('Date', 'wp-file-upload'));
|
29 |
+
DEFINE("WFU_SIZETITLE", __('Size', 'wp-file-upload'));
|
30 |
+
DEFINE("WFU_USERTITLE", __('User', 'wp-file-upload'));
|
31 |
+
DEFINE("WFU_POSTTITLE", __('Page', 'wp-file-upload'));
|
32 |
+
DEFINE("WFU_FIELDSTITLE", __('User Fields', 'wp-file-upload'));
|
33 |
+
DEFINE("WFU_DOWNLOADLABEL", __('Download', 'wp-file-upload'));
|
34 |
+
DEFINE("WFU_DOWNLOADTITLE", __('Download this file', 'wp-file-upload'));
|
35 |
+
DEFINE("WFU_DELETELABEL", __('Delete', 'wp-file-upload'));
|
36 |
+
DEFINE("WFU_DELETETITLE", __('Delete this file', 'wp-file-upload'));
|
37 |
+
DEFINE("WFU_SORTTITLE", __('Sort list based on this column', 'wp-file-upload'));
|
38 |
+
DEFINE("WFU_GUESTTITLE", __('guest', 'wp-file-upload'));
|
39 |
+
DEFINE("WFU_UNKNOWNTITLE", __('unknown', 'wp-file-upload'));
|
40 |
+
//error messages
|
41 |
+
DEFINE("WFU_ERROR_ADMIN_FTPDIR_RESOLVE", __("Error. Could not resolve ftp target filedir. Check the domain in 'ftpinfo' attribute.", "wp-file-upload"));
|
42 |
+
DEFINE("WFU_ERROR_ADMIN_FTPINFO_INVALID", __("Error. Invalid ftp information. Check 'ftpinfo' attribute.", "wp-file-upload"));
|
43 |
+
DEFINE("WFU_ERROR_ADMIN_FTPINFO_EXTRACT", __("Error. Could not extract ftp information from 'ftpinfo' attribute. Check its syntax.", "wp-file-upload"));
|
44 |
+
DEFINE("WFU_ERROR_ADMIN_FTPFILE_RESOLVE", __("Error. Could not resolve ftp target filename. Check the domain in 'ftpinfo' attribute.", "wp-file-upload"));
|
45 |
+
DEFINE("WFU_ERROR_ADMIN_FTPSOURCE_FAIL", __("Error. Could not open source file for ftp upload. Check if file is accessible.", "wp-file-upload"));
|
46 |
+
DEFINE("WFU_ERROR_ADMIN_FTPTRANSFER_FAIL", __("Error. Could not send data to ftp target file.", "wp-file-upload"));
|
47 |
+
DEFINE("WFU_ERROR_ADMIN_FTPHOST_FAIL", __("Error. Could not connect to ftp host. Check the domain in 'ftpinfo' attribute.", "wp-file-upload"));
|
48 |
+
DEFINE("WFU_ERROR_ADMIN_FTPLOGIN_FAIL", __("Error. Could not authenticate to ftp host. Check username and password in 'ftpinfo' attribute.", "wp-file-upload"));
|
49 |
+
DEFINE("WFU_ERROR_ADMIN_SFTPINIT_FAIL", __("Error. Could not initialize sftp subsystem. Please check if the server supports sftp.", "wp-file-upload"));
|
50 |
+
DEFINE("WFU_ERROR_ADMIN_SFTP_UNSUPPORTED", __("Error. The web server does not support sftp.", "wp-file-upload"));
|
51 |
+
DEFINE("WFU_ERROR_ADMIN_FILE_PHP_SIZE", __("Error. The upload size limit of PHP directive upload_max_filesize is preventing the upload of big files.\nPHP directive upload_max_filesize limit is: ".ini_get("upload_max_filesize").".\nTo increase the limit change the value of the directive from php.ini.\nIf you don't have access to php.ini, then try adding the following line to your .htaccess file:\n\nphp_value upload_max_filesize 10M\n\n(adjust the size according to your needs)\n\nThe file .htaccess is found in your website root directory (where index.php is found).\nIf your don't have this file, then create it.\nIf this does not work either, then contact your domain provider.", "wp-file-upload"));
|
52 |
+
DEFINE("WFU_ERROR_ADMIN_FILE_PHP_TIME", __("The upload time limit of PHP directive max_input_time is preventing the upload of big files.\nPHP directive max_input_time limit is: ".ini_get("max_input_time")." seconds.\nTo increase the limit change the value of the directive from php.ini.\nIf you don't have access to php.ini, then add the following line to your .htaccess file:\n\nphp_value max_input_time 500\n\n(adjust the time according to your needs)\n\nThe file .htaccess is found in your website root directory (where index.php is found).\nIf your don't have this file, then create it.\nIf this does not work either, then contact your domain provider.", "wp-file-upload"));
|
53 |
+
DEFINE("WFU_ERROR_ADMIN_DIR_PERMISSION", __("Error. Permission denied to write to target folder.\nCheck and correct read/write permissions of target folder.", "wp-file-upload"));
|
54 |
+
DEFINE("WFU_ERROR_ADMIN_FILE_WRONGEXT", __("Error. This file was rejected because its extension is not correct. Its proper filename is: ", "wp-file-upload"));
|
55 |
+
DEFINE("WFU_ERROR_ADMIN_DOS_ATTACK", __("Too many files are uploaded in a short period of time. This may be a Denial-Of-Service attack, so file was rejected. Please check the upload log for suspicious behaviour.", "wp-file-upload"));
|
56 |
+
DEFINE("WFU_ERROR_DOS_ATTACK", __("File not uploaded in order to prevent overflow of the website. Please contact administrator.", "wp-file-upload"));
|
57 |
+
DEFINE("WFU_ERROR_DIR_EXIST", __("Target folder doesn't exist.", "wp-file-upload"));
|
58 |
+
DEFINE("WFU_ERROR_DIR_NOTEMP", __("Upload failed! Missing a temporary folder.", "wp-file-upload"));
|
59 |
+
DEFINE("WFU_ERROR_DIR_PERMISSION", __("Upload failed! Permission denied to write to target folder.", "wp-file-upload"));
|
60 |
+
DEFINE("WFU_ERROR_FILE_ALLOW", __("File not allowed.", "wp-file-upload"));
|
61 |
+
DEFINE("WFU_ERROR_FILE_REJECT", __("File is suspicious and was rejected.", "wp-file-upload"));
|
62 |
+
DEFINE("WFU_ERROR_FILE_PLUGIN_SIZE", __("The uploaded file exceeds the file size limit.", "wp-file-upload"));
|
63 |
+
DEFINE("WFU_ERROR_FILE_PLUGIN_2GBSIZE", __("The uploaded file exceeds 2GB and is not supported by this server.", "wp-file-upload"));
|
64 |
+
DEFINE("WFU_ERROR_FILE_PHP_SIZE", __("Upload failed! The uploaded file exceeds the file size limit of the server. Please contact the administrator.", "wp-file-upload"));
|
65 |
+
DEFINE("WFU_ERROR_FILE_PHP_TIME", __("Upload failed! The duration of the upload exceeded the time limit of the server. Please contact the administrator.", "wp-file-upload"));
|
66 |
+
DEFINE("WFU_ERROR_FILE_HTML_SIZE", __("Upload failed! The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.", "wp-file-upload"));
|
67 |
+
DEFINE("WFU_ERROR_FILE_PARTIAL", __("Upload failed! The uploaded file was only partially uploaded.", "wp-file-upload"));
|
68 |
+
DEFINE("WFU_ERROR_FILE_NOTHING", __("Upload failed! No file was uploaded.", "wp-file-upload"));
|
69 |
+
DEFINE("WFU_ERROR_FILE_WRITE", __("Upload failed! Failed to write file to disk.", "wp-file-upload"));
|
70 |
+
DEFINE("WFU_ERROR_FILE_MOVE", __("Upload failed! Error occured while moving temporary file. Please contact administrator.", "wp-file-upload"));
|
71 |
+
DEFINE("WFU_ERROR_FILE_CANCELLED", __("Upload cancelled!", "wp-file-upload"));
|
72 |
+
DEFINE("WFU_ERROR_UPLOAD_STOPPED", __("Upload failed! A PHP extension stopped the file upload. PHP does not provide a way to ascertain which extension caused the file upload to stop; examining the list of loaded extensions with phpinfo() may help.", "wp-file-upload"));
|
73 |
+
DEFINE("WFU_ERROR_UPLOAD_FAILED_WHILE", __("Upload failed! Error occured while attemting to upload the file.", "wp-file-upload"));
|
74 |
+
DEFINE("WFU_ERROR_UPLOAD_FAILED", __("Upload failed!", "wp-file-upload"));
|
75 |
+
DEFINE("WFU_ERROR_UPLOAD_NOFILESELECTED", __("No file!", "wp-file-upload"));
|
76 |
+
DEFINE("WFU_ERROR_UPLOAD_CANCELLED", __("Upload failed! The upload has been canceled by the user or the browser dropped the connection.", "wp-file-upload"));
|
77 |
+
DEFINE("WFU_ERROR_UNKNOWN", __("Upload failed! Unknown error.", "wp-file-upload"));
|
78 |
+
DEFINE("WFU_ERROR_CONTACT_ADMIN", __("Please contact the administrator.", "wp-file-upload"));
|
79 |
+
DEFINE("WFU_ERROR_REMOTESERVER_NORESULT", __("No result from remote server!", "wp-file-upload"));
|
80 |
+
DEFINE("WFU_ERROR_JSONPARSE_FILEMESSAGE", __(" but with warnings", "wp-file-upload"));
|
81 |
+
DEFINE("WFU_ERROR_JSONPARSE_MESSAGE", __("Warning: JSON parse error.", "wp-file-upload"));
|
82 |
+
DEFINE("WFU_ERROR_JSONPARSE_ADMINMESSAGE", __("Upload parameters of this file, passed as JSON string to the handler, could not be parsed.", "wp-file-upload"));
|
83 |
+
DEFINE("WFU_ERROR_JSONPARSE_HEADERMESSAGE", __("Warning: JSON parse error.", "wp-file-upload"));
|
84 |
+
DEFINE("WFU_ERROR_JSONPARSE_HEADERADMINMESSAGE", __("UploadStates, passed as JSON string to the handler, could not be parsed.", "wp-file-upload"));
|
85 |
+
DEFINE("WFU_ERROR_REDIRECTION_ERRORCODE0", __("Redirection to classic form functionality occurred due to unknown error.", "wp-file-upload"));
|
86 |
+
DEFINE("WFU_ERROR_REDIRECTION_ERRORCODE1", __("Redirection to classic form functionality occurred because AJAX is not supported.", "wp-file-upload"));
|
87 |
+
DEFINE("WFU_ERROR_REDIRECTION_ERRORCODE2", __("Redirection to classic form functionality occurred because HTML5 is not supported.", "wp-file-upload"));
|
88 |
+
DEFINE("WFU_ERROR_REDIRECTION_ERRORCODE3", __("Redirection to classic form functionality occurred due to JSON parse error.", "wp-file-upload"));
|
89 |
+
DEFINE("WFU_ERROR_ENABLE_POPUPS", __("Please enable popup windows from the browser's settings!", "wp-file-upload"));
|
90 |
+
DEFINE("WFU_ERROR_USERDATA_EMPTY", __("cannot be empty!", "wp-file-upload"));
|
91 |
+
DEFINE("WFU_ERROR_USERDATANUMBER_INVALID", __("number not valid!", "wp-file-upload"));
|
92 |
+
DEFINE("WFU_ERROR_USERDATAEMAIL_INVALID", __("email not valid!", "wp-file-upload"));
|
93 |
+
DEFINE("WFU_ERROR_USERDATACONFIRMEMAIL_NOMATCH", __("emails do not match!", "wp-file-upload"));
|
94 |
+
DEFINE("WFU_ERROR_USERDATACONFIRMEMAIL_NOBASE", __("no base email field in group!", "wp-file-upload"));
|
95 |
+
DEFINE("WFU_ERROR_USERDATACONFIRMPASSWORD_NOMATCH", __("passwords do not match!", "wp-file-upload"));
|
96 |
+
DEFINE("WFU_ERROR_USERDATACONFIRMPASSWORD_NOBASE", __("no base password field in group!", "wp-file-upload"));
|
97 |
+
DEFINE("WFU_ERROR_USERDATACHECKBOX_NOTCHECKED", __("checkbox unchecked!", "wp-file-upload"));
|
98 |
+
DEFINE("WFU_ERROR_USERDATARADIO_NOTSELECTED", __("no option selected!", "wp-file-upload"));
|
99 |
+
DEFINE("WFU_ERROR_USERDATALIST_NOITEMSELECTED", __("no item selected!", "wp-file-upload"));
|
100 |
+
DEFINE("WFU_ERROR_SAME_PLUGINID", __("There are more than one instances of the plugin in this page with the same id. Please change it.", "wp-file-upload"));
|
101 |
+
DEFINE("WFU_ERROR_PAGE_OBSOLETE", __("Cannot edit the shortcode because the page has been modified. Please reload the page.", "wp-file-upload"));
|
102 |
+
DEFINE("WFU_ERROR_WEBCAM_NOTSUPPORTED", __("Your browser does not support webcam capture!", "wp-file-upload"));
|
103 |
+
DEFINE("WFU_ERROR_WEBCAM_VIDEO_NOTSUPPORTED", __("Your browser does not support video recording from the webcam!", "wp-file-upload"));
|
104 |
+
DEFINE("WFU_ERROR_WEBCAM_VIDEO_NOTHINGRECORDED", __("No video was recorded!", "wp-file-upload"));
|
105 |
+
DEFINE("WFU_ERROR_CAPTCHA_OLDPHP", __("ERROR: Captcha not supported! You have an old PHP version. Upgrade your PHP or use RecaptchaV2 (no account).", "wp-file-upload"));
|
106 |
+
DEFINE("WFU_ERROR_CAPTCHA_MULTIPLE_NOTALLOWED", __("ERROR: Only one instance of RecaptchaV1 can exist on the same page. Please notify administrator.", "wp-file-upload"));
|
107 |
+
DEFINE("WFU_ERROR_CAPTCHA_MULTIPLE_NOTALLOWED_ADMIN", __("ERROR: Only one instance of RecaptchaV1 can exist on the same page. Please use RecaptchaV1 (no account).", "wp-file-upload"));
|
108 |
+
DEFINE("WFU_ERROR_CAPTCHA_NOSITEKEY", __("ERROR: No site key. Please contact administrator!", "wp-file-upload"));
|
109 |
+
DEFINE("WFU_ERROR_CAPTCHA_NOSITEKEY_ADMIN", __("ERROR: No site key defined! Please go to the plugin settings in Dashboard to define Google Recaptcha keys.", "wp-file-upload"));
|
110 |
+
DEFINE("WFU_ERROR_CAPTCHA_NOCHALLENGE", __("Bad captcha image!", "wp-file-upload"));
|
111 |
+
DEFINE("WFU_ERROR_CAPTCHA_NOINPUT", __("No input!", "wp-file-upload"));
|
112 |
+
DEFINE("WFU_ERROR_CAPTCHA_EMPTY", __("Captcha not completed!", "wp-file-upload"));
|
113 |
+
DEFINE("WFU_ERROR_CAPTCHA_WRONGCAPTCHA", __("Wrong captcha!", "wp-file-upload"));
|
114 |
+
DEFINE("WFU_ERROR_CAPTCHA_REFRESHING", __("Error refreshing captcha!", "wp-file-upload"));
|
115 |
+
DEFINE("WFU_ERROR_CAPTCHA_UNKNOWNERROR", __("Unknown captcha error!", "wp-file-upload"));
|
116 |
+
DEFINE("WFU_ERROR_CAPTCHA_NOTSUPPORTED", __("Captcha not supported by your browser!", "wp-file-upload"));
|
117 |
+
DEFINE("WFU_ERROR_CAPTCHA_MISSINGINPUTSECRET", __("the secret parameter is missing", "wp-file-upload"));
|
118 |
+
DEFINE("WFU_ERROR_CAPTCHA_INVALIDINPUTSECRET", __("the secret parameter is invalid or malformed", "wp-file-upload"));
|
119 |
+
DEFINE("WFU_ERROR_CAPTCHA_MISSINGINPUTRESPONSE", __("the response parameter is missing", "wp-file-upload"));
|
120 |
+
DEFINE("WFU_ERROR_CAPTCHA_INVALIDINPUTRESPONSE", __("the response parameter is invalid or malformed", "wp-file-upload"));
|
121 |
+
DEFINE("WFU_ERROR_REDIRECTION_NODRAGDROP", __("Please do not use drag drop due to an internal problem.", "wp-file-upload"));
|
122 |
+
DEFINE("WFU_ERROR_CHUNKEDUPLOAD_UNIQUEIDEMPTY", __("Error during chunked upload. Unique ID empty in chunk %d", "wp-file-upload"));
|
123 |
+
DEFINE("WFU_ERROR_CHUNKEDUPLOAD_NOTALLOWED", __("Chunked upload is not allowed!", "wp-file-upload"));
|
124 |
+
DEFINE("WFU_ERROR_CHUNKEDUPLOAD_ABORTED", __("Chunked upload aborted due to error in previous chunk!", "wp-file-upload"));
|
125 |
+
DEFINE("WFU_ERROR_CHUNKEDUPLOAD_CONCATFAILED", __("Chunked upload failed, final file could not be created!", "wp-file-upload"));
|
126 |
+
DEFINE("WFU_ERROR_ADMIN_CHUNKWRITEFAILED", __("Could not write file chuck to destination on chunk %d", "wp-file-upload"));
|
127 |
+
DEFINE("WFU_ERROR_ADMIN_CHUNKENLARGEFAILED", __("Could not enlarge destination file on chunk %d", "wp-file-upload"));
|
128 |
+
DEFINE("WFU_ERROR_ADMIN_CHUNKHANDLEFAILED", __("Could not open file handles on chunk %d", "wp-file-upload"));
|
129 |
+
DEFINE("WFU_BROWSER_DOWNLOADFILE_NOTALLOWED", __("You are not allowed to download this file!", "wp-file-upload"));
|
130 |
+
DEFINE("WFU_BROWSER_DOWNLOADFILE_NOTEXIST", __("File does not exist!", "wp-file-upload"));
|
131 |
+
DEFINE("WFU_BROWSER_DOWNLOADFILE_FAILED", __("Could not download file!", "wp-file-upload"));
|
132 |
+
DEFINE("WFU_BROWSER_DELETEFILE_NOTALLOWED", __("You are not allowed to delete this file!", "wp-file-upload"));
|
133 |
+
DEFINE("WFU_BROWSER_DELETEFILE_FAILED", __("File was not deleted!", "wp-file-upload"));
|
134 |
+
DEFINE("WFU_BROWSER_DELETEFILES_ALLFAILED", __("No file was deleted!", "wp-file-upload"));
|
135 |
+
DEFINE("WFU_BROWSER_DELETEFILES_SOMEFAILED", __("Some files were not deleted!", "wp-file-upload"));
|
136 |
+
//warning messages
|
137 |
+
DEFINE("WFU_WARNING_FILE_EXISTS", __("Upload skipped! File already exists.", "wp-file-upload"));
|
138 |
+
DEFINE("WFU_WARNING_FILE_SUSPICIOUS", __("The extension of the file does not match its contents.", "wp-file-upload"));
|
139 |
+
DEFINE("WFU_WARNING_ADMIN_FILE_SUSPICIOUS", __("Upload succeeded but the file is suspicious because its contents do not match its extension. Its proper filename is: ", "wp-file-upload"));
|
140 |
+
DEFINE("WFU_WARNING_NOFILES_SELECTED", __("No files have been selected!", "wp-file-upload"));
|
141 |
+
DEFINE("WFU_WARNING_CONSENT_NOTCOMPLETED", __("Please complete the consent question before continuing the upload!", "wp-file-upload"));
|
142 |
+
DEFINE("WFU_WARNING_WPFILEBASE_NOTUPDATED_NOFILES", __("WPFilebase Plugin not updated because there were no files uploaded.", "wp-file-upload"));
|
143 |
+
DEFINE("WFU_WARNING_NOTIFY_NOTSENT_NOFILES", __("Notification email was not sent because there were no files uploaded.", "wp-file-upload"));
|
144 |
+
DEFINE("WFU_WARNING_NOTIFY_NOTSENT_NORECIPIENTS", __("Notification email was not sent because no recipients were defined. Please check notifyrecipients attribute in the shortcode.", "wp-file-upload"));
|
145 |
+
DEFINE("WFU_WARNING_NOTIFY_NOTSENT_UNKNOWNERROR", __("Notification email was not sent due to an error. Please check notifyrecipients, notifysubject and notifymessage attributes for errors.", "wp-file-upload"));
|
146 |
+
DEFINE("WFU_WARNING_REDIRECT_NOTEXECUTED_EMPTY", __("Redirection not executed because redirection link is empty. Please check redirectlink attribute.", "wp-file-upload"));
|
147 |
+
DEFINE("WFU_WARNING_REDIRECT_NOTEXECUTED_FILESFAILED", __("Redirection not executed because not all files were successfully uploaded.", "wp-file-upload"));
|
148 |
+
DEFINE("WFU_WARNING_POTENTIAL_DOS_EMAIL_SUBJECT", __("Potential Denial-Of-Service Attack on {SITE}", "wp-file-upload"));
|
149 |
+
DEFINE("WFU_WARNING_POTENTIAL_DOS_EMAIL_MESSAGE", __("Hello admin\n\nThis is a message from Wordpress File Upload Plugin to notify you that a potential Denial-Of-Service attack has been detected on {SITE}.\n\nThe plugin detected more than {FILENUM} uploads within {INTERVAL} seconds.\n\nAll file uploads that exceed this limit are rejected to protect the website from overflowing.\n\nPlease check the upload history log in the plugin's area in Dashboard for any suspicious behaviour.\n\nA new message will follow if the situation remains.\n\nThanks", "wp-file-upload"));
|
150 |
+
DEFINE("WFU_WARNING_ALT_IPTANUS_SERVER_ACTIVATED", __("You have activated an alternative insecure Iptanus Services Server. For details please contact info@iptanus.com.", "wp-file-upload"));
|
151 |
+
DEFINE("WFU_WARNING_IPTANUS_SERVER_UNREACHABLE", __("Iptanus Services Server is unreachable. This may cause problems on some plugin functions. Please read this :article: for resolution.", "wp-file-upload"));
|
152 |
+
//admin area messages
|
153 |
+
DEFINE("WFU_DASHBOARD_ADD_SHORTCODE_REJECTED", __("Failed to add the shortcode to the page/post. Please try again. If the message persists, contact administrator.", "wp-file-upload"));
|
154 |
+
DEFINE("WFU_DASHBOARD_EDIT_SHORTCODE_REJECTED", __("Failed to edit the shortcode because the contents of the page changed. Try again to edit the shortcode.", "wp-file-upload"));
|
155 |
+
DEFINE("WFU_DASHBOARD_DELETE_SHORTCODE_REJECTED", __("Failed to delete the shortcode because the contents of the page changed. Try again to delete it.", "wp-file-upload"));
|
156 |
+
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.", "wp-file-upload"));
|
157 |
+
DEFINE("WFU_DASHBOARD_UPDATE_SHORTCODE_REJECTED", __("Failed to update the shortcode because the contents of the page changed. Go back to reload the shortcode.", "wp-file-upload"));
|
158 |
+
DEFINE("WFU_DASHBOARD_UPDATE_SHORTCODE_FAILED", __("Failed to update the shortcode. Please try again. If the problem persists, go back and reload the shortcode.", "wp-file-upload"));
|
159 |
+
//test messages
|
160 |
+
DEFINE("WFU_TESTMESSAGE_MESSAGE", __('This is a test message', 'wp-file-upload'));
|
161 |
+
DEFINE("WFU_TESTMESSAGE_ADMINMESSAGE", __('This is a test administrator message', 'wp-file-upload'));
|
162 |
+
DEFINE("WFU_TESTMESSAGE_FILE1_HEADER", __('File testfile 1 under test', 'wp-file-upload'));
|
163 |
+
DEFINE("WFU_TESTMESSAGE_FILE1_MESSAGE", __('File testfile 1 message', 'wp-file-upload'));
|
164 |
+
DEFINE("WFU_TESTMESSAGE_FILE1_ADMINMESSAGE", __('File testfile 1 administrator message', 'wp-file-upload'));
|
165 |
+
DEFINE("WFU_TESTMESSAGE_FILE2_HEADER", __('File testfile 2 under test', 'wp-file-upload'));
|
166 |
+
DEFINE("WFU_TESTMESSAGE_FILE2_MESSAGE", __('File testfile 2 message', 'wp-file-upload'));
|
167 |
+
DEFINE("WFU_TESTMESSAGE_FILE2_ADMINMESSAGE", __('File testfile 2 administrator message', 'wp-file-upload'));
|
168 |
+
//variables tool-tips
|
169 |
+
DEFINE("WFU_VARIABLE_TITLE_USERID", __("Insert variable %userid% inside text. It will be replaced by the id of the current user.", "wp-file-upload"));
|
170 |
+
DEFINE("WFU_VARIABLE_TITLE_USERNAME", __("Insert variable %username% inside text. It will be replaced by the username of the current user.", "wp-file-upload"));
|
171 |
+
DEFINE("WFU_VARIABLE_TITLE_USEREMAIL", __("Insert variable %useremail% inside text. It will be replaced by the email of the current user.", "wp-file-upload"));
|
172 |
+
DEFINE("WFU_VARIABLE_TITLE_FILENAME", __("Insert variable %filename% inside text. It will be replaced by the filename of the uploaded file.", "wp-file-upload"));
|
173 |
+
DEFINE("WFU_VARIABLE_TITLE_FILEPATH", __("Insert variable %filepath% inside text. It will be replaced by the full filepath of the uploaded file.", "wp-file-upload"));
|
174 |
+
DEFINE("WFU_VARIABLE_TITLE_BLOGID", __("Insert variable %blogid% inside text. It will be replaced by the blog id of the website.", "wp-file-upload"));
|
175 |
+
DEFINE("WFU_VARIABLE_TITLE_PAGEID", __("Insert variable %pageid% inside text. It will be replaced by the id of the current page.", "wp-file-upload"));
|
176 |
+
DEFINE("WFU_VARIABLE_TITLE_PAGETITLE", __("Insert variable %pagetitle% inside text. It will be replaced by the title of the current page.", "wp-file-upload"));
|
177 |
+
DEFINE("WFU_VARIABLE_TITLE_USERDATAXXX", __("Insert variable %userdataXXX% inside text. Select the user field from the drop-down list. It will be replaced by the value that the user entered in this field.", "wp-file-upload"));
|
178 |
+
DEFINE("WFU_VARIABLE_TITLE_N", __("Insert variable %n% inside text to denote a line change.", "wp-file-upload"));
|
179 |
+
//other plugin values
|
180 |
+
DEFINE("WFU_WARNINGMESSAGE_NOSAVE", __('File %filename% uploaded successfully but not saved', 'wp-file-upload'));
|
181 |
+
DEFINE("WFU_NOTIFY_TESTMODE", __("Test Mode", "wp-file-upload"));
|
182 |
+
DEFINE("WFU_SUBDIR_SELECTDIR", __("select dir...", "wp-file-upload"));
|
183 |
+
DEFINE("WFU_SUBDIR_TYPEDIR", __("type dir", "wp-file-upload"));
|
184 |
+
DEFINE("WFU_SUCCESSMESSAGE_DETAILS", __('Upload path: %filepath%', 'wp-file-upload'));
|
185 |
+
DEFINE("WFU_FAILMESSAGE_DETAILS", __('Failed upload path: %filepath%', 'wp-file-upload'));
|
186 |
+
DEFINE("WFU_USERDATA_REQUIREDLABEL", __(' (required)', 'wp-file-upload'));
|
187 |
+
DEFINE("WFU_PAGEEXIT_PROMPT", __('Files are being uploaded. Are you sure you want to exit the page?', 'wp-file-upload'));
|
188 |
+
DEFINE("WFU_MESSAGE_CAPTCHA_CHECKING", __("checking captcha...", "wp-file-upload"));
|
189 |
+
DEFINE("WFU_MESSAGE_CAPTCHA_REFRESHING", __("refreshing...", "wp-file-upload"));
|
190 |
+
DEFINE("WFU_MESSAGE_CAPTCHA_OK", __("correct captcha", "wp-file-upload"));
|
191 |
+
DEFINE("WFU_CONFIRMBOX_CAPTION", __("click to continue the upload", "wp-file-upload"));
|
192 |
+
DEFINE("WFU_BROWSER_DELETEFILE_PROMPT", __("Are you sure you want to delete this file?", "wp-file-upload"));
|
193 |
+
DEFINE("WFU_BROWSER_DELETEFILES_PROMPT", __("Are you sure you want to delete these files?", "wp-file-upload"));
|
194 |
+
DEFINE("WFU_BROWSER_BULKACTION_TITLE", __("Bulk Actions", "wp-file-upload"));
|
195 |
+
DEFINE("WFU_BROWSER_BULKACTION_LABEL", __("Apply", "wp-file-upload"));
|
196 |
+
DEFINE("WFU_PAGINATION_PAGE", __("Page", "wp-file-upload"));
|
197 |
+
DEFINE("WFU_PAGINATION_OF", __("of ", "wp-file-upload"));
|
198 |
+
DEFINE("WFU_CANCEL_UPLOAD_PROMPT", __("Are you sure that you want to cancel the upload?", "wp-file-upload"));
|
199 |
+
DEFINE("WFU_FILE_CANCEL_HINT", __("cancel upload of this file", "wp-file-upload"));
|
200 |
+
DEFINE("WFU_UPLOAD_STATE0", __("Upload in progress", "wp-file-upload"));
|
201 |
+
DEFINE("WFU_UPLOAD_STATE1", __("Upload in progress with warnings!", "wp-file-upload"));
|
202 |
+
DEFINE("WFU_UPLOAD_STATE2", __("Upload in progress but some files already failed!", "wp-file-upload"));
|
203 |
+
DEFINE("WFU_UPLOAD_STATE3", __("Upload in progress but no files uploaded so far!", "wp-file-upload"));
|
204 |
+
DEFINE("WFU_UPLOAD_STATE4", __("All files uploaded successfully", "wp-file-upload"));
|
205 |
+
DEFINE("WFU_UPLOAD_STATE5", __("All files uploaded successfully but there are warnings!", "wp-file-upload"));
|
206 |
+
DEFINE("WFU_UPLOAD_STATE5_SINGLEFILE", __("File uploaded successfully but there are warnings!", "wp-file-upload"));
|
207 |
+
DEFINE("WFU_UPLOAD_STATE6", __("Some files failed to upload!", "wp-file-upload"));
|
208 |
+
DEFINE("WFU_UPLOAD_STATE7", __("All files failed to upload", "wp-file-upload"));
|
209 |
+
DEFINE("WFU_UPLOAD_STATE7_SINGLEFILE", __("File failed to upload", "wp-file-upload"));
|
210 |
+
DEFINE("WFU_UPLOAD_STATE8", __("There are no files to upload!", "wp-file-upload"));
|
211 |
+
DEFINE("WFU_UPLOAD_STATE9", __("Test upload message", "wp-file-upload"));
|
212 |
+
DEFINE("WFU_UPLOAD_STATE10", __("JSON parse warning!", "wp-file-upload"));
|
213 |
+
DEFINE("WFU_UPLOAD_STATE11", __("please wait while redirecting...", "wp-file-upload"));
|
214 |
+
DEFINE("WFU_UPLOAD_STATE12", __("Upload failed!", "wp-file-upload"));
|
215 |
+
DEFINE("WFU_UPLOAD_STATE13", __("Submitting data", "wp-file-upload"));
|
216 |
+
DEFINE("WFU_UPLOAD_STATE14", __("Data submitted successfully!", "wp-file-upload"));
|
217 |
+
DEFINE("WFU_UPLOAD_STATE15", __("Data were not submitted!", "wp-file-upload"));
|
218 |
+
DEFINE("WFU_UPLOAD_STATE16", __("Cancelling upload", "wp-file-upload"));
|
219 |
+
DEFINE("WFU_UPLOAD_STATE17", __("Upload cancelled!", "wp-file-upload"));
|
220 |
+
DEFINE("WFU_UPLOAD_STATE18", __("Upload succeeded!", "wp-file-upload"));
|
221 |
+
DEFINE("WFU_UPLOAD_STATE19", __("Upload completed but no files were saved!", "wp-file-upload"));
|
222 |
+
DEFINE("WFU_UPLOAD_STATE19_SINGLEFILE", __("File was not saved due to personal data policy!", "wp-file-upload"));
|
223 |
+
DEFINE("WFU_PAGE_PLUGINEDITOR_BUTTONTITLE", __("Open visual shortcode editor in new window", "wp-file-upload"));
|
224 |
+
DEFINE("WFU_PAGE_PLUGINEDITOR_LOADING", __("loading visual editor", "wp-file-upload"));
|
225 |
+
DEFINE("WFU_CONFIRM_CLEARFILES", __("Clear file list?", "wp-file-upload"));
|
226 |
+
DEFINE("WFU_DROP_HERE_MESSAGE", __('DROP HERE', 'wp-file-upload'));
|
227 |
+
//webcam values
|
228 |
+
DEFINE("WFU_WEBCAM_RECVIDEO_BTN", __('record video', 'wp-file-upload'));
|
229 |
+
DEFINE("WFU_WEBCAM_TAKEPIC_BTN", __('take a picture', 'wp-file-upload'));
|
230 |
+
DEFINE("WFU_WEBCAM_TURNONOFF_BTN", __('turn webcam on/off', 'wp-file-upload'));
|
231 |
+
DEFINE("WFU_WEBCAM_GOLIVE_BTN", __('go live again', 'wp-file-upload'));
|
232 |
+
DEFINE("WFU_WEBCAM_STOPREC_BTN", __('end recording', 'wp-file-upload'));
|
233 |
+
DEFINE("WFU_WEBCAM_PLAY_BTN", __('play', 'wp-file-upload'));
|
234 |
+
DEFINE("WFU_WEBCAM_PAUSE_BTN", __('pause', 'wp-file-upload'));
|
235 |
+
DEFINE("WFU_WEBCAM_GOBACK_BTN", __('go to the beginning', 'wp-file-upload'));
|
236 |
+
DEFINE("WFU_WEBCAM_GOFWD_BTN", __('go to the end', 'wp-file-upload'));
|
237 |
+
//widget values
|
238 |
+
DEFINE("WFU_WIDGET_PLUGINFORM_TITLE", __('Wordpress File Upload Form', 'wp-file-upload'));
|
239 |
+
DEFINE("WFU_WIDGET_PLUGINFORM_DESCRIPTION", __('Wordpress File Upload plugin uploader for sidebars', 'wp-file-upload'));
|
240 |
+
DEFINE("WFU_WIDGET_SIDEBAR_DEFAULTTITLE", __('Upload Files', 'wp-file-upload'));
|
241 |
+
}
|
242 |
+
|
243 |
+
/*********** Environment Variables ************/
|
244 |
+
//plugin default values
|
245 |
+
$GLOBALS["WFU_GLOBALS"] = array(
|
246 |
+
"WFU_UPLOADID" => array( "Default Upload ID", "string", "1", "The default upload ID of the uploader shortcode. It can be any integer from 1 and above." ),
|
247 |
+
"WFU_SINGLEBUTTON" => array( "Default Single-Button Status", "string", "false", "The default single-button status of the uploader shortcode. It can be 'true' or 'false'." ),
|
248 |
+
"WFU_UPLOADROLE" => array( "Default Upload Role", "string", "all,guests", "The default upload role of the uploader shortcode. It can be a comma-separated list of role slugs, including keywords 'all' and 'guests'." ),
|
249 |
+
"WFU_UPLOADPATH" => array( "Default Upload Path", "string", "uploads", "The default upload path of the uploader shortcode. It must be a folder relative to wp-content dir." ),
|
250 |
+
"WFU_FITMODE" => array( "Default Fit Mode", "string", "fixed", "The default fit mode of the uploader shortcode. It can be 'fixed' or 'responsive'." ),
|
251 |
+
"WFU_ALLOWNOFILE" => array( "Default Allow No File Mode", "string", "false", "The default mode for allowing no file uploads. If it is set to 'true' then an upload form can be submitted even if a file has not been selected. It can be 'true' or 'false'." ),
|
252 |
+
"WFU_ALLOWNOFILE" => array( "Default Allow No File Mode", "string", "false", "The default mode for allowing no file uploads. If it is set to 'true' then an upload form can be submitted even if a file has not been selected. It can be 'true' or 'false'." ),
|
253 |
+
"WFU_RESETMODE" => array( "Default Reset Form Mode", "string", "always", "The default reset mode of the upload form. It can be 'always', 'onsuccess' or 'never'." ),
|
254 |
+
"WFU_FORCEFILENAME" => array( "Default Force Filename State", "string", "false", "The default force filename state (force plugin to leave filename unchanged) of the uploader shortcode. It can be 'true' or 'false'." ),
|
255 |
+
"WFU_UPLOADPATTERNS" => array( "Default Upload Extensions", "string", "*.*", "The default allowed file extensions of the uploader shortcode. It can be a comma-separated list of wildcard extensions." ),
|
256 |
+
"WFU_MAXSIZE" => array( "Default Maximum File Size", "string", "50", "The default maximum allowed file size of the uploader shortcode in Megabytes. It can be any positive number." ),
|
257 |
+
"WFU_ACCESSMETHOD" => array( "Default Access Method", "string", "normal", "The default access method (of the website filesystem) of the uploader shortcode. It can be 'normal' or 'ftp'." ),
|
258 |
+
"WFU_FTPINFO" => array( "Default FTP Access Information", "string", "", "The default FTP access parameters of the uploader shortcode. It's syntax is 'username:password@ftp_domain'." ),
|
259 |
+
"WFU_USEFTPDOMAIN" => array( "Default Use FTP Domain State", "string", "false", "The default use FTP domain state (use the FTP domain defined in ftpinfo to store the uploaded files) of the uploader shortcode. It can be 'true' or 'false'." ),
|
260 |
+
"WFU_FTPPASSIVEMODE" => array( "Default FTP Passive Mode State", "string", "false", "The default FTP passive mode (use passive mode or not for FTP access) of the uploader shortcode. It can be 'true' or 'false'." ),
|
261 |
+
"WFU_FTPFILEPERMISSIONS" => array( "Default FTP File Permissions", "string", "", "The default FTP passive mode (use passive mode or not for FTP access) of the uploader shortcode. It can be 'true' or 'false'." ),
|
262 |
+
"WFU_DUBLICATESPOLICY" => array( "Default Duplicate File Action", "string", "overwrite", "The default duplicate file action of the uploader shortcode. It can be 'overwrite', 'reject' or 'mantain both'." ),
|
263 |
+
"WFU_UNIQUEPATTERN" => array( "Default Duplicate File Pattern", "string", "index", "The default duplicate file pattern of the uploader shortcode. It can be 'index' or 'datetimestamp'." ),
|
264 |
+
"WFU_FILEBASELINK" => array( "Default WPFilebase Update State", "string", "false", "The default WPFilebase plugin update state of the uploader shortcode. It can be 'true' or 'false'." ),
|
265 |
+
"WFU_NOTIFY" => array( "Default Email Notification State", "string", "false", "The default email notification state of the uploader shortcode. It can be 'true' or 'false'." ),
|
266 |
+
"WFU_NOTIFYRECIPIENTS" => array( "Default Email Recipients", "string", "", "The default email recipients of the uploader shortcode. It can be a comma-separated list of email addresses." ),
|
267 |
+
"WFU_NOTIFYHEADERS" => array( "Default Email Headers", "string", "", "The default email headers of the uploader shortcode." ),
|
268 |
+
"WFU_ATTACHFILE" => array( "Default Attach File State", "string", "false", "The default attach file to email state of the uploader shortcode. It can be 'true' or 'false'." ),
|
269 |
+
"WFU_REDIRECT" => array( "Default Redirection State", "string", "false", "The default redirection state of the uploader shortcode. It can be 'true' or 'false'." ),
|
270 |
+
"WFU_REDIRECTLINK" => array( "Default Redirect URL", "string", "", "The default redirect URL of the uploader shortcode." ),
|
271 |
+
"WFU_ADMINMESSAGES" => array( "Default State for Admin Messages", "string", "false", "The default state of displaying or not admin messages of the uploader shortcode. It can be 'true' or 'false'." ),
|
272 |
+
"WFU_SUCCESSMESSAGECOLORS" => array( "Default Colors for Success Message", "string", "#006600,#EEFFEE,#006666", "The default color triplet (text, background and border colors) of success message of the uploader shortcode." ),
|
273 |
+
"WFU_WARNINGMESSAGECOLORS" => array( "Default Colors for Warning Message", "string", "#F88017,#FEF2E7,#633309", "The default color triplet (text, background and border colors) of warning message of the uploader shortcode." ),
|
274 |
+
"WFU_FAILMESSAGECOLORS" => array( "Default Colors for Fail Message", "string", "#660000,#FFEEEE,#666600", "The default color triplet (text, background and border colors) of fail message of the uploader shortcode." ),
|
275 |
+
"WFU_WAITMESSAGECOLORS" => array( "Default Colors for Wait Message", "string", "#666666,#EEEEEE,#333333", "The default color triplet (text, background and border colors) of wait message of the uploader shortcode." ),
|
276 |
+
"WFU_SHOWTARGETFOLDER" => array( "Default State for Target Folder", "string", "false", "The default state of displaying or not the target folder of the uploader shortcode. It can be 'true' or 'false'." ),
|
277 |
+
"WFU_TARGETFOLDERLABEL" => array( "Default Text for Target Folder Label", "string", "Upload Directory", "The default text of the target folder label of the uploader shortcode." ),
|
278 |
+
"WFU_ASKFORSUBFOLDERS" => array( "Default Subfolders State", "string", "false", "The default state of displaying or not a list of subfolders of the uploader shortcode. It can be 'true' or 'false'." ),
|
279 |
+
"WFU_SUBFOLDERLABEL" => array( "Default Text of Subfolders Label", "string", "Select Subfolder", "The default text of subfolders label of the uploader shortcode." ),
|
280 |
+
"WFU_SUBFOLDERTREE" => array( "Default Subfolders List", "string", "", "The default list of subfolders of the uploader shortcode. Check plugin's support page for syntax." ),
|
281 |
+
"WFU_FORCECLASSIC" => array( "Default Disable AJAX State", "string", "false", "The default state of disabling or not AJAX functionality of the uploader shortcode. It can be 'true' or 'false'." ),
|
282 |
+
"WFU_TESTMODE" => array( "Default Test Mode State", "string", "false", "The default state of test mode of the uploader shortcode. It can be 'true' or 'false'." ),
|
283 |
+
"WFU_DEBUGMODE" => array( "Default Debug Mode State", "string", "false", "The default state of debug mode of the uploader shortcode. It can be 'true' or 'false'." ),
|
284 |
+
"WFU_WIDTHS" => array( "Default Element Widths", "string", "", "The default widths of the elements of the uploader shortcode. It is a comma-separated list of element widths." ),
|
285 |
+
"WFU_HEIGHTS" => array( "Default Element Heights", "string", "", "The default heights of the elements of the uploader shortcode. It is a comma-separated list of element heights." ),
|
286 |
+
"WFU_PLACEMENTS" => array( "Default Element Placements", "string", "title/filename+selectbutton+uploadbutton/subfolders"."/userdata"."/message", "The default placements of the elements of the uploader shortcode. Check plugin's support page for syntax." ),
|
287 |
+
"WFU_USERDATA" => array( "Default User Fields State", "string", "false", "The default state of custom user fields of the uploader shortcode. It can be 'true' or 'false'." ),
|
288 |
+
"WFU_MEDIALINK" => array( "Default Add to Media State", "string", "false", "The default state for adding files to Media of the uploader shortcode. It can be 'true' or 'false'." ),
|
289 |
+
"WFU_POSTLINK" => array( "Default Attachment to Post State", "string", "false", "The default state for attaching files to current post of the uploader shortcode. It can be 'true' or 'false'." ),
|
290 |
+
"WFU_WEBCAM" => array( "Default Webcam State", "string", "false", "The default state for webcam capture. It can be 'true' or 'false'." ),
|
291 |
+
"WFU_AUDIOCAPTURE" => array( "Default Capture Audio State", "string", "false", "The default state of audio capture. If it is set to 'true' then audio will be captured, together with video from the webcam. It can be 'true' or 'false'." ),
|
292 |
+
"WFU_WEBCAMMODE" => array( "Default Webcam Mode", "string", "capture video", "The default webcam capture mode. It can be 'capture video', 'take photos' or 'both'." ),
|
293 |
+
"WFU_VIDEOWIDTH" => array( "Default Video Width", "string", "", "The default preferable video width for webcam capture. It can be any positive integer in pixels." ),
|
294 |
+
"WFU_VIDEOHEIGHT" => array( "Default Video Height", "string", "", "The default preferable video height for webcam capture. It can be any positive integer in pixels." ),
|
295 |
+
"WFU_VIDEOASPECTRATIO" => array( "Default Video Aspect Ratio", "string", "", "The default preferable video aspect ratio for webcam video capture. It can be any positive value." ),
|
296 |
+
"WFU_VIDEOFRAMERATE" => array( "Default Video Frame Rate", "string", "", "The default preferable video frame rate for webcam video capture. It can be any positive value in frames/sec." ),
|
297 |
+
"WFU_CAMERAFACING" => array( "Default Camera Facing Mode", "string", "any", "The default preferable camera to be used for video/screenshot capture. It can be 'any', 'front' or 'back'." ),
|
298 |
+
"WFU_MAXRECORDTIME" => array( "Default Maximum Record Time", "string", "10", "The default maximum video recording time in seconds. The default value is 10 seconds." ),
|
299 |
+
"WFU_ASKCONSENT" => array( "Default Ask Consent State", "string", "false", "The default state of personal data consent request. The default value is false." ),
|
300 |
+
"WFU_PERSONALDATATYPES" => array( "Default Personal Data Types", "string", "userdata", "The default personal data types. The default value is 'userdata'." ),
|
301 |
+
"WFU_NOTREMEMBERCONSENT" => array( "Default Do Not Remember Consent Answer State", "string", "false", "The default state about remembering or not user's answer on consent question. The default value is true." ),
|
302 |
+
"WFU_CONSENTREJECTUPLOAD" => array( "Default Reject Upload on Consent Denial State", "string", "false", "The default state of continuing or rejecting the upload depending on consent answer. The default value is true." ),
|
303 |
+
"WFU_CONSENTFORMAT" => array( "Default Consent Format", "string", "radio", "The default format of consent question. The default value is 'checkbox'." ),
|
304 |
+
"WFU_CONSENTPRESELECT" => array( "Default Consent Preselect State", "string", "none", "The default preselect state of consent question when checkbox format is active. The default value is false." )
|
305 |
+
);
|
306 |
+
//other plugin values
|
307 |
+
$GLOBALS["WFU_GLOBALS"] += array(
|
308 |
+
"WFU_DEBUG" => array( "Plugin Debug Mode", "string", "OFF", "If DEBUG mode is activated then advanced hook of plugin's function can be performed. This option may make the plugin slower, so use it very carefully. It can be 'OFF' or 'ON'." ),
|
309 |
+
"WFU_RESTRICT_FRONTEND_LOADING" => array( "Restrict Front-End Loading", "string", "false", "It defines whether the plugin will load on all pages or specific ones. If it is 'false' then it will load on all pages. To restrict loading only on specific pages set a comma-separated list of page or post IDs." ),
|
310 |
+
"WFU_UPLOADPROGRESS_MODE" => array( "Upload Progress Mode", "string", "incremental", "Defines how the upload progress is calculated. It can be 'incremental' or 'absolute'. Default value is 'incremental'." ),
|
311 |
+
"WFU_DOS_ATTACKS_CHECK" => array( "Check for Denial-Of-Service Attacks", "string", "true", "If it is true then then plugin will check if the number of files uploaded within a specific amount of time exceeds the limit, thus protecting from DOS attacks. It can be 'true' or 'false'." ),
|
312 |
+
"WFU_DOS_ATTACKS_FILE_LIMIT" => array( "Denial-Of-Service File Limit", "integer", 10000, "Defines the maximum number of files that are allowed to be uploaded within a specific amount of time. It can be any positive integer." ),
|
313 |
+
"WFU_DOS_ATTACKS_TIME_INTERVAL" => array( "Denial-Of-Service Time Interval", "integer", 3600, "Defines the time interval for DOS attacks check. The time interval is given in seconds." ),
|
314 |
+
"WFU_DOS_ATTACKS_ADMIN_EMAIL_FREQUENCY" => array( "Denial-Of-Service Admin Email Frequency", "integer", 3600, "Defines how frequently an email will be sent to administrator notifying for Denial-Of-Service attacks. The time interval is given in seconds." ),
|
315 |
+
"WFU_SANITIZE_FILENAME_MODE" => array( "Filename Sanitization Mode", "string", "strict", "The sanitization mode for filenames. It can be 'strict' or 'loose'." ),
|
316 |
+
"WFU_SANITIZE_FILENAME_DOTS" => array( "Sanitize Filename Dots", "string", "true", "Convert dot symbols (.) in filename into dashes, in order to avoid double extensions. It can be 'true' or 'false'." ),
|
317 |
+
"WFU_WILDCARD_ASTERISK_MODE" => array( "Wildcard Asterisk Mode", "string", "strict", "The mode of wildcard pattern asterisk symbol. If it is strict, then the asterisk will not match dot (.) characters. It can be 'strict' or 'loose'." ),
|
318 |
+
"WFU_PHP_ARRAY_MAXLEN" => array( "Max PHP Array Length", "string", "10000", "The maximum allowable number of items of a PHP array." ),
|
319 |
+
"WFU_ADMINBROWSER_TABLE_MAXROWS" => array( "Admin Browser Rows Per Page", "integer", 25, "The number of rows per page of the admin browser. A value equal to zero or less denotes no pagination." ),
|
320 |
+
"WFU_HISTORYLOG_TABLE_MAXROWS" => array( "History Log Table Rows Per Page", "integer", 25, "The number of rows per page of the History Log table." ),
|
321 |
+
"WFU_UPLOADEDFILES_TABLE_MAXROWS" => array( "Uploaded Files Table Rows Per Page", "integer", 25, "The number of rows per page of the Uploaded Files table." ),
|
322 |
+
"WFU_ALTERNATIVE_RANDOMIZER" => array( "Use Alternative Randomizer", "string", "false", "On fast web servers the plugin's generator of random strings may not work properly causing various problems. If it is set to true, an alternative randomizer method is employed that works for fast web servers. It can be 'true' or 'false'." ),
|
323 |
+
"WFU_FORCE_NOTIFICATIONS" => array( "Force Email Notifications", "string", "false", "Send email notifications (if they are activated) even if no file has been uploaded. It can be 'true' or 'false'." ),
|
324 |
+
"WFU_UPDATE_MEDIA_ON_DELETE" => array( "Update Media on Delete", "string", "true", "When an uploaded file is deleted then delete also the corresponding Media Library item if exists. It can be 'true' or 'false'." ),
|
325 |
+
"WFU_DASHBOARD_PROTECTED" => array( "Dashboard Is Protected", "string", "false", "If /wp-admin folder is password protected then this variable should be set to 'true' so that internal operations of the plugin can work. The username and password should also be set." ),
|
326 |
+
"WFU_DASHBOARD_USERNAME" => array( "Protected Dashboard Username", "string", "", "Username entry for accessing protected /wp-admin folder." ),
|
327 |
+
"WFU_DASHBOARD_PASSWORD" => array( "Protected Dashboard Password", "string", "", "Password entry for accessing protected /wp-admin folder." ),
|
328 |
+
"WFU_EXPORT_DATA_SEPARATOR" => array( "Export Data Separator", "string", ",", "This is the delimiter of the exported file data columns. It can be any symbol. Default value is comma (,)." ),
|
329 |
+
"WFU_EXPORT_USERDATA_SEPARATOR" => array( "Export User Data Separator", "string", ";", "This is the delimiter of the exported user data of each file. It can be any symbol. Default value is semicolon (;)." ),
|
330 |
+
"WFU_DISABLE_VERSION_CHECK" => array( "Disable Version Check", "string", "false", "If it is set to 'true' then the plugin will not check if there are any new versions available. This is a temporary solution to problems having some users accessing Iptanus Services server causing the plugin to stall. It can be 'true' or 'false'." ),
|
331 |
+
"WFU_RELAX_CURL_VERIFY_HOST" => array( "Relax cURL Host Verification", "string", "false", "If it is set to 'true' then CURLOPT_SSL_VERIFYHOST will be disabled when executing a cURL POST request. This is required in some cases so that the plugin can reach https://services2.iptanus.com, because on some servers it fails with a file_get_contents warning. It can be 'true' or 'false'." ),
|
332 |
+
"WFU_USE_ALT_IPTANUS_SERVER" => array( "Use Alternative Iptanus Server", "string", "false", "If it is set to 'true' then the alternative Iptanus server will be used. This is a work-around in some cases where the website cannot reach https://services2.iptanus.com. It can be 'true' or 'false'." ),
|
333 |
+
"WFU_ALT_IPTANUS_SERVER" => array( "Alternative Iptanus Server", "string", "https://iptanusservices.appspot.com", "If it is set then this is the URL of the alternative Iptanus server." ),
|
334 |
+
"WFU_ALT_VERSION_SERVER" => array( "Alternative Version Server", "string", "https://iptanusservices.appspot.com/g79xo30q8s", "If the alternative Iptanus server is used and this variable is not empty, then it will be used as the alternative Version Server URL." ),
|
335 |
+
"WFU_MINIFY_INLINE_CSS" => array( "Minify Inline CSS Code", "string", "true", "Defines whether the inline CSS code will be minified. It can be 'true' or 'false'." ),
|
336 |
+
"WFU_MINIFY_INLINE_JS" => array( "Minify Inline JS Code", "string", "true", "Defines whether the inline Javascript code will be minified. It can be 'true' or 'false'." ),
|
337 |
+
"WFU_US_DBOPTION_CHECK" => array( "DB Option User State Check Interval", "integer", 7200, "Defines how often (in seconds) the plugin will update user state list, when user state is saved in DB option table." ),
|
338 |
+
"WFU_US_DBOPTION_LIFE" => array( "DB Option User State Life", "integer", 1800, "Defines the maximum time of inactivity of a user state, when user state is saved in DB option table." ),
|
339 |
+
"WFU_PD_VISIBLE_OPLEVELS" => array( "Personal Data Visible Operation Levels", "integer", 3, "Defines how deep administrators can go into personal data operation details. A value of -1 denotes that there is no limit." ),
|
340 |
+
"WFU_PD_VISIBLE_PERLEVELS" => array( "Personal Data Visible Permission Levels", "integer", 2, "Defines how deep administrators can go into personal data permission details. A value of -1 denotes that there is no limit." ),
|
341 |
+
"WFU_PD_VISIBLE_LOGLEVELS" => array( "Personal Data Visible Log Action Levels", "integer", 2, "Defines how deep administrators can go into personal data log action details. A value of -1 denotes that there is no limit." ),
|
342 |
+
"WFU_UPLOADEDFILES_MENU" => array( "Uploaded Files Menu State", "string", "true", "Defines whether the Uploaded Files Dashboard menu item will be shown or not. It can be 'true' or 'false'." ),
|
343 |
+
"WFU_UPLOADEDFILES_DEFACTION" => array( "Uploaded Files Default Action", "string", "adminbrowser", "Defines the default action that will be executed when a file link is pressed in Uploaded Files page. It can be 'details', 'adminbrowser', 'historylog', 'link', 'download' and 'none'." ),
|
344 |
+
"WFU_UPLOADEDFILES_COLUMNS" => array( "Uploaded Files Columns", "string", "#, file, upload_date, user, properties, remarks, actions", "Defines the visible columns of the Uploaded Files list as well as their order. It is noted that 'File' column is always visible and it is the second column if '#' column is visible, or the first one if '#' column is hidden." ),
|
345 |
+
"WFU_UPLOADEDFILES_ACTIONS" => array( "Uploaded Files Actions", "string", "details, media, adminbrowser, historylog, link, download", "Defines the allowable actions and their order for each file in Uploaded Files list. It is noted that the actions shown for each file depend on its properties." ),
|
346 |
+
"WFU_UPLOADEDFILES_HIDEINVALID" => array( "Hide Invalid Uploaded Files", "string", "false", "Defines whether all uploaded file records will be shown in Uploaded File menu or only the valid ones. Invalid are the records who are obsolete or their files do not exist anymore." ),
|
347 |
+
"WFU_UPLOADEDFILES_RESET_TIME" => array( "Uploaded Files Reset Time", "integer", 5, "Defines the interval in seconds before the unread uploaded files can be marked as read. A value of -1 denotes that there is no interval." ),
|
348 |
+
"WFU_UPLOADEDFILES_BARMENU" => array(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|