<%
Response.Buffer = EW_RESPONSE_BUFFER
%>
<!--#include file="ewcfg11.asp"-->
<!--#include file="aspfn11.asp"-->
<!--#include file="userfn11.asp"-->
<!--#include file="zlogininfo.asp"-->
<%
	Call ew_Header(True, EW_CHARSET)
	Call ew_Connect()
	Set Language = New cLanguage
	Call Language.LoadPhrases()
	If IsEmpty(zlogin) Then Set zlogin = New czlogin

	' Security
	Set Security = New cAdvancedSecurity
	If Not Security.IsLoggedIn() Then Call Security.AutoLogin() ' Auto login
	Call Security.LoadUserLevel() ' Load user level
%>
<!DOCTYPE html>
<html>
<head>
<title><%= Language.Phrase("MobileMenu") %></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="<%= ew_jQueryFile("jquery.mobile-%v.min.css") %>">
<link rel="stylesheet" type="text/css" href="<%= EW_PROJECT_STYLESHEET_FILENAME %>">
<link rel="stylesheet" type="text/css" href="css/ewmobile.css">
<script type="text/javascript" src="<%= ew_jQueryFile("jquery-%v.min.js") %>"></script>
<script type="text/javascript">
	//$(document).bind("mobileinit", function() {
	//	jQuery.mobile.ajaxEnabled = false;
	//	jQuery.mobile.ignoreContentEnabled = true;
	//});
</script>
<script type="text/javascript" src="<%= ew_jQueryFile("jquery.mobile-%v.min.js") %>"></script>
<meta name="generator" content="ASPMaker v11.0.3">
</head>
<body>
<div data-role="page">
	<div data-role="header">
		<h1><%= Language.ProjectPhrase("BodyTitle") %></h1>
	</div>
	<div data-role="content">
<% Dim RootMenu: Set RootMenu = New cMenu: RootMenu.IsMobile = True %>
<%

' Variables for checking menu items for user level
Const EW_SESSION_MENU_AR_USER_LEVEL_PRIV = "z5357901A6B63901A65397248_arUserLevelPriv" ' User Level Privilege Array
Const EW_SESSION_MENU_USER_LEVEL = "z5357901A6B63901A65397248_Status_UserLevelValue" ' User level value
Const EW_MENU_ALLOW_ADMIN = 16
Dim arMenuUserLevelPriv

' Restore user level privilege
If IsArray(Session(EW_SESSION_MENU_AR_USER_LEVEL_PRIV)) Then
	arMenuUserLevelPriv = Session(EW_SESSION_MENU_AR_USER_LEVEL_PRIV)
End If

' Check if menu item is allowed for current user level
Function AllowListMenu(TableName)
		Dim i, priv, thispriv, userlevellist
		userlevellist = CurrentUserLevelList ' Get user level id list
		If userlevellist & "" = "" Then ' Not defined, just get user level
			userlevellist = CurrentUserLevel
		End If
		If IsLoggedIn() Then
			If IsListItem(userlevellist, "-1") Then
				AllowListMenu = True
			Else
				AllowListMenu = False
				priv = 0
				If IsArray(arMenuUserLevelPriv) Then
					For i = 0 to UBound(arMenuUserLevelPriv, 2)
						If CStr(arMenuUserLevelPriv(0, i)) = CStr(TableName) Then
							If IsListItem(userlevellist, arMenuUserLevelPriv(1, i)) Then
								thispriv = arMenuUserLevelPriv(2, i)
								If IsNull(thispriv) Then thispriv = 0
								If Not IsNumeric(thispriv) Then thispriv = 0
								thispriv = CLng(thispriv)
								priv = priv Or thispriv
							End If
						End If
					Next
				End If
				AllowListMenu = CBool(priv And 8)
			End If
		Else
			AllowListMenu = False
		End If
End Function

' Is list item
Function IsListItem(list, item)
	Dim ar, i
	If list = "" Then
		IsListItem = False
	Else
		ar = Split(list, ",")
		For i = 0 to UBound(ar)
			If CStr(item&"") = CStr(Trim(ar(i)&"")) Then
				IsListItem = True
				Exit Function
			End If
		Next
		IsListItem = False
	End If
End Function
%>
<%

' Get Menu Text
Function GetMenuText(Id, Text)
	GetMenuText = Language.MenuPhrase(Id, "MenuText")
	If GetMenuText = "" Then GetMenuText = Text
End Function
%>
<%

' Generate all menu items
RootMenu.Id = EW_MENUBAR_ID
RootMenu.IsRoot = True
RootMenu.AddMenuItem 42, GetMenuText("42", "网站设置"), "", -1, "", "", True, False, True
RootMenu.AddMenuItem 35, GetMenuText("35", "导航设置"), "dhlist.asp", 42, "", "", AllowListMenu("{2B78E68A-24C3-4D57-9E98-91476C455DCC}dh"), False, False
RootMenu.AddMenuItem 29, GetMenuText("29", "SEO优化"), "webseolist.asp", 42, "", "", AllowListMenu("{2B78E68A-24C3-4D57-9E98-91476C455DCC}webseo"), False, False
RootMenu.AddMenuItem 5, GetMenuText("5", "站点信息"), "websetlist.asp", 42, "", "", AllowListMenu("{2B78E68A-24C3-4D57-9E98-91476C455DCC}webset"), False, False
RootMenu.AddMenuItem 43, GetMenuText("43", "关键词关联"), "gjclist.asp", 42, "", "", AllowListMenu("{2B78E68A-24C3-4D57-9E98-91476C455DCC}gjc"), False, False
RootMenu.AddMenuItem 21, GetMenuText("21", "网站栏目管理"), "", -1, "", "", IsLoggedIn(), False, True
RootMenu.AddMenuItem 1, GetMenuText("1", "信息栏目"), "bhlmlist.asp", 21, "", "", AllowListMenu("{2B78E68A-24C3-4D57-9E98-91476C455DCC}bhlm"), False, False
RootMenu.AddMenuItem 8, GetMenuText("8", "信息二级栏目"), "xwlmlist.asp?cmd=resetall", 21, "", "", AllowListMenu("{2B78E68A-24C3-4D57-9E98-91476C455DCC}xwlm"), False, False
RootMenu.AddMenuItem 30, GetMenuText("30", "三级栏目"), "sjlmlist.asp?cmd=resetall", 21, "", "", AllowListMenu("{2B78E68A-24C3-4D57-9E98-91476C455DCC}sjlm"), False, False
RootMenu.AddMenuItem 28, GetMenuText("28", "网站信息管理"), "", -1, "", "", IsLoggedIn(), False, True
RootMenu.AddMenuItem 7, GetMenuText("7", "信息管理"), "xwfblist.asp?cmd=resetall", 28, "", "", AllowListMenu("{2B78E68A-24C3-4D57-9E98-91476C455DCC}xwfb"), False, False
RootMenu.AddMenuItem 27, GetMenuText("27", "在线咨询"), "zxzxlist.asp", -1, "", "", AllowListMenu("{2B78E68A-24C3-4D57-9E98-91476C455DCC}zxzx"), False, False
RootMenu.AddMenuItem 26, GetMenuText("26", "管理中心"), "", -1, "", "", IsLoggedIn(), False, True
RootMenu.AddMenuItem 2, GetMenuText("2", "管理员"), "zloginlist.asp", 26, "", "", AllowListMenu("{2B78E68A-24C3-4D57-9E98-91476C455DCC}login"), False, False
RootMenu.AddMenuItem 4, GetMenuText("4", "管理员等级设置"), "UserLevelslist.asp", 26, "", "", ((Session(EW_SESSION_MENU_USER_LEVEL) And EW_MENU_ALLOW_ADMIN) = EW_MENU_ALLOW_ADMIN), False, False
RootMenu.AddMenuItem 3, GetMenuText("3", "User Level Permissions"), "UserLevelPermissionslist.asp", -1, "", "", ((Session(EW_SESSION_MENU_USER_LEVEL) And EW_MENU_ALLOW_ADMIN) = EW_MENU_ALLOW_ADMIN), False, False
RootMenu.AddMenuItem &HFFFFFFFF, Language.Phrase("Logout"), "logout.asp", -1, "", "", IsLoggedIn(), False, False
RootMenu.AddMenuItem &HFFFFFFFF, Language.Phrase("Login"), "login.asp", -1, "", "", (Not IsLoggedIn() And Right(Request.ServerVariables("URL"), Len("login.asp")) <> "login.asp"), False, False
RootMenu.Render(False)
Set RootMenu = Nothing
%>
	</div><!-- /content -->
</div><!-- /page -->
</body>
</html>
<%
		Set Security = Nothing
	Set Language = Nothing

	' Close connection
	If Not (Conn Is Nothing) Then Conn.Close
	Set Conn = Nothing
%>
