Example #1
0
        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);
        }
Example #2
0
        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();
                    }
                }
            }
        }
Example #3
0
 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;
 }
Example #4
0
        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);
        }
Example #6
0
        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);
        }
Example #7
0
        public void OnInitActivateList(bool withSearch = true, bool withPaging = true, string templatePath = "")
        {
            var strListSearch = "";
            var strListHeader = "";
            var strListBody   = "";
            var strListFooter = "";

            if (withSearch)
            {
                strListSearch = TemplCtrl.GetTemplateData(CtrlTypeCode + "_Search.html", Utils.GetCurrentCulture());
            }

            _activatePaging = withPaging;
            strListHeader   = TemplCtrl.GetTemplateData(CtrlTypeCode + "_ListH.html", Utils.GetCurrentCulture());
            strListBody     = TemplCtrl.GetTemplateData(CtrlTypeCode + "_List.html", Utils.GetCurrentCulture());
            strListFooter   = TemplCtrl.GetTemplateData(CtrlTypeCode + "_ListF.html", Utils.GetCurrentCulture());

            OnInitActivateList(strListHeader, strListBody, strListFooter, strListSearch, withPaging);
        }
Example #8
0
        public void Load()
        {
            var menuplugin = _templCtrl.GetTemplateData("menuplugin.xml", Utils.GetCurrentCulture(), true, true, _portallevel, _storeSettings.Settings());

            if (menuplugin != "")
            {
                var info = new NBrightInfo();
                info.PortalId = _portalId;
                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.PortalId = _portalId;
                        info.XMLData  = menuplugin;
                        _pluginList   = new List <NBrightInfo>();
                        _pluginList   = CalcPluginList(info);
                    }
                }
            }
            NBrightBuyUtils.SetModCache(0, _cachekey, _pluginList);
        }
        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);
        }
Example #10
0
 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;
 }
Example #11
0
        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);
            }
        }