<%@ page contentType="text/html; charset=GBK" session="false"%>
<%@ taglib uri="/cmsTag" prefix="cms"%>

<!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="X-UA-Compatible" content="IE=EmulateIE7" />
		<cms:SystemDataModel id='1'>
			<cms:SystemContent id="${param.contentId}" modelId="1">
				<title>编辑文章</title>
				<link href="../../style/blue/css/main.css" type="text/css" rel="stylesheet" />
				<link href="../../style/blue/css/reset-min.css" rel="stylesheet" type="text/css" />
				<link href="../../javascript/colorpicker/css/picker.css" type="text/css" rel="stylesheet" />
				<script type="text/javascript" src="../../common/js/jquery-1.7.gzjs"></script>
				<script language="javascript" type="text/javascript" src="../../javascript/commonUtil_src.js"></script>
				<script type="text/javascript" src="../../javascript/dialog/lhgdialog.min.js?skin=iblue"></script>
				<script type="text/javascript" src="../../javascript/editor/fckeditor.js"></script>
				<script type="text/javascript" src="../../javascript/format/editor_content_format.js"></script>
				<script type="text/javascript" src="../../javascript/colorpicker/picker.js"></script>
				<script type="text/javascript" src="../../javascript/uuid.js"></script>

				<script language="javascript" type="text/javascript" src="../../javascript/My97DatePicker/WdatePicker.js"></script>

				<script>
			basePath='<cms:Domain/>/';
			//$(window).load(function()
			$(function()
			{
				 //颜色选择
				 $("#titleBg").bigColorpicker(
				 	"titleBgVal"
				 ); 
				 
				 $("#simpleTitleBg").bigColorpicker(
				 	"simpleTitleBgVal"
				 ); 
	

			 // $.formValidator.initConfig({formID:"photoForm",theme:'Bull',mode:'AutoTip',onError:function(msg){alert(msg)},inIframe:true});
			  validate('title',1,null,null);	
		    
			})
		 
		</script>
				<script type="text/javascript">


</script>
	</head>
	<body>
		<form method="post" name="contentForm" id="contentForm">
			<div class="breadnav">
				<table width="99.9%" border="0" cellspacing="0" cellpadding="0">
					<tr>
						<td align="left">
							&nbsp;
							<img src="../../style/blue/images/home.gif" width="16" height="16" class="home" />
							当前位置：
							<a href="#">内容管理</a> &raquo; 编辑文章
						</td>
						<td align="right">

						</td>
					</tr>
				</table>
			</div>
			<div style="height:25px;"></div>
			<!--新添加修稿20130804-->
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td align="left" valign="top">
						<!--main start-->
						<div class="addtit">
							<img src="../../style/blue/icon/application-import.png" width="16" height="16" />
							文章基本信息
						</div>


						<table width="100%" border="0" cellpadding="0" cellspacing="0" class="form-table-big" style="padding-top: 8px;">

							<tr>
								<td width="17%" class="input-title">
									标题:
								</td>
								<td class="td-input">
									<input id="title" name="title" type="text" size="85" maxLength="120" style="width: 443px;${Info.titleStyle}" class="form-input-title titlerule" onkeyup="textCounter(this, 'currCharLen');" value="${Info.title}" />
									<span class="red">*</span>
									<font><span id="currCharLen">0</span>字</font> &nbsp;

									<img src="../../../core/style/blue/icons/edit_r1_c7.jpg" height="16" width="16" title="颜色" id="titleBg" class="cursor img-icon" />
									<input type="hidden" id="titleBgVal" name="titleBgVal" value="" />
									<img src="../../../core/style/blue/icons/edit_r1_c1.jpg" height="16" width="16" title="粗体" id="strongTitle" onclick="javascript:setTitleChar(this);" class="cursor img-icon" />
									<img src="../../../core/style/blue/icons/edit_r1_c3.jpg" height="16" width="16" title="斜体" id="emTitle" onclick="javascript:setTitleChar(this);" class=" cursor img-icon" />
									<img src="../../../core/style/blue/icons/edit_r1_c5.jpg" height="16" width="16" title="下划线" id="underTitle" onclick="javascript:setTitleChar(this);" class=" cursor img-icon" />
									<input type="checkbox" size="55" class="form-checkbox img-icon" onclick="javascript:showTitleInput('simpleTitle',this);" />
									辅标题
									<%--<input type="checkbox" size="55" class="form-checkbox img-icon" onclick="javascript:showTitleInput('shortTitle',this);" />
									短标
								--%></td>
							</tr>
							<tr id="simpleTitleTr" style="display:none">
								<td class="input-title">
									副标题:
								</td>
								<td  class="td-input">
									<input id="simpleTitle" name="simpleTitle" type="text" style="width: 443px;" class="form-input-title titlerule" onkeyup="textCounter(this, 'currSimpleCharLen');" size="55" maxLength="60" value="${Info.simpleTitle}" />
									<font face="微软雅黑"><span id="currSimpleCharLen">0</span>字</font> &nbsp;
									<img src="../../../core/style/blue/icons/edit_r1_c7.jpg" height="16" width="16" title="颜色" id="simpleTitleBg" class="cursor img-icon" />
									<input type="hidden" id="simpleTitleBgVal" name="simpleTitleBgVal" />
									<img src="../../../core/style/blue/icons/edit_r1_c1.jpg" height="16" width="16" title="粗体" id="strongSimpleTitle" onclick="javascript:setSimpleTitleChar(this);" class="cursor img-icon" />
									<img src="../../../core/style/blue/icons/edit_r1_c3.jpg" height="16" width="16" title="斜体" id="emSimpleTitle" onclick="javascript:setSimpleTitleChar(this);" class="cursor img-icon" />
									<img src="../../../core/style/blue/icons/edit_r1_c5.jpg" height="16" width="16" title="下划线" id="underSimpleTitle" onclick="javascript:setSimpleTitleChar(this);" class="cursor img-icon" />
									
								</td>

							</tr>
							<tr id="shortTitleTr" style="display:none">
								<td class="input-title">
									短标题:
								</td>
								<td  class="td-input">
									<input id="shortTitle" name="shortTitle" type="text" style="width: 443px;" class="form-input-title titlerule" onkeyup="textCounter(this, 'currSimpleCharLen');" size="55" maxLength="60" value="${Info.shortTitle}" />
									<font face="微软雅黑">0字 </font> &nbsp; &nbsp;
								</td>

							</tr>

							<tr>
								<td width="16%" class="input-title">
									所属栏目:
								</td>
								<td class="td-input">

									<input id="classInfo" type="text" class="form-input" value="" readonly size="22" maxlength="54" />
									<input type="button" value="选择" onclick="" class="btn-1" />

									&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
									<cms:SystemCopyAssInfo contentId="${Info.contentId}">
										<span><img src="../../../core/style/blue/icon/documents-text.png" id="sysCopyContentImg" title="复制到:  ${CopyAssInfo.copyClassStr}" height="16" width="16" class="img-icon" /><a class="a_style" href="javascript:openCopyContentToSiteClassDialog('single','1','${CopyAssInfo.copyClassStr}');">&nbsp;复制</a>[<font color=red><span id='sysCopyClassCount'>${CopyAssInfo.copyClassCount}</span></font>]</span>
									</cms:SystemCopyAssInfo>
									&nbsp;&nbsp;&nbsp;
									<span><img src="../../../core/style/blue/icon/sitemap-application.png" height="16" width="16" class="img-icon" /><a class="a_style" href="javascript:openSelectSiteGroupDialog();">&nbsp;共享</a>[<font color=red><span id='shareCount'>0</span></font>]</span>&nbsp;&nbsp;&nbsp;
									<span><img src="../../../core/style/blue/icon/document-tree.png" height="16" width="16" class="img-icon" /><a class="a_style" href="javascript:openSelectRelatedContentDialog();">&nbsp;相关</a>[<font color=red><span id='shareCount'>0</span></font>]</span>&nbsp;&nbsp;&nbsp;
									<span><img src="../../../core/style/icons/report.png" height="16" width="16" class="img-icon" /><a class="a_style" href="javascript:openSelectRelatedContentDialog();">&nbsp;调查</a>[<font color=red><span id='shareCount'>0</span></font>]</span>&nbsp;&nbsp;&nbsp;
									<input type="checkbox" class="form-checkbox" name="topFlag" value="0" checked></input>置顶
								</td>
							</tr>

							<tr>
								<td class="input-title">
									责编:
								</td>
								<td class="td-input">
									<input id="creator" name="creator" type="text" class="form-input" size="45" maxlength="58" value="${Info.creator}" />
									&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
									<span class="input-title">TAG标签:</span>
									<input readonly id="tagKey" name="tagKey" type="text" class="form-input" size="40" maxlength="300" value="${Info.tagKey}" />
									<input type="button" value="选取TAG" onclick="javascript:openSelectTagDialog();" class="btn-1" />
								</td>
							</tr>

							<tr>
								<td class="input-title">
									来源:
								</td>
								<td class="td-input">
									<input name="author" id="author" type="text" class="form-input" size="34" maxLength="50" value="${Info.author}" />
									<input type="button" value="选取来源" onclick="javascript:openSelectContentSourceDialog();" class="btn-1" />
									&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
									<span class="input-title">关键字:</span>
									<input id="keywords" name="keywords" type="text" class="form-input" size="40" maxlength="200" value="${Info.keywords}" />
									<input type="button" value="自动获取" onclick="javascript:getKeywordFromContent();" class="btn-1" />
								</td>
							</tr>

							<tr>
								<td class="input-title">
									内容摘要:
								</td>
								<td class="td-input">
									<textarea id="summary" name="summary" style="height:45px;width:584px" class="form-textarea">${Info.summary}</textarea>
								</td>
							</tr>


							<tr>
								<td class="input-title">

								</td>
								<td class="td-input">
									<textarea id="content" name="content" style="height:50px;width:570px" class="form-textarea">${Info.content}</textarea>

									<script type="text/javascript">
                                                   var editor1 = new FCKeditor('content');
                                                   editor1.BasePath = "<cms:BasePath/>core/javascript/editor/";
                                                   editor1.Height = 535;
                                                   editor1.Width = 648;
                                                   editor1.Config["EnterMode"] = "p";
                                                   editor1.ReplaceTextarea();   
                                 	</script>

									<%--<input type="hidden" id="content" name="content"  style="display:none" />

									<iframe id="jtopcmsEditorFrame" src="<cms:Domain/>/core/javascript/editor/editor/fckeditor.html?InstanceName=content&amp;Toolbar=Default&amp;EnterMode=br" width="675" height="500" frameborder="0" scrolling="no" style="border: 0pt none ; margin: 0pt; padding: 0pt; background-color: transparent; background-image: none; width: 100%; height: 200px;"></iframe>
									<br>
									
									--%>
									<script>
									//javascript:change(400,"a")javascript:change(400,"d")
										function change(h,f)
										{
											var styleHeight = parseInt(document.getElementById('jtopcmsEditorFrame').style.height);
											
											if("d" == f && styleHeight -60 < 600 )
											{
												return;
											}
											
											if("a" == f)
											{									
												document.getElementById('jtopcmsEditorFrame').style.height= (styleHeight + h)+"px";
											}
											else
											{
												document.getElementById('jtopcmsEditorFrame').style.height= (styleHeight - h)+"px";
											}
										}
									</script>

								</td>
							</tr>
							


						</table>

						<div class="addtit">
							<img src="../../style/blue/icon/application-import.png" width="16" height="16" />
							高级选项
						</div>
						<table width="100%" border="0" cellspacing="0" cellpadding="0" class="form-table-big">
							<tr>
								<td class="input-title">

								</td>
								<td class="td-input">
									<input type="checkbox" class="form-checkbox" checked />
									内容图&nbsp;&nbsp;
									<input type="checkbox" class="form-checkbox" />
									首页图&nbsp;&nbsp;
									<input type="checkbox" class="form-checkbox" />
									频道图&nbsp;&nbsp;
									<input type="checkbox" class="form-checkbox" />
									列表图
							</tr>
							<tr>
								<td class="input-title">
									内容引导图:
								</td>
								<td class="td-input">
									<table border="0" cellpadding="0" cellspacing="0" class="form-table-upload">
										<tr>
											<td>
												<img id="logoImageCmsSysImgShow" src="<cms:SystemResizeImgUrl reUrl="${Class.logoImageReUrl}" />" />
											</td>
											<td>
												<table border="0" cellpadding="0" cellspacing="0" height="65px" class="form-table-big">
													<tr>
														<td>
															&nbsp;
															<input type="button" onclick="javascript:showModuleImageDialog('logoImageCmsSysImgShow','logoImage')" value="上传" onclick="" class="btn-1" />
															<input type="button" value="裁剪" onclick="" class="btn-1" />
															<input type="button" value="删除" onclick="" class="btn-1" />
														</td>
													</tr>
													<tr>
														<td>
															&nbsp; 宽&nbsp;
															<input id="logoImageCmsSysImgWidth" class="form-input" readonly type="text" size="3" value="${Class.logoImageImageW}" />
															&nbsp;高&nbsp;
															<input id="logoImageCmsSysImgHeight" class="form-input" readonly type="text" size="3" value="${Class.logoImageImageH}" />
															&nbsp;

														</td>
													</tr>
												</table>
												<input id="logoImage" name="logoImage" type="hidden" value="${Class.logoImageResId}" />
											</td>
										</tr>
									</table>



								</td>
							</tr>



							<tr>
								<td class="input-title">
									内容属性
								</td>
								<td class="td-input">
									<%--
								multiple="multiple"
									--%>
									<select name="typeFlag" id="typeFlag">
										<option>
											------ 内容自定义属性 ------
										</option>
										<option>
											图文
										</option>
										<option>
											视频
										</option>
										<option>
											附件
										</option>
										<option>
											图集
										</option>
									</select>
									&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 允许评论:
									<input type='radio' name='allowCommend' class='form-radio' value='1' checked />
									是
									<input type='radio' name='allowCommend' class='form-radio' value='0' />
									否
								</td>


							</tr>
							<tr>
								<td width="16%" class="input-title">
									独有模板
								</td>
								<td class="td-input">
									<input id="especialTemplateUrl" name="especialTemplateUrl" type="text" class="form-input" size="54" maxlength="220" />
									<input type="button" value="浏览..." onclick="" class="btn-1" />
								</td>

							</tr>

						
							<tr>
								<td class="input-title">
									发布时间
								</td>
								<td class="td-input">
									<input id="appearStartDateTime" name="appearStartDateTime" size="27" maxlength="30" type="text" class="form-input-date" onmousedown="javascript:WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'});" value="${Info.appearStartDateTime}" />
									&nbsp;至 &nbsp;
									<input id="appearEndDateTime" name="appearEndDateTime" size="27" maxlength="30" type="text" class="form-input-date" onmousedown="javascript:WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'});" value="${Info.appearEndDateTime}"
								</td>
							</tr>

						</table>
					</td>
				</tr>

				<tr>
					<td height="10">
						&nbsp;
					</td>
				</tr>
			</table>

			<!-- hidden -->
			<input type="hidden" id="classId" name="classId" value="${param.classId}" />

			<input type="hidden" id="contentId" name="contentId" value="${Info.contentId}" />

			<!-- 文章模型 -->
			<input type="hidden" id="modelId" name="modelId" value="1" />

			<input type="hidden" id="toStepId" name="toStepId" />

			<input type="hidden" id="fromStepId" name="fromStepId" />

			<!-- 图片信息-->
			<input id="homeImageSysReUrl" name="homeImageSysReUrl" type="hidden" value="${Info.homeImageSysReUrl}" />
			<input id="channelhomeImageSysReUrl" name="channelhomeImageSysReUrl" type="hidden" value="${Info.channelhomeImageSysReUrl}" />
			<input id="classImageSysReUrl" name="classImageSysReUrl" type="hidden" value="${Info.classImageSysReUrl}" />
			<input id="contentImageSysReUrl" name="contentImageSysReUrl" type="hidden" value="${Info.contentImageSysReUrl}" />


			<!-- 标题样式 -->
			<input id='titleStyle' name="titleStyle" type="hidden" value="${Info.titleStyle}" />
			<input id='simpleTitleStyle' name="simpleTitleStyle" type="hidden" value="${Info.simpleTitleStyle}" />

			<!-- 稿件标志 -->
			<input id='contentAddStatus' name="contentAddStatus" type="hidden" />

			<!-- 审核标志 -->
			<input id='censorState' name="censorState" type="hidden" value="${Info.censorState}" />

			<!-- 获取keyword临时变量 -->
			<input type="hidden" id="jtopcms_sys_keyword_content" name="jtopcms_sys_keyword_content" />

			<!-- 同步复制栏目 -->
			<input type="hidden" id="copyClassId" name="copyClassIds" />
		</form>



		<!--提交-->

		<table width="100%" border="0" cellspacing="0" cellpadding="0" >
			<tr class="btnbg100">
				<td width="40%" class="input-title"></td>
				<td  class="td-input">
					<cms:WorkflowActionUIHelp classId="${param.classId}">
						<a onclick="javascript:submitArticle('${Action.fromStepId}','${Action.toStepId}');"  class="btnwithico"><img src="../../style/icons/tick.png" width="16" height="16" /><b>${Action.passActionName}&nbsp;</b> </a>
					</cms:WorkflowActionUIHelp>
					<a onclick="javascript:submitArticle(-1,-1,true);"  class="btnwithico"><img src="../../style/icons/tick.png" width="16" height="16" /><b>存为稿件&nbsp;</b> </a>
					<a onclick="javascript:back();"  class="btnwithico"><img src="../../style/icon/close.png" width="16" height="16"><b>取消&nbsp;</b> </a>
				</td>
			</tr>
		</table>


		<!--[if lt IE 7]>
        <script type="text/javascript" src="js/unitpngfix.js"></script>
<![endif]-->
	</body>
</html>

<script type="text/javascript">

init();

function init()
{

	var contentImageSrc = '${Info.contentImage}';
	
	if(contentImageSrc != '')
	{
		document.getElementById('contentImageShow').src = '${Info.contentImage}';
	}
	
	//topFlag
	initRadio('topFlag','${Info.topFlag}');
	
	
	
}


function submitArticle(fromStepId,toStepId,draft)
{	
	if(draft)
	{
		document.getElementById('contentAddStatus').value='draft';
	}
	
   	document.getElementById('fromStepId').value=fromStepId;
    document.getElementById('toStepId').value=toStepId;
 
   
    for(var i =0 ;  i< pageInfoArray.length;i++)
    {
    	//alert(pageInfoArray[i]);
    }

  
	//alert(document.all.upload.contentWindow.document.getElementById("classImgURL").value); 


	//document.all.classImgUrl.value=document.all.uploadFrame.contentWindow.document.getElementById("classImgFile").value;
	//document.all.contentImgUrl.value=document.all.uploadFrame.contentWindow.document.getElementById("contentImgFile").value;
	//document.all.headImgUrl.value=document.all.uploadFrame.contentWindow.document.getElementById("headImgFile").value;
	//alert('1:'+document.all.classImgURL.value);
	

	
	//alert('2:'+document.all.contentImgURL.value);
	//alert('3:'+document.all.headImgURL.value);
	
	disposeTitleStyle();
	
	var articleForm = document.getElementById('contentForm');
	
	articleForm.action="../../../content/editContent.cmd"
	
	articleForm.submit();
}


function showShareDialog()
{
   var returnArray=window.showModalDialog("ShareArticle.jsp?currentSelectClassIdStr="+document.getElementById("selectShareIds").value+"&random="+Math.random(),"","dialogWidth=350px;dialogHeight=430px;status=no");

   if(typeof(returnArray) != 'undefined')
   {
     var selectClassIdStr=returnArray[0];
     if(typeof(selectClassIdStr) != 'undefined' && '' != selectClassIdStr  )
     {
   	   document.getElementById("selectShareIds").value=selectClassIdStr;
     }
     
     document.getElementById("shareCount").innerHTML=returnArray[1];
   }
}

//选取相关内容
function openSelectContentSourceDialog()
{
	$.dialog({ 
		    id : 'oscsd',
	    	title : '选取来源',
	    	width: '270px', 
	    	height: '420px', 
	    	lock: true, 
	        max: false, 
	        min: false,
	        resize: false,
	       
	        content: 'url:'+basePath+'/core/content/dialog/ShowContentSource.jsp?uid='+Math.random()
	
	});
}

//选取Tag
function openSelectTagDialog()
{
	$.dialog({ 
		    id : 'ostd',
	    	title : '选取Tag标签',
	    	width: '450px', 
	    	height: '555px', 
	    	lock: true, 
	        max: false, 
	        min: false,
	        resize: false,
	       
	        content: 'url:'+basePath+'/core/content/dialog/ShowSiteTag.jsp?uid='+Math.random()
	
	});
}

//选取站群节点
function openSelectSiteGroupDialog()
{
	$.dialog({ 
		    id : 'ossgd',
	    	title : '共享到站群',
	    	width: '300px', 
	    	height: '280px', 
	    	lock: true, 
	        max: false, 
	        min: false,
	        resize: false,
	       
	        content: 'url:'+basePath+'/core/content/dialog/ShowSiteGroup.jsp?uid='+Math.random()
	
	});
}

//选取相关内容
function openSelectRelatedContentDialog()
{
	$.dialog({ 
		    id : 'osrcgd',
	    	title : '选取相关内容',
	    	width: '670px', 
	    	height: '420px', 
	    	lock: true, 
	        max: false, 
	        min: false,
	        resize: false,
	       
	        content: 'url:'+basePath+'/core/content/dialog/ShowRelatedContent.jsp?uid='+Math.random()
	
	});
}


</script>
</cms:SystemContent>
</cms:SystemDataModel>
