public virtual XmlNode ToSiteMapTopicNode(XmlDocument context) { String tName = XmlCommon.GetLocaleEntry(Name, Customer.Current.LocaleSetting, true); Topic t = new Topic(tName, Customer.Current.LocaleSetting); return(SiteMapNode(t.SectionTitle, SE.MakeDriverLink(tName), context)); }
private XmlNode CustomerServiceNode() { XmlNode cat = SiteMapNode( "menu.CustomerService".StringResource(), //AppLogic.ResolveUrl("~/t-service.aspx"), AppLogic.ResolveUrl(SE.MakeDriverLink("service")), mapDoc ); cat.AppendChild( SiteMapNode( "menu.YourAccount".StringResource(), AppLogic.ResolveUrl("~/account.aspx"), mapDoc )); cat.AppendChild( SiteMapNode( "menu.OrderHistory".StringResource(), AppLogic.ResolveUrl("~/account.aspx"), mapDoc )); cat.AppendChild( SiteMapNode( "menu.PolicyReturns".StringResource(), //AppLogic.ResolveUrl("~/t-returns.aspx"), AppLogic.ResolveUrl(SE.MakeDriverLink("returns")), mapDoc )); cat.AppendChild( SiteMapNode( "menu.Shipping".StringResource(), //AppLogic.ResolveUrl("~/t-shipping.aspx"), AppLogic.ResolveUrl(SE.MakeDriverLink("shipping")), mapDoc )); cat.AppendChild( SiteMapNode( "menu.Contact".StringResource(), AppLogic.ResolveUrl("~/contactus.aspx"), mapDoc )); cat.AppendChild( SiteMapNode( "menu.PolicyPrivacy".StringResource(), //AppLogic.ResolveUrl("~/t-privacy.aspx"), AppLogic.ResolveUrl(SE.MakeDriverLink("privacy")), mapDoc )); cat.AppendChild( SiteMapNode( "menu.PolicySecurity".StringResource(), //AppLogic.ResolveUrl("~/t-security.aspx"), AppLogic.ResolveUrl(SE.MakeDriverLink("security")), mapDoc )); return(cat); }
/// <summary> /// Gets the eval data. /// </summary> /// <param name="expression">The expression.</param> /// <param name="target">The target.</param> /// <param name="entry">The entry.</param> /// <returns></returns> public static object GetEvalData(string expression, Type target, string entry) { Customer ThisCustomer = AppLogic.GetCurrentCustomer(); bool IsRegistered = CommonLogic.IIF(ThisCustomer != null, ThisCustomer.IsRegistered, false); string[] values = expression.Split(','); string command = values[0]; switch (command.ToLowerInvariant()) { case "cartprompt": return(AppLogic.GetString("AppConfig.CartPrompt", ThisCustomer.SkinID, ThisCustomer.LocaleSetting)); case "currency_locale_robots_tag": return(CurrencyLocaleRobotsTag(ThisCustomer)); case "num_cart_items": return(NumCartItemsParser(ThisCustomer)); case "pageinfo": return(PageInfoParser(ThisCustomer)); case "buysafeseal": return(BuySafeSealParser(ThisCustomer)); case "bongoextend": return(BongoExtendParser(ThisCustomer)); case "username": return(UserNameParser(ThisCustomer)); case "signinout_link": return(SignInOutLinkParser(ThisCustomer)); case "signinout_text": return(SignInOutTextParser(ThisCustomer)); case "skinid": return(ThisCustomer.SkinID.ToString()); case "stringresource": return(StringResourceParser(ThisCustomer, values)); case "stringresourceformat": return(StringResourceFormatParser(ThisCustomer, values)); case "appconfig": return(AppConfigParser(values)); case "appconfigbool": return(AppConfigBoolParser(values)); case "appconfigusint": return(AppConfigUSIntParser(values)); case "topic": return(TopicParser(ThisCustomer, values)); case "topictitle": return(Topic.GetTitle(values[1].Trim(), ThisCustomer.LocaleSetting, AppLogic.StoreID())); case "topiclink": return(SE.MakeDriverLink(values[1].Trim())); case "xmlpackage": if (values.Length >= 2) { string xmlPackageName = values[1]; string runtimeParams = values.Length >= 3 ? values[2] : string.Empty; return(RunXmlPackage(ThisCustomer, xmlPackageName.Trim(), runtimeParams.Trim())); } else { return("Invalid number of parameters"); } case "stringformat": return(StringFormat(expression)); case "user_menu_name": return(CommonLogic.IIF(!IsRegistered, "my account", ThisCustomer.FullName())); case "customerid": return(ThisCustomer.CustomerID.ToString()); case "skinimagedir": return(AppLogic.SkinImageDir()); case "skinimage": if (values.Length < 2) { return("{Image File name not specified}"); } string imgFile = values[1]; return(AppLogic.SkinImage(imgFile.Trim())); case "adminlink": return(AppLogic.AdminLinkUrl(values[1].Trim())); case "google_ecom_tracking_v2": if (AppLogic.AppConfigBool("Google.DeprecatedEcomTokens.Enabled")) { if (CommonLogic.GetThisPageName(false).ToLowerInvariant().StartsWith("orderconfirmation.aspx")) { return(String.Empty); } else { return(AppLogic.GetGoogleEComTrackingV2(ThisCustomer, false)); } } else { return(String.Empty); } case "google_ecom_tracking_asynch": if (AppLogic.AppConfigBool("Google.DeprecatedEcomTokens.Enabled")) { if (CommonLogic.GetThisPageName(false).ToLowerInvariant().StartsWith("orderconfirmation.aspx") || CommonLogic.GetThisPageName(false).ToLowerInvariant().StartsWith("mobileorderconfirmation.aspx")) { return(AppLogic.GetGoogleEComTrackingAsynch(ThisCustomer, true)); } else { return(AppLogic.GetGoogleEComTrackingAsynch(ThisCustomer, false)); } } else { return(String.Empty); } case "vbv": return(VBVParser(ThisCustomer)); default: return(string.Empty); } }
public SiteMap1(System.Collections.Generic.Dictionary <string, EntityHelper> EntityHelpers, int SkinID, Customer ThisCustomer) { bool FromCache = false; String CacheName = String.Format("SiteMap1_{0}_{1}", SkinID.ToString(), ThisCustomer.LocaleSetting); if (AppLogic.CachingOn) { m_Contents = (String)HttpContext.Current.Cache.Get(CacheName); if (m_Contents != null) { FromCache = true; } } if (!FromCache) { StringBuilder tmpS = new StringBuilder(50000); if (AppLogic.IsAdminSite || AppLogic.AppConfigBool("SiteMap.ShowCategories")) { // Categories: String s = AppLogic.LookupHelper("Category", 0).GetEntityULList(0, ThisCustomer.LocaleSetting, ThisCustomer.AffiliateID, ThisCustomer.CustomerLevelID, true, AppLogic.AppConfigBool("SiteMap.ShowProducts") && AppLogic.NumProductsInDB < 250, true, "sitemapul", true, 0, String.Empty); if (s.Length != 0) { tmpS.Append("<b>"); if (AppLogic.IsAdminSite) { tmpS.Append("<a href=\"newentities.aspx?entityname=category\">"); } tmpS.Append(AppLogic.GetString("AppConfig.CategoryPromptPlural", SkinID, ThisCustomer.LocaleSetting).ToUpperInvariant()); if (AppLogic.IsAdminSite) { tmpS.Append("</a>"); } tmpS.Append("</b>"); tmpS.Append(s); } } if (AppLogic.IsAdminSite || AppLogic.AppConfigBool("SiteMap.ShowSections")) { // Sections: String s = AppLogic.LookupHelper("Section", 0).GetEntityULList(0, ThisCustomer.LocaleSetting, ThisCustomer.AffiliateID, ThisCustomer.CustomerLevelID, true, AppLogic.AppConfigBool("SiteMap.ShowProducts") && AppLogic.NumProductsInDB < 250, true, "sitemapul", true, 0, String.Empty); if (s.Length != 0) { tmpS.Append("<b>"); if (AppLogic.IsAdminSite) { tmpS.Append("<a href=\"newentities.aspx?entityname=section\">"); } tmpS.Append(AppLogic.GetString("AppConfig.SectionPromptPlural", SkinID, ThisCustomer.LocaleSetting).ToUpperInvariant()); if (AppLogic.IsAdminSite) { tmpS.Append("</a>"); } tmpS.Append("</b>"); tmpS.Append(s); } } if (AppLogic.IsAdminSite || AppLogic.AppConfigBool("SiteMap.ShowLibraries")) { // Libraries: String s = AppLogic.LookupHelper("Library", 0).GetEntityULList(0, ThisCustomer.LocaleSetting, ThisCustomer.AffiliateID, ThisCustomer.CustomerLevelID, AppLogic.AppConfigBool("SiteMap.ShowDocuments"), true, true, "sitemapul", true, 0, String.Empty); if (s.Length != 0) { tmpS.Append("<b>"); if (AppLogic.IsAdminSite) { tmpS.Append("<a href=\"newentities.aspx?entityname=library\">"); } tmpS.Append(AppLogic.GetString("AppConfig.LibraryPromptPlural", SkinID, ThisCustomer.LocaleSetting).ToUpperInvariant()); if (AppLogic.IsAdminSite) { tmpS.Append("</a>"); } tmpS.Append("</b>"); tmpS.Append(s); } } if (AppLogic.IsAdminSite || AppLogic.AppConfigBool("SiteMap.ShowManufacturers")) { // Manufacturers: String s = AppLogic.LookupHelper("Manufacturer", 0).GetEntityULList(0, ThisCustomer.LocaleSetting, ThisCustomer.AffiliateID, ThisCustomer.CustomerLevelID, false, AppLogic.AppConfigBool("SiteMap.ShowProducts") && AppLogic.NumProductsInDB < 250, true, "sitemapul", true, 0, String.Empty); if (s.Length != 0) { tmpS.Append("<b>"); if (AppLogic.IsAdminSite) { tmpS.Append("<a href=\"newentities.aspx?entityname=manufacturer\">"); } tmpS.Append(AppLogic.GetString("AppConfig.ManufacturerPromptPlural", SkinID, ThisCustomer.LocaleSetting).ToUpperInvariant()); if (AppLogic.IsAdminSite) { tmpS.Append("</a>"); } tmpS.Append("</b>"); tmpS.Append(s); } } if (AppLogic.IsAdminSite || AppLogic.AppConfigBool("SiteMap.ShowTopics")) { // Topics: tmpS.Append("<b>"); if (AppLogic.IsAdminSite) { tmpS.Append("<a href=\"topics.aspx\">"); } tmpS.Append(AppLogic.GetString("sitemap.aspx.2", SkinID, ThisCustomer.LocaleSetting).ToUpperInvariant()); if (AppLogic.IsAdminSite) { tmpS.Append("</a>"); } tmpS.Append("</b>"); tmpS.Append("<ul class=\"sitemapul\">\n"); using (SqlConnection dbconn = DB.dbConn()) { dbconn.Open(); using (IDataReader rs = DB.GetRS(string.Format("select count(*) as N from Topic with (NOLOCK) where {0} Deleted=0 AND Published=1 and (SkinID IS NULL or SkinID=0 or SkinID={1}) ", CommonLogic.IIF(AppLogic.IsAdminSite, "", "ShowInSiteMap=1 and "), SkinID.ToString()) + "; " + string.Format("select Name,Title,TopicID from Topic with (NOLOCK) where {0} Deleted=0 and Published=1 and (SkinID IS NULL or SkinID=0 or SkinID={1}) Order By DisplayOrder, Name ASC", CommonLogic.IIF(AppLogic.IsAdminSite, "", "ShowInSiteMap=1 and "), SkinID.ToString()), dbconn)) { if (rs.Read() && DB.RSFieldInt(rs, "N") > 0) { if (rs.NextResult()) { while (rs.Read()) { tmpS.Append("<li>"); if (AppLogic.IsAdminSite) { tmpS.Append(String.Format("<a href=\"edittopic.aspx?topicid={0}\">", DB.RSFieldInt(rs, "TopicID").ToString())); } else { tmpS.Append("<a href=\"" + SE.MakeDriverLink(DB.RSFieldByLocale(rs, "Name", Localization.GetDefaultLocale())) + "\">"); } tmpS.Append(Security.HtmlEncode(DB.RSFieldByLocale(rs, "Title", Localization.GetDefaultLocale()))); tmpS.Append("</a>"); tmpS.Append("</li>\n"); } } } } } // File Topics: // create an array to hold the list of files ArrayList fArray = new ArrayList(); // get information about our initial directory String SFP = CommonLogic.SafeMapPath(CommonLogic.IIF(AppLogic.IsAdminSite, "../", "") + "App_Templates/Skin_" + SkinID.ToString() + "/template.htm").Replace("template.htm", ""); DirectoryInfo dirInfo = new DirectoryInfo(SFP); // retrieve array of files & subdirectories FileSystemInfo[] myDir = dirInfo.GetFileSystemInfos(); for (int i = 0; i < myDir.Length; i++) { // check the file attributes // if a subdirectory, add it to the sArray // otherwise, add it to the fArray if (((Convert.ToUInt32(myDir[i].Attributes) & Convert.ToUInt32(FileAttributes.Directory)) > 0)) { } else { bool skipit = false; if (!myDir[i].FullName.EndsWith("htm", StringComparison.InvariantCultureIgnoreCase) || (myDir[i].FullName.IndexOf("TEMPLATE", StringComparison.InvariantCultureIgnoreCase) != -1) || (myDir[i].FullName.IndexOf("AFFILIATE_", StringComparison.InvariantCultureIgnoreCase) != -1) || (myDir[i].FullName.IndexOf(AppLogic.ro_PMMicropay, StringComparison.InvariantCultureIgnoreCase) != -1)) { skipit = true; } if (!skipit) { fArray.Add(Path.GetFileName(myDir[i].FullName)); } } } if (fArray.Count != 0) { // sort the files alphabetically fArray.Sort(0, fArray.Count, null); for (int i = 0; i < fArray.Count; i++) { tmpS.Append("<li>"); if (!AppLogic.IsAdminSite) // admin site can't link to these kinds of topics { tmpS.Append("<a href=\"" + SE.MakeDriverLink(fArray[i].ToString().Replace(".htm", "")) + "\">"); } else { tmpS.Append("(file based topic) "); } tmpS.Append(Security.HtmlEncode(CommonLogic.Capitalize(fArray[i].ToString().Replace(".htm", "")))); if (!AppLogic.IsAdminSite) { tmpS.Append("</a>"); } tmpS.Append("</li>\n"); } } tmpS.Append("</ul>\n"); } m_Contents = tmpS.ToString(); if (AppLogic.CachingOn) { HttpContext.Current.Cache.Insert(CacheName, m_Contents, null, System.DateTime.Now.AddMinutes(AppLogic.CacheDurationMinutes()), TimeSpan.Zero); } } }
public SiteMapComponentArt(Dictionary <string, EntityHelper> EntityHelpers, int SkinID, Customer ThisCustomer, bool showCustomerService) { bool FromCache = false; String CacheName = String.Format("SiteMapComponentArt_{0}_{1}", SkinID.ToString(), ThisCustomer.LocaleSetting); if (AppLogic.CachingOn) { m_Contents = (String)HttpContext.Current.Cache.Get(CacheName); if (m_Contents != null) { FromCache = true; } } if (!FromCache) { StringBuilder tmpS = new StringBuilder(50000); tmpS.Append("<SiteMap>\n"); if (AppLogic.IsAdminSite || AppLogic.AppConfigBool("SiteMap.ShowCategories")) { // Categories: String s = AppLogic.LookupHelper("Category", 0).GetEntityComponentArtNode(0, ThisCustomer.LocaleSetting, ThisCustomer.AffiliateID, ThisCustomer.CustomerLevelID, true, AppLogic.IsAdminSite || AppLogic.AppConfigBool("SiteMap.ShowProducts") && AppLogic.NumProductsInDB < 250); if (s.Length != 0) { if (AppLogic.IsAdminSite) { tmpS.Append("<node Text=\"" + XmlCommon.XmlEncodeAttribute(AppLogic.GetString("AppConfig.CategoryPromptPlural", SkinID, ThisCustomer.LocaleSetting).ToUpperInvariant()) + "\" NavigateUrl=\"newentities.aspx?entityname=category\">\n"); } else { tmpS.Append("<node Text=\"" + XmlCommon.XmlEncodeAttribute(AppLogic.GetString("AppConfig.CategoryPromptPlural", SkinID, ThisCustomer.LocaleSetting).ToUpperInvariant()) + "\">\n"); } tmpS.Append(s); tmpS.Append("</node>"); } } if (AppLogic.IsAdminSite || AppLogic.AppConfigBool("SiteMap.ShowSections")) { // Sections: String s = AppLogic.LookupHelper("Section", 0).GetEntityComponentArtNode(0, ThisCustomer.LocaleSetting, ThisCustomer.AffiliateID, ThisCustomer.CustomerLevelID, true, AppLogic.IsAdminSite || AppLogic.AppConfigBool("SiteMap.ShowProducts") && AppLogic.NumProductsInDB < 250); if (s.Length != 0) { if (AppLogic.IsAdminSite) { tmpS.Append("<node Text=\"" + XmlCommon.XmlEncodeAttribute(AppLogic.GetString("AppConfig.SectionPromptPlural", SkinID, ThisCustomer.LocaleSetting).ToUpperInvariant()) + "\" NavigateUrl=\"newentities.aspx?entityname=section\">\n"); } else { tmpS.Append("<node Text=\"" + XmlCommon.XmlEncodeAttribute(AppLogic.GetString("AppConfig.SectionPromptPlural", SkinID, ThisCustomer.LocaleSetting).ToUpperInvariant()) + "\">\n"); } tmpS.Append(s); tmpS.Append("</node>"); } } if (AppLogic.IsAdminSite || AppLogic.AppConfigBool("SiteMap.ShowLibraries")) { // Libraries: String s = AppLogic.LookupHelper("Library", 0).GetEntityComponentArtNode(0, ThisCustomer.LocaleSetting, ThisCustomer.AffiliateID, ThisCustomer.CustomerLevelID, true, AppLogic.IsAdminSite || AppLogic.AppConfigBool("SiteMap.ShowDocuments") && AppLogic.NumProductsInDB < 250); if (s.Length != 0) { if (AppLogic.IsAdminSite) { tmpS.Append("<node Text=\"" + XmlCommon.XmlEncodeAttribute(AppLogic.GetString("AppConfig.LibraryPromptPlural", SkinID, ThisCustomer.LocaleSetting).ToUpperInvariant()) + "\" NavigateUrl=\"newentities.aspx?entityname=library\">\n"); } else { tmpS.Append("<node Text=\"" + XmlCommon.XmlEncodeAttribute(AppLogic.GetString("AppConfig.LibraryPromptPlural", SkinID, ThisCustomer.LocaleSetting).ToUpperInvariant()) + "\">\n"); } tmpS.Append(s); tmpS.Append("</node>"); } } if (AppLogic.IsAdminSite || AppLogic.AppConfigBool("SiteMap.ShowManufacturers")) { // Manufacturers: String s = AppLogic.LookupHelper("Manufacturer", 0).GetEntityComponentArtNode(0, ThisCustomer.LocaleSetting, ThisCustomer.AffiliateID, ThisCustomer.CustomerLevelID, true, AppLogic.IsAdminSite || AppLogic.AppConfigBool("SiteMap.ShowProducts") && AppLogic.NumProductsInDB < 250); if (s.Length != 0) { if (AppLogic.IsAdminSite) { tmpS.Append("<node Text=\"" + XmlCommon.XmlEncodeAttribute(AppLogic.GetString("AppConfig.ManufacturerPromptPlural", SkinID, ThisCustomer.LocaleSetting).ToUpperInvariant()) + "\" NavigateUrl=\"newentities.aspx?entityname=manufacturer\">\n"); } else { tmpS.Append("<node Text=\"" + XmlCommon.XmlEncodeAttribute(AppLogic.GetString("AppConfig.ManufacturerPromptPlural", SkinID, ThisCustomer.LocaleSetting).ToUpperInvariant()) + "\">\n"); } tmpS.Append(s); tmpS.Append("</node>"); } } if (!AppLogic.IsAdminSite && AppLogic.AppConfigBool("SiteMap.ShowCustomerService") && showCustomerService) { tmpS.Append("<node Text=\"" + XmlCommon.XmlEncodeAttribute(AppLogic.GetString("menu.CustomerService", ThisCustomer.SkinID, ThisCustomer.LocaleSetting)) + "\">\n"); tmpS.Append(" <node Text=\""+ XmlCommon.XmlEncodeAttribute(AppLogic.GetString("menu.YourAccount", SkinID, ThisCustomer.LocaleSetting)) + "\" NavigateUrl=\"account.aspx\" />\n"); tmpS.Append(" <node Text=\""+ XmlCommon.XmlEncodeAttribute(AppLogic.GetString("menu.OrderHistory", SkinID, ThisCustomer.LocaleSetting)) + "\" NavigateUrl=\"account.aspx\" />\n"); tmpS.Append(" <node Text=\""+ XmlCommon.XmlEncodeAttribute(AppLogic.GetString("menu.PolicyReturns", SkinID, ThisCustomer.LocaleSetting)) + "\" NavigateUrl=\"" + SE.MakeDriverLink("returns") + "\" />\n"); tmpS.Append(" <node Text=\""+ XmlCommon.XmlEncodeAttribute(AppLogic.GetString("menu.Shipping", SkinID, ThisCustomer.LocaleSetting)) + "\" NavigateUrl=\"" + SE.MakeDriverLink("shipping") + "\" />\n"); tmpS.Append(" <node Text=\""+ XmlCommon.XmlEncodeAttribute(AppLogic.GetString("menu.Contact", SkinID, ThisCustomer.LocaleSetting)) + "\" NavigateUrl=\"contactus.aspx\" />\n"); tmpS.Append(" <node Text=\""+ XmlCommon.XmlEncodeAttribute(AppLogic.GetString("menu.PolicyPrivacy", SkinID, ThisCustomer.LocaleSetting)) + "\" NavigateUrl=\"" + SE.MakeDriverLink("privacy") + "\" />\n"); tmpS.Append(" <node Text=\""+ XmlCommon.XmlEncodeAttribute(AppLogic.GetString("menu.PolicySecurity", SkinID, ThisCustomer.LocaleSetting)) + "\" NavigateUrl=\"" + SE.MakeDriverLink("security") + "\" />\n"); tmpS.Append("</node>\n"); } if (AppLogic.IsAdminSite || AppLogic.AppConfigBool("SiteMap.ShowTopics")) { // Topics: if (AppLogic.IsAdminSite) { tmpS.Append("<node Text=\"" + XmlCommon.XmlEncodeAttribute(AppLogic.GetString("sitemap.aspx.2", SkinID, ThisCustomer.LocaleSetting).ToUpperInvariant()) + "\" NavigateUrl=\"topics.aspx\">\n"); } else { tmpS.Append("<node Text=\"" + XmlCommon.XmlEncodeAttribute(AppLogic.GetString("sitemap.aspx.2", SkinID, ThisCustomer.LocaleSetting).ToUpperInvariant()) + "\" NavigateUrl=\"\">\n"); } using (SqlConnection con = new SqlConnection(DB.GetDBConn())) { con.Open(); using (IDataReader rs = DB.GetRS(string.Format("select Name,Title,TopicID,ShowInSiteMap from Topic with (NOLOCK) where {0} Deleted=0 and Published=1 and (SkinID IS NULL or SkinID=0 or SkinID={1}) Order By DisplayOrder, Name ASC", CommonLogic.IIF(AppLogic.IsAdminSite, "", "ShowInSiteMap=1 and "), SkinID.ToString()), con)) { string displayname = string.Empty; string name = string.Empty; while (rs.Read()) { String URL = String.Empty; name = DB.RSFieldByLocale(rs, "Name", ThisCustomer.LocaleSetting); if (AppLogic.IsAdminSite) { URL = String.Format("topics.aspx?EditTopicId={0}", DB.RSFieldInt(rs, "TopicID").ToString()); } else { URL = SE.MakeDriverLink(name); } displayname = XmlCommon.XmlEncodeAttribute(DB.RSFieldByLocale(rs, "Title", ThisCustomer.LocaleSetting)); if (displayname != string.Empty) { if (name.IndexOf("GOOGLE", StringComparison.InvariantCultureIgnoreCase) == -1 && name.IndexOf("PHONE", StringComparison.InvariantCultureIgnoreCase) == -1 && name.IndexOf("AFFILIATE", StringComparison.InvariantCultureIgnoreCase) == -1 && name.IndexOf("GIFTREGISTRY", StringComparison.InvariantCultureIgnoreCase) == -1 && name.IndexOf("WISHLIST", StringComparison.InvariantCultureIgnoreCase) == -1 && name.IndexOf("CHECKOUTANON", StringComparison.InvariantCultureIgnoreCase) == -1 && name.IndexOf("DOWNLOAD", StringComparison.InvariantCultureIgnoreCase) == -1 && name.IndexOf("GENRE", StringComparison.InvariantCultureIgnoreCase) == -1 && name.IndexOf("DISTRIBUTOR", StringComparison.InvariantCultureIgnoreCase) == -1 && name.IndexOf("VECTOR", StringComparison.InvariantCultureIgnoreCase) == -1 && name.IndexOf("CARTPAGEFOOTER", StringComparison.InvariantCultureIgnoreCase) == -1 && name.IndexOf("CODINSTRUCTIONS", StringComparison.InvariantCultureIgnoreCase) == -1) { tmpS.Append("<node Text=\"" + displayname + "\" NavigateUrl=\"" + XmlCommon.XmlEncodeAttribute(URL) + "\" />\n"); } } } } } // File Topics: // create an array to hold the list of files ArrayList fArray = new ArrayList(); // get information about our initial directory String SFP = CommonLogic.SafeMapPath(CommonLogic.IIF(AppLogic.IsAdminSite, "../", "") + "App_Templates/Skin_" + SkinID.ToString() + "/template.htm").Replace("template.htm", ""); DirectoryInfo dirInfo = new DirectoryInfo(SFP); // retrieve array of files & subdirectories FileSystemInfo[] myDir = dirInfo.GetFileSystemInfos(); for (int i = 0; i < myDir.Length; i++) { // check the file attributes // if a subdirectory, add it to the sArray // otherwise, add it to the fArray if (((Convert.ToUInt32(myDir[i].Attributes) & Convert.ToUInt32(FileAttributes.Directory)) > 0)) { } else { bool skipit = false; if (!myDir[i].FullName.EndsWith("htm", StringComparison.InvariantCultureIgnoreCase) || (myDir[i].FullName.IndexOf("TEMPLATE", StringComparison.InvariantCultureIgnoreCase) != -1) || (myDir[i].FullName.IndexOf("AFFILIATE_", StringComparison.InvariantCultureIgnoreCase) != -1) || (myDir[i].FullName.IndexOf(AppLogic.ro_PMMicropay, StringComparison.InvariantCultureIgnoreCase) != -1)) { skipit = true; } if (!skipit) { fArray.Add(Path.GetFileName(myDir[i].FullName)); } } } if (fArray.Count != 0) { // sort the files alphabetically fArray.Sort(0, fArray.Count, null); for (int i = 0; i < fArray.Count; i++) { String URL = String.Empty; if (!AppLogic.IsAdminSite) // admin site can't link to these kinds of topics { URL = SE.MakeDriverLink(fArray[i].ToString().Replace(".htm", "")); } tmpS.Append("<node Text=\"" + XmlCommon.XmlEncodeAttribute(CommonLogic.Capitalize(fArray[i].ToString().Replace(".htm", ""))) + "\" " + CommonLogic.IIF(URL.Length != 0, "NavigateUrl=\"" + XmlCommon.XmlEncodeAttribute(URL) + "\"", "") + "/>\n"); } } tmpS.Append("</node>"); } tmpS.Append("</SiteMap>\n"); m_Contents = tmpS.ToString(); if (AppLogic.CachingOn) { HttpContext.Current.Cache.Insert(CacheName, m_Contents, null, System.DateTime.Now.AddMinutes(AppLogic.CacheDurationMinutes()), TimeSpan.Zero); } } }