Esempio n. 1
0
        /// <summary>
        /// Saves the and continue.
        /// </summary>
        private void SaveAndContinue()
        {
            SharedEnum.CrudOperation crudOperation = SharedEnum.CrudOperation.Insert;
            try
            {
                DotNetNuke.Security.PortalSecurity objSec = new DotNetNuke.Security.PortalSecurity();
                this.SaveTopic(
                    HttpUtility.HtmlDecode(
                        objSec.InputFilter(objSec.InputFilter(this.teContent.Text, PortalSecurity.FilterFlag.NoMarkup), PortalSecurity.FilterFlag.NoScripting)),
                    this.AllowDiscuss.Checked,
                    this.AllowRating.Checked,
                    objSec.InputFilter(WikiMarkup.DecodeTitle(this.txtTitle.Text.Trim()), PortalSecurity.FilterFlag.NoMarkup),
                    objSec.InputFilter(this.txtDescription.Text.Trim(), PortalSecurity.FilterFlag.NoMarkup),
                    objSec.InputFilter(this.txtKeywords.Text.Trim(), PortalSecurity.FilterFlag.NoMarkup),
                    out crudOperation);
            }
            catch (TopicValidationException exc)
            {
                switch (exc.CrudError)
                {
                case DotNetNuke.Wiki.BusinessObjects.TopicBO.TopicError.DUPLICATENAME:
                    this.Messages.ShowWarning(Localization.GetString("WarningDUPLICATENAME", this.LocalResourceFile));
                    break;

                default:
                    throw exc;
                }
            }

            this.PostTopicToDNNJournal(crudOperation);
        }
Esempio n. 2
0
        /// <summary>
        /// Handles the Click event of the save control. Creates/updates a topic
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event
        /// data.</param>
        protected void CmdSave_Click(object sender, System.EventArgs e)
        {
            // If we've change the Topic Name we need to create a new topic.
            Topic ti = null;

            ////if (string.IsNullOrWhiteSpace(PageTopic) | PageTopic != WikiMarkup.DecodeTitle(txtPageName.Text.Trim()))
            ////{
            ////    PageTopic = WikiMarkup.DecodeTitle(txtPageName.Text.Trim());
            ////    _Topic.TopicID = 0;
            ////    ti = TopicBo.GetByNameForModule(ModuleId, PageTopic);
            ////}

            this.PageTopic = WikiMarkup.DecodeTitle(this.txtPageName.Text.Trim());

            if (ti == null)
            {
                this.SaveChanges();
                if (this.PageTopic == WikiModuleBase.WikiHomeName)
                {
                    Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(this.TabId));
                }

                Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(this.TabId, this.PortalSettings, string.Empty, string.Empty, "topic=" + WikiMarkup.EncodeTitle(this.PageTopic)), false);
            }
            else
            {
                this.lblPageCreationError.Text = Localization.GetString("lblPageCreationError", this.LocalResourceFile);
            }
        }
Esempio n. 3
0
        /// <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="System.EventArgs" /> instance containing the event
        /// data.</param>
        public new void Page_Load(object sender, System.EventArgs e)
        {
            this.LoadLocalization();

            if (this.CanEdit)
            {
                if (this.teContent != null)
                {
                    this.teContent.HtmlEncode = false;
                }

                this.LoadTopic();
                if (string.IsNullOrWhiteSpace(CurrentTopic.Name))
                {
                    if (this.Request.QueryString["topic"] == null)
                    {
                        this.PageTopic    = WikiHomeName.Replace("[L]", string.Empty);
                        CurrentTopic.Name = this.PageTopic;
                    }
                    else
                    {
                        this.PageTopic    = WikiMarkup.DecodeTitle(this.Request.QueryString["topic"].ToString()).Replace("[L]", string.Empty);
                        CurrentTopic.Name = this.PageTopic;
                    }
                }

                this.EditPage();

                // CommentsSec.IsExpanded = FalseB
                if (this.Request.QueryString["add"] != null)
                {
                    this.PageTopic = string.Empty;
                    this.LoadTopic();
                    this.EditPage();
                }
                else
                {
                }

                // Add confirmation to the delete button.
                ClientAPI.AddButtonConfirm(this.DeleteBtn, Localization.GetString("ConfirmDelete", WikiModuleBase.SharedResources));
            }
            else
            {
                // User doesn't have edit rights to this module, load up a message stating so.
                this.lblMessage.Text     = Localization.GetString("NoEditAccess", this.LocalResourceFile);
                this.divWikiEdit.Visible = false;
            }
        }