<%@ page contentType="text/html; charset=GBK"%>
<%@ taglib uri="/cms4j" prefix="cms4j" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<title>CMS4J </title>
<link href="../skin/blue/css/oper_area_style.css" rel="stylesheet" type="text/css">
</head>
<script src="../../js/common.js"></script>
<script src="../../js/page_init.js"></script>
<script src="../../js/validator.js"></script>


<script>
function UploadLoaded(){
	//alert("upload");
}

function upload(){
	//alert("uploaddddd");
	d_file.myform.submit();
}

// 文件上传完成时执行,带入上传文件名
function UploadSaved(sPathFileName,type){
	if(type=="" || type == null){
		displayCtrl('showArticleImage','uploadArticleImage');
		document.all.articleImage.src = sPathFileName;
		this.cms4jForm.HOMEPAGE_IMAGE.value = sPathFileName;
	}else if(type == "linkTo"){
		displayCtrl('removeLinkToTD','uploadLinkToTable');
		this.cms4jForm.LINK_TO_EXTERIOR.value = sPathFileName;
	}
}

function reloadArticleImage(){
	this.cms4jForm.HOMEPAGE_IMAGE.value = "";
	displayCtrl('uploadArticleImage','showArticleImage');
	d_file.location.href = "../editor/upload.jsp";
}

//aschen add 20060807 多专题文章
function OpenChildWindow() {
	 var idSelected=document.cms4jForm.SPECIAL_ID.value;
	 url = 'special_list.jsp?idSelected='+idSelected;
	 sWidth = '500';
	 sHeight = '400';
     gOpenedWindow = null;
     gOpened = false;
     var  str = "height=" +  sHeight +  ",innerHeight=" + sHeight;
     str += ",width=" + sWidth + ",innerWidth=" + sWidth;
    if (window.screen) {
       var ah = window.screen.availHeight - 30;
       var  aw = window.screen.availWidth - 10;
       var xc = (aw - sWidth)/2;
       var yc = (ah - sHeight) / 2;
       str += ",left=" + xc + ",screenX=" + xc;
       str += ",top=" + yc + ",screenY=" + yc;
      }      
      str +=",scrollbars=yes";
     gOpenedWindow =  window.open(url, "window" , str);
}

//设置专题列表
function resetSel(){
	var sel = document.getElementById("SPECIAL_SHOW");
	sel.options.length=0;
	var id=document.cms4jForm.SPECIAL_ID.value;
	var name=document.cms4jForm.SPECIAL_NAME.value;
	if(id=="1"||id==null||id==""){
		return;
	}else{
		var arrId=new Array();
		var arrName=new Array();
		arrId=id.split("|");
		arrName=name.split("|");
		var idValue;
		var nameValue;
		for(var i=0;i<arrId.length-1;i++){
			idValue=arrId[i];
			nameValue=arrName[i];
			sel.options[sel.options.length] = new Option(nameValue,idValue);	
		}
	}
}


function class_select(selectedValue){
	SetCookie ("CMS4J_OH_ARTICLE_CLASS_ID", selectedValue,365);
}

function pageInit(){

	var CMS4J_OH_ARTICLE_CLASS_ID = getCookie('CMS4J_OH_ARTICLE_CLASS_ID');

	selectInit("ARTICLE_CLASS_ID",CMS4J_OH_ARTICLE_CLASS_ID);

}

</script>

<body onLoad="pageInit();">
<form action="../../do?action=addArticle&type=full" method="post" name="cms4jForm" id="cms4jForm">
  <input type="hidden" value="1" name="SPECIAL_ID">
  <input type="hidden" value="1" name="SPECIAL_NAME">
  <table width="98%"  border="0" align="center" cellpadding="0" cellspacing="0">
    <tr height="12"> 
      <td width="3%"><img src="../../images/admin/oper_table_up_left.gif" width="26" height="12"></td>
      <td width="92%" background="../../images/admin/oper_table_up_bg.gif" height="12"></td>
      <td width="5%"><img src="../../images/admin/oper_table_up_right.gif" width="26" height="12"></td>
    </tr>
    <tr> 
      <td colspan="3"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
          <tr> 
            <td width="5" background="../../images/admin/oper_table_left_bg.gif"><img src="../../images/admin/oper_table_left_bg.gif" width="5" height="2"></td>
            <td background="../../images/admin/oper_table_bg.gif"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                <tr> 
                  <td class="title_bar">添加新文章</td>
                </tr>
                <tr height="4"> 
                  <td height="4"></td>
                </tr>
              </table>
              <table width="100%" border="0" cellpadding="0" cellspacing="1" class="list_border_bg">
                <tr> 
                  <td width="22%" height="22" align="right" class="list_left_title">所属栏目：</td>
                  <td width="78%" height="22" class="list_cell_bg"> <select name="ARTICLE_CLASS_ID" class="form_select" id="ARTICLE_CLASS_ID" onChange="class_select(this.value)">
                      <option selected value="">请选择</option>
                      <cms4j:class purview_type="input" content_type="article">
						<option value="<%=class_info.getARTICLE_CLASS_ID()%>" id="<%=class_info.getARTICLE_CLASS_ID()%>"><%=class_info.getCLASS_NAME()%></option>
						<cms4j:class purview_type="input" content_type="article">
							<option value="<%=class_info.getARTICLE_CLASS_ID()%>" id="<%=class_info.getARTICLE_CLASS_ID()%>">　└<%=class_info.getCLASS_NAME()%></option>
							<cms4j:class purview_type="input" content_type="article">
								<option value="<%=class_info.getARTICLE_CLASS_ID()%>" id="<%=class_info.getARTICLE_CLASS_ID()%>">　　　└<%=class_info.getCLASS_NAME()%></option>
							</cms4j:class>
						</cms4j:class>
					</cms4j:class>
					  
					  </select> <span class="test_must">*</span>                  </td>
                </tr>
                <tr> 
                  <td height="22" align="right" class="list_left_title">所属专题：</td>
                  <td height="22" class="list_cell_bg"> 
					   <select name="SPECIAL_SHOW" id="SPECIAL_SHOW" SIZE="4" STYLE="WIDTH:40%">
                       </select>
                       <a href="javascript:OpenChildWindow();">选择</a>				  </td>
                </tr>
                <tr> 
                  <td height="22" align="right" class="list_left_title">文章标题：</td>
                  <td height="22" class="list_cell_bg"> <input name="TITLE" type="text" class="form_input" id="TITLE" size="60" maxlength="100"> 
                    <select name="TITLE_COLOR" class="form_select" id="TITLE_COLOR">
                      <option value="" selected>颜色</option>
                      <OPTION value="">默认</OPTION>
                      <OPTION value="#000000" style="background-color:#000000"></OPTION>
                      <OPTION value="#FFFFFF" style="background-color:#FFFFFF"></OPTION>
                      <OPTION value="#008000" style="background-color:#008000"></OPTION>
                      <OPTION value="#800000" style="background-color:#800000"></OPTION>
                      <OPTION value="#808000" style="background-color:#808000"></OPTION>
                      <OPTION value="#000080" style="background-color:#000080"></OPTION>
                      <OPTION value="#800080" style="background-color:#800080"></OPTION>
                      <OPTION value="#808080" style="background-color:#808080"></OPTION>
                      <OPTION value="#FFFF00" style="background-color:#FFFF00"></OPTION>
                      <OPTION value="#00FF00" style="background-color:#00FF00"></OPTION>
                      <OPTION value="#00FFFF" style="background-color:#00FFFF"></OPTION>
                      <OPTION value="#FF00FF" style="background-color:#FF00FF"></OPTION>
                      <OPTION value="#FF0000" style="background-color:#FF0000"></OPTION>
                      <OPTION value="#0000FF" style="background-color:#0000FF"></OPTION>
                      <OPTION value="#008080" style="background-color:#008080"></OPTION>
                    </select> <select name="TITLE_FONT" class="form_select" id="TITLE_FONT">
                      <option value="default" selected>字形</option>
                      <option value="strong">粗体</option>
                      <option value="em">斜体</option>
                      <option value="strongAndEm">粗+斜</option>
                    </select> <span class="test_must">*</span></td>
                </tr>
                <tr> 
                  <td height="22" align="right" class="list_left_title">关键字：</td>
                  <td height="22" class="list_cell_bg"> <input name="KEY_WORD" type="text" class="form_input" id="KEY_WORD" size="60" maxlength="30"> <span class="test_must">*</span>
                    <span class="text_remark"><br>
                    用来查找相关文章，可输入多个关键字，中间用 | 或 空格 隔开，例如：北京|奥运|2008</span>                  </td>
                </tr>
                <tr> 
                  <td height="22" align="right" class="list_left_title">文章作者：</td>
                  <td height="22" class="list_cell_bg"> <input name="AUTHOR" type="text" class="form_input"
           id="AUTHOR" size="30" maxlength="30">
                    &lt;=<span class="page_ctrl">【<FONT style="CURSOR: hand" 
onclick="document.cms4jForm.AUTHOR.value='未知'">未知</FONT>】【<FONT 
style="CURSOR: hand" onclick="document.cms4jForm.AUTHOR.value='佚名'">佚名</FONT>】【<FONT style="CURSOR: hand" 
onclick="document.cms4jForm.AUTHOR.value='admin'">admin</FONT>】【<FONT style="CURSOR: hand" 
onclick="document.cms4jForm.AUTHOR.value='原创'">原创</FONT>】</span></td>
                </tr>
                <tr style="display:none"> 
                  <td height="22" align="right" class="list_left_title">是否允许评论：</td>
                  <td height="22" class="list_cell_bg"> <input name="IS_COMMENT" type="radio" class="form_radio" value="true" checked>
                    允许评论 
                    <input name="IS_COMMENT" type="radio" class="form_radio" value="false">
                    不允许评论</td>
                </tr>
                <tr> 
                  <td height="23" align="right" class="list_left_title">文章来源：</td>
                  <td height="23" class="list_cell_bg"> <input name="SOURCE" type="text" class="form_input"
           id="SOURCE" size="30" maxlength="30">
&lt;=<span class="page_ctrl">【<FONT style="CURSOR: hand" 
onclick="document.cms4jForm.SOURCE.value='未知'">未知</FONT>】【<FONT style="CURSOR: hand" 
onclick="document.cms4jForm.SOURCE.value='原创'">原创</FONT>】</span></td>
                </tr>
                <tr>
                  <td height="22" align="right" class="list_left_title">链接至其它：</td>
                  <td height="22" class="list_cell_bg"><table width="80%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td width="57%"><input name="LINK_TO_EXTERIOR" type="text" class="form_input"
           id="LINK_TO_EXTERIOR" size="60" maxlength="150"></td>
                      <td width="43%" id="removeLinkToTD" style="display:none"><input type="button" name="Submit3" value="取消" onClick="LINK_TO_EXTERIOR.value='';uploadLinkTo.location.href='../editor/upload.jsp?type=linkTo';displayCtrl('uploadLinkToTable','removeLinkToTD');"></td>
                    </tr>
                  </table>
                    <span class="text_remark">设置此新闻为链接至其它网站，即用户点击此新闻时，系统自动链接至上面输入框中输入的网址<br>
                      </span>
                      <table width="100%"  border="0" cellspacing="0" cellpadding="0" id="uploadLinkToTable">
                        <tr>
                          <td width="64%"><iframe id="uploadLinkTo" frameborder=0 src="../editor/upload.jsp?type=linkTo" width="100%" height="22" scrolling=no></iframe></td>
                          <td width="36%" align="left"><input type="button" name="Submit2" value="上传" onClick="uploadLinkTo.myform.submit();"></td>
                        </tr>
                      </table></td>
                </tr>
                <tr style="display:">
                  <td height="22" align="right" class="list_left_title">文章摘要：</td>
                  <td height="22" class="list_cell_bg"><textarea name="SUMMARY"  style="width:96% " rows="6" class="form_input" id="SUMMARY"></textarea>                  </td>
                </tr>
                <tr align="center">
                  <td height="22" colspan="2" class="list_left_title"><div align="center">文章内容</div></td>
                </tr>
                <tr> 
                  <td height="22" colspan="2" align="left" class="list_left_title">
                    <div align="center">
					<textarea name="CONTENT" class="form_textarea" id="CONTENT" style="display:none"></textarea>
                    
          			<iframe ID="editor" src="../editor/editor.htm" frameborder=1 scrolling=no width="98%" height="405"></iframe>  
                    </div></td>
                </tr>
                <tr> 
                  <td height="32" align="right" class="list_left_title">文章摘要图片：</td>
                  <td height="32" class="list_cell_bg">                  
				  <table width="100%"  border="0" cellspacing="0" cellpadding="0" id="uploadArticleImage">
                    <tr>
                      <td width="57%" class="text_remark">用于显示在栏目的前方，或组成图片新闻栏目</td>
                      <td width="15%">&nbsp;</td>
                      <td width="28%" rowspan="2">&nbsp;</td>
                    </tr>
                    <tr>
                      <td><iframe id="d_file" frameborder=0 src="../editor/upload.jsp" width="100%" height="22" scrolling=no></iframe></td>
                      <td align="center"><input type="button" name="Submit" value="上传" onClick="upload()"></td>
                      </tr>
                  </table>
                  <input type="hidden" name="HOMEPAGE_IMAGE">				  
                  <table width="100%"  border="0" cellspacing="0" cellpadding="0" id="showArticleImage" style="display:none ">
                    <tr>
                      <td width="48%" class="text_remark">用于显示在栏目的前方，或组成图片新闻栏目</td>
                      <td width="30%" align="center"><img src="../../images/admin/fw_top_logo.gif" width="138" height="112" id="articleImage"></td>
                      <td width="22%"><input type="button" name="Submit" value="删除" onClick="reloadArticleImage();"></td>
                    </tr>
                  </table>				  </td>
                </tr>
                <tr style="display:none"> 
                  <td align="right" class="list_left_title"><strong>内容分页方式：</strong></td>
                  <td class="list_cell_bg"> <select name="PAGINATION_ID" class="form_select" id="PAGINATION_ID">
                      <cms4j:select tableName="ARTICLE_PAGINATION" colsName="PAGINATION_ID,NAME"> 
                      <option value="@PAGINATION_ID" >@NAME</option>
                      </cms4j:select> </select>                    </td>
                </tr>
                <tr> 
                  <td height="22" align="right" class="list_left_title">文章性质：</td>
                  <td height="22" class="list_cell_bg"> <input name="IS_ONTOP" type="checkbox" class="form_checkbox" value="true">
                    固顶文章&nbsp;&nbsp;&nbsp;&nbsp; <input name="IS_COMMEND" type=checkbox class="form_checkbox" value="true">
                    推荐文章</td>
                </tr>
                <tr> 
                  <td align="right" class="list_left_title"><strong>点击数初始值：</strong></td>
                  <td class="list_cell_bg"> <input name="CLICKS" type="text" class="form_input" id="CLICKS" value="0" size="10" maxlength="10">
                    &nbsp;&nbsp; </td>
                </tr>
                <tr> 
                  <td align="right" class="list_left_title"><strong>录入时间：</strong></td>
                  <td class="list_cell_bg"> <input name="ADD_DATE" type="text" class="form_input" id="ADD_DATE" maxlength="50">
                    <span class="text_remark">时间格式为“年-月-日 时:分:秒”，如：2003-5-12 12:32:47</span></td>
                </tr>
                <tr style="display:none"> 
                  <td align="right" class="list_left_title"><strong>版面设计模板：</strong></td>
                  <td class="list_cell_bg"> <select name="FRAME_TEMPLET_ID" class="form_select" id="FRAME_TEMPLET_ID">
                      <cms4j:select tableName="SYS_TEMPLET" colsName="TEMPLET_ID,TEMPLET_NAME"> 
                      <option id="@TEMPLET_ID" value="@TEMPLET_NAME">@TEMPLET_NAME</option>
                      </cms4j:select> </select> &nbsp;<span class="text_remark">相关模板中包含了版面设计的版式等信息</span></td>
                </tr>
                <tr style="display:none"> 
                  <td align="right" class="list_left_title"><strong>配色模板：</strong></td>
                  <td class="list_cell_bg"> <select name="COLOR_TEMPLET_ID" class="form_select" id="COLOR_TEMPLET_ID">
                      <cms4j:select tableName="ARTICLE_COLOR_TEMPLET" colsName="COLOR_TEMPLET_ID,NAME"> 
                      <option id="@COLOR_TEMPLET_ID" value="@COLOR_TEMPLET_ID">@NAME</option>
                      </cms4j:select> </select> &nbsp;<span class="text_remark">相关模板中包含CSS、颜色、图片等信息</span></td>
                </tr>
                <tr style="display:none"> 
                  <td height="22" align="right" class="list_left_title">立即发布：</td>
                  <td height="22" class="list_cell_bg"> <input name="RELEASE_STATE" type="radio" class="form_radio" value="immediately">
                    立即发布 
                    <input name="RELEASE_STATE" type="radio" class="form_radio" value="auditing" checked>
                    审核后再发布</td>
                </tr>
                <tr style="display:none"> 
                  <td height="22" align="right" class="list_left_title">浏览权限：</td>
                  <td height="22" class="list_cell_bg"> <input name="checkbox" type="checkbox" value="checkbox" checked>
                    管理员 
                    <input name="checkbox2" type="checkbox" value="checkbox" checked>
                    论坛版主 
                    <input name="checkbox3" type="checkbox" value="checkbox" checked>
                    VIP 用户 
                    <input name="checkbox4" type="checkbox" value="checkbox" checked>
                    会员用户 
                    <input name="checkbox5" type="checkbox" value="checkbox" checked>
                    注册用户 
                    <input name="checkbox6" type="checkbox" value="checkbox" checked>
                    游客 </td>
                </tr>
                <tr style="display:none"> 
                  <td height="22" align="right" class="list_left_title">查看此文章的条件：</td>
                  <td height="22" class="list_cell_bg"> <select name="RESTRICT_ID" class="form_select" id="RESTRICT_ID">
                      <cms4j:select tableName="SYS_RESTRICTS" colsName="RESTRICT_ID,REST_NAME"> 
                      <option id="@RESTRICT_ID" value="@RESTRICT_ID">@REST_NAME</option>
                      </cms4j:select> </select> </td>
                </tr>
                <tr style="display:none"> 
                  <td height="22" align="right" class="list_left_title">查看此文章的操作：</td>
                  <td height="22" class="list_cell_bg"> <select name="ACTION_ID" class="form_select" id="ACTION_ID">
                      <cms4j:select tableName="SYS_ACTIONS" colsName="ACTION_ID,ACT_NAME"> 
                      <option id="@ACTION_ID" value="@ACTION_ID">@ACT_NAME</option>
                      </cms4j:select> </select> </td>
                </tr>
                <tr> 
                  <td height="22" colspan="2" align="right" class="table_oper_tr"> 
                    <input name="Submit" type="submit" class="form_button" value="提交"></td>
                </tr>
              </table> </td>
            <td width="5" background="../../images/admin/oper_table_right_bg.gif"><img src="../../images/admin/oper_table_right_bg.gif" width="5" height="2"></td>
          </tr>
        </table></td>
    </tr>
    <tr height="13"> 
      <td><img src="../../images/admin/oper_table_down_left.gif" width="26" height="13"></td>
      <td width="100%" height="13" background="../../images/admin/oper_table_down_bg.gif"></td>
      <td align="right"><img src="../../images/admin/oper_table_down_right.gif" width="26" height="13"></td>
    </tr>
  </table>
<table width="717" border="0" cellspacing="0" cellpadding="0">
  <tr>
      <td align="center">&nbsp;</td>
  </tr>
</table>
</form>
</body>
</html>
