<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<script type="text/javascript">
	function loadMenu(url, menuId, menuKey){
		$.ajax({  
			type: 'POST',  
			dataType : "json",
			data : {"menuId":menuId, "menuKey":menuKey},
			url: "${ROOT_PATH}/setSessionMenuAnon",//请求的action路径  
			success:function(data){ //请求成功后处理函数。
				location.href = "${ROOT_PATH}/" + url;
			}
		}); 
	}
</script>
<div class="sidebar-menu toggle-others fixed">
	<div class="sidebar-menu-inner">
		<header class="logo-env">
		<div class="logo">
			<a href="#" class="logo-expanded" style="color: white; font-size: 15px;">
				<span style="text-align: center; margin-left: 32px;">功能导航</span>
			</a>
		</div>
		</header>
		<ul id="main-menu" class="main-menu">
			<c:forEach items="${SESSION_MENU_LIST}" var="menu">
				<c:set var="menuActive" value="false"></c:set>
				<c:if test="${fn:contains(menu.key, SESSION_MENU_KEY)}">
					<c:set var="menuActive" value="true"></c:set>
				</c:if>
				<c:if test="${menu.hasMenu}">
					<li <c:if test="${menuActive}">class="active opened expanded has-sub"</c:if>>
						<a href="javascript:void(0);">
							<i class="linecons-cog"></i>
							<span class="title">${menu.name }</span>
						</a>
						<ul>
							<c:forEach items="${menu.subMenu}" var="sub">
								<c:set var="subActive" value="false"></c:set>
								<c:if test="${fn:contains(sub.key, SESSION_MENU_KEY)}">
									<c:set var="subActive" value="true"></c:set>
								</c:if>
								<li data-title="${sub.id }" <c:if test="${subActive}">class="active"</c:if>>
									<a href="javascript:;" onclick="loadMenu('${sub.url}', '${sub.id}', '${sub.key}');">
										<span class="title">${sub.name }</span>
									</a>
								</li>
							</c:forEach>
						</ul>
					</li>
				</c:if>
				<c:if test="${!menu.hasMenu}">
					<li <c:if test="${menuActive}">class="active"</c:if>>
						<a href="javascript:;" onclick="loadMenu('${menu.url}', '${menu.id}', '${menu.key}');">
							<i class="linecons-cog"></i>
							<span class="title">${menu.name }</span>
						</a>
					</li>
				</c:if>
			</c:forEach>
		</ul>
	</div>
</div>