<link href="styles/general.css" rel="stylesheet" type="text/css" />
<link href="styles/main.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/utils.js"></script>
<body>
<h1>
<span class="action-span"><a href="?ctl=class&act=class_add"><tpl>$class_add</tpl><!--添加频道--></a></span>
<span class="action-span1"><a href="?ctl=index&act=admin_main"><tpl>$common_admin_index</tpl><!--管理首页--></a> >> <tpl>$class_list</tpl><!--频道列表--></span>
<div style="clear:both"></div>
</h1>
<form method="post" action="" name="listForm">
<div class="list-div" id="listDiv">

<table width="100%" cellspacing="1" cellpadding="2" id="list-table">
  <tr>
    <th><tpl>$class_list_name</tpl><!--频道名称--></th>
    <th><tpl>$class_article_num</tpl><!--文章数--></th>
    <th><tpl>$class_list_type</tpl><!--频道类型--></th>
    <th><tpl>$class_list_sort</tpl><!--排序--></th>
	<th><tpl>$class_list_state</tpl><!--状态--></th>
    <th><tpl>$class_list_oper</tpl><!--操作--></th>
  </tr>
  <tpl>foreach $class_array as $val</tpl>
  <tr align="center" class="<tpl>$val['class_level']</tpl>">
    <td align="left" width="40%" class="first-cell" >
	<tpl>if $val['class_leaf'] == 1</tpl>
      <img src="images/menu_minus.gif" width="9" height="9" border="0" style="margin-left:<tpl>$val['class_level']</tpl>em" onClick="rowClicked(this)" />
	<tpl>else</tpl>
      <img src="images/menu_arrow.gif" width="9" height="9" border="0" style="margin-left:<tpl>$val['class_level']</tpl>em" />
	<tpl>/if</tpl>
	  <span><tpl>$val['class_name']</tpl></span>
    </td>
    <td width="5%"><tpl>$val['article_num']</tpl></td>
	<td width="8%"><tpl>if $val['class_type_tag'] == 'image'</tpl><tpl>$class_list_type_img</tpl><tpl>else</tpl><tpl>$class_list_type_art</tpl><tpl>/if</tpl></td>
    <td width="5%"><tpl>$val['class_sort']</tpl></td>
    <td width="5%"><img src="images/<tpl>if $val['class_state']=='1'</tpl>yes.gif<tpl>else</tpl>no.gif<tpl>/if</tpl>" /></td>
    <td width="42%" align="center">
      <a href="index.php?ctl=class&act=class_add&class_top_id=<tpl>$val['class_id']</tpl>"><tpl>$class_son_add</tpl></a> | 
	  <a href="index.php?ctl=class&act=class_add&class_id=<tpl>$val['class_id']</tpl>"><tpl>$class_list_edit</tpl></a> | 
	  <a href="index.php?ctl=class&act=move_show&class_id=<tpl>$val['class_id']</tpl>"><tpl>$class_list_move</tpl></a> | 
	  <a href="index.php?ctl=class&act=class_del&class_id=<tpl>$val['class_id']</tpl>" onClick="return confirm('<tpl>$class_del_conf</tpl>');"><tpl>$class_list_del</tpl></a> | 
	  <a href="index.php?ctl=content&act=content_add&class_id=<tpl>$val['class_id']</tpl>"><tpl>$class_artucle_add</tpl></a> | 
	  <a href="../index.php?ctl=class&act=front_article_class&class_id=<tpl>$val['class_id']</tpl>" target="_blank"><tpl>$class_list_show</tpl></a>
    </td>
  </tr>
  <tpl>/foreach</tpl>
</table>
</div>
</form>
<div id="footer">
<tpl>$common_copyright</tpl>
</div>
</body>
<script language="JavaScript">
var imgPlus = new Image();
imgPlus.src = "images/menu_plus.gif";
/**
 * 折叠分类列表
 */
function rowClicked(obj)
{
  obj = obj.parentNode.parentNode;

  var tbl = document.getElementById("list-table");
  var lvl = parseInt(obj.className);
  var fnd = false;

  for (i = 0; i < tbl.rows.length; i++)
  {
      var row = tbl.rows[i];

      if (tbl.rows[i] == obj)
      {
          fnd = true;
      }
      else
      {
          if (fnd == true)
          {
              var cur = parseInt(row.className);
              if (cur > lvl)
              {
                  row.style.display = (row.style.display != 'none') ? 'none' : (Browser.isIE) ? 'block' : 'table-row';
              }
              else
              {
                  fnd = false;
                  break;
              }
          }
      }
  }

  for (i = 0; i < obj.cells[0].childNodes.length; i++)
  {
      var imgObj = obj.cells[0].childNodes[i];
      if (imgObj.tagName == "IMG" && imgObj.src != 'images/menu_arrow.gif')
      {
          imgObj.src = (imgObj.src == imgPlus.src) ? 'images/menu_minus.gif' : imgPlus.src;
      }
  }
}
//-->
</script>