| Server IP : 165.22.154.248 / Your IP : 216.73.217.0 [ Web Server : Apache/2.4.29 (Ubuntu) System : Linux droplet-integra 4.15.0-197-generic #208-Ubuntu SMP Tue Nov 1 17:23:37 UTC 2022 x86_64 User : www-data ( 33) PHP Version : 7.2.24-0ubuntu0.18.04.15 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals, Domains : 1 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/avanza-lms.old.bak9874115/lib/form/ |
Upload File : |
M.form_filepicker = {};
M.form_filepicker.Y = null;
M.form_filepicker.instances = [];
M.form_filepicker.callback = function(params) {
var html = '<a href="'+params['url']+'">'+params['file']+'</a>';
html += '<div class="dndupload-progressbars"></div>';
M.form_filepicker.Y.one('#file_info_'+params['client_id'] + ' .filepicker-filename').setContent(html);
//When file is added then set status of global variable to true
var elementid = M.core_filepicker.instances[params['client_id']].options.elementid;
M.form_filepicker.instances[elementid].fileadded = true;
//generate event to indicate changes which will be used by disable if or validation code
M.form_filepicker.Y.one('#'+elementid).simulate('change');
};
/**
* This fucntion is called for each file picker on page.
*/
M.form_filepicker.init = function(Y, options) {
//Keep reference of YUI, so that it can be used in callback.
M.form_filepicker.Y = Y;
//For client side validation, initialize file status for this filepicker
M.form_filepicker.instances[options.elementid] = {};
M.form_filepicker.instances[options.elementid].fileadded = false;
//Set filepicker callback
options.formcallback = M.form_filepicker.callback;
if (!M.core_filepicker.instances[options.client_id]) {
M.core_filepicker.init(Y, options);
}
Y.on('click', function(e, client_id) {
e.preventDefault();
if (this.ancestor('.fitem.disabled') == null) {
M.core_filepicker.instances[client_id].show();
}
}, '#filepicker-button-'+options.client_id, null, options.client_id);
var item = document.getElementById('nonjs-filepicker-'+options.client_id);
if (item) {
item.parentNode.removeChild(item);
}
item = document.getElementById('filepicker-wrapper-'+options.client_id);
if (item) {
item.style.display = '';
}
var dndoptions = {
clientid: options.client_id,
acceptedtypes: options.accepted_types,
author: options.author,
maxfiles: -1,
maxbytes: options.maxbytes,
itemid: options.itemid,
repositories: options.repositories,
formcallback: options.formcallback,
containerprefix: '#file_info_',
containerid: 'file_info_'+options.client_id,
contextid: options.context.id
};
M.form_dndupload.init(Y, dndoptions);
};