123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194 |
- /*******************************************************************************
- * iNethinkCMS - 网站内容管理系统
- * Copyright (C) 2012-2013 inethink.com
- *
- * @author jackyang <69991000@qq.com>
- * @website http://cms.inethink.com
- * @version 1.3.6.0 (2013-08-14)
- *
- * This is licensed under the GNU LGPL, version 3.0 or later.
- * For details, see: http://www.gnu.org/licenses/gpl-3.0.html
- *******************************************************************************/
- using System;
- using System.Collections.Generic;
- using System.Web;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using iNethinkCMS.Command;
- using iNethinkCMS.Web.UI;
- using System.Collections.Specialized;
- using System.Text.RegularExpressions;
- namespace iNethinkCMS.Web.admin
- {
- public partial class _main_left :Admin_BasePage
- {
- public string vMenuName = "";
- public string vMenuCon = "";
- protected void Page_Load(object sender, EventArgs e)
- {
- CheckUserPower("login");
- string vMenu = Request["menu"];
- if (vMenu == null || vMenu.Length < 1)
- {
- vMenu = "news";
- }
- //System.Environment.NewLine
- switch (vMenu)
- {
- case "news":
-
- if (this.SysLoginUserType == 1)
- {
- vMenuName = "内容管理";
- vMenuCon = "<a href='news/news_content.aspx?act=guide' target='main'>添加内容</a>";
- vMenuCon += "<a href='news/news_content.aspx' target='main'>内容管理</a>";
- if (this.SysLoginUserPower.IndexOf("f,") >=0)
- {
- vMenuCon += "<p></p>";
- vMenuCon += "<a href='../plugs/guestbook/guestbook_manage.aspx' target='main'>留言管理</a>";
- }
- if (this.SysLoginUserPower.IndexOf("g,") >= 0)
- {
- this.vMenuCon += "<p></p>";
- this.vMenuCon += "<a href='../plugs/comment/comment_manage.aspx' target='main'>评论管理</a>";
- }
- if (this.SysLoginUserPower.IndexOf("h,") >= 0)
- {
- this.vMenuCon += "<p></p>";
- this.vMenuCon += "<a href='../plugs/digg/digg_manage.aspx' target='main'>投票管理</a>";
- }
- }
- else {
- this.vMenuName = "用户中心";
- if (this.SysRegisteredUsersIsManage)
- {
- vMenuCon = "<a href='news/news_content.aspx?act=guide' target='main'>添加内容</a>";
- vMenuCon += "<a href='news/news_content.aspx' target='main'>内容管理</a>";
- if (this.SysLoginUserPower.IndexOf("f,") >= 0)
- {
- vMenuCon += "<p></p>";
- vMenuCon += "<a href='../plugs/guestbook/guestbook_manage.aspx' target='main'>留言管理</a>";
- }
- if (this.SysLoginUserPower.IndexOf("g,") >= 0)
- {
- this.vMenuCon += "<a href='../plugs/comment/comment_manage.aspx' target='main'>评论管理</a>";
- }
- if (this.SysLoginUserPower.IndexOf("h,") >= 0)
- {
- this.vMenuCon += "<a href='../plugs/digg/digg_manage.aspx' target='main'>投票管理</a>";
- }
- vMenuCon += "<p></p>";
- }
- this.vMenuCon += "<a href='/Register.aspx?id="+this.SysLoginUserID.ToString()+"' target='main'>帐号管理</a>";
- if (this.siteConfig.UserManagedCenters.Trim().Length > 3)
- {
- try
- {
- string[] userMenuValues = this.siteConfig.UserManagedCenters.Trim().Split('|');
- foreach (string usrMenuValue in userMenuValues)
- {
- if (usrMenuValue.Trim().Length > 2)
- {
- string[] mValues = usrMenuValue.Trim().Split(':');
- if (mValues.Length == 4)
- {
- if (mValues[3].Trim() == "1")
- {
- this.vMenuCon += "<p></p>";
- }
- NameValueCollection nvcList = new NameValueCollection();
- string baseUrl = "";
- ParseUrl(mValues[1].Trim(), out baseUrl, out nvcList);
- if (this.SysRegisteredUsersChannelPower.IndexOf(nvcList["pcid"] + ",") < 0)
- {
- this.vMenuCon += "<a href='/channel.aspx?id=" + nvcList["pcid"] + "' target='_blank'>" + mValues[0].Trim() + "</a>";
- }
- else {
- this.vMenuCon += "<a href='" + mValues[1].Trim() + "' target='" + mValues[2].Trim() + "'>" + mValues[0].Trim() + "</a>";
- }
-
- }
- }
- }
- }
- catch (Exception ex){
- Response.Write(ex.Message);
- }
-
- }
- }
- break;
- case "column":
- vMenuName = "栏目&专题";
- vMenuCon = "<a href='news/news_column.aspx?act=guide' target='main'>添加栏目</a>";
- vMenuCon += "<a href='news/news_column.aspx' target='main'>栏目管理</a>";
- vMenuCon += "<p></p>";
- vMenuCon += "<a href='news/news_special.aspx' target='main'>专题管理</a>";
- break;
- case "module":
- vMenuName = "扩展模块";
- vMenuCon += "<a href='extend/extend_blogroll.aspx' target='main'>友情连接</a>";
- vMenuCon += "<a href='extend/extend_dict.aspx' target='main'>数据字典</a>";
- vMenuCon += "<p></p>";
- vMenuCon += "<a href='extend/extend_plugs.aspx' target='main'>插件管理</a>";
- vMenuCon += "<p></p>";
- vMenuCon += "<a href='extend/KHZL.aspx' target='main'>客户资料</a>";
- break;
- case "label":
- vMenuName = "标签&页面";
- vMenuCon = "<a href='custom/custom_tags.aspx' target='main'>自定义标签</a>";
- vMenuCon += "<p></p>";
- vMenuCon += "<a href='custom/custom_pages.aspx' target='main'>自定义页面</a>";
- break;
- case "sys":
- vMenuName = "系统设置";
- vMenuCon = "<a href='sys/sys_user.aspx' target='main'>系统用户管理</a>";
- vMenuCon += "<p></p>";
- vMenuCon += "<a href='sys/sys_upclear.aspx' target='main'>上传文件管理</a>";
- vMenuCon += "<p></p>";
- vMenuCon += "<a href='sys/sys_cache.aspx' target='main'>缓存管理</a>";
- vMenuCon += "<p></p>";
- vMenuCon += "<a href='sys/sys_template.aspx' target='main'>模板管理</a>";
- vMenuCon += "<a href='sys/sys_seo.aspx' target='main'>SEO优化</a>";
- vMenuCon += "<a href='sys/sys_settings.aspx' target='main'>系统设置</a>";
- break;
- }
- }
- /// <summary>
- /// 分析 url 字符串中的参数信息
- /// </summary>
- /// <param name="url">输入的 URL</param>
- /// <param name="baseUrl">输出 URL 的基础部分</param>
- /// <param name="nvc">输出分析后得到的 (参数名,参数值) 的集合</param>
- public static void ParseUrl(string url, out string baseUrl, out NameValueCollection nvc)
- {
- if (url == null)
- throw new ArgumentNullException("url");
- nvc = new NameValueCollection();
- baseUrl = "";
- if (url == "")
- return;
- int questionMarkIndex = url.IndexOf('?');
- if (questionMarkIndex == -1)
- {
- baseUrl = url;
- return;
- }
- baseUrl = url.Substring(0, questionMarkIndex);
- if (questionMarkIndex == url.Length - 1)
- return;
- string ps = url.Substring(questionMarkIndex + 1);
- // 开始分析参数对
- Regex re = new Regex(@"(^|&)?(\w+)=([^&]+)(&|$)?", RegexOptions.Compiled);
- MatchCollection mc = re.Matches(ps);
- foreach (Match m in mc)
- {
- nvc.Add(m.Result("$2").ToLower(), m.Result("$3"));
- }
- }
- }
- }
|