public static String GetTemplateData(String templatename, NBrightInfo info) { var controlMapPath = HttpContext.Current.Server.MapPath("/DesktopModules/NBright/NBrightBuy/Providers/ManualPaymentProvider"); var templCtrl = new NBrightCore.TemplateEngine.TemplateGetter(PortalSettings.Current.HomeDirectoryMapPath, controlMapPath, "Themes\\config", ""); var templ = templCtrl.GetTemplateData(templatename, Utils.GetCurrentCulture()); var dic = new Dictionary <String, String>(); foreach (var d in StoreSettings.Current.Settings()) { dic.Add(d.Key, d.Value); } foreach (var d in info.ToDictionary()) { if (dic.ContainsKey(d.Key)) { dic[d.Key] = d.Value; } else { dic.Add(d.Key, d.Value); } } templ = Utils.ReplaceSettingTokens(templ, dic); templ = Utils.ReplaceUrlTokens(templ); return(templ); }
public static String GetTemplateData(String templatename) { var controlMapPath = HttpContext.Current.Server.MapPath("/DesktopModules/NBright/NBrightBuy/Providers/TaxProvider"); var templCtrl = new NBrightCore.TemplateEngine.TemplateGetter(PortalSettings.Current.HomeDirectoryMapPath, controlMapPath, "Themes\\config", ""); var templ = templCtrl.GetTemplateData(templatename, Utils.GetCurrentCulture()); templ = Utils.ReplaceSettingTokens(templ, StoreSettings.Current.Settings()); templ = Utils.ReplaceUrlTokens(templ); return templ; }
private String GetTemplateData(String templatename, String lang) { var controlMapPath = HttpContext.Current.Server.MapPath("/DesktopModules/NBright/NBrightPL"); var templCtrl = new NBrightCore.TemplateEngine.TemplateGetter(PortalSettings.Current.HomeDirectoryMapPath, controlMapPath, "Themes\\config", ""); var templ = templCtrl.GetTemplateData(templatename, lang); templ = Utils.ReplaceUrlTokens(templ); return(templ); }
public static String GetTemplateData(String templatename, NBrightInfo pluginInfo) { var controlMapPath = HttpContext.Current.Server.MapPath("/DesktopModules/NBright/OS_SystemPay"); var templCtrl = new NBrightCore.TemplateEngine.TemplateGetter(PortalSettings.Current.HomeDirectoryMapPath, controlMapPath, "Themes\\config", ""); var templ = templCtrl.GetTemplateData(templatename, Utils.GetCurrentCulture()); templ = Utils.ReplaceSettingTokens(templ, pluginInfo.ToDictionary()); templ = Utils.ReplaceUrlTokens(templ); return(templ); }
private String GetTemplateData(String templatename) { var controlMapPath = HttpContext.Current.Server.MapPath("/DesktopModules/NBright/NBrightBuy/Providers/ShippingProvider"); var templCtrl = new NBrightCore.TemplateEngine.TemplateGetter(PortalSettings.Current.HomeDirectoryMapPath, controlMapPath, "Themes\\config", ""); var templ = templCtrl.GetTemplateData(templatename, Utils.GetCurrentCulture()); templ = Utils.ReplaceSettingTokens(templ, StoreSettings.Current.Settings()); templ = Utils.ReplaceUrlTokens(templ); return(templ); }
private String GetTemplateData(String templatename, NBrightInfo cartInfo) { var nbCtrl = new NBrightBuyController(); var info = nbCtrl.GetPluginSinglePageData(Shippingkey, "SHIPPING", Utils.GetCurrentCulture()); if (info == null) { return(string.Empty); } string ctrlMapPath = HttpContext.Current.Server.MapPath("/DesktopModules/NBright/OS_AllShipping"); var templateCtrl = new NBrightCore.TemplateEngine.TemplateGetter(PortalSettings.Current.HomeDirectoryMapPath, ctrlMapPath, "Themes\\config", ""); string template = templateCtrl.GetTemplateData(templatename, Utils.GetCurrentCulture()); return(template); }
public PluginData(int portalId, Boolean systemlevel = false) { _templCtrl = NBrightBuyUtils.GetTemplateGetter(portalId,"config"); portallevel = !systemlevel; if (StoreSettings.Current == null) { storeSettings = new StoreSettings(portalId); } else { storeSettings = StoreSettings.Current; } var menuplugin = _templCtrl.GetTemplateData("menuplugin.xml", Utils.GetCurrentCulture(), true, true, portallevel, storeSettings.Settings()); if (menuplugin != "") { Info = new NBrightInfo(); Info.XMLData = menuplugin; _pluginList = new List<NBrightInfo>(); _pluginList = GetPluginList(); } else { // no menuplugin.xml exists, so must be new install, get new config var pluginfoldermappath = System.Web.Hosting.HostingEnvironment.MapPath(StoreSettings.NBrightBuyPath() + "/Plugins"); if (pluginfoldermappath != null && Directory.Exists(pluginfoldermappath)) { var xmlDoc = new XmlDocument(); xmlDoc.Load(pluginfoldermappath + "\\menu.config"); pluginfoldermappath = System.Web.Hosting.HostingEnvironment.MapPath(StoreSettings.NBrightBuyPath() + "/Themes/config/default"); xmlDoc.Save(pluginfoldermappath + "\\menuplugin.xml"); //load new config menuplugin = _templCtrl.GetTemplateData("menuplugin.xml", Utils.GetCurrentCulture(), true, true, portallevel, storeSettings.Settings()); if (menuplugin != "") { Info = new NBrightInfo(); Info.XMLData = menuplugin; _pluginList = new List<NBrightInfo>(); _pluginList = GetPluginList(); } } } }
public static String GetTemplateData(String templatename, NBrightInfo info) { var controlMapPath = HttpContext.Current.Server.MapPath("/DesktopModules/NBright/NBrightBuy/Providers/ManualPaymentProvider"); var templCtrl = new NBrightCore.TemplateEngine.TemplateGetter(PortalSettings.Current.HomeDirectoryMapPath, controlMapPath, "Themes\\config", ""); var templ = templCtrl.GetTemplateData(templatename, Utils.GetCurrentCulture()); var dic = new Dictionary<String, String>(); foreach (var d in StoreSettings.Current.Settings()) { dic.Add(d.Key,d.Value); } foreach (var d in info.ToDictionary()) { if (dic.ContainsKey(d.Key)) dic[d.Key] = d.Value; else dic.Add(d.Key, d.Value); } templ = Utils.ReplaceSettingTokens(templ, dic); templ = Utils.ReplaceUrlTokens(templ); return templ; }
public PluginData(int portalId, Boolean systemlevel = false) { _portalId = portalId; _templCtrl = NBrightBuyUtils.GetTemplateGetter(portalId, "config"); _portallevel = !systemlevel; if (StoreSettings.Current == null) { _storeSettings = new StoreSettings(portalId); } else { _storeSettings = StoreSettings.Current; } _cachekey = "pluginlist" + portalId + "*" + systemlevel; var pList = NBrightBuyUtils.GetModCache(_cachekey); if (pList != null) { // if we've created an empty cache record, clear cache data _pluginList = (List <NBrightInfo>)pList; if (_pluginList.Count == 0) { DotNetNuke.Common.Utilities.DataCache.ClearCache(); } } if (pList != null && !_storeSettings.DebugMode) { _pluginList = (List <NBrightInfo>)pList; } else { Load(); } }
public PluginData(int portalId, Boolean systemlevel = false) { _portalId = portalId; _templCtrl = NBrightBuyUtils.GetTemplateGetter(portalId,"config"); _portallevel = !systemlevel; if (StoreSettings.Current == null) { _storeSettings = new StoreSettings(portalId); } else { _storeSettings = StoreSettings.Current; } _cachekey = "pluginlist" + portalId + "*" + systemlevel; var pList = NBrightBuyUtils.GetModCache(_cachekey); if (pList != null) { // if we've created an empty cache record, clear cache data _pluginList = (List<NBrightInfo>)pList; if (_pluginList.Count == 0) DotNetNuke.Common.Utilities.DataCache.ClearCache(); } if (pList != null && !_storeSettings.DebugMode) { _pluginList = (List<NBrightInfo>)pList; } else { Load(); } }
public PluginData(int portalId, Boolean systemlevel = false) { _templCtrl = NBrightBuyUtils.GetTemplateGetter(portalId,"config"); portallevel = !systemlevel; if (StoreSettings.Current == null) { storeSettings = new StoreSettings(portalId); } else { storeSettings = StoreSettings.Current; } var cachekey = "pluginlist" + portalId + "*" + systemlevel; var pList = NBrightBuyUtils.GetModCache(cachekey); if (pList != null) { // if we've created an empty cache record, clear cache data _pluginList = (List<NBrightInfo>)pList; if (_pluginList.Count == 0) DotNetNuke.Common.Utilities.DataCache.ClearCache(); } if (pList != null) { // if we've created an empty cache record, clear cache data _pluginList = (List<NBrightInfo>)pList; if (_pluginList.Count == 0) DotNetNuke.Common.Utilities.DataCache.ClearCache(); } if (pList != null && !storeSettings.DebugMode) { _pluginList = (List<NBrightInfo>)pList; } else { var menuplugin = _templCtrl.GetTemplateData("menuplugin.xml", Utils.GetCurrentCulture(), true, true, portallevel, storeSettings.Settings()); if (menuplugin != "") { var info = new NBrightInfo(); info.XMLData = menuplugin; _pluginList = new List<NBrightInfo>(); _pluginList = CalcPluginList(info); } else { // no menuplugin.xml exists, so must be new install, get new config var pluginfoldermappath = System.Web.Hosting.HostingEnvironment.MapPath(StoreSettings.NBrightBuyPath() + "/Plugins"); if (pluginfoldermappath != null && Directory.Exists(pluginfoldermappath)) { var xmlDoc = new XmlDocument(); xmlDoc.Load(pluginfoldermappath + "\\menu.config"); pluginfoldermappath = System.Web.Hosting.HostingEnvironment.MapPath(StoreSettings.NBrightBuyPath() + "/Themes/config/default"); xmlDoc.Save(pluginfoldermappath + "\\menuplugin.xml"); //load new config menuplugin = _templCtrl.GetTemplateData("menuplugin.xml", Utils.GetCurrentCulture(), true, true, portallevel, storeSettings.Settings()); if (menuplugin != "") { var Info = new NBrightInfo(); Info.XMLData = menuplugin; _pluginList = new List<NBrightInfo>(); _pluginList = GetPluginList(); } } } NBrightBuyUtils.SetModCache(0,cachekey,_pluginList); } }
protected override void OnInit(EventArgs e) { //// Debug code for cache improvement timing: REMOVE FOR BUILD //NBrightLogTrace = NBrightCore.common.Utils.ReadFile(PortalSettings.HomeDirectoryMapPath + "\\NBrightLogTrace.txt"); //NBrightLogStartTick = DateTime.Now.Ticks; //// Debug code for cache improvement timing: REMOVE FOR BUILD base.OnInit(e); // Attach events //NOTE: this event has been removed to stop memory leak (hold on memory) DO NOT PUT IT BACK!!!! //GenXmlFunctions.FileHasBeenUploaded += new UploadFileCompleted(OnFileUploaded); OverRideInfoList = null; if (String.IsNullOrEmpty(ControlAdminPath)) { ControlAdminPath = ControlPath; } UInfo = new UserDataInfo(PortalId, ModuleId, ObjCtrl, CtrlTypeCode); EntityLangauge = Utils.RequestQueryStringParam(Context, "lang"); if (EntityLangauge.Length != 5) { EntityLangauge = Utils.GetCurrentCulture(); } //make sure we have a valid culture code in upper and lower case. (url re-writers can make all url lowercase) (none is the default editing langauge for templates/admin content) if (EntityLangauge != "none") { EntityLangauge = EntityLangauge.Substring(0, 2).ToLower() + "-" + EntityLangauge.Substring(3, 2).ToUpper(); } //get the ItemId ItemId = Utils.RequestQueryStringParam(Context, "itemid"); //get the langauge ItemId ItemIdLang = Utils.RequestQueryStringParam(Context, "itemidlang"); if (ItemIdLang == "" && ItemId != "") { ItemIdLang = "0"; var obj = GetDataLang(); if (obj != null) { ItemIdLang = obj.ItemID.ToString(); } } CtrlSearch = new Repeater(); this.Controls.Add(CtrlSearch); CtrlListMsg = new LiteralControl(); this.Controls.Add(CtrlListMsg); CtrlListMsg.Visible = false; CtrlList = new Repeater(); this.Controls.Add(CtrlList); if (!DisablePaging) { CtrlPaging = new NBrightCore.controls.PagingCtrl(); this.Controls.Add(CtrlPaging); CtrlList.ItemCommand += new RepeaterCommandEventHandler(CtrlListItemCommand); CtrlSearch.ItemCommand += new RepeaterCommandEventHandler(CtrlSearchItemCommand); CtrlPaging.PageChanged += new RepeaterCommandEventHandler(PagingClick); } if (String.IsNullOrEmpty(PrimaryTemplateMapPath)) { PrimaryTemplateMapPath = PortalSettings.HomeDirectoryMapPath; } if (String.IsNullOrEmpty(SecondaryTemplateMapPath)) { SecondaryTemplateMapPath = MapPath(ControlAdminPath); } if (String.IsNullOrEmpty(TemplateThemeFolder)) { TemplateThemeFolder = ""; // we need a valid value, even if empty } TemplCtrl = new NBrightCore.TemplateEngine.TemplateGetter(PrimaryTemplateMapPath, SecondaryTemplateMapPath, "NBrightTemplates", TemplateThemeFolder); }