<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>文件上传器</title>
</head>
<link href="<?=BASEURL?>modules/file/views/upload/images/upload.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="<?=BASEURL?>modules/file/views/upload/images/mootools-trunk.js"></script>
<script type="text/javascript" src="<?=BASEURL?>modules/file/views/upload/images/Swiff.Uploader.js"></script>
<script type="text/javascript" src="<?=BASEURL?>modules/file/views/upload/images/Fx.ProgressBar.js"></script>
<script type="text/javascript" src="<?=BASEURL?>modules/file/views/upload/images/FancyUpload2.js"></script>
<script type="text/javascript">
window.addEvent('load', function() {

	var swiffy = new FancyUpload2($('upload-status'), 'upload-list', {
	'limitSize':<?=$filesize?>,
	'limitFiles':<?=$limitfiles?>,
	'fieldName': 'uploadfile',
	'path': '<?=BASEURL?>modules/file/views/upload/images/Swiff.Uploader.swf',
	'onLoad': function() {
		$('upload-status').removeClass('hide');
		$('upload-fallback').destroy();
	},
	'allComplete':function(){ alert('全部上传完成')	},	//所有上传完成
	'debug': true, // enable logs, uses console.log
	'target': 'browse-file'
	});
	/**
	* Various interactions
	*/
	$('browse-file').addEvent('click', function() {
		swiffy.options.typeFilter={<?=$uploadtype?>};
		swiffy.browse({<?=$uploadtype?>});
		return false;
	});

	$('upload-clear').addEvent('click', function() {
		swiffy.removeFile();
		return false;
	});

	$('upload-upload').addEvent('click', function() {
		var action	=	$('form-upload').action;
		var posturl	=	action+$('form-upload').toQueryString();
		swiffy.upload({url:posturl});
		return false;
	});

});
function selectuse(response){
	parent.uploadAttachment(response);	
}
</script>
<body bgcolor="#FFFFFF">
<div id="upload">
  <form action="<?=BASEURI?>file_upload/upload/" method="post" enctype="multipart/form-data" name="form-upload" id="form-upload">
    <div id="upload-status" class="hide">
      <div style="text-align:left;color:#666666;"> <span class="overall-title"> 总进上传进度 (0 B) </span><br />
        <img src="<?=BASEURL?>modules/file/views/upload/images/bar.gif" class="progress overall-progress" /> </div>
      <div style="text-align:left;color:#666666;"> <span class="current-title"> 当前文件上传进度 </span><br />
        <img src="<?=BASEURL?>modules/file/views/upload/images/bar.gif" class="progress current-progress" /> </div>
      <div class="current-text"></div>
      <ul id="upload-list">
      </ul>
      <p> 是否生成缩略图
        <input type="checkbox" name="is_thumb" value="1" checked>
        宽度
        <input type="text" name="width" value="<?=$channel->channel_thumbs_width?>" size="3"/>
        高度
        <input type="text" name="height" value="<?=$channel->channel_thumbs_height?>" size="3" />
        <input type="hidden" name="currentPath" value="<?=@$currentPath?>">
      </p>
      <p>
        <input type="button" value="浏览" id="browse-file" class="button">
        <input type="button" value="清空记录" id="upload-clear" class="button">
        <input type="button" value="上传" id="upload-upload" class="button">
      </p>
    </div>
    <div id='upload-fallback'>
      <div>加载批量上传组件“FancyUpload”失败，请安装Adobe Flash Player 9以上的版本</div>
      <div>请选择需要上传的文件</div>
      <div>
        <input type="file" name="uploadfile" id="upload-photoupload" />
      </div>
      <div>
        <input type="submit" name="sbupload" value="上传" />
      </div>
    </div>
  </form>
</div>
</body>
</html>
