<%@ Page Language="C#" AutoEventWireup="true" Inherits="System_Label_SetSpecial, QianboCMS" EnableEventValidation="false" %>
<!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 runat="server">
<title>专题参数设置</title>
<link rel="stylesheet" href="../Css/layout.css" type="text/css" />
<script type="text/javascript" src="../../Js/jquery.js"></script>
<script type="text/javascript" src="../../Js/lhgdialog/lhgdialog.min.js?self=true"></script>
<script language="javascript" src="../../Js/Common.js" type="text/javascript"></script>
<script type="text/javascript">
var api = frameElement.api, W = api.opener, D = W.document;
</script>
<script language="javascript" type="text/javascript">
function SwitchList()
{
    window.location.href=document.form1.selectList.value;
}
function showHidenTop()
{
    if($("chkIsPage").checked==false)
    {
        ultimateList.style.display="";
    }
    else
    {
        ultimateList.style.display="none";
        $("txtArticleCount").value="0";
    }
}
function ControlStyle()
{
    if($("selShowStyle").value=="out_table")
    {
        trStyle1.style.display="none";
        trStyle2.style.display="none";
    }
    else
    {
        trStyle1.style.display="";
        trStyle2.style.display="";
    }
}
function CreateSqecialList()
{
    values="{$Qianbo id=\"special_infolist\" ";
    values=values+"spid=\""+$("ddlSpecial").value+"\" ";
    if($("chkIsSqecail").checked==true)
    values=values+"includesub=\"true\" ";
    else
    values=values+"includesub=\"false\" ";
    if($("chkIsPage").checked==true)
    {
        values=values+"padding=\"true\" ";
        values=values+"paddingstyle=\""+$("txtPageStyle").value+"\" ";
        values=values+"pagesize=\""+$("txtPageSize").value+"\" ";
        values=values+"paddingcss=\""+$("txtPageCss").value+"\" ";
        values=values+"pagenav=\""+$("txtPageNav").value+"\" "
    }
    else
    {
        values=values+"padding=\"false\" ";
    }
    values=values+"liststyle=\""+$("ddlStyle").value+"\" ";
    values=values+"cellcount=\""+$("selNewsColumn").value+"\" ";
    values=values+"showstyle=\""+$("selShowStyle").value+"\" ";
    values=values+"dateformat=\""+$("txtDateFormat").value+"\" "
    values=values+"infocount=\""+$("txtArticleCount").value+"\" ";
    values=values+"daterange=\""+$("txtDateRange").value+"\" ";
    values=values+"order=\""+$("selectOrder").value+"\" ";
    values=values+"titlelength=\""+$("txtTitleCount").value+"\" ";
    if($("txtNewsRows").value=="0")
    {
        values=values+"rowcount=\"\" ";
        values=values+"compart=\"\" /}";
    }
    else
    {
        values=values+"rowcount=\""+$("txtNewsRows").value+"\" ";
        values=values+"compart=\""+$("txtCompart").value+"\" /}";
    }
    D.all.lblContent.focus();
    if(D.selection)
    {
        var reange=D.selection.createRange();
        reange.text=values;
    }
    api.close();
}
function FunShoHIdComp()
{
    if($("selNewsColumn").value!="1")
    trCom.style.display="none";
    else
    trCom.style.display="";
}
function setPageStyle()
{
    $('txtPageNav').focus();
    if (D.selection)
    {
        var range= D.selection.createRange();
        if(D.selection)
        {
            var reange=D.selection.createRange();
            reange.text="{@page_nav}";
        }
    }
}
</script>
</head>

<body onload="showHidenTop()">
<form id="form1" runat="server">
  <div>
    <table width="99%" cellspacing="1" cellpadding="0" class="wzdh" align="center">
      <tr>
        <td><span style="float: left;"><strong>设置标签参数</strong></span>
          <span style="float: right;"><a href="#" onclick="javascript:api.close();">关闭</a>&nbsp;</span></td>
      </tr>
    </table>
    <table width="99%" border="0" cellpadding="2" cellspacing="1" class="border" align="center">
      <tr id="row1">
        <td class="bqleft">所属专题：</td>
        <td class="bqright"><asp:DropDownList ID="ddlSpecial" runat="server"></asp:DropDownList>
          是否包含子专题：<input id="chkIsSqecail" type="checkbox" /></td>
      </tr>
      <tr id="strNewsColumn">
        <td class="bqleft">专题列表列数：</td>
        <td class="bqright"><select id="selNewsColumn" onchange="FunShoHIdComp()">
<script language="javascript" type="text/javascript">
for(i=1;i<=5;i++)
{
    document.write("<option value="+i+">"+i+"</option>");
}
</script>
          </select></td>
      </tr>
      <tr>
        <td class="bqleft">引用内容样式：</td>
        <td class="bqright"><asp:DropDownList ID="ddlStyle" runat="server"></asp:DropDownList></td>
      </tr>
      <tr>
        <td class="bqleft">布局方式：</td>
        <td class="bqright"><select id="selShowStyle">
            <option value="out_table" selected="selected">表格</option>
            <option value="out_div">Div+Css</option>
          </select></td>
      </tr>
      <tr>
        <td class="bqleft">日期样式：</td>
        <td class="bqright"><input id="txtDateFormat" type="text" value="YY年MM月DD日" size="12" />
          格式：YYYY(4位数年份 如：2012)、MM(月)、DD(日)、HH(小时)、MI(分)、SS(秒)</td>
      </tr>
<script type="text/javascript">
var jq = jQuery.noConflict();
jQuery(function(){
    jQuery('#btnSetStyle').click(function(){
        jQuery.dialog({
            id: 'txtSetStyle',
            lock: true,
            title: '分页效果',
            content: "url:SetPage.aspx",
            width: 450,
            height: 165
        });
    });
});
</script>
      <tr>
        <td class="bqleft">是否使用分页：</td>
        <td class="bqright"><input id="chkIsPage" name="chkIsPage" type="checkbox" checked="checked" onclick="showHidenTop()" />
          分页样式
          <input id="txtPageStyle" size="1" type="text" value="1" />
          <input id="btnSetStyle" class="btn" type="button" value="设置" />
          每页数量
          <input id="txtPageSize" type="text" size="1" value="10" />
          分页Css：<input id="txtPageCss" size="50" type="text" /></td>
      </tr>
      <tr>
        <td class="bqleft">分页样式：</td>
        <td class="bqright"><textarea id="txtPageNav" rows="5" style="width: 550px;"><tr><td>{@page_nav}</td></tr></textarea>
          <br />
          <a href="#" onclick="setPageStyle()"><span style="color: #4975dc;">插入分页标签</span></a></td>
      </tr>
      <tr id="ultimateList">
        <td class="bqleft">文章数目：</td>
        <td class="bqright"><input name="txtArticleCount" id="txtArticleCount" type="text" value="0" size="3" maxlength="200" />
          <span class="tips">为0则显示所有文章</span></td>
      </tr>
      <tr>
        <td class="bqleft">日期范围：</td>
        <td class="bqright">默认最近显示
          <input type="text" value="0" size="4" maxlength="200" id="txtDateRange">
          天内的文章 <span class="tips">为0则显示所有文章</span></td>
      </tr>
      <tr>
        <td class="bqleft">排序方式：</td>
        <td class="bqright"><select name="selectOrder">
            <option value="datedesc">添加日期降序</option>
            <option value="dateasc">添加日期升序</option>
            <option value="hitasc">文章点击升序</option>
            <option value="hitdesc">文章点击降序</option>
          </select>
      </tr>
      <tr>
        <td class="bqleft">标题字数：</td>
        <td class="bqright"><input name="txtTitleCount" type="text" value="30" size="3" maxlength="200">
          <span class="tips">为0则显示完整标题</span></td>
      </tr>
      <tr id="trCom">
        <td class="bqleft">文章循环行样式：</td>
        <td class="bqright">每显示
          <input type="text" value="0" size="1" maxlength="200" id="txtNewsRows">
          行后，向循环列表中插入代码：
          <input type="text" value="&lt;hr&gt;" size="50" maxlength="200" id="txtCompart">
          <span class="tips">支持Html代码</span></td>
      </tr>
      <tr>
        <td class="bqleft"></td>
        <td class="bqright"><input id="btnSubmit" class="btn" type="button" value="确定创建此标签" onclick="CreateSqecialList()" />
          <input class="btn" type="button" value="取消" onclick="javascript:api.close();" /></td>
      </tr>
    </table>
  </div>
</form>
<br />
</body>
</html>