Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            udc = UserDataContext.GetUserDataContext();

            if (!string.IsNullOrEmpty(Request.QueryString["PN"]))
            {
                currentPage = Convert.ToInt32(Request.QueryString["PN"]);
            }
            pager.PageSize = pageSize;

            forum = (DataObjectForum)dataObject;

            LitDesc.Text = forum.Description;

            bool isMember;
            bool isOwner = Community.GetIsUserOwner(UserProfile.Current.UserId, forum.CommunityID.Value, out isMember);

            if ((forum.ThreadCreationUsers == CommunityUsersType.Owners && isOwner) ||
                (forum.ThreadCreationUsers == CommunityUsersType.Members && isMember) ||
                (forum.ThreadCreationUsers == CommunityUsersType.Authenticated && udc.IsAuthenticated) ||
                udc.IsAdmin)
            {
                lnkCreate.NavigateUrl = string.Format("/M/Admin/EditForumTopic.aspx?FID={0}", forum.ObjectID);
            }
            else
            {
                lnkCreate.Enabled = false;
            }
            lnkCreate.ID = null;

            Reload();
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            forum = DataObject.Load <DataObjectForum>(ObjectID, null, true);
            foreach (RadComboBoxItem item in this.RcbRights.Items)
            {
                item.Text = language.GetString(string.Format("LableForumRights{0}", item.Value));
            }

            if (forum.State == ObjectState.Added)
            {
                forum.ObjectID    = ObjectID;
                forum.Title       = languageShared.GetString("LabelUnnamed");
                forum.CommunityID = CommunityID;
                forum.ShowState   = ObjectShowState.InProgress;
                forum.Insert(UserDataContext.GetUserDataContext());
                forum.Title = string.Empty;
            }

            if (!string.IsNullOrEmpty(Request.QueryString["TG"]))
            {
                forum.TagList = Server.UrlDecode(Request.QueryString["TG"]);
            }
            if (!string.IsNullOrEmpty(Request.QueryString["OS"]))
            {
                forum.Status = (ObjectStatus)int.Parse(Request.QueryString["OS"]);
            }
            if (!string.IsNullOrEmpty(Request.QueryString["SS"]))
            {
                forum.ShowState = (ObjectShowState)int.Parse(Request.QueryString["SS"]);
            }
            if (!string.IsNullOrEmpty(Request.QueryString["CR"]))
            {
                forum.Copyright = int.Parse(Request.QueryString["CR"]);
            }
            if (!string.IsNullOrEmpty(Request.QueryString["GC"]))
            {
                string[] geoLatLong = Request.QueryString["GC"].Split(',');
                double   geoLat, geoLong = double.MinValue;
                if (geoLatLong.Length == 2)
                {
                    if (double.TryParse(geoLatLong[0], out geoLat) && double.TryParse(geoLatLong[1], out geoLong))
                    {
                        forum.Geo_Lat  = geoLat;
                        forum.Geo_Long = geoLong;
                    }
                }
            }
            if (!string.IsNullOrEmpty(Request.QueryString["ZP"]))
            {
                forum.Zip = Server.UrlDecode(Request.QueryString["ZP"]);
            }
            if (!string.IsNullOrEmpty(Request.QueryString["CI"]))
            {
                forum.City = Server.UrlDecode(Request.QueryString["CI"]);
            }
            if (!string.IsNullOrEmpty(Request.QueryString["RE"]))
            {
                forum.Street = Server.UrlDecode(Request.QueryString["RE"]);
            }
            if (!string.IsNullOrEmpty(Request.QueryString["CO"]))
            {
                forum.CountryCode = Server.UrlDecode(Request.QueryString["CO"]);
            }

            FillEditForm();
        }
Esempio n. 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // Hide columns
            if (!showTopicColumn)
            {
                this.TdTopicH.Visible = false;
            }
            if (!showStarterColumn)
            {
                this.TdStarterH.Visible = false;
            }
            if (!showInfoColumn)
            {
                this.TdInfoH.Visible = false;
            }
            if (!showLastPosterColumn)
            {
                this.TdLastPosterH.Visible = false;
            }

            udc = UserDataContext.GetUserDataContext();

            this.FTPAGTOP.ItemNameSingular = languageShared.GetString("LabelEntrySingular");
            this.FTPAGTOP.ItemNamePlural   = languageShared.GetString("LabelEntryPlural");
            this.FTPAGTOP.PageSize         = pageSize;
            this.FTPAGTOP.PagerBreak       = pagerBreak;
            this.FTPAGTOP.BrowsableControl = this;
            this.FTPAGTOP.CustomText       = " ";
            this.FTPAGTOP.RenderHref       = true;

            this.FTPAGBOT.ItemNameSingular = languageShared.GetString("LabelEntrySingular");
            this.FTPAGBOT.ItemNamePlural   = languageShared.GetString("LabelEntryPlural");
            this.FTPAGBOT.PageSize         = pageSize;
            this.FTPAGBOT.PagerBreak       = pagerBreak;
            this.FTPAGBOT.BrowsableControl = this;
            this.FTPAGBOT.CustomText       = " ";
            this.FTPAGBOT.RenderHref       = true;

            forum = (DataObjectForum)dataObject;

            this.LitDesc.Text = forum.Description;

            bool isMember;
            bool isOwner = Community.GetIsUserOwner(UserProfile.Current.UserId, forum.CommunityID.Value, out isMember);

            if ((forum.ThreadCreationUsers == CommunityUsersType.Owners && isOwner) ||
                (forum.ThreadCreationUsers == CommunityUsersType.Members && isMember) ||
                (forum.ThreadCreationUsers == CommunityUsersType.Authenticated && udc.IsAuthenticated) ||
                udc.IsAdmin)
            {
                LnkAddTopic.Attributes.Add("onClick", string.Format("radWinOpen('{0}&XCN={1}&OID={2}&FID={3}', '{4}', 800, 500, false, null, 'wizardWin')", Helper.GetUploadWizardLink("ForumTopic", _4screen.CSB.Common.SiteConfig.UsePopupWindows), forum.CommunityID, Guid.NewGuid(), forum.ObjectID, language.GetString("CommandForumTopicAdd")));
            }
            else
            {
                LnkAddTopic.Enabled = false;
                LnkAddTopic.ToolTip = (new TextControl()
                {
                    LanguageFile = "UserControls.Templates.WebUI.Base", TextKey = "TooltipLoginToAddForumTopic"
                }).Text;
            }

            RestoreState();
            Reload();
        }