<? defined('ROOT_PHPLEFT') or exit(require '../../../404.php');?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="css/main.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="<?=PL_URL?>js/common.js"></script>
<script>

function cks(e){
	if (e==1){
	$('linkurls').style.display="none";
	$('paths').style.display="block";
	$('modules').style.display="block";
	$('pluginss').style.display="none";	
	}else if (e==2){
	$('linkurls').style.display="none";
	$('paths').style.display="block";
	$('modules').style.display="none";
	$('pluginss').style.display="block";
		
	}else{
	$('linkurls').style.display="block";
	$('paths').style.display="none";
	$('modules').style.display="none";
	$('pluginss').style.display="none";
		
	}
	
	
}
</script>

</head>
<body bottommargin="0" leftmargin="0" topmargin="0" rightmargin="0">
<div class="tpis"><img src="images/icos.gif" align="absmiddle"/>当前位置：基础设置 > 频道管理</div>
<table class="usertableborder input" cellspacing="1" cellpadding="3" width="100%" align="center"
        border="0">
        <tr>
            <th colspan="7">提示信息</th>
        </tr>
    
</table>
    <div class="tsc">
1. 请谨慎删除频道，删除频道后，数据不可恢复。 <br>
2. 频道创建后，可以设置更改字段。
</div>
<? include inTemplate(menu);?>
<?
if ($show=='menu'){
	?>
<script type="text/javascript">
function check() {
	if($('name').value == '') {
    msg('请输入频道名称','cname','right_r');
		return false;
	}
	if($('is').checked) {
	if($('path').value == '') {
    msg('请输入目录','cpath','right_r');
		return false;
	}
	if($('module').value == '') {
	msg('请选择模型','cmodule','right_r');
		return false;
	}
	}else if ($('is3').checked){
   if($('linkurl').value == '') {
   	msg('请输入网址','clinkurl','right_r');
		return false;
	}	
	}else if($('is2').checked) {
	if($('path').value == '') {
    msg('请输入目录','cpath','right_r');
		return false;
	}
	if($('plugins').value == '') {
	msg('请选择插件','cplugins','right_r');
		return false;
	}
	}
}
	</script>
   <form id="form" action="?file=post_center&post=menu&input=add" method="post" onSubmit="return check();" style="margin:0px; padding:0px;">

 <table class="usertableborder" cellspacing="1" cellpadding="3" width="100%" align="center"
        border="0">
        <tr>
            <th colspan="3" class="list">
                添加频道</th>
        </tr>   
       <tr class="list1">
            <td width="159" height="30" class="text" style="padding-right:10px; text-align:right"><strong>频道名称</strong></td>
      <td width="383" height="30"><input name="alladd[name]" type="text" id="name" value="<?=$alladd[name]?>" size="23"></td>
            <td height="30"><span id="cname">建议使用中文</span></td>
        </tr>
        <tr class="list">
            <td width="159" height="30" class="text" style="padding-right:10px; text-align:right"></td>
      <td width="383" height="30">
      <input name="is" type="radio" onClick="cks(1);" value="1" id="is" checked>
            内部模型&nbsp;  <input name="is"  onClick="cks(2);" type="radio" id="is2" value="2">
            插件&nbsp;  <input name="is"  onClick="cks(3);" id="is3" type="radio" value="3">
            网址链接
      </td>
            <td height="30"></td>
        </tr></table>
        <table class="usertableborder" cellspacing="1" cellpadding="3" width="100%" align="center"
        border="0" id="linkurls" style="display:none">
        <tr class="list1">
            <td width="159" height="30" class="text" style="padding-right:10px; text-align:right"><strong>网址</strong></td>
        <td width="383" height="30"><input name="linkurl" type="text" id="linkurl" value="<?=$alladd[linkurl]?>" size="30"></td>
            <td height="30"><span id="clinkurl"></span></td>
        </tr>
        </table>
        <table class="usertableborder" cellspacing="1" cellpadding="3" width="100%" align="center"
        border="0" id="paths">
        <tr class="list1">
            <td width="159" height="30" class="text" style="padding-right:10px; text-align:right"><strong>频道目录</strong></td>
        <td width="383" height="30"><input name="alladd[path]" type="text" id="path" value="<?=$alladd[path]?>" size="30"></td>
            <td height="30"><span id="cpath">使用英文或者数字、下划线等</span></td>
        </tr>
        </table>
        <table class="usertableborder" cellspacing="1" cellpadding="3" width="100%" align="center"
        border="0" id="pluginss" style="display:none">
        <tr class="list">
            <td width="159" height="30" class="text" style="padding-right:10px; text-align:right"><strong>选择插件</strong></td>
            <td width="383" height="30">
            <?=add_select($pluginslist,$alladd[module],'请选择','alladd[plugins]','plugins');?>
        </td>
            <td height="30"><span id="cplugins"></span></td>
        </tr>
        </table>
        <table class="usertableborder" cellspacing="1" cellpadding="3" width="100%" align="center"
        border="0" id="modules">
        <tr class="list">
            <td width="159" height="30" class="text" style="padding-right:10px; text-align:right"><strong>选择模型</strong></td>
            <td width="383" height="30">
            <?=add_select($filelist,$alladd[module],'请选择','alladd[module]','module');?>
        </td>
            <td height="30"><span id="cmodule"></span></td>
        </tr></table>
<table class="usertableborder bb" cellspacing="1" cellpadding="3" width="100%" align="center"
        border="0">
        <tr class="list1">
            <td width="159" height="30" class="text" style="padding-right:10px; text-align:right"><strong>新窗口</strong></td>
            <td width="383" height="30"><input name="alladd[target]" type="radio" id="target" value="1" class="no"<? if ($alladd[target]==1){ ?> checked<? }?>>
            是&nbsp;  <input name="alladd[target]" type="radio" id="target" class="no" value="0"<? if ($alladd[target]<>'1'){ ?> checked<? }?>>
            否 </td>
            <td height="30"></td>
        </tr>
        <tr class="list">
            <td width="159" height="30" class="text" style="padding-right:10px; text-align:right"><strong>是否显示</strong></td>
            <td width="383" height="30"><input name="alladd[is_or]" type="radio" id="is" value="1" class="no"<? if ($alladd[is_or]<>'0'){ ?> checked<? }?>>
            是&nbsp;  <input name="alladd[is_or]" type="radio" id="is_or" class="no" value="0"<? if ($alladd[is_or]=='0'){ ?> checked<? }?>>
            否 </td>
            <td height="30"></td>
        </tr>
         <tr class="list1">
          <td height="30" class="text" style="padding-right:10px; text-align:right"></td>
          <td height="30"><input type="submit" name="button" id="button" value=" 确 认 " class="ok"></td>
            <td height="30">&nbsp;</td>
        </tr>
    </table>
   </form>
    
 <?
}elseif ($show=='bj'){
	?>
   <form action="?file=post_center&post=menu&input=bj&id=<?=$id?>" method="post" style="margin:0px; padding:0px;">
<input name="paths" type="hidden" id="paths" value="<?=$alladd[path]?>" size="30">
<input name="style" type="hidden" id="style" value="<?=$style?>" size="30">
 <table class="usertableborder bb" cellspacing="1" cellpadding="3" width="100%" align="center"
        border="0">
        <tr>
            <th colspan="3">
                编辑频道</th>
        </tr>   
       <tr class="list1">
            <td width="159" height="30" class="text" style="padding-right:10px; text-align:right"><strong>频道名称</strong></td>
            <td width="383" height="30"><input name="alladd[name]" type="text" id="name" value="<?=$alladd[name]?>" size="23"></td>
            <td height="30">建议使用中文</td>
        </tr>
        <tr class="list">
            <td width="159" height="30" class="text" style="padding-right:10px; text-align:right"></td>
      <td width="383" height="30">
      <input name="is" type="radio" onClick="cks(1);" value="1"<? if ($style<>'1'){ ?> checked<? }?> disabled>
            内部模型&nbsp;  <input name="is"  onClick="cks(2);" type="radio" value="2"<? if ($style=='1'){ ?> checked<? }?> disabled>
            网址链接
      </td>
            <td height="30"></td>
        </tr>
        <? if ($style=='1'){ ?>
         <tr class="list1" id="linkurls">
            <td width="159" height="30" class="text" style="padding-right:10px; text-align:right"><strong>网址</strong></td>
        <td width="383" height="30"><input name="alladd[linkurl]" type="text" id="linkurl" value="<?=$alladd[linkurl]?>" size="30"></td>
            <td height="30">&nbsp;</td>
        </tr>
        <? }else{?>
        <tr class="list">
            <td width="159" height="30" class="text" style="padding-right:10px; text-align:right"><strong>频道目录</strong></td>
            <td width="383" height="30"><input name="alladd[path]" type="text" id="path" value="<?=$alladd[path]?>" size="30"></td>
            <td height="30">使用英文或者数字、下划线等</td>
        </tr>
        <tr class="list1">
            <td width="159" height="30" class="text" style="padding-right:10px; text-align:right"><strong>选择模型</strong></td>
            <td width="383" height="30">
            <?=select($filelist,$alladd[module],'请选择','alladd[module]',' disabled');?>
            
          </td>
            <td height="30"></td>
        </tr>
<? }?>
        <tr class="list">
            <td width="159" height="30" class="text" style="padding-right:10px; text-align:right"><strong>新窗口</strong></td>
            <td width="383" height="30"><input name="alladd[target]" type="radio" id="target" value="1" class="no"<? if ($alladd[target]==1){ ?> checked<? }?>>
            是&nbsp;  <input name="alladd[target]" type="radio" id="target" class="no" value="0"<? if ($alladd[target]=='0'){ ?> checked<? }?>>
            否 </td>
            <td height="30"></td>
        </tr>
        <tr class="list1">
            <td width="159" height="30" class="text" style="padding-right:10px; text-align:right"><strong>是否显示</strong></td>
            <td width="383" height="30"><input name="alladd[is_or]" type="radio" id="is" value="1" class="no"<? if ($alladd[is_or]=='1'){ ?> checked<? }?>>
            是&nbsp;  <input name="alladd[is_or]" type="radio" id="is_or" class="no" value="0"<? if ($alladd[is_or]=='0'){ ?> checked<? }?>>
            否 </td>
            <td height="30"></td>
        </tr>
         <tr class="list">
          <td height="30" class="text" style="padding-right:10px; text-align:right"></td>
            <td height="30"><input type="submit" name="button" id="button" value=" 确 认 " class="ok"></td>
            <td height="30">&nbsp;</td>
        </tr>
    </table>
    </form>
<?	
}else{
?><form id="form1" name="form1" method="post" action="phpleft.php?file=menu&post=key">
    <table class="usertableborder bb" cellspacing="0" cellpadding="3" width="100%" align="center"
        border="0">
       
<tr align="center" class="title">
          <td width="168" height="30" valign="top"  class="usertablerow3">
          频道ID
          </td>
          <td width="99" height="30" valign="top"  class="usertablerow3">
          排序
          </td>
          <td width="200" height="30" class="usertablerow3">频道名称</td>
         
            <td width="119" height="30" class="usertablerow3">频道文件</td>
             <td width="119" height="30" class="usertablerow3">模型</td>
             <td width="201" height="30" class="usertablerow3">频道管理</td>
              <td height="30" class="usertablerow3">&nbsp;</td>
             
        </tr>
       
         <?php
		 $ii = 0;
		 foreach($menulist as $id=>$m) {
		$ii = $ii+1;
		 ?>
        <tr align="center" class="list<?php if($ii%2==1) echo '1'?>">
          <td width="168" height="30" valign="top" style="padding-right:10px;">
          <?=$m[id]?>
          </td>
          <td width="99" height="30">
  <input name="key[<?=$m[id]?>]" type="text" id="key" value="<?=$m[inlist]?>" size="3" style="text-align:center"></td>

            <td width="200" height="30"><a href="<?=$m['linkurl']?>" target="_blank">
          <?=$m[name]?></a></td>
            <td width="119" height="30">
            <?=$m[path];?></td>
             <td width="201" height="30"><? if ($m['fou']=='3'){ echo '外链'; }elseif($m['fou']=='2'){echo '扩展('.$m[plugins].')';}else{ echo $m[module];}?></td>
             <td width="203" height="30"><? if ($m[hexin]==1){?>核心文件<? }else {?>
             <a href="phpleft.php?file=menu&show=bj&id=<?=$m[id]?><? if ($m[path]=='') echo '&style=1';?>"><img src="<?=PL_URL?>ico/edit.png" align="absmiddle" alt="编辑" border="0"></a> <a href="?file=post_center&post=menu&input=del&modname=<?=$m[module]?>&id=<?=$m[id]?><? if ($m['fou']) echo '&style='.$m[fou];?>" onClick="return confirm('确定要删除这个频道？将清空频道所有数据')"><img src="<?=PL_URL?>ico/del.png" align="absmiddle" alt="删除" border="0"></a>             <? }?></td>
<td width="203" height="30"></td>
             
      </tr>
      
        <? }?>
        </tr>
    </table>
        <table class="usertableborder bb" cellspacing="0" cellpadding="3" width="100%" align="center"
        border="0">
      <tr>
        <td width="17%" height="30" style="padding-right:10px; text-align:right"><input type="submit" value=" 更新排序 " class="ok"></td>
        <td width="83%" height="30"></td>
     
      </tr>
    </table>
    </form>
 
    <?
}
	?>
</body>
</html>
