<?php

/**
 *
 * @copyright  2012-2015 izend.org
 * @version    11
 * @link       http://www.izend.org
 */
?>
<form enctype="multipart/form-data" action="" method="post" class="compact">
<input type="hidden" name="upload_token" value="<?php echo $token; ?>" />
<?php if (!empty($maxfilesize)): ?>
<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $maxfilesize; ?>" />
<?php endif; ?>
<p>
<input type="file" name="upload_file" id="upload_file" title="" />
<input type="submit" class="submit submit_put" id="upload_put" name="upload_put" value="Upload" title="" />
<?php extract($errors); ?>
<?php if ($missing_file or $bad_file or $bad_name or $bad_size or $bad_copy or $copy_error): ?>
<span class="icon icon_ko">-</span>
<?php else: ?>
<?php extract($infos); ?>
<?php if ($file_copied): ?>
<span class="icon icon_ok">+</span>
<?php endif; ?>
<?php endif; ?>
</p>
</form>
<script type="text/javascript">
//<![CDATA[
$(document).ready(function() {
    var file=$('#upload_file');
    var upload=$('#upload_put');

    file.css({ position: 'absolute', left: '-9999px' });

    upload.on('click', function(e) { e.preventDefault(); file.click(); });

    file.change(function() {
        if (file.val()) {
            upload.off('click').click();
        }
    });
});
//]]>
</script>
