protected void btnSave_Click(object sender, EventArgs e)
 {
     BaseHandler bh = new BaseHandler();
     PHText t = bh.GetCurrentVersionText(CultureCode, ItemId, ItemType);
     if (t == null)
     {
         t = new PHText();
         t.CreatedByUserId = UserId;
         t.CultureCode = CultureCode;
         t.ItemId = ItemId;
         t.ItemType = ItemType;
     }
     t.Text = Regex.Replace(tbTheText.Text, "<[^>]*>", String.Empty);
     if (ddlHeadingType.SelectedIndex > 0)
     {
         t.Text = "<h" + ddlHeadingType.SelectedIndex.ToString() + ">" + t.Text + "</h" + ddlHeadingType.SelectedIndex.ToString() + ">";
     }
     t.ModifiedByUserId = UserId;
     if (Case == EControlCase.Edit)
     {
         bh.SavePhTextInAllCc(t);
         Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(TabId, "", AttachQS));
     }
     else if (Case == EControlCase.Translate)
     {
         t.CultureCodeStatus = ECultureCodeStatus.HumanTranslated;
         bh.SavePhText(t);
         Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(TabId, "", AttachQS));
     }
 }
 protected void btnSave_Click(object sender, EventArgs e)
 {
     BaseHandler bh = new BaseHandler();
     PHText t = bh.GetCurrentVersionText(CultureCode, ItemId, ItemType);
     if (t == null)
     {
         t = new PHText();
         t.CreatedByUserId = UserId;
         t.CultureCode = CultureCode;
         t.ItemId = ItemId;
         t.ItemType = ItemType;
     }
     t.Text = System.Net.WebUtility.HtmlDecode(hdnrichtext.Value);
     t.ModifiedByUserId = UserId;
     if (Case == EControlCase.Edit)
     {
         bh.SavePhTextInAllCc(t);
         Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(TabId, "", AttachQS));
     }
     else if (Case == EControlCase.Translate)
     {
         t.CultureCodeStatus = ECultureCodeStatus.HumanTranslated;
         bh.SavePhText(t);
         Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(TabId, "", AttachQS));
     }
 }
 protected void btnSave_Click(object sender, EventArgs e)
 {
     BaseHandler bh = new BaseHandler();
     PHText t = bh.GetCurrentVersionText(CultureCode, ItemId, ItemType);
     if (t == null)
     {
         t = new PHText();
         t.CreatedByUserId = UserId;
         t.CultureCode = CultureCode;
         t.ItemId = ItemId;
         t.ItemType = ItemType;
     }
     t.Text = Regex.Replace(tbTheText.Text, "<[^>]*>", String.Empty);
     t.ModifiedByUserId = UserId;
     if (Case == EControlCase.Edit)
     {
         bh.SavePhTextInAllCc(t);
         if (ItemType == ETextItemType.PluggTitle)
         {
             string newPageName = ItemId.ToString() + ": " + t.Text;
             PluggContainer pc = new PluggContainer(CultureCode, ItemId);
             DNNHelper h = new DNNHelper();
             h.RenameTab(pc.ThePlugg.TabId, newPageName);
         }
         if (ItemType == ETextItemType.CourseTitle)
         {
             string newPageName = "C" + ItemId.ToString() + ": " + t.Text;
             CourseContainer cc = new CourseContainer(CultureCode, ItemId);
             DNNHelper h = new DNNHelper();
             h.RenameTab(cc.TheCourse.TabId, newPageName);
         }
         Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(TabId, "", "edit=0", AttachQS));
     }
     else if (Case == EControlCase.Translate)
     {
         t.CultureCodeStatus = ECultureCodeStatus.HumanTranslated;
         bh.SavePhText(t);
         Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(TabId, "", "translate=0", AttachQS));
     }
 }
Example #4
0
        public void UpdatePHText(ETextItemType ItemType, string txt)
        {
            var itemid = Convert.ToInt32(this.ComponentID);

            List<PluggComponent> comps = this.PluggContainer.GetComponentList();
            PluggComponent cToAdd = comps.Find(x => x.PluggComponentId == itemid);
            BaseHandler bh = new BaseHandler();

            var comtype = cToAdd.ComponentType;

            PHText phText = this.PHText;

            phText.Text = txt;
            phText.CultureCodeStatus = ECultureCodeStatus.GoogleTranslated;
            phText.CreatedByUserId = this.UserID;
            bh.SavePhTextInAllCc(phText);
            // bh.SavePhText(phText);
            Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(this.TabID, "", new string[] { "edit=1", "language=" + this.CurrentLanguage }));
        }
Example #5
0
        private void UpdatePHtext(ETextItemType ItemType, string txt)
        {
            var id = hdnlabel.Value;
            var itemid = Convert.ToInt32(id);

            List<PluggComponent> comps = p.GetComponentList();
            PluggComponent cToAdd = comps.Find(x => x.PluggComponentId == Convert.ToInt32(id));
            BaseHandler bh = new BaseHandler();

            var comtype = cToAdd.ComponentType;

            PHText phText = bh.GetCurrentVersionText(curlan, itemid, ItemType);

            phText.Text = txt;
            phText.CultureCodeStatus = ECultureCodeStatus.GoogleTranslated;
            phText.CreatedByUserId = this.UserId;
            if (EditStr == "2")
            {
                phText.CultureCodeStatus = ECultureCodeStatus.HumanTranslated;
                bh.SavePhText(phText);
            }
            else
            bh.SavePhTextInAllCc(phText);
               // bh.SavePhText(phText);
            Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(TabId, "", new string[] { "edit=" + EditStr, "language=" + curlan }));
        }
Example #6
0
        protected void btnSaveRRt_Click(object sender, EventArgs e)
        {
            var id = hdnlabel.Value;
            var itemid = Convert.ToInt32(id);

            List<PluggComponent> comps = p.GetComponentList();
            PluggComponent cToAdd = comps.Find(x => x.PluggComponentId == Convert.ToInt32(id));
            BaseHandler bh = new BaseHandler();

            var comtype = cToAdd.ComponentType;

            switch (cToAdd.ComponentType)
            {
                case EComponentType.RichRichText:
                    //PHText RichRichText = bh.GetCurrentVersionText(curlan, itemid, ETextItemType.PluggComponentRichRichText);
                    //RichRichText.Text = richrichtext.Text;

                    PHText objPHtext = new PHText(System.Net.WebUtility.HtmlDecode(richrichtext.Text), curlan, ETextItemType.PluggComponentRichRichText);
                    objPHtext.CultureCodeStatus = ECultureCodeStatus.GoogleTranslated;
                    objPHtext.ItemId = itemid;
                    objPHtext.CreatedByUserId = this.UserId;

                    if (EditStr == "2")
                        objPHtext.CultureCodeStatus = ECultureCodeStatus.HumanTranslated;

                    bh.SavePhTextInAllCc(objPHtext);
                    break;

                case EComponentType.Latex:

                    PHLatex latex = bh.GetCurrentVersionLatexText(curlan, Convert.ToInt32(id), ELatexItemType.PluggComponentLatex);
                    latex.CultureCodeStatus = ECultureCodeStatus.GoogleTranslated;
                    latex.ItemId = itemid;
                    latex.CreatedByUserId = this.UserId;
                    latex.Text = System.Net.WebUtility.HtmlDecode(richrichtext.Text);
                    //bh.SaveLatexText(latex);
                    bh.SaveLatexTextInAllCc(latex);
                    break;
            }

            Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(TabId, "", new string[] { "edit=" + EditStr, "language=" + curlan }));
        }
Example #7
0
        protected void btnSaveRRt_Click(object sender, EventArgs e)
        {
            var itemid = Convert.ToInt32(this.ComponentID);

            List<PluggComponent> comps = this.PluggContainer.GetComponentList();
            PluggComponent cToAdd = comps.Find(x => x.PluggComponentId == itemid);
            BaseHandler bh = new BaseHandler();

            var comtype = cToAdd.ComponentType;

            //switch (cToAdd.ComponentType)
            //{
            //    case EComponentType.RichRichText:
            //PHText RichRichText = bh.GetCurrentVersionText(curlan, itemid, ETextItemType.PluggComponentRichRichText);
            //RichRichText.Text = richrichtext.Text;

            PHText objPHtext = new PHText(System.Net.WebUtility.HtmlDecode(richrichtext.Text), this.CurrentLanguage, ETextItemType.PluggComponentRichRichText);
            objPHtext.CultureCodeStatus = ECultureCodeStatus.GoogleTranslated;
            objPHtext.ItemId = itemid;
            objPHtext.CreatedByUserId = this.UserID;

            if (EditCase == 2)
                objPHtext.CultureCodeStatus = ECultureCodeStatus.HumanTranslated;
            bh.SavePhTextInAllCc(objPHtext);

            Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(this.TabID, "", new string[] { "edit=1", "language=" + this.CurrentLanguage }));
        }