<%@ page contentType="text/html; charset=GBK" %>
<%@ taglib uri="/cms4j" prefix="cms4j" %>
<%@ page import = "cn.com.dekn.cms.util.*,cn.com.dekn.common.util.*" %>


<%
//录入项ID INPUT_ID
String INPUT_ID = StrUtil.getNotNullStringValue(request.getParameter("INPUT_ID"),"");

//录入项默认值 INPUT_DEFAULT_VALUE
String INPUT_DEFAULT_VALUE = StrUtil.getNotNullStringValue(request.getParameter("INPUT_DEFAULT_VALUE"),"");

//录入项可选值 INPUT_VALUE
String INPUT_VALUE = StrUtil.getNotNullStringValue(request.getParameter("INPUT_VALUE"),"");
String[] valueArray = INPUT_VALUE.split("\\|");

//录入项备注 INPUT_REMARK
String INPUT_REMARK = StrUtil.getNotNullStringValue(request.getParameter("INPUT_REMARK"),"");

//是否必填写 INPUT_MUST
String INPUT_MUST = StrUtil.getNotNullStringValue(request.getParameter("INPUT_MUST"),"");

//必选项类型 INPUT_MUST_TYPE
String INPUT_MUST_TYPE = StrUtil.getNotNullStringValue(request.getParameter("INPUT_MUST_TYPE"),"");

//必选项提示消息 INPUT_MUST_MSG
String INPUT_MUST_MSG = StrUtil.getNotNullStringValue(request.getParameter("INPUT_MUST_MSG"),"");

String UPLOAD_URL = StrUtil.getNotNullStringValue(request.getParameter("UPLOAD_URL"),"");
String upLoadUrl = "";
if(null == UPLOAD_URL || UPLOAD_URL.equals("")){
	upLoadUrl = "../editor/uploadIframe.jsp";
}else{
	upLoadUrl =  UPLOAD_URL;
}

String ID = StrUtil.getNotNullStringValue(request.getParameter("ID"),"");

if(INPUT_MUST.equals("1")){
	INPUT_MUST = "true";
}else{
	INPUT_MUST = "false";
}
if(INPUT_MUST.equals("1") && INPUT_MUST_TYPE.equals("")){
	INPUT_MUST_TYPE = "Require";
}
%>

<script language="javascript">
function uploadSubmit(){
 uploadLinkTo<%=INPUT_ID%>.window.myformSubmit();
}
</script>

<table width="80%" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td width="57%" id="upload_valueTd<%=INPUT_ID%>">
		<input name="<%=INPUT_ID%>" type="text" class="form-input" id="<%=INPUT_ID%>" size="60" maxlength="250" value="<%=INPUT_DEFAULT_VALUE%>">
		</td>
		<td width="43%" id="removeUploadToTD<%=INPUT_ID%>" style="display:none">
		<input name="b2" id="b2" type="button" class="b2_cancel" onClick="<%=INPUT_ID%>.value='';uploadLinkTo<%=INPUT_ID%>.location.href='<%=upLoadUrl%>?type=uploadTo&tdName=<%=INPUT_ID%>&isRtnFileSize=true';displayCtrl('uploadToTable<%=INPUT_ID%>','removeUploadToTD<%=INPUT_ID%>');if(typeof setIframHeight=='function'){setIframHeight();}" value="取消">
		</td>
	</tr>
</table>

<span class="remark">可以在上面手工输入一个地址</span>
<span class="text_remark"><br>
</span>

<table width="100%"  border="0" cellspacing="0" cellpadding="0" id="uploadToTable<%=INPUT_ID%>">
	<tr>
		<td width="42%">
		<iframe id="uploadLinkTo<%=INPUT_ID%>" name="uploadLinkTo<%=INPUT_ID%>" frameborder=0 src="<%=upLoadUrl%>?type=uploadTo&isUploadWarter=no&tdName=<%=INPUT_ID%>&isRtnFileSize=true" width="400" height="24" scrolling=no></iframe>
	  </td>
	  <td width="58%" align="left"><input name="b2" id="b2" type="button" class="b2_ok" onClick="uploadSubmit()" value="上传"></td>
	</tr>
</table>

<script>
if(null!=document.getElementById("<%=INPUT_ID%>")){
	var upload_value = document.getElementById("<%=INPUT_ID%>").value;
	if(upload_value != ""){
		displayCtrl('removeUploadToTD<%=INPUT_ID%>','uploadToTable<%=INPUT_ID%>');
	}
}
</script>