<!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=gb2312" />
<title>
栏目管理</title>

<link rel="stylesheet" href="css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" />
<script language="javascript" src="js/jquery.min.js" type="text/javascript"></script>	
<script type="text/javascript" src="js/admin.jquery.configuration.js"></script>
<script language="javascript">
var channelArray = new Array();
<?php    
$i = 0;
foreach($channelArray as $k=>$arr){
  echo "channelArray[$k] = \"{$arr['nid']}\";\r\n";
}
?>

function Nav()
{
    if(window.navigator.userAgent.indexOf("MSIE")>=1) return 'IE';
  else if(window.navigator.userAgent.indexOf("Firefox")>=1) return 'FF';
  else return "OT";
}
    
function SelectTemplets(fname)
{
   var posLeft = 200;
   var posTop = 300;
   window.open("../include/dialog/select_templets.php?f="+fname, "poptempWin", "scrollbars=yes,resizable=yes,statebar=no,width=600,height=400,left="+posLeft+", top="+posTop);
}
  
function ShowHide(objname)
{
  var obj = document.getElementById(objname);
  if(obj.style.display != "none")
       obj.style.display = "none";
  else {
       if(Nav()=='IE') obj.style.display = "block";
       else obj.style.display = "table-row";
    }
}
  
function ShowObj(objname)
{
   var obj = document.getElementById(objname);
     if(Nav()=='IE') obj.style.display = "block";
     else obj.style.display = "table"; 
}
  
function HideObj(objname){
  var obj = document.getElementById(objname);
    obj.style.display = "none";
}
  
function ShowItem1(){
  ShowObj('head1'); ShowObj('needset');
  HideObj('head2'); HideObj('adset');
  HideObj('head3'); HideObj('ctset');
}
  
function ShowItem2(){
  ShowObj('head2'); ShowObj('adset');
  HideObj('head1'); HideObj('needset');
  HideObj('head3'); HideObj('ctset');
}

function ShowItem3(){
  ShowObj('head3'); ShowObj('ctset');
  HideObj('head1'); HideObj('needset');
  HideObj('head2'); HideObj('adset');
}
  
function CheckTypeDir()
{
  var upinyin = document.getElementById('upinyin');
  var tpobj = document.getElementById('typedir');
  if(upinyin.checked) tpobj.style.display = "none";
  else tpobj.style.display = "block";
}
  
function ParTemplet(obj)
{
  var sevvalue = channelArray[obj.value];
  var tobj = document.getElementById('smclass');
  var tempindex = document.getElementsByName('tempindex');
  var templist = document.getElementsByName('templist');
  var temparticle = document.getElementsByName('temparticle');
  var dfstyle = document.getElementsByName('dfstyle');
  var dfstyleValue = dfstyle[0].value;
  tempindex[0].value = dfstyleValue+"/index_"+sevvalue+".htm";
  templist[0].value = dfstyleValue+"/list_"+sevvalue+".htm";
  temparticle[0].value = dfstyleValue+"/article_"+sevvalue+".htm";
  if(obj.value < 0)
  {
      if(Nav()=='IE') tobj.style.display = "block";
      else tobj.style.display = "table-row";
  }
  else
  {
      tobj.style.display = "none";
  }
}
  
function checkSubmit()
{
   if(document.form1.typename.value==""){
          alert("栏目名称不能为空！");
          document.form1.typename.focus();
          return false;
     }
     return true;
}

function CheckCross()
{
    var cross2 = document.getElementById('cross2');
    var crossid = document.getElementById('crossid');
    if(cross2.checked) crossid.style.display = 'block';
    else crossid.style.display = 'none';
}

</script>
</head>
<body>
<div id="body-wrapper"> <!-- Wrapper for the radial gradient background -->
<?php include(DEDEADMIN.'/templets/menu.htm'); ?>
<script language="javascript">
$("#articles").addClass("current");$("#catalog_main").addClass("current");</script>	
			

			
			<div class="content-box"><!-- Start Content Box -->
				
				<div class="content-box-header">
					
					<h3>&nbsp;<a href="catalog_main.php"><u>栏目管理</u></a>&gt;&gt;&nbsp;增加栏目</h3>
					
					<ul class="content-box-tabs">
						<li><a href="#tab1" class="default-tab">常规选项</a></li> <!-- href must be unique and match the id of target div -->
						<li><a href="#tab2">高级选项</a></li>
                        <li><a href="#tab3">栏目内容</a></li>
					</ul>
					
					<div class="clear"></div>
					
				</div> <!-- End .content-box-header -->
				
				<div class="content-box-content">
					
  <form name="form1" action="catalog_add.php" method="post" onSubmit="return checkSubmit();">
  <input type="hidden" name="dopost" value="save" />
  <input type="hidden" name="reid" id="reid" value="<?php echo $id; ?>" />
  <input type='hidden' name='topid' id='topid' value='<?php echo $topid; ?>' />
  <?php
  if($id>0)
  {
      echo "  <input type='hidden' name='moresite' value='{$myrow['moresite']}' />\r\n";
      echo "  <input type='hidden' name='siteurl' value='{$myrow['siteurl']}' />\r\n";
      echo "  <input type='hidden' name='sitepath' value='{$myrow['sitepath']}' />\r\n";
  }
?>
					<div class="tab-content  default-tab" id="tab1">				
						
							
							<fieldset> 
                            	<p>
                                <label>是否支持投稿</label>
                               <input type='radio' name='issend' value='0' class='np' <?php if($issend==0) echo " checked='checked' ";?> />
              不支持&nbsp;
              <input type='radio' name='issend' value='1' class='np' <?php if($issend==1) echo " checked='checked' ";?> />
              支持
                                </p>
                            	<p>
                                <label>是否隐藏栏目</label>
                                 <input type='radio' name='ishidden' value='0' class='np' checked="checked" />
              显示　&nbsp;
              <input type='radio' name='ishidden' value='1' class='np' />
              隐藏 
                                </p> 
                            	<p>
                                <label>内容模型</label>
                                <select name="channeltype" id="channeltype" style="width:200px" onChange="ParTemplet(this)">
            <?php
            foreach($channelArray as $k=>$arr)
            {
                if($k==$channelid) {
                    $nid = $arr['nid'];
                    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>
                                </p>                                                                
								<p>
									<label>栏目名称</label>
									<input class="text-input medium-input" type="text" id="typename" name="typename" size="30" /> 
								</p>
								<p>
									<label>排列顺序</label>
                                    <input name="sortrank" size="6" type="text" value="50" class="text-input small-input" style="width:60px" />
              （由低 -&gt; 高） 
								</p>                                                                                       								
								<p>
									<label>浏览权限</label>
                 <select name="corank" id="corank" style="width:100px">
                <?php
              $dsql->SetQuery("Select * from `#@__arcrank` where rank >= 0");
              $dsql->Execute();
              while($row = $dsql->GetObject())
              {
                  if($corank==$row->rank) echo "<option value='".$row->rank."' selected>".$row->membername."</option>\r\n";
                        else
                        {
                            //如果上级目录的corank>0，下级必须继承
                            if($corank==0)
                            { echo "<option value='".$row->rank."'>".$row->membername."</option>\r\n"; }
                        }
              }
              ?>
              </select>
              (仅限制栏目里的文档浏览权限)                  
								</p>
								<p>
									<label>上级目录</label>
                 <?php
                    $pardir = '{cmspath}'.$cfg_arcdir;
                    if(!empty($typedir)) $pardir = $typedir.'/';
                    $pardir = preg_replace("#\/{1,}#", '/', $pardir);
                    echo $pardir;
                ?>
              <input name="nextdir" type="hidden" id="nextdir" value="<?php echo $pardir?>" />    
								</p>                                
								
								<p>
									<label>文件保存目录</label>
                                  <input name="typedir" type="text" id="typedir" class="text-input medium-input" style="width:300px">
                  
                  <input name="upinyin" type="checkbox" id="upinyin" class="np" value="1" onClick="CheckTypeDir()" />
                  拼音         
									
								</p>
								<p>
									<label>目录相对位置</label>
                                   <input name="referpath" type="radio" id="truepath1" class="np" value="parent" checked="chekced" />
              上级目录
              <?php
              if($moresite==0){
              ?>
              <input name="referpath" type="radio" id="truepath2" class="np" value="cmspath" />
              CMS根目录
              <input name="referpath" type="radio" id="truepath3" class="np" value="basepath" />
              站点根目录
              <?php } ?>
									
								</p>                                
								
								<p>
									<label>栏目列表选项</label>
									<input type='radio' name='isdefault' value='1' class='np' checked="checked" />
              链接到默认页
              <input type='radio' name='isdefault' value='0' class='np' />
              链接到列表第一页
              <input type='radio' name='isdefault' value='-1' class='np' />
              使用动态页
              使用动态页 
								</p>
								
								<p>
									<label>默认页的名称</label>
                                    <input name="defaultname" type="text" value="index.html" class="text-input medium-input" />
                                   
								</p>
								<p>
									<label>栏目属性</label>
                                     <input name="ispart" type="radio" id="radio" value="0" class='np' checked="checked"/>
              最终列表栏目（允许在本栏目发布文档，并生成文档列表） <br>
              <input name="ispart" type="radio" id="radio" value="1" class='np'/>
              频道封面（栏目本身不允许发布文档） <br>
              <input name="ispart" type="radio" id="radio" value="2" class='np'/>
              外部连接（在"文件保存目录"处填写网址）
								</p>
								<p id='helpvarco' style='display:none'>
									<label>栏目交叉说明</label>
                                    交叉栏目是指一个大栏目与另一个非下级的子栏目出现交叉的情况，相当于系统原来的副栏目功能，不过现在改在栏目里预先设置好。<br />例如：
            网站上有大栏目——智能手机、音乐手机，另外又有栏目——诺基亚-&gt;智能手机、诺基亚-&gt;音乐手机，这样顶级的大栏目就和另一个大栏目的子栏目形成了交叉，这样只需要在大栏目中指定交叉的栏目即可。
            <br />注：会自动索引交叉栏目的内容，但不会索引交叉栏目下级栏目的内容，这种应用也适用于按地区划分资讯的站点。
								</p>                                                                
								<p>
									<label>栏目交叉<img src="images/help.gif" alt="帮助" width="16" height="16" border="0" style="cursor:pointer" onClick="ShowHide('helpvarco')" /><br />仅适用[最终列表栏目]</label>
                                  <input name="cross" type="radio" id="cross0" value="0" class='np' onClick="CheckCross()" checked='1' />
                不交叉
                <input name="cross" type="radio" id="cross1" value="1" class='np' onClick="CheckCross()" />
                自动获取同名栏目内容
                <input name="cross" type="radio" id="cross2" value="2" class='np' onClick="CheckCross()" />
                手工指定交叉栏目ID(用逗号分开)
                <br />
                <textarea name="crossid" cols="50" rows="3" id="crossid" style="display:none" class="alltxt"></textarea>
								</p>                                
								
								
								
								
								<p>
									<br /><input class="button" name="imageField" type="submit" value="编辑" />
								</p>
								
							</fieldset>
							
							<div class="clear"></div><!-- End .clear -->
							
						
						
					</div> <!-- End #tab1 -->
					
					<div class="tab-content" id="tab2">
						<fieldset> 
						
							<p>
								<label>多站点支持</label>
                               <input name="moresite" type="radio"  class="np" value="0" checked="checked"/>
              不启用
              <input type="radio" name="moresite" class="np" value="1"/>
              启用
							</p>
				
							<p>
								<label>说明</label>
								绑名绑定仅需要在顶级栏目设定，子级栏目更改无效。
							</p>
							
							<p>
								<label>绑定域名</label>
								<input name="siteurl" type="text" id="siteurl" size="35" onChange="CheckPathSet();" class="text-input medium-input" />
              (需加 http://，一级或二级域名的根网址)
							</p>
							
							<p>
								<label>封面模板</label>
								<input name="tempindex" type="text" value="{style}/index_<?php echo $nid?>.htm" class="text-input medium-input" style="width:300px"/>
              <input type="button" name="set1" value="浏览..." class="coolbg np" style="width:60px" onClick="SelectTemplets('form1.tempindex');" />
              <img src="images/help.gif" alt="帮助" width="16" height="16" border="0" style="cursor:pointer" onClick="ShowHide('helpvar1')"/>
							</p>
                            
							
							<p>
								<label>列表模板</label>
                                <input name="templist" type="text" value="{style}/list_<?php echo $nid?>.htm"  class="text-input medium-input" style="width:300px" />
              <input type="button" name="set3" value="浏览... "class="coolbg np" style="width:60px" onClick="SelectTemplets('form1.templist');" />
							</p>
                            
                            
							
							<p>
								<label>文章模板</label>
								<input name="temparticle" type="text" value="{style}/article_<?php echo $nid?>.htm" class="text-input medium-input"  style="width:300px" />
              <input type="button" name="set4" value="浏览..." class="coolbg np" style="width:60px" onClick="SelectTemplets('form1.temparticle');"/>
							</p>
								
							<p>
								<label>文章命名规则</label>
                                <input name="namerule" type="text" id="namerule" value="<?php echo $cfg_df_namerule;?>" class="text-input medium-input"  style="width:250px" />
              <img src="images/help.gif" alt="帮助" width="16" height="16" border="0" style="cursor:pointer" onClick="ShowHide('helpvar2')" />
							</p>							
							
							<p>
								<label>列表命名规则</label>
								<input name="namerule2" type="text" id="namerule2" value="<?php echo $myrow['namerule2']?>" size="40" class="text-input small-input" />
							</p>
							
							<p>
								<label>SEO标题</label>
							  <input name="seotitle" type="text" style="width:250px" id="seotitle" class="text-input small-input" value="" />
                (栏目模板里用{dede:field.seotitle /}调用)
							</p>
							
						  <p>
						    <label>关键字</label>
                            <input name="keywords" type="text" style="width:250px" id="keywords" class="text-input medium-input"  />                          

							</p>
							
							<p>
								<label>栏目描述</label>
                                <textarea name="description" cols="70" style="height:50px" rows="4" id="description" class="alltxt"></textarea>
							</p>
                         							
							
							<p>
									<br /><input class="button" name="imageField" type="submit" value="编辑" />
							</p>
								
						</fieldset>
						<div class="clear"></div><!-- End .clear -->
					</div> <!-- End #tab2 -->
                    
<div class="tab-content" id="tab3">
						<fieldset> 
						
							<p>&nbsp;说明：栏目内容是替代原来栏目单独页的更灵活的一种方式，可在栏目模板中用{dede:field.content/}调用，通常用于企业简介之类的用途。  
							</p>
				
							<p>
                               <?php
                                GetEditor("content",$myrow['content'],"450","Default","print","false");
                                ?>
							</p>
							<p>
									<br /><input class="button" name="imageField" type="submit" value="编辑" />
							</p>
								
						</fieldset>
						<div class="clear"></div><!-- End .clear -->
					</div> <!-- End #tab3 -->                    
					</form>
					
				</div> <!-- End .content-box-content -->
				
			</div> <!-- End .content-box -->
			
			<div class="clear"></div>
			
			<?php include(DEDEADMIN.'/templets/footer.htm'); ?>
			
		</div> <!-- End #main-content -->	
	</div>
</body>
</html>
