📄 index.cs
字号:
{
base.ClientScript.RegisterClientScriptBlock(base.GetType(), "ClientScript", builder.ToString());
}
}
private void InitSubMenuLi(StringBuilder sb, string channelMenuId)
{
string xpath = this.xmlPath + "/channelMenu[@id='" + channelMenuId + "']";
XmlNode node = this.xmlDoc.SelectSingleNode(xpath);
if ((node != null) && node.HasChildNodes)
{
foreach (XmlNode node2 in node)
{
string str5;
string attributeValue = this.GetAttributeValue(node2, "id");
if (!this.CheckIsShowSubMenuLi(node2))
{
continue;
}
if (node2.Name == "mainMenu")
{
string str6;
bool hasChildNodes = node2.HasChildNodes;
if ((((str6 = this.GetAttributeValue(node2, "id")) != null) && (str6 == "NodesManage")) && !PEContext.Current.Admin.IsSuperAdmin)
{
hasChildNodes = RolePermissions.AccessCheckNodePermission(OperateCode.CurrentNodesManage, -1);
}
if (hasChildNodes)
{
sb.Append("<li onmouseover=\"show('" + attributeValue + "');hideOthers('" + attributeValue + "');\" onmouseout=\"hide('" + attributeValue + "')\">\n");
}
else
{
sb.Append("<li onmouseover=\"hideOthers('" + attributeValue + "');\">\n");
}
}
else
{
sb.Append("<li>\n");
}
string str3 = this.GetAttributeValue(node2, "leftUrl");
string str4 = this.GetAttributeValue(node2, "rightUrl");
if (this.GetAttributeValue(node2.ParentNode, "id") != "MenuMyDeskTop")
{
if (string.IsNullOrEmpty(str3) || string.IsNullOrEmpty(str4))
{
sb.Append("<a href=\"#\">\n");
}
else
{
sb.Append("<a href=\"#\" onclick=\"ShowMain('" + str3 + "','" + str4 + "')\">\n");
}
sb.Append(this.GetAttributeValue(node2, "title"));
sb.Append("</a>\n");
}
else
{
string name = node2.Name;
if (name == null)
{
goto Label_025C;
}
if (!(name == "SignOut"))
{
if (name == "Welcome")
{
goto Label_0235;
}
goto Label_025C;
}
sb.Append("<a id=\"LinkButton1\" href=\"Logout.aspx\">" + node2.InnerText + "</a>");
}
goto Label_02AD;
Label_0235:
str5 = string.Format(node2.InnerText, PEContext.Current.Admin.AdminName);
sb.Append(str5);
goto Label_02AD;
Label_025C:;
sb.Append("<a href=\"#\" onclick=\"ShowMain('" + str3 + "','" + str4 + "')\">\n");
sb.Append(attributeValue);
sb.Append("</a>\n");
Label_02AD:
this.InitDivMenu(sb, attributeValue, xpath + "/mainMenu[@id='" + attributeValue + "']");
sb.Append("</li>\n");
}
}
}
protected void Page_Load(object sender, EventArgs e)
{
string str;
this.AdminPageTitle.Text = SiteConfig.SiteInfo.SiteName + "--后台管理";
if (this.Session["IndexRightUrl"] != null)
{
this.IndexRightUrl = this.Session["IndexRightUrl"].ToString();
}
if (this.Session["IndexLeftUrl"] != null)
{
this.IndexLeftUrl = this.Session["IndexLeftUrl"].ToString();
}
this.xmlDoc = new XmlDocument();
HttpContext current = HttpContext.Current;
if (current != null)
{
str = current.Server.MapPath("~/Admin/Common/MainMenu.xml");
}
else
{
str = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Admin/Common/MainMenu.xml");
}
try
{
this.xmlDoc.Load(str);
}
catch (XmlException exception)
{
AdminPage.WriteErrMsg("MainMenu.xml配置文件不符合XML规范,具体错误信息:" + exception.Message, "Index.aspx");
}
this.InitMainMenuJS();
this.InitMainMenu();
this.ShowSubMenu();
this.CheckNewVersionJSUrl = "http://update.powereasy.net/SiteFactory/Version.aspx?Trade=SiteFactory&Product=" + SiteConfig.SiteInfo.ProductEdition + "&SystemVersion=" + ProductVersion;
}
private void ShowSubMenu()
{
XmlNode node = this.xmlDoc.SelectSingleNode(this.xmlPath);
if (node != null)
{
StringBuilder sb = new StringBuilder();
if (node.HasChildNodes)
{
foreach (XmlNode node2 in node)
{
string attributeValue = this.GetAttributeValue(node2, "id");
if (attributeValue == "MenuMyDeskTop")
{
sb.Append("<div id=\"ChannelMenu_" + attributeValue + "\" style=\"width: 100%;\">\n");
}
else
{
sb.Append("<div id=\"ChannelMenu_" + attributeValue + "\" style=\"width: 100%; display: none;\">\n");
}
sb.Append("<ul>\n");
this.InitSubMenuLi(sb, attributeValue);
sb.Append("</ul>\n");
sb.Append("</div>\n");
}
}
this.SubMenu.InnerHtml = sb.ToString();
}
}
public string SubMenuArray()
{
XmlNode node = this.xmlDoc.SelectSingleNode(this.xmlPath);
StringBuilder sb = new StringBuilder();
if (node == null)
{
return null;
}
if (node.HasChildNodes)
{
foreach (XmlNode node2 in node)
{
if (this.CheckPermission(this.GetAttributeValue(node2, "operateCode")))
{
StringHelper.AppendString(sb, "\"ChannelMenu_" + this.GetAttributeValue(node2, "id") + "\"");
}
}
}
sb.Insert(0, "var arr = new Array(");
sb.Append(");");
return sb.ToString();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -