Version Description
- fixed bug where ftp credentials did not work when username or password contained (:) or (@) symbols
- RegExp fix for wfu_js_decode_obj function for improved compatibility with caching plugins
- corrected WFU_Original_Template::get_instance() method because it always returned the original class
- View Log page improved so that displayed additional user fields of an uploaded file are not cropped
Download this release
Release Info
Developer | nickboss |
Plugin | WordPress File Upload |
Version | 4.3.0 |
Comparing to | |
See all releases |
Code changes from version 4.2.0 to 4.3.0
- js/wordpress_file_upload_functions.js +3 -3
- lib/wfu_admin_log.php +1 -1
- lib/wfu_admin_settings.php +2 -0
- lib/wfu_ajaxactions.php +3 -1
- lib/wfu_functions.php +56 -60
- lib/wfu_io.php +7 -7
- lib/wfu_template.php +1 -1
- readme.txt +11 -2
- release_notes.txt +1 -1
- templates/uploader-Custom1.php +436 -1
- vendor/minifier/minify/LICENSE +18 -0
- vendor/minifier/path-converter/LICENSE +18 -0
- wordpress_file_upload.php +13 -8
js/wordpress_file_upload_functions.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
GlobalData={};Code_Initializators=[];GlobalData.WFU={n:[]};GlobalData.WFUB={n:[]};GlobalData.filestatematch={};GlobalData.filestatematch.success=[0,1,2,2];GlobalData.filestatematch.warning=[1,1,2,2];GlobalData.filestatematch.error1=[3,3,2,3];GlobalData.filestatematch.error2=[2,2,2,3];GlobalData.UploadInProgressString="";GlobalData.FreeChangeHandler=false;wfu_Check_Browser_Capabilities();
|
2 |
-
if(typeof wfu_js_decode_obj=="undefined")
|
3 |
function wfu_run_js_from_bank(){if(typeof WFU_JS_BANK!="undefined")while(WFU_JS_BANK.length>0){var obj=wfu_js_decode_obj(WFU_JS_BANK[0].obj_str);if(obj)obj[WFU_JS_BANK[0].func].call(obj);WFU_JS_BANK.splice(0,1)}}
|
4 |
function wfu_Initialize_Consts(consts){if(typeof GlobalData.consts!="undefined")return;GlobalData.consts=new Object;var consts_arr=consts.split(";");var const_arr;for(var i=0;i<consts_arr.length;i++){const_txt=consts_arr[i].split(":");GlobalData.consts[wfu_plugin_decode_string(const_txt[0])]=wfu_plugin_decode_string(const_txt[1])}}
|
5 |
function wfu_Load_Code_Connectors(sid){if(typeof wfu_Code_Objects=="undefined")wfu_Code_Objects={};wfu_Code_Objects[sid]=new wfu_Code_Object(sid);for(var i=0;i<Code_Initializators.length;i++)wfu_Code_Objects[sid].additem(Code_Initializators[i](sid))}
|
@@ -10,7 +10,7 @@ item[section].func;if(func!=null){val=func.apply(this,Array.prototype.slice.call
|
|
10 |
function wfu_plugin_load_action(sid){var WFU=GlobalData.WFU[sid];wfu_install_unload_hook();if(!!WFU.visualeditorbutton_exist){WFU.visualeditorbutton.init();var invoke_function=function(){wfu_invoke_shortcode_editor(WFU)};WFU.visualeditorbutton.attachInvokeHandler(invoke_function)}if(WFU.is_formupload)WFU.uploadaction=function(){wfu_redirect_to_classic(sid,0,0)};else WFU.uploadaction=function(){wfu_HTML5UploadFile(sid)};var clickaction=function(){wfu_selectbutton_clicked(sid)};var changeaction=function(fileselected){var WFU=
|
11 |
GlobalData.WFU[sid];var usefilearray=0;wfu_selectbutton_changed(sid,usefilearray);wfu_update_uploadbutton_status(sid);if(WFU.singlebutton&&fileselected)WFU.uploadaction()};if(!!WFU.uploadform_exist)WFU.uploadform.attachActions(clickaction,changeaction);if(!!WFU.submit_exist){if(WFU.testmode)clickaction=function(){alert(GlobalData.consts.notify_testmode)};else clickaction=function(){WFU.uploadaction()};WFU.submit.attachClickAction(clickaction)}}
|
12 |
function wfu_install_unload_hook(){window.onbeforeunload=wfu_unload_hook}function wfu_unload_hook(){if(GlobalData.UploadInProgressString!="")if(GlobalData.UploadInProgressString.trim()!="")return GlobalData.consts.wfu_pageexit_prompt}
|
13 |
-
function wfu_Check_Browser_Capabilities(){if(typeof wfu_BrowserCaps!="undefined")return;wfu_BrowserCaps=new Object;var xmlhttp=wfu_GetHttpRequestObject();wfu_BrowserCaps.supportsAJAX=xmlhttp!=null;wfu_BrowserCaps.supportsUploadProgress=!!(xmlhttp&&"upload"in xmlhttp&&"onprogress"in xmlhttp.upload);var fd=null;try{var fd=new FormData}catch(e$
|
14 |
true:false;wfu_BrowserCaps.supportsAnimation=wfu_check_animation();wfu_BrowserCaps.isSafari=Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>0}
|
15 |
function wfu_check_animation(){var animation=false,animationstring="animation",keyframeprefix="",domPrefixes="Webkit Moz O ms Khtml".split(" "),pfx="";var elm=document.createElement("DIV");if(elm.style.animationName)animation=true;if(animation===false)for(var i=0;i<domPrefixes.length;i++)if(elm.style[domPrefixes[i]+"AnimationName"]!==undefined){pfx=domPrefixes[i];animationstring=pfx+"Animation";keyframeprefix="-"+pfx.toLowerCase()+"-";animation=true;break}return animation}
|
16 |
function wfu_join_strings(delimeter){var args=[].slice.call(arguments);var str="";var delim="";for(var i=1;i<args.length;i++){if(str==""||args[i]=="")delim="";else delim=delimeter;str+=delim+args[i]}return str}
|
@@ -18,7 +18,7 @@ function wfu_plugin_decode_string(str){var i=0;var newstr="";var num,val;while(i
|
|
18 |
function wfu_plugin_encode_string(str){var i=0;var newstr="";var hex="";for(i=0;i<str.length;i++){num=str.charCodeAt(i);if(num>=2048)num=((num&16773120|917504)<<4)+((num&4032|8192)<<2)+(num&63|128);else if(num>=128)num=((num&65472|12288)<<2)+(num&63|128);hex=num.toString(16);if(hex.length==1||hex.length==3||hex.length==5)hex="0"+hex;newstr+=hex}return newstr}
|
19 |
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}function wfu_addEventHandler(obj,evt,handler){if(obj.addEventListener)obj.addEventListener(evt,handler,false);else if(obj.attachEvent)obj.attachEvent("on"+evt,handler);else obj["on"+evt]=handler}
|
20 |
function wfu_attach_element_handlers(item,handler){var elem_events=["DOMAttrModified","textInput","input","change","keypress","paste","focus","propertychange"];for(var i=0;i<elem_events.length;i++)wfu_addEventHandler(item,elem_events[i],handler)}
|
21 |
-
function wfu_GetHttpRequestObject(){var xhr=null;try{xhr=new XMLHttpRequest}catch(e$
|
22 |
function wfu_get_filelist(sid,include_filearray){var WFU=GlobalData.WFU[sid];include_filearray=typeof include_filearray!=="undefined"?include_filearray:true;var farr=[];if(!!WFU.uploadform_exist)farr=WFU.uploadform.files();if(include_filearray&&typeof WFU.filearray!=="undefined")farr=WFU.filearray;return farr}
|
23 |
function wfu_add_files(sid,files){var WFU=GlobalData.WFU[sid];if(typeof WFU.filearray=="undefined"){WFU.filearray=Array();WFU.filearrayprops=Array()}if(!!WFU.uploadform_exist)WFU.uploadform.reset();WFU.filearray.length=WFU.filearrayprops.length=0;for(var i=0;i<files.length;i++){WFU.filearray.push(files[i].file);WFU.filearrayprops.push(files[i].props)}}
|
24 |
function wfu_attach_cancel_event(sid,unique_upload_id){function wfu_cancel_classic_upload_final(){var Params=wfu_Initialize_Params();Params.general.shortcode_id=sid;Params.general.unique_id="";Params.general.files_count=0;Params.general.state=16;wfu_ProcessUploadComplete(sid,0,Params,"no-ajax","",[false,null,false]);if(!!WFU.uploadform_exist){WFU.uploadform.reset();WFU.uploadform.submit();WFU.uploadform.lock()}}function wfu_cancel_classic_upload(){var url=GlobalData.consts.ajax_url+"?action=wfu_ajax_action_cancel_upload&wfu_uploader_nonce="+
|
1 |
GlobalData={};Code_Initializators=[];GlobalData.WFU={n:[]};GlobalData.WFUB={n:[]};GlobalData.filestatematch={};GlobalData.filestatematch.success=[0,1,2,2];GlobalData.filestatematch.warning=[1,1,2,2];GlobalData.filestatematch.error1=[3,3,2,3];GlobalData.filestatematch.error2=[2,2,2,3];GlobalData.UploadInProgressString="";GlobalData.FreeChangeHandler=false;wfu_Check_Browser_Capabilities();
|
2 |
+
if(typeof wfu_js_decode_obj=="undefined")wfu_js_decode_obj=function(obj_str){var obj=null;if(obj_str=="window")obj=window;else{var match=obj_str.match(new RegExp("GlobalData(\\.(WFU|WFUB)\\[(.*?)\\](\\.(.*))?)?$"));if(match){obj=GlobalData;if(match[3])obj=obj[match[2]][match[3]];if(match[5])obj=obj[match[5]]}}return obj};
|
3 |
function wfu_run_js_from_bank(){if(typeof WFU_JS_BANK!="undefined")while(WFU_JS_BANK.length>0){var obj=wfu_js_decode_obj(WFU_JS_BANK[0].obj_str);if(obj)obj[WFU_JS_BANK[0].func].call(obj);WFU_JS_BANK.splice(0,1)}}
|
4 |
function wfu_Initialize_Consts(consts){if(typeof GlobalData.consts!="undefined")return;GlobalData.consts=new Object;var consts_arr=consts.split(";");var const_arr;for(var i=0;i<consts_arr.length;i++){const_txt=consts_arr[i].split(":");GlobalData.consts[wfu_plugin_decode_string(const_txt[0])]=wfu_plugin_decode_string(const_txt[1])}}
|
5 |
function wfu_Load_Code_Connectors(sid){if(typeof wfu_Code_Objects=="undefined")wfu_Code_Objects={};wfu_Code_Objects[sid]=new wfu_Code_Object(sid);for(var i=0;i<Code_Initializators.length;i++)wfu_Code_Objects[sid].additem(Code_Initializators[i](sid))}
|
10 |
function wfu_plugin_load_action(sid){var WFU=GlobalData.WFU[sid];wfu_install_unload_hook();if(!!WFU.visualeditorbutton_exist){WFU.visualeditorbutton.init();var invoke_function=function(){wfu_invoke_shortcode_editor(WFU)};WFU.visualeditorbutton.attachInvokeHandler(invoke_function)}if(WFU.is_formupload)WFU.uploadaction=function(){wfu_redirect_to_classic(sid,0,0)};else WFU.uploadaction=function(){wfu_HTML5UploadFile(sid)};var clickaction=function(){wfu_selectbutton_clicked(sid)};var changeaction=function(fileselected){var WFU=
|
11 |
GlobalData.WFU[sid];var usefilearray=0;wfu_selectbutton_changed(sid,usefilearray);wfu_update_uploadbutton_status(sid);if(WFU.singlebutton&&fileselected)WFU.uploadaction()};if(!!WFU.uploadform_exist)WFU.uploadform.attachActions(clickaction,changeaction);if(!!WFU.submit_exist){if(WFU.testmode)clickaction=function(){alert(GlobalData.consts.notify_testmode)};else clickaction=function(){WFU.uploadaction()};WFU.submit.attachClickAction(clickaction)}}
|
12 |
function wfu_install_unload_hook(){window.onbeforeunload=wfu_unload_hook}function wfu_unload_hook(){if(GlobalData.UploadInProgressString!="")if(GlobalData.UploadInProgressString.trim()!="")return GlobalData.consts.wfu_pageexit_prompt}
|
13 |
+
function wfu_Check_Browser_Capabilities(){if(typeof wfu_BrowserCaps!="undefined")return;wfu_BrowserCaps=new Object;var xmlhttp=wfu_GetHttpRequestObject();wfu_BrowserCaps.supportsAJAX=xmlhttp!=null;wfu_BrowserCaps.supportsUploadProgress=!!(xmlhttp&&"upload"in xmlhttp&&"onprogress"in xmlhttp.upload);var fd=null;try{var fd=new FormData}catch(e$0){}wfu_BrowserCaps.supportsHTML5=fd!=null;var e=document.createElement("iframe");wfu_BrowserCaps.supportsIFRAME=e!=null;wfu_BrowserCaps.supportsDRAGDROP=window.FileReader?
|
14 |
true:false;wfu_BrowserCaps.supportsAnimation=wfu_check_animation();wfu_BrowserCaps.isSafari=Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>0}
|
15 |
function wfu_check_animation(){var animation=false,animationstring="animation",keyframeprefix="",domPrefixes="Webkit Moz O ms Khtml".split(" "),pfx="";var elm=document.createElement("DIV");if(elm.style.animationName)animation=true;if(animation===false)for(var i=0;i<domPrefixes.length;i++)if(elm.style[domPrefixes[i]+"AnimationName"]!==undefined){pfx=domPrefixes[i];animationstring=pfx+"Animation";keyframeprefix="-"+pfx.toLowerCase()+"-";animation=true;break}return animation}
|
16 |
function wfu_join_strings(delimeter){var args=[].slice.call(arguments);var str="";var delim="";for(var i=1;i<args.length;i++){if(str==""||args[i]=="")delim="";else delim=delimeter;str+=delim+args[i]}return str}
|
18 |
function wfu_plugin_encode_string(str){var i=0;var newstr="";var hex="";for(i=0;i<str.length;i++){num=str.charCodeAt(i);if(num>=2048)num=((num&16773120|917504)<<4)+((num&4032|8192)<<2)+(num&63|128);else if(num>=128)num=((num&65472|12288)<<2)+(num&63|128);hex=num.toString(16);if(hex.length==1||hex.length==3||hex.length==5)hex="0"+hex;newstr+=hex}return newstr}
|
19 |
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}function wfu_addEventHandler(obj,evt,handler){if(obj.addEventListener)obj.addEventListener(evt,handler,false);else if(obj.attachEvent)obj.attachEvent("on"+evt,handler);else obj["on"+evt]=handler}
|
20 |
function wfu_attach_element_handlers(item,handler){var elem_events=["DOMAttrModified","textInput","input","change","keypress","paste","focus","propertychange"];for(var i=0;i<elem_events.length;i++)wfu_addEventHandler(item,elem_events[i],handler)}
|
21 |
+
function wfu_GetHttpRequestObject(){var xhr=null;try{xhr=new XMLHttpRequest}catch(e$1){try{xhr=new ActiveXObject("Msxml2.XMLHTTP")}catch(e2){try{xhr=new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}}if(xhr==null&&window.createRequest)try{xmlhttp=window.createRequest()}catch(e$2){}return xhr}
|
22 |
function wfu_get_filelist(sid,include_filearray){var WFU=GlobalData.WFU[sid];include_filearray=typeof include_filearray!=="undefined"?include_filearray:true;var farr=[];if(!!WFU.uploadform_exist)farr=WFU.uploadform.files();if(include_filearray&&typeof WFU.filearray!=="undefined")farr=WFU.filearray;return farr}
|
23 |
function wfu_add_files(sid,files){var WFU=GlobalData.WFU[sid];if(typeof WFU.filearray=="undefined"){WFU.filearray=Array();WFU.filearrayprops=Array()}if(!!WFU.uploadform_exist)WFU.uploadform.reset();WFU.filearray.length=WFU.filearrayprops.length=0;for(var i=0;i<files.length;i++){WFU.filearray.push(files[i].file);WFU.filearrayprops.push(files[i].props)}}
|
24 |
function wfu_attach_cancel_event(sid,unique_upload_id){function wfu_cancel_classic_upload_final(){var Params=wfu_Initialize_Params();Params.general.shortcode_id=sid;Params.general.unique_id="";Params.general.files_count=0;Params.general.state=16;wfu_ProcessUploadComplete(sid,0,Params,"no-ajax","",[false,null,false]);if(!!WFU.uploadform_exist){WFU.uploadform.reset();WFU.uploadform.submit();WFU.uploadform.lock()}}function wfu_cancel_classic_upload(){var url=GlobalData.consts.ajax_url+"?action=wfu_ajax_action_cancel_upload&wfu_uploader_nonce="+
|
lib/wfu_admin_log.php
CHANGED
@@ -79,7 +79,7 @@ function wfu_view_log($page = 1, $only_table_rows = false) {
|
|
79 |
}
|
80 |
}
|
81 |
if ( $remarks != '' ) {
|
82 |
-
$remarks = "\n\t\t\t\t\t\t".'<select multiple="multiple" style="width:100%; height:40px; background:none; font-size:small;">'.$remarks;
|
83 |
$remarks .= "\n\t\t\t\t\t\t".'</select>';
|
84 |
}
|
85 |
}
|
79 |
}
|
80 |
}
|
81 |
if ( $remarks != '' ) {
|
82 |
+
$remarks = "\n\t\t\t\t\t\t".'<select multiple="multiple" style="width:100%; height:40px; background:none; font-size:small; overflow:scroll;">'.$remarks;
|
83 |
$remarks .= "\n\t\t\t\t\t\t".'</select>';
|
84 |
}
|
85 |
}
|
lib/wfu_admin_settings.php
CHANGED
@@ -11,6 +11,7 @@ function wfu_settings_definitions() {
|
|
11 |
"relaxcss" => array("number", ""),
|
12 |
"admindomain" => array("number", ""),
|
13 |
"mediacustom" => array("number", ""),
|
|
|
14 |
"includeotherfiles" => array("number", ""),
|
15 |
"altserver" => array("number", ""),
|
16 |
"captcha_sitekey" => array("string", ""),
|
@@ -145,6 +146,7 @@ function wfu_manage_settings($message = '') {
|
|
145 |
$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>';
|
146 |
$echo_str .= "\n\t\t\t\t\t\t".'</td>';
|
147 |
$echo_str .= "\n\t\t\t\t\t".'</tr>';
|
|
|
148 |
$echo_str .= "\n\t\t\t\t\t\t".'<th scope="row">';
|
149 |
$echo_str .= "\n\t\t\t\t\t\t\t".'<label for="wfu_includeotherfiles">Include Other Files in Plugin\'s Database</label>';
|
150 |
$echo_str .= "\n\t\t\t\t\t\t".'</th>';
|
11 |
"relaxcss" => array("number", ""),
|
12 |
"admindomain" => array("number", ""),
|
13 |
"mediacustom" => array("number", ""),
|
14 |
+
"createthumbnails" => array("number", ""),
|
15 |
"includeotherfiles" => array("number", ""),
|
16 |
"altserver" => array("number", ""),
|
17 |
"captcha_sitekey" => array("string", ""),
|
146 |
$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>';
|
147 |
$echo_str .= "\n\t\t\t\t\t\t".'</td>';
|
148 |
$echo_str .= "\n\t\t\t\t\t".'</tr>';
|
149 |
+
$echo_str .= "\n\t\t\t\t\t".'<tr>';
|
150 |
$echo_str .= "\n\t\t\t\t\t\t".'<th scope="row">';
|
151 |
$echo_str .= "\n\t\t\t\t\t\t\t".'<label for="wfu_includeotherfiles">Include Other Files in Plugin\'s Database</label>';
|
152 |
$echo_str .= "\n\t\t\t\t\t\t".'</th>';
|
lib/wfu_ajaxactions.php
CHANGED
@@ -646,7 +646,9 @@ function wfu_ajax_action_include_file() {
|
|
646 |
$dec_file = wfu_path_rel2abs(wfu_flatten_path($dec_file));
|
647 |
$fileid = wfu_log_action('include', $dec_file, $user->ID, '', '', get_current_blog_id(), '', null);
|
648 |
|
649 |
-
if ( $fileid !== false )
|
|
|
|
|
650 |
else die(apply_filters('_wfu_ajax_action_include_file', 'wfu_include_file:fail:'));
|
651 |
}
|
652 |
|
646 |
$dec_file = wfu_path_rel2abs(wfu_flatten_path($dec_file));
|
647 |
$fileid = wfu_log_action('include', $dec_file, $user->ID, '', '', get_current_blog_id(), '', null);
|
648 |
|
649 |
+
if ( $fileid !== false ) {
|
650 |
+
die(apply_filters('_wfu_ajax_action_include_file', "wfu_include_file:success:".$fileid));
|
651 |
+
}
|
652 |
else die(apply_filters('_wfu_ajax_action_include_file', 'wfu_include_file:fail:'));
|
653 |
}
|
654 |
|
lib/wfu_functions.php
CHANGED
@@ -463,7 +463,7 @@ function wfu_js_to_HTML($js) {
|
|
463 |
}
|
464 |
|
465 |
function wfu_init_run_js_script() {
|
466 |
-
$script = 'if (typeof wfu_js_decode_obj == "undefined") function wfu_js_decode_obj(obj_str) { var obj = null; if (obj_str == "window") obj = window; else { var match = obj_str.match(
|
467 |
$script .= "\n".'if (typeof wfu_run_js == "undefined") function wfu_run_js(obj_str, func) { if (typeof GlobalData == "undefined") { if (typeof window.WFU_JS_BANK == "undefined") WFU_JS_BANK = []; WFU_JS_BANK.push({obj_str: obj_str, func: func}) } else { var obj = wfu_js_decode_obj(obj_str); if (obj) obj[func].call(obj); } }';
|
468 |
return wfu_js_to_HTML($script);
|
469 |
}
|
@@ -644,9 +644,10 @@ function wfu_delete_file_execute($filepath, $userid) {
|
|
644 |
$retid = wfu_log_action('delete', $filepath, $userid, '', 0, 0, '', null);
|
645 |
$result = unlink($filepath);
|
646 |
if ( !$result ) wfu_revert_log_action($retid);
|
647 |
-
|
648 |
-
|
649 |
-
|
|
|
650 |
}
|
651 |
|
652 |
return $result;
|
@@ -661,8 +662,8 @@ function wfu_upload_plugin_full_path( $params ) {
|
|
661 |
$pos1 = strpos($ftpdata_flat, ":");
|
662 |
$pos2 = strpos($ftpdata_flat, "@");
|
663 |
if ( $pos1 && $pos2 && $pos2 > $pos1 ) {
|
664 |
-
$ftp_username = substr($params["ftpinfo"], 0, $pos1);
|
665 |
-
$ftp_password = substr($params["ftpinfo"], $pos1 + 1, $pos2 - $pos1 - 1);
|
666 |
$ftp_host = substr($params["ftpinfo"], $pos2 + 1);
|
667 |
$ftp_port = preg_replace("/^[^:]*:?/", "", $ftp_host);
|
668 |
$ftp_host_clean = preg_replace("/:.*/", "", $ftp_host);
|
@@ -1043,12 +1044,10 @@ function wfu_log_action($action, $filepath, $userid, $uploadid, $pageid, $blogid
|
|
1043 |
// calculate file size
|
1044 |
$filesize = filesize($filepath);
|
1045 |
// first make obsolete records having the same file path because the old file has been replaced
|
1046 |
-
$wpdb->
|
1047 |
-
|
1048 |
-
|
1049 |
-
|
1050 |
-
array( '%s')
|
1051 |
-
);
|
1052 |
}
|
1053 |
// attempt to create new log record
|
1054 |
$now_date = date('Y-m-d H:i:s');
|
@@ -1337,6 +1336,7 @@ function wfu_revert_log_action($idlog) {
|
|
1337 |
|
1338 |
//find user by its id and return a non-empty username
|
1339 |
function wfu_get_username_by_id($id) {
|
|
|
1340 |
$user = get_user_by('id', $id);
|
1341 |
if ( $user == false && $id > 0 ) $username = 'unknown';
|
1342 |
elseif ( $user == false && $id == -999 ) $username = 'system';
|
@@ -1412,41 +1412,44 @@ function wfu_get_latest_rec_from_id($idlog) {
|
|
1412 |
* @return mixed
|
1413 |
*/
|
1414 |
function wfu_get_latest_filedata_from_id($idlog, $is_new = false) {
|
1415 |
-
global $wpdb;
|
1416 |
-
$table_name1 = $wpdb->prefix . "wfu_log";
|
1417 |
-
|
1418 |
//get latest database record of file, if it is still valid
|
1419 |
$filerec = wfu_get_latest_rec_from_id($idlog);
|
1420 |
//return null if the record does not exist or it is obsolete
|
1421 |
if ( $filerec == null ) return null;
|
1422 |
-
|
1423 |
-
|
1424 |
-
$filedata = wfu_decode_array_from_string($filerec->filedata);
|
1425 |
-
if ( !is_array($filedata) ) return ( $is_new ? array() : null );
|
1426 |
-
//update filepath property in filedata of "transfer" type, if service
|
1427 |
-
//records exist
|
1428 |
-
foreach ( $filedata as $key => $data )
|
1429 |
-
if ( !isset($data["type"]) || $data["type"] == "transfer" )
|
1430 |
-
$filedata[$key]["filepath"] = $filerec->filepath;
|
1431 |
-
|
1432 |
-
return $filedata;
|
1433 |
}
|
1434 |
|
1435 |
-
function wfu_get_filedata($filepath, $
|
1436 |
$filerec = wfu_get_file_rec($filepath, false);
|
1437 |
if ( $filerec == null ) return null;
|
1438 |
-
|
1439 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1440 |
else {
|
1441 |
$filedata = wfu_decode_array_from_string($filerec->filedata);
|
1442 |
-
if ( !is_array($filedata) ) $filedata = array();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1443 |
}
|
1444 |
-
//add idlog in filedata if $include_id is true
|
1445 |
-
if ( $include_id )
|
1446 |
-
$filedata["general"] = array(
|
1447 |
-
"type" => "data",
|
1448 |
-
"idlog" => $filerec->idlog
|
1449 |
-
);
|
1450 |
|
1451 |
return $filedata;
|
1452 |
}
|
@@ -1489,6 +1492,20 @@ function wfu_reassign_hashes() {
|
|
1489 |
}
|
1490 |
}
|
1491 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1492 |
//update database to reflect the current status of files
|
1493 |
function wfu_sync_database() {
|
1494 |
$a = func_get_args(); switch(WFU_FUNCTION_HOOK(__FUNCTION__, $a, $out)) { case 'X': break; case 'R': return $out; break; case 'D': die($out); break; }
|
@@ -1513,14 +1530,7 @@ function wfu_sync_database() {
|
|
1513 |
}
|
1514 |
}
|
1515 |
if ( $obsolete ) {
|
1516 |
-
$
|
1517 |
-
//make previous record obsolete
|
1518 |
-
$wpdb->update($table_name1,
|
1519 |
-
array( 'date_to' => $now_date ),
|
1520 |
-
array( 'idlog' => $filerec->idlog ),
|
1521 |
-
array( '%s' ),
|
1522 |
-
array( '%d' )
|
1523 |
-
);
|
1524 |
$obsolete_count ++;
|
1525 |
}
|
1526 |
}
|
@@ -1554,14 +1564,7 @@ function wfu_get_recs_of_user($userid) {
|
|
1554 |
}
|
1555 |
}
|
1556 |
if ( $obsolete ) {
|
1557 |
-
$
|
1558 |
-
//make previous record obsolete
|
1559 |
-
$wpdb->update($table_name1,
|
1560 |
-
array( 'date_to' => $now_date ),
|
1561 |
-
array( 'idlog' => $filerec->idlog ),
|
1562 |
-
array( '%s' ),
|
1563 |
-
array( '%d' )
|
1564 |
-
);
|
1565 |
}
|
1566 |
else {
|
1567 |
$filerec->userdata = null;
|
@@ -1665,14 +1668,7 @@ function wfu_get_filtered_recs($filter) {
|
|
1665 |
}
|
1666 |
}
|
1667 |
if ( $obsolete ) {
|
1668 |
-
$
|
1669 |
-
//make previous record obsolete
|
1670 |
-
$wpdb->update($table_name1,
|
1671 |
-
array( 'date_to' => $now_date ),
|
1672 |
-
array( 'idlog' => $filerec->idlog ),
|
1673 |
-
array( '%s' ),
|
1674 |
-
array( '%d' )
|
1675 |
-
);
|
1676 |
}
|
1677 |
else {
|
1678 |
$filerec->userdata = null;
|
463 |
}
|
464 |
|
465 |
function wfu_init_run_js_script() {
|
466 |
+
$script = 'if (typeof wfu_js_decode_obj == "undefined") function wfu_js_decode_obj(obj_str) { var obj = null; if (obj_str == "window") obj = window; else { var match = obj_str.match(new RegExp(\'GlobalData(\\\\.(WFU|WFUB)\\\\[(.*?)\\\\](\\\\.(.*))?)?$\')); if (match) { obj = GlobalData; if (match[3]) obj = obj[match[2]][match[3]]; if (match[5]) obj = obj[match[5]]; } } return obj; }';
|
467 |
$script .= "\n".'if (typeof wfu_run_js == "undefined") function wfu_run_js(obj_str, func) { if (typeof GlobalData == "undefined") { if (typeof window.WFU_JS_BANK == "undefined") WFU_JS_BANK = []; WFU_JS_BANK.push({obj_str: obj_str, func: func}) } else { var obj = wfu_js_decode_obj(obj_str); if (obj) obj[func].call(obj); } }';
|
468 |
return wfu_js_to_HTML($script);
|
469 |
}
|
644 |
$retid = wfu_log_action('delete', $filepath, $userid, '', 0, 0, '', null);
|
645 |
$result = unlink($filepath);
|
646 |
if ( !$result ) wfu_revert_log_action($retid);
|
647 |
+
else {
|
648 |
+
//delete linked attachment if exists and it is allowed to be deleted
|
649 |
+
if ( $filedata != null && isset($filedata["media"]) && WFU_VAR("WFU_UPDATE_MEDIA_ON_DELETE") == "true" )
|
650 |
+
wp_delete_attachment( $filedata["media"]["attach_id"] );
|
651 |
}
|
652 |
|
653 |
return $result;
|
662 |
$pos1 = strpos($ftpdata_flat, ":");
|
663 |
$pos2 = strpos($ftpdata_flat, "@");
|
664 |
if ( $pos1 && $pos2 && $pos2 > $pos1 ) {
|
665 |
+
$ftp_username = str_replace(array('\:', '\@'), array(':', '@'), substr($params["ftpinfo"], 0, $pos1));
|
666 |
+
$ftp_password = str_replace(array('\:', '\@'), array(':', '@'), substr($params["ftpinfo"], $pos1 + 1, $pos2 - $pos1 - 1));
|
667 |
$ftp_host = substr($params["ftpinfo"], $pos2 + 1);
|
668 |
$ftp_port = preg_replace("/^[^:]*:?/", "", $ftp_host);
|
669 |
$ftp_host_clean = preg_replace("/:.*/", "", $ftp_host);
|
1044 |
// calculate file size
|
1045 |
$filesize = filesize($filepath);
|
1046 |
// first make obsolete records having the same file path because the old file has been replaced
|
1047 |
+
$oldrecs = $wpdb->get_results('SELECT * FROM '.$table_name1.' WHERE filepath = \''.$relativepath.'\' AND date_to = 0');
|
1048 |
+
if ( $oldrecs ) {
|
1049 |
+
foreach ( $oldrecs as $oldrec ) wfu_make_rec_obsolete($oldrec);
|
1050 |
+
}
|
|
|
|
|
1051 |
}
|
1052 |
// attempt to create new log record
|
1053 |
$now_date = date('Y-m-d H:i:s');
|
1336 |
|
1337 |
//find user by its id and return a non-empty username
|
1338 |
function wfu_get_username_by_id($id) {
|
1339 |
+
$a = func_get_args(); switch(WFU_FUNCTION_HOOK(__FUNCTION__, $a, $out)) { case 'X': break; case 'R': return $out; break; case 'D': die($out); break; }
|
1340 |
$user = get_user_by('id', $id);
|
1341 |
if ( $user == false && $id > 0 ) $username = 'unknown';
|
1342 |
elseif ( $user == false && $id == -999 ) $username = 'system';
|
1412 |
* @return mixed
|
1413 |
*/
|
1414 |
function wfu_get_latest_filedata_from_id($idlog, $is_new = false) {
|
|
|
|
|
|
|
1415 |
//get latest database record of file, if it is still valid
|
1416 |
$filerec = wfu_get_latest_rec_from_id($idlog);
|
1417 |
//return null if the record does not exist or it is obsolete
|
1418 |
if ( $filerec == null ) return null;
|
1419 |
+
|
1420 |
+
return wfu_get_filedata_from_rec($filerec, $is_new, true, false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1421 |
}
|
1422 |
|
1423 |
+
function wfu_get_filedata($filepath, $include_general_data = false) {
|
1424 |
$filerec = wfu_get_file_rec($filepath, false);
|
1425 |
if ( $filerec == null ) return null;
|
1426 |
+
|
1427 |
+
return wfu_get_filedata_from_rec($filerec, true, false, $include_general_data);
|
1428 |
+
}
|
1429 |
+
|
1430 |
+
function wfu_get_filedata_from_rec($filerec, $is_new = false, $update_transfer = false, $include_general_data = false) {
|
1431 |
+
//return filedata, if it does not exist and we do not want to create a new
|
1432 |
+
//filedata structure return null, otherwise return an empty array
|
1433 |
+
if ( !isset($filerec->filedata) || is_null($filerec->filedata) ) $filedata = ( $is_new ? array() : null );
|
1434 |
else {
|
1435 |
$filedata = wfu_decode_array_from_string($filerec->filedata);
|
1436 |
+
if ( !is_array($filedata) ) $filedata = ( $is_new ? array() : null );
|
1437 |
+
}
|
1438 |
+
if ( !is_null($filedata) ) {
|
1439 |
+
//update filepath property in filedata of "transfer" type, if service
|
1440 |
+
//records exist
|
1441 |
+
if ( $update_transfer ) {
|
1442 |
+
foreach ( $filedata as $key => $data )
|
1443 |
+
if ( !isset($data["type"]) || $data["type"] == "transfer" )
|
1444 |
+
$filedata[$key]["filepath"] = $filerec->filepath;
|
1445 |
+
}
|
1446 |
+
//add idlog in filedata if $include_general_data is true
|
1447 |
+
if ( $include_general_data )
|
1448 |
+
$filedata["general"] = array(
|
1449 |
+
"type" => "data",
|
1450 |
+
"idlog" => $filerec->idlog
|
1451 |
+
);
|
1452 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
1453 |
|
1454 |
return $filedata;
|
1455 |
}
|
1492 |
}
|
1493 |
}
|
1494 |
|
1495 |
+
function wfu_make_rec_obsolete($filerec) {
|
1496 |
+
$a = func_get_args(); switch(WFU_FUNCTION_HOOK(__FUNCTION__, $a, $out)) { case 'X': break; case 'R': return $out; break; case 'D': die($out); break; }
|
1497 |
+
global $wpdb;
|
1498 |
+
$table_name1 = $wpdb->prefix . "wfu_log";
|
1499 |
+
$filedata = wfu_get_filedata_from_rec($filerec, true);
|
1500 |
+
//update db record accordingly
|
1501 |
+
$wpdb->update($table_name1,
|
1502 |
+
array( 'date_to' => date('Y-m-d H:i:s'), 'filedata' => wfu_encode_array_to_string($filedata) ),
|
1503 |
+
array( 'idlog' => $filerec->idlog ),
|
1504 |
+
array( '%s', '%s' ),
|
1505 |
+
array( '%d' )
|
1506 |
+
);
|
1507 |
+
}
|
1508 |
+
|
1509 |
//update database to reflect the current status of files
|
1510 |
function wfu_sync_database() {
|
1511 |
$a = func_get_args(); switch(WFU_FUNCTION_HOOK(__FUNCTION__, $a, $out)) { case 'X': break; case 'R': return $out; break; case 'D': die($out); break; }
|
1530 |
}
|
1531 |
}
|
1532 |
if ( $obsolete ) {
|
1533 |
+
wfu_make_rec_obsolete($filerec);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1534 |
$obsolete_count ++;
|
1535 |
}
|
1536 |
}
|
1564 |
}
|
1565 |
}
|
1566 |
if ( $obsolete ) {
|
1567 |
+
wfu_make_rec_obsolete($filerec);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1568 |
}
|
1569 |
else {
|
1570 |
$filerec->userdata = null;
|
1668 |
}
|
1669 |
}
|
1670 |
if ( $obsolete ) {
|
1671 |
+
wfu_make_rec_obsolete($filerec);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1672 |
}
|
1673 |
else {
|
1674 |
$filerec->userdata = null;
|
lib/wfu_io.php
CHANGED
@@ -21,8 +21,8 @@ function wfu_is_dir($path, $ftpdata) {
|
|
21 |
$pos1 = strpos($ftpdata_flat, ":");
|
22 |
$pos2 = strpos($ftpdata_flat, "@");
|
23 |
if ( $pos1 && $pos2 && $pos2 > $pos1 ) {
|
24 |
-
$ftp_username = substr($ftpdata, 0, $pos1);
|
25 |
-
$ftp_password = substr($ftpdata, $pos1 + 1, $pos2 - $pos1 - 1);
|
26 |
$ftp_host = substr($ftpdata, $pos2 + 1);
|
27 |
$ftp_port = preg_replace("/^[^:]*:?/", "", $ftp_host);
|
28 |
$ftp_host_clean = preg_replace("/:.*/", "", $ftp_host);
|
@@ -62,8 +62,8 @@ function wfu_create_directory($path, $method, $ftpdata) {
|
|
62 |
$pos1 = strpos($ftpdata_flat, ":");
|
63 |
$pos2 = strpos($ftpdata_flat, "@");
|
64 |
if ( $pos1 && $pos2 && $pos2 > $pos1 ) {
|
65 |
-
$ftp_username = substr($ftpdata, 0, $pos1);
|
66 |
-
$ftp_password = substr($ftpdata, $pos1 + 1, $pos2 - $pos1 - 1);
|
67 |
$ftp_host = substr($ftpdata, $pos2 + 1);
|
68 |
$ftp_port = preg_replace("/^[^:]*:?/", "", $ftp_host);
|
69 |
$ftp_host_clean = preg_replace("/:.*/", "", $ftp_host);
|
@@ -112,7 +112,7 @@ function wfu_create_directory($path, $method, $ftpdata) {
|
|
112 |
|
113 |
function wfu_upload_file($source, $target, $method, $ftpdata, $passive, $fileperms) {
|
114 |
$a = func_get_args(); switch(WFU_FUNCTION_HOOK(__FUNCTION__, $a, $out)) { case 'X': break; case 'R': return $out; break; case 'D': die($out); break; }
|
115 |
-
$ret_array =
|
116 |
$ret_array["uploaded"] = false;
|
117 |
$ret_array["admin_message"] = "";
|
118 |
$ret_message = "";
|
@@ -131,8 +131,8 @@ function wfu_upload_file($source, $target, $method, $ftpdata, $passive, $fileper
|
|
131 |
$pos1 = strpos($ftpdata_flat, ":");
|
132 |
$pos2 = strpos($ftpdata_flat, "@");
|
133 |
if ( $pos1 && $pos2 && $pos2 > $pos1 ) {
|
134 |
-
$ftp_username = substr($ftpdata, 0, $pos1);
|
135 |
-
$ftp_password = substr($ftpdata, $pos1 + 1, $pos2 - $pos1 - 1);
|
136 |
$ftp_host = substr($ftpdata, $pos2 + 1);
|
137 |
$ftp_port = preg_replace("/^[^:]*:?/", "", $ftp_host);
|
138 |
$ftp_host_clean = preg_replace("/:.*/", "", $ftp_host);
|
21 |
$pos1 = strpos($ftpdata_flat, ":");
|
22 |
$pos2 = strpos($ftpdata_flat, "@");
|
23 |
if ( $pos1 && $pos2 && $pos2 > $pos1 ) {
|
24 |
+
$ftp_username = str_replace(array('\:', '\@'), array(':', '@'), substr($ftpdata, 0, $pos1));
|
25 |
+
$ftp_password = str_replace(array('\:', '\@'), array(':', '@'), substr($ftpdata, $pos1 + 1, $pos2 - $pos1 - 1));
|
26 |
$ftp_host = substr($ftpdata, $pos2 + 1);
|
27 |
$ftp_port = preg_replace("/^[^:]*:?/", "", $ftp_host);
|
28 |
$ftp_host_clean = preg_replace("/:.*/", "", $ftp_host);
|
62 |
$pos1 = strpos($ftpdata_flat, ":");
|
63 |
$pos2 = strpos($ftpdata_flat, "@");
|
64 |
if ( $pos1 && $pos2 && $pos2 > $pos1 ) {
|
65 |
+
$ftp_username = str_replace(array('\:', '\@'), array(':', '@'), substr($ftpdata, 0, $pos1));
|
66 |
+
$ftp_password = str_replace(array('\:', '\@'), array(':', '@'), substr($ftpdata, $pos1 + 1, $pos2 - $pos1 - 1));
|
67 |
$ftp_host = substr($ftpdata, $pos2 + 1);
|
68 |
$ftp_port = preg_replace("/^[^:]*:?/", "", $ftp_host);
|
69 |
$ftp_host_clean = preg_replace("/:.*/", "", $ftp_host);
|
112 |
|
113 |
function wfu_upload_file($source, $target, $method, $ftpdata, $passive, $fileperms) {
|
114 |
$a = func_get_args(); switch(WFU_FUNCTION_HOOK(__FUNCTION__, $a, $out)) { case 'X': break; case 'R': return $out; break; case 'D': die($out); break; }
|
115 |
+
$ret_array = array();
|
116 |
$ret_array["uploaded"] = false;
|
117 |
$ret_array["admin_message"] = "";
|
118 |
$ret_message = "";
|
131 |
$pos1 = strpos($ftpdata_flat, ":");
|
132 |
$pos2 = strpos($ftpdata_flat, "@");
|
133 |
if ( $pos1 && $pos2 && $pos2 > $pos1 ) {
|
134 |
+
$ftp_username = str_replace(array('\:', '\@'), array(':', '@'), substr($ftpdata, 0, $pos1));
|
135 |
+
$ftp_password = str_replace(array('\:', '\@'), array(':', '@'), substr($ftpdata, $pos1 + 1, $pos2 - $pos1 - 1));
|
136 |
$ftp_host = substr($ftpdata, $pos2 + 1);
|
137 |
$ftp_port = preg_replace("/^[^:]*:?/", "", $ftp_host);
|
138 |
$ftp_host_clean = preg_replace("/:.*/", "", $ftp_host);
|
lib/wfu_template.php
CHANGED
@@ -7,7 +7,7 @@ public static $name = "WFU_Original_Template";
|
|
7 |
|
8 |
public static function get_instance() {
|
9 |
if ( null == self::$instance ) {
|
10 |
-
self::$instance = new
|
11 |
self::$name = get_called_class();
|
12 |
}
|
13 |
|
7 |
|
8 |
public static function get_instance() {
|
9 |
if ( null == self::$instance ) {
|
10 |
+
self::$instance = new static();
|
11 |
self::$name = get_called_class();
|
12 |
}
|
13 |
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: nickboss
|
|
3 |
Donate link: http://www.iptanus.com/support/wordpress-file-upload
|
4 |
Tags: file, upload, ajax, form, page, post, sidebar, responsive, widget, webcam, ftp
|
5 |
Requires at least: 2.9.2
|
6 |
-
Tested up to: 4.9.
|
7 |
Stable tag: "trunk"
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
@@ -146,11 +146,17 @@ There is an option in plugin's settings in Dashboard to relax the CSS rules, so
|
|
146 |
|
147 |
== Changelog ==
|
148 |
|
|
|
|
|
|
|
|
|
|
|
|
|
149 |
= 4.2.0 =
|
150 |
* changed logic of file sanitizer; dots in filename are by default converted to dashes, in order to avoid upload failures caused when the plugin detects double extensions
|
151 |
* corrected bug where a Javascript error was generated when askforsubfolders was disabled and showtargetfolder was active
|
152 |
* added css and js minifier in inline code
|
153 |
-
*
|
154 |
* plugin modified so that Media record is deleted when the associated uploaded file is deleted from plugin's database
|
155 |
* corrected bug where some plugin images were not loaded while Relax CSS option was inactive
|
156 |
|
@@ -720,6 +726,9 @@ Initial version.
|
|
720 |
|
721 |
== Upgrade Notice ==
|
722 |
|
|
|
|
|
|
|
723 |
= 4.2.0 =
|
724 |
Significant update to introduce some new features and fix some bugs.
|
725 |
|
3 |
Donate link: http://www.iptanus.com/support/wordpress-file-upload
|
4 |
Tags: file, upload, ajax, form, page, post, sidebar, responsive, widget, webcam, ftp
|
5 |
Requires at least: 2.9.2
|
6 |
+
Tested up to: 4.9.4
|
7 |
Stable tag: "trunk"
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
146 |
|
147 |
== Changelog ==
|
148 |
|
149 |
+
= 4.3.0 =
|
150 |
+
* fixed bug where ftp credentials did not work when username or password contained (:) or (@) symbols
|
151 |
+
* RegExp fix for wfu_js_decode_obj function for improved compatibility with caching plugins
|
152 |
+
* corrected WFU_Original_Template::get_instance() method because it always returned the original class
|
153 |
+
* View Log page improved so that displayed additional user fields of an uploaded file are not cropped
|
154 |
+
|
155 |
= 4.2.0 =
|
156 |
* changed logic of file sanitizer; dots in filename are by default converted to dashes, in order to avoid upload failures caused when the plugin detects double extensions
|
157 |
* corrected bug where a Javascript error was generated when askforsubfolders was disabled and showtargetfolder was active
|
158 |
* added css and js minifier in inline code
|
159 |
+
* plugin modified so that the shortcodes render correctly either Javascript loads early (in header) or late (in footer)
|
160 |
* plugin modified so that Media record is deleted when the associated uploaded file is deleted from plugin's database
|
161 |
* corrected bug where some plugin images were not loaded while Relax CSS option was inactive
|
162 |
|
726 |
|
727 |
== Upgrade Notice ==
|
728 |
|
729 |
+
= 4.3.0 =
|
730 |
+
Significant update to introduce some new features and fix some bugs.
|
731 |
+
|
732 |
= 4.2.0 =
|
733 |
Significant update to introduce some new features and fix some bugs.
|
734 |
|
release_notes.txt
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
-
<!-- --><span>Version 4.
|
2 |
<!-- -->
|
1 |
+
<!-- --><span>Version 4.3.0 is a very significant update bringing some new features and improvements mostly for the Professional edition. As regards the Free edition, this version introduces some code improvements to make the plugin work better with caching modules, as well as some bug fixes related to FTP functionality and View Log page.<br/><br/>For more details about this version's changes please visit the Release Notes of the plugin's </span><a href="http://www.iptanus.com/wordpress-plugins/wordpress-file-upload/">support page</a><span>.</span><!-- -->
|
2 |
<!-- -->
|
templates/uploader-Custom1.php
CHANGED
@@ -11,7 +11,442 @@
|
|
11 |
* different.
|
12 |
*/
|
13 |
class WFU_UploaderTemplate_Custom1 extends WFU_Original_Template {
|
14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
}
|
16 |
|
17 |
?>
|
11 |
* different.
|
12 |
*/
|
13 |
class WFU_UploaderTemplate_Custom1 extends WFU_Original_Template {
|
14 |
+
|
15 |
+
private static $instance = null;
|
16 |
+
public static $name = "WFU_Original_Template";
|
17 |
+
|
18 |
+
public static function get_instance() {
|
19 |
+
if ( null == self::$instance ) {
|
20 |
+
self::$instance = new static();
|
21 |
+
self::$name = get_called_class();
|
22 |
+
}
|
23 |
+
|
24 |
+
return self::$instance;
|
25 |
+
}
|
26 |
+
|
27 |
+
function wfu_uploadform_template($data) {?>
|
28 |
+
<?php /*************************************************************************
|
29 |
+
the following lines contain initialization of PHP variables
|
30 |
+
*******************************************************************************/
|
31 |
+
/* do not change this line */extract($data);
|
32 |
+
/*
|
33 |
+
* The following variables are available for use:
|
34 |
+
*
|
35 |
+
* @var $ID int the upload ID
|
36 |
+
* @var $width string assigned width of select button element
|
37 |
+
* @var $height string assigned height of select button element
|
38 |
+
* @var $responsive bool true if responsive mode is enabled
|
39 |
+
* @var $testmode bool true if the plugin is in test mode
|
40 |
+
* @var $label string the title of the select button element
|
41 |
+
* @var $filename string the name that the selected file must have when
|
42 |
+
* submitted for upload by the form; it must be passed to the 'name'
|
43 |
+
* attribute of the form's input element of 'file' type
|
44 |
+
* $var hidden_elements array holds an array of hidden elements that must be
|
45 |
+
* added in the HTML form so that the plugin works correctly; every item
|
46 |
+
* of the array has three properties, the 'id', the 'name' and the 'value'
|
47 |
+
* of the hidden element
|
48 |
+
* @var $index int the index of occurrence of the element inside the plugin,
|
49 |
+
* in case that it appears more than once
|
50 |
+
* @var $params array all plugin's attributes defined through the shortcode
|
51 |
+
*
|
52 |
+
* It is noted that $ID can also be used inside CSS, Javascript and HTML code.
|
53 |
+
*/
|
54 |
+
$styles = "";
|
55 |
+
//for responsive plugin adjust container's widths if a % width has been defined
|
56 |
+
if ( $responsive && strlen($width) > 1 && substr($width, -1, 1) == "%" ) $styles = 'width: 100%;';
|
57 |
+
elseif ( $width != "" ) $styles = "width: $width; ";
|
58 |
+
if ( $height != "" ) $styles .= "height: $height; ";
|
59 |
+
$styles_form = $styles;
|
60 |
+
if ( $testmode ) $styles .= 'z-index: 500;';
|
61 |
+
/*******************************************************************************
|
62 |
+
the following lines contain CSS styling rules
|
63 |
+
*********************************************************************/ ?><style>
|
64 |
+
form.file_input_uploadform
|
65 |
+
{
|
66 |
+
position: relative;
|
67 |
+
width: 100px; /*relax*/
|
68 |
+
height: 27px; /*relax*/
|
69 |
+
overflow: hidden;
|
70 |
+
margin: 0px;
|
71 |
+
padding: 0px;
|
72 |
+
}
|
73 |
+
|
74 |
+
input[type="button"].file_input_button
|
75 |
+
{
|
76 |
+
width: 100px; /*relax*/
|
77 |
+
height: 27px; /*relax*/
|
78 |
+
position: absolute; /*relax*/
|
79 |
+
top: 0px; /*relax*/
|
80 |
+
margin: 0px; /*relax*/
|
81 |
+
padding: 0px; /*relax*/
|
82 |
+
background-color: #EEEEEE; /*relax*/
|
83 |
+
color: #555555; /*relax*/
|
84 |
+
background-image: url("<?php echo WPFILEUPLOAD_DIR; ?>images/white-grad-active.png"); /*relax*/
|
85 |
+
background-position: left top; /*relax*/
|
86 |
+
background-repeat: repeat-x; /*relax*/
|
87 |
+
border-style: solid; /*relax*/
|
88 |
+
border-width: 1px; /*relax*/
|
89 |
+
border-color: #BBBBBB; /*relax*/
|
90 |
+
-webkit-border-radius: 2px; /*relax*/
|
91 |
+
-moz-border-radius: 2px; /*relax*/
|
92 |
+
-khtml-border-radius: 2px; /*relax*/
|
93 |
+
border-radius: 2px; /*relax*/
|
94 |
+
}
|
95 |
+
|
96 |
+
input[type="button"].file_input_button_hover
|
97 |
+
{
|
98 |
+
width: 100px; /*relax*/
|
99 |
+
height: 27px; /*relax*/
|
100 |
+
position: absolute; /*relax*/
|
101 |
+
top: 0px; /*relax*/
|
102 |
+
margin: 0px; /*relax*/
|
103 |
+
padding: 0px; /*relax*/
|
104 |
+
background-color: #EEEEEE; /*relax*/
|
105 |
+
color: #111111; /*relax*/
|
106 |
+
background-image: url("<?php echo WPFILEUPLOAD_DIR; ?>images/white-grad-active.png"); /*relax*/
|
107 |
+
background-position: left top; /*relax*/
|
108 |
+
background-repeat: repeat-x; /*relax*/
|
109 |
+
border-style: solid; /*relax*/
|
110 |
+
border-width: 1px; /*relax*/
|
111 |
+
border-color: #333333; /*relax*/
|
112 |
+
-webkit-border-radius: 2px; /*relax*/
|
113 |
+
-moz-border-radius: 2px; /*relax*/
|
114 |
+
-khtml-border-radius: 2px; /*relax*/
|
115 |
+
border-radius: 2px; /*relax*/
|
116 |
+
}
|
117 |
+
|
118 |
+
input[type="button"].file_input_button:disabled, input[type="button"].file_input_button_hover:disabled
|
119 |
+
{
|
120 |
+
width: 100px; /*relax*/
|
121 |
+
height: 27px; /*relax*/
|
122 |
+
position: absolute; /*relax*/
|
123 |
+
top: 0px; /*relax*/
|
124 |
+
margin: 0px; /*relax*/
|
125 |
+
padding: 0px; /*relax*/
|
126 |
+
background-color: #EEEEEE; /*relax*/
|
127 |
+
color: silver; /*relax*/
|
128 |
+
background-image: url("<?php echo WPFILEUPLOAD_DIR; ?>images/white-grad-active.png"); /*relax*/
|
129 |
+
background-position: left top; /*relax*/
|
130 |
+
background-repeat: repeat-x; /*relax*/
|
131 |
+
border-style: solid; /*relax*/
|
132 |
+
border-width: 1px; /*relax*/
|
133 |
+
border-color: #BBBBBB; /*relax*/
|
134 |
+
-webkit-border-radius: 2px; /*relax*/
|
135 |
+
-moz-border-radius: 2px; /*relax*/
|
136 |
+
-khtml-border-radius: 2px; /*relax*/
|
137 |
+
border-radius: 2px; /*relax*/
|
138 |
+
}
|
139 |
+
|
140 |
+
input[type="file"].file_input_hidden
|
141 |
+
{
|
142 |
+
font-size: 45px;
|
143 |
+
position: absolute;
|
144 |
+
right: 0px;
|
145 |
+
top: 0px;
|
146 |
+
margin: 0px;
|
147 |
+
padding: 0px;
|
148 |
+
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
|
149 |
+
filter: alpha(opacity=0);
|
150 |
+
-moz-opacity: 0;
|
151 |
+
-khtml-opacity: 0;
|
152 |
+
opacity: 0;
|
153 |
+
}
|
154 |
+
</style><?php /*****************************************************************
|
155 |
+
the following lines contain Javascript code
|
156 |
+
*********************************************/ ?><script type="text/javascript">
|
157 |
+
/* do not change this line */GlobalData.WFU[$ID].uploadform.init = function() {
|
158 |
+
/***
|
159 |
+
* The following uploadform methods can be defined by the template, together
|
160 |
+
* with other initialization actions:
|
161 |
+
*
|
162 |
+
* @method attachActions attaches necessary actions of the plugin that must be
|
163 |
+
* run when the select button is clicked or when the user changes the
|
164 |
+
* selected file
|
165 |
+
* @method reset resets the upload form
|
166 |
+
* @method submit submits the upload form
|
167 |
+
* @method lock locks the upload form
|
168 |
+
* @method unlock unlocks the upload form
|
169 |
+
* @method changeFileName changes the name that the selected file must have
|
170 |
+
* @method files returns the list of files selected by the user
|
171 |
+
*/
|
172 |
+
/**
|
173 |
+
* attaches necessary actions of the plugin
|
174 |
+
*
|
175 |
+
* This function attaches necessary actions of the plugin that must be run when
|
176 |
+
* the select button of the form is clicked or when the user changes the
|
177 |
+
* selected file.
|
178 |
+
*
|
179 |
+
* @param clickaction object this is a function that must be called when the
|
180 |
+
* user clicks the select button in order to select a file; it takes no
|
181 |
+
* parameters
|
182 |
+
* @param changeaction object this is a function that must be called when the
|
183 |
+
* user selects a file; a boolean true or false must be passed as
|
184 |
+
* parameter, denoting if a file has been selected or not
|
185 |
+
*
|
186 |
+
* @return void
|
187 |
+
*/
|
188 |
+
this.attachActions = function(clickaction, changeaction) {
|
189 |
+
document.getElementById("upfile_$ID").onclick = function() { clickaction(); };
|
190 |
+
document.getElementById("upfile_$ID").onchange = function() { changeaction(document.getElementById("upfile_$ID").value != ""); };
|
191 |
+
}
|
192 |
+
|
193 |
+
/**
|
194 |
+
* resets the upload form
|
195 |
+
*
|
196 |
+
* This function runs right after an upload has finished, in order to clear the
|
197 |
+
* list of files. It has a meaning only when the upload is done using classic
|
198 |
+
* HTML Forms and not AJAX.
|
199 |
+
*
|
200 |
+
* @return void
|
201 |
+
*/
|
202 |
+
this.reset = function() {
|
203 |
+
document.getElementById("uploadform_$ID").reset();
|
204 |
+
}
|
205 |
+
|
206 |
+
/**
|
207 |
+
* submits the upload form
|
208 |
+
*
|
209 |
+
* This function runs when the upload starts, in order to submit the files
|
210 |
+
* using the classic HTML Forms and not AJAX.
|
211 |
+
*
|
212 |
+
* @return void
|
213 |
+
*/
|
214 |
+
this.submit = function() {
|
215 |
+
document.getElementById("upfile_$ID").disabled = false;
|
216 |
+
document.getElementById("uploadform_$ID").submit();
|
217 |
+
}
|
218 |
+
|
219 |
+
/**
|
220 |
+
* locks the upload form
|
221 |
+
*
|
222 |
+
* This function runs right before an upload starts, in order to disable the
|
223 |
+
* form and select button elements, so that the user cannot select files while
|
224 |
+
* an upload is on progress.
|
225 |
+
*
|
226 |
+
* @return void
|
227 |
+
*/
|
228 |
+
this.lock = function() {
|
229 |
+
document.getElementById("input_$ID").disabled = true;
|
230 |
+
document.getElementById("upfile_$ID").disabled = true;
|
231 |
+
}
|
232 |
+
|
233 |
+
/**
|
234 |
+
* unlocks the upload form
|
235 |
+
*
|
236 |
+
* This function runs right after finish of an upload, in order to re-enable
|
237 |
+
* the form and the select button.
|
238 |
+
*
|
239 |
+
* @return void
|
240 |
+
*/
|
241 |
+
this.unlock = function() {
|
242 |
+
document.getElementById("input_$ID").disabled = false;
|
243 |
+
document.getElementById("upfile_$ID").disabled = false;
|
244 |
+
}
|
245 |
+
|
246 |
+
/**
|
247 |
+
* changes the name that the selected file must have
|
248 |
+
*
|
249 |
+
* This function changes the name that the selected file must have when
|
250 |
+
* submitted for upload by the form. it must be passed to the 'name' attribute
|
251 |
+
* of the form's input element of 'file' type.
|
252 |
+
*
|
253 |
+
* @param new_filename string the new name of the file
|
254 |
+
*
|
255 |
+
* @return void
|
256 |
+
*/
|
257 |
+
this.changeFileName = function(new_filename) {
|
258 |
+
document.getElementById("upfile_$ID").name = new_filename;
|
259 |
+
}
|
260 |
+
|
261 |
+
/**
|
262 |
+
* returns the list of files selected by the user
|
263 |
+
*
|
264 |
+
* This function returns the list of files selected by the user, which are
|
265 |
+
* stored in the input element of type "file" of the form.
|
266 |
+
*
|
267 |
+
* @return object
|
268 |
+
*/
|
269 |
+
this.files = function() {
|
270 |
+
var inputfile = document.getElementById("upfile_$ID");
|
271 |
+
var farr = inputfile.files;
|
272 |
+
//fix in case files attribute is not supported
|
273 |
+
if (!farr) { if (inputfile.value) farr = [{name:inputfile.value}]; else farr = []; }
|
274 |
+
return farr;
|
275 |
+
}
|
276 |
+
/* do not change this line */}
|
277 |
+
</script><?php /****************************************************************
|
278 |
+
the following lines contain the HTML output
|
279 |
+
****************************************************************************/ ?>
|
280 |
+
<form class="file_input_uploadform" id="uploadform_$ID" name="uploadform_$ID" method="post" enctype="multipart/form-data" style="<?php echo $styles_form; ?>">
|
281 |
+
<?php if ( $testmode ): ?>
|
282 |
+
<input align="center" type="button" id="input_$ID" value="<?php echo $label; ?>" class="gamipress-link file_input_button" style="<?php echo $styles; ?>" onmouseout="javascript: document.getElementById('input_$ID').className = 'gamipress-link file_input_button';" onmouseover="javascript: document.getElementById('input_$ID').className = 'gamipress-link file_input_button_hover';" onclick="alert('<?php echo WFU_NOTIFY_TESTMODE; ?>');" />
|
283 |
+
<?php else: ?>
|
284 |
+
<input align="center" type="button" id="input_$ID" value="<?php echo $label; ?>" class="gamipress-link file_input_button" style="<?php echo $styles; ?>" />
|
285 |
+
<?php endif ?>
|
286 |
+
<input type="file" class="file_input_hidden" name="<?php echo $filename; ?>" id="upfile_$ID" tabindex="1" onmouseout="javascript: document.getElementById('input_$ID').className = 'gamipress-link file_input_button';" onmouseover="javascript: document.getElementById('input_$ID').className = 'gamipress-link file_input_button_hover';"<?php echo ""; ?> />
|
287 |
+
<?php foreach( $hidden_elements as $elem ): ?>
|
288 |
+
<input type="hidden" id="<?php echo $elem["id"]; ?>" name="<?php echo $elem["name"]; ?>" value="<?php echo $elem["value"]; ?>" />
|
289 |
+
<?php endforeach ?>
|
290 |
+
</form>
|
291 |
+
<?php /*************************************************************************
|
292 |
+
end of HTML output
|
293 |
+
*****************************************************************************/ }
|
294 |
+
|
295 |
+
function wfu_submit_template($data) {?>
|
296 |
+
<?php /*************************************************************************
|
297 |
+
the following lines contain initialization of PHP variables
|
298 |
+
*******************************************************************************/
|
299 |
+
/* do not change this line */extract($data);
|
300 |
+
/*
|
301 |
+
* The following variables are available for use:
|
302 |
+
*
|
303 |
+
* @var $ID int the upload ID
|
304 |
+
* @var $width string assigned width of upload button element
|
305 |
+
* @var $height string assigned height of upload button element
|
306 |
+
* @var $responsive bool true if responsive mode is enabled
|
307 |
+
* @var $testmode bool true if the plugin is in test mode
|
308 |
+
* @var $allownofile bool true if it is allowed to submit the upload form
|
309 |
+
* without any file selected
|
310 |
+
* @var $label string the title of the upload button element
|
311 |
+
* @var $index int the index of occurrence of the element inside the plugin,
|
312 |
+
* in case that it appears more than once
|
313 |
+
* @var $params array all plugin's attributes defined through the shortcode
|
314 |
+
*
|
315 |
+
* It is noted that $ID can also be used inside CSS, Javascript and HTML code.
|
316 |
+
*/
|
317 |
+
$styles = "";
|
318 |
+
//for responsive plugin adjust container's widths if a % width has been defined
|
319 |
+
if ( $responsive && strlen($width) > 1 && substr($width, -1, 1) == "%" ) $styles = 'width: 100%;';
|
320 |
+
elseif ( $width != "" ) $styles = "width: $width; ";
|
321 |
+
if ( $height != "" ) $styles .= "height: $height; ";
|
322 |
+
/*******************************************************************************
|
323 |
+
the following lines contain CSS styling rules
|
324 |
+
*********************************************************************/ ?><style>
|
325 |
+
input[type="button"].file_input_submit
|
326 |
+
{
|
327 |
+
width: 100px; /*relax*/
|
328 |
+
height: 27px; /*relax*/
|
329 |
+
position: relative; /*relax*/
|
330 |
+
margin: 0px; /*relax*/
|
331 |
+
padding: 0px; /*relax*/
|
332 |
+
background-color: #EEEEEE; /*relax*/
|
333 |
+
color: #555555; /*relax*/
|
334 |
+
background-image: url("<?php echo WPFILEUPLOAD_DIR; ?>images/white-grad-active.png"); /*relax*/
|
335 |
+
background-position: left top; /*relax*/
|
336 |
+
background-repeat: repeat-x; /*relax*/
|
337 |
+
border-style: solid; /*relax*/
|
338 |
+
border-width: 1px; /*relax*/
|
339 |
+
border-color: #BBBBBB; /*relax*/
|
340 |
+
-webkit-border-radius: 2px; /*relax*/
|
341 |
+
-moz-border-radius: 2px; /*relax*/
|
342 |
+
-khtml-border-radius: 2px; /*relax*/
|
343 |
+
border-radius: 2px; /*relax*/
|
344 |
+
}
|
345 |
+
|
346 |
+
input[type="button"].file_input_submit:hover, input[type="button"].file_input_submit:focus
|
347 |
+
{
|
348 |
+
width: 100px; /*relax*/
|
349 |
+
height: 27px; /*relax*/
|
350 |
+
position: relative; /*relax*/
|
351 |
+
margin: 0px; /*relax*/
|
352 |
+
padding: 0px; /*relax*/
|
353 |
+
background-color: #EEEEEE; /*relax*/
|
354 |
+
color: #111111; /*relax*/
|
355 |
+
background-image: url("<?php echo WPFILEUPLOAD_DIR; ?>images/white-grad-active.png"); /*relax*/
|
356 |
+
background-position: left top; /*relax*/
|
357 |
+
background-repeat: repeat-x; /*relax*/
|
358 |
+
border-style: solid; /*relax*/
|
359 |
+
border-width: 1px; /*relax*/
|
360 |
+
border-color: #333333; /*relax*/
|
361 |
+
-webkit-border-radius: 2px; /*relax*/
|
362 |
+
-moz-border-radius: 2px; /*relax*/
|
363 |
+
-khtml-border-radius: 2px; /*relax*/
|
364 |
+
border-radius: 2px; /*relax*/
|
365 |
+
}
|
366 |
+
|
367 |
+
input[type="button"].file_input_submit:disabled
|
368 |
+
{
|
369 |
+
width: 100px; /*relax*/
|
370 |
+
height: 27px; /*relax*/
|
371 |
+
position: relative; /*relax*/
|
372 |
+
margin: 0px; /*relax*/
|
373 |
+
padding: 0px; /*relax*/
|
374 |
+
background-color: #EEEEEE; /*relax*/
|
375 |
+
color: silver; /*relax*/
|
376 |
+
background-image: url("<?php echo WPFILEUPLOAD_DIR; ?>images/white-grad-active.png"); /*relax*/
|
377 |
+
background-position: left top; /*relax*/
|
378 |
+
background-repeat: repeat-x; /*relax*/
|
379 |
+
border-style: solid; /*relax*/
|
380 |
+
border-width: 1px; /*relax*/
|
381 |
+
border-color: #BBBBBB; /*relax*/
|
382 |
+
-webkit-border-radius: 2px; /*relax*/
|
383 |
+
-moz-border-radius: 2px; /*relax*/
|
384 |
+
-khtml-border-radius: 2px; /*relax*/
|
385 |
+
border-radius: 2px; /*relax*/
|
386 |
+
}
|
387 |
+
</style><?php /*****************************************************************
|
388 |
+
the following lines contain Javascript code
|
389 |
+
*********************************************/ ?><script type="text/javascript">
|
390 |
+
/* do not change this line */GlobalData.WFU[$ID].submit.init = function() {
|
391 |
+
/***
|
392 |
+
* The following upload button methods can be defined by the template, together
|
393 |
+
* with other initialization actions:
|
394 |
+
*
|
395 |
+
* @method attachClickAction attaches necessary action of the plugin that must
|
396 |
+
* be run when the upload button is clicked
|
397 |
+
* @method updateLabel updates the label of the upload button
|
398 |
+
* @method toggle enables or disables the upload button
|
399 |
+
*/
|
400 |
+
/**
|
401 |
+
* attaches necessary click action of the plugin
|
402 |
+
*
|
403 |
+
* This function attaches necessary action of the plugin that must be ran when
|
404 |
+
* the upload button is clicked.
|
405 |
+
*
|
406 |
+
* @param clickaction object this is a function that must be called when the
|
407 |
+
* user clicks the upload button in order to upload the selected file
|
408 |
+
*
|
409 |
+
* @return void
|
410 |
+
*/
|
411 |
+
this.attachClickAction = function(clickaction) {
|
412 |
+
document.getElementById("upload_$ID").onclick = function() { clickaction(); };
|
413 |
+
}
|
414 |
+
|
415 |
+
/**
|
416 |
+
* updates the label of the upload button
|
417 |
+
*
|
418 |
+
* @param new_label string the new label of the upload button
|
419 |
+
*
|
420 |
+
* @return void
|
421 |
+
*/
|
422 |
+
this.updateLabel = function(new_label) {
|
423 |
+
document.getElementById("upload_$ID").value = new_label;
|
424 |
+
}
|
425 |
+
|
426 |
+
/**
|
427 |
+
* enables or disables the upload button
|
428 |
+
*
|
429 |
+
* @param status bool if true the the upload button must be enabled, if false
|
430 |
+
* then the upload button must be disabled
|
431 |
+
*
|
432 |
+
* @return void
|
433 |
+
*/
|
434 |
+
this.toggle = function(status) {
|
435 |
+
document.getElementById("upload_$ID").disabled = !status;
|
436 |
+
}
|
437 |
+
/* do not change this line */}
|
438 |
+
</script><?php /****************************************************************
|
439 |
+
the following lines contain the HTML output
|
440 |
+
****************************************************************************/ ?>
|
441 |
+
<?php if ( $testmode ): ?>
|
442 |
+
<input align="center" type="button" id="upload_$ID" name="upload_$ID" value="<?php echo $label; ?>" class="gamipress-link file_input_submit" style="<?php echo $styles; ?>" />
|
443 |
+
<?php else: ?>
|
444 |
+
<input align="center" type="button" id="upload_$ID" name="upload_$ID" value="<?php echo $label; ?>" class="gamipress-link file_input_submit" style="<?php echo $styles; ?>"<?php echo ( $allownofile ? '' : ' disabled="disabled"' ); ?> />
|
445 |
+
<?php endif ?>
|
446 |
+
<?php /*************************************************************************
|
447 |
+
end of HTML output
|
448 |
+
*****************************************************************************/ }
|
449 |
+
|
450 |
}
|
451 |
|
452 |
?>
|
vendor/minifier/minify/LICENSE
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Copyright (c) 2012 Matthias Mullie
|
2 |
+
|
3 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
4 |
+
this software and associated documentation files (the "Software"), to deal in
|
5 |
+
the Software without restriction, including without limitation the rights to
|
6 |
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
7 |
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
8 |
+
subject to the following conditions:
|
9 |
+
|
10 |
+
The above copyright notice and this permission notice shall be included in all
|
11 |
+
copies or substantial portions of the Software.
|
12 |
+
|
13 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
15 |
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
16 |
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
17 |
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
18 |
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
vendor/minifier/path-converter/LICENSE
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Copyright (c) 2015 Matthias Mullie
|
2 |
+
|
3 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
4 |
+
this software and associated documentation files (the "Software"), to deal in
|
5 |
+
the Software without restriction, including without limitation the rights to
|
6 |
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
7 |
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
8 |
+
subject to the following conditions:
|
9 |
+
|
10 |
+
The above copyright notice and this permission notice shall be included in all
|
11 |
+
copies or substantial portions of the Software.
|
12 |
+
|
13 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
15 |
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
16 |
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
17 |
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
18 |
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
wordpress_file_upload.php
CHANGED
@@ -4,14 +4,14 @@ if( !session_id() ) { session_start(); }
|
|
4 |
/*
|
5 |
Plugin URI: http://www.iptanus.com/support/wordpress-file-upload
|
6 |
Description: Simple interface to upload files from a page.
|
7 |
-
Version: 4.
|
8 |
Author: Nickolas Bossinas
|
9 |
Author URI: http://www.iptanus.com
|
10 |
*/
|
11 |
|
12 |
/*
|
13 |
Wordpress File Upload (Wordpress Plugin)
|
14 |
-
Copyright (C) 2010-
|
15 |
Contact me at http://www.iptanus.com
|
16 |
|
17 |
This program is free software: you can redistribute it and/or modify
|
@@ -118,11 +118,16 @@ function wfu_enqueue_frontpage_scripts() {
|
|
118 |
if ( ( !isset($ret_data["correct_NextGenGallery_incompatibility"]) || $ret_data["correct_NextGenGallery_incompatibility"] != "true" ) &&
|
119 |
( !isset($ret_data["correct_JQueryUI_incompatibility"]) || $ret_data["correct_JQueryUI_incompatibility"] != "true" ) )
|
120 |
wp_enqueue_style('jquery-ui-css', '//code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.min.css');
|
121 |
-
|
|
|
|
|
122 |
wp_enqueue_script('json2');
|
123 |
wp_enqueue_script('wordpress_file_upload_script', WPFILEUPLOAD_DIR.'js/wordpress_file_upload_functions.js');
|
124 |
-
|
125 |
-
|
|
|
|
|
|
|
126 |
}
|
127 |
|
128 |
function wfu_include_lib() {
|
@@ -407,7 +412,7 @@ function wordpress_file_upload_function($incomingfromhandler) {
|
|
407 |
if ( !isset($_SESSION['wfu_check_refresh_'.$sid]) || $_SESSION['wfu_check_refresh_'.$sid] != "form button pressed" ) {
|
408 |
$_SESSION['wfu_check_refresh_'.$sid] = 'do not process';
|
409 |
$wordpress_file_upload_output .= wfu_post_plugin_actions($params);
|
410 |
-
$wordpress_file_upload_output = apply_filters("_wfu_file_upload_output", $wordpress_file_upload_output);
|
411 |
return $wordpress_file_upload_output."\n";
|
412 |
}
|
413 |
$_SESSION['wfu_check_refresh_'.$sid] = 'do not process';
|
@@ -423,7 +428,7 @@ function wordpress_file_upload_function($incomingfromhandler) {
|
|
423 |
|
424 |
if ( $params['forceclassic'] != "true" ) {
|
425 |
$wordpress_file_upload_output .= wfu_post_plugin_actions($params);
|
426 |
-
$wordpress_file_upload_output = apply_filters("_wfu_file_upload_output", $wordpress_file_upload_output);
|
427 |
return $wordpress_file_upload_output."\n";
|
428 |
}
|
429 |
|
@@ -479,7 +484,7 @@ function wordpress_file_upload_function($incomingfromhandler) {
|
|
479 |
}
|
480 |
|
481 |
$wordpress_file_upload_output .= wfu_post_plugin_actions($params);
|
482 |
-
$wordpress_file_upload_output = apply_filters("_wfu_file_upload_output", $wordpress_file_upload_output);
|
483 |
return $wordpress_file_upload_output."\n";
|
484 |
}
|
485 |
|
4 |
/*
|
5 |
Plugin URI: http://www.iptanus.com/support/wordpress-file-upload
|
6 |
Description: Simple interface to upload files from a page.
|
7 |
+
Version: 4.3.0
|
8 |
Author: Nickolas Bossinas
|
9 |
Author URI: http://www.iptanus.com
|
10 |
*/
|
11 |
|
12 |
/*
|
13 |
Wordpress File Upload (Wordpress Plugin)
|
14 |
+
Copyright (C) 2010-2018 Nickolas Bossinas
|
15 |
Contact me at http://www.iptanus.com
|
16 |
|
17 |
This program is free software: you can redistribute it and/or modify
|
118 |
if ( ( !isset($ret_data["correct_NextGenGallery_incompatibility"]) || $ret_data["correct_NextGenGallery_incompatibility"] != "true" ) &&
|
119 |
( !isset($ret_data["correct_JQueryUI_incompatibility"]) || $ret_data["correct_JQueryUI_incompatibility"] != "true" ) )
|
120 |
wp_enqueue_style('jquery-ui-css', '//code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.min.css');
|
121 |
+
//do not load timepicker css if $ret_data exclude_timepicker flag is true
|
122 |
+
if ( !isset($ret_data["exclude_timepicker"]) || $ret_data["exclude_timepicker"] != "true" )
|
123 |
+
wp_enqueue_style('jquery-ui-timepicker-addon-css', '//cdnjs.cloudflare.com/ajax/libs/jquery-ui-timepicker-addon/1.6.3/jquery-ui-timepicker-addon.min.css');
|
124 |
wp_enqueue_script('json2');
|
125 |
wp_enqueue_script('wordpress_file_upload_script', WPFILEUPLOAD_DIR.'js/wordpress_file_upload_functions.js');
|
126 |
+
//do not load timepicker js if $ret_data exclude_timepicker flag is true
|
127 |
+
if ( !isset($ret_data["exclude_timepicker"]) || $ret_data["exclude_timepicker"] != "true" ) {
|
128 |
+
wp_enqueue_script('jquery-ui-slider');
|
129 |
+
wp_enqueue_script('jquery-ui-timepicker-addon-js', '//cdnjs.cloudflare.com/ajax/libs/jquery-ui-timepicker-addon/1.6.3/jquery-ui-timepicker-addon.min.js', array("jquery-ui-datepicker"));
|
130 |
+
}
|
131 |
}
|
132 |
|
133 |
function wfu_include_lib() {
|
412 |
if ( !isset($_SESSION['wfu_check_refresh_'.$sid]) || $_SESSION['wfu_check_refresh_'.$sid] != "form button pressed" ) {
|
413 |
$_SESSION['wfu_check_refresh_'.$sid] = 'do not process';
|
414 |
$wordpress_file_upload_output .= wfu_post_plugin_actions($params);
|
415 |
+
$wordpress_file_upload_output = apply_filters("_wfu_file_upload_output", $wordpress_file_upload_output, $params);
|
416 |
return $wordpress_file_upload_output."\n";
|
417 |
}
|
418 |
$_SESSION['wfu_check_refresh_'.$sid] = 'do not process';
|
428 |
|
429 |
if ( $params['forceclassic'] != "true" ) {
|
430 |
$wordpress_file_upload_output .= wfu_post_plugin_actions($params);
|
431 |
+
$wordpress_file_upload_output = apply_filters("_wfu_file_upload_output", $wordpress_file_upload_output, $params);
|
432 |
return $wordpress_file_upload_output."\n";
|
433 |
}
|
434 |
|
484 |
}
|
485 |
|
486 |
$wordpress_file_upload_output .= wfu_post_plugin_actions($params);
|
487 |
+
$wordpress_file_upload_output = apply_filters("_wfu_file_upload_output", $wordpress_file_upload_output, $params);
|
488 |
return $wordpress_file_upload_output."\n";
|
489 |
}
|
490 |
|