<%@ 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" />
		<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
		<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" />
		<script type="text/javascript" src="../javascript/commonUtil_src.js"></script>
		<script type="text/javascript" src="../common/js/jquery-1.7.gzjs"></script>
		<script type="text/javascript" src="../javascript/dialog/lhgdialog.min.js?skin=iblue"></script>
		<script language="javascript" type="text/javascript" src="../javascript/My97DatePicker/WdatePicker.js"></script>


		<script>  
		basePath = '<cms:BasePath/>';
        //表格变色
			$(function()
			{ 
		   		$("#showlist1 tr[id!='pageBarTr']").hover(function() 
		   		{ 
					$(this).addClass("tdbgyew"); 
				}, 
				function() 
				{ 
					$(this).removeClass("tdbgyew"); 
				}); 
				
				$("#showlist2 tr[id!='pageBarTr']").hover(function() 
		   		{ 
					$(this).addClass("tdbgyew"); 
				}, 
				function() 
				{ 
					$(this).removeClass("tdbgyew"); 
				}); 
				
				$("#showlist3 tr[id!='pageBarTr']").hover(function() 
		   		{ 
					$(this).addClass("tdbgyew"); 
				}, 
				function() 
				{ 
					$(this).removeClass("tdbgyew"); 
				}); 
				
				$("#showlist4 tr[id!='pageBarTr']").hover(function() 
		   		{ 
					$(this).addClass("tdbgyew"); 
				}, 
				function() 
				{ 
					$(this).removeClass("tdbgyew"); 
				}); 
				
				for(var i=0; i<document.links.length; i++)
			   {
			     document.links[i].onclick=function(){this.blur()}
			   }
			});  	
      	</script>
	</head>
	<body>
		<cms:CurrentSite>
			<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;
							<a href="#">我的工作台</a>
						</td>
						<td align="right">

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

			<div style="height:15px;"></div>

			<form id="advertForm" name="advertForm" method="post">
				<table width="100%" border="0" cellspacing="0" cellpadding="0">
					<tr>
						<td align="left" valign="top">

							<!--main start-->
							<center>
								<div class="auntion_tagRoom" style="margin-top:14px;width:99%">
									<ul>
										
										<li id="two1" onclick="setTab(1)" class="selectTag">
											<a href="javascript:;"><img src="../style/icons/socket--pencil.png" width="16" height="16" />待我回复留言&nbsp;</a>
										</li>
										<li id="two2" onclick="setTab(2)">
											<a href="javascript:;"><img src="../style/blue/icon/sitemap-application.png" width="16" height="16" />站群共享内容&nbsp;</a>
										</li>
										<li id="two3" onclick="setTab(3)">
											<a href="javascript:;"><img src="../style/blue/icon/channel_document.png" width="16" height="16" />个人稿件库&nbsp;</a>
										</li>

									</ul>
								</div>

								<div class="auntion_tagRoom_Content">
									

									<!-- 第二部分:留言 -->
									<div id="g3_two_1" class="auntion_Room_C_imglist" style="display:;">

										<ul>
											<li>
												<table width="99.5%" border="0" cellspacing="0" cellpadding="0" class="mainbody-x">
													<tr>
														<td class="mainbody" align="left" valign="top">
															<!--main start-->
															<table class="listtable" width="99.8%" border="0" cellpadding="0" cellspacing="0">

																<tr>
																	<td style="padding: 6px 10px;" class="">
																		<div class="fl">
																			留言板
																			<select id="configFlag" onchange="javascript:changeFilter(this.value)" class="form-select">
																				<%--<option value="-1">
																					所有留言板 &nbsp;&nbsp;&nbsp;
																				</option>
																				--%>
																				<cms:SystemGbConfig configId="all">
																					<option value="${GbCfg.cfgFlag}">
																						${GbCfg.cfgName}&nbsp;&nbsp;&nbsp;
																					</option>
																				</cms:SystemGbConfig>
																				<cms:Empty flag="GbCfg">
																					<option value="-1">
																						无留言板&nbsp;&nbsp;&nbsp;
																					</option>
																				</cms:Empty>
																			</select>
																			&nbsp;
																			<select id="isReply" onchange="javascript:changeFilter(this.value)" class="form-select">
																				<option value="">
																					回复状态 &nbsp;&nbsp;&nbsp;
																				</option>
																				<option value="1">
																					已经回复
																				</option>
																				<option value="0">
																					未回复 &nbsp;&nbsp;&nbsp;
																				</option>

																			</select>
																			<select id="isCensor" onchange="javascript:changeFilter(this.value)" class="form-select">
																				<option value="">
																					审核状态 &nbsp;&nbsp;&nbsp;
																				</option>

																				<option value="1">
																					通过审核
																				</option>
																				<option value="0">
																					未通过
																				</option>
																			</select>


																			<select id="isOpen" onchange="javascript:changeFilter(this.value)" class="form-select">
																				<option value="">
																					公开状态 &nbsp;&nbsp;&nbsp;
																				</option>

																				<option value="1">
																					公开的
																				</option>
																				<option value="0">
																					不公开
																				</option>
																			</select>
																		</div>

																		<div>
																		</div>
																		<div class="fr">
																			<a href="javascript:changeGbInfoStatus('censor','1');" class="btnwithico"> <img src="../style/icons/flag-blue.png" alt="" /><b>通过&nbsp;</b> </a>
																			<a href="javascript:changeGbInfoStatus('censor','0');" class="btnwithico"> <img src="../style/icons/flag-white.png" alt="" /><b>不通过&nbsp;</b> </a>

																			<a href="javascript:changeGbInfoStatus('open','1');" class="btnwithico"> <img src="../../core/style/icons/light-bulb.png" alt="" /><b>公开&nbsp;</b> </a>
																			<a href="javascript:changeGbInfoStatus('open','0');" class="btnwithico"> <img src="../../core/style/icons/light-bulb-off.png" alt="" /><b>不公开&nbsp;</b> </a>
																			<a href="javascript:deleteGuestbook(null);" class="btnwithico"> <img src="../../core/style/default/images/doc_delete.png" alt="" /><b>删除&nbsp;</b> </a>
																		</div>
																	</td>
																<tr>
																	<td id="uid_td25" style="padding: 2px 6px;">
																		<div class="DataGrid">

																			<table id="showlist2" class="listdate" width="100%" cellpadding="0" cellspacing="0">

																				<tr class="datahead">
																					<td width="3%" height="30">
																						<strong>ID</strong>
																					</td>
																					<td width="2%" height="30">
																						<input type="checkbox" onclick="javascript:selectAll('checkIds',this);" />
																					</td>
																					<td width="28%">
																						<strong>留言标题</strong>
																					</td>

																					<td width="10%">
																						<strong>留言人</strong>
																					</td>
										
																					<td width="6%">
																						<strong>回复状态</strong>
																					</td>

																					<td width="7%">
																						<center>
																							<strong>维护</strong>
																						</center>
																					</td>
																				</tr>

																				<cms:SystemGbInfo configFlag="${param.configFlag}" isOpen="${param.isOpen}" isReply="${param.isReply}" isCensor="${param.isCensor}" pageSize="9">
																					<tr>
																						<td>
																							${GbInfo.gbId}
																						</td>
																						<td>
																							<input type="checkbox" name="checkIds" value="${GbInfo.gbId}" />
																						</td>

																						<td>
																							<cms:if test="${GbInfo.gbTitle!=null && GbInfo.gbTitle!=''}">
																								<a href="javascript:openEditGuestbookDialog('${GbInfo.configFlag}','${GbInfo.configId}','${GbInfo.gbId}')"> <font style="color:#454545"><cms:SubString len="123" tail=" ......" str="${GbInfo.gbTitle}" /> </font> </a>
																							</cms:if>
																							<cms:else>
																								<a href="javascript:openEditGuestbookDialog('${GbInfo.configFlag}','${GbInfo.configId}','${GbInfo.gbId}')"> <font style="color:#454545"><cms:SubString len="123" tail=" ......" str="${GbInfo.gbText}" /> </font> </a>
																							</cms:else>
																						</td>

																						<td>
																							${GbInfo.gbMan}
																						</td>

																						<td>
																							<cms:if test="${GbInfo.isReply==1}">
																										<img src="../style/icon/tick.png" />
																							</cms:if>
																							<cms:else>
																										<img src="../style/icon/del.gif" />
																							</cms:else>
																						</td>

																						<td>

																							<center>
																								<span><img src="../../core/style/icons/card-address.png" width="16" height="16" /><a href="javascript:openEditGuestbookDialog('${GbInfo.configFlag}','${GbInfo.configId}','${GbInfo.gbId}')">&nbsp;回复</a>&nbsp;&nbsp;&nbsp;<img src="../../core/style/default/images/del.gif" width="16" height="16" /><a href="javascript:deleteGuestbook('${GbInfo.gbId}');">删除 </a>&nbsp;</span>
																							</center>

																						</td>

																					</tr>
																				</cms:SystemGbInfo>

																				<cms:Empty flag="GbInfo">
																					<tr>
																						<td class="tdbgyew" colspan="6">
																							<center>
																								当前没有数据!
																							</center>
																						</td>
																					</tr>
																				</cms:Empty>

																				<tr id="pageBarTr">
																					<cms:PageInfo>
																						<td colspan="8" class="PageBar" align="left">
																							<div class="fr">
																								<span class="text_m"> 共 ${Page.totalCount} 条记录 第${Page.currentPage}页 / ${Page.pageCount}页 <input type="text" size="5" id="pageJumpPosGb" /> <input type="button" name="goto" value="GOTO" onclick="javascript:jumpGb()" /> </span>
																								<span class="page">[<a href="javascript:pageGb('f')">首页</a>]</span>
																								<span class="page">[<a href="javascript:pageGb('p')">上一页</a>]</span>
																								<span class="page">[<a href="javascript:pageGb('n')">下一页</a>]</span>
																								<span class="page">[<a href="javascript:pageGb('l')">末页</a>]</span> &nbsp;
																							</div>

																							<script>
														
																								function pageGb(flag)
																								{
																									if('n'==flag)
																									{
																										window.location='Workbench.jsp?configFlag=${param.configFlag}&isOpen=${param.isOpen}&isReply=${param.isReply}&isCensor=${param.isCensor}&pn=${Page.currentPage+1}&tab=1';
																									}
																									else if('p'==flag)
																									{
																										window.location='Workbench.jsp?configFlag=${param.configFlag}&isOpen=${param.isOpen}&isReply=${param.isReply}&isCensor=${param.isCensor}&pn=${Page.currentPage-1}&tab=1';
																									}
																									else if('f'==flag)
																									{
																										window.location='Workbench.jsp?configFlag=${param.configFlag}&isOpen=${param.isOpen}&isReply=${param.isReply}&isCensor=${param.isCensor}&pn=1&tab=1';
																									}
																									else if('l'==flag)
																									{
																										window.location='Workbench.jsp?configFlag=${param.configFlag}&isOpen=${param.isOpen}&isReply=${param.isReply}&isCensor=${param.isCensor}&pn=${Page.currentPage-1}&tab=1';
																									}
																								}
																								
																								function jumpGb()
																								{
																									replaceUrlParam(window.location,'configFlag=${param.configFlag}&isOpen=${param.isOpen}&isReply=${param.isReply}&isCensor=${param.isCensor}&tab=1&pn='+document.getElementById('pageJumpPosGb').value);
																								}
																							</script>
																							<div class="fl"></div>
																					</cms:PageInfo>
																					</td>
																				</tr>

																			</table>
																			<div class="mainbody-right"></div>
																		</div>

																	</td>
																</tr>

															</table>

														</td>
													</tr>

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

									<!-- 第三部分:站群共享 -->
									<div id="g3_two_2" class="auntion_Room_C_imglist" style="display:none;">

										<ul>
											<li>
												<table width="99.5%" border="0" cellspacing="0" cellpadding="0" class="mainbody-x">
													<tr>
														<td class="mainbody" align="left" valign="top">
															<!--main start-->
															<table class="listtable" width="99.8%" border="0" cellpadding="0" cellspacing="0">

																<tr>
																	<td style="padding: 6px 10px;" class="">
																		<div class="fl">
																			内容模型:&nbsp;
																			<select id="shareModelId" class="class-form" onchange="javascript:changeFilterShare();">
																				<option>
																					------ 所有模型 ------
																				</option>
																				<cms:SystemDataModelList modelType="2">
																					<cms:SystemDataModel>
																						<option value="${DataModel.dataModelId}">
																							${DataModel.modelName}&nbsp;
																						</option>
																					</cms:SystemDataModel>
																				</cms:SystemDataModelList>

																			</select>
																			&nbsp;

																		</div>
																		<div>
																			<a href="javascript:openShareContentToSiteClassDialog('','${param.modelId}','','');" " class="btnwithico" onclick=""><img src="../style/icons/document-export.png" width="16" height="16" /><b>投送到本站栏目&nbsp;</b> </a>
																			<a href="javascript:deleteShareContent();" class="btnwithico" onclick=""><img src="../style/default/images/del.gif" width="16" height="16" /><b>删除&nbsp;</b> </a>

																		</div>
																		<div class="fr">

																		</div>
																	</td>
																</tr>

																<tr>
																	<td id="uid_td25" style="padding: 2px 6px;">
																		<div class="DataGrid">
																			<table id="showlist3" class="listdate" width="100%" cellpadding="0" cellspacing="0">

																				<tr class="datahead">

																					<td width="3%">
																						<strong>ID</strong>
																					</td>

																					<td width="2%">
																						<input class="inputCheckbox" value="*" type="checkbox" onclick="javascript:selectAll('checkShareId',this);" />
																					</td>
																					<td width="24%">
																						<strong>标题</strong>
																					</td>


																					<td width="9%">
																						<strong>来源站点</strong>
																					</td>
																					<td width="9%">
																						<strong>内容模型</strong>
																					</td>


																					<td width="5%">
																						<center>
																							<strong>操作</strong>
																						</center>
																					</td>
																				</tr>

																				<cms:CurrentSite>
																					<cms:QueryData service="cn.com.mjsoft.cms.content.service.ContentService" method="getShareContentForSiteQueryTag" objName="ShareInfo" var="${param.modelId},${param.pn},12">

																						<tr>
																							<td>
																								${ShareInfo.contentId}
																							</td>
																							<td>
																								<input class="inputCheckbox" name="checkShareId" value="${ShareInfo.contentId}" type="checkbox" onclick="javascript:" />
																							</td>
																							<td>
																								&nbsp;${ShareInfo.title}
																							</td>
																							<td>
																							
																								<cms:Site siteId="${ShareInfo.fromSiteId}">
																								${Site.siteName}
																							</cms:Site>
																							</td>
																							<td>
																							
																							
																								<cms:Model id="${ShareInfo.modelId}">
																								   ${Model.modelName}
																								</cms:Model>
																							 
																							</td>


																							<td>
																								<center>
																									<a href="javascript:openShareContentToSiteClassDialog('','${ShareInfo.modelId}','','${ShareInfo.contentId}');"><img src="../../core/style/icons/card-address.png" width="16" height="16" />&nbsp;投送</a>
																								</center>
																							</td>
																						</tr>

																					</cms:QueryData>
																					<cms:Empty flag="ShareInfo">
																						<tr>
																							<td class="tdbgyew" colspan="7">
																								<center>
																									当前没有数据!
																								</center>
																							</td>
																						</tr>
																					</cms:Empty>
																				</cms:CurrentSite>

																				<tr id="pageBarTr">
																					<cms:PageInfo>
																						<td colspan="8" class="PageBar" align="left">
																							<div class="fr">
																								<span class="text_m"> 共 ${Page.totalCount} 条记录 第${Page.currentPage}页 / ${Page.pageCount}页 <input type="text" size="5" id="pageJumpPosSc" /> <input type="button" name="goto" value="GOTO" onclick="javascript:jumpSc()" /> </span>
																								<span class="page">[<a href="javascript:pageSc('f')">首页</a>]</span>
																								<span class="page">[<a href="javascript:pageSc('p')">上一页</a>]</span>
																								<span class="page">[<a href="javascript:pageSc('n')">下一页</a>]</span>
																								<span class="page">[<a href="javascript:pageSc('l')">末页</a>]</span> &nbsp;
																							</div>

																							<script>
																							initSelect('shareModelId','${param.modelId}');
																							
																							function pageSc(flag)
																							{
																								if('n'==flag)
																								{
																									window.location='Workbench.jsp?isReply=0&modelId=${param.modelId}&pn=${Page.currentPage+1}&tab=2';
																								}
																								else if('p'==flag)
																								{
																									window.location='Workbench.jsp?isReply=0&modelId=${param.modelId}&pn=${Page.currentPage-1}&tab=2';
																								}
																								else if('f'==flag)
																								{
																									window.location='Workbench.jsp?isReply=0&modelId=${param.modelId}&pn=1&tab=2';
																								}
																								else if('l'==flag)
																								{
																									window.location='Workbench.jsp?isReply=0&modelId=${param.modelId}&pn=${Page.currentPage-1}&tab=2';
																								}
																							}
																							
																							function jumpSc()
																							{
																								replaceUrlParam(window.location,'isReply=0&modelId=${param.modelId}&tab=2&pn='+document.getElementById('pageJumpPosSc').value);
																							}
																						</script>
																							<div class="fl"></div>
																					</cms:PageInfo>
																					</td>
																				</tr>
																			</table>
																		</div>
																		<div class="mainbody-right"></div>
																	</td>
																</tr>


															</table>

															</form>

														</td>
													</tr>
												</table>
											</li>
										</ul>
									</div>

									<!-- 第四部分:个人稿件 -->
									<div id="g3_two_3" class="auntion_Room_C_imglist" style="display:none;">
										<ul>
											<li>
												<table width="99.5%" border="0" cellspacing="0" cellpadding="0" class="mainbody-x">
													<tr>
														<td class="mainbody" align="left" valign="top">
															<!--main start-->
															<table class="listtable" width="99.8%" border="0" cellpadding="0" cellspacing="0">

																<tr>
																	<td style="padding: 6px 10px;" class="">
																		<div class="fl">
																			所属栏目:&nbsp;
																			<select id="dClassId" name="dClassId" class="class-form" onchange="javascript:changeFilterDraft();">
																				<option>
																					---------- 所有栏目稿件 ----------
																				</option>
																				<cms:SystemClassList site="${CurrSite.siteFlag}" type="all">
																					<cms:SysClass>
																						<option value="${Class.classId}">
																							${Class.layerUIBlankClassName}
																						</option>
																					</cms:SysClass>
																				</cms:SystemClassList>
																			</select>
																			&nbsp;
																		</div>
																		<div>
																			<a href="javascript:deleteSelectContent();" class="btnwithico"><img src="../style/default/images/del.gif" width="16" height="16" /><b>删除稿件&nbsp;</b> </a>

																		</div>
																		<div class="fr">

																		</div>
																	</td>
																</tr>

																<tr>
																	<td id="uid_td25" style="padding: 2px 6px;">
																		<div class="DataGrid">
																			<table id="showlist4" class="listdate" width="100%" cellpadding="0" cellspacing="0">

																				<tr class="datahead">

																					<td width="4%">
																						<strong>ID</strong>
																					</td>

																					<td width="2%">
																						<input class="inputCheckbox"  type="checkbox" onclick="javascript:selectAll('checkedDId',this);" />
																					</td>
																					<td width="25%">
																						<strong>标题</strong>
																					</td>

																					<td width="9%">
																						<strong>所属栏目</strong>
																					</td>

																					<td width="9%">
																						<strong>数据模型</strong>
																					</td>


																					<td width="9%">
																						<center>
																							<strong>操作</strong>
																						</center>
																					</td>
																				</tr>

																				<cms:QueryData service="cn.com.mjsoft.cms.content.service.ContentService" method="getDraftContentForSiteQueryTag" objName="DInfo" var="${param.dClassId},${param.pn},12">

																					<tr>
																						<td>
																							${DInfo.contentId}
																						</td>
																						<td>
																							<input class="inputCheckbox" id="checkedDId" name="checkedDId" value="${DInfo.contentId}" type="checkbox" onclick="javascript:" />
																						</td>
																						<td>
																							${DInfo.title}
																						</td>
																						<td>
																							<cms:SysClass id="${DInfo.classId}">
																								${Class.className}				
																							</cms:SysClass>
																						</td>
																						<td>
																							<cms:SystemDataModel id="${DInfo.modelId}">
																									${DataModel.modelName}					
																							</cms:SystemDataModel>
																						</td>

																						<td>
																							<div>
																								<center>
																									<img src="../../core/style/icons/card-address.png" width="16" height="16" />
																									<a href="javascript:gotoEditUserDefineContentPage('${DInfo.contentId}','${DInfo.classId}','${DInfo.modelId}','${DInfo.creator}','${DInfo.censorState}');">&nbsp;处理稿件</a>&nbsp; &nbsp;
																									<img src="../../core/style/default/images/del.gif" width="16" height="16" />
																									<a href="javascript:javascript:deleteContent('${DInfo.modelId}','${DInfo.contentId}','${DInfo.creator}','${DInfo.censorState}');">删除 </a>&nbsp;&nbsp;&nbsp;
																								</center>
																							</div>
																						</td>
																					</tr>


																				</cms:QueryData>

																				<cms:Empty flag="DInfo">
																					<tr>
																						<td class="tdbgyew" colspan="8">
																							<center>
																								当前没有数据!
																							</center>
																						</td>
																					</tr>
																				</cms:Empty>



																				<cms:PageInfo>
																					<tr id="pageBarTr">
																						<td colspan="8" class="PageBar" align="left">
																							<div class="fr">
																								<span class="text_m"> 共 ${Page.totalCount} 行记录 第${Page.currentPage}页 / ${Page.pageCount}页 <input type="text" size="4" id="pageJumpPos" name="pageJumpPos" /> <input type="button" name="goto" value="GOTO" onclick="javascript:jump()" /> </span>
																								<span class="page">[<a href="javascript:query('h');">首页</a>]</span>
																								<span class="page">[<a href="javascript:query('p');">上一页</a>]</span>
																								<span class="page">[<a href="javascript:query('n');">下一页</a>]</span>
																								<span class="page">[<a href="javascript:query('l');">末页</a>]</span>&nbsp;
																							</div>
																							<script>
																										function query(flag)
																										{
																											var cp = 0;
																											
																											if('p' == flag)
																											{
													                                                             cp = parseInt('${Page.currentPage-1}');
																											}
												
																											if('n' == flag)
																											{
													                                                             cp = parseInt('${Page.currentPage+1}');
																											}
												
																											if('h' == flag)
																											{
													                                                             cp = 1;
																											}
												
																											if('l' == flag)
																											{
													                                                             cp = parseInt('${Page.pageCount}');
																											}
												
																											if(cp < 1)
																											{
													                                                           cp=1;
																											}
																										
																											
																											replaceUrlParam(window.location,'isReply=0&tab=4&pn='+cp);		
																										}
																							
																							
																										function jump()
																										{
																											replaceUrlParam(window.location,'isReply=0&tab=4&pn='+document.getElementById('pageJumpPos').value);
																										}
																								</script>
																							<div class="fl"></div>
																						</td>
																					</tr>
																				</cms:PageInfo>
																			</table>
																		</div>
																		<div class="mainbody-right"></div>
																	</td>
																</tr>


															</table>

															</form>

														</td>
													</tr>
												</table>
											</li>
										</ul>
									</div>

								</div>
							</center>
						</td>
					</tr>
				</table>

				<!-- hidden -->


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

if('${param.tab}' != '' && '${param.tab}' != null)
{
	setTab('${param.tab}');
}

function setTab(tab)
{
	setTab2('two',tab,3)
}

//initSelect('auditFilter','${param.filterBy}');






var currentSelectId = -1;
var currentProcessManager = ''

var currentModelId = -1;
var currentClassId = -1;





/****************  以下留言区域   ***************/
initSelect('configFlag','${param.configFlag}');
initSelect('isOpen','${param.isOpen}');
initSelect('isReply','${param.isReply}');
initSelect('isCensor','${param.isCensor}');

function openEditGuestbookDialog(configFlag,cfgId,gbId)
{
	$.dialog({ 
	    id : 'oegbd',
    	title : '留言回复',
    	width: '800px', 
    	height: '550px',
    	lock: true, 
    	max: false,
        min: false,
        resize: false,
        
        content: 'url:<cms:Domain/>/core/guestbook/ReplyAndEditGuestbook.jsp?configFlag='+document.getElementById('configFlag').value+"&gbId="+gbId+"&configId="+cfgId
	});
}


function changeGbInfoStatus(action,flag)
{
	var ids = document.getElementsByName('checkIds');
		
	var idArray = new Array();
	for(var i = 0; i < ids.length; i++)
	{
		if(ids[i].checked == true)
		{
			idArray.push(ids[i].value);
		}
	}
	
	var id = idArray.join(',');

	if(id == null || id == '')
	{
	
		$.dialog
		(
	  		{ 
				title :'提示',
			    width: '130px', 
				height: '60px', 
				lock: true, 
				icon: '32X32/i.png', 
									    				
				content: "没有选择留言",
							
				cancel: true
			}
		);	
		return;							  
	}
	
	
	$.dialog({ 
   					title :'提示',
    				width: '165px', 
    				height: '60px', 
                    lock: true, 
    				icon: '32X32/i.png', 
    				
                    content: '您确认改变留言状态吗？',
                    
                    ok: function () {
           				var url = "<cms:BasePath/>guestbook/changeStatus.cmd?action="+action+"&flag="+flag+'&id='+id;
 		
				 		$.ajax({
				      		type: "POST",
				       		url: url,
				       		data:'',
				   
				       		success: function(msg)
				            {     
				               if('success' == msg)
				               {
				               		//showMsg('留言状态改动成功!');
				               		window.location.reload();
				               		//W.$.dialog.tips('留言状态改动成功...',1); 
				               		
				               		//$('#censorStatus').html('asdsad');
				               } 	
				               else
				               {
				               	    showMsg('改动失败!');
				               }   
				              
				            }
				     	});	
       
    
    				}, 
    				cancel: true 
    });
	
	
}


function deleteGuestbook(id)
{
	if(id == null)
	{
		var ids = document.getElementsByName('checkIds');
		
		var idArray = new Array();
		for(var i = 0; i < ids.length; i++)
		{
			if(ids[i].checked == true)
			{
				idArray.push(ids[i].value);
			}
		}
		id = idArray.join(',');
	}
	
	
	if(id == null || id == '')
	{
	
		$.dialog
		(
	  		{ 
				title :'提示',
			    width: '130px', 
				height: '60px', 
				lock: true, 
				icon: '32X32/i.png', 
									    				
				content: "没有选择留言",
							
				cancel: true
			}
		);	
		return;							  
	}
	
	
	$.dialog({ 
   					title :'提示',
    				width: '160px', 
    				height: '60px', 
                    lock: true, 
    				icon: '32X32/i.png', 
    				
                    content: '您确认删除所选留言吗？',
                    
                    ok: function () {
           				var url = "../../guestbook/deleteGb.cmd?id="+id+"&cfgFlag="+$('#configFlag').val();
 		
				 		$.ajax({
				      		type: "POST",
				       		url: url,
				       		data:'',
				   
				       		success: function(msg)
				            {        
				            	if('success' == msg)
				            	{ 
									replaceUrlParam(window.location, 'isReply=0&tab=1');
				            	}
				            	else
				            	{
				            		$.dialog(
								    { 
								   					title :'提示',
								    				width: '165px', 
								    				height: '60px', 
								                    lock: true, 
								    				icon: '32X32/fail.png', 
								    				
								                    content: "删除失败，请联系管理员！",
						
								    				cancel: true
									});
				            	}
				            	
				             
				            }
				     	});	 
       
    
    				}, 
    				cancel: true 
    });
}



//共享内容


function deleteShareContent()
{
	var ids= '';
	
	var cidCheck = document.getElementsByName('checkShareId');
			 
	for(var i=0; i<cidCheck.length;i++)
	{
				if(cidCheck[i].checked)
				{
					ids += cidCheck[i].value+',';
				}
	}
			 
	if('' == ids)
	{
			   $.dialog({ 
		   					title :'提示',
		    				width: '180px', 
		    				height: '60px', 
		                    lock: true, 
		    				icon: '32X32/i.png', 
		    				
		                    content: '请选择需要删除的共享内容！', 
		       				cancel: true 
			  });
			  return;
	}			
		
		var url = "<cms:BasePath/>content/deleteShareContent.cmd?ids="+ids;
	 			
	 	$.ajax({
	      	type: "POST",
	       	url: url,
	       	data:'',
	       	
	       	success: function(msg)
	        {
	        	if(msg.indexOf('您没有操作权限!') != -1)
	        	{
	        					$.dialog(
							   { 
								   					title :'提示',
								    				width: '200px', 
								    				height: '60px', 
								                    lock: true, 
								                     
								    				icon: '32X32/fail.png', 
								    				
								                    content: "执行失败，无权限请联系管理员！",
						
								    				cancel: true
								});
								
								return;
	        	
	        	
	        	} 
	        
	               
	        	if('' != msg)
	        	{
	        		$.dialog({ 
	   					title :'提示',
	    				width: '160px', 
	    				height: '60px', 
	                    lock: true, 
	    				icon: '32X32/succ.png', 
	    				
	                    content: '删除成功！', 
	       				ok: function(){ 
      						replaceUrlParam(window.location, 'isReply=0&tab=3');
    					} 
		  			});
		  			
	        	}
	        	else
	        	{
	        					$.dialog(
							   { 
								   					title :'提示',
								    				width: '200px', 
								    				height: '60px', 
								                    lock: true, 
								                     
								    				icon: '32X32/fail.png', 
								    				
								                    content: "删除操作失败！",
						
								    				cancel: true
								});
	        	
	        	
	        	}
	        }
	     });	
    

}



function changeFilter()
{
	var configFlag = document.getElementById('configFlag').value;
	var isOpen = document.getElementById('isOpen').value;
	var isReply = document.getElementById('isReply').value;
	var isCensor= document.getElementById('isCensor').value;
	
	window.location.href = 'Workbench.jsp?configFlag='+configFlag+'&isOpen='+isOpen+'&isReply='+isReply+'&isCensor='+isCensor+'&tab=1';	
}

function openShareContentToSiteClassDialog(flag, modelId, refClassIdStr, cid)
{
	if(cid == '' && ('-1' == modelId || '' == modelId))
	{		
		 $.dialog({ 
		   					title :'提示',
		    				width: '180px', 
		    				height: '60px', 
		                    lock: true, 
		    				icon: '32X32/i.png', 
		    				
		                    content: '请指定一个内容模型！', 
		       				cancel: true 
		});
	    return;
	}
	
	var ids= '';
	
	if(cid != '')
	{
		ids = cid;
	}
	else
	{
		var cidCheck = document.getElementsByName('checkShareId');
				
		for(var i=0; i<cidCheck.length;i++)
		{
					if(cidCheck[i].checked)
					{
						ids += cidCheck[i].value+',';
					}
		}
				
		if('' == ids)
		{
				   $.dialog({ 
			   					title :'提示',
			    				width: '180px', 
			    				height: '60px', 
			                    lock: true, 
			    				icon: '32X32/i.png', 
			    				
			                    content: '请选择需要投送的共享内容！', 
			       				cancel: true 
				  });
				  return;
		}
	}
	
	$.dialog({ 
	    id : 'osctcd',
    	title : '投送内容至栏目',
    	width: '400px', 
    	height: '500px', 
    	lock: true, 
        max: false, 
        min: false,
        resize: false,
       
        content: 'url:'+basePath+'core/content/dialog/ShowShareContentClass.jsp?uid='+Math.random()+'&cid='+ids+'&modelId='+modelId+'&refClassIdStr='+refClassIdStr+'&flag='+flag
	});
}



function changeFilterShare()
{
	var shareModelId = document.getElementById('shareModelId').value;
	
	
	replaceUrlParam(window.location,'modelId='+shareModelId+'&tab=3');
}

//稿件区域

initSelect('dClassId','${param.dClassId}');

function changeFilterDraft()
{
	var dClassId = document.getElementById('dClassId').value;
	
	
	replaceUrlParam(window.location,'dClassId='+dClassId+'&tab=4');
}

function gotoEditUserDefineContentPage(contentId, classId, modelId, creator, censor)
{
	<cms:LoginUser>
		var currentManager = '${Auth.apellation}';
	</cms:LoginUser>
	
	if(censor == '-1' && creator != currentManager)
	{
		var dialog = $.dialog({ 
   					title :'提示',
    				width: '160px', 
    				height: '60px', 
                    lock: true, 
    				icon: '32X32/i.png', 
    				
                    content: '只能处理自己的稿件！',
                                      
       cancel: true 
                    
	   });
       return;
	}


	window.location.href="<cms:BasePath/>core/content/EditUserDefineModelContent.jsp?fromDraft=true&pn=${param.pn}&dClassId="+classId+"&contentId="+contentId+"&classId="+classId+"&modelId="+modelId+"&uid="+Math.random();
}


function deleteSelectContent()
{
	var cidCheck = document.getElementsByName('checkedDId');
	
	var ids='';
	for(var i=0; i<cidCheck.length;i++)
	{
		if(cidCheck[i].checked)
		{
			ids += cidCheck[i].value+',';
		}
	}
	
	if('' == ids)
	{
	   $.dialog({ 
   					title :'提示',
    				width: '160px', 
    				height: '60px', 
                    lock: true, 
    				icon: '32X32/i.png', 
    				
                    content: '请选择要删除的内容！', 
       cancel: true 
                    
	
	  });
	  return;
	}
	
	deleteContent('',ids);

}




function deleteContent(modelId,ids, creator, censor)
{
	<cms:LoginUser>
		var currentManager = '${Auth.apellation}';
	</cms:LoginUser>
	
	if(censor == '-1' && creator != currentManager)
	{
		var dialog = $.dialog({ 
   					title :'提示',
    				width: '160px', 
    				height: '60px', 
                    lock: true, 
    				icon: '32X32/i.png', 
    				
                    content: '只能处理自己的稿件！',
                                      
       cancel: true 
                    
	   });
       return;
	}


	var dialog = $.dialog({ 
   					title :'提示',
    				width: '160px', 
    				height: '60px', 
                    lock: true, 
    				icon: '32X32/i.png', 
    				
                    content: '您确认删除所选内容吗？',
                    
                    ok: function () 
                    { 
                    
                    //var url = "<cms:BasePath/>content/deleteContent.cmd?ids="+ids+"&modelId="+modelId;
                    var url = "<cms:BasePath/>content/deleteMySelfSiteContentToTrash.cmd?ids="+ids+"&modelId="+modelId;
                    
 		
 					//$("#content").val(text);
					//var postData = encodeURI($("#replyText,#configFlag,#gbId").serialize());
 		
			 		$.ajax({
			      		type: "POST",
			       		url: url,
			       		data:'',
			   
			       		success: function(msg)
			            {     
			               if('success' == msg)
			               {
			               		//showMsg('回复留言成功!');
			               		//W.$.dialog.tips('删除内容成功...',1); 
			               		
			               		replaceUrlParam(window.location, 'isReply=0&tab=4');
			               } 	
			               else
			               {
			               		$.dialog(
							   { 
								   					title :'提示',
								    				width: '200px', 
								    				height: '60px', 
								                    lock: true, 
								                     
								    				icon: '32X32/fail.png', 
								    				
								                    content: "执行失败，无权限请联系管理员！",
						
								    				cancel: true
								});
			               	     
			               }   
			              
			            }
			     	});	
       
       
    				}, 
    				cancel: true 
   	});
}





</script>

</cms:CurrentSite>
