protected IList<ManageThemeInfo> GetThemes() { HttpContext context = HiContext.Current.Context; IList<ManageThemeInfo> list = new List<ManageThemeInfo>(); string path = context.Request.MapPath(HiContext.Current.GetSkinPath() + "/brandcategorythemes"); if (!Directory.Exists(path)) Directory.CreateDirectory(path); string[] strArray = Directory.Exists(path) ? Directory.GetFiles(path) : null; if (null != strArray && strArray.Length != 0) { ManageThemeInfo item = null; foreach (string str2 in strArray) { if (str2.EndsWith(".html")) { ManageThemeInfo info2 = new ManageThemeInfo(); info2.ThemeName = item.Name = Path.GetFileName(str2); item = info2; list.Add(item); } } } return list; }
protected IList <ManageThemeInfo> LoadThemes() { XmlDocument document = new XmlDocument(); IList <ManageThemeInfo> list = new List <ManageThemeInfo>(); string[] strArray = Directory.Exists(base.Server.MapPath("/Templates/vshop/")) ? Directory.GetDirectories(base.Server.MapPath("/Templates/vshop/")) : null; foreach (string str in strArray) { DirectoryInfo info = new DirectoryInfo(str); string str2 = info.Name.ToLower(CultureInfo.InvariantCulture); if ((str2.Length > 0) && !str2.StartsWith("_")) { foreach (FileInfo info2 in info.GetFiles("template.xml")) { ManageThemeInfo item = new ManageThemeInfo(); FileStream inStream = info2.OpenRead(); document.Load(inStream); inStream.Close(); item.Name = document.SelectSingleNode("root/Name").InnerText; item.ThemeName = str2; if (str2 == this.tempLatePath) { this.templateCuName = document.SelectSingleNode("root/Name").InnerText; } list.Add(item); } } } return(list); }
protected IList <ManageThemeInfo> GetThemes() { IList <ManageThemeInfo> list = new List <ManageThemeInfo>(); SiteSettings siteSettings = SettingsManager.GetSiteSettings(HiContext.Current.User.UserId); string path = HiContext.Current.Context.Request.MapPath(Globals.ApplicationPath + string.Format("/Templates/sites/{0}/{1}/categorythemes", HiContext.Current.User.UserId, siteSettings.Theme)); if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } string[] strArray = Directory.GetFiles(path); ManageThemeInfo manageThemeInfo = null; foreach (string item in strArray) { if (item.EndsWith(".html")) { manageThemeInfo = new ManageThemeInfo(); manageThemeInfo.ThemeName = manageThemeInfo.Name = Path.GetFileName(item); list.Add(manageThemeInfo); } } return(list); }
/// <summary> /// 加载模板 /// </summary> /// <param name="currentThemeName"></param> /// <returns></returns> protected IList <ManageThemeInfo> LoadThemes(string currentThemeName) { HttpContext context = HiContext.Current.Context; XmlDocument document = new XmlDocument(); IList <ManageThemeInfo> list = new List <ManageThemeInfo>(); string themesPath = context.Request.PhysicalApplicationPath + HiConfiguration.GetConfig().FilesPath + @"\Templates\sites\" + HiContext.Current.User.UserId.ToString(); if (Directory.Exists(themesPath)) { string[] themeList = Directory.GetDirectories(themesPath); ManageThemeInfo item = null; DirectoryInfo themeInfo = null; string themeName = string.Empty; foreach (string theme in themeList) { themeInfo = new DirectoryInfo(theme); themeName = themeInfo.Name.ToLower(); if (themeName.Length > 0 && !themeName.StartsWith("_")) { foreach (FileInfo fileInfo in themeInfo.GetFiles(themeName + ".xml")) { item = new ManageThemeInfo(); using (FileStream inStream = fileInfo.OpenRead()) { document.Load(inStream); } item.Name = document.SelectSingleNode("ManageTheme/Name").InnerText; item.ThemeImgUrl = document.SelectSingleNode("ManageTheme/ImageUrl").InnerText; item.ThemeName = themeName; if (string.Compare(item.ThemeName, currentThemeName) == 0) { litThemeName.Text = item.ThemeName; imgThemeImgUrl.ImageUrl = string.Concat(Globals.ApplicationPath, "/Templates/sites/", HiContext.Current.User.UserId, "/", themeName, "/", document.SelectSingleNode("ManageTheme/ImageUrl").InnerText); Image1.ImageUrl = string.Concat(Globals.ApplicationPath, "/Templates/sites/", HiContext.Current.User.UserId, "/", themeName, "/", document.SelectSingleNode("ManageTheme/BigImageUrl").InnerText); } list.Add(item); } } } } return(list); }
protected System.Collections.Generic.IList <ManageThemeInfo> LoadThemes(string currentThemeName) { System.Web.HttpContext context = Hidistro.Membership.Context.HiContext.Current.Context; System.Xml.XmlDocument xmlDocument = new System.Xml.XmlDocument(); System.Collections.Generic.IList <ManageThemeInfo> list = new System.Collections.Generic.List <ManageThemeInfo>(); string path = context.Request.PhysicalApplicationPath + HiConfiguration.GetConfig().FilesPath + "\\Templates\\sites\\" + Hidistro.Membership.Context.HiContext.Current.User.UserId.ToString(); string[] array = System.IO.Directory.Exists(path) ? System.IO.Directory.GetDirectories(path) : null; string[] array2 = array; for (int i = 0; i < array2.Length; i++) { string path2 = array2[i]; System.IO.DirectoryInfo directoryInfo = new System.IO.DirectoryInfo(path2); string text = directoryInfo.Name.ToLower(System.Globalization.CultureInfo.InvariantCulture); if (text.Length > 0 && !text.StartsWith("_")) { System.IO.FileInfo[] files = directoryInfo.GetFiles(text + ".xml"); System.IO.FileInfo[] array3 = files; for (int j = 0; j < array3.Length; j++) { System.IO.FileInfo fileInfo = array3[j]; ManageThemeInfo manageThemeInfo = new ManageThemeInfo(); System.IO.FileStream fileStream = fileInfo.OpenRead(); xmlDocument.Load(fileStream); fileStream.Close(); manageThemeInfo.Name = xmlDocument.SelectSingleNode("ManageTheme/Name").InnerText; manageThemeInfo.ThemeImgUrl = xmlDocument.SelectSingleNode("ManageTheme/ImageUrl").InnerText; manageThemeInfo.ThemeName = text; if (string.Compare(manageThemeInfo.ThemeName, currentThemeName) == 0) { this.litThemeName.Text = manageThemeInfo.ThemeName; this.imgThemeImgUrl.ImageUrl = string.Concat(new object[] { Globals.ApplicationPath, "/Templates/sites/", Hidistro.Membership.Context.HiContext.Current.User.UserId, "/", text, "/", xmlDocument.SelectSingleNode("ManageTheme/ImageUrl").InnerText }); this.Image1.ImageUrl = string.Concat(new object[] { Globals.ApplicationPath, "/Templates/sites/", Hidistro.Membership.Context.HiContext.Current.User.UserId, "/", text, "/", xmlDocument.SelectSingleNode("ManageTheme/BigImageUrl").InnerText }); } list.Add(manageThemeInfo); } } } return(list); }
protected System.Collections.Generic.IList <ManageThemeInfo> LoadThemes(string currentThemeName) { XmlDocument document = new XmlDocument(); System.Collections.Generic.IList <ManageThemeInfo> list = new System.Collections.Generic.List <ManageThemeInfo>(); string path = System.Web.HttpContext.Current.Request.PhysicalApplicationPath + HiConfiguration.GetConfig().FilesPath + "\\Templates\\vshop"; string[] strArray = System.IO.Directory.Exists(path) ? System.IO.Directory.GetDirectories(path) : null; string[] array = strArray; for (int i = 0; i < array.Length; i++) { string str3 = array[i]; System.IO.DirectoryInfo info2 = new System.IO.DirectoryInfo(str3); string str4 = info2.Name.ToLower(System.Globalization.CultureInfo.InvariantCulture); if (str4.Length > 0 && !str4.StartsWith("_")) { System.IO.FileInfo[] files = info2.GetFiles("template.xml"); for (int j = 0; j < files.Length; j++) { System.IO.FileInfo info3 = files[j]; ManageThemeInfo item = new ManageThemeInfo(); System.IO.FileStream inStream = info3.OpenRead(); document.Load(inStream); inStream.Close(); item.Name = document.SelectSingleNode("root/Name").InnerText; item.ThemeImgUrl = string.Concat(new string[] { Globals.ApplicationPath, "/Templates/vshop/", str4, "/", document.SelectSingleNode("root/ImageUrl").InnerText }); item.ThemeName = str4; if (string.Compare(item.ThemeName, currentThemeName) == 0) { this.litThemeName.Text = item.ThemeName; } list.Add(item); } } } return(list); }
protected System.Collections.Generic.IList <ManageThemeInfo> GetThemes() { System.Collections.Generic.IList <ManageThemeInfo> list = new System.Collections.Generic.List <ManageThemeInfo>(); Hidistro.Membership.Context.SiteSettings siteSettings = Hidistro.Membership.Context.SettingsManager.GetSiteSettings(Hidistro.Membership.Context.HiContext.Current.User.UserId); string path = Hidistro.Membership.Context.HiContext.Current.Context.Request.MapPath(Globals.ApplicationPath + string.Format("/Templates/sites/{0}/{1}/categorythemes", Hidistro.Membership.Context.HiContext.Current.User.UserId, siteSettings.Theme)); string[] array = System.IO.Directory.Exists(path) ? System.IO.Directory.GetFiles(path) : null; string[] array2 = array; for (int i = 0; i < array2.Length; i++) { string text = array2[i]; if (text.EndsWith(".html")) { ManageThemeInfo manageThemeInfo = new ManageThemeInfo(); manageThemeInfo.ThemeName = (manageThemeInfo.Name = System.IO.Path.GetFileName(text)); list.Add(manageThemeInfo); } } return(list); }
protected IList<ManageThemeInfo> LoadThemes(string path) { HttpContext context = HiContext.Current.Context; XmlDocument document = new XmlDocument(); IList<ManageThemeInfo> list = new List<ManageThemeInfo>(); string str = context.Request.PhysicalApplicationPath + HiConfiguration.GetConfig().FilesPath + @"\Templates\" + path; string[] dirs = Directory.Exists(str) ? Directory.GetDirectories(str) : null; if (null != dirs) { ManageThemeInfo item = null; foreach (string dir in dirs) { DirectoryInfo info = new DirectoryInfo(dir); string dirName = info.Name.ToLower(); if ((dirName.Length > 0) && !dirName.StartsWith("_")) { foreach (FileInfo info3 in info.GetFiles(dirName + ".xml")) { item = new ManageThemeInfo(); FileStream inStream = info3.OpenRead(); document.Load(inStream); inStream.Close(); item.Name = document.SelectSingleNode("ManageTheme/Name").InnerText; item.ThemeImgUrl = document.SelectSingleNode("ManageTheme/ImageUrl").InnerText; item.ThemeName = dirName; list.Add(item); } } } } return list; }
protected IList <ManageThemeInfo> LoadThemes(string currentThemeName) { HttpContext context = HiContext.Current.Context; XmlDocument xmlDocument = new XmlDocument(); xmlDocument.XmlResolver = null; IList <ManageThemeInfo> list = new List <ManageThemeInfo>(); string path = context.Request.PhysicalApplicationPath + "\\Templates\\common\\home"; string[] array = Directory.Exists(path) ? Directory.GetDirectories(path) : null; ManageThemeInfo manageThemeInfo = null; string[] array2 = array; foreach (string path2 in array2) { DirectoryInfo directoryInfo = new DirectoryInfo(path2); string text = directoryInfo.Name.ToLower(CultureInfo.InvariantCulture); if (text.Length > 0 && !text.StartsWith("_")) { FileInfo[] files = directoryInfo.GetFiles("template.xml"); FileInfo[] array3 = files; foreach (FileInfo fileInfo in array3) { manageThemeInfo = new ManageThemeInfo(); FileStream fileStream = fileInfo.OpenRead(); xmlDocument.Load(fileStream); fileStream.Close(); manageThemeInfo.Name = xmlDocument.SelectSingleNode("root/Name").InnerText; manageThemeInfo.ThemeImgUrl = "/Templates/common/home/" + text + "/" + xmlDocument.SelectSingleNode("root/ImageUrl").InnerText; manageThemeInfo.ThemeName = text; if (string.Compare(manageThemeInfo.ThemeName, currentThemeName) == 0) { this.litThemeName.Text = manageThemeInfo.Name; this.imgCurrentImg.Src = "/Templates/common/home/" + text + "/" + xmlDocument.SelectSingleNode("root/ImageUrl").InnerText; } list.Add(manageThemeInfo); } } } return(list); }
protected IList <ManageThemeInfo> LoadThemes(string currentThemeName) { HttpContext context = HiContext.Current.Context; XmlDocument document = new XmlDocument(); IList <ManageThemeInfo> list = new List <ManageThemeInfo>(); string path = context.Request.PhysicalApplicationPath + HiConfiguration.GetConfig().FilesPath + @"\Templates\sites\" + HiContext.Current.User.UserId.ToString(); string[] strArray = Directory.Exists(path) ? Directory.GetDirectories(path) : null; ManageThemeInfo item = null; foreach (string str3 in strArray) { DirectoryInfo info2 = new DirectoryInfo(str3); string str2 = info2.Name.ToLower(CultureInfo.InvariantCulture); if ((str2.Length > 0) && !str2.StartsWith("_")) { foreach (FileInfo info3 in info2.GetFiles(str2 + ".xml")) { item = new ManageThemeInfo(); FileStream inStream = info3.OpenRead(); document.Load(inStream); inStream.Close(); item.Name = document.SelectSingleNode("ManageTheme/Name").InnerText; item.ThemeImgUrl = document.SelectSingleNode("ManageTheme/ImageUrl").InnerText; item.ThemeName = str2; if (string.Compare(item.ThemeName, currentThemeName) == 0) { this.litThemeName.Text = item.ThemeName; this.imgThemeImgUrl.ImageUrl = string.Concat(new object[] { Globals.ApplicationPath, "/Templates/sites/", HiContext.Current.User.UserId, "/", str2, "/", document.SelectSingleNode("ManageTheme/ImageUrl").InnerText }); this.Image1.ImageUrl = string.Concat(new object[] { Globals.ApplicationPath, "/Templates/sites/", HiContext.Current.User.UserId, "/", str2, "/", document.SelectSingleNode("ManageTheme/BigImageUrl").InnerText }); } list.Add(item); } } } return(list); }
protected IList<ManageThemeInfo> LoadThemes(string currentThemeName) { HttpContext context = HiContext.Current.Context; XmlDocument document = new XmlDocument(); IList<ManageThemeInfo> themesList = new List<ManageThemeInfo>(); string path = context.Request.PhysicalApplicationPath + HiConfiguration.GetConfig().FilesPath + @"\Templates\library"; string[] fileList = Directory.Exists(path) ? Directory.GetDirectories(path) : null; ManageThemeInfo item = null; DirectoryInfo directoryInfo = null; string themeName = ""; FileStream inStream = null; foreach (string file in fileList) { directoryInfo = new DirectoryInfo(file); themeName = directoryInfo.Name.ToLower(); if ((themeName.Length > 0) && !themeName.StartsWith("_")) { foreach (FileInfo info3 in directoryInfo.GetFiles(themeName + ".xml")) { item = new ManageThemeInfo(); using (inStream = info3.OpenRead()) { document.Load(inStream); } item.Name = document.SelectSingleNode("ManageTheme/Name").InnerText; item.ThemeImgUrl = document.SelectSingleNode("ManageTheme/ImageUrl").InnerText; item.ThemeName = themeName; if (string.Compare(item.ThemeName, currentThemeName) == 0) { litThemeName.Text = item.ThemeName; imgThemeImgUrl.ImageUrl = Globals.ApplicationPath + "/Templates/library/" + themeName + "/" + document.SelectSingleNode("ManageTheme/ImageUrl").InnerText; Image1.ImageUrl = Globals.ApplicationPath + "/Templates/library/" + themeName + "/" + document.SelectSingleNode("ManageTheme/BigImageUrl").InnerText; } themesList.Add(item); } } } return themesList; }
protected IList<ManageThemeInfo> LoadThemes() { HttpContext context = HiContext.Current.Context; XmlDocument document = new XmlDocument(); IList<ManageThemeInfo> list = new List<ManageThemeInfo>(); string path = context.Request.PhysicalApplicationPath + HiConfiguration.GetConfig().FilesPath + @"\Templates\library"; if (!Directory.Exists(path)) Directory.CreateDirectory(path);//判断路径是否存在 string[] subDirList = Directory.Exists(path) ? Directory.GetDirectories(path) : null; ManageThemeInfo item = null; string themeName = ""; DirectoryInfo dirInfo = null; foreach (string subDir in subDirList) { dirInfo = new DirectoryInfo(subDir); themeName = dirInfo.Name.ToLower(); if ((themeName.Length > 0) && !themeName.StartsWith("_")) { foreach (FileInfo fileInfo in dirInfo.GetFiles(themeName + ".xml")) { item = new ManageThemeInfo(); FileStream inStream = fileInfo.OpenRead(); document.Load(inStream); inStream.Close(); item.Name = document.SelectSingleNode("ManageTheme/Name").InnerText; item.ThemeImgUrl = document.SelectSingleNode("ManageTheme/ImageUrl").InnerText; item.ThemeName = themeName; list.Add(item); } } } return list; }