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 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)
 {
     if (SubjectId == 0)
         ltSubject.Text = Localization.GetString("NoSubject", LocalResourceFile);
     else
     {
         BaseHandler bh = new BaseHandler();
         var SubList = bh.GetSubjectsAsFlatList(CultureCode);
         ltSubject.Text = bh.GetSubjectString(CultureCode, SubjectId);
     }
     if (Case == EControlCase.ViewAllowEdit)
     {
         phEdit.Visible = true;
         hlEdit.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(TabId, "", "edit=" + ControlOrder, AttachQS);
     }
     if (Case == EControlCase.Edit)
     {
         btnSave.Visible = true;
         btnCancel.Visible = true;
         phSelect.Visible = true;
         ltTheTree.Visible = true;
         ltTheTree.Text = "<div class=\"tree\"><div id=\"tree2\"></div></div><br />";
         BaseHandler bh = new BaseHandler();
         var tree = bh.GetSubjectsAsTree(CultureCode);
         JavaScriptSerializer TheSerializer = new JavaScriptSerializer();
         hdnTreeData.Value = TheSerializer.Serialize(tree);
     }
 }
Exemplo n.º 5
0
 public void BindTree()
 {
     BaseHandler objsubhandler = new BaseHandler();
     var tree = objsubhandler.GetExtendedSubjectsAsTree(Language);
     JavaScriptSerializer TheSerializer = new JavaScriptSerializer();
     hdnTreeData.Value = TheSerializer.Serialize(tree);
 }
        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();
     PHLatex t = bh.GetCurrentVersionLatexText(CultureCode, ItemId, ItemType);
     if (t == null)
     {
         t = new PHLatex();
         t.CreatedByUserId = UserId;
         t.CultureCode = CultureCode;
         t.ItemId = ItemId;
         t.ItemType = ItemType;
     }
     t.ModifiedByUserId = UserId;
     if (Case == EControlCase.Edit)
     {
         t.Text = tbEnterLatex.Text;
         t.HtmlText = "";
         bh.SaveLatexTextInAllCc(t);
         Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(TabId, "", "edit=0", AttachQS));
     }
     else if (Case == EControlCase.Translate)
     {
         PHLatex translatedFrom = bh.GetCurrentVersionLatexText(CreatedInCultureCode, ItemId, ItemType);
         if (translatedFrom != null)
         {
             t.Text = translatedFrom.Text;
             t.HtmlText = System.Net.WebUtility.HtmlDecode(teTranslate.Text);
             t.CultureCodeStatus = ECultureCodeStatus.HumanTranslated;
             bh.SaveLatexText(t);
             Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(TabId, "", "translate=0", AttachQS));
         }
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     BaseHandler bh = new BaseHandler();
     PHText t = bh.GetCurrentVersionText(CultureCode, ItemId, ItemType);
     PHText translatedFrom;
     if (t != null)
         TheText.Text = t.Text;
     switch (Case)
     {
         case EControlCase.ViewAllowEdit:
             pnlEdit.Visible = true;
             hlEdit.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(TabId, "", "edit=" + ControlOrder, AttachQS);
             break;
         case EControlCase.Edit:
             TheText.Visible = false;
             btnSave.Visible = true;
             btnCancel.Visible = true;
             pnlRichTextbox.Visible = true;
             if (t != null)
                 hdnrichtext.Value = TheText.Text;
             break;
         case EControlCase.ViewAllowTranslate:
             pnlOriginalText.Visible = true;
             if (t != null)
             {
                 pnlOriginalText.Visible = true;
                 lblCurrentText.Visible = true;
                 if (t.CultureCodeStatus == ECultureCodeStatus.GoogleTranslated)
                 {
                     pnlTranslateFromGoogle.Visible = true;
                     hlTranslateFromGoogle.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(TabId, "", "translatecp=" + ControlOrder, AttachQS);
                     btnGoogleOK.Visible = true;
                 }
                 else
                 {
                     pnlTranslateFromHuman.Visible = true;
                     hlTranslateFromHuman.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(TabId, "", "translatecp=" + ControlOrder, AttachQS);
                 }
             }
             translatedFrom = bh.GetCurrentVersionText(CreatedInCultureCode, ItemId, ItemType);
             if (translatedFrom != null)
                 ltOriginalText.Text = translatedFrom.Text;
             break;
         case EControlCase.Translate:
             pnlOriginalText.Visible = true;
             btnSave.Visible = true;
             btnCancel.Visible = true;
             pnlRichTextbox.Visible = true;
             lblCurrentText.Visible = true;
             TheText.Visible = false;
             if (t != null)
                 hdnrichtext.Value = TheText.Text;
             translatedFrom = bh.GetCurrentVersionText(CreatedInCultureCode, ItemId, ItemType);
             if (translatedFrom != null)
                 ltOriginalText.Text = translatedFrom.Text;
             break;
     }
 }
Exemplo n.º 9
0
        protected void btnSaveTitle_Click(object sender, EventArgs e)
        {
            BaseHandler bh = new BaseHandler();
            PluggContainer pc = new PluggContainer(new Localization().CurrentCulture);
            pc.ThePlugg.CreatedByUserId = this.UserId;
            pc.ThePlugg.ModifiedByUserId = this.UserId;
            pc.ThePlugg.PluggId = 0;
            pc.ThePlugg.WhoCanEdit = (EWhoCanEdit)Enum.Parse(typeof(EWhoCanEdit), rdEditPlug.SelectedValue);
            pc.SetTitle(txtTitle.Text);
            pc.SetDescription(txtDescription.Text);

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

            foreach (string StrCmpData in hdcmpData.Value.Split(new string[] { "$#%#$%" }, StringSplitOptions.RemoveEmptyEntries))
            {
                string[] straCmpData = StrCmpData.Split(new string[] { "$$$&$$$" }, StringSplitOptions.RemoveEmptyEntries);

                switch (straCmpData[0])
                {
                    case "RichRichText":
                        PHText RichRichText = new PHText();
                        RichRichText.Text = straCmpData[1];
                        RichRichText.ItemType = ETextItemType.PluggComponentRichRichText;
                        cmpData.Add(RichRichText);
                        break;
                    case "RichText":
                        PHText RichText = new PHText();
                        RichText.Text = straCmpData[1];
                        RichText.ItemType = ETextItemType.PluggComponentRichText;
                        cmpData.Add(RichText);
                        break;
                    case "Label":
                        PHText Label = new PHText();
                        Label.Text = straCmpData[1];
                        Label.ItemType = ETextItemType.PluggComponentLabel;
                        cmpData.Add(Label);
                        break;
                    case "Latex":
                        PHLatex Latex = new PHLatex(straCmpData[1], new Localization().CurrentCulture,ELatexItemType.PluggComponentLatex);
                        cmpData.Add(Latex);
                        break;
                    case "YouTube":
                        Plugghest.Base2.YouTube objYouTube = new Plugghest.Base2.YouTube();
                        string[] strYoutubeval = straCmpData[1].Split(new string[] { "&&&$$&&&" }, StringSplitOptions.RemoveEmptyEntries);
                        objYouTube.YouTubeAuthor = strYoutubeval[3];
                        objYouTube.YouTubeCode = strYoutubeval[2];
                        objYouTube.YouTubeComment = strYoutubeval[5];
                        objYouTube.YouTubeCreatedOn = Convert.ToDateTime(strYoutubeval[4]);
                        objYouTube.YouTubeDuration = Convert.ToInt32(strYoutubeval[1]);
                        objYouTube.YouTubeTitle = strYoutubeval[0];
                        cmpData.Add(objYouTube);
                        break;
                }

            }
            bh.SavePlugg(pc, cmpData);
        }
 protected void btnAdd_Click(object sender, EventArgs e)
 {
     BaseHandler plugghandler = new BaseHandler();
     PluggComponent pc = new PluggComponent();
     pc.ComponentOrder = Order + 1;
     pc.ComponentType = (EComponentType)Enum.Parse(typeof(EComponentType), ddCoponentList.SelectedValue);
     plugghandler.AddComponent(this.PluggContainer, pc);
     //Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(this.TabID, "", new string[] { "edit=1", "language=" + this.CurrentLanguage }));
 }
 protected void btnAdd_Click(object sender, EventArgs e)
 {
     PluggContainer pc = new PluggContainer("en-us", PluggId);
     pc.GetComponentList();
     PluggComponent cmp = new PluggComponent();
     cmp.ComponentOrder = ComponentOrder;
     cmp.ComponentType = (EComponentType)(ddNewComponent.SelectedIndex+1);
     cmp.PluggId = PluggId;
     BaseHandler bh = new BaseHandler();
     bh.AddComponent(pc, cmp);
     Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(TabId, "", "edit=0"));
 }
Exemplo n.º 12
0
 protected void btnGoogleOK_Click(object sender, EventArgs e)
 {
     BaseHandler bh = new BaseHandler();
     PHText t = bh.GetCurrentVersionText(CultureCode, ItemId, ItemType);
     if (t != null)
     {
         t.CultureCodeStatus = ECultureCodeStatus.HumanTranslated;
         t.ModifiedByUserId = UserId;
         bh.SavePhText(t);
         Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(TabId, "", AttachQS));
     }
 }
 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));
 }
Exemplo n.º 14
0
        public void BindTree(int subid)
        {
            BaseHandler objBaseHandler = new BaseHandler();
            List<Subject> SubList = (List<Subject>)objBaseHandler.GetSubjectsAsFlatList(curlan);
            string childName = SubList.Find(x => x.SubjectId == subid).label;
            int id = Convert.ToInt32(SubList.Find(x => x.SubjectId == subid).MotherId);
            while (id != 0)
            {
                Subject newSub = SubList.Find(x => x.SubjectId == id);
                childName = newSub.label + "->" + childName;
                id = Convert.ToInt32(newSub.MotherId);
            }
            lbltree.Text = LabSubjectTxt + ": " + childName;

            var tree = objBaseHandler.GetSubjectsAsTree(curlan);
            JavaScriptSerializer TheSerializer = new JavaScriptSerializer();
            hdnTreeData.Value = TheSerializer.Serialize(tree);
        }
 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));
     }
 }
Exemplo n.º 16
0
        protected void btnOk_Click(object sender, EventArgs e)
        {
            try
            {
                if (txtTitle.Text.Trim() == "")
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "Err", "alert('Please enter title !')", true);
                    return;
                }
                BaseHandler bh = new BaseHandler();
                List<object> cmpData = new List<object>();
                PluggContainer pc = new PluggContainer(new Localization().CurrentCulture);
                pc.ThePlugg.CreatedByUserId = this.UserId;
                pc.ThePlugg.ModifiedByUserId = this.UserId;
                pc.ThePlugg.PluggId = 0;
                pc.SetTitle(txtTitle.Text);
                string subjectStr = Page.Request.QueryString["s"];
                if (subjectStr != null)
                {
                    int subid = Convert.ToInt32(subjectStr);
                    pc.ThePlugg.SubjectId = subid;
                }
                    else
                pc.ThePlugg.SubjectId = 0;

                pc.SetDescription(txtDescription.Text);
                pc.ThePlugg.WhoCanEdit = (EWhoCanEdit)Enum.Parse(typeof(EWhoCanEdit), rdbtnWhoCanEdit.SelectedValue);

                bh.CreateBasicPlugg(pc);
                txtTitle.Text = "";
                txtDescription.Text = "";
                Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "Success", "alert('New Plugg is created successfully')", true);
            }
            catch (Exception ex)
            {
                Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "Error", "alert('Error : " + ex.Message + "')", true);
            }
        }
Exemplo n.º 17
0
 public void BindTree()
 {
     BaseHandler bh = new BaseHandler();
     var tree = bh.GetCoursePluggsAsTree(CourseId, Language);
     if(tree.Count() == 0)
     {
         if (Page.Request.QueryString["edit"] == "add")
         {
             btnAddAfter.Visible = false;
             btnAddBefore.Visible = false;
             btnAddChild.Visible = false;
             btnAdd.Visible = true;
         }
         else
         {
             lblNoCP.Visible = true;
             btnRemovePluggs.Enabled = false;
             btnReorder.Enabled = false;
         }
     }
     //JavaScriptSerializer TheSerializer = new JavaScriptSerializer();
     //hdnTreeData.Value = TheSerializer.Serialize(tree);
     hdnTreeData.Value = Newtonsoft.Json.JsonConvert.SerializeObject(tree);
 }
Exemplo n.º 18
0
        protected void btnOk_Click(object sender, EventArgs e)
        {
            try
            {
                if (txtTitle.Text.Trim() == "")
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "Err", "alert('Please enter title !')", true);
                    return;
                }
                BaseHandler bh = new BaseHandler();
                List<object> cmpData = new List<object>();
                PluggContainer pc = new PluggContainer(new Localization().CurrentCulture);
                //pc.ThePlugg.CreatedByUserId = this.UserId;
                //pc.ThePlugg.ModifiedByUserId = this.UserId;
                pc.ThePlugg.PluggId = 0;
                pc.SetTitle(txtTitle.Text);

                //pc.SetDescription(txtDescription.Text);

                PHText RichRichText = new PHText();
                RichRichText.ItemType = ETextItemType.PluggComponentRichRichText;
                cmpData.Add(RichRichText);

                Plugghest.Base2.YouTube objYouTube = new Plugghest.Base2.YouTube();
                cmpData.Add(objYouTube);

                bh.SavePlugg(pc, cmpData);

                txtTitle.Text = "";
                Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "Success", "alert('New Plugg is created successfully')", true);
            }
            catch (Exception ex)
            {
                Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "Error", "alert('Error : " + ex.Message + "')", true);
            }
        }
Exemplo n.º 19
0
 ///<summary>
 /// Load the Description in the CultureCode language from DB. You must set CourseId and CultureCode to get the Description
 ///</summary>
 public void LoadDescription()
 {
     if (TheCourse == null || TheCourse.CourseId == 0 || CultureCode == null)
         throw new Exception("Cannot load Description. Need CourseId and CultureCode");
     BaseHandler bh = new BaseHandler();
     TheDescription = bh.GetCurrentVersionText(CultureCode, TheCourse.CourseId, ETextItemType.CourseDescription);
 }
Exemplo n.º 20
0
 ///<summary>
 /// Load the title in the CultureCode language from DB. You must set PluggId and CultureCode to get the Title
 ///</summary>
 public void LoadTitle()
 {
     if (ThePlugg == null || ThePlugg.PluggId == 0)
         throw new Exception("Cannot load title. Need PluggId");
     BaseHandler bh = new BaseHandler();
     TheTitle = bh.GetCurrentVersionText(CultureCode, ThePlugg.PluggId, ETextItemType.PluggTitle);
 }
Exemplo n.º 21
0
 ///<summary>
 /// Load TheLatexCourseText in the CultureCode language from DB. You must set CourseId and CultureCode to get TheHtmlCourseText
 ///</summary>
 public void LoadTheLatexCourseText()
 {
     if (TheCourse == null || TheCourse.CourseId == 0 || CultureCode == null)
         throw new Exception("Cannot load TheHtmlCourseText. Need CourseId and CultureCode");
     BaseHandler bh = new BaseHandler();
     TheLatexCourseText = bh.GetCurrentVersionLatexText(CultureCode, TheCourse.CourseId, ELatexItemType.CourseLatexText);
 }
Exemplo n.º 22
0
 ///<summary>
 /// Loads all the Pluggs in the CultureCode language from DB. You must set CourseId and CultureCode to get the Pluggs
 ///</summary>
 public void LoadPluggs()
 {
     BaseHandler bh = new BaseHandler();
     ThePluggs = bh.GetCoursePluggsAsTree(TheCourse.CourseId, CultureCode);
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            string coursePageName = ((DotNetNuke.Framework.CDefault)this.Page).Title;
            coursePageName = coursePageName.Replace("C", "");
            CourseId = Convert.ToInt32(coursePageName);
            CultureCode = (Page as DotNetNuke.Framework.PageBase).PageCulture.Name;
            BaseHandler bh = new BaseHandler();
            cc = new CourseContainer(CultureCode, CourseId);
            IsAuthorized = ((this.UserId != -1 && cc.TheCourse.WhoCanEdit == EWhoCanEdit.Anyone) || cc.TheCourse.CreatedByUserId == this.UserId || (UserInfo.IsInRole("Administator")));

            if (Request.Form["__EVENTTARGET"] == "btnWhoCanEdit")
            {
                // Fire event
                btnWhoCanEdit_Click(this, new EventArgs());
            }

            if (Request.Form["__EVENTTARGET"] == "btnListed")
            {
                // Fire event
                btnListed_Click(this, new EventArgs());
            }

            UserController uc = new UserController();
            UserInfo u = uc.GetUser(PortalId, cc.TheCourse.CreatedByUserId);
            hlCreatedBy.Text = u.DisplayName;
            hlCreatedBy.NavigateUrl = DotNetNuke.Common.Globals.UserProfileURL(cc.TheCourse.CreatedByUserId);
            lbltheCreatedOn.Text = cc.TheCourse.CreatedOnDate.ToString();
            rblWhoCanEdit.Items.Clear();
            rblWhoCanEdit.Items.Add("Anyone");
            rblWhoCanEdit.Items.Add("Only me");
            rblWhoCanEdit.SelectedValue = "Anyone";
            switch (cc.TheCourse.WhoCanEdit)
            {
                case EWhoCanEdit.Anyone:
                    lbltheWhoCanEdit.Text = "Anyone";
                    break;
                case EWhoCanEdit.OnlyMe:
                    lbltheWhoCanEdit.Text = "Only me";
                    rblWhoCanEdit.SelectedValue = "Only me";
                    break;
                case EWhoCanEdit.NotSet :
                    lbltheWhoCanEdit.Text = "Not set";
                    break;
            }
            rblListed.Items.Clear();
            rblListed.Items.Add(Localization.GetString("Listed.Text", this.LocalResourceFile));
            rblListed.Items.Add(Localization.GetString("NotListed.Text", this.LocalResourceFile));
            rblListed.SelectedIndex = 0;

            if (cc.TheCourse.IsListed)
                lblTheListed.Text = "Yes";
            else
            {
                lblTheListed.Text = "No";
                rblListed.SelectedIndex = 1;
            }
            if (cc.TheCourse.CreatedByUserId == this.UserId)
            {
                btnWhoCanEdit.Visible = true;
                btnListed.Visible = true;
            }
            cc.LoadDescription();
            if (cc.TheDescription != null)
                lbltheDespription.Text = cc.TheDescription.Text;
            else
                lbltheDespription.Text = "-";

            if(cc.TheCourse.CreatedByUserId == this.UserId || UserInfo.IsInRole("Administator"))
            {
                btnDelete.Visible = true;
            }
        }
Exemplo n.º 24
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;
            //    }
            //}
        }
Exemplo n.º 25
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 }));
        }
Exemplo n.º 26
0
        protected void btnSaveRt_Click(object sender, EventArgs e)
        {
            BaseHandler bh = new BaseHandler();
            PHText phText = this.PHText;

            phText.Text = hdnrichtext.Value;
            phText.ModifiedByUserId = this.UserID;
            phText.CultureCodeStatus = ECultureCodeStatus.HumanTranslated;
            bh.SavePhText(phText);
            Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(this.TabID, "", new string[] { "edit=1", "language=" + this.CurrentLanguage }));
        }
Exemplo n.º 27
0
 public string getSubjectByID(int subjectId)
 {
     if (subjectId == 0 || subjectId == -1)
         return "No subject";
     BaseHandler bh = new BaseHandler();
     return bh.GetSubjectString("en-US", subjectId);
 }
Exemplo n.º 28
0
 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)";
 }
Exemplo n.º 29
0
        protected void btnSaveRRt_Click(object sender, EventArgs e)
        {
            BaseHandler bh = new BaseHandler();
            PHText objPHtext = this.PHText; //new PHText(System.Net.WebUtility.HtmlDecode(richrichtext.Text), this.CurrentLanguage, ETextItemType.PluggComponentRichRichText);
            objPHtext.Text = richrichtext.Text;
            objPHtext.ModifiedByUserId = this.UserID;
            objPHtext.CultureCodeStatus = ECultureCodeStatus.HumanTranslated;
            bh.SavePhText(objPHtext);

            Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(this.TabID, "", new string[] { "edit=1", "language=" + this.CurrentLanguage }));
        }
Exemplo n.º 30
0
        protected void btnSaveRRt_Click(object sender, EventArgs e)
        {
            List<PluggComponent> comps = this.PluggContainer.GetComponentList();
            PluggComponent cToAdd = comps.Find(x => x.PluggComponentId == this.ComponentID);
            BaseHandler bh = new BaseHandler();

            var comtype = cToAdd.ComponentType;
            PHLatex latex = bh.GetCurrentVersionLatexText(this.CurrentLanguage, this.ComponentID, ELatexItemType.PluggComponentLatex);
            latex.CultureCodeStatus = ECultureCodeStatus.GoogleTranslated;
            latex.ItemId = this.ComponentID;
            latex.CreatedByUserId = this.UserID;
            latex.Text = System.Net.WebUtility.HtmlDecode(richrichtext.Text);
            //bh.SaveLatexText(latex);
            bh.SaveLatexTextInAllCc(latex);

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