Example #1
0
        // these are the same for ALL page requests since app start!
        public void BuildPageStaticTokens()
        {
            String m_CacheName = String.Empty;

            if (AppLogic.CachingOn)
            {
                m_CacheName    = String.Format("StaticTokens_{0}_{1}_{2}_{3}_{4}_{5}", SkinID.ToString(), ThisCustomer.LocaleSetting, ThisCustomer.CurrencySetting, ThisCustomer.CustomerLevelID, ThisCustomer.AffiliateID, ThisCustomer.VATSettingReconciled);
                m_StaticTokens = (Hashtable)HttpContext.Current.Cache.Get(m_CacheName);
            }
            if (m_StaticTokens == null)
            {
                m_StaticTokens = new Hashtable();
                m_StaticTokens.Add("(!STORE_VERSION!)", String.Empty);
                m_StaticTokens.Add("(!COPYRIGHTYEARS!)", AppLogic.AppConfig("StartingCopyrightYear") + "-" + DateTime.Now.Year.ToString());
                if (AppLogic.AppConfigBool("CardinalCommerce.Centinel.Enabled"))
                {
                    m_StaticTokens.Add("(!VBV!)", "<img src=\"" + AppLogic.LocateImageURL("App_Themes/skin_" + SkinID.ToString() + "/images/vbv.jpg") + "\" border=\"0\" alt=\"Store protected with Verified By Visa/MasterCard Secure Initiatives\">");
                }
                else
                {
                    m_StaticTokens.Add("(!VBV!)", String.Empty);
                }
                m_StaticTokens.Add("(!SKINID!)", SkinID.ToString());
                m_StaticTokens.Add("(!RIGHTCOL!)", "The RIGHTCOL token is no longer supported. You should put the right column you want directly into your skin templtae.ascx design where you want it");
                m_StaticTokens.Add("(!SITENAME!)", AppLogic.AppConfig("StoreName"));
                m_StaticTokens.Add("(!SITE_NAME!)", AppLogic.AppConfig("StoreName"));
                m_StaticTokens.Add("(!STORELOCALE!)", Localization.GetDefaultLocale());
                m_StaticTokens.Add("(!LOCALESETTING!)", ThisCustomer.LocaleSetting);
                m_StaticTokens.Add("(!CUSTOMERLOCALE!)", ThisCustomer.LocaleSetting);
                m_StaticTokens.Add("(!CURRENCY_LOCALE_ROBOTS_TAG!)", String.Empty); //CommonLogic.IIF(ThisCustomer.CurrencySetting == Localization.GetPrimaryCurrency() && ThisCustomer.LocaleSetting == Localization.GetWebConfigLocale(), String.Empty, "<meta name=\"robots\" content=\"noindex,nofollow,noarchive\">")); // to prevent indexing of store pages in "foreign" currencies"
                m_StaticTokens.Add("(!SEARCH_BOX!)", AppLogic.GetSearchBox(SkinID, ThisCustomer.LocaleSetting));
                m_StaticTokens.Add("(!COUNTRYBAR!)", AppLogic.GetCountryBar(ThisCustomer.LocaleSetting));
                m_StaticTokens.Add("(!HELPBOX!)", AppLogic.GetHelpBox(SkinID, true, ThisCustomer.LocaleSetting, null));
                m_StaticTokens.Add("(!HELPBOX_CONTENTS!)", AppLogic.GetHelpBox(SkinID, false, ThisCustomer.LocaleSetting, null));
                m_StaticTokens.Add("(!NEWS_SUMMARY!)", AppLogic.GetNewsSummary(3));
                m_StaticTokens.Add("(!CATEGORY_PROMPT!)", CommonLogic.IIF(AppLogic.GetString("AppConfig.CategoryPromptPlural", SkinID, ThisCustomer.LocaleSetting).Length != 0, AppLogic.GetString("AppConfig.CategoryPromptPlural", SkinID, ThisCustomer.LocaleSetting), AppLogic.GetString("skinbase.cs.3", SkinID, ThisCustomer.LocaleSetting)));
                m_StaticTokens.Add("(!CATEGORY_PROMPT_SINGULAR!)", CommonLogic.IIF(AppLogic.GetString("AppConfig.CategoryPromptSingular", SkinID, ThisCustomer.LocaleSetting).Length != 0, AppLogic.GetString("AppConfig.CategoryPromptSingular", SkinID, ThisCustomer.LocaleSetting), AppLogic.GetString("skinbase.cs.3", SkinID, ThisCustomer.LocaleSetting)));
                m_StaticTokens.Add("(!CATEGORY_PROMPT_PLURAL!)", CommonLogic.IIF(AppLogic.GetString("AppConfig.CategoryPromptPlural", SkinID, ThisCustomer.LocaleSetting).Length != 0, AppLogic.GetString("AppConfig.CategoryPromptPlural", SkinID, ThisCustomer.LocaleSetting), AppLogic.GetString("skinbase.cs.2", SkinID, ThisCustomer.LocaleSetting)).ToUpperInvariant());
                m_StaticTokens.Add("(!SECTION_PROMPT!)", CommonLogic.IIF(AppLogic.GetString("AppConfig.SectionPromptPlural", SkinID, ThisCustomer.LocaleSetting).Length != 0, AppLogic.GetString("AppConfig.SectionPromptPlural", SkinID, ThisCustomer.LocaleSetting), AppLogic.GetString("skinbase.cs.2", SkinID, ThisCustomer.LocaleSetting)));
                m_StaticTokens.Add("(!SECTION_PROMPT_SINGULAR!)", CommonLogic.IIF(AppLogic.GetString("AppConfig.SectionPromptSingular", SkinID, ThisCustomer.LocaleSetting).Length != 0, AppLogic.GetString("AppConfig.SectionPromptSingular", SkinID, ThisCustomer.LocaleSetting), AppLogic.GetString("skinbase.cs.2", SkinID, ThisCustomer.LocaleSetting)));
                m_StaticTokens.Add("(!SECTION_PROMPT_PLURAL!)", CommonLogic.IIF(AppLogic.GetString("AppConfig.SectionPromptPlural", SkinID, ThisCustomer.LocaleSetting).Length != 0, AppLogic.GetString("AppConfig.SectionPromptPlural", SkinID, ThisCustomer.LocaleSetting), AppLogic.GetString("skinbase.cs.1", SkinID, ThisCustomer.LocaleSetting)).ToUpperInvariant());
                m_StaticTokens.Add("(!MANUFACTURER_PROMPT!)", CommonLogic.IIF(AppLogic.GetString("AppConfig.ManufacturerPromptPlural", SkinID, ThisCustomer.LocaleSetting).Length != 0, AppLogic.GetString("AppConfig.ManufacturerPromptPlural", SkinID, ThisCustomer.LocaleSetting), AppLogic.GetString("skinbase.cs.3", SkinID, ThisCustomer.LocaleSetting)));
                m_StaticTokens.Add("(!MANUFACTURER_PROMPT_SINGULAR!)", CommonLogic.IIF(AppLogic.GetString("AppConfig.ManufacturerPromptSingular", SkinID, ThisCustomer.LocaleSetting).Length != 0, AppLogic.GetString("AppConfig.ManufacturerPromptSingular", SkinID, ThisCustomer.LocaleSetting), AppLogic.GetString("skinbase.cs.3", SkinID, ThisCustomer.LocaleSetting)));
                m_StaticTokens.Add("(!MANUFACTURER_PROMPT_PLURAL!)", CommonLogic.IIF(AppLogic.GetString("AppConfig.ManufacturerPromptPlural", SkinID, ThisCustomer.LocaleSetting).Length != 0, AppLogic.GetString("AppConfig.ManufacturerPromptPlural", SkinID, ThisCustomer.LocaleSetting), AppLogic.GetString("skinbase.cs.2", SkinID, ThisCustomer.LocaleSetting)).ToUpperInvariant());
                m_StaticTokens.Add("(!UNSUP_4!)", AppLogic.GetCategoryBox(AppLogic.AppConfigUSInt("KitCategoryID"), true, 5, false, "Our custom tailored kits provide everything you need in one package!", SkinID, ThisCustomer.LocaleSetting));
                m_StaticTokens.Add("(!ADMIN_FOR!)", AppLogic.GetString("admin.main.ascx.AdminFor", 1, Localization.GetDefaultLocale()));

                foreach (String EntityName in AppLogic.ro_SupportedEntities)
                {
                    String        ENU    = EntityName.ToUpperInvariant();
                    StringBuilder tmpSx  = new StringBuilder(4096);
                    EntityHelper  Helper = AppLogic.LookupHelper(EntityName, 0);

                    m_StaticTokens.Add("(!" + ENU + "_BROWSE_BOX!)", Helper.GetEntityBrowseBox(SkinID, ThisCustomer.LocaleSetting));
                }
                m_StaticTokens = AspDotNetStorefront.Global.CompleteParser(m_StaticTokens);
            }
            if (AppLogic.CachingOn)
            {
                HttpContext.Current.Cache.Insert(m_CacheName, m_StaticTokens, null, System.DateTime.Now.AddMinutes(m_CacheMinutes), TimeSpan.Zero);
            }
        }