_decodeProperties($_smarty_tpl, array ( 'version' => '3.1.39', 'unifunc' => 'content_6494329f129837_15322620', 'has_nocache_code' => false, 'file_dependency' => array ( '3fcd17fd2eb62a57baf614aa6f77e79870f6a141' => array ( 0 => 'C:\\xampp\\htdocs\\hotelcommerce\\admin\\themes\\default\\template\\helpers\\uploader\\ajax.tpl', 1 => 1687433793, 2 => 'file', ), ), 'includes' => array ( ), ),false)) { function content_6494329f129837_15322620 (Smarty_Internal_Template $_smarty_tpl) { ?> tpl_vars['max_files']->value)) && count($_smarty_tpl->tpl_vars['files']->value) >= $_smarty_tpl->tpl_vars['max_files']->value) {?>
smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['l'][0], array( array('s'=>'You have reached the limit (%s) of files to upload, please remove files to continue uploading','sprintf'=>$_smarty_tpl->tpl_vars['max_files']->value),$_smarty_tpl ) );?>
type="text/javascript"> $( document ).ready(function() { tpl_vars['files']->value)) && $_smarty_tpl->tpl_vars['files']->value) {?> $('#tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?> -images-thumbnails').parent().show(); }); >
tpl_vars['url']->value))) {?> data-url="tpl_vars['url']->value, ENT_QUOTES, 'UTF-8', true);?> "tpl_vars['multiple']->value)) && $_smarty_tpl->tpl_vars['multiple']->value) {?> multiple="multiple" style="width:0px;height:0px;" />
type="text/javascript"> function humanizeSize(bytes) { if (typeof bytes !== 'number') { return ''; } if (bytes >= 1000000000) { return (bytes / 1000000000).toFixed(2) + ' GB'; } if (bytes >= 1000000) { return (bytes / 1000000).toFixed(2) + ' MB'; } return (bytes / 1000).toFixed(2) + ' KB'; } $( document ).ready(function() { tpl_vars['multiple']->value)) && (isset($_smarty_tpl->tpl_vars['max_files']->value))) {?> var tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?> _max_files = tpl_vars['max_files']->value-count($_smarty_tpl->tpl_vars['files']->value);?> ; tpl_vars['files']->value)) && $_smarty_tpl->tpl_vars['files']->value) {?> $('#tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?> -images-thumbnails').parent().show(); var tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?> _upload_button = Ladda.create( document.querySelector('#tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?> -upload-button' )); var tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?> _total_files = 0; $('#tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?> ').fileupload({ dataType: 'json', async: false, autoUpload: false, singleFileUploads: true, tpl_vars['post_max_size']->value))) {?>maxFileSize: tpl_vars['post_max_size']->value;?> , tpl_vars['drop_zone']->value))) {?>dropZone: tpl_vars['drop_zone']->value;?> , start: function (e) { tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?> _upload_button.start(); $('#tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?> -upload-button').unbind('click'); //Important as we bind it for every elements in add function }, fail: function (e, data) { $('#tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?> -errors').html(data.errorThrown.message).parent().show(); }, done: function (e, data) { if (data.result) { if (typeof data.result.tpl_vars['name']->value, ENT_QUOTES, 'UTF-8', true);?> !== 'undefined') { for (var i=0; itpl_vars['name']->value, ENT_QUOTES, 'UTF-8', true);?> .length; i++) { if (data.result.tpl_vars['name']->value, ENT_QUOTES, 'UTF-8', true);?> [i] !== null) { if (typeof data.result.tpl_vars['name']->value, ENT_QUOTES, 'UTF-8', true);?> [i].error !== 'undefined' && data.result.tpl_vars['name']->value, ENT_QUOTES, 'UTF-8', true);?> [i].error != '') { $('#tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?> -errors').html(''+data.result.tpl_vars['name']->value, ENT_QUOTES, 'UTF-8', true);?> [i].name+' : '+data.result.tpl_vars['name']->value, ENT_QUOTES, 'UTF-8', true);?> [i].error).parent().show(); } else { $(data.context).appendTo($('#tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?> -success')); $('#tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?> -success').parent().show(); if (typeof data.result.tpl_vars['name']->value, ENT_QUOTES, 'UTF-8', true);?> [i].image !== 'undefined') { var template = '
'; template += data.result.tpl_vars['name']->value, ENT_QUOTES, 'UTF-8', true);?> [i].image; if (typeof data.result.tpl_vars['name']->value, ENT_QUOTES, 'UTF-8', true);?> [i].delete_url !== 'undefined') template += '

smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['l'][0], array( array('s'=>'Delete'),$_smarty_tpl ) );?>

'; template += '
'; $('#tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?> -images-thumbnails').html($('#tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?> -images-thumbnails').html()+template); $('#tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?> -images-thumbnails').parent().show(); } } } } } $(data.context).find('button').remove(); } }, }).on('fileuploadalways', function (e, data) { if (typeof tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?> _max_files !== 'undefined') { tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?> _max_files--; } tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?> _total_files--; if (tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?> _total_files == 0) { tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?> _upload_button.stop(); $('#tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?> -upload-button').unbind('click'); $('#tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?> -files-list').parent().hide(); } }).on('fileuploadadd', function(e, data) { if (typeof tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?> _max_files !== 'undefined') { if (tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?> _total_files >= tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?> _max_files) { e.preventDefault(); alert('smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['l'][0], array( array('s'=>sprintf('You cannot have more than %s images in total. Please remove some of the current images before adding new ones.',$_smarty_tpl->tpl_vars['max_files']->value)),$_smarty_tpl ) );?> '); return; } } data.context = $('
').addClass('form-group').appendTo($('#tpl_vars['id']->value, ENT_QUOTES, 'UTF-8', true);?> -files-list')); var file_name = $('').append(''+data.files[0].name+' ('+humanizeSize(data.files[0].size)+')').appendTo(data.context); var button = $('