<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>31wan - 后台管理中心</title>
<link href="__PUBLIC__/admin/css/reset.css" rel="stylesheet" type="text/css">
<link href="__PUBLIC__/admin/css/zh-cn-system.css" rel="stylesheet" type="text/css">
<link href="__PUBLIC__/admin/css/table_form.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/admin/css/style/zh-cn-styles1.css" title="styles1" media="screen">
<link rel="alternate stylesheet" type="text/css" href="__PUBLIC__/admin/css/style/zh-cn-styles2.css" title="styles2" media="screen">
<link rel="alternate stylesheet" type="text/css" href="__PUBLIC__/admin/css/style/zh-cn-styles3.css" title="styles3" media="screen">
<link rel="alternate stylesheet" type="text/css" href="__PUBLIC__/admin/css/style/zh-cn-styles4.css" title="styles4" media="screen">
<script language="javascript" type="text/javascript" src="__PUBLIC__/admin/js/jquery-1.8.0.min.js"></script>
<script language="javascript" type="text/javascript" src="__PUBLIC__/admin/js/admin_common.js"></script>
<script language="javascript" type="text/javascript" src="__PUBLIC__/admin/js/styleswitch.js"></script>
</head>
<body>
<style type="text/css">
	html{_overflow-y:scroll}
</style>
<script type="text/javascript">
  $(document).ready(function() {
    $("#dnd-example").treeTable({
    	indent: 20
    	});
  });
  
  function checknode(obj)
  {

      var chk = $("input[type='checkbox']");
      var count = chk.length;
      var num = chk.index(obj);
      var level_top = level_bottom =  chk.eq(num).attr('level')
      for (var i=num; i>=0; i--)
      {
              var le = chk.eq(i).attr('level');
              if(eval(le) < eval(level_top)) 
              {
                  chk.eq(i).attr("checked",'checked');
                  var level_top = level_top-1;
              }
      }
      for (var j=num+1; j<count; j++)
      {
              var le = chk.eq(j).attr('level');
              if(chk.eq(num).attr("checked")=='checked') {
                  if(eval(le) > eval(level_bottom)) chk.eq(j).attr("checked",'checked');
                  else if(eval(le) == eval(level_bottom)) break;
              }
              else {
                  if(eval(le) > eval(level_bottom)) chk.eq(j).attr("checked",false);
                  else if(eval(le) == eval(level_bottom)) break;
              }
      }
  }
</script>
<div class="table-list" id="load_priv">
<table cellspacing="0" width="100%">
	<thead>
	<tr>
	<th class="text-l cu-span" style="padding-left:30px;"></th>
	</tr>
	</thead>
</table>
<form name="myform" action="{:U('Global/role_priv')}" method="post">
<input name="roleid" value="4" type="hidden">
<input name="siteid" value="1" type="hidden">
<table class="treeTable" id="dnd-example" cellspacing="0" width="100%">
<tbody>
   <volist name= "list" id="vo"> 
    <tr>
    <td align="left">
     <input name="menuid[]" value="{$vo.id}" level="<?php if($vo['fid']==0){ echo '0';}else{echo '1';}?>"  onclick="javascript:checknode(this);" type="checkbox" <?php if($vo['flag']==1){ echo 'checked';}?>></td>
    <td class="tdleft">{$vo.space}{$vo.cname}
	<font color="blue"><eq name="vo.hidden" value="1">[隐藏]-{$vo.module_alias}<else/>({$vo.module_alias})</eq></font>
	</td>
  </tr>
 </volist> 
</tbody>
</table>
<input value="{$roleid}" name="roleid" type="hidden">
    <div class="btn"><input class="button" name="dosubmit" id="dosubmit" value="提交" type="submit"></div>
</form>
</div>



</body></html>