<!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="Content-Type" content="text/html; charset=<?php echo $cfg_soft_lang; ?>">
<title>欄目管理--快速創建欄目</title>
<script type="text/javascript" src="../include/js/jquery/jquery.js"></script>
<script type="text/javascript">
var $ = jQuery;
$(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"));
    });
    //刪除按鈕事件
    $("#addQuickRel .del").click(function() {
        $(this).parents(".repeat").remove();
    });
    //添加按鈕事件
    $("#addrel").click(function(){
		var id = $("#addQuickRel tr").prevAll("tr").length + 1;
        $("#addQuickRel 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($("#addQuickRel"));
    });
});
</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";
}
function showSeltype(objname)
{
	if(objname.value != 0)
	{
		$("#addQuickRel").show();
		$("#addQuick").hide();
		$("#savetype").val('rel');
	} else {
		$("#addQuickRel").hide();
		$("#addQuick").show();
		$("#savetype").val('');
	}
}
</script>
<link href='css/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" />
  <input type="hidden" name="savetype" value="" id="savetype"/>
  <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='images/book1.gif' width='20' />&nbsp;<a href="catalog_main.php"><u>欄目管理</u></a> &gt;&gt; 批量增加欄目 </td>
          </tr>
        </table></td>
    </tr>
    <tr>
      <td width="100%" height="1" background="images/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="left" bgcolor="#FFFFFF">
	  <table width="100%" border="0" cellspacing="0" id="head1" cellpadding="0" >
          <tr>
            <td colspan="2" bgcolor="#FFFFFF"><table width="84" border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td width="84" height="24" align="center" background="images/itemnote1.gif">&nbsp;常規選項&nbsp;</td>
                </tr>
              </table></td>
          </tr>
        </table>
        <table width="100%" border="0"  id="needset" cellspacing="0" cellpadding="0" style="border:1px solid #cfcfcf;background:#ffffff;text-align:left;">
          <tr>
            <td height="24"  bgcolor="#F9FCEF" style="padding-left:10px;"><strong>公用參數：</strong></td>
            <td  bgcolor="#F9FCEF"></td>
          </tr>
          <tr>
            <td width="150" class='bline' height="26" style="padding-left:10px;">是否支持投稿：</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" style="padding-left:10px;">目錄保存位置：</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 = preg_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" style="padding-left:10px;">隸屬欄目：</td>
           <td class='bline'>
           <select name='reid' onchange="showSeltype(this)">
           <option value='0'>選擇所屬目錄... </option>
            <?php echo $typeOptions;?>
           </select> 
           （默認為頂級欄目）
           </td>
          </tr>
          <tr>
            <td class='bline' height="26" style="padding-left:10px;">內容模型： &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" style="padding-left:10px;">欄目列表選項：</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" style="padding-left:10px;">默認頁的名稱： </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" style="padding-left:10px;">支持變量： </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' style="padding-left:10px;">文章命名規則：</td>
            <td class='bline'><input name="namerule" type="text" id="namerule" value="{typedir}/{Y}{M}{D}/{aid}.html" size="40" class="pubinputs" />
              <img src="images/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" style="padding-left:10px;">支持變量： </td>
            <td bgcolor="#F3F7EA">{page} 列表的頁碼</td>
          </tr>
          <tr>
            <td height="26" style="padding-left:10px;">列表命名規則：</td>
            <td><input name="namerule2" type="text" id="namerule2" value="{typedir}/list_{tid}_{page}.html" size="40" class="pubinputs" />
              <img src="images/help.gif" alt="幫助" width="16" height="16" border="0" style="cursor:pointer" onClick="ShowHide('helpvar3')" /></td>
          </tr>
          <tr>
            <td height="24"  bgcolor="#F9FCEF" style="padding-left:10px;"><strong>欄目填寫：</strong></td>
            <td  bgcolor="#F9FCEF"></td>
          </tr>
          <tr>
            <td colspan='2' style="padding:5px 0px 8px 10px">
			<table id="addQuick" width="800"  border="0" cellpadding="3" cellspacing="1" bgcolor="#cfcfcf">
                <tbody>
                  <tr bgcolor="#FBFCE2" align="center">
                    <td width="60" height="28">排序</td>
                    <td width="170">頂級欄目名稱</td>
                    <td width="520">子欄目(用&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"  align="center">
                    <td class="rank" style="padding:5px;"><input type="hidden" name="posttype" value="" class="pubinputs" />
                      <input type="text" name="rank" id="rank" value="1" class="pubinputs" style="width:50px;" /></td>
                    <td align='center'><input type="text" name="toptype" id="toptype" class="pubinputs" style="width:160px;" /></td>
                    <td><input type="text" name="sontype" id="sontype" class="pubinputs" style="width:480px;" /></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"  align="center">
                    <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:50px;" /></td>
                    <td align='center'><input type="text" name="toptype<?php echo $i; ?>" id="toptype<?php echo $i; ?>" class="pubinputs" style="width:160px;" /></td>
                    <td><input type="text" name="sontype<?php echo $i; ?>" id="sontype<?php echo $i; ?>" class="pubinputs" style="width:480px;" /></td>
                    <td align="center"><input name="" type="button" value="刪除" id="add" class="del coolbt"></td>
                  </tr>
                  <?php } ?>
                </tbody>
              </table>
              
              
              <table id="addQuickRel" width="302"  border="0" cellpadding="3" cellspacing="1" bgcolor="#cfcfcf" style="display:none">
                <tbody>
                  <tr bgcolor="#FBFCE2" align="center">
                    <td width="60" height="28">排序</td>
                    <td width="170">欄目名稱</td>
                    <td width="50" align="center"><input name="" type="button" value="添加" id="addrel" class="coolbt"></td>
                  </tr>
                  <tr bgcolor="#FFFFFF" height="32"  align="center">
                    <td class="rank" style="padding:5px;"><input type="hidden" name="posttype" value="" class="pubinputs" />
                      <input type="text" name="rank" id="rank" value="1" class="pubinputs" style="width:50px;" /></td>
                    <td align='center'><input type="text" name="reltype" id="reltype" class="pubinputs" style="width:160px;" /></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"  align="center">
                    <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:50px;" /></td>
                    <td align='center'><input type="text" name="reltype<?php echo $i; ?>" id="reltype<?php echo $i; ?>" class="pubinputs" style="width:160px;" /></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" bgcolor="#F9FCEF" style="border:1px solid #cfcfcf;border-top:none;">
         <tr>
            <td width="1%" height="36"></td>
            <td width="99%" valign="bottom"><input name="imageField" type="image" src="images/button_ok.gif" width="60" height="22" border="0" class="np" />
              &nbsp;&nbsp;&nbsp; <a href="catalog_main.php"><img src="images/button_back.gif" width="60" height="22" border="0" /></a> </td>
          </tr>
        </table></td>
    </tr>
  </table>
</form>
</body>
</html>
