<%
	String[] uploadId = uicomponent.getUploadIds();
	boolean isDynamicMode = uicomponent.isDynamicMode();
	def rcontext = _ctx.getRequestContext();
	def b = new org.json.JSONArray(uploadId);
	def id = uicomponent.getId();
	rcontext.getJavascriptManager().require("SHARED/upload", "upload")
    .addScripts("upload.UIUploadInput.initUploadEntry('" + id + "'," + b.toString()+ ", " + !isDynamicMode+ ");");
%>
<div id="$id" class="uiUploadInput">
<div class="createUploadURL" style="display:none"><%=uicomponent.url('CreateUploadId')%></div>
<div class="removeInputUrl" style="display: none;"><%=uicomponent.url('RemoveUploadId');%></div>
<div class="limitMessage" style="display: none;"><%= _ctx.appRes("UIFormUploadInput.msg.limit"); %></div>
<script type="text/template">
<div class="uploadContainer" style="display:none">  
	<div class="fileHidden" style="overflow:hidden">
		<input class="file" name="file" type='file' style="display:none"/>
	</div>	
	<div class="progressBarFrame clearfix" style="display:none">
		<span class="deleteFileLabel pull-right">
			<a href="#" class="actionIcon" rel="tooltip" data-placement="bottom" title="<%=_ctx.appRes("UIFormUploadInput.label.Cancel")%>">
				<i class="uiIconRemove uiIconLightGray"></i>
			</a>
		</span>
		<div class="fileNameLabel pull-left"></div>
		<div class="pull-left percent">0%</div>
		<div class="progress  progress-striped">
		  <div class="bar" style="width:0%"></div>
		</div>			   
  </div>
  <div class="selectFileFrame clearfix" style="display: none;">		
		<div class="fileNameLabel"></div>
		<div class="removeFile pull-right" >
			<a href="#" id="btnRemove" class="actionIcon" rel="tooltip" data-placement="bottom" title="<%= _ctx.appRes("UIFormUploadInput.label.remove"); %>">
				<i class="uiIconDelete uiIconLightGray" ></i>
			</a>
		</div>
  </div>
	<iframe height="0" width="0" style="display: none;" name="uploadIFrame">
		<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
		<html xmlns='http://www.w3.org/1999/xhtml'>
			<head></head>
			<body></body>
		</html>
	</iframe>
</div>
</script>
<div class="uploadButton">
	<label class="btn"><%=_ctx.appRes("UIFormUploadInput.label.SelectFile")%></label> 
	<label class="noFile" style="display:none"><%=_ctx.appRes("UIFormUploadInput.label.NoFile")%></label>
	<label class="moreFiles" style="display:none"><%=_ctx.appRes("UIFormUploadInput.label.MoreFile")%></label>
</div>	
</div>