Exemple #1
0
 public CatMenuBuilder(String templateBody, ModSettings modSettings, int currentCatId, Boolean debugMode)
 {
     _catGrpCtrl = new GrpCatController(Utils.GetCurrentCulture());
     _ctrlObj = new NBrightBuyController();
     _modSettings = modSettings;
     _debugMode = debugMode;
     _templateBody = GetMenuTemplates(templateBody);
     _currentCatId = currentCatId;
 }
Exemple #2
0
 public void AddClientRole(ModSettings modSettings)
 {
     if (_userInfo != null)
     {
         if (!_userInfo.IsInRole("Client"))
         {
             var rc = new DotNetNuke.Security.Roles.RoleController();
             var ri = rc.GetRoleByName(PortalId, "Client");
             if (ri != null) rc.AddUserRole(PortalId, _userInfo.UserID, ri.RoleID, Null.NullDate);
             if (StoreSettings.Current.Get("sendclientroleemail") == "True") NBrightBuyUtils.SendEmail(_userInfo.Email, "addclientrole.html", _clientInfo, "", "", _userInfo.Profile.PreferredLocale);
         }
     }
 }
        private void CatDefaultDataBind(object sender, EventArgs e)
        {
            var lc = (Literal)sender;
            var name = lc.Text;
            lc.Text = "";
            var container = (IDataItemContainer)lc.NamingContainer;
            try
            {
                lc.Visible = visibleStatus.DefaultIfEmpty(true).First();
                var moduleId = DataBinder.Eval(container.DataItem, "ModuleId");
                var id = Convert.ToString(DataBinder.Eval(container.DataItem, "ItemId"));
                var lang = Convert.ToString(DataBinder.Eval(container.DataItem, "lang"));

                if (Utils.IsNumeric(id) && Utils.IsNumeric(moduleId))
                {
                    var moduleKey = "";
                    // if we have no catid in url, we're going to need a default category from module.
                    var settings = new System.Collections.Hashtable();
                    var modSettings = new ModSettings(Convert.ToInt32(moduleId), settings);
                    moduleKey = modSettings.Get("modulekey");

                    var grpCatCtrl = new GrpCatController(Utils.GetCurrentCulture());
                    var objCInfo = grpCatCtrl.GetCurrentCategoryData(PortalSettings.Current.PortalId, lc.Page.Request, Convert.ToInt32(id), modSettings.Settings(), moduleKey);
                    if (objCInfo != null)
                    {
                        GroupCategoryData objPcat;
                        switch (name.ToLower())
                        {
                            case "categorydesc":
                                lc.Text = objCInfo.categorydesc;
                                break;
                            case "message":
                                lc.Text = System.Web.HttpUtility.HtmlDecode(objCInfo.message);
                                break;
                            case "archived":
                                lc.Text = objCInfo.archived.ToString(CultureInfo.InvariantCulture);
                                break;
                            case "breadcrumb":
                                lc.Text = objCInfo.breadcrumb;
                                break;
                            case "categoryid":
                                lc.Text = objCInfo.categoryid.ToString("");
                                break;
                            case "categoryname":
                                lc.Text = objCInfo.categoryname;
                                break;
                            case "categoryref":
                                lc.Text = objCInfo.categoryref;
                                break;
                            case "depth":
                                lc.Text = objCInfo.depth.ToString("");
                                break;
                            case "disabled":
                                lc.Text = objCInfo.disabled.ToString(CultureInfo.InvariantCulture) ;
                                break;
                            case "entrycount":
                                lc.Text = objCInfo.entrycount.ToString("");
                                break;
                            case "grouptyperef":
                                lc.Text = objCInfo.grouptyperef;
                                break;
                            case "imageurl":
                                lc.Text = objCInfo.imageurl;
                                break;
                            case "ishidden":
                                lc.Text = objCInfo.ishidden.ToString(CultureInfo.InvariantCulture);
                                break;
                            case "isvisible":
                                lc.Text = objCInfo.isvisible.ToString(CultureInfo.InvariantCulture) ;
                                break;
                            case "metadescription":
                                lc.Text = objCInfo.metadescription;
                                break;
                            case "metakeywords":
                                lc.Text = objCInfo.metakeywords;
                                break;
                            case "parentcatid":
                                lc.Text = objCInfo.parentcatid.ToString("");
                                break;
                            case "parentcategoryname":
                                objPcat = grpCatCtrl.GetCategory(objCInfo.parentcatid);
                                lc.Text = objPcat.categoryname;
                                break;
                            case "parentcategoryref":
                                objPcat = grpCatCtrl.GetCategory(objCInfo.parentcatid);
                                lc.Text = objPcat.categoryref;
                                break;
                            case "parentcategorydesc":
                                objPcat = grpCatCtrl.GetCategory(objCInfo.parentcatid);
                                lc.Text = objPcat.categorydesc;
                                break;
                            case "parentcategorybreadcrumb":
                                objPcat = grpCatCtrl.GetCategory(objCInfo.parentcatid);
                                lc.Text = objPcat.breadcrumb;
                                break;
                            case "parentcategoryguidkey":
                                objPcat = grpCatCtrl.GetCategory(objCInfo.parentcatid);
                                lc.Text = objPcat.categoryrefGUIDKey;
                                break;
                            case "recordsortorder":
                                lc.Text = objCInfo.recordsortorder.ToString("");
                                break;
                            case "seoname":
                                lc.Text = objCInfo.seoname;
                                if (lc.Text == "") lc.Text = objCInfo.categoryname;
                                break;
                            case "seopagetitle":
                                lc.Text = objCInfo.seopagetitle ;
                                break;
                            case "url":
                                lc.Text = objCInfo.url ;
                                break;
                        }
                    }
                }

            }
            catch (Exception ex)
            {
                lc.Text = ex.ToString();
            }
        }
Exemple #4
0
        protected override void OnInit(EventArgs e)
        {
            ModCtrl = new NBrightBuyController();
            DebugMode = StoreSettings.Current.DebugMode;

            base.OnInit(e);

            #region "Get all Settings for module"
            //get Model Level Settings
            ModSettings = new ModSettings(ModuleId, Settings);
            ModuleKey = ModSettings.Get("modulekey");

            #endregion

            if (EnablePaging)
            {
                CtrlPaging = new NBrightCore.controls.PagingCtrl();
                this.Controls.Add(CtrlPaging);
                CtrlPaging.PageChanged += new RepeaterCommandEventHandler(PagingClick);
            }

            //add template provider to NBright Templating
            NBrightCore.providers.GenXProviderManager.AddProvider("NBrightBuy,Nevoweb.DNN.NBrightBuy.render.GenXmlTemplateExt");

            // search for any other NBright Tenmplating providers that might have been added.
            var pluginData = new PluginData(PortalSettings.Current.PortalId);
            var l = pluginData.GetTemplateExtProviders();
            foreach (var p in l)
            {
                var prov = p.Value;
                NBrightCore.providers.GenXProviderManager.AddProvider(prov.GetXmlProperty("genxml/textbox/assembly") + "," + prov.GetXmlProperty("genxml/textbox/namespaceclass"));
            }
        }
 public string GetTemplateData(ModSettings modSettings, string templatename, string lang, bool debugMode = false)
 {
     return GetTemplateData(modSettings.Moduleid, templatename, lang, modSettings.Settings(), debugMode);
 }
 public string GetTemplateData(ModSettings modSettings, string templatename, string lang, bool debugMode = false)
 {
     return(GetTemplateData(modSettings.Moduleid, templatename, lang, modSettings.Settings(), debugMode));
 }