Exemplo n.º 1
0
 public override void UpdateSettings()
 {
     try
     {
         DotNetNuke.Entities.Modules.ModuleController objModules = new DotNetNuke.Entities.Modules.ModuleController();
         objModules.UpdateModuleSetting(ModuleId, "pageSizeAdmin", txtLimitAdmin.Text);
         string strCats = "";
         foreach (ListItem l in lstChkCats.Items)
         {
             if (l.Selected == true)
             {
                 strCats += "," + l.Value;
             }
         }
         if (strCats != "")
         {
             strCats = strCats.Substring(1);
         }
         objModules.UpdateModuleSetting(ModuleId, "cats", strCats);
     }
     catch (Exception exc)
     {
         Exceptions.ProcessModuleLoadException(this, exc);
     }
 }
 public override void UpdateSettings()
 {
     DotNetNuke.Entities.Modules.ModuleController mc = new DotNetNuke.Entities.Modules.ModuleController();
     mc.UpdateModuleSetting(ModuleId, "TieuDe", TextBox1.Text);
     mc.UpdateModuleSetting(ModuleId, "Nguon", DropDownList1.SelectedValue);
     mc.UpdateModuleSetting(ModuleId, "TuyChon", RadioButtonList1.SelectedValue);
 }
Exemplo n.º 3
0
        public bool Delete(int tabId, int modId)
        {
            var mc = new DotNetNuke.Entities.Modules.ModuleController();

            mc.DeleteTabModule(tabId, modId, true);
            return(true);
        }
Exemplo n.º 4
0
        public HttpResponseMessage ManageUser(DTO.UserDetails user)
        {
            var apiResponse = new DTO.ApiResponse <string>();

            try
            {
                var userController = new DotNetNuke.Entities.Users.UserController();

                var dnnUser = DotNetNuke.Entities.Users.UserController.GetUserById(PortalSettings.PortalId, user.Id);
                if (dnnUser != null)
                {
                    var objModules = new DotNetNuke.Entities.Modules.ModuleController();
                    var objModule  = objModules.GetModuleByDefinition(PortalSettings.PortalId, "User Accounts");
                    if (objModule != null)
                    {
                        apiResponse.CustomObject = DotNetNuke.Common.Globals.NavigateURL(objModule.TabID, false, PortalSettings, "Edit", new string[] { "UserId=" + dnnUser.UserID.ToString(), "mid=" + objModule.ModuleID.ToString() });
                        apiResponse.Success      = true;
                    }
                }
            }
            catch (Exception err)
            {
                apiResponse.Success = false;
                apiResponse.Message = err.Message;

                Exceptions.LogException(err);
            }

            return(Request.CreateResponse(HttpStatusCode.OK, apiResponse));
        }
Exemplo n.º 5
0
        public void ProcessRequest(HttpContext context)
        {
            SharedMethods.InitializeEntitySpaces();
            HttpRequest  request  = context.Request;
            HttpResponse response = context.Response;

            context.Response.ContentType = "application/json";


            int maxPoints = int.MaxValue;

            var customField = request.Params["customField"] ?? String.Empty;
            var country     = request.Params["country"] ?? String.Empty;
            var state       = request.Params["state"] ?? String.Empty;
            var city        = request.Params["city"] ?? String.Empty;

            var moduleId       = Convert.ToInt32(request.Params["moduleId"]);
            var targetModuleId = Convert.ToInt32(request.Params["targetModuleId"]);

            var markerCollection = Queries.GetMarkersByState(targetModuleId, customField, country, state, maxPoints, null);

            var markers = new List <ViewAbleMarker>();

            markerCollection.ToList().ForEach(marker => markers.Add(new ViewAbleMarker(marker)));

            DotNetNuke.Entities.Modules.ModuleController objModules = new DotNetNuke.Entities.Modules.ModuleController();
            var settings   = objModules.GetModuleSettings(moduleId);
            var template   = Convert.ToString(settings[DNNspot.Maps.MarkerListing.ModuleSettingNames.ListTemplate]);
            var markerHtml = DNNspot.Maps.Common.ModuleBase.ReplaceTokens(markerCollection, template, moduleId);

            var jsonObject = new { message = String.Empty, success = true, markerHtml = markerHtml.ToString() };

            response.Write(JsonConvert.SerializeObject(jsonObject));
        }
 public override void UpdateSettings()
 {
     try
     {
         DotNetNuke.Entities.Modules.ModuleController objModules = new DotNetNuke.Entities.Modules.ModuleController();
         objModules.UpdateModuleSetting(ModuleId, "limits", txtLimits.Text);
         objModules.UpdateModuleSetting(ModuleId, "source", radSource.SelectedValue);
         objModules.UpdateModuleSetting(ModuleId, "categoryid", ddlCategory.SelectedValue);
         objModules.UpdateModuleSetting(ModuleId, "newsgroupid", ddlNewsGroup.SelectedValue);
         objModules.UpdateModuleSetting(ModuleId, "categorycode", txtCategoryCode.Text);
         objModules.UpdateModuleSetting(ModuleId, "newsgroupcode", txtNewsGroupCode.Text);
         objModules.UpdateModuleSetting(ModuleId, "slideHeight", txtSlideHeight.Text);
         objModules.UpdateModuleSetting(ModuleId, "leftPartWidth", txtLeftPartWidth.Text);
         objModules.UpdateModuleSetting(ModuleId, "rightPartWidth", txtRightPartWidth.Text);
         objModules.UpdateModuleSetting(ModuleId, "thumbnailHeight", txtImageHeight.Text);
         objModules.UpdateModuleSetting(ModuleId, "thumbnailWidth", txtImageWidth.Text);
         objModules.UpdateModuleSetting(ModuleId, "displayTitle", chkDisplayTitle.Checked.ToString());
         objModules.UpdateModuleSetting(ModuleId, "titleCSSClass", txtTitleCSSClass.Text);
         objModules.UpdateModuleSetting(ModuleId, "titleLength", txtTitleLength.Text);
         objModules.UpdateModuleSetting(ModuleId, "descLength", txtDescLength.Text);
     }
     catch (Exception exc)
     {
         Exceptions.ProcessModuleLoadException(this, exc);
     }
 }
        private static String GeocodeNextModuleMarker(int moduleId)
        {
            var settings = new DotNetNuke.Entities.Modules.ModuleController().GetModuleSettings(moduleId);

            var markers = GetTopMarkerByModuleId(moduleId);

            if (markers.Count < 1)
            {
                return("All markers have been geocoded");
            }

            var marker  = markers.First();
            var address = String.Format("{0} {1}, {2}, {3} {4} {5}", marker.Address1, marker.Address2, marker.City, marker.Region, marker.PostalCode, marker.Country);
            //var geocodeRequest = new GeocodeRequest(address);
            //var geocodeService = new GoogleGeocodeService((string)(settings[ModuleSettingNames.ApiKey] ?? "ABQIAAAAeqB6L08C1Tf8o24Lvoqq9BT2yXp_ZAY8_ufC3CFXhHIE1NvwkxRTRiEJPO7V86QE95aNqonFXBhDOQ"));

            var geocodeResult = GeocodeLocation(address);

            if (geocodeResult.GeocodeSuccess)
            {
                marker.Latitude  = geocodeResult.Latitude;
                marker.Longitude = geocodeResult.Longitude;
                markers.Save();
            }
            return(geocodeResult.StatusMessage);
        }
Exemplo n.º 8
0
        internal static int AddExistingModule(int moduleId, int tabId, string paneName, int position, string align, string container)
        {
            var objModules  = new DotNetNuke.Entities.Modules.ModuleController();
            var objEventLog = new DotNetNuke.Services.Log.EventLog.EventLogController();

            int UserId = PortalSettings.Current.UserId;

            var objModule = objModules.GetModule(moduleId, tabId, false);

            if (objModule != null)
            {
                // clone the module object ( to avoid creating an object reference to the data cache )
                var objClone = objModule.Clone();
                objClone.TabID        = PortalSettings.Current.ActiveTab.TabID;
                objClone.ModuleOrder  = position;
                objClone.PaneName     = paneName;
                objClone.Alignment    = align;
                objClone.ContainerSrc = container;

                int iNewModuleId = objModules.AddModule(objClone);
                //objEventLog.AddLog(objClone, PortalSettings.Current, UserId, "", DotNetNuke.Services.Log.EventLog.EventLogController.EventLogType.MODULE_CREATED);

                return(iNewModuleId);
            }

            return(-1);
        }
        private static String GeocodeMarker(int moduleId, int markerId)
        {
            var settings = new DotNetNuke.Entities.Modules.ModuleController().GetModuleSettings(moduleId);

            //var markers = GetTopMarkerByModuleId(moduleId);

            //if (markers.Count < 1)
            //    return "All markers have been geocoded";

            Marker marker = new Marker();

            marker.LoadByPrimaryKey(markerId);

            //var marker = markers.First();
            var address = String.Format("{0} {1}, {2}, {3} {4} {5}", marker.Address1, marker.Address2, marker.City, marker.Region, marker.PostalCode, marker.Country);

            var geocodeResult = GeocodeLocation(address);

            if (geocodeResult.GeocodeSuccess)
            {
                marker.Latitude  = geocodeResult.Latitude;
                marker.Longitude = geocodeResult.Longitude;
                marker.Save();
            }
            return(geocodeResult.StatusMessage);
        }
Exemplo n.º 10
0
        internal static void AddModuleCopy(int iModuleId, int iTabId, int iOrderPosition, string sPaneName, string container)
        {
            var objModules = new DotNetNuke.Entities.Modules.ModuleController();
            var objModule  = objModules.GetModule(iModuleId, iTabId, false);

            if (objModule != null)
            {
                //Clone module as it exists in the cache and changes we make will update the cached object
                var newModule = objModule.Clone();

                newModule.ModuleID     = Null.NullInteger;
                newModule.TabID        = PortalSettings.Current.ActiveTab.TabID;
                newModule.ModuleTitle  = "Copy of " + objModule.ModuleTitle;
                newModule.ModuleOrder  = iOrderPosition;
                newModule.PaneName     = sPaneName;
                newModule.ContainerSrc = container;
                newModule.ModuleID     = objModules.AddModule(newModule);

                if (string.IsNullOrEmpty(newModule.DesktopModule.BusinessControllerClass) == false)
                {
                    object objObject = DotNetNuke.Framework.Reflection.CreateObject(newModule.DesktopModule.BusinessControllerClass, newModule.DesktopModule.BusinessControllerClass);
                    if (objObject is DotNetNuke.Entities.Modules.IPortable)
                    {
                        string Content = Convert.ToString(((DotNetNuke.Entities.Modules.IPortable)objObject).ExportModule(iModuleId));
                        if (string.IsNullOrEmpty(Content) == false)
                        {
                            ((DotNetNuke.Entities.Modules.IPortable)objObject).ImportModule(newModule.ModuleID, Content, newModule.DesktopModule.Version, PortalSettings.Current.UserId);
                        }
                    }
                }
            }
        }
        public HttpResponseMessage InstallExtensionUrl(int PageId)
        {
            var apiResponse = new DTO.ApiResponse <string>();

            try
            {
                if (DotNetNuke.Entities.Users.UserController.Instance.GetCurrentUserInfo().IsSuperUser)
                {
                    var objModules = new DotNetNuke.Entities.Modules.ModuleController();
                    var objModule  = objModules.GetModuleByDefinition(-1, "Extensions");
                    if (objModule != null)
                    {
                        apiResponse.Message = DotNetNuke.Common.Globals.NavigateURL(objModule.TabID, true, PortalSettings, "Install", new string[] { "rtab=" + PageId.ToString() });
                    }

                    apiResponse.Success = true;
                }
            }
            catch (Exception err)
            {
                apiResponse.Success = false;
                apiResponse.Message = err.Message;

                Exceptions.LogException(err);
            }

            return(Request.CreateResponse(HttpStatusCode.OK, apiResponse));
        }
        public HttpResponseMessage ListModulesOnPage(int portalId, int tabId)
        {
            var apiResponse = new DTO.ApiResponse <List <DTO.GenericListItem> >();

            try
            {
                var mc = new DotNetNuke.Entities.Modules.ModuleController();
                apiResponse.CustomObject = new List <DTO.GenericListItem>();

                foreach (var tabModule in mc.GetTabModules(tabId))
                {
                    var newGenericItem = new DTO.GenericListItem();
                    newGenericItem.Name  = string.Format("{0} - {1} - {2}", string.IsNullOrWhiteSpace(tabModule.Value.ModuleTitle) ? "No Title" : tabModule.Value.ModuleTitle, tabModule.Value.PaneName, tabModule.Value.ModuleDefinition.FriendlyName);
                    newGenericItem.Value = tabModule.Value.ModuleID.ToString();
                    apiResponse.CustomObject.Add(newGenericItem);
                }

                apiResponse.Success = true;
            }
            catch (Exception err)
            {
                apiResponse.Success = false;
                apiResponse.Message = err.Message;

                Exceptions.LogException(err);
            }

            return(Request.CreateResponse(HttpStatusCode.OK, apiResponse));
        }
Exemplo n.º 13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            #region ViewPermission
            // Truyen vao tabid va mid de he thong kiem tra
            // Neu User dang truy cap co quyen thi he thong tra ra du lieu
            // Neu user khong co quyen he thong se thong bao not define
            try
            {
                DotNetNuke.Entities.Portals.PortalSettings portalSettings = DotNetNuke.Entities.Portals.PortalController.GetCurrentPortalSettings();
                if (((Request.QueryString["tabid"] == null && Request.Form["tabid"] == null) || (Request.QueryString["mid"] == null && Request.Form["mid"] == null)) || !(Request.IsAuthenticated))
                {
                    WriteDataError("NotAuthenticated");
                    return;
                }
                // get TabId
                int TabId = -1;
                if ((Request.QueryString["tabid"] != null))
                {
                    TabId = Int32.Parse(Request.QueryString["tabid"]);
                }
                else if ((Request.Form["tabid"] != null))
                {
                    TabId = Int32.Parse(Request.Form["tabid"]);
                }

                // get ModuleId
                int ModuleId = -1;
                if ((Request.QueryString["mid"] != null))
                {
                    ModuleId = Int32.Parse(Request.QueryString["mid"]);
                }
                else if ((Request.Form["mid"] != null))
                {
                    ModuleId = Int32.Parse(Request.Form["mid"]);
                }
                objUserInfo = DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo();
                DotNetNuke.Entities.Modules.ModuleController mc = new DotNetNuke.Entities.Modules.ModuleController();
                System.Collections.Hashtable settings           = mc.GetModuleSettings(ModuleId);
                objModuleInfo = new DotNetNuke.Entities.Modules.ModuleController().GetModule(ModuleId, TabId);

                if (DotNetNuke.Security.Permissions.ModulePermissionController.CanViewModule(objModuleInfo))
                {
                    try
                    {
                        WriteData();
                    }
                    catch (Exception ex)
                    {
                        WriteDataError(ex.Message);
                    }
                }
            }
            catch (Exception ex)
            {
                WriteDataError(ex.Message);
            }
            #endregion
            base.OnInit(e);
        }
        private bool HasViewPermissions()
        {
            var mi = default(DotNetNuke.Entities.Modules.ModuleInfo);
            var mc = new DotNetNuke.Entities.Modules.ModuleController();

            mi = mc.GetModule(ModuleId, TabId);
            return(ModulePermissionController.CanViewModule(mi));
        }
Exemplo n.º 15
0
 public override void UpdateSettings()
 {
     base.UpdateSettings();
     DotNetNuke.Entities.Modules.ModuleController mc = new DotNetNuke.Entities.Modules.ModuleController();
     mc.UpdateModuleSetting(ModuleId, "TabForward", ddlTabFw.SelectedValue);
     mc.UpdateModuleSetting(ModuleId, "PageSize", txtSize.Text);
     mc.UpdateModuleSetting(ModuleId, "CatProduct", ddlCat.SelectedValue);
 }
Exemplo n.º 16
0
        public bool Delete(int tabId, int modId)
        {
            Log.Add($"delete mod:{modId} on tab:{tabId}");
            var mc = new DotNetNuke.Entities.Modules.ModuleController();

            mc.DeleteTabModule(tabId, modId, true);
            Log.Add("delete completed");
            return(true);
        }
Exemplo n.º 17
0
        internal override void UpdateTitle(ToSic.Eav.Interfaces.IEntity titleItem)
        {
            Log.Add("update title");
            // todo: this should probably do the more complex stuff
            // to ensure that it happens on all versions of this module (all languages)
            // used to work once...
            //if (titleItem?.GetBestValue("EntityTitle") != null)
            //    SxcContext.ModuleInfo.ModuleTitle = titleItem.GetBestValue("EntityTitle").ToString();

            // 2017-04-01 2dm before:
            // var languages =  ZoneHelpers.CulturesWithState(SxcContext.ModuleInfo.PortalID, SxcContext.ZoneId.Value);
            var languages = SxcContext.Environment /*new Environment.DnnEnvironment(Log)*/.ZoneMapper.CulturesWithState(SxcContext.ModuleInfo.PortalID,
                                                                                                                        SxcContext.ZoneId.Value);

            // Find Module for default language
            var moduleController = new DotNetNuke.Entities.Modules.ModuleController();
            var originalModule   = moduleController.GetModule(SxcContext.ModuleInfo.ModuleID);

            foreach (var dimension in languages)
            {
                if (!originalModule.IsDefaultLanguage)
                {
                    originalModule = originalModule.DefaultLanguageModule;
                }

                try // this can sometimes fail, like if the first item is null - https://github.com/2sic/2sxc/issues/817
                {
                    // Break if default language module is null
                    if (originalModule == null)
                    {
                        return;
                    }

                    // Get Title value of Entitiy in current language
                    var titleValue = titleItem.Title[dimension.Key].ToString();

                    // Find module for given Culture
                    var moduleByCulture = moduleController.GetModuleByCulture(originalModule.ModuleID,
                                                                              originalModule.TabID, SxcContext.ModuleInfo.PortalID,
                                                                              DotNetNuke.Services.Localization.LocaleController.Instance.GetLocale(dimension.Key));

                    // Break if no title module found
                    if (moduleByCulture == null || titleValue == null)
                    {
                        return;
                    }

                    moduleByCulture.ModuleTitle = titleValue;
                    moduleController.UpdateModule(moduleByCulture);
                }
                catch
                {
                    // ignored
                }
            }
        }
        public override void UpdateSettings()
        {
            try { Int32.Parse(tbSoBai.Text); }
            catch { tbSoBai.Text = "10"; }
            DotNetNuke.Entities.Modules.ModuleController mc = new DotNetNuke.Entities.Modules.ModuleController();
            mc.UpdateModuleSetting(ModuleId, "Nguon", ddNguonTin.SelectedValue);
            mc.UpdateModuleSetting(ModuleId, "Trang", tbSoBai.Text);

            //mc.UpdateModuleSetting(ModuleId, "SQL", tbSQL.Text);
        }
        public override void UpdateSettings()
        {
            try
            {
                DotNetNuke.Entities.Modules.ModuleController objmodules = new DotNetNuke.Entities.Modules.ModuleController();
                objmodules.UpdateModuleSetting(ModuleId, "template1", ddlTemplate1.Text);
                objmodules.UpdateModuleSetting(ModuleId, "template2", ddlTemplate2.Text);
                objmodules.UpdateModuleSetting(ModuleId, "template3", ddlTemplate3.Text);

                objmodules.UpdateModuleSetting(ModuleId, "numshortnews1", txtNumShortNews1.Text);
                objmodules.UpdateModuleSetting(ModuleId, "numshortnews2", txtNumShortNews2.Text);
                objmodules.UpdateModuleSetting(ModuleId, "numshortnews3", txtNumShortNews3.Text);

                objmodules.UpdateModuleSetting(ModuleId, "imagewidth1", txtImageWidth1.Text);
                objmodules.UpdateModuleSetting(ModuleId, "imagewidth2", txtImageWidth2.Text);
                objmodules.UpdateModuleSetting(ModuleId, "imagewidth3", txtImageWidth3.Text);

                objmodules.UpdateModuleSetting(ModuleId, "tieude1", txtTieuDe1.Text);
                string sBaiViet1 = "";
                foreach (ListItem i in lstBaiViet1.Items)
                {
                    if (i.Selected)
                    {
                        sBaiViet1 += "@" + i.Value + "@";
                    }
                }
                objmodules.UpdateModuleSetting(ModuleId, "baiviet1", sBaiViet1);

                objmodules.UpdateModuleSetting(ModuleId, "tieude2", txtTieuDe2.Text);
                string sBaiViet2 = "";
                foreach (ListItem i in lstBaiViet2.Items)
                {
                    if (i.Selected)
                    {
                        sBaiViet2 += "@" + i.Value + "@";
                    }
                }
                objmodules.UpdateModuleSetting(ModuleId, "baiviet2", sBaiViet2);

                objmodules.UpdateModuleSetting(ModuleId, "tieude3", txtTieuDe3.Text);
                string sBaiViet3 = "";
                foreach (ListItem i in lstBaiViet3.Items)
                {
                    if (i.Selected)
                    {
                        sBaiViet3 += "@" + i.Value + "@";
                    }
                }
                objmodules.UpdateModuleSetting(ModuleId, "baiviet3", sBaiViet3);
            }
            catch (Exception exc)
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
        public override void UpdateSettings()
        {
            base.UpdateSettings();
            DotNetNuke.Entities.Modules.ModuleController mc = new DotNetNuke.Entities.Modules.ModuleController();
            mc.UpdateModuleSetting(ModuleId, "TabForward", ddlTabFw.SelectedValue);
            mc.UpdateModuleSetting(ModuleId, "CatNews", ddlCatNews.SelectedValue);

            //thiet lap noi dung template
            mc.UpdateModuleSetting(ModuleId, "filenamelist", ddlListType.SelectedValue);
            mc.UpdateModuleSetting(ModuleId, "tempcontentlist", TemplateContent(FolderList, ddlListType.SelectedValue));
        }
Exemplo n.º 21
0
        public override void UpdateSettings()
        {
            base.UpdateSettings();
            DotNetNuke.Entities.Modules.ModuleController mc = new DotNetNuke.Entities.Modules.ModuleController();
            mc.UpdateModuleSetting(ModuleId, "TabForward", ddlTabFw.SelectedValue);
            mc.UpdateModuleSetting(ModuleId, "CatNews", ddlCatNews.SelectedValue);

            //thiet lap noi dung template
            mc.UpdateModuleSetting(ModuleId, "filenamelist", ddlListType.SelectedValue);
            mc.UpdateModuleSetting(ModuleId, "tempcontentlist", TemplateContent(FolderList, ddlListType.SelectedValue));
        }
Exemplo n.º 22
0
 public override void UpdateSettings()
 {
     try
     {
         DotNetNuke.Entities.Modules.ModuleController objModules = new DotNetNuke.Entities.Modules.ModuleController();
         objModules.UpdateModuleSetting(ModuleId, "pageSizeAdmin", txtLimitAdmin.Text);
     }
     catch (Exception exc)
     {
         Exceptions.ProcessModuleLoadException(this, exc);
     }
 }
Exemplo n.º 23
0
 public override void UpdateSettings()
 {
     base.UpdateSettings();
     string newText = "";
     newText = tbContent.Text as string;
     if (!(newText == ""))
     {
         DotNetNuke.Entities.Modules.ModuleController objModules = new DotNetNuke.Entities.Modules.ModuleController();
         objModules.UpdateTabModuleSetting(TabModuleId,"ThisText",newText);
         SynchronizeModule();
     }
 }
Exemplo n.º 24
0
        public override void UpdateSettings()
        {
            DotNetNuke.Entities.Modules.ModuleController MC = new DotNetNuke.Entities.Modules.ModuleController();

            MC.UpdateModuleSetting(ModuleId, "Mode", DDL_Mode.Text);
            MC.UpdateModuleSetting(ModuleId, "AssumeFBSDK", Convert.ToString(CB_AssumeFBSDK.Checked));
            MC.UpdateModuleSetting(ModuleId, "NumberOfPosts", TB_NumberOfPosts.Text);
            MC.UpdateModuleSetting(ModuleId, "Width", TB_Width.Text);
            MC.UpdateModuleSetting(ModuleId, "ColorScheme", DDL_ColorScheme.Text);
            MC.UpdateModuleSetting(ModuleId, "AppID", TB_AppID.Text);
            MC.UpdateModuleSetting(ModuleId, "QSP", TB_QSP.Text);
        }
 public override void UpdateSettings()
 {
     try
     {
         DotNetNuke.Entities.Modules.ModuleController objModules = new DotNetNuke.Entities.Modules.ModuleController();
         objModules.UpdateModuleSetting(ModuleId, "LoaiVatTu", ddlLoaiVatTu.SelectedValue);
     }
     catch (Exception exc)
     {
         Exceptions.ProcessModuleLoadException(this, exc);
     }
 }
Exemplo n.º 26
0
		private void btnContinue_Click(object sender, System.EventArgs e)
		{
			ForumsConfig fc = new ForumsConfig();
			bool init = false;
			init = fc.ForumsInit(PortalId, ModuleId);
			if (init == true)
			{
				DotNetNuke.Entities.Modules.ModuleController objModules = new DotNetNuke.Entities.Modules.ModuleController();
				objModules.UpdateModuleSetting(ModuleId, "AFINSTALLED", init.ToString());
				DataCache.ClearAllCache(ModuleId, TabId);
				Response.Redirect(EditUrl());
			}
		}
        public override void UpdateSettings()
        {
            string org = "125";
            CheckBox cbChon;
            for (int i = 0; i < gvDonVi.Rows.Count; i++)
            {
                cbChon = (CheckBox)gvDonVi.Rows[i].FindControl("cbChon");
                if (cbChon.Checked) org = gvDonVi.Rows[i].Cells[0].Text;
            }

            DotNetNuke.Entities.Modules.ModuleController mControl = new DotNetNuke.Entities.Modules.ModuleController();
            mControl.UpdateModuleSetting(ModuleId, "BIRTH", org);
        }
Exemplo n.º 28
0
        public override void UpdateSettings()
        {
            base.UpdateSettings();
            string newText = "";

            newText = tbContent.Text as string;
            if (!(newText == ""))
            {
                DotNetNuke.Entities.Modules.ModuleController objModules = new DotNetNuke.Entities.Modules.ModuleController();
                objModules.UpdateTabModuleSetting(TabModuleId, "ThisText", newText);
                SynchronizeModule();
            }
        }
Exemplo n.º 29
0
        public void ProcessRequest(HttpContext context)
        {
            #region ViewPermission
            // Truyen vao tabid va mid de he thong kiem tra
            // Neu User dang truy cap co quyen thi he thong tra ra du lieu
            // Neu user khong co quyen he thong se thong bao not define
            try
            {
                DotNetNuke.Entities.Portals.PortalSettings portalSettings = DotNetNuke.Entities.Portals.PortalController.GetCurrentPortalSettings();
                if (!context.Request.IsAuthenticated)
                {
                    WriteDataError(context, "NotAuthenticated");
                    return;
                }
                // get TabId
                int TabId = Utils.tabCheckCommon;

                // get ModuleId
                int ModuleId = Utils.moduleCheckCommon;

                objUserInfo = DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo();
                DotNetNuke.Entities.Modules.ModuleController mc = new DotNetNuke.Entities.Modules.ModuleController();
                System.Collections.Hashtable settings           = mc.GetModuleSettings(ModuleId);
                objModuleInfo = new DotNetNuke.Entities.Modules.ModuleController().GetModule(ModuleId, TabId);
                if (DotNetNuke.Security.Permissions.ModulePermissionController.CanViewModule(objModuleInfo))
                {
                    try
                    {
                        WriteData(context);
                        return;
                    }
                    catch (Exception ex)
                    {
                        WriteDataError(context, ex.Message);
                        return;
                    }
                }
                else
                {
                    WriteDataError(context, "NotPermission");
                    return;
                }
            }
            catch (Exception ex)
            {
                WriteDataError(context, ex.Message);
                return;
            }
            #endregion
        }
Exemplo n.º 30
0
        private void btnContinue_Click(object sender, System.EventArgs e)
        {
            ForumsConfig fc   = new ForumsConfig();
            bool         init = false;

            init = fc.ForumsInit(PortalId, ModuleId);
            if (init == true)
            {
                DotNetNuke.Entities.Modules.ModuleController objModules = new DotNetNuke.Entities.Modules.ModuleController();
                objModules.UpdateModuleSetting(ModuleId, "AFINSTALLED", init.ToString());
                DataCache.ClearAllCache(ModuleId, TabId);
                Response.Redirect(EditUrl());
            }
        }
Exemplo n.º 31
0
 public override void UpdateSettings()
 {
     try
     {
         DotNetNuke.Entities.Modules.ModuleController objModules = new DotNetNuke.Entities.Modules.ModuleController();
         objModules.UpdateModuleSetting(ModuleId, "limits", txtLimits.Text);
         objModules.UpdateModuleSetting(ModuleId, "source", lstRdSource.SelectedValue);
         objModules.UpdateModuleSetting(ModuleId, "template", ddlTemplate.Text);
     }
     catch (Exception exc)
     {
         Exceptions.ProcessModuleLoadException(this, exc);
     }
 }
Exemplo n.º 32
0
 public override void UpdateSettings()
 {
     try
     {
         DotNetNuke.Entities.Modules.ModuleController objModules = new DotNetNuke.Entities.Modules.ModuleController();
         objModules.UpdateModuleSetting(ModuleId, "source", radSource.SelectedValue);
         objModules.UpdateModuleSetting(ModuleId, "newsid", ddlNews.SelectedValue);
         objModules.UpdateModuleSetting(ModuleId, "CommentListTemplate", ddlTemplate.SelectedValue);
     }
     catch (Exception exc)
     {
         Exceptions.ProcessModuleLoadException(this, exc);
     }
 }
 public override void UpdateSettings()
 {
     try
     {
         DotNetNuke.Entities.Modules.ModuleController objModules = new DotNetNuke.Entities.Modules.ModuleController();
         objModules.UpdateModuleSetting(ModuleId, "code", txtCode.Text);
         objModules.UpdateModuleSetting(ModuleId, "source", lstRdSource.SelectedValue);
         objModules.UpdateModuleSetting(ModuleId, "menuwidth", txtMenuWidth.Text);
         objModules.UpdateModuleSetting(ModuleId, "ExpandAll", chkExpandAll.Checked.ToString());
         objModules.UpdateModuleSetting(ModuleId, "CSSPrefix", txtCSSPrefix.Text);
     }
     catch (Exception exc)
     {
         Exceptions.ProcessModuleLoadException(this, exc);
     }
 }
        public override void UpdateSettings()
        {
            try
            {
                Convert.ToInt32(TextBox1.Text);
            }
            catch
            {
                TextBox1.Text = "10";
            }
            DotNetNuke.Entities.Modules.ModuleController mc = new DotNetNuke.Entities.Modules.ModuleController();
            mc.UpdateModuleSetting(ModuleId, "Nguon", DropDownList1.SelectedValue);
            mc.UpdateModuleSetting(ModuleId, "Trang", TextBox1.Text);

            mc.UpdateModuleSetting(ModuleId, "SQL", tbSQL.Text);
        }
Exemplo n.º 35
0
        public override Boolean IsIndexingAllowedForModule(DotNetNuke.Entities.Modules.ModuleInfo objModule)
        {
            DotNetNuke.Entities.Tabs.TabController objTabController = new DotNetNuke.Entities.Tabs.TabController();
            Hashtable tabSettings = objTabController.GetTabSettings(objModule.TabID);

            if (!tabSettings.Contains("AllowIndex") || tabSettings["AllowIndex"].ToString().ToLowerInvariant() == "true")
            {
                // Check if indexing is disabled for the current module
                DotNetNuke.Entities.Modules.ModuleController objModuleController = new DotNetNuke.Entities.Modules.ModuleController();
                Hashtable tabModuleSettings = objModuleController.GetTabModuleSettings(objModule.TabModuleID);
                return(!tabModuleSettings.Contains("AllowIndex") || tabModuleSettings["AllowIndex"].ToString().ToLowerInvariant() == "true");
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 36
0
        internal override void UpdateTitle(IEntity titleItem)
        {
            // todo: this should probably do the more complex stuff
            // to ensure that it happens on all versions of this module (all languages)
            // used to work once...
            //if (titleItem?.GetBestValue("EntityTitle") != null)
            //    SxcContext.ModuleInfo.ModuleTitle = titleItem.GetBestValue("EntityTitle").ToString();

            var languages = ZoneHelpers.GetCulturesWithActiveState(SxcContext.ModuleInfo.PortalID, SxcContext.ZoneId.Value);

            // Find Module for default language
            var moduleController = new DotNetNuke.Entities.Modules.ModuleController();
            var originalModule = moduleController.GetModule(SxcContext.ModuleInfo.ModuleID);

            foreach (var dimension in languages)
            {
                if (!originalModule.IsDefaultLanguage)
                    originalModule = originalModule.DefaultLanguageModule;

                try // this can sometimes fail, like if the first item is null - https://github.com/2sic/2sxc/issues/817
                {
                    // Break if default language module is null
                    if (originalModule == null)
                        return;

                    // Get Title value of Entitiy in current language
                    var titleValue = titleItem.Title[dimension.Code].ToString();

                    // Find module for given Culture
                    var moduleByCulture = moduleController.GetModuleByCulture(originalModule.ModuleID,
                        originalModule.TabID, SxcContext.ModuleInfo.PortalID,
                        DotNetNuke.Services.Localization.LocaleController.Instance.GetLocale(dimension.Code));

                    // Break if no title module found
                    if (moduleByCulture == null || titleValue == null)
                        return;

                    moduleByCulture.ModuleTitle = titleValue;
                    moduleController.UpdateModule(moduleByCulture);
                }
                catch
                {
                    // ignored
                }
            }
        }
Exemplo n.º 37
0
 protected override void RenderContents(HtmlTextWriter writer)
 {
     if (UserId == -1)
     {
         return;
     }
     try
     {
         string output = string.Empty;
         DotNetNuke.Entities.Portals.PortalSettings ps = (DotNetNuke.Entities.Portals.PortalSettings)(Context.Items["PortalSettings"]);
         DotNetNuke.Entities.Users.UserInfo         cu = DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo();
         string imagePath = string.Empty;
         int    portalId  = ps.PortalId;
         string tmp       = string.Empty;
         if (Template == null)
         {
             tmp = "<span class=\"aslabelsmbold\">[RESX:Posts]:</span> [AF:PROFILE:POSTCOUNT]<br />" + "<span class=\"aslabelsmbold\">[RESX:RankName]:</span> [AF:PROFILE:RANKNAME]<br />" + "<span class=\"aslabelsmbold\">[RESX:RankDisplay]:</span> [AF:PROFILE:RANKDISPLAY] <br />" + "<span class=\"aslabelsmbold\">[RESX:LastUpdate]:</span> [AF:PROFILE:DATELASTACTIVITY:d] <br />" + "<span class=\"aslabelsmbold\">[RESX:MemberSince]:</span> [AF:PROFILE:DATECREATED:d]";
         }
         else
         {
             tmp = Template.Text;
         }
         if (ModuleId == -1)
         {
             DotNetNuke.Entities.Modules.ModuleController mc = new DotNetNuke.Entities.Modules.ModuleController();
             DotNetNuke.Entities.Tabs.TabController       tc = new DotNetNuke.Entities.Tabs.TabController();
             DotNetNuke.Entities.Tabs.TabInfo             ti = null;
             foreach (DotNetNuke.Entities.Modules.ModuleInfo mi in mc.GetModules(portalId))
             {
                 if (mi.DesktopModule.ModuleName.ToUpperInvariant() == "Active Forums".ToUpperInvariant())
                 {
                     ModuleId = mi.ModuleID;
                     break;
                 }
             }
         }
         output = TemplateUtils.ParseProfileTemplate(tmp, UserId, portalId, ModuleId, cu.UserID, Convert.ToInt32(PortalSettings.Current.TimeZone.BaseUtcOffset.TotalMinutes));
         output = Utilities.LocalizeControl(output);
         writer.Write(output);
     }
     catch (Exception ex)
     {
         writer.Write(ex.Message);
     }
 }
        internal override void UpdateTitle(IEntity titleItem)
        {
            // todo: this should probably do the more complex stuff
            // to ensure that it happens on all versions of this module (all languages)
            // used to work once...
            //if (titleItem?.GetBestValue("EntityTitle") != null)
            //    SxcContext.ModuleInfo.ModuleTitle = titleItem.GetBestValue("EntityTitle").ToString();

            var languages = ZoneHelpers.GetCulturesWithActiveState(SxcContext.ModuleInfo.PortalID, SxcContext.ZoneId.Value);

            // Find Module for default language
            var moduleController = new DotNetNuke.Entities.Modules.ModuleController();
            var originalModule   = moduleController.GetModule(SxcContext.ModuleInfo.ModuleID);

            foreach (var dimension in languages)
            {
                if (!originalModule.IsDefaultLanguage)
                {
                    originalModule = originalModule.DefaultLanguageModule;
                }

                // Break if default language module is null
                if (originalModule == null)
                {
                    return;
                }

                // Get Title value of Entitiy in current language
                var titleValue = titleItem.Title[dimension.Code].ToString();

                // Find module for given Culture
                var moduleByCulture = moduleController.GetModuleByCulture(originalModule.ModuleID, originalModule.TabID, SxcContext.ModuleInfo.PortalID, DotNetNuke.Services.Localization.LocaleController.Instance.GetLocale(dimension.Code));

                // Break if no title module found
                if (moduleByCulture == null || titleValue == null)
                {
                    return;
                }

                moduleByCulture.ModuleTitle = titleValue;
                moduleController.UpdateModule(moduleByCulture);
            }
        }
        public override void UpdateSettings()
        {
            base.UpdateSettings();
            DotNetNuke.Entities.Modules.ModuleController mc = new DotNetNuke.Entities.Modules.ModuleController();
            mc.UpdateModuleSetting(ModuleId, "TabForward", ddlTabFw.SelectedValue);
            mc.UpdateModuleSetting(ModuleId, "PageSize", txtSize.Text);
            mc.UpdateModuleSetting(ModuleId, "CatProduct", ddlCat.SelectedValue);
            mc.UpdateModuleSetting(ModuleId, "NoPrice", txtNoPrice.Text.Trim());


            ////thiet lap noi dung template
            //mc.UpdateModuleSetting(ModuleId, "filenamelist", ddlListType.SelectedValue);
            //mc.UpdateModuleSetting(ModuleId, "tempcontentlist", TemplateContent(FolderList, ddlListType.SelectedValue));

            ////thiet lap template detail
            //mc.UpdateModuleSetting(ModuleId, "filenamedetail", ddlTempDetail.SelectedValue);
            //mc.UpdateModuleSetting(ModuleId, "tempcontentdetail", TemplateContent(FolderRelative, ddlTempDetail.SelectedValue));

            ////thiet lap template Relative
            //mc.UpdateModuleSetting(ModuleId, "filenamerelative", ddlTempDetail.SelectedValue);
            //mc.UpdateModuleSetting(ModuleId, "tempcontentrelative", TemplateContent(FolderRelative, ddlTempRelative.SelectedValue));
        }
 public override void UpdateSettings()
 {
     base.UpdateSettings();
     DotNetNuke.Entities.Modules.ModuleController mc = new DotNetNuke.Entities.Modules.ModuleController();
     mc.UpdateModuleSetting(ModuleId, "TabForward", ddlTabFw.SelectedValue);
     mc.UpdateModuleSetting(ModuleId, "PageSize", txtSize.Text);
     mc.UpdateModuleSetting(ModuleId, "CatProduct", ddlCat.SelectedValue);
 }
Exemplo n.º 41
0
		protected override void RenderContents(HtmlTextWriter writer)
		{
			if (UserId == -1)
			{
				return;
			}
			try
			{
				string output = string.Empty;
				DotNetNuke.Entities.Portals.PortalSettings ps = (DotNetNuke.Entities.Portals.PortalSettings)(Context.Items["PortalSettings"]);
				DotNetNuke.Entities.Users.UserInfo cu = DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo();
				string imagePath = string.Empty;
				int portalId = ps.PortalId;
				string tmp = string.Empty;
				if (Template == null)
				{
					tmp = "<span class=\"aslabelsmbold\">[RESX:Posts]:</span> [AF:PROFILE:POSTCOUNT]<br />" + "<span class=\"aslabelsmbold\">[RESX:RankName]:</span> [AF:PROFILE:RANKNAME]<br />" + "<span class=\"aslabelsmbold\">[RESX:RankDisplay]:</span> [AF:PROFILE:RANKDISPLAY] <br />" + "<span class=\"aslabelsmbold\">[RESX:LastUpdate]:</span> [AF:PROFILE:DATELASTACTIVITY:d] <br />" + "<span class=\"aslabelsmbold\">[RESX:MemberSince]:</span> [AF:PROFILE:DATECREATED:d]";
				}
				else
				{
					tmp = Template.Text;
				}
				if (ModuleId == -1)
				{
					DotNetNuke.Entities.Modules.ModuleController mc = new DotNetNuke.Entities.Modules.ModuleController();
					DotNetNuke.Entities.Tabs.TabController tc = new DotNetNuke.Entities.Tabs.TabController();
					DotNetNuke.Entities.Tabs.TabInfo ti = null;
					foreach (DotNetNuke.Entities.Modules.ModuleInfo mi in mc.GetModules(portalId))
					{
						if (mi.DesktopModule.ModuleName.ToUpperInvariant() == "Active Forums".ToUpperInvariant())
						{
							ModuleId = mi.ModuleID;
							break;
						}
					}
				}
				output = TemplateUtils.ParseProfileTemplate(tmp, UserId, portalId, ModuleId, cu.UserID, ps.TimeZoneOffset);
				output = Utilities.LocalizeControl(output);
				writer.Write(output);
			}
			catch (Exception ex)
			{
				writer.Write(ex.Message);
			}

		}
Exemplo n.º 42
0
 public bool Delete(int tabId, int modId)
 {
     var mc = new DotNetNuke.Entities.Modules.ModuleController();
     mc.DeleteTabModule(tabId, modId, true);
     return true;
 }
        public override void UpdateSettings()
        {
            base.UpdateSettings();
            DotNetNuke.Entities.Modules.ModuleController mc = new DotNetNuke.Entities.Modules.ModuleController();
            mc.UpdateModuleSetting(ModuleId, "TabForward", ddlTabFw.SelectedValue);
            mc.UpdateModuleSetting(ModuleId, "PageSize", txtSize.Text);
            mc.UpdateModuleSetting(ModuleId, "CatProduct", ddlCat.SelectedValue);
            mc.UpdateModuleSetting(ModuleId, "NoPrice", txtNoPrice.Text.Trim());

            ////thiet lap noi dung template
            //mc.UpdateModuleSetting(ModuleId, "filenamelist", ddlListType.SelectedValue);
            //mc.UpdateModuleSetting(ModuleId, "tempcontentlist", TemplateContent(FolderList, ddlListType.SelectedValue));

            ////thiet lap template detail
            //mc.UpdateModuleSetting(ModuleId, "filenamedetail", ddlTempDetail.SelectedValue);
            //mc.UpdateModuleSetting(ModuleId, "tempcontentdetail", TemplateContent(FolderRelative, ddlTempDetail.SelectedValue));

            ////thiet lap template Relative
            //mc.UpdateModuleSetting(ModuleId, "filenamerelative", ddlTempDetail.SelectedValue);
            //mc.UpdateModuleSetting(ModuleId, "tempcontentrelative", TemplateContent(FolderRelative, ddlTempRelative.SelectedValue));
        }
 public override void UpdateSettings()
 {
     DotNetNuke.Entities.Modules.ModuleController mc = new DotNetNuke.Entities.Modules.ModuleController();
     mc.UpdateModuleSetting(ModuleId, "nsComment", RadioButtonList1.SelectedValue);
 }
Exemplo n.º 45
0
		public virtual void ProcessRequest(System.Web.HttpContext context)
		{
			try
			{
				if (HttpContext.Current.Items["PortalSettings"] != null)
				{
					_ps = (DotNetNuke.Entities.Portals.PortalSettings)(HttpContext.Current.Items["PortalSettings"]);
					_pid = _ps.PortalId;
				}
				else
				{
					string DomainName = null;
					DotNetNuke.Entities.Portals.PortalAliasInfo objPortalAliasInfo = null;
					string sUrl = HttpContext.Current.Request.RawUrl.Replace("http://", string.Empty).Replace("https://", string.Empty);
					objPortalAliasInfo = DotNetNuke.Entities.Portals.PortalSettings.GetPortalAliasInfo(HttpContext.Current.Request.Url.Host);
					_pid = objPortalAliasInfo.PortalID;
					_ps = DotNetNuke.Entities.Portals.PortalController.GetCurrentPortalSettings();


				}

				//Dim sc As New Social.SocialSettings
				//_mainSettings = sc.LoadSettings[_ps.PortalId]
				_mainSettings = DataCache.MainSettings(ModuleId);
				//  If context.Request.IsAuthenticated Then
				_isValid = true;
				if (AdminRequired & ! context.Request.IsAuthenticated)
				{
					_isValid = false;
					return;
				}
				if (AdminRequired && context.Request.IsAuthenticated)
				{
					//_isValid = DotNetNuke.Security.PortalSecurity.IsInRole(_ps.AdministratorRoleName)
					DotNetNuke.Entities.Modules.ModuleController objMC = new DotNetNuke.Entities.Modules.ModuleController();
					DotNetNuke.Entities.Modules.ModuleInfo objM = objMC.GetModule(ModuleId, TabId);
					string roleIds = Permissions.GetRoleIds(objM.AuthorizedEditRoles.Split(';'), PortalId);
					_isValid = Modules.ActiveForums.Permissions.HasAccess(roleIds, ForumUser.UserRoles);
				}
				else if (AdminRequired & ! context.Request.IsAuthenticated)
				{
					_isValid = false;
					return;
				}
				string p = HttpContext.Current.Request.Params["p"];
				if (! (string.IsNullOrEmpty(p)))
				{
					_params = Utilities.JSON.ConvertFromJSONAssoicativeArrayToHashTable(p);
				}

				if (context.Request.Files.Count == 0)
				{
					string jsonPost = string.Empty;
					string prop = string.Empty;
					bool propComplete = true;
					string val = string.Empty;
					string tmp = string.Empty;
					bool bObj = false;
					//Arrays
					List<string> slist = null;
					//Dim pairs As NameValueCollection = Nothing
					Hashtable pairs = null;
					Hashtable subPairs = null;

					Hashtable ht = new Hashtable();
					int idx = 0;
					string parentProp = string.Empty;
					string skip = "{}[]:," + ((char)(34)).ToString();
					using (System.IO.StreamReader sr = new System.IO.StreamReader(context.Request.InputStream, System.Text.Encoding.UTF8))
					{
						while ( ! (sr.EndOfStream))
						{
							char c = (char)(sr.Read());
							if (idx > 0 && c == '[')
							{
								c = (char)(sr.Read());
								bObj = true;
							}
							if (idx > 0 && c == '{')
							{
								if (pairs == null)
								{
									parentProp = prop;
									prop = string.Empty;
									tmp = string.Empty;
									//pairs = New NameValueCollection
									pairs = new Hashtable();
								}
								else if (subPairs == null)
								{
									string subString = c.ToString();
									while ( c != '}')
									{
										c = (char)(sr.Read());
										subString += c;
										if (c == '}')
										{
											break;
										}
									}
									subPairs = Utilities.JSON.ConvertFromJSONAssoicativeArrayToHashTable(subString);
									pairs.Add(prop, subPairs);
									prop = string.Empty;
									tmp = string.Empty;
									subPairs = null;
									c = (char)(sr.Read());
								}
							}

							if (idx > 0 && bObj == true && ! (c == '{'))
							{
								string subItem = string.Empty;
								while ( c != ']')
								{
									if (slist == null)
									{
										slist = new List<string>();
									}
									if (skip.IndexOf(c) == -1)
									{
										subItem += c;
									}

									c = (char)(sr.Read());
									if (c == ',' || c == ']')
									{
										slist.Add(subItem);
										subItem = string.Empty;
									}
									if (c == ']')
									{
										c = (char)(sr.Read());
										bObj = false;
										break;

									}
								}
							}
							if (c == ':')
							{
								prop = tmp;
								tmp = string.Empty;
							}
							if (skip.IndexOf(c) == -1)
							{
								tmp += c;
							}
							if (c == ',' || c == '}')
							{
								if (! (string.IsNullOrEmpty(tmp)))
								{
									tmp = HttpUtility.UrlDecode(tmp);
								}
								if (slist != null)
								{
									ht.Add(prop, slist);
									slist = null;
								}
								else if (pairs != null && c == ',' && ! (string.IsNullOrEmpty(prop)))
								{
									pairs.Add(prop, tmp);
								}
								else if (pairs != null && c == '}')
								{
									if (! (string.IsNullOrEmpty(tmp)))
									{
										pairs.Add(prop, tmp);
									}
									ht.Add(parentProp, pairs);
									parentProp = string.Empty;
									pairs = null;
								}
								else if (! (string.IsNullOrEmpty(prop)))
								{
									ht.Add(prop, tmp);
								}

								prop = string.Empty;
								tmp = string.Empty;
							}

							idx += 1;

						}
						if (pairs != null & ! (string.IsNullOrEmpty(parentProp)))
						{
							ht.Add(parentProp, pairs);
						}
						else if (! (string.IsNullOrEmpty(prop)) && ! (string.IsNullOrEmpty(tmp)))
						{
							ht.Add(prop, HttpUtility.UrlDecode(tmp));
						}
						else if (! (string.IsNullOrEmpty(prop)) && slist != null)
						{
							ht.Add(prop, slist);
						}

						//jsonPost = sr.ReadToEnd()
						sr.Close();
					}
					_params = ht;
					//End If
				}
				else
				{
					Hashtable ht = new Hashtable();
					foreach (string s in context.Request.Params.AllKeys)
					{
						if (! (ht.ContainsKey(s)))
						{
							ht.Add(s, context.Request.Params[s]);
						}

					}
					_params = ht;
				}

				if (HttpContext.Current.Request.IsAuthenticated)
				{
					UserId = UserController.GetUserIdByUserName(PortalId, HttpContext.Current.User.Identity.Name);
				}
				else
				{
					UserId = -1;
				}

			}
			catch (Exception ex)
			{
				_isValid = false;
				Exceptions.LogException(ex);

			}



		}
Exemplo n.º 46
0
 public override void UpdateSettings()
 {
     DotNetNuke.Entities.Modules.ModuleController ob = new DotNetNuke.Entities.Modules.ModuleController();
     ob.UpdateModuleSetting(ModuleId, "feedCategory", DropDownList1.SelectedValue);
 }