/// <summary> /// Handles the Load event of the Page control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param> protected void Page_Load([NotNull] object sender, [NotNull] EventArgs e) { // check if this feature is disabled if (!this.Get <YafBoardSettings>().AllowPrivateMessages) { YafBuildLink.RedirectInfoPage(InfoMessage.Disabled); } if (this.IsPostBack) { return; } if (this.Request.QueryString.GetFirstOrDefault("v").IsSet()) { this.View = PmViewConverter.FromQueryString(this.Request.QueryString.GetFirstOrDefault("v")); this.hidLastTab.Value = $"View{(int)this.View}"; } this.PageLinks.AddRoot(); this.PageLinks.AddLink( this.Get <YafBoardSettings>().EnableDisplayName ? this.PageContext.CurrentUserData.DisplayName : this.PageContext.PageUserName, YafBuildLink.GetLink(ForumPages.cp_profile)); this.PageLinks.AddLink(this.GetText("TITLE")); this.NewPM.NavigateUrl = YafBuildLink.GetLinkNotEscaped(ForumPages.pmessage); this.NewPM2.NavigateUrl = this.NewPM.NavigateUrl; }
/// <summary> /// Gets the message link. /// </summary> /// <param name="messageId">The message id.</param> /// <returns> /// The get message link. /// </returns> protected string GetMessageLink([NotNull] object messageId) { return(YafBuildLink.GetLink( ForumPages.cp_message, "pm={0}&v={1}", messageId, PmViewConverter.ToQueryStringParam(this.View))); }
/// <summary> /// Handles the Load event of the Page control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param> protected void Page_Load([NotNull] object sender, [NotNull] EventArgs e) { // check if this feature is disabled if (!this.Get <BoardSettings>().AllowPrivateMessages) { BuildLink.RedirectInfoPage(InfoMessage.Disabled); } if (this.IsPostBack) { return; } if (this.Get <HttpRequestBase>().QueryString.GetFirstOrDefault("v").IsSet()) { this.View = PmViewConverter.FromQueryString(this.Get <HttpRequestBase>().QueryString.GetFirstOrDefault("v")); this.hidLastTab.Value = $"View{(int)this.View}"; } this.NewPM.NavigateUrl = BuildLink.GetLinkNotEscaped(ForumPages.PostPrivateMessage); this.NewPM2.NavigateUrl = this.NewPM.NavigateUrl; }
/// <summary> /// Handles the Load event of the Page control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param> protected void Page_Load([NotNull] object sender, [NotNull] EventArgs e) { // check if this feature is disabled if (!this.Get <BoardSettings>().AllowPrivateMessages) { BuildLink.RedirectInfoPage(InfoMessage.Disabled); } if (this.IsPostBack) { return; } if (this.Get <HttpRequestBase>().QueryString.GetFirstOrDefault("v").IsSet()) { this.View = PmViewConverter.FromQueryString(this.Get <HttpRequestBase>().QueryString.GetFirstOrDefault("v")); this.hidLastTab.Value = $"View{(int)this.View}"; } this.NewPM.NavigateUrl = BuildLink.GetLink(ForumPages.PostPrivateMessage); this.NewPM2.NavigateUrl = this.NewPM.NavigateUrl; // Renew PM Statistics var dt = this.GetRepository <PMessage>().UserMessageCount(this.PageContext.PageUserID); if (dt.HasRows()) { this.InfoInbox.Text = this.InfoArchive.Text = this.InfoOutbox.Text = this.GetPMessageText( "PMLIMIT_ALL", dt.Rows[0]["NumberTotal"], dt.Rows[0]["NumberIn"], dt.Rows[0]["NumberOut"], dt.Rows[0]["NumberArchived"], dt.Rows[0]["NumberAllowed"]); } }