<!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>
<link href="css/base.css" rel="stylesheet" type="text/css">
<SCRIPT src="js/jquery.js" type=text/javascript></SCRIPT>
<script language="javascript" src="../include/js/dedeajax2.js"></script>
<script language="javascript" src="js/main.js"></script>
<script type="text/javascript" src="js/calendar/calendar.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;
     }
	 document.getElementsByName("content")[0].innerHTML = ue.getContent();
     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>


<script>
	function aaa2(){
		$("#s11").hide();
		$(".s12").show();
	}
	function aaa1(){
		$("#s11").hide();
		$(".s12").hide();
	}
	function aaa3(){
		$("#s11").show();
		$(".s12").hide();
	}
	
</script>
<style>
.s12{ margin-top:10px;}
#ctset2{ background:none !important;}
</style>
</head>
<body leftmargin='15' topmargin='10' bgcolor="#FFFFFF" class="catalog">

<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">

  <tr>
  <form name="form1" action="catalog_edit.php" method="post" onSubmit="return checkSubmit();">
  <input type="hidden" name="dopost" value="save" />
  <input type="hidden" name="id" value="<?php echo $id; ?>" />
  <input type="hidden" name="topid" value="<?php echo $myrow['topid']; ?>" />
  <td height="95" align="center" bgcolor="#EDF1F2">
    
    <table width="100%" border="0" cellspacing="0" id="head1" cellpadding="0">
          <tr> 
            <td colspan="2" bgcolor="#EDF1F2" align="left">
           <table border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td width="88" height="24" align="center" background="images/itemnote1.gif">常规选项</td>
                  <td width="88" align="center" background="images/itemnote2.gif"><a href="#" onClick="ShowItem2()"><u>高级选项</u></a></td>
      
                </tr>
              </table>
            </td>
          </tr>
        </table> 
        
        <table width="100%" border="0" cellspacing="0" id="head2" cellpadding="0" style="display:none">
          <tr>
            <td colspan="2" bgcolor="#EDF1F2"  style="text-align:left;">
          <table height="24" border="0" cellpadding="0" cellspacing="0">
                <tr> 
                  <td width="88" align="center" background="images/itemnote2.gif"><a href="#" onClick="ShowItem1()"><u>常规选项</u></a></td>
                  <td width="88" align="center" background="images/itemnote1.gif">高级选项</td>
                
                </tr>
              </table>
            </td>
          </tr>
       </table>
       
       <table width="100%" border="0" cellspacing="0" id="head3" cellpadding="0" style="display:none">
          <tr>
            <td colspan="2" bgcolor="#EDF1F2" style="text-align:left;">
             <table height="24" border="0" cellpadding="0" cellspacing="0">
                <tr> 
                  <td width="88" align="center" background="images/itemnote2.gif"><a href="#" onClick="ShowItem1()"><u>常规选项</u></a></td>
                  <td width="88" align="center" background="images/itemnote2.gif"><a href="#" onClick="ShowItem2()"><u>高级选项</u></a></td>
                 
                </tr>
              </table>
            </td>
          </tr>
       </table>
       
        <table width="100%" border="0"  id="needset" cellspacing="0" cellpadding="0">
          
          
          <tr> 
            <td class='bline' height="26" width="150" style="padding-left:10px;"><font color='red'>栏目名称：</font></td>
            <td class='bline'><input name="typename" type="text" id="typename" size="30" value="<?php echo $myrow['typename']?>" class="iptxt" /></td>
          </tr>
          
          <tr> 
            <td class='bline' height="26" style="padding-left:10px;"> 排列顺序： </td>
            <td class='bline'> <input name="sortrank" size="6" type="text" value="<?php echo $myrow['sortrank']?>" class="iptxt" />
              （由低 -&gt; 高） </td>
          </tr>
        
          <tr> 
            <td height="26" class='bline' style="padding-left:10px;">栏目属性：</td>
            <td class='bline'>
                <input name="ispart" type="radio" onclick="aaa1()" id="radio" value="0" class='np'<?php if($myrow['ispart']==0) echo " checked='1' ";?>/>
              列表栏目（允许在本栏目发布文档，适合做新闻资讯）<br>
              <input name="ispart" type="radio" onclick="aaa2()" id="radio2" value="1" class='np'<?php if($myrow['ispart']==1) echo " checked='1' ";?>/>
              频道封面（适合做企业简介等单页面栏目）<br>
              <input name="ispart" type="radio" onclick="aaa3()" id="radio3" value="2" class='np'<?php if($myrow['ispart']==2) echo " checked='1' ";?>/>
              外部连接（点击填写网址，适合做站外跳转）
              </td>
          </tr>
          
          <tr id="s11" style="display:none"> 
            <td class='bline' height="26" style="padding-left:10px;">链接地址：</td>
            <td class='bline'> <input name="typedir" type="text" id="typedir" value="<?php echo $myrow['typedir']?>" style="width:300px"  class="iptxt" /> 
            </td>
          </tr>
          
      </table>
      
      
      
  
  

        
        
        
        <table width="100%" border="0" cellspacing="0" cellpadding="0" style="display:none;" id="adset">
        
          <tr> 
            <td width="150" class='bline' height="26" style="padding-left:10px;">是否隐藏栏目：</td>
            <td class='bline'> <input type='radio' name='ishidden' value='0' class='np'<?php if($myrow['ishidden']=="0") echo " checked='1' ";?>/>
              显示　&nbsp; <input type='radio' name='ishidden' value='1' class='np'<?php if($myrow['ishidden']=="1") echo " checked='1' ";?>/>
              隐藏 </td>
          </tr>
          <tr> 
            <td height="26" style="padding-left:10px;">栏目列表选项：</td>
            <td> 
 
              <input type='radio' name='isdefault' value='-1' class='np'<?php if($myrow['isdefault']==-1) echo " checked='1' ";?>/>
              使用伪静态 </td>
          </tr>
          
          
          <tr id='helpvar4' style='display:none'> 
            <td height="24" bgcolor="#F9FCEF" style="padding-left:10px;">使用提示： </td>
            <td bgcolor="#F9FCEF"> 如有功能设计需要，可以在栏目模板里用{aite:field.typenameen /}调用<br />或循环里使用[field:typenameen/]标签调用 </td>
          </tr>
          
          <tr> 
            <td class='bline' height="26" style="padding-left:10px;"><font>英文名称：</font></td>
            <td class='bline'><input name="typenameen" type="text" id="typenameen" size="30" value="<?php echo $myrow['typenameen']?>" class="iptxt" /> <img src="images/help.gif" width="16" height="16" border="0" style="cursor:pointer" onClick="ShowHide('helpvar4')"/></td>
          </tr>
          <tr class="nrmx"> 
            <td class='bline' height="26" style="padding-left:10px;">内容模型：</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 id='helpvar1' style='display:none'> 
            <td height="24" bgcolor="#F9FCEF" style="padding-left:10px;">模板命名规则： </td>
            <td bgcolor="#F9FCEF"> 
              {style}/index_article.htm  栏目属性里勾选频道封面时默认选用的模板，如有特殊需要可以另外制作或修改该模板文件<br>
              {style}/list_article.htm   栏目属性里勾选栏目列表时默认选用的模板，如有特殊需要可以另外制作或修改该模板文件<br>
              {style}/list_img.htm  此命名为图片列表展示，如果模板文件里含此文件，在列表模板框填即可<br>
              {style}/article_article.htm   默认文档内容页选用的模板，如有特殊需要可以另外制作或修改该模板文件<br>
              
              
              </td>
          </tr>
          
          <tr> 
            <td height="26" style="padding-left:10px;">封面模板：</td>
            <td> <input name="tempindex" type="text" value="<?php echo $myrow['tempindex']?>" style="width:300px" class="iptxt" /> 
              <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')"/>
            </td>
          </tr>
          <tr> 
            <td height="26" style="padding-left:10px;">列表模板：</td>
            <td> <input name="templist" type="text" value="<?php echo $myrow['templist']?>" style="width:300px" class="iptxt" /> 
              <input type="button" name="set3" value="浏览..." class="coolbg np" style="width:60px" onClick="SelectTemplets('form1.templist');"/> 
            </td>
          </tr>
          <tr> 
            <td height="26" style="padding-left:10px;">文章模板：</td>
            <td><input name="temparticle" type="text" value="<?php echo $myrow['temparticle']?>" style="width:300px"  class="iptxt" /> 
              <input type="button" name="set4" value="浏览..." class="coolbg np" style="width:60px" onClick="SelectTemplets('form1.temparticle');"/> 
            </td>
          </tr>
          
          <tr style="display:none"> 
            <td height="26" style="padding-left:10px;">文章命名规则：</td>
            <td> <input name="namerule" type="text" id="namerule" value="<?php echo $myrow['namerule']?>" size="40" class="iptxt" /> 
              <img src="images/help.gif" alt="帮助" width="16" height="16" border="0" style="cursor:pointer" onClick="ShowHide('helpvar2')"/> 
            </td>
          </tr>
          
<!--增加栏目缩略图-->


<tr id='helpvar2' style='display:none'> 
            <td height="24" bgcolor="#F9FCEF" style="padding-left:10px;">使用提示： </td>
            <td bgcolor="#F9FCEF"> 如有功能设计需要，可以在栏目模板里用{aite:field.typeimg /}调用<br />或循环里使用[field:typeimg/]标签调用 </td>
          </tr>
<tr>   

<tr>
<td width="90" height="81" style="padding-left:10px;">栏目图片：</td>
<td width="500">
 <input name="typeimg" type="text" id="typeimg" style="width:300px; vertical-align:top"  value="<?php echo $myrow['typeimg']?>"><input type="button" name="Submit" value="浏览..." style="width:70px; height:24px;" onClick="SelectImage('form1.typeimg','');">
 <input type="button" name="Submit2" value="裁剪" style="margin-left:8px;" onClick="imageCut('typeimg');" class='np coolbg'/>
<!-- <input type='checkbox' class='np' name='ddisremote' value='1'>
 远程<br />-->
 <img src="images/help.gif" width="16" height="16" border="0" style="cursor:pointer" onClick="ShowHide('helpvar2')"/>
 </td>
<td align="center">
<img src="<?php if($myrow['typeimg']!="") echo $myrow['typeimg']; else echo "images/pview.gif";?>" width="150" height="100" id="picview" name="picview">
</td>
</tr>
<!--增加栏目缩略图--> 
          
          
          
        <tr id='helpvar3' style='display:none'> 
            <td height="24" bgcolor="#F9FCEF" style="padding-left:10px;">使用提示： </td>
            <td bgcolor="#F9FCEF"> 如有优化需要，可以在栏目模板里用{aite:field.seotitle /}调用 </td>
          </tr>
        <tr>   
        
        <tr>
            <td height="65" style="padding-left:10px;">SEO标题：</td>
            <td>
                <input name="seotitle" type="text" style="width:250px" id="seotitle" class="alltxt" value="<?php echo $myrow['seotitle']?>" />
                <img src="images/help.gif" width="16" height="16" border="0" style="cursor:pointer" onClick="ShowHide('helpvar3')"/>
                
            </td>
          </tr>
        
          <tr> 
            <td height="65" style="padding-left:10px;">关键字：</td>
            <td> <textarea name="keywords" cols="70" rows="4" id="keywords"  class="alltxt" ><?php echo $myrow['keywords']?></textarea> 
            </td>
          </tr>
          <tr>
            <td height="65" style="padding-left:10px;">栏目描述：</td>
            <td height="65"><textarea name="description" cols="70" style="height:50px" rows="4" id="description" class="alltxt" ><?php echo $myrow['description']?></textarea></td>
          </tr>
          <tr> 
            <td height="45" style="padding-left:10px;">继承选项：</td>
            <td> 
              <input name="upnext" type="checkbox" id="upnext" value="1" class="np"/>
              同时更改下级栏目的浏览权限、内容类型、模板风格、命名规则等通用属性
            </td>
          </tr>
        </table>
        
        
        
        <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" id="ctset2" class="s12"  style="<?php if($myrow['ispart']==0) echo "display:none;";?>">
    <tbody><tr>
      <td>
        <table border="0" cellpadding="0" cellspacing="0">
          <tbody><tr>
            <td width="84" height="24" align="center" background="images/itemnote1.gif"><a href='javascript:ShowHideT("adset2")'><u>栏目内容↑</u></a></td>
          </tr>
        </tbody></table>
        
        
          <table width="100%" border="0" align="center" cellpadding="2" cellspacing="2" id="adset2" style="border:1px solid #cfcfcf;background:#ffffff;">
          <tbody>
          <tr>
              <td style="padding:10px;">
           
                <?php
                GetEditor("content",$myrow['content'],"200","Default","print","false");
                ?> 
  
         
              </td>
              
           </tr>
           </tbody>
           </table>
  
        
        
      </td>
    </tr>
  </tbody></table>
        
        
          <table width="100%" 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>
      </form>
  </tr>
</table>
</body>
</html>