Beispiel #1
0
        private void ViewMenu_ItemClick(object sender, YAF.Controls.PopEventArgs e)
        {
            switch (e.Item.ToLower())
            {
            case "normal":
                IsThreaded = false;
                BindData();
                break;

            case "threaded":
                IsThreaded = true;
                BindData();
                break;

            default:
                throw new ApplicationException(e.Item);
            }
        }
        private void PopMenu1_ItemClick(object sender, PopEventArgs e)
        {
            switch (e.Item)
            {
            case "userprofile":
                YafBuildLink.Redirect(YAF.Classes.Utils.ForumPages.profile, "u={0}", UserId);
                break;

            case "edituser":
                YafBuildLink.Redirect(YAF.Classes.Utils.ForumPages.admin_edituser, "u={0}", UserId);
                break;

            case "toggleuserposts_show":
                RemoveIgnored(UserId);
                Response.Redirect(Request.RawUrl);
                break;

            case "toggleuserposts_hide":
                AddIgnored(UserId);
                Response.Redirect(Request.RawUrl);
                break;
            }
        }
Beispiel #3
0
        private void OptionsMenu_ItemClick(object sender, YAF.Controls.PopEventArgs e)
        {
            switch (e.Item.ToLower())
            {
            case "print":
                YAF.Classes.Utils.YafBuildLink.Redirect(YAF.Classes.Utils.ForumPages.printtopic, "t={0}", PageContext.PageTopicID);
                break;

            case "watch":
                TrackTopic_Click(sender, e);
                break;

            case "email":
                EmailTopic_Click(sender, e);
                break;

            case "rssfeed":
                YAF.Classes.Utils.YafBuildLink.Redirect(YAF.Classes.Utils.ForumPages.rsstopic, "pg={0}&t={1}", Request.QueryString ["g"], PageContext.PageTopicID);
                break;

            default:
                throw new ApplicationException(e.Item);
            }
        }
Beispiel #4
0
        /// <summary>
        /// The pop menu 1_ item click.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="YAF.Controls.PopEventArgs"/> instance containing the event data.</param>
        private void PopMenu1_ItemClick([NotNull] object sender, [NotNull] PopEventArgs e)
        {
            switch (e.Item)
            {
            case "userprofile":
                YafBuildLink.Redirect(
                    ForumPages.profile,
                    "u={0}&name={1}",
                    this.PostData.UserId,
                    this.Get <YafBoardSettings>().EnableDisplayName
                            ? this.DataRow["DisplayName"]
                            : this.DataRow["UserName"]);
                break;

            case "lastposts":
                YafBuildLink.Redirect(
                    ForumPages.search,
                    "postedby={0}",
                    this.Get <YafBoardSettings>().EnableDisplayName ? this.DataRow["DisplayName"] : this.DataRow["UserName"]);
                break;

            case "addbuddy":
                this.PopMenu1.RemovePostBackItem("addbuddy");
                var strBuddyRequest = this.Get <IBuddy>().AddRequest(this.PostData.UserId);
                if (Convert.ToBoolean(strBuddyRequest[1]))
                {
                    this.PageContext.AddLoadMessage(
                        this.GetTextFormatted("NOTIFICATION_BUDDYAPPROVED_MUTUAL", strBuddyRequest[0]), MessageTypes.success);

                    this.PopMenu1.AddClientScriptItemWithPostback(
                        this.GetText("BUDDY", "REMOVEBUDDY"),
                        "removebuddy",
                        "if (confirm('{0}')) {1}".FormatWith(
                            this.GetText("CP_EDITBUDDIES", "NOTIFICATION_REMOVE"), "{postbackcode}"));
                }
                else
                {
                    this.PageContext.AddLoadMessage(this.GetText("NOTIFICATION_BUDDYREQUEST"));
                }

                break;

            case "removebuddy":
            {
                this.PopMenu1.RemovePostBackItem("removebuddy");
                this.PopMenu1.AddPostBackItem("addbuddy", this.GetText("BUDDY", "ADDBUDDY"));
                this.PageContext.AddLoadMessage(
                    this.GetTextFormatted(
                        "REMOVEBUDDY_NOTIFICATION", this.Get <IBuddy>().Remove(this.PostData.UserId)),
                    MessageTypes.success);
                break;
            }

            case "edituser":
                YafBuildLink.Redirect(ForumPages.admin_edituser, "u={0}", this.PostData.UserId);
                break;

            case "toggleuserposts_show":
                this.Get <IUserIgnored>().RemoveIgnored(this.PostData.UserId);
                this.Response.Redirect(this.Request.RawUrl);
                break;

            case "toggleuserposts_hide":
                this.Get <IUserIgnored>().AddIgnored(this.PostData.UserId);
                this.Response.Redirect(this.Request.RawUrl);
                break;

            case "viewthanks":
                YafBuildLink.Redirect(ForumPages.viewthanks, "u={0}", this.PostData.UserId);
                break;
            }
        }
		private void PopMenu1_ItemClick( object sender, PopEventArgs e )
		{
			switch ( e.Item )
			{
				case "userprofile":
					YafBuildLink.Redirect( YAF.Classes.Utils.ForumPages.profile, "u={0}", UserId );
					break;
				case "edituser":
					YafBuildLink.Redirect( YAF.Classes.Utils.ForumPages.admin_edituser, "u={0}", UserId );
					break;
				case "toggleuserposts_show":
					RemoveIgnored( UserId );
					Response.Redirect( Request.RawUrl );
					break;
				case "toggleuserposts_hide":
					AddIgnored( UserId );
					Response.Redirect( Request.RawUrl );
					break;
			}
		}
Beispiel #6
0
        /// <summary>
        /// The pop menu 1_ item click.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="e">
        /// The e.
        /// </param>
        private void PopMenu1_ItemClick([NotNull] object sender, [NotNull] PopEventArgs e)
        {
            switch (e.Item)
            {
            case "userprofile":
                YafBuildLink.Redirect(ForumPages.profile, "u={0}", this.PostData.UserId);
                break;

            case "lastposts":
                YafBuildLink.Redirect(ForumPages.search, "postedby={0}", this.PostData.UserProfile.UserName);
                break;

            case "addbuddy":
                var strBuddyRequest = new string[2];
                this.PopMenu1.RemovePostBackItem("addbuddy");
                strBuddyRequest = YafBuddies.AddBuddyRequest(this.PostData.UserId);
                if (Convert.ToBoolean(strBuddyRequest[1]))
                {
                    this.PageContext.AddLoadMessage(
                        this.PageContext.Localization.GetText("NOTIFICATION_BUDDYAPPROVED_MUTUAL").FormatWith(strBuddyRequest[0]));
                    this.PopMenu1.AddClientScriptItemWithPostback(
                        this.PageContext.Localization.GetText("BUDDY", "REMOVEBUDDY"),
                        "removebuddy",
                        "if (confirm('{0}')) {1}".FormatWith(this.PageContext.Localization.GetText("CP_EDITBUDDIES", "NOTIFICATION_REMOVE"), "{postbackcode}"));
                }
                else
                {
                    this.PageContext.AddLoadMessage(this.PageContext.Localization.GetText("NOTIFICATION_BUDDYREQUEST"));
                }

                break;

            case "removebuddy":
            {
                this.PopMenu1.RemovePostBackItem("removebuddy");
                this.PopMenu1.AddPostBackItem("addbuddy", this.PageContext.Localization.GetText("BUDDY", "ADDBUDDY"));
                this.PageContext.AddLoadMessage(
                    this.PageContext.Localization.GetText("REMOVEBUDDY_NOTIFICATION").FormatWith(
                        YafBuddies.RemoveBuddy(this.PostData.UserId)));
                break;
            }

            case "edituser":
                YafBuildLink.Redirect(ForumPages.admin_edituser, "u={0}", this.PostData.UserId);
                break;

            case "toggleuserposts_show":
                this.Get <YafUserIgnored>().RemoveIgnored(this.PostData.UserId);
                this.Response.Redirect(this.Request.RawUrl);
                break;

            case "toggleuserposts_hide":
                this.Get <YafUserIgnored>().AddIgnored(this.PostData.UserId);
                this.Response.Redirect(this.Request.RawUrl);
                break;

            case "viewthanks":
                YafBuildLink.Redirect(ForumPages.viewthanks, "u={0}", this.PostData.UserId);
                break;
            }
        }