Exemple #1
0
 /// <summary>
 /// Do Logout Dialog
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
 protected void LogOutClick([NotNull] object sender, [NotNull] EventArgs e)
 {
     this.PageContext.PageElements.RegisterJsBlockStartup(
         "logoutModalConfirmJs",
         JavaScriptBlocks.BootBoxConfirmJs(
             this.GetText("TOOLBAR", "LOGOUT_TITLE"),
             this.GetText("TOOLBAR", "LOGOUT_QUESTION"),
             this.GetText("TOOLBAR", "LOGOUT"),
             this.GetText("COMMON", "CANCEL"),
             BuildLink.GetLink(ForumPages.Account_Logout)));
 }
        /// <summary>
        /// Creates this pages title and fires a PageTitleSet event if one is set
        /// </summary>
        private void GeneratePopUp()
        {
            // This happens when user logs in
            if (this.DisplayPmPopup() && (!this.PageContext.ForumPageType.Equals(ForumPages.MyMessages) ||
                                          !this.PageContext.ForumPageType.Equals(ForumPages.Friends)))
            {
                this.PageContext.PageElements.RegisterJsBlockStartup(
                    "ModalConfirmJs",
                    JavaScriptBlocks.BootBoxConfirmJs(
                        this.GetText("COMMON", "UNREAD_MSG_TITLE"),
                        this.GetTextFormatted("UNREAD_MSG2", this.PageContext.UnreadPrivate),
                        this.GetText("COMMON", "YES"),
                        this.GetText("COMMON", "NO"),
                        this.Get <LinkBuilder>().GetLink(ForumPages.MyMessages)));

                this.Get <ISession>().LastPm = this.PageContext.LastUnreadPm;

                // Avoid Showing Both Popups
                return;
            }

            if (!this.DisplayPendingBuddies() || this.PageContext.ForumPageType.Equals(ForumPages.Friends) || this.PageContext.ForumPageType.Equals(ForumPages.MyMessages))
            {
                return;
            }

            this.PageContext.PageElements.RegisterJsBlockStartup(
                "ModalConfirmJs",
                JavaScriptBlocks.BootBoxConfirmJs(
                    this.GetText("BUDDY", "PENDINGBUDDIES_TITLE"),
                    this.GetTextFormatted("PENDINGBUDDIES2", this.PageContext.PendingBuddies),
                    this.GetText("COMMON", "YES"),
                    this.GetText("COMMON", "NO"),
                    this.Get <LinkBuilder>().GetLink(ForumPages.Friends)));

            this.Get <ISession>().LastPendingBuddies = this.PageContext.LastPendingBuddies;
        }