<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head><title><!--{$UUDEV_PAGE_TITLE}--></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!--{include file=elements/header.css.html}-->
<!--{include file=elements/header.js.html type=common}-->
<!--{include file=elements/header.js.html type=popbox}-->
<!--{include file=elements/header.js.html type=valid}-->
</head>
<body>
<div id="outside">
	<!--{include file=frame/top.html}-->
	<div id="mainareaContent">
		<!--{include file=frame/left.html}-->
		<div id="rightContent">
			<div id="topContent">
				<div class="sitmap">
					<span class="r"><!--{include file="elements/uuadvad.html"}--></span>互动社区&nbsp;&gt;&nbsp;菜单管理&nbsp;&gt;&nbsp;菜单列表
				</div>
			</div>
			<div class="tabcontent">
				<a href="index.php?r=User.userlist" class="link">会员列表</a>
				<a href="index.php?r=SiteSet.userset" class="link">属性设置</a>
				<a href="index.php?r=User.honourlist" class="link">会员头衔</a>
				<a href="index.php?r=SiteSet.experienceset" class="link">会员经验</a>
				<a href="index.php?r=User.forumroleimg" class="link">管理员身份勋章</a>
				<a href="index.php?r=User.albumlist" class="link">会员相册</a>
				<a href="index.php?r=User.listphotoframe" class="link">会员相框</a>
				<a href="index.php?r=User.msglist" class="link">会员消息</a>
				<a href="index.php?r=SiteSet.msgboxset" class="link">信箱设置</a>
				<a href="index.php?r=Menu" class="nolink">菜单管理</a>
			</div>
			<div id="secrightContent">
				<div class="tableContent2">
					<div class="operation">
						<a href="index.php?r=Menu.addAclMap&menuId=<!--{$menuId}-->">添加权限</a>
						<a id="cmd-del" href="#">删除</a>
					</div>
					<table class="tbl_list" width="100%" cellpadding="0" cellspacing="0" border="0">
						<tr class="thead">
							<td width="5%"><input type="checkbox" class="checkall"/></td>
							<td width="13%">ID</td>
							
							<td width="15%">控制器名称</td>
							<td width="15%">方法名称</td>
							<td width="10%">操作</td>
						</tr>
						<!--{foreach from=$data item=data}-->
						<tr onMouseOver="chgTrColor(this)" onMouseOut="chgTrColor(this)">
							<td><!--{if $data.cms_role != 1}--><input type="checkbox" name="recordId" value="<!--{$data.id}-->" cms_role="<!--{$data.cms_role}-->"/><!--{/if}--></td>
							<td><!--{$data.id}--></td>
							<td><!--{$data.controller}--></td>
							<td><!--{$data.action}--></td>
							<td></td>
						</tr>
						<!--{/foreach}-->
					</table>
					
					<div class="page"><!--{$pager}--></div>
				</div>
			</div>
		</div>
	</div>
</div>
</body>
<script>
$(document).ready(function(){
	$("#parents").change(function(){
		window.location.href = 'index.php?r=Menu&parentId='+$(this).val();
	});
	$("#cmd-del").click(function(){
		var id = checkId();
		if(id!=''){
			$.get("index.php?r=Menu.delete",{ids:id},function(data){
				//alert(data);
				if(data.status==1)
				{
					alert("删除成功");
					window.location.reload();
				}else{
					alert("删除失败");
				}
			},'json');
		}
	});
});
function checkId()
{
	var item = $("[name=recordId]");
	var id = "";
	if (item.size() > 0) {
		item.each(function(){
			if ($(this).attr("checked") == true) {
				id += $(this).val();
				id += ",";
			}
		});
	}
	id = id.substr(0, id.lastIndexOf(","));
	if (id == "") {
		alert("请选择记录");
		return '';
	} else {
		return id;
	}
}
</script>
</html>