<?php
/**
 * @package iCMS
 * @copyright 2007-2010, iDreamSoft
 * @license http://www.idreamsoft.cn iDreamSoft
 * @author coolmoo <idreamsoft@qq.com>
 */
!defined('iPATH') && exit('What are you doing?'); 
iCMS_admincp_head();
?>
<script type="text/javascript">admincpnav('首页&nbsp;&raquo;&nbsp;TAG管理');
	function doaction(obj){
		switch(obj.value){ 
			case "del":
				if(confirm("确定要删除！！！")){
					return true;
				}else{
					obj.value="";
					return false;
				}
			break;
		}
	}
</script>
<div class="container" id="cpcontainer">
  <div class="itemtitle">
    <ul class="tab1" id="submenu">
      <li class="current"><a href="<?=__SELF__?>?do=tag&operation=manage"><span>TAG管理</span></a></li>
      <li><a href="<?=__SELF__?>?do=tag&operation=sort"><span>TAG归类管理</span></a></li>
      <li id="nav_add"><a href="<?=__SELF__?>?do=tag&operation=add"><span>添加TAG</span></a></li>
    </ul>
  </div>
  <table class="tb tb2 nobdb" id="tips">
    <tr>
      <th colspan="15" class="partition">技巧提示</th>
    </tr>
    <tr>
      <td class="tipsblock"><ul id="tipslis">
          <li>点击ID可查看该TAG</li>
          <li>点击使用数可查看关联内容</li>
        </ul></td>
    </tr>
  </table>
  <form action="<?=__SELF__?>?do=tag&operation=post" method="post">
  <table class="tb tb2 ">
    <tr>
      <td>&nbsp;</td>
      <th>ID</th>
      <th>排序</th>
      <th>TAG</th>
      <th>TAG归类</th>
      <th>使用数</th>
      <th>状态</th>
      <th>管理</th>
    </tr>
    <?php for($i=0;$i<$_count;$i++){
    	$iurlArray=array('id'=>$rs[$i]['id'],'link'=>$rs[$i]['link'],'name'=>$rs[$i]['name']);
		$iurl=$iCMS->iurl('tag',$iurlArray);
		$rs[$i]['url']= $iurl->href;
    ?>
    <tr>
      <td><input type="checkbox" class="checkbox" name="id[]" value="<?=$rs[$i]['id']?>" /></td>
      <td><a href="<?=$rs[$i]['url']?>" target="_blank"><?=$rs[$i]['id']?></a></td>
      <td><input type="text" class="txt" name="ordernum[<?=$rs[$i]['id']?>]" value="<?=_int($rs[$i]['ordernum'])?>" style="width:40px;"/></td>
      <td><input type="text" class="txt" name="name[<?=$rs[$i]['id']?>]" value="<?=$rs[$i]['name']?>" style="width:240px;"/></td>
      <td><select name="sortid[<?=$rs[$i]['id']?>]" style="width:auto;">
        <option value="0"> == 暂无归类 == </option>
        <?=tagsort($rs[$i]['sortid'])?>
        </select>
      </td>
      <td><a href="<?=__SELF__?>?do=tag&operation=list&id=<?=$rs[$i]['id']?>" title="点击查看关联内容"><?=$rs[$i]['count']?></a></td>
      <td><?php if ($rs[$i]['status']){ ?><a href="<?=__SELF__?>?do=tag&operation=disabled&id=<?=$rs[$i]['id']?>" title='点击禁用此TAG'>启用</a><?php }else{  ?><a href="<?=__SELF__?>?do=tag&operation=open&id=<?=$rs[$i]['id']?>" title='点击启用此TAG'>禁用</a><?php }?></td>
      <td><?php if($iCMS->config['tagrule']!="php"&&$iCMS->config['ishtm']){?><a href="<?=__SELF__?>?do=tag&operation=updateHTML&id=<?=$rs[$i]['id']?>" title='生成静态文件'><?=file_exists($iurl->path)?"发布":"待发布"?></a> | <?php } ?>
        <a href="<?=__SELF__?>?do=tag&operation=add&id=<?=$rs[$i]['id']?>">编辑 </a> | <a href="<?=__SELF__?>?do=tag&operation=updateCache&id=<?=$rs[$i]['id']?>&name=<?=rawurlencode($rs[$i]['name'])?>" title='更新TAG缓存'>更新</a> | <a href="<?=__SELF__?>?do=tag&operation=del&id=<?=$rs[$i]['id']?>"onClick="return confirm('确定要删除?');">删除 </a></td>
    </tr>
    <?php } ?>
    <tr>
      <td colspan="7"><?=$pagenav?></td>
    </tr>
    <tr class="nobg">
      <td class="td25"><input type="checkbox" name="chkall" id="chkall" class="checkbox" onclick="checkAll('prefix', this.form, 'id')" />
        <label for="chkall">全选</label></td>
      <td colspan="6"><div class="fixsel">
        <select name="action" id="action" onChange="doaction(this);">
          <option value="tagEdit">编辑</option>
          <option value="del">删除</option>
        <?php if($iCMS->config['ishtm'] && $iCMS->config['tagrule']!="php"){?>
          <!--option value="html">生成静态</option-->
          	  <?php }?>
            </select>
          <input type="submit" class="btn" name="forumlinksubmit" value="提交"  />
        </div></td>
    </tr>
  </table>
  </form>
</div>
</body></html>