/// <summary> /// 服务器信息页面 /// </summary> public void ServerSummary_GET() { base.RenderTemplate(ResourceMap.GetPageContent(ManagementPage.Server_Summary), new { path = GetPath(), dashurl = Server.DashbordRssServer, soft_ver = Cms.Version, sys_alias = Settings.License_NAME, // + "(KEY:" + Settings.SYS_KEY + ")", server_name = HttpContext.Current.Server.MachineName, server_os = Environment.OSVersion.VersionString, server_local = System.Globalization.CultureInfo.InstalledUICulture.EnglishName, server_ip = Request.ServerVariables["LOCAl_ADDR"], server_host = Request.ServerVariables["SERVER_NAME"], server_iis = Request.ServerVariables["Server_SoftWare"], server_netver = Environment.Version.Major + "." + Environment.Version.Minor + "." + Environment.Version.Build + "." + Environment.Version.Revision, server_https = Request.Url.ToString().IndexOf("https://") != -1 ? "是" : "否", server_port = Request.ServerVariables["Server_Port"], server_hour = String.Format("{0}小时", ((Environment.TickCount / 0x3e8) / 3600).ToString()), server_time = DateTime.Now.ToString(), server_cpu = String.Format("{0},{1}核", Environment.GetEnvironmentVariable("PROCESSOR_IDENTIFIER"), Environment.GetEnvironmentVariable("NUMBER_OF_PROCESSORS")), server_meory = (Environment.WorkingSet / 1024 / 1024) + "M", server_net_meory = ((Double)System.Diagnostics.Process.GetCurrentProcess().WorkingSet64 / 1048576).ToString("N2") + "M", person_os = this.GetOSNameByUserAgent(base.Request.UserAgent), person_ip = base.Request.UserHostAddress, person_soft = base.Request.Browser.Browser, person_softver = base.Request.Browser.Version, person_cookie = base.Request.Browser.Cookies ? "支持" : "<span style=\"color:Red\">不支持</span>", person_java = base.Request.Browser.EcmaScriptVersion.Major >= 1 ? "支持" : "<span style=\"color:Red\">不支持</span>", }); }
/// <summary> /// 分类扩展信息设置 /// </summary> /// <returns></returns> public void Category_Check_GET() { int categoryLft = int.Parse(base.Request["lft"]); IList <int> extendIds = new List <int>(); IList <ExtendFieldDto> list = ExtendFieldCacheManager.GetExtendFields(base.CurrentSite.SiteId); CategoryDto category = ServiceCall.Instance.SiteService.GetCategoryByLft(this.SiteId, categoryLft); foreach (IExtendField extend in category.ExtendFields) { extendIds.Add(extend.Id); } string json = JsonSerializer.Serialize(list); category.ExtendFields = null; string categoryJson = JsonSerializer.Serialize(new { ID = category.Id, Lft = category.Lft, Name = category.Name, ExtendIds = extendIds }); base.RenderTemplate(ResourceMap.GetPageContent(ManagementPage.Site_Extend_Category_Check), new { url = base.Request.RawUrl, json = json, category = categoryJson }); }
public void Forword_GET() { int id = int.Parse(base.Request["archive.id"]); ArchiveDto archive = ServiceCall.Instance.ArchiveService.GetArchiveById(this.SiteId, id); string fullDomain = this.CurrentSite.FullDomain; if (fullDomain.IndexOf("#") != -1) { fullDomain = fullDomain.Replace("#", Cms.Context.Host); } string url = fullDomain + archive.Url; if (String.IsNullOrEmpty(archive.Outline)) { archive.Outline = ArchiveUtility.GetOutline(archive.Content, 100); } //Cms.Context.SiteDomain object data = new { title = archive.Title, outline = archive.Outline, url = url, forword_content = String.Format("<a href=\"{0}\" target=\"_blank\"><strong>{1}</strong><br />{2}</a>", url, archive.Title, archive.Outline), link_content = "" }; base.RenderTemplate(ResourceMap.GetPageContent(ManagementPage.Archive_Forword), data); }
/// <summary> /// 系统设置 /// </summary> public void AppConfig_GET() { object data = new { license_name = Settings.License_NAME, license_key = Settings.License_KEY, site_domain = Request.Url.Host, sys_autowww = Settings.SYS_AUTOWWW, sys_admin_tag = Settings.SYS_ADMIN_TAG, db_prefix = Settings.DB_PREFIX, opti_IndexCacheSeconds = (Settings.Opti_IndexCacheSeconds / 60).ToString(), opti_ClientCacheSeconds = (Settings.Opti_ClientCacheSeconds / 60).ToString(), Opti_GC_Collect_Interval = (Settings.Opti_GC_Collect_Interval / 3600000), opti_debug = Settings.Opti_Debug, server_static = Settings.SERVER_STATIC, server_static_enabled = Settings.SERVER_STATIC_ENABLED, tpl_usefullpath = Settings.TPL_UseFullPath, tpl_usecompress = Settings.TPL_UseCompress }; base.RenderTemplate(ResourceMap.GetPageContent(ManagementPage.App_Config), new { json = JsonSerializer.Serialize(data) }); }
/// <summary> /// 编辑文件 /// </summary> public void EditFile_GET() { string path = Request["path"]; string content, bakinfo; FileInfo file, bakfile; file = new FileInfo(AppDomain.CurrentDomain.BaseDirectory + path); bakfile = new FileInfo(AppDomain.CurrentDomain.BaseDirectory + Helper.GetBackupFilePath(path)); if (!file.Exists) { Response.Write("文件不存在!"); return; } else { if (bakfile.Exists) { bakinfo = String.Format(@"上次修改时间日期:{0:yyyy-MM-dd HH:mm:ss} <a style=""margin-right:20px"" href=""javascript:;"" onclick=""process('restore')"">还原</a>", bakfile.LastWriteTime, path); } else { bakinfo = ""; } } StreamReader sr = new StreamReader(file.FullName); content = sr.ReadToEnd(); sr.Dispose(); //base.RenderTemplate(ManagerResouces.tpl_editfile, new //{ // file=path, // content=content, // bakinfo=bakinfo //}); // Response.Write(ManagerResouces.tpl_editfile.Replace("${file}", path) // .Replace("${content}", content).Replace("${bakinfo}", bakinfo)); content = Regex.Replace(content, "&", "&"); content = Regex.Replace(content, "<", "<"); content = Regex.Replace(content, ">", ">"); base.RenderTemplate( BasePage.CompressHtml(ResourceMap.GetPageContent(ManagementPage.Template_EditFile)), new { file = path, content = content, bakinfo = bakinfo, path = path }); }
/// <summary> /// 模板设置 /// </summary> public void Settings_GET() { string tpl = Request["tpl"]; if (String.IsNullOrEmpty(tpl)) { tpl = base.CurrentSite.Tpl; } var tplSetting = new TemplateSetting(tpl); base.RenderTemplate(ResourceMap.GetPageContent(ManagementPage.Template_Setting), new { //模板 tpl_CFG_OutlineLength = tplSetting.CFG_OutlineLength.ToString(), tpl_CFG_allowAmousComment = tplSetting.CFG_AllowAmousComment ? " checked=\"checked\"" : String.Empty, tpl_CFG_CommentEditorHtml = tplSetting.CFG_CommentEditorHtml, tpl_CFG_ArchiveTagsFormat = tplSetting.CFG_ArchiveTagsFormat, tpl_CFG_FriendLinkFormat = tplSetting.CFG_FriendLinkFormat, tpl_CFG_FriendShowNum = tplSetting.CFG_FriendShowNum, tpl_CFG_NavigatorLinkFormat = tplSetting.CFG_NavigatorLinkFormat, tpl_CFG_NavigatorChildFormat = tplSetting.CFG_NavigatorChildFormat, tpl_CFG_SitemapSplit = tplSetting.CFG_SitemapSplit, tpl_CFG_TrafficFormat = tplSetting.CFG_TrafficFormat }); }
/// <summary> /// 编辑模板 /// </summary> public void Edit_GET() { string tpl = Request["tpl"]; if (String.IsNullOrEmpty(tpl)) { tpl = base.CurrentSite.Tpl; } StringBuilder sb = new StringBuilder(); DirectoryInfo dir = new DirectoryInfo(String.Format("{0}templates/{1}/", AppDomain.CurrentDomain.BaseDirectory, tpl)); if (!dir.Exists) { Response.Redirect(Request.Path + "?module=template&action=templates", true); return; } EachClass.IterialTemplateFiles(dir, sb, tpl); base.RenderTemplate(ResourceMap.GetPageContent(ManagementPage.Template_Edit), new { tplfiles = sb.ToString(), tpl = tpl }); }
/// <summary> /// 链接列表 /// </summary> public void List_GET() { SiteLinkType type = (SiteLinkType)Enum.Parse(typeof(SiteLinkType), HttpContext.Current.Request["type"], true); string linkTypeName; switch (type) { case SiteLinkType.FriendLink: linkTypeName = "友情链接"; break; default: case SiteLinkType.CustomLink: linkTypeName = "自定义链接"; break; case SiteLinkType.Navigation: linkTypeName = "网站导航"; break; } //显示页面 object data = new { linktype = base.Request["type"], linkTypeName = linkTypeName }; base.RenderTemplate(ResourceMap.GetPageContent(ManagementPage.Link_SiteLinkList), data); }
public void Fields_GET() { string form = EntityForm.Build <ExtendFieldDto>(new ExtendFieldDto(), false, "btn"); base.RenderTemplate(ResourceMap.GetPageContent(ManagementPage.Site_Extend_List), new { form = form }); }
public void RelatedLink_GET() { string form = EntityForm.Build <LinkDto>(new LinkDto(), false, "btn"); base.RenderTemplate(ResourceMap.GetPageContent(ManagementPage.Link_RelatedLink), new { form = form }); }
/// <summary> /// 欢迎首页 /// </summary> public void Welcome_GET() { base.RenderTemplate(ResourceMap.GetPageContent(ManagementPage.Welcome), new { path = GetPath(), dashurl = Server.DashbordRssServer, soft_ver = Cms.Version, sys_alias = Settings.License_NAME, }); }
/// <summary> /// 修改资料 /// </summary> public void ModifyUserBasicProfile_GET() { User user = UserState.Administrator.Current; base.RenderTemplate( ResourceMap.GetPageContent(ManagementPage.User_ModifyBasicProfile), new { name = user.Name }); }
/// <summary> /// 登录页面 /// </summary> public void Login_GET() { base.RenderTemplate( ResourceMap.GetPageContent(ManagementPage.Login), new { path = GetPath(), version = Cms.Version, year = DateTime.Now.Year.ToString() }); }
/// <summary> /// 管理首页 /// </summary> //[StaticCache] public void Index_GET() { //if (!Cms.Cache.CheckClientCacheExpiresByEtag()) { return; } //重定向管理页 string path = base.Request.Path; if (base.Request.Url.Query == "" || path.EndsWith("/")) { if (path.EndsWith("/")) { path = path.Substring(0, path.Length - 1); } base.Response.Write(String.Format("<script>window.parent.location.replace('{0}?ver={1}')</script>", path, Cms.Version)); return; } string page_Template; User usr = UserState.Administrator.Current; if (usr.SiteId > 0) { //子站用户跳转标识 //if (base.Request["f"] != "s") //{ // base.Response.Write(String.Format("<script>window.parent.location.replace('{0}?ver={1}&f=s')</script>", base.Request.Path, Cms.Version)); // return; //} //else //{ // page_Template = ResourceMap.GetPageContent(ManagementPage.SUB_Index); //} page_Template = ResourceMap.GetPageContent(ManagementPage.SUB_Index); } else { page_Template = ResourceMap.GetPageContent(ManagementPage.Index); } base.RenderTemplateUseCache(page_Template, new { version = Cms.Version, path = GetPath(), admin_path = Settings.SYS_ADMIN_TAG, //ui_component_path = ResourceMap.GetPageUrl(ManagementPage.UI_Component), ui_css_path = ResourceMap.GetPageUrl(ManagementPage.UI_Index_Css), ui_custom_js_path = ResourceMap.GetPageUrl(ManagementPage.UI_Index_Custom_Js) //initData=new Ajax().GetAppInit() }); }
public void Edit_GET() { int siteID = int.Parse(base.Request["siteId"] ?? "1"); SiteDto site = SiteCacheManager.GetSite(siteID); string html = EntityForm.Build <SiteDto>(site, true, "提交"); base.RenderTemplate(ResourceMap.GetPageContent(ManagementPage.Site_Edit), new { form = html, tpls = Helper.GetTemplateOptions(site.Tpl) }); }
/// <summary> /// 更新用户 /// </summary> public void UpdateUser_GET() { Cms.Context.Items["ajax"] = "1"; model.User usr = CmsLogic.User.GetUser(base.Request["username"]); usr.Password = "******"; string html = EntityForm.Build <model.User>(usr, true, "保存"); base.RenderTemplate(ResourceMap.GetPageContent(ManagementPage.User_Edit), new { entity = html, groups = Helper.GetUserGroupOptions(usr.GroupID) }); }
/// <summary> /// 创建会员 /// </summary> public void CreateUser_GET() { Cms.Context.Items["ajax"] = "1"; string html = EntityForm.Build <model.User>(new model.User { Available = true }, true, "添加用户"); base.RenderTemplate(ResourceMap.GetPageContent(ManagementPage.User_Edit), new { entity = html, sites = Helper.GetSiteOptions(-1), groups = Helper.GetUserGroupOptions(-1) }); }
/// <summary> /// 预览文档 /// </summary> public void View_GET() { int id = int.Parse(base.Request["archive.id"]); ArchiveDto archive = ServiceCall.Instance.ArchiveService.GetArchiveById(this.SiteId, id); User author = CmsLogic.User.GetUser(archive.Author); base.RenderTemplate(ResourceMap.GetPageContent(ManagementPage.Archive_View), new { title = archive.Title, author = author == null ? archive.Author : author.Name + "(" + author.UserName + ")", publishdate = String.Format("{0:yyyy-MM-dd HH:mm:ss}", archive.CreateDate), content = archive.Content, thumbnail = archive.Thumbnail, count = archive.ViewCount }); }
public void Create_GET() { var site = new SiteDto(); var sites = SiteCacheManager.GetAllSites(); if (sites.Count > 0) { site.SiteId = sites[sites.Count - 1].SiteId + 1; //site.Name = "未命名站点"+site.SiteId.ToString(); } string html = EntityForm.Build <SiteDto>(site, true, "创建"); base.RenderTemplate(ResourceMap.GetPageContent(ManagementPage.Site_Edit), new { form = html, tpls = Helper.GetTemplateOptions("") }); }
/// <summary> /// 编辑模板 /// </summary> public void Edit_GET() { StringBuilder sb = new StringBuilder(); DirectoryInfo cssDir = new DirectoryInfo(String.Format("{0}style/", AppDomain.CurrentDomain.BaseDirectory)); DirectoryInfo cfgDir = new DirectoryInfo(String.Format("{0}config/", AppDomain.CurrentDomain.BaseDirectory)); //sb.Append("<optgroup label=\"样式表\">"); //EachClass.EachFiles(cssDir, sb, "style",".css", true); sb.Append("</optgroup><optgroup label=\"设置文件\">"); EachClass.EachFiles(cfgDir, sb, "config", ".xml ; .ini ; .conf", true); sb.Append("</optgroup>"); base.RenderTemplate(ResourceMap.GetPageContent(ManagementPage.File_SelectEdit), new { files = sb.ToString(), systpl = base.CurrentSite.Tpl }); }
public void Index_GET() { IList <SiteDto> sites = SiteCacheManager.GetAllSites(); TreeItem[] items = new TreeItem[sites.Count]; for (int i = 0; i < sites.Count; i++) { items[i] = new TreeItem { ID = sites[i].SiteId, Name = sites[i].Name }; } base.RenderTemplate(ResourceMap.GetPageContent(ManagementPage.Site_Index), new { siteTree = Helper.SingleTree("所有站点", items) }); }
/// <summary> /// 编辑文件 /// </summary> public void EditFile_GET() { string path = Request["path"]; string content, bakinfo; if (path.ToLower().IndexOf("config/cms.config") != -1) { throw new ArgumentException(); } string mode = "html"; string dependJs = String.Empty; FileInfo file, bakfile; file = new FileInfo(AppDomain.CurrentDomain.BaseDirectory + path); bakfile = new FileInfo(AppDomain.CurrentDomain.BaseDirectory + path + ".bak"); switch (file.Extension.ToLower()) { case ".css": dependJs = "/framework/assets/coder/mode/css.js"; mode = "css"; break; case ".conf": case ".config": case ".xml": dependJs = "/framework/assets/coder/mode/xml.js"; mode = "xml"; break; } if (!file.Exists) { Response.Write("文件不存在!"); return; } else { if (bakfile.Exists) { bakinfo = String.Format(@"上次修改时间日期:{0:yyyy-MM-dd HH:mm:ss} <a style=""margin-right:20px"" href=""javascript:;"" onclick=""process('restore')"">还原</a>", bakfile.LastWriteTime, path); } else { bakinfo = ""; } } StreamReader sr = new StreamReader(file.FullName); content = sr.ReadToEnd(); sr.Dispose(); //base.RenderTemplate(ManagerResouces.tpl_editfile, new //{ // file=path, // content=content, // bakinfo=bakinfo //}); // Response.Write(ManagerResouces.tpl_editfile.Replace("${file}", path) // .Replace("${content}", content).Replace("${bakinfo}", bakinfo)); content = Regex.Replace(content, "<", "<"); content = Regex.Replace(content, ">", ">"); base.RenderTemplate(ResourceMap.GetPageContent(ManagementPage.File_Edit), new { file = path, mode = mode, dependJs = dependJs, content = content, bakinfo = bakinfo, path = path }); }
/// <summary> /// 系统用户列表 /// </summary> public void UserIndex_GET() { base.RenderTemplate(ResourceMap.GetPageContent(ManagementPage.User_Index), new { }); }
public void FileManager_GET() { base.RenderTemplate(ResourceMap.GetPageContent(ManagementPage.File_Manager), null); }
public void Dashboard_GET() { base.RenderTemplate( ResourceMap.GetPageContent(ManagementPage.Plugin_Dashboard), null); }
/// <summary> /// 管理后台调用的脚本 /// </summary> public void Read_GET() { HttpContext context = HttpContext.Current; /* * MemoryStream ms = new MemoryStream(); * WebManagerResource.loading_process.Save(ms, ImageFormat.Gif); * string x = Convert.ToBase64String(ms.ToArray()); * ms.Dispose(); * throw new Exception(x); */ //context.Response.Write(Convert.ToBase64String(Encoding.UTF8.GetBytes("ui_component"))); return; /* To Base64 */ //byte[] data2=Encoding.UTF8.GetBytes("sys_tab"); //context.Response.Write(Convert.ToBase64String(data2, 0, data2.Length)); return; const int maxAge = 31536000; DateTime sinceTime; DateTime nowTime = DateTime.Now.ToUniversalTime(); string sinceModified = context.Request.Headers.Get("If-Modified-Since"); DateTime.TryParse(sinceModified, out sinceTime); sinceTime = sinceTime.ToUniversalTime(); if (!String.IsNullOrEmpty(sinceModified) && (nowTime - sinceTime).TotalSeconds < maxAge) { context.Response.StatusCode = 304; context.Response.Status = "304 Not Modified"; return; } else { if (Settings.Opti_SupportGZip) { context.Response.Filter = new GZipStream(context.Response.Filter, CompressionMode.Compress); context.Response.AddHeader("Content-Encoding", "gzip"); } context.Response.AddHeader("Cache-Control", "max-age=" + maxAge.ToString()); context.Response.AddHeader("Last-Modified", nowTime.ToString("r")); context.Response.AddHeader("Expires", DateTime.Now.AddYears(1).ToString("r")); context.Response.AddHeader("ETag", "\"" + DateTime.Now.Ticks + "\""); /* * response.Cache.SetETag(lastModified.Ticks.ToString()); * response.Cache.SetLastModified(lastModified); * //public 以指定响应能由客户端和共享(代理)缓存进行缓存。 * response.Cache.SetCacheability(HttpCacheability.Public); * //是允许文档在被视为陈旧之前存在的最长绝对时间。 * response.Cache.SetMaxAge(new TimeSpan(7, 0, 0, 0)); * //将缓存过期从绝对时间设置为可调时间 * response.Cache.SetSlidingExpiration(true); */ string filename = Encoding.UTF8.GetString(Convert.FromBase64String(context.Request["res"])); //获取文件MImE类型 string mime = fileMImE.ContainsKey(filename) ? fileMImE[filename] : "text/plain"; if (Regex.IsMatch(mime, "^image\\/(jpg|png|gif)$", RegexOptions.IgnoreCase)) { //ajax_loading图片 if (filename == "ajax_loader") { //const string data = "R0lGODlhGAAYAPQAAP///wCA/87m/vr8/uDv/rDX/ujz/o7G/sjj/pzN/tjr/qjT/sDf/vL4/na6/obC/rjb/miz/gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH+GkNyZWF0ZWQgd2l0aCBhamF4bG9hZC5pbmZvACH5BAAHAAAAIf8LTkVUU0NBUEUyLjADAQAAACwAAAAAGAAYAAAFriAgjiQAQWVaDgr5POSgkoTDjFE0NoQ8iw8HQZQTDQjDn4jhSABhAAOhoTqSDg7qSUQwxEaEwwFhXHhHgzOA1xshxAnfTzotGRaHglJqkJcaVEqCgyoCBQkJBQKDDXQGDYaIioyOgYSXA36XIgYMBWRzXZoKBQUMmil0lgalLSIClgBpO0g+s26nUWddXyoEDIsACq5SsTMMDIECwUdJPw0Mzsu0qHYkw72bBmozIQAh+QQABwABACwAAAAAGAAYAAAFsCAgjiTAMGVaDgR5HKQwqKNxIKPjjFCk0KNXC6ATKSI7oAhxWIhezwhENTCQEoeGCdWIPEgzESGxEIgGBWstEW4QCGGAIJEoxGmGt5ZkgCRQQHkGd2CESoeIIwoMBQUMP4cNeQQGDYuNj4iSb5WJnmeGng0CDGaBlIQEJziHk3sABidDAHBgagButSKvAAoyuHuUYHgCkAZqebw0AgLBQyyzNKO3byNuoSS8x8Ofw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R5oWUIpz8pAEAMe6TwfwyYsGo/IpFKSAAAh+QQJCgAAACwAAAAAEAAQAAADMwi6ImKQORfjdOe82p4wGccc4CEuQradylesojEMBgsUc2G7sDX3lQGBMLAJibufbSlKAAAh+QQJCgAAACwAAAAAEAAQAAADMgi63P7wCRHZnFVdmgHu2nFwlWCI3WGc3TSWhUFGxTAUkGCbtgENBMJAEJsxgMLWzpEAACH5BAkKAAAALAAAAAAQABAAAAMyCLrc/jDKSatlQtScKdceCAjDII7HcQ4EMTCpyrCuUBjCYRgHVtqlAiB1YhiCnlsRkAAAOwAAAAAAAAAAAA=="; HttpContext.Current.Response.BinaryWrite(Convert.FromBase64String(data)); } else if (filename == "load_process") { const string data = "R0lGODlhQAAKAMIAAMzOzOTm5NTW1Pz6/Nza3P///wAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJBgAFACwAAAAAQAAKAAADb1i63P4wykmrvXLowTZfXreJGvkpITgugEAATPvGLszW9Hzrimz3uAUhECAwBETjAlk8Jp3N5VMaVTCV1mm2WhhyvdiuVvwdg2MEXgGQ/q3baDVbDmfVe/dCCrXil1R/fid6fYSBhoMYiouMjY4XCQAh+QQJBgAJACwAAAAAQAAKAIPEwsTk5uTU0tTc2tzMysz8+vzU1tTc3tzMzsz///8AAAAAAAAAAAAAAAAAAAAAAAAEmTDJSau9OOs8BPLesI1kaRnHoA6HIRVwQcXyRM8xDuv1mycoAAEBaEkQAwOCgjAMlpPmk+mEHqvUaRSbYBEMAoKxGwiIJobyWZI2U9proPo9R9dRBIFB7JK7JwN1EoF/g4JkhYhxhGdOQgRFfQIqVglIWkeUTJpRnJmYlpwoSSljNzY/Pjuoq6o9CaeugwIgH3EmuLm6u7wbEQAh+QQJBgALACwAAAAAQAAKAIOkoqTU1tS8urz8+vzMzsysrqzk5uTEwsTc2ty8vry0trT///8AAAAAAAAAAAAAAAAElnDJSau9OOssgP/CJo6kVSRoWkhDO1DuO8WwW7e3zNpLcSgCheKwWhAQAQKFEEAo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BAFWEpeZCwiYUp2fSqJQpDZZCVs9XmBiJzEusK8zsbSzNQsvEjo5OT0AwEBDH8TFGEgIycmFxs3OExEAIfkECQYABwAsAAAAAEAACgCCtLK03NrczM7M/Pr8tLa05Obk1NbU////A3x4utz+MMpJq71y6ME2X163iRr5KaECrOwiGIHAvPEMy+5t1zmv0LgDQUAUEBaBQiHAMCiZC+ey+aROo1XsVVg0HBVSKDirSG4PZjGavD6nFwRD8XsQBHz1ezCPt/f1M4AuglxzICOHJYknBykoiI+KkScsLRiXmJmam5cJADs="; HttpContext.Current.Response.BinaryWrite(Convert.FromBase64String(data)); } else { #region 管理后台LOGO if (filename == "cms_top_logo") { FileInfo file = new FileInfo(String.Format("{0}{1}local/logo.gif", AppDomain.CurrentDomain.BaseDirectory, CmsVariables.FRAMEWORK_PATH)); if (file.Exists) { using (Bitmap bit = new Bitmap(file.FullName)) { MemoryStream stream = new MemoryStream(); bit.Save(stream, ImageFormat.Gif); bit.Dispose(); context.Response.BinaryWrite(stream.ToArray()); stream.Dispose(); } return; } } #endregion using (Bitmap bit = WebManagerResource.ResourceManager.GetObject(filename) as Bitmap) { MemoryStream stream = new MemoryStream(); bit.Save(stream, ImageFormat.Gif); bit.Dispose(); context.Response.BinaryWrite(stream.ToArray()); stream.Dispose(); } } } else { if (filename == "style") { context.Response.Write( ResourceUtility.CompressHtml( ResourceMap.GetPageContent(ManagementPage.Css_Style) )); } else { context.Response.Write(ResourceUtility.CompressHtml(WebManagerResource.ResourceManager.GetString(filename))); } } HttpContext.Current.Response.ContentType = mime; // HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=cms"); } }
/// <summary> /// 供首页调用 /// </summary> public void MiniApps_Get() { base.RenderTemplate( ResourceMap.GetPageContent(ManagementPage.Plugin_MiniApps), null); }
/// <summary> /// 文档列表 /// </summary> public void List_GET() { HttpRequest request = HttpContext.Current.Request; const int __pageSize = 10; object data; //返回的数据 int pageSize, pageIndex, recordCount, pages; bool?visible, special, system, aspage; int?categoryID = null, moduleID = null; string _categoryId = request["category.id"], //只有这个参数为必传 _moduleId = request["moduleId"], _pageIndex = request["page"] ?? "1", _pageSize = request["size"], _author = request["author"], _visible = request["visible"], _special = request["special"], _system = request["system"], _aspage = request["aspage"]; StringBuilder sb = new StringBuilder(); string categoryOpts, //栏目Options pagerHtml, //分页链接 tableHeaderText, //表头字段 archiveListHtml; //文档列表HTML goto result; //处理页码大小并保存 if (!Regex.IsMatch(_pageIndex, "^(?!0)\\d+$")) { pageIndex = 1; //If pageindex start with zero or lower } else { pageIndex = int.Parse(_pageIndex); } if (String.IsNullOrEmpty(_pageSize)) { object o = HttpContext.Current.Session["archivelist_pagesize"]; int.TryParse(HttpContext.Current.Session["archivelist_pagesize"] as string, out pageSize); } else { int.TryParse(_pageSize, out pageSize); HttpContext.Current.Session["archivelist_pagesize"] = pageSize; } if (pageSize == 0) { pageSize = __pageSize; } //文档显示选项 #region if (String.IsNullOrEmpty(_visible)) { visible = null; } else { visible = String.Compare(_visible, String.Intern("true"), true) == 0; } if (String.IsNullOrEmpty(_special)) { special = null; } else { special = String.Compare(_special, String.Intern("true"), true) == 0; } if (String.IsNullOrEmpty(_system)) { system = null; } else { system = String.Compare(_system, String.Intern("true"), true) == 0; } if (String.IsNullOrEmpty(_aspage)) { aspage = null; } else { aspage = String.Compare(_aspage, String.Intern("true"), true) == 0; } #endregion //获取表头 bool isMaster = (UserGroups)UserState.Administrator.Current.GroupID == UserGroups.Master; tableHeaderText = isMaster ? "<th style=\"width:60px\" class=\"center\">发布人</th>" : String.Empty; //加载栏目 ServiceCall.Instance.SiteService.HandleCategoryTree(this.SiteId, 1, (category, level) => { sb.Append("<option value=\"").Append(category.ID.ToString()).Append("\">"); for (var i = 0; i < level; i++) { sb.Append("-"); } sb.Append(category.Name).Append("</option>"); }); categoryOpts = sb.ToString(); sb.Remove(0, sb.Length); string[,] flags = new string[, ] { { ArchiveFlag.GetInternalFlagKey(BuiltInArchiveFlags.IsSystem), system == null?"":(system.Value?"1":"0") }, { ArchiveFlag.GetInternalFlagKey(BuiltInArchiveFlags.IsSpecial), special == null?"":(special.Value?"1":"0") }, { ArchiveFlag.GetInternalFlagKey(BuiltInArchiveFlags.Visible), visible == null?"":(visible.Value?"1":"0") }, { ArchiveFlag.GetInternalFlagKey(BuiltInArchiveFlags.AsPage), aspage == null?"":(aspage.Value?"1":"0") } }; //文档数据表,并生成Html DataTable dt = ServiceCall.Instance.ArchiveService.GetPagedArchives(this.SiteId, categoryID, _author, flags, null, false, pageSize, pageIndex, out recordCount, out pages); //moduleID == null ? CmsLogic.Archive.GetPagedArchives(categoryID, _author,flags, null, false, pageSize, pageIndex, out recordCount, out pages) //: CmsLogic.Archive.GetPagedArchives((SysModuleType)(moduleID ?? 1), _author, flags,null, false, pageSize, pageIndex, out recordCount, out pages); IDictionary <string, bool> flagsDict; bool isSpecial, isSystem, isVisible, isPage; foreach (DataRow dr in dt.Rows) { flagsDict = ArchiveFlag.GetFlagsDict(dr["flags"].ToString()); isSpecial = flagsDict.ContainsKey(ArchiveFlag.GetInternalFlagKey(BuiltInArchiveFlags.IsSpecial)) && flagsDict[ArchiveFlag.GetInternalFlagKey(BuiltInArchiveFlags.IsSpecial)]; isSystem = flagsDict.ContainsKey(ArchiveFlag.GetInternalFlagKey(BuiltInArchiveFlags.IsSystem)) && flagsDict[ArchiveFlag.GetInternalFlagKey(BuiltInArchiveFlags.IsSystem)]; isVisible = flagsDict.ContainsKey(ArchiveFlag.GetInternalFlagKey(BuiltInArchiveFlags.Visible)) && flagsDict[ArchiveFlag.GetInternalFlagKey(BuiltInArchiveFlags.Visible)]; isPage = flagsDict.ContainsKey(ArchiveFlag.GetInternalFlagKey(BuiltInArchiveFlags.AsPage)) && flagsDict[ArchiveFlag.GetInternalFlagKey(BuiltInArchiveFlags.AsPage)]; //编号 sb.Append("<tr indent=\"").Append(dr["id"].ToString()).Append("\"><td align=\"center\">").Append(dr["id"].ToString()).Append("</td>"); //标题 sb.Append("<td").Append(isSpecial ? " class=\"special\">" : ">").Append(dr["title"].ToString()); if (!String.IsNullOrEmpty(dr["alias"] as string)) { sb.Append(" <span style=\"color:#777\">( 别名:").Append(dr["alias"].ToString()).Append(" )</span>"); } sb.Append("</td>"); //管理员可以查看发布人 if (isMaster) { sb.Append("<td class=\"center\"><a href=\"?module=archive&action=list&moduleID=").Append(_moduleId).Append("&author=") .Append(dr["author"].ToString()).Append("\" title=\"查看该用户发布的文档\">").Append(dr["Author"].ToString()).Append("</a></td>"); } sb.Append("<td>").Append(String.Format("{0:yyyy/MM/dd HH:mm}", Convert.ToDateTime(dr["CreateDate"]))).Append("</td><td align=\"center\">") .Append(dr["ViewCount"].ToString()).Append("</td><td><button class=\"refresh\" /></td><td><button class=\"file\" /></td><td><button class=\"edit\" /></td><td><button class=\"delete\" /></td></tr>"); } archiveListHtml = sb.ToString(); string format = String.Format("?module=archive&action=list&categoryID={0}&moduleID={1}&page={2}&size={3}&author={4}&visible={5}&special={6}&system={7}", _categoryId, _moduleId, "{0}", pageSize, _author, _visible, _special, _system); pagerHtml = Helper.BuildPagerInfo(format, pageIndex, recordCount, pages); result: data = new { moduleID = _moduleId ?? String.Empty, categoryID = _categoryId ?? String.Empty, username = _author }; base.RenderTemplate(ResourceMap.GetPageContent(ManagementPage.Archive_List), data); }
/// <summary> /// 创建文档 /// </summary> public void Create_GET() { object data; string tpls, nodesHtml, //栏目JSON extendFieldsHtml = "", //属性Html extendItemsHtml = ""; Module module; int categoryId = int.Parse(base.Request["category.id"] ?? "1"); //分类ID CategoryDto category = ServiceCall.Instance.SiteService.GetCategory(base.SiteId, categoryId); //获取模板视图下拉项 StringBuilder sb2 = new StringBuilder(); //模板目录 DirectoryInfo dir = new DirectoryInfo( String.Format("{0}templates/{1}", AppDomain.CurrentDomain.BaseDirectory, Settings.TPL_MultMode ? "" : base.CurrentSite.Tpl + "/" )); EachClass.EachTemplatePage( dir, sb2, TemplatePageType.Custom, TemplatePageType.Archive ); tpls = sb2.ToString(); sb2.Remove(0, sb2.Length); //获取该模块栏目JSON数据 //categoryJSON = CmsLogic.Category.GetJson(m.ID); ServiceCall.Instance.SiteService.HandleCategoryTree(this.SiteId, 1, (_category, level) => { sb2.Append("<option value=\"").Append(_category.ID.ToString()).Append("\""); if (_category.ID == category.ID) { sb2.Append(" selected=\"selected\""); } sb2.Append(">"); for (int i = 0; i < level; i++) { sb2.Append(CmsCharMap.Dot); } sb2.Append(_category.Name).Append("</option>"); }); nodesHtml = sb2.ToString(); //============= 拼接模块的属性值 ==============// /* * //========= 统计tab =============// * sb.Append("<ul class=\"dataExtend_tabs\">"); * foreach (DataExtend e in extends) * { * sb.Append("<li><span>").Append(e.Name).Append("</span></li>"); * } * sb.Append("</ul>"); * * extendItemsHtml = sb.ToString(); * * sb.Capacity = 1000; * sb.Remove(0, sb.Length); */ //======== 生成值 =============// StringBuilder sb = new StringBuilder(500); sb.Append("<div class=\"dataextend_item\">"); foreach (IExtendField p in category.ExtendFields) { sb.Append("<dl><dt>").Append(p.Name).Append(":</dt><dd>"); if (p.Type == ((int)PropertyUI.Text).ToString()) { sb.Append("<input type=\"text\" class=\"tb_normal\" field=\"extend_").Append(p.ID.ToString()) .Append("\" value=\"").Append(p.DefaultValue).Append("\"/>"); } else if (p.Type == ((int)PropertyUI.Upload).ToString()) { sb.Append("<input type=\"text\" disabled=\"disabled\" class=\"tb_normal\" id=\"extend_").Append(p.ID.ToString()) .Append("\" field=\"extend_").Append(p.ID.ToString()) .Append("\" value=\"").Append(p.DefaultValue).Append("\"/><span id=\"upload_") .Append(p.ID.ToString()).Append("\">选择文件</span>") .Append("<script type=\"text/javascript\">cms.propertyUpload(") .Append("'upload_").Append(p.ID.ToString()).Append("','extend_").Append(p.ID.ToString()).Append("');</script>"); } sb.Append("</dd></dl>"); /*<p><span class="txt">标签:</span> * <span class="input"><input type="text" name="tags" size="30"/></span> * <span class="msg"></span></p> */ } sb.Append("</div>"); extendFieldsHtml = sb.ToString(); // extendFieldsHtml = "<div style=\"color:red;padding:20px;\">所选栏目模块不包含任何自定义属性,如需添加请到模块管理-》属性设置</div>"; object json = new { Thumbnail = CmsVariables.FRAMEWORK_ARCHIVE_NoPhoto }; data = new { extendFieldsHtml = extendFieldsHtml, extendItemsHtml = extendItemsHtml, thumbPrefix = CmsVariables.Archive_ThumbPrefix, nodes = nodesHtml, url = Request.Url.PathAndQuery, tpls = tpls, json = JsonSerializer.Serialize(json) }; base.RenderTemplate(ResourceMap.GetPageContent(ManagementPage.Archive_Create), data); }
/// <summary> /// 更新文档 /// </summary> public void Update_GET() { object data; int archiveId = int.Parse(base.Request["archive.id"]); string tpls, nodesHtml, //栏目JSON extendFieldsHtml = "", //属性Html extendItemsHtml = ""; Module module; int siteId = this.CurrentSite.SiteId; ArchiveDto archive = ServiceCall.Instance.ArchiveService.GetArchiveById(siteId, archiveId); int categoryId = archive.Category.ID; #region 旧的 //获取上次发布的栏目 //Category category = CmsLogic.Category.Get(a => a.ID == archive.Category.ID); //if (base.CompareSite(category.SiteId)) return; //bool categoryIsNull = category == null; /* * if (!categoryIsNull) * { * * module = CmsLogic.Module.GetModule(category.ModuleID); * * //============= 拼接模块的属性值 ==============// * * StringBuilder sb = new StringBuilder(50); * IList<DataExtend> extends = null;// new List<DataExtend>(CmsLogic.DataExtend.GetExtendsByModule(module)); * * if (extends.Count > 0) * { * * //========= 统计tab =============// * sb.Append("<ul class=\"dataExtend_tabs\">"); * foreach (DataExtend e in extends) * { * sb.Append("<li><span>").Append(e.Name).Append("</span></li>"); * } * sb.Append("</ul>"); * * extendItemsHtml = sb.ToString(); * * sb.Capacity = 1000; * sb.Remove(0, sb.Length); * * * //======== 生成值 =============// * * IEnumerable<DataExtendAttr> attrs; * IDictionary<string, string> extendFields = null;// CmsLogic.DataExtend.GetExtendFiledDictionary(archive.ID); * string attrValue; * * foreach (DataExtend e in extends) * { * sb.Append("<div class=\"dataextend_item\">"); * * attrs = CmsLogic.DataExtend.GetExtendAttrs(e.ID); * * foreach (DataExtendAttr p in attrs) * { * * * attrValue = extendFields.ContainsKey(p.AttrName) ? extendFields[p.AttrName] : p.AttrVal; * * sb.Append("<dl><dt>").Append(p.AttrName).Append(":</dt><dd>"); * * if (p.AttrType == ((int)PropertyUI.Text).ToString()) * { * sb.Append("<input type=\"text\" class=\"tb_normal\" name=\"extend_").Append(p.ID.ToString()) * .Append("\" value=\"").Append(attrValue).Append("\"/>"); * } * else if (p.AttrType == ((int)PropertyUI.Upload).ToString()) * { * sb.Append("<input type=\"text\" disabled=\"disabled\" class=\"tb_normal\" id=\"extend_").Append(p.ID.ToString()).Append("\" name=\"extend_").Append(p.ID.ToString()) * .Append("\" value=\"").Append(attrValue).Append("\"/><span id=\"upload_") * .Append(p.ID.ToString()).Append("\">选择文件</span>") * .Append("<script type=\"text/javascript\">cms.propertyUpload(") * .Append("'upload_").Append(p.ID.ToString()).Append("','extend_").Append(p.ID.ToString()).Append("');</script>"); * } * * * sb.Append("</dd></dl>"); * * //<p><span class="txt">标签:</span> * // <span class="input"><input type="text" name="tags" size="30"/></span> * // <span class="msg"></span></p> * * } * * * sb.Append("</div>"); * } * * extendFieldsHtml = sb.ToString(); * } * * // extendFieldsHtml = "<div style=\"color:red;padding:20px;\">所选栏目模块不包含任何自定义属性,如需添加请到模块管理-》属性设置</div>"; * * } */ #endregion //============= 拼接模块的属性值 ==============// StringBuilder sb = new StringBuilder(50); string attrValue; IExtendField field; sb.Append("<div class=\"dataextend_item\">"); foreach (IExtendValue extValue in archive.ExtendValues) { field = extValue.Field; attrValue = extValue.Value ?? field.DefaultValue; sb.Append("<dl><dt>").Append(field.Name).Append(":</dt><dd>"); if (field.Type == ((int)PropertyUI.Text).ToString()) { sb.Append("<input type=\"text\" class=\"tb_normal\" field=\"extend_").Append(field.ID.ToString()) .Append("\" value=\"").Append(attrValue).Append("\"/>"); } else if (field.Type == ((int)PropertyUI.Upload).ToString()) { sb.Append("<input type=\"text\" disabled=\"disabled\" class=\"tb_normal\" id=\"extend_").Append(field.ID.ToString()) .Append("\" field=\"extend_").Append(field.ID.ToString()) .Append("\" value=\"").Append(attrValue).Append("\"/><span id=\"upload_") .Append(field.ID.ToString()).Append("\">选择文件</span>") .Append("<script type=\"text/javascript\">cms.propertyUpload(") .Append("'upload_").Append(field.ID.ToString()).Append("','extend_").Append(field.ID.ToString()) .Append("');</script>"); } sb.Append("</dd></dl>"); } sb.Append("</div>"); extendFieldsHtml = sb.ToString(); //获取模板视图下拉项 StringBuilder sb2 = new StringBuilder(); //模板目录 DirectoryInfo dir = new DirectoryInfo( String.Format("{0}templates/{1}", AppDomain.CurrentDomain.BaseDirectory, Settings.TPL_MultMode ? "" : base.CurrentSite.Tpl + "/" )); EachClass.EachTemplatePage(dir, sb2, TemplatePageType.Custom, TemplatePageType.Archive ); tpls = sb2.ToString(); sb2.Remove(0, sb2.Length); ServiceCall.Instance.SiteService.HandleCategoryTree(this.SiteId, 1, (_category, level) => { sb2.Append("<option value=\"").Append(_category.ID.ToString()).Append("\""); //if (_category.ModuleID != category.ModuleID) //{ // sb2.Append(" disabled=\"disabled\" class=\"disabled\""); //} sb2.Append(_category.ID == categoryId ? " selected=\"selected\"" : "").Append(">"); for (int i = 0; i < level; i++) { sb2.Append(CmsCharMap.Dot); } sb2.Append(_category.Name).Append("</option>"); }); nodesHtml = sb2.ToString(); //标签 Dictionary <string, bool> flags = ArchiveFlag.GetFlagsDict(archive.Flags); string thumbnail = !String.IsNullOrEmpty(archive.Thumbnail) ? archive.Thumbnail : "/" + CmsVariables.FRAMEWORK_ARCHIVE_NoPhoto; object json = new { IsSpecial = flags.ContainsKey(ArchiveFlag.GetInternalFlagKey(BuiltInArchiveFlags.IsSpecial)) && flags[ArchiveFlag.GetInternalFlagKey(BuiltInArchiveFlags.IsSpecial)], IsSystem = flags.ContainsKey(ArchiveFlag.GetInternalFlagKey(BuiltInArchiveFlags.IsSystem)) && flags[ArchiveFlag.GetInternalFlagKey(BuiltInArchiveFlags.IsSystem)], IsNotVisible = !(flags.ContainsKey(ArchiveFlag.GetInternalFlagKey(BuiltInArchiveFlags.Visible)) && flags[ArchiveFlag.GetInternalFlagKey(BuiltInArchiveFlags.Visible)]), AsPage = flags.ContainsKey(ArchiveFlag.GetInternalFlagKey(BuiltInArchiveFlags.AsPage)) && flags[ArchiveFlag.GetInternalFlagKey(BuiltInArchiveFlags.AsPage)], Id = archive.Id, Title = archive.Title, Alias = archive.Alias ?? String.Empty, Tags = archive.Tags, Source = archive.Source, Outline = archive.Outline, Content = archive.Content, TemplatePath = archive.IsSelfTemplate && !String.IsNullOrEmpty(archive.TemplatePath) ? archive.TemplatePath : String.Empty, Thumbnail = thumbnail }; data = new { extendFieldsHtml = extendFieldsHtml, extendItemsHtml = extendItemsHtml, thumbPrefix = CmsVariables.Archive_ThumbPrefix, nodes = nodesHtml, url = Request.Url.PathAndQuery, tpls = tpls, json = JsonSerializer.Serialize(json) }; base.RenderTemplate( BasePage.CompressHtml(ResourceMap.GetPageContent(ManagementPage.Archive_Update)), data); }