<!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>
<script language="javascript" src="main.js"></script>
<script language="javascript">
<!--
function SelectGuide(fname)
{
   var posLeft = window.event.clientY-200;
   var posTop = window.event.clientX-200;
   window.open("mychannel_field_make.php?f="+fname, "popUpImagesWin", "scrollbars=yes,resizable=no,statebar=no,width=600,height=420,left="+posLeft+", top="+posTop);
}
function CheckSubmit()
{
	if(document.form1.typename.value=='')
	{
		alert("频道名称不能为空！");
		return false;
	}
	return true;
}
//删除
function DelNote(gourl){
	if(!window.confirm("你确认要删除这条记录么！")){ return false; }
	location.href=gourl;
}
-->
</script>
<link href="css_body.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.STYLE1 {color: #FF0000}
td{ padding:2px; padding-left:6px; line-height:150%; }
.STYLE2 {color: #666666; display:none; }
-->
</style>
</head>
<body>

<div class="bodytitle">
	<div class="bodytitleleft"></div>
	<div class="bodytitletxt">频道管理</div>
</div>

  
<table width="96%" border="0" cellpadding="1" cellspacing="1" align="center" class="tbtitle" style="background:#E2F5BC;">
  <form name="form1" action="mychannel_edit.php" method="post" onSubmit="return CheckSubmit();">
    <input type='hidden' name='ID' value='<?php echo $ID?>'>
    <input type='hidden' name='dopost' value='save'>
    <input type='hidden' name='issystem' value='<?php echo $row['issystem']?>'>
    <tr bgcolor="#E2F5BC"> 
      <td height="28" colspan="2" bgcolor="#EDF9D5">
      	<b>&nbsp;<a href="mychannel_main.php"><u>频道模型管理</u></a> &gt; 修改频道模型：</b>
      	(修改表名不会创建新表，如果你不懂手工处理这些表，请不要更改)      </td>
    </tr>
    <tr> 
      <td width="35%" height="28" align="left" bgcolor="#FFFFFF">频道ID：<br />
        <span class="STYLE2" id='help1'>　　数字，创建后不可更改，并具有唯一性。</span> </td>
      <td width="65%" bgcolor="#FFFFFF">
      	<?php echo $row['ID']?>
      * <img src="img/help.gif" alt="帮助" width="16" height="16" border="0" style="cursor:hand" onclick="ShowHide2('help1')" /></td>
    </tr>
    <tr> 
      <td height="28" align="left" bgcolor="#F8FCEF">频道名称：<br />
      <span class="STYLE2" id="help3">　　频道的中文名称，在后台管理，前台发布等均使用此名字。</span></td>
      <td bgcolor="#F8FCEF">
	    <input name="typename" type="text" id="typename" value="<?php echo $row['typename']?>" style="width:180px">
      *<img src="img/help.gif" alt="帮助" width="16" height="16" border="0" style="cursor:hand" onclick="ShowHide2('help3')" />
     </td>
    </tr>
    <tr> 
      <td align="left" bgcolor="#FFFFFF">名字标识：<br />
        <span class="STYLE2" id="help2">　　与文档的模板相关连，建议由英文、数字或下划线组成，因为部份Unix系统无法识别中文文件，频道默认文档模板是 “default/article_名字标识.htm”，列表模板、封面模板类推。 </span></td>
      <td bgcolor="#FFFFFF">
      	<input name="nid" type="text" id="nid" value="<?php echo $row['nid']?>" style="width:180px">
        *<img src="img/help.gif" alt="帮助" width="16" height="16" border="0" style="cursor:hand" onclick="ShowHide2('help2')" />
        <input name="ispy" type="checkbox"  id="ispy" value="1" class="np" checked />用频道名称的拼音
      </td>
    </tr>
    <tr>
      <td height="28" align="left" bgcolor="#F8FCEF">主索引表：<br />
      <span class="STYLE2" id="help4">　　系统会直接复制dede_archives的结构作为索引表，表名是允许相同的，当然使用不同的表分流数据可以提高负载性能。</span></td>
      <td bgcolor="#F8FCEF">
	  <input name="maintable" type="text" id="maintable" value="<?php if($row['maintable']=='') echo "{$cfg_dbprefix}archives"; else echo $row['maintable']; ?>" style="width:180px">
	  *<img src="img/help.gif" alt="帮助" width="16" height="16" border="0" style="cursor:hand" onclick="ShowHide2('help4')" />	
   </td>
    </tr>
    <tr> 
      <td height="28" align="left" bgcolor="#FFFFFF">附加表：<br />
        <span class="STYLE2" id="help5">　　必须由英文、数字、下划线组成，用于保存不包含在索引表中的个性化数据。</span></td>
      <td bgcolor="#FFFFFF">
	    <input name="addtable" type="text" id="addtable"  style="width:180px" value="<?php echo $row['addtable']; ?>">
        *<img src="img/help.gif" alt="帮助" width="16" height="16" border="0" style="cursor:hand" onclick="ShowHide2('help5')" />
      </td>
    </tr>
    <tr>
      <td height="28" align="left" bgcolor="#F8FCEF">模型字段配置：<br />
      信息索引类字段系统已经加入，<br />
      你只需要增加其它个性化字段即可。</td>
      <td bgcolor="#F8FCEF">
      	<input name="fset" type="button" id="fset" value="添加新字段" onClick="location.href='mychannel_field_add.php?ID=<?php echo $ID; ?>'" class="inputbut" style="margin-top:5px"/></td>
    </tr>
     <tr>
      <td colspan='2'  bgcolor="#FFFFFF" style="padding:6px">
<table width="100%" border="0" cellpadding="1" cellspacing="1" align="center"  style="background:#ABC094;">
   <tr align="center" bgcolor="#EEFAA9" height="24">
      <td width="28%">表单提示文字</td>
      <td width="18%">数据字段名</td>
      <td width="20%">数据类型</td>
      <td width="18%">表单类型</td>
      <td>维护</td>
  </tr>
<?php 
$ds = file(dirname(__FILE__)."/../inc/fieldtype.txt");
foreach($ds as $d){
	$dds = explode(',',trim($d));
	$fieldtypes[$dds[0]] = $dds[1];
}
$fieldset = $row['fieldset'];
$dtp = new DedeTagParse();
$dtp->SetNameSpace("field","<",">");
$dtp->LoadSource($fieldset);
if(is_array($dtp->CTags)){
foreach($dtp->CTags as $ctag)
{
?>  <tr align="center" bgcolor="#FFFFFF" height="24">
      <td>
      <?php 
			$itname = $ctag->GetAtt('itemname');
			if($itname=='') echo "没指定";
			else echo $itname;
			?>
			</td>
      <td>
      	<?php echo $ctag->GetTagName()?>
      </td>
      <td>
      <?php 
			$ft = $ctag->GetAtt('type');
			if(isset($fieldtypes[$ft])) echo $fieldtypes[$ft];
			else  echo "系统专用类型";
			?>
			</td>
		  <td>
		 <?php 
			$ft = $ctag->GetAtt('autofield');
			if($ft==''||$ft==0) echo "固化表单";
			else  echo "自动表单";
		 ?>
		  </td>
      <td>
      	<a href='mychannel_field_edit.php?ID=<?php echo $ID?>&fname=<?php echo $ctag->GetTagName()?>&issystem=<?php echo $row['issystem']; ?>'>[修改]</a>
       <?php if($row['issystem']!=1){ ?>
      | <a href='#' onClick='javascript:DelNote("mychannel_field_edit.php?ID=<?php echo $ID?>&fname=<?php echo $ctag->GetTagName()?>&action=delete");'>[移除]</a>
       <?php } ?>
      </td>
  </tr>
<?php 
 }}
?>
</table>
      </td>
    </tr>
    <tr> 
      <td height="28" align="left" bgcolor="#F8FCEF">模型性质：</td>
      <td bgcolor="#F8FCEF">
      	<input name="issystem" type="radio" class="np"  value="0"<?php if($row['issystem']=='0') echo " checked"; ?> />
        自动模型 
        <input name="issystem" type="radio" class="np" value="1"<?php if($row['issystem']=='1') echo " checked"; ?> />
        系统模型
      </td>
    </tr>
    <tr> 
      <td height="28" align="left" bgcolor="#FFFFFF">是否支持会员投稿：</td>
      <td bgcolor="#FFFFFF">
      	<input name="issend" type="radio" class="np"  value="0"<?php if($row['issend']=='0') echo " checked"; ?> />
        不支持　 
        <input name="issend" type="radio" class="np"  value="1"<?php if($row['issend']=='1') echo " checked"; ?> />
        支持
      </td>
    </tr>
    <tr> 
      <td height="28" align="left" bgcolor="#F8FCEF">投稿会员组：</td>
      <td bgcolor="#F8FCEF">
      	<input name="sendmember" type="radio" class="np"  value="0"<?php if($row['sendmember']=='0') echo " checked"; ?> />
        个人会员 
        <input name="sendmember" type="radio" class="np"  value="1"<?php if($row['sendmember']=='1') echo " checked"; ?> />
        企业会员
        <input name="sendmember" type="radio" class="np"  value="2"<?php if($row['sendmember']=='2') echo " checked"; ?> />
        所有会员
      </td>
    </tr>
    <tr> 
      <td height="28" align="left" bgcolor="#FFFFFF">会员许可投稿级别：</td>
      <td bgcolor="#FFFFFF">
	  <select name="sendrank" id="sendrank" style="width:120px">
		  <?php 
              $dsql->SetQuery("Select * from #@__arcrank where rank>=10");
              $dsql->Execute();
              while($row2 = $dsql->GetObject())
              {
              	if($row2->rank==$row['sendrank']) echo "     <option value='".$row2->rank."' selected>".$row2->membername."</option>\r\n";
				else echo "     <option value='".$row2->rank."'>".$row2->membername."</option>\r\n";
              }
          ?>
        </select>
      </td>
    </tr>
    <tr> 
      <td height="28" align="left" bgcolor="#F8FCEF">会员稿件默认状态：</td>
      <td bgcolor="#F8FCEF">
      	<input name="arcsta"  type="radio" value="-1"<?php  if($row['arcsta']==-1) echo " checked";?>>
        未审核 
        <input name="arcsta"  type="radio" value="0"<?php  if($row['arcsta']==0) echo " checked";?>>
        已审核（自动生成HTML） 
        <input name="arcsta"  type="radio" value="1"<?php  if($row['arcsta']==1) echo " checked";?>>
        已审核（仅使用动态文档）
      </td>
    </tr>
    <tr>
      <td colspan="2" bgcolor="#FFFFFF" height="28">
      	　　◎以下的选项，如果你没有自己重新开发这个模型的发布程序，保留默认即可，系统会自动生成发布表单。
      </td>
    </tr>
    <tr> 
      <td width="35%" height="28" align="left" bgcolor="#FFFFFF">发布程序选项：</td>
      <td width="65%" bgcolor="#FFFFFF">
      <input type='checkbox' name='isdefault' value='1' class='np'<?php if($row['isdefault']==1) echo ' checked';  ?> />
       设置为内容发布默认频道
      </td>
    </tr>
    <tr> 
      <td align="left" bgcolor="#F8FCEF">档案发布程序</td>
      <td bgcolor="#F8FCEF"><input name="addcon" type="text" id="addcon" value="<?php echo $row['addcon']?>" size="35"></td>
    </tr>
    <tr> 
      <td align="left" bgcolor="#FFFFFF">档案修改程序</td>
      <td bgcolor="#FFFFFF"><input name="editcon" type="text" id="editcon" value="<?php echo $row['editcon']?>" size="35"></td>
    </tr>
    <tr> 
      <td align="left" bgcolor="#F8FCEF">档案管理程序</td>
      <td bgcolor="#F8FCEF"><input name="mancon" type="text" id="mancon" value="<?php echo $row['mancon']?>" size="35"></td>
    </tr>
    <tr> 
      <td align="left" bgcolor="#FFFFFF">会员发布程序</td>
      <td bgcolor="#FFFFFF"><input name="useraddcon" type="text" id="useraddcon" value="<?php echo $row['useraddcon']?>" size="35"></td>
    </tr>
    <tr> 
      <td align="left" bgcolor="#F8FCEF">会员修改程序</td>
      <td bgcolor="#F8FCEF"><input name="usereditcon" type="text" id="usereditcon" value="<?php echo $row['usereditcon']?>" size="35"></td>
    </tr>
    <tr> 
      <td align="left" bgcolor="#FFFFFF">会员管理程序</td>
      <td bgcolor="#FFFFFF"><input name="usermancon" type="text" id="usermancon" value="<?php echo $row['usermancon']?>" size="35"></td>
    </tr>
    <tr bgcolor="#F9FDF0"> 
      <td height="28" colspan="2">
      	<table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr> 
            <td width="26%" height="45">&nbsp;</td>
            <td width="15%"><input type="submit" name="button" id="button" value="确定"  class="inputbut"/></td>
            <td width="59%"><input name="按钮" type="button" class="inputbut"  id="button2" onclick="location='mychannel_main.php';" value="返回"/></td>
          </tr>
        </table>
      </td>
    </tr>
  </form>
</table>
</body>
</html>