<!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" />
<style>
.np { border:0px }
</style>
<script language='javascript'>
	var selCheckbox = '';
	function ResetBox(selid)
	{
		var selobj = document.getElementById(selid);
		var preobj = null;
		if(selCheckbox!='') preobj = document.getElementById(selCheckbox);
		if(selobj.checked){
			if(preobj!=null && selid != selCheckbox) preobj.checked = false;
			selCheckbox = selid;
		}else{
			if(selCheckbox == selid) selCheckbox = '';
		}
	}
	function SetDefault()
	{
		if(selCheckbox==''){
			alert("你沒有選中需要設置為默認的欄目！");
		}else{
			var selobj = document.getElementById(selCheckbox);
			location="public_guide.php?action=setdefault&cid="+selobj.value;
		}
	}
	function ResetDefault(){
		location="public_guide.php?action=setdefault&cid=0";
	}
</script>
</head>
<body leftmargin="8" topmargin="8" background='images/allbg.gif'>
<table width="98%" height="31" border="0" align="center" cellpadding="1" cellspacing="1" class="tbtitle" style="border:1px solid #CFCFCF;margin-top:6px;border-bottom:none;">
  <tr>
    <td class="tbtitletxt" background='images/tbg.gif'><strong>&nbsp;內容發佈嚮導：</strong></td>
  </tr>
</table>
<table width="98%" border="0" cellpadding="1" cellspacing="1" align="center" style="border:1px solid #CFCFCF;">
  <tr align="center">
    <td height="120" align="left" valign="top" bgcolor="#FFFFFF" style="padding:6px;padding-bottom:20px">
	<table width="100%" border="0" cellspacing="0" cellpadding="6">
      <tr>
        <td><strong>內容發佈說明：</strong><br />
          1、必須先建立與頻道內容模型關連的欄目才能發佈內容（<a href="catalog_main.php"><u>欄目管理</u></a>）；<br />
          2、如果您設置了某頻道為默認發佈表單，以後將不再顯示此嚮導，而是直接顯示您所選的頻道的發佈表單，如果想要發佈其它頻道的內容，可以從左邊的目錄樹中選擇，如果以後您想要修改默認發佈表單，請點擊目錄樹上方的「發佈嚮導」圖標；</td>
      </tr>
    </table>
	<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#cfcfcf" >
    <tr height="22" align="center" bgcolor="#FBFCE2">
        <td width="8%" ><strong>選擇</strong></td>
		<td width="8%"><strong>頻道ID</strong></td>
        <td width="20%"><strong>頻道內容模型</strong></td>
        <td width="23%"><strong>附加表</strong></td>
        <td width="10%"><strong>欄目數</strong></td>
        <td><strong>操作選項</strong></td>
      </tr>
   <?php 
   $i=0;
   while($row = $dsql->GetArray()){
   $i++;
   $row['mancon'] = ($row['mancon']=='' ? 'content_list.php?channelid='.$row['id'] : $row['mancon'].'?channelid='.$row['id']);
   $checkbox = ($row['isdefault']==0 ? '' : ' checked');
   if($checkbox!=''){
   	 echo "<script language='javascript'>selCheckbox='cid{$i}';</script>\r\n";
   }
   $catnum = GetCatalogs($dsql,$row['id']);
   ?>   
     <tr align="center" bgcolor="#FFFFFF" height="20" onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';">
        <td><input type="checkbox" name="cid<?php echo $i; ?>" id="cid<?php echo $i; ?>" onClick="ResetBox('cid<?php echo $i; ?>')" value="<?php echo $row['id']; ?>" class="np" <?php echo $checkbox; ?>/></td>
		    <td><?php echo $row['id']; ?></td>
        <td><?php echo $row['typename']; ?></td>
        <td><?php echo $row['addtable']; ?></td>
        <td><?php echo $catnum; ?></td>
        <td>
        <a href="catalog_main.php">管理欄目</a>
        <?php
        if($catnum>0){
        ?>
        	 | 
        <a href="<?php echo $row['mancon']; ?>">管理內容</a>
        	 | 
        <a href="catalog_do.php?channelid=<?php echo $row['id'];?>&cid=0&dopost=addArchives">發佈內容</a>
       <?php }else{ ?>
       		 | 
        <font color='#cccccc'>管理內容</font>
        	 | 
        <font color='#cccccc'>發佈內容</font>
       <?php } ?>
        </td>
      </tr>
    <?php
    }
    ?>
    </table>
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>
        	<input name="b1" type="button" id="b1" value="把所選的頻道表單設為默認表單" onClick="SetDefault()" class="coolbg" />
        	&nbsp;&nbsp;
        	<input name="b2" type="button" id="b2" value="取消默認表單" onClick="ResetDefault()" class="coolbg" />
        </td>
      </tr>
    </table></td>
  </tr>
</table>
<div align="center">&nbsp;</div>
</body>
</html>
