<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=gb2312'>
<title>栏目管理--快速创建栏目</title>
<script type="text/javascript" src="../images/js/j.js"></script>
<script type="text/javascript">
$(document).ready(function(){
    //删除按钮事件
    $("#addQuick .del").click(function() {
        $(this).parents(".repeat").remove();
    });
    //添加按钮事件
    $("#add").click(function(){
		var id = $("#addQuick tr").prevAll("tr").length + 1;
        $("#addQuick tr:eq(1)").clone(true).addClass("repeat")
			.find(".rank input")
                .attr("value",function(){return id})
				.end()
            .find(".pubinputs")
                .attr("name",function(){return this.name+id})
				.attr("id",function(){return this.id+id})
                .end()
            .appendTo($("#addQuick"));
    });

});
</script>
<script language="javascript">
function ShowHide(objname){
  var obj = document.getElementById(objname);
  if(obj.style.display == "block" || obj.style.display == "")
	   obj.style.display = "none";
  else
	   obj.style.display = "block";
}
function ShowObj(objname){
   var obj = document.getElementById(objname);
	 obj.style.display = "block";
}
function HideObj(objname){
  var obj = document.getElementById(objname);
	obj.style.display = "none";
}
</script>
<link href='img/base.css' rel='stylesheet' type='text/css'>
</head>
<body leftmargin='15' topmargin='10'>
<form name="form1" action="catalog_add.php" method="post">
  <input type="hidden" name="dopost" value="savequick" />
  <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#111111" style="BORDER-COLLAPSE: collapse">
    <tr>
      <td width="100%" height="20" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="30"><img height='14' src='img/book1.gif' width='20' /> <a href="catalog_main.php"><u>栏目管理</u></a> &gt;&gt; 批量增加栏目 </td>
          </tr>
        </table></td>
    </tr>
    <tr>
      <td width="100%" height="1" background="img/sp_bg.gif"></td>
    </tr>
  </table>
  <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td height="10"></td>
    </tr>
    <tr>
      <td height="95" align="center" bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" id="head1" cellpadding="0" style="border-bottom:1px solid #CCCCCC">
          <tr>
            <td colspan="2" bgcolor="#FFFFFF"><table width="84" border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td width="84" height="24" align="center" background="img/itemnote1.gif">&nbsp;常规选项&nbsp;</td>
                </tr>
              </table></td>
          </tr>
        </table>
        <table width="100%" border="0"  id="needset" cellspacing="0" cellpadding="0">
          <tr>
            <td height="24" bgcolor="#F3F7EA"><strong>公用参数：</strong></td>
            <td bgcolor="#F3F7EA"></td>
          </tr>
          <tr>
            <td width="150" class='bline' height="26">是否支持投稿：</td>
            <td class='bline'><input type='radio' name='issend' value='0' class='np' />
              不支持
              &nbsp;
              <input type='radio' name='issend' value='1' class='np' checked='1' />
              支持 </td>
          </tr>
          <tr>
            <td class='bline' height="26">目录保存位置：</td>
            <td class='bline'><input name="referpath" type="radio" id="truepath1" class="np" value="parent" checked='1' />
              默认HMTL目录(
              <?php
            $pardir = '{cmspath}'.$cfg_arcdir;
            if(!empty($typedir)) $pardir = $typedir.'/';
            $pardir = ereg_replace('/{1,}','/',$pardir);
            echo $pardir;
            ?>
              )
              <input name="referpath" type="radio" id="truepath2" class="np" value="cmspath" />
              CMS根目录
              <input name="nextdir" type="hidden" id="nextdir" value="<?php echo $pardir; ?>" />
            </td>
          </tr>
          <tr>
            <td class='bline' height="26">内容模型： &nbsp; </td>
            <td class='bline'><select name="channeltype" id="channeltype" style="width:200px" onChange="ParTemplet(this)">
                <?php
            foreach($channelArray as $k=>$arr)
            {
            	if($k==$channelid) echo "    <option value='{$k}' selected>{$arr['typename']}|{$arr['nid']}</option>\r\n";
              else  echo "    <option value='{$k}'>{$arr['typename']}|{$arr['nid']}</option>\r\n";
            }
            ?>
              </select>
            </td>
          </tr>
          <tr>
            <td class='bline' height="26">栏目列表选项：</td>
            <td class='bline'><input type='radio' name='isdefault' value='1' class='np' checked='1' />
              链接到默认页
              <input type='radio' name='isdefault' value='0' class='np' />
              链接到列表第一页
              <input type='radio' name='isdefault' value='-1' class='np' />
              使用动态页 </td>
          </tr>
          <tr>
            <td class='bline' height="26">默认页的名称： </td>
            <td class='bline'><input name="defaultname" type="text" value="index.html" class="pubinputs" /></td>
          </tr>
          <tr id='helpvar2' style='display:none'>
            <td height="24" bgcolor="#F3F7EA">支持变量： </td>
            <td height="24" bgcolor="#F3F7EA"> {Y}、{M}、{D} 年月日<br/>
              {timestamp} INT类型的UNIX时间戳<br/>
              {aid} 文章ID<br/>
              {pinyin} 拼音+文章ID<br/>
              {py} 拼音部首+文章ID<br/>
              {typedir} 栏目目录 <br/>
              {cc} 日期+ID混编后用转换为适合的字母 <br/>
            </td>
          </tr>
          <tr>
            <td height="26" class='bline'>文章命名规则：</td>
            <td class='bline'><input name="namerule" type="text" id="namerule" value="{typedir}/{Y}{M}{D}/{aid}.html" size="40" class="pubinputs" />
              <img src="img/help.gif" alt="帮助" width="16" height="16" border="0" style="cursor:pointer" onClick="ShowHide('helpvar2')" /> </td>
          </tr>
          <tr id='helpvar3' style='display:none'>
            <td height="24" bgcolor="#F3F7EA">支持变量： </td>
            <td bgcolor="#F3F7EA">{page} 列表的页码</td>
          </tr>
          <tr>
            <td height="26">列表命名规则：</td>
            <td><input name="namerule2" type="text" id="namerule2" value="{typedir}/list_{tid}_{page}.html" size="40" class="pubinputs" />
              <img src="img/help.gif" alt="帮助" width="16" height="16" border="0" style="cursor:pointer" onClick="ShowHide('helpvar3')" /></td>
          </tr>
          <tr>
            <td height="24" bgcolor="#F3F7EA"><strong>栏目填写：</strong></td>
            <td bgcolor="#F3F7EA"></td>
          </tr>
          <tr>
            <td class='bline' colspan='2' style="padding:5px 0px 8px 0px"><table id="addQuick" width="800"  border="0" cellpadding="3" cellspacing="1" bgcolor="#D8E78F">
                <tbody>
                  <tr bgcolor="#F0FBE1">
                    <td width="50" height="28">排序</td>
                    <td width="170">顶级栏目名称</td>
                    <td width="530">子栏目(用&quot;目录名称1,目录名称2...&quot;这样表示多个栏目)</td>
                    <td width="50" align="center"><input name="" type="button" value="添加" id="add" class="coolbt"></td>
                  </tr>
                  <tr bgcolor="#FFFFFF" height="32">
                    <td class="rank"><input type="hidden" name="posttype" value="" class="pubinputs" />
                      <input type="text" name="rank" id="rank" value="1" class="pubinputs" style="width:100%;" /></td>
                    <td align='center'><input type="text" name="toptype" id="toptype" class="pubinputs" style="width:96%;" /></td>
                    <td><input type="text" name="sontype" id="sontype" class="pubinputs" style="width:100%;" /></td>
                    <td align="center"><input name="" type="button" value="删除" id="add" class="del coolbt"></td>
                  </tr>
                  <?php for($i=2;$i<=10;$i++) { ?>
                  <tr bgcolor="#FFFFFF" height="32" class="repeat">
                    <td class="rank"><input type="hidden" name="posttype<?php echo $i; ?>" value="<?php echo $i; ?>" />
                      <input type="text" name="rank<?php echo $i; ?>" id="rank<?php echo $i; ?>" value="<?php echo $i; ?>" class="pubinputs" style="width:100%;" /></td>
                    <td align='center'><input type="text" name="toptype<?php echo $i; ?>" id="toptype<?php echo $i; ?>" class="pubinputs" style="width:96%;" /></td>
                    <td><input type="text" name="sontype<?php echo $i; ?>" id="sontype<?php echo $i; ?>" class="pubinputs" style="width:100%;" /></td>
                    <td align="center"><input name="" type="button" value="删除" id="add" class="del coolbt"></td>
                  </tr>
                  <?php } ?>
                </tbody>
              </table></td>
          </tr>
        </table>
        <table width="98%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="1%" height="50"></td>
            <td width="99%" valign="bottom"><input name="imageField" type="image" src="img/button_ok.gif" width="60" height="22" border="0" class="np" />
              &nbsp;&nbsp;&nbsp; <a href="catalog_main.php"><img src="img/button_back.gif" width="60" height="22" border="0" /></a> </td>
          </tr>
        </table></td>
    </tr>
  </table>
</form>
</body>
</html>
