<%@ Page CodeFileBaseClass="AliCMS.Lib.SystemModule.Privilege.List" %>
<%@ Register TagPrefix="alicmsUC" TagName="Ime" Src="../../ime.dwt.ascx"%>
<%@ Register TagPrefix="alicmsUC" TagName="LanguageMenu" Src="../../language_menu.dwt.ascx"%>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>特权设置</title>
<link rel="stylesheet"  href="<%=CommonPath%>jquery/themes/lightness/all.css" >
<ali:Comment><link rel="stylesheet"  href="../../S01/CHS/css/common.css" ></ali:Comment>
<link rel="stylesheet" href="<%=CssPath%>common.css" >
<alicmsUC:Ime Ime="false" Eot="true" runat="server" />
<script >
var _page = 'privilege'
    _lang = '<%=ContentLang%>',
    _webPath = '<%=WebPath%>',
    _imagePath = '<%=ImagePath%>',
    _addIndex = 0,
    _addList = new Array(),
    _deleteIndex = 0,
    _deleteList = new Array(),
    _lang_working = '正在操作...',
    _lang_operation_fail = '操作失败！',
    _lang_operation_success = '操作成功！',
    _lang_no_changes = '没有任何变化！无需保存！';
</script>
</head>
<body>
<div class="WhiteHeader">
	<div class="Left"><img src="<%=ImagePath%>close_frame.gif" ></div>
	<div class="Title">特权设置</div>
	<div class="LanguageFilter"></div>
</div>
<div class="Block">
	<ul class="TabMenu">
		<li class="Left"></li>
		<li class="Middle"><a href="../role/list.aspx?Lang=<%=ContentLang%>">角色列表</a></li>
		<li class="Right"></li>
		<li class="Left"></li>
		<li class="Middle"><a href="../role/add.aspx?Lang=<%=ContentLang%>">添加角色</a></li>
		<li class="Right"></li>
		<li class="Left Selected"></li>
		<li class="Middle Selected">特权设置</li>
		<li class="Right Selected"></li>
	</ul>
	<ul class="Title">
		<li class="Left"></li>
		<li class="Middle"></li>
		<li class="Right"></li>
	</ul>
	<div class="ToolBar">
		角色：<select id="RoleID" class="Text <%=ContentLang%>Font">
				<option value="">游客</option>
				<ali:List Object="Role">
					<ali:Record>
						<%If Guid.Equals(ID, CurrentRoleID)%>
							<option value="<%=ID%>" selected="selected"><%=Name%></option>
						<%Else%>
							<option value="<%=ID%>"><%=Name%></option>
						<%EndIf%>
					</ali:Record>
				</ali:List>
			</select>
		实例：
			<select id="InstanceID" class="Text <%=ContentLang%>Font">
				<ali:List Object="Instance">
					<ali:Record>
						<%If Guid.Equals(ID, CurrentInstanceID)%>
							<option value="<%=ID%>" ModuleID="<%=ModuleID%>" selected="selected"><%=Name%></option>
						<%Else%>
							<option value="<%=ID%>" ModuleID="<%=ModuleID%>"><%=Name%></option>
						<%EndIf%>
					</ali:Record>
				</ali:List>
			</select>
		语言：
			<select id="CurrentLang" class="Text <%=ContentLang%>Font">
				<ali:List Object="Language">
					<ali:Record>
						<%If Guid.Equals(ID, CurrentLang)%>
							<option value="<%=Ab%>" selected="selected"><%=Name%></option>
						<%Else%>
							<option value="<%=Ab%>"><%=Name%></option>
						<%EndIf%>
					</ali:Record>
				</ali:List>
			</select>
			<input type="button" id="CheckAll" value="全选" >
			<input id="Save" type="button" value="保存" >
	</div>
	<div id="List">
		<table border="0" cellpadding="4" cellspacing="1">
			<thead>
				<tr>
					<th>对象</th>
					<th>特权</th>
				</tr>
			</thead>
			<tbody>
				<ali:List ID="ObjectTableID" Object="Module.Object" Source="ObjectTable">
					<ali:Record>
						<tr id="Row<%=InnerID%>" ItemID="<%=InnerID%>">
							<td style="white-space:nowrap">
								<input type="checkbox" name="ObjectID" id="Ob<%=InnerID%>" ><label for="Ob<%=InnerID%>" class="<%=ContentLang%>Font"><%=Label%></label>
							</td>
							<td>
								<ali:List Object="Module.Object.Operation" Condition="ObjectID=ID">
									<ali:Record>
										<%If HasPrivilege(Record)%>
											<input type="checkbox" name="OperationID" id="Op<%=ObjectTableID[InnerID]%>_<%=Index%>" value="<%=ID%>" checked="checked" PrivilegeID="<%=GetPrivilegeID(Record)%>" ObjectID="<%=ObjectTableID[ID]%>" ObjectName="<%=ObjectTableID["FullName"]%>" OperationName="<%=Name%>" >
										<%Else%>
											<input type="checkbox" name="OperationID" id="Op<%=ObjectTableID[InnerID]%>_<%=Index%>" value="<%=ID%>" PrivilegeID="" ObjectID="<%=ObjectTableID[ID]%>" ObjectName="<%=ObjectTableID["FullName"]%>" OperationName="<%=Name%>" >
										<%EndIf%>
										<label for="Op<%=ObjectTableID[InnerID]%>_<%=Index%>" class="<%=ContentLang%>Font"><%=Label%></label>
									</ali:Record>
								</ali:List>
							</td>
						</tr>
					</ali:Record>
				</ali:List>
			</tbody>
		</table>
	</div>
	<div class="Footer"></div>
</div>
<script src="<%=CommonPath%>jquery/core.js"></script>
<script src="<%=CommonPath%>jquery/ui.js"></script>
<script src="<%=CommonPath%>utility.js"></script>
<script src="<%=JsPath%>tree_handler.js"></script>
<script src="<%=JsPath%>global.js"></script>
<script src="<%=ModuleJsPath%>module.js"></script>
</body>
</html>