protected void btnYtSave_Click(object sender, EventArgs e)
        {
            //string curlan = (Page as DotNetNuke.Framework.PageBase).PageCulture.Name;
            //int pluggid = Convert.ToInt32(((DotNetNuke.Framework.CDefault)this.Page).Title);
            //PluggContainer p = new PluggContainer(curlan, pluggid);

            //List<PluggComponent> comps = p.GetComponentList();

            //BaseHandler bh = new BaseHandler();

            //List<object> objToadd = new List<object>();
            BaseHandler bh = new BaseHandler();
            YouTube yt = bh.GetYouTubeByComponentId(YouTubeId);
            if (yt == null)
                yt = new YouTube();
            try
            {
                yt.YouTubeTitle = yttitle.Value;
                yt.YouTubeDuration = Convert.ToInt32(ytduration.Value);
                yt.YouTubeCode = ytYouTubeCode.Value;
                yt.YouTubeAuthor = ytAuthor.Value;
                yt.YouTubeCreatedOn = Convert.ToDateTime(ytYouTubeCreatedOn.Value);
                yt.YouTubeComment = ytYouTubeComment.Value;
                yt.PluggComponentId = YouTubeId;
            }
            catch
            {

            }

            bh.SaveYouTube(yt);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            BaseHandler bh = new BaseHandler();
            YouTube yt = bh.GetYouTubeByComponentId(PluggComponentId);
            if (yt != null)
            {
                lblTheYTTitle.Text = yt.YouTubeTitle;
                lblTheYTAuthor.Text = yt.YouTubeAuthor;
                lblTheYTText.Text = yt.YouTubeComment;
                lnkShowInfo.Visible = true;
            }

            if (yt != null && Case != EControlCase.Edit)
                pnlYouTube.Controls.Add(new LiteralControl(yt.GetIframeString(CultureCode)));
            if (Case == EControlCase.ViewAllowEdit)
            {
                pnlEdit.Visible = true;
                hlEdit.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(TabId, "", "edit=" + ControlOrder, AttachQS);
            }
            if (Case == EControlCase.Edit)
            {
                btnSave.Visible = true;
                btnCancel.Visible = true;
                pnlYouTubeInput.Visible = true;
                if (yt != null)
                    tbYouTube.Text = yt.YouTubeCode;
            }
        }
 protected void btnSave_Click(object sender, EventArgs e)
 {
     BaseHandler bh = new BaseHandler();
     YouTube yt = bh.GetYouTubeByComponentId(PluggComponentId);
     if (yt == null)
         yt = new YouTube();
     yt.YouTubeTitle = yttitle.Value;
     yt.YouTubeDuration = Convert.ToInt32(ytduration.Value);
     yt.YouTubeCode = ytYouTubeCode.Value;
     yt.YouTubeAuthor = ytAuthor.Value;
     yt.YouTubeCreatedOn = Convert.ToDateTime(ytYouTubeCreatedOn.Value);
     yt.YouTubeComment = ytYouTubeComment.Value;
     yt.PluggComponentId = PluggComponentId;
     bh.SaveYouTube(yt);
     Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(TabId, "", "edit=0", AttachQS));
 }
Example #4
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            List<PluggComponent> comps = this.PluggContainer.GetComponentList();

            BaseHandler bh = new BaseHandler();
            List<object> objToadd = new List<object>();
            Plugghest.Base2.YouTube yt = bh.GetYouTubeByComponentId(this.ComponentID);
            if (yt == null)
                yt = new Plugghest.Base2.YouTube();
            try
            {
                yt.YouTubeTitle = yttitle.Value;
                yt.YouTubeDuration = Convert.ToInt32(ytduration.Value);
                yt.YouTubeCode = ytYouTubeCode.Value;
                yt.YouTubeAuthor = ytAuthor.Value;
                yt.YouTubeCreatedOn = Convert.ToDateTime(ytYouTubeCreatedOn.Value);
                yt.YouTubeComment = ytYouTubeComment.Value;
                yt.PluggComponentId = this.ComponentID;
            }
            catch
            {

            }

            bh.SaveYouTube(yt);

            Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(this.TabID, "", new string[] { "edit=1", "language=" + this.CurrentLanguage }));
        }
 public static string GetIframeString(int YouTubeId, string _PageCultureCode)
 {
     BaseHandler bh = new BaseHandler();
     Plugghest.Base2.YouTube yt = bh.GetYouTubeByComponentId(YouTubeId);
     return yt != null ? yt.GetIframeString(_PageCultureCode) : "(currently no video)";
 }
Example #6
0
        protected void btnTest_Click(object sender, EventArgs e)
        {
            BaseHandler bh = new BaseHandler();
            PluggContainer pc = new PluggContainer("en-US", 31);
            List<PluggComponent> comps = pc.GetComponentList();

            foreach(PluggComponent comp in comps)
            {
            switch (comp.ComponentType)
            {
            case EComponentType.Label:
            PHText lbl = bh.GetCurrentVersionText(pc.CultureCode, comp.PluggComponentId, ETextItemType.PluggComponentLabel);
            //Handle label
            break;
            case EComponentType.RichText:
            PHText rt = bh.GetCurrentVersionText(pc.CultureCode, comp.PluggComponentId, ETextItemType.PluggComponentRichText);
            //Handle rich text
            break;
            case EComponentType.RichRichText:
            PHText rrt = bh.GetCurrentVersionText(pc.CultureCode, comp.PluggComponentId, ETextItemType.PluggComponentRichRichText);
            //Handle richrich text
            break;
            case EComponentType.Latex:
            PHLatex lt = bh.GetCurrentVersionLatexText(pc.CultureCode, comp.PluggComponentId, ELatexItemType.PluggComponentLatex);
            //Handle Latex text
            break;
            case EComponentType.YouTube:
            YouTube yt = bh.GetYouTubeByComponentId(comp.PluggComponentId);
            //Handle YouTube
            break;
            }
            }
            PHText rrText = bh.GetCurrentVersionText(pc.CultureCode, comps[0].PluggComponentId, ETextItemType.PluggComponentRichRichText);
            string myText = rrText.Text;

            //int x;
            //PluggComponent vv = comps[0];
            //foreach(PluggComponent c in comps)
            //{
            //    x = c.PluggComponentId;
            //}
            //pc.ThePlugg.CreatedByUserId = 1;
            //pc.ThePlugg.ModifiedByUserId = 1;
            //pc.ThePlugg.WhoCanEdit = EWhoCanEdit.Anyone;

            //pc.SetTitle("This is my Title");
            //pc.SetDescription("This is my description");

            //List<object> cmpData = new List<object>();

            //YouTube v = new YouTube();
            //v.YouTubeAuthor = "";
            //v.YouTubeCode = "asdasdasdas";
            //v.YouTubeComment = "";
            //v.YouTubeCreatedOn = DateTime.Now;
            //v.YouTubeDuration = 100;
            //v.YouTubeTitle = "This is my Title";
            //cmpData.Add(v);

            //PHText htmlText = new PHText();
            //htmlText.Text = "This is my Html text";
            //htmlText.ItemType = ETextItemType.PluggComponentRichRichText;
            //cmpData.Add(htmlText);

            //bh.SavePlugg(pc, cmpData);

            //PHLatex latexText = new PHLatex();
            //latexText.Text = "This is my Latex text";
            //latexText.ItemType = ELatexItemType.PluggComponentLatex;
            //cmpData.Add(latexText);

            //pc.LoadComponents();
            //switch (pc.TheComponents.GetType().Name)
            //{
            //    case "Aba":
            //        break;
            //}

            //pc.ThePlugg = bh.GetPlugg(1);
            //pc.LoadComponents();
            //foreach (var c in pc.TheComponents)
            //{
            //    switch (c.GetType().Name)
            //    {
            //        case "PHText":
            //            PHText xx = (PHText)c;
            //            string x = theTitle;
            //            break;
            //    }
            //}
        }
Example #7
0
        private void DisPlayPluggComp()
        {
            List<PluggComponent> comps = p.GetComponentList();
            BaseHandler bh = new BaseHandler();
            string ddl = ""; string str = "</select></div><hr />"; int i = 0, IntCompOrder = 1;
            if (comps.Count == 0)
            {
                ShowNoComMsg();
            }

            ddl = CreateDropDown(ddl);

            Label dynamicLabel = new Label();

            if (IsCase3)
            {
                chkComTxt = true;
            }
            int? subid = p.ThePlugg.SubjectId;
            CreateSubject(i, subid);
            bool isLastComp = false;
            foreach (PluggComponent comp in comps)
            {
                isLastComp = (IntCompOrder == comps.Count);
                switch (comp.ComponentType)
                {
                    case EComponentType.Label:

                        PHText lbl = bh.GetCurrentVersionText(curlan, comp.PluggComponentId, ETextItemType.PluggComponentLabel);
                        //This condition is used for editing plugg
                        string LabHTMLstring = "";
                        if (IsCase3)
                        {
                            if (lbl.Text == "(No text)")
                                lbl.Text = "(currently no text)";
                            LabHTMLstring = CreateDiv(lbl, "Label" + i, LabComponenttxt+" " + IntCompOrder + ": " + BtnLabelTxt);
                            int orderid = comp.ComponentOrder;
                            CreateBtnDel(orderid, "btncsdel", "btnlbDel" + i + "");
                            CreateBtnEdit(comp, lbl, "btncsdel", "btnlbEdit" + i + "");

                            if (isLastComp)
                            {
                                LabHTMLstring = "<hr /></div>" + LabAddNewcomTxt + " after "+LabComponenttxt+" " + IntCompOrder + ": <select class='ddlclass' id='ddl" + i + "'>";
                            }
                            else
                            {
                                LabHTMLstring = "<hr /></div>" + LabAddNewcomTxt + " between " + LabComponenttxt + " " + IntCompOrder + " and " + (IntCompOrder + 1).ToString() + ": <select class='ddlclass' id='ddl" + i + "'>";
                            }
                            LabHTMLstring = LabHTMLstring + ddl;
                            divTitle.Controls.Add(new LiteralControl(LabHTMLstring));
                            CreateBtnAdd(orderid, "btncs", "btnlbAdd" + i + "");
                            divTitle.Controls.Add(new LiteralControl(str));
                        }
                        else if (lbl.Text == "(No text)")
                        {
                            IntCompOrder--;
                            break;
                        }
                        //This condition is used for Translation The Plugg Text(same for all cases)
                        else if (IsCase2)
                        {
                            LabHTMLstring = CreateDiv(lbl, "Label" + i, LabComponenttxt+" " + IntCompOrder + ": " + BtnLabelTxt);
                            if (lbl.CultureCodeStatus == ECultureCodeStatus.GoogleTranslated)
                            {
                                CreateBtnImproveHumGoogleTrans(comp, lbl, "googletrans", "btnrtIGT" + i + "", BtnImpgoogleTransTxt);
                                CreateBtnGoogleT(lbl, "googleTrasok", "btnGTText" + i + "");
                            }
                            if (lbl.CultureCodeStatus == ECultureCodeStatus.HumanTranslated)
                            {
                                CreateBtnImproveHumGoogleTrans(comp, lbl, "btnhumantrans", "btnlbl" + i + "",BtnImproveHumTransTxt);
                            }
                            divTitle.Controls.Add(new LiteralControl(str));
                            chkComTxt = true;
                        }
                        else
                        {
                            if (lbl.Text == "(No text)")
                            {
                                break;
                            }

                            if (lbl != null)
                              divTitle.Controls.Add(new LiteralControl("<div>" + lbl.Text + "</div> "));

                           // string LabHTMLstring = CreateDiv(lbl, "Label" + i, BtnLabelTxt);
                            chkComTxt = true;
                        }

                        break;

                    case EComponentType.RichText:
                        PHText rt = bh.GetCurrentVersionText(curlan, comp.PluggComponentId, ETextItemType.PluggComponentRichText);
                        if (IsCase3)
                        {
                            if (rt.Text == "(No text)")
                                rt.Text = "(currently no text)";

                            string RtHTMLstring = CreateDiv(rt, "RichText" + i, LabComponenttxt+" " + IntCompOrder + ": " + BtnRichTextTxt);
                            int RTorderid = comp.ComponentOrder;

                            CreateBtnDel(RTorderid, "btncsdel", "btnrtDel" + i + "");
                            CreateBtnEdit(comp, rt, "btncsdel", "btnrtEdit" + i + "");
                            if (isLastComp)
                            {
                                RtHTMLstring = "<hr /></div>" + LabAddNewcomTxt + " after " + LabComponenttxt + " " + IntCompOrder + ": <select class='ddlclass' id='Rtddl" + i + "'>";
                            }
                            else
                            {
                                RtHTMLstring = "<hr /></div>" + LabAddNewcomTxt + " between " + LabComponenttxt + " " + IntCompOrder + " and " + (IntCompOrder + 1).ToString() + ": <select class='ddlclass' id='Rtddl" + i + "'>";
                            }
                            RtHTMLstring = RtHTMLstring + ddl;
                            divTitle.Controls.Add(new LiteralControl(RtHTMLstring));
                            CreateBtnAdd(RTorderid, "btncs", "btnrtAdd" + i + "");
                            divTitle.Controls.Add(new LiteralControl(str));
                        }
                        else if (rt.Text == "(No text)")
                        {
                            IntCompOrder--;
                            break;
                        }
                        else if (IsCase2)
                        {

                            string RtHTMLstring = CreateDiv(rt, "RichText" + i, LabComponenttxt+" " + IntCompOrder + ": " + BtnRichTextTxt);
                            if (rt.CultureCodeStatus == ECultureCodeStatus.GoogleTranslated)
                            {
                                CreateBtnImproveHumGoogleTrans(comp, rt, "googletrans", "btnrtIGT" + i + "", BtnImpgoogleTransTxt);
                                CreateBtnGoogleT(rt, "googleTrasok", "btnrtGTText" + i + "");

                            }
                            if (rt.CultureCodeStatus == ECultureCodeStatus.HumanTranslated)
                            {
                                CreateBtnImproveHumGoogleTrans(comp, rt, "btnhumantrans", "btnrtIHT" + i + "",BtnImproveHumTransTxt);
                            }
                            divTitle.Controls.Add(new LiteralControl(str));
                            chkComTxt = true;
                        }
                        else
                        {
                            if (rt.Text == "(No text)")
                            {
                                break;
                            }
                            divTitle.Controls.Add(new LiteralControl("<div>" + rt.Text + "</div> "));
                           // string RtHTMLstring = CreateDiv(rt, "RichText" + i, BtnRichTextTxt);

                            chkComTxt = true;
                        }
                        break;

                    case EComponentType.RichRichText:
                        PHText rrt = bh.GetCurrentVersionText(curlan, comp.PluggComponentId, ETextItemType.PluggComponentRichRichText);
                        if (IsCase3)
                        {
                            if (rrt.Text == "(No text)")
                                rrt.Text = "(currently no text)";

                            string RRTHTMLstring = CreateDiv(rrt, "RichRichText" + i, LabComponenttxt+" " + IntCompOrder + ": " + BtnRichRichTxttxt);
                            int RRTorderid = comp.ComponentOrder;

                            CreateBtnDel(RRTorderid, "btncsdel", "btnrrtDel" + i + "");
                            CreateBtnEdit(comp, rrt, "btncsdel", "btnrrtEdit" + i + "");
                            if (isLastComp)
                            {
                                RRTHTMLstring = "<hr /></div>" + LabAddNewcomTxt + " after " + LabComponenttxt + " " + IntCompOrder + ": <select class='ddlclass' id='Rtddl" + i + "'>";
                            }
                            else
                            {
                                RRTHTMLstring = "<hr /></div>" + LabAddNewcomTxt + " between " + LabComponenttxt + " " + IntCompOrder + " and " + (IntCompOrder + 1).ToString() + ": <select class='ddlclass' id='Rtddl" + i + "'>";
                            }
                            RRTHTMLstring = RRTHTMLstring + ddl;
                            divTitle.Controls.Add(new LiteralControl(RRTHTMLstring));

                            CreateBtnAdd(RRTorderid, "btncs", "btnrrtAdd" + i + "");

                            divTitle.Controls.Add(new LiteralControl(str));
                        }
                        else if (rrt.Text == "(No text)")
                        {
                            IntCompOrder--;
                            break;
                        }
                        else if (IsCase2)
                        {
                            string RRTHTMLstring = CreateDiv(rrt, "RichRichText" + i, LabComponenttxt+" " + IntCompOrder + ": " + BtnRichRichTxttxt);
                            if (rrt.CultureCodeStatus == ECultureCodeStatus.GoogleTranslated)
                            {
                                CreateBtnImproveHumGoogleTrans(comp, rrt, "googletrans", "btnrrtIGT" + i + "",BtnImpgoogleTransTxt);
                                CreateBtnGoogleT(rrt, "googleTrasok", "btnrrtGTText" + i + "");
                            }
                            if (rrt.CultureCodeStatus == ECultureCodeStatus.HumanTranslated)
                            {
                                CreateBtnImproveHumGoogleTrans(comp, rrt, "btnhumantrans", "btnrrtIHT" + i + "",BtnImproveHumTransTxt);

                            }

                            divTitle.Controls.Add(new LiteralControl(str));
                            chkComTxt = true;
                        }
                        else
                        {
                            if (rrt.Text == "(No text)")
                            {
                                break;
                            }
                            divTitle.Controls.Add(new LiteralControl("<div>" + rrt.Text + "</div> "));
                            //string RRTHTMLstring = CreateDiv(rrt, "RichRichText" + i, BtnRichRichTxttxt);
                            chkComTxt = true;
                        }
                        break;

                    case EComponentType.Latex:
                        PHLatex lat = bh.GetCurrentVersionLatexText(curlan, comp.PluggComponentId, ELatexItemType.PluggComponentLatex);
                        if (IsCase3)
                        {
                            if (lat.Text == "(No text)")
                                lat.Text = "(currently no text)";
                            string LatHTMLstring = CreateDivLat(lat, "Latex" + i, IntCompOrder);
                           // string RRTHTMLstring = CreateDivLat(lat, "Latex" + i, "Component " + IntCompOrder + ": " + BtnRichRichTxttxt, IntCompOrder);
                            int ltorderid = comp.ComponentOrder;

                            CreateBtnDel(ltorderid, "btncsdel", "btnltDel" + i + "");

                            Button editbtn = new Button();
                            editbtn.CssClass = "btncsdel";
                            editbtn.ID = "btnltEdit" + i;
                            editbtn.Text = BtnEditTxt;
                            editbtn.Click += (s, e) => { CallLatFun(ltorderid, comp, lat, "1"); };
                            divTitle.Controls.Add(editbtn);

                            if (isLastComp)
                            {
                                LatHTMLstring = "<hr /></div>" + LabAddNewcomTxt + " after " + LabComponenttxt + " " + IntCompOrder + ": <select class='ddlclass' id='ltddl" + i + "'>";
                            }
                            else
                            {
                                LatHTMLstring = "<hr /></div>" + LabAddNewcomTxt + " between " + LabComponenttxt + " " + IntCompOrder + " and " + (IntCompOrder + 1).ToString() + ": <select class='ddlclass' id='ltddl" + i + "'>";
                            }
                                LatHTMLstring = LatHTMLstring + ddl;
                            divTitle.Controls.Add(new LiteralControl(LatHTMLstring));
                            CreateBtnAdd(ltorderid, "btncs", "btnlatexAdd" + i + "");
                            divTitle.Controls.Add(new LiteralControl(str));
                        }

                        else
                        {
                            if (lat.Text == "(No text)")
                            {
                                break;
                            }
                            divTitle.Controls.Add(new LiteralControl("<div>" + lat.Text + "</div> "));
                           // string LatHTMLstring = CreateDivLat(lat, "Latex" + i, IntCompOrder);
                            if (IsCase2)
                                divTitle.Controls.Add(new LiteralControl("<hr />"));
                            chkComTxt = true;
                        }

                        break;

                    case EComponentType.YouTube:
                        YouTube yt = bh.GetYouTubeByComponentId(comp.PluggComponentId);
                        string strYoutubeIframe = "";
                        string ytYouTubecode = "";
                        try
                        {
                            strYoutubeIframe = yt.GetIframeString(p.CultureCode);
                        }
                        catch
                        {
                            strYoutubeIframe = "(currently no video)";
                        }
                        if (yt == null)
                        {
                            ytYouTubecode = "(currently no video)";
                        }
                        else
                        {
                            ytYouTubecode = yt.YouTubeCode;
                        }
                        var ytdivid = "Youtube" + i;
                        var ytddlid = "ytddl" + i;
                        var ytorderid = comp.ComponentOrder;
                        string ytHTMLstring = "";
                        if (IsCase3)
                        {
                            ytHTMLstring = "<div><div id=" + ytdivid + " class='Main'>" + LabComponenttxt+" " + IntCompOrder + ": " + "YouTube";

                            divTitle.Controls.Add(new LiteralControl(ytHTMLstring));

                            CreateBtnDel(ytorderid, "btncsdel", "btnytDel" + i + "");

                            string IdYt = "btnrrtEdit" + i;

                            CreateBtnYTEdit(comp, yt, ytorderid, "btncsdel", "IdYt" + i + "");
                            if (isLastComp)
                            {
                                ytHTMLstring = "</div>" + strYoutubeIframe + "</br><hr />" + LabAddNewcomTxt + " after " + LabComponenttxt + " " + IntCompOrder + ": <select class='ddlclass' id=" + ytddlid + ">";
                            }
                            else
                            {
                                ytHTMLstring = "</div>" + strYoutubeIframe + "</br><hr />" + LabAddNewcomTxt + " between " + LabComponenttxt + " " + IntCompOrder + " and " + (IntCompOrder + 1).ToString() + ": <select class='ddlclass' id=" + ytddlid + ">";
                            }
                            ytHTMLstring = ytHTMLstring + ddl;
                            divTitle.Controls.Add(new LiteralControl(ytHTMLstring));

                            CreateBtnAdd(ytorderid, "btncs", "btnytAdd" + i + "");

                            divTitle.Controls.Add(new LiteralControl(str));
                        }
                        else if (strYoutubeIframe == "(currently no video)")
                        {
                            IntCompOrder--;
                            break;
                        }
                        else
                        {
                            if (strYoutubeIframe == "(currently no video)")
                            {
                                break;
                            }
                           // divTitle.Controls.Add(new LiteralControl("<div>" + strYoutubeIframe + "</div> "));
                           ytHTMLstring = "<div>" + strYoutubeIframe + "</div>";
                              if (IsCase2)

                            divTitle.Controls.Add(new LiteralControl("<div><div id=" + ytdivid + " class='Main'>" + LabComponenttxt+" " + IntCompOrder + ": " + "YouTube"));

                            divTitle.Controls.Add(new LiteralControl(ytHTMLstring));
                              if (IsCase2)
                           divTitle.Controls.Add(new LiteralControl("<hr />"));

                            chkComTxt = true;
                        }
                        break;
                }
                i++;
                IntCompOrder++;
            }
            if (!chkComTxt)
                ShowNoComMsg();
        }
Example #8
0
        protected void btnYtSave_Click(object sender, EventArgs e)
        {
            var id = hdnlabel.Value;
            var itemid = Convert.ToInt32(id);

            List<PluggComponent> comps = p.GetComponentList();

            BaseHandler bh = new BaseHandler();

            List<object> objToadd = new List<object>();

            YouTube yt = bh.GetYouTubeByComponentId(Convert.ToInt32(id));
            if (yt == null)
                yt = new YouTube();
            try
            {
                yt.YouTubeTitle = yttitle.Value;
                yt.YouTubeDuration = Convert.ToInt32(ytduration.Value);
                yt.YouTubeCode = ytYouTubeCode.Value;
                yt.YouTubeAuthor = ytAuthor.Value;
                yt.YouTubeCreatedOn = Convert.ToDateTime(ytYouTubeCreatedOn.Value);
                yt.YouTubeComment = ytYouTubeComment.Value;
                yt.PluggComponentId = itemid;
            }
            catch
            {

            }

            bh.SaveYouTube(yt);

            Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(TabId, "", new string[] { "edit=1", "language=" + curlan }));
        }
 private void CaseDisplay()
 {
     BaseHandler bh = new BaseHandler();
     YouTube yt = bh.GetYouTubeByComponentId(YouTubeId);
     pnYoutubeIFrame.Visible = true;
     pnYoutubeIFrame.Controls.Add(new LiteralControl(yt.GetIframeString((Page as DotNetNuke.Framework.PageBase).PageCulture.Name)));
 }