Ejemplo n.º 1
0
 public BlogController(BlogData data)
 {
     _data = data;
 }
Ejemplo n.º 2
0
        public HttpResponseMessage UpdateBlog(HttpRequestMessage request)
        {
            var stringdata = request.Content.ReadAsStringAsync().Result;

            if (stringdata == null)
            {
                return(new HttpResponseMessage(HttpStatusCode.BadRequest)
                {
                    Content = new StringContent("Post data is empty")
                });
            }
            else
            {
                string externaluserid = "";
                Guid   externalid     = new Guid();
                var    blogdata       = JsonConvert.DeserializeObject <BlogWrapper>(stringdata);
                if (editService.GetGMapsMarker().Count >= 0)
                {
                    blogdata.blog.gmapsMarker = editService.GetGMapsMarker();
                }

                var updateBlog = blogdata.blog;
                ApplicationDbContext context = new ApplicationDbContext();
                var user = context.Users.Find(User.Identity.GetUserId());
                int id   = editService.GetCurrentBlogId();
                //delete old blog
                if (context.BlogDatas.Any(b => b.ApplicationUserId == user.Id && b.BlogDataId == id))
                {
                    var oldblog = context.BlogDatas.Where(b => b.ApplicationUserId == user.Id && b.BlogDataId == id).ToList().Single();
                    if (oldblog != null)
                    {
                        //keep external links
                        externaluserid = oldblog.ExternalUser;
                        externalid     = oldblog.ExternalId;

                        //delete old blog
                        context.BlogDatas.Remove(oldblog);
                        context.SaveChanges();
                    }
                }

                List <TextModel>        texts       = new List <TextModel>();
                List <ImageModel>       images      = new List <ImageModel>();
                List <VideoModel>       videos      = new List <VideoModel>();
                List <GalleryModel>     gallerys    = new List <GalleryModel>();
                List <GMapsMarkerModel> gmapsmarker = new List <GMapsMarkerModel>();
                int textExisting          = 0;
                var stillexistingelements = editService.Retrieve();

                //old data, that wasnt deleted, add first
                foreach (var img in stillexistingelements)
                {
                    if (img is TextElement)
                    {
                        var text = img as TextElement;
                        texts.Add(new TextModel {
                            Text = text.value, Position = text.position
                        });
                        textExisting++;
                    }
                    else
                    if (img is ImageElement)
                    {
                        var image = img as ImageElement;

                        images.Add(new ImageModel {
                            Base64 = image.base64, Position = image.position
                        });
                    }
                    else if (img is GalleryElement)
                    {
                        var gallery      = img as GalleryElement;
                        var galleryImage = new List <GalleryImageModel>();
                        gallery.Images.ForEach(image => { galleryImage.Add(new GalleryImageModel {
                                Base64 = image.base64
                            }); });
                        gallerys.Add(new GalleryModel {
                            Position = gallery.position, ClassName = gallery.ClassName, GalleryImageModels = galleryImage
                        });
                    }
                    else if (img is VideoElement)
                    {
                        var video = img as VideoElement;

                        videos.Add(new VideoModel {
                            Source = video.Src, Position = video.position
                        });
                    }
                }

                //to match the array indexing start at 0
                textExisting--;

                while (textExisting >= 0)
                {
                    updateBlog.text.RemoveAt(textExisting);
                    textExisting--;
                }

                //new data added trough drag n drop
                int alreadyfiledPositions = stillexistingelements.Count;

                foreach (var text in updateBlog.text)
                {
                    texts.Add(new TextModel {
                        Text = text.value, Position = text.position + alreadyfiledPositions
                    });
                }

                //add image and slideshow data into elements

                List <Element> imageElements = mapImages(editService.GetImages(), updateBlog.images.ToList(), editService.GetGallery());


                foreach (var img in imageElements)
                {
                    if (img is ImageElement)
                    {
                        var image = img as ImageElement;
                        if (image.base64 != null && image.position != 0)
                        {
                            images.Add(new ImageModel {
                                Base64 = image.base64, Position = image.position + alreadyfiledPositions
                            });
                        }
                    }
                    else if (img is GalleryElement)
                    {
                        var gallery      = img as GalleryElement;
                        var galleryImage = new List <GalleryImageModel>();
                        gallery.Images.ForEach(image => { galleryImage.Add(new GalleryImageModel {
                                Base64 = image.base64
                            }); });
                        gallerys.Add(new GalleryModel {
                            Position = gallery.position + alreadyfiledPositions, ClassName = gallery.ClassName, GalleryImageModels = galleryImage
                        });
                    }
                }



                //add video into elements
                foreach (var video in updateBlog.videos)
                {
                    videos.Add(new VideoModel {
                        Source = video.src, Position = video.position + alreadyfiledPositions
                    });
                }


                foreach (var marker in updateBlog.gmapsMarker)
                {
                    gmapsmarker.Add(new GMapsMarkerModel {
                        Latitude = marker.Latitude, Longitude = marker.Longitude
                    });
                }

                //add everything to db

                BlogData blog = new BlogData {
                    ApplicationUser = user, Title = blogdata.blog.titel, Subtitle = blogdata.blog.subtitel, GalleryModels = gallerys, ImageModels = images, TextModels = texts, GMapsMarkerModels = gmapsmarker, ExternalId = externalid, ExternalUser = externaluserid, IsVisibleFromOutside = false, VideoModels = videos
                };
                context.BlogDatas.Add(blog);

                context.SaveChanges();
                context.Dispose();
                editService.Clear();


                return(new HttpResponseMessage(HttpStatusCode.OK));
            }
        }
Ejemplo n.º 3
0
    private void Display_ViewFolder()
    {
        Collection cPreApproval;
        bool isBlog;
        isBlog = System.Convert.ToBoolean(_FolderType == 1 ? true : false);
        if (isBlog)
        {
            _BlogData = _ContentApi.BlogObject(_FolderData);
            _FolderData.PublishPdfEnabled = false;
            phSubjects.Visible = true;
            phBlogRoll.Visible = true;
            phDescription.Visible = false;
        }

        _PermissionData = _ContentApi.LoadPermissions(_Id, "folder", 0);

        ltrTypes.Text = _MessageHelper.GetMessage("Smart Forms txt");
        //Sitemap Path
        ltInheritSitemapPath.Text = _MessageHelper.GetMessage("lbl Inherit Parent Configuration");

        ViewFolderToolBar();

        if (isBlog)
        {
            phBlogProperties1.Visible = true;
            if (_BlogData.Visibility == Ektron.Cms.Common.EkEnumeration.BlogVisibility.Public)
            {
                td_vf_visibilitytxt.InnerHtml = _MessageHelper.GetMessage("lbl public");
            }
            else
            {
                td_vf_visibilitytxt.InnerHtml = _MessageHelper.GetMessage("lbl private");
            }

            td_vf_nametxt.InnerHtml = _BlogData.Name;
            td_vf_titletxt.InnerHtml = _BlogData.Title;
        }
        else
        {
            phFolderProperties1.Visible = true;
            td_vf_foldertxt.InnerHtml = _FolderData.Name;
        }

        td_vf_idtxt.InnerHtml = _Id.ToString();

        if (isBlog)
        {
            phBlogProperties2.Visible = true;
            string sEnabled = "";
            string sModerate = "";
            string sRequire = "";
            string sNotify = "";
            if (_BlogData.EnableComments)
            {
                sEnabled = "checked=\"checked\" ";
            }
            if (_BlogData.ModerateComments)
            {
                sModerate = "checked=\"checked\" ";
            }
            if (_BlogData.RequiresAuthentication)
            {
                sRequire = "checked=\"checked\" ";
            }
            if (_BlogData.NotifyURL != "")
            {
                sNotify = "checked=\"checked\" ";
            }
            td_vf_taglinetxt.InnerHtml = _BlogData.Tagline;
            if (_BlogData.PostsVisible < 0)
            {
                td_vf_postsvisibletxt.InnerHtml = "(selected day)";
            }
            else
            {
                td_vf_postsvisibletxt.InnerHtml += _BlogData.PostsVisible.ToString();
            }
            td_vf_commentstxt.InnerHtml += "<input disabled=\"disabled\" type=\"checkbox\" name=\"enable_comments\" id=\"enable_comments\" " + sEnabled + " />" + _MessageHelper.GetMessage("lbl enable comments");
            td_vf_commentstxt.InnerHtml += "<br />";
            td_vf_commentstxt.InnerHtml += "<input disabled=\"disabled\" type=\"checkbox\" name=\"moderate_comments\" id=\"moderate_comments\" " + sModerate + " />" + _MessageHelper.GetMessage("lbl moderate comments");
            td_vf_commentstxt.InnerHtml += "<br />";
            td_vf_commentstxt.InnerHtml += "<input disabled=\"disabled\" type=\"checkbox\" name=\"require_authentication\" id=\"require_authentication\" " + sRequire + " />" + _MessageHelper.GetMessage("lbl require authentication");

            td_vf_updateservicestxt.InnerHtml += "<input type=\"checkbox\" name=\"notify_url\" id=\"notify_url\" " + sNotify + " disabled=\"disabled\" />" + _MessageHelper.GetMessage("lbl Notify blog");
            td_vf_updateservicestxt.InnerHtml += "<br />";
            td_vf_updateservicestxt.InnerHtml += _BlogData.NotifyURL;
        }
        else
        {
            td_vf_folderdesctxt.InnerHtml = _FolderData.Description;
        }

        if (_FolderData.StyleSheet == "")
        {
            td_vf_stylesheettxt.InnerHtml += _MessageHelper.GetMessage("none specified msg");
        }
        else
        {
            td_vf_stylesheettxt.InnerHtml += _SitePath + _FolderData.StyleSheet;
        }

        if (_FolderData.StyleSheetInherited)
        {
            td_vf_stylesheettxt.InnerHtml += "<div class=\"ektronCaption\">" + _MessageHelper.GetMessage("inherited style sheet msg") + "</div>";
        }
        DrawContentAliasesTable();
        IsContentSearchableSection();
        IsDisplaySettings();
        DrawContentTemplatesTable();
        DrawFolderTaxonomyTable(); //Assigned taxonomy
        long iTmpCaller = _ContentApi.RequestInformationRef.CallerId;
        try
        {
            _ContentApi.RequestInformationRef.CallerId = Ektron.Cms.Common.EkConstants.InternalAdmin;
            _ContentApi.RequestInformationRef.UserId = Ektron.Cms.Common.EkConstants.InternalAdmin;

            AssetConfigInfo[] asset_config = _ContentApi.GetAssetMgtConfigInfo();
            if (asset_config[10].Value.IndexOf("ektron.com") > -1)
            {
                ltrCheckPdfServiceProvider.Text = _MessageHelper.GetMessage("pdf service provider");
            }
            else
            {
                ltrCheckPdfServiceProvider.Text = "";
            }
        }
        catch (Exception ex)
        {
            string _error = ex.Message;
        }
        finally
        {
            _ContentApi.RequestInformationRef.CallerId = iTmpCaller;
            _ContentApi.RequestInformationRef.UserId = iTmpCaller;
        }

        if (_FolderData.PublishPdfEnabled && (Ektron.Cms.Common.EkEnumeration.FolderType)_FolderType != Ektron.Cms.Common.EkEnumeration.FolderType.Calendar)
        {
            if (_FolderData.PublishPdfActive)
            {
                td_vf_pdfactivetxt.InnerHtml += _MessageHelper.GetMessage("publish as pdf");
                ltrCheckPdfServiceProvider.Visible = true;
            }
            else
            {
                td_vf_pdfactivetxt.InnerHtml += _MessageHelper.GetMessage("lbl Publish native format");
                ltrCheckPdfServiceProvider.Visible = false;
            }
        }
        else
        {
            phPublishAsPdf.Visible = false;
        }

        // show domain info
        if (_FolderData.IsDomainFolder)
        {
            phProductionDomain.Visible = true;
            SettingsData settings_list;
            SiteAPI m_refSiteAPI = new SiteAPI();
            CommonApi m_refCommonAPI = new CommonApi();
            Ektron.Cms.Common.EkRequestInformation request_info;
            settings_list = m_refSiteAPI.GetSiteVariables(-1);
            request_info = m_refCommonAPI.RequestInformationRef;

            DomainFolder.Text += "<tr>";
            DomainFolder.Text += "<td class=\"label\">" + _MessageHelper.GetMessage("lbl Staging Domain") + ":</td>";
            DomainFolder.Text += "<td class=\"value\">http://" + _FolderData.DomainStaging + "</td>";
            DomainFolder.Text += "</tr>";
            DomainFolder.Text += "<tr>";
            DomainFolder.Text += "<td class=\"label\">" + _MessageHelper.GetMessage("lbl Production Domain") + ":</td>";
            DomainFolder.Text += "<td class=\"value\">http://" + _FolderData.DomainProduction + "</td>";
            DomainFolder.Text += "</tr>";

        }
        if (_FolderData.IsDomainFolder && _FolderData.ParentId == 0)
        {
            DrawFolderLocaleTaxonomyTable();
        }
        else
        {
            LocaleTaxonomy.Visible = false;
        }

        // show categories if its a blog
        if (isBlog)
        {
            if (!(_BlogData.Categories == null) && _BlogData.Categories.Length > 0)
            {
                for (this._i = 0; this._i <= _BlogData.Categories.Length - 1; this._i++)
                {
                    ltr_vf_categories.Text += _BlogData.Categories[this._i];
                    ltr_vf_categories.Text += "<br/>";
                }
            }
            else
            {
                ltr_vf_categories_lbl.Text = "No subjects";
            }

            if (!(_BlogData.BlogRoll == null) && _BlogData.BlogRoll.Length() > 0)
            {
                for (this._i = 0; this._i <= _BlogData.BlogRoll.Length() - 1; this._i++)
                {
                    Table tRoll = new Table();
                    tRoll.CssClass = "ektronGrid";
                    TableRow tRollRow = new TableRow();
                    TableCell tRollCell = new TableCell();
                    //Link Name
                    tRollCell = new TableCell();
                    tRollRow = new TableRow();
                    tRollCell.Text = "Link Name:";
                    tRollCell.CssClass = "label";
                    tRollRow.Controls.Add(tRollCell);
                    tRollCell = new TableCell();
                    tRollCell.Text = _BlogData.BlogRoll.RollItem(this._i).LinkName;
                    tRollCell.CssClass = "readOnlyValue";
                    tRollRow.Controls.Add(tRollCell);
                    tRoll.Controls.Add(tRollRow);
                    //URL
                    tRollCell = new TableCell();
                    tRollRow = new TableRow();
                    tRollCell.Text = "URL:";
                    tRollCell.CssClass = "label";
                    tRollRow.Controls.Add(tRollCell);
                    tRollCell = new TableCell();
                    tRollCell.Text = _BlogData.BlogRoll.RollItem(this._i).URL;
                    tRollCell.CssClass = "readOnlyValue";
                    tRollRow.Controls.Add(tRollCell);
                    tRoll.Controls.Add(tRollRow);
                    //Short Description
                    tRollCell = new TableCell();
                    tRollRow = new TableRow();
                    tRollCell.Text = "Short Description:";
                    tRollCell.CssClass = "label";
                    tRollRow.Controls.Add(tRollCell);
                    tRollCell = new TableCell();
                    tRollCell.Text = _BlogData.BlogRoll.RollItem(this._i).ShortDescription;
                    tRollCell.CssClass = "readOnlyValue";
                    tRollRow.Controls.Add(tRollCell);
                    tRoll.Controls.Add(tRollRow);
                    //Relationship
                    tRollCell = new TableCell();
                    tRollRow = new TableRow();
                    tRollCell.Text = "Relationship:";
                    tRollCell.CssClass = "label";
                    tRollRow.Controls.Add(tRollCell);
                    tRollCell = new TableCell();
                    tRollCell.Text = _BlogData.BlogRoll.RollItem(this._i).Relationship;
                    tRollCell.CssClass = "readOnlyValue";
                    tRollRow.Controls.Add(tRollCell);
                    tRoll.Controls.Add(tRollRow);
                    lbl_vf_roll.Controls.Add(tRoll);

                    Literal spacer = new Literal();
                    spacer.Text = "<div class=\'ektronTopSpace\'></div>";
                    lbl_vf_roll.Controls.Add(spacer);
                }
            }
        }

        if (_SettingsData.EnablePreApproval)
        {
            phPreapprovalGroup.Visible = true;
            cPreApproval = _ContentApi.EkContentRef.GetFolderPreapprovalGroup(_Id);
            if (-1 == Convert.ToInt32(cPreApproval["PreApprovalGroupID"]))
            {
                td_vf_preapprovaltxt.InnerHtml += cPreApproval["UserGroupName"] + " (Inherited)";
            }
            else if (0 == Convert.ToInt32(cPreApproval["PreApprovalGroupID"]))
            {
                td_vf_preapprovaltxt.InnerHtml += "(None)";
            }
            else
            {
                td_vf_preapprovaltxt.InnerHtml += cPreApproval["PreApprovalGroup"];
            }
        }

        // display replication settings for folder
        if (_ContentApi.RequestInformationRef.EnableReplication)
        {
            bool bShowReplicationMethod = true;
            if (_FolderData.ParentId != 0 && ((Ektron.Cms.Common.EkEnumeration.FolderType)_FolderType == Ektron.Cms.Common.EkEnumeration.FolderType.Blog || (Ektron.Cms.Common.EkEnumeration.FolderType)_FolderType == Ektron.Cms.Common.EkEnumeration.FolderType.DiscussionForum))
            {
                FolderData tmp_folder_data = null;
                tmp_folder_data = this._ContentApi.EkContentRef.GetFolderById(_FolderData.ParentId);
                if ((Ektron.Cms.Common.EkEnumeration.FolderType)tmp_folder_data.FolderType == Ektron.Cms.Common.EkEnumeration.FolderType.Community)
                {
                    bShowReplicationMethod = false;
                }
            }
            if (bShowReplicationMethod)
            {
                ReplicationMethod.Text = "<tr><td>&nbsp;</td></tr><tr><td class=\"label\">" + _MessageHelper.GetMessage("lbl folderdynreplication") + "</td></tr><tr><td>";
                if (_FolderData.ReplicationMethod == 1)
                {
                    ReplicationMethod.Text += _MessageHelper.GetMessage("replicate folder contents");
                }
                else
                {
                    ReplicationMethod.Text += _MessageHelper.GetMessage("generic No");
                }
                ReplicationMethod.Text += "	</td></tr>";
            }
        }

        // Show Custom-Field folder assignments:
        CustomFieldsApi customFieldsApi = new CustomFieldsApi();
        if (_ContentLanguage == Ektron.Cms.Common.EkConstants.CONTENT_LANGUAGES_UNDEFINED)
        {
            customFieldsApi.ContentLanguage = _ContentApi.DefaultContentLanguage;
        }
        else
        {
            customFieldsApi.ContentLanguage = _ContentLanguage;
        }
        litMetadata.Text = customFieldsApi.GetEditableCustomFieldAssignments(_Id, false);
        customFieldsApi = null;
        DisplaySitemapPath();
        DisplaySubscriptionInfo();
        DrawContentTypesTable();
        if (_FolderType == 2) //OrElse m_intFolderId = 0 Avoiding root to be site aliased
        {
            phSiteAlias.Visible = true;
            DisplaySiteAlias();
        }
        Showpane();
    }
Ejemplo n.º 4
0
    private void Display_EditFolder()
    {
        TemplateData[] template_data;
        XmlConfigData[] xmlconfig_data;
        bool isBlog = System.Convert.ToBoolean(_FolderType == 1);
        int i = 0;

        ltInheritSitemapPath.Text = _MessageHelper.GetMessage("lbl inherit from parent");

        _PermissionData = _ContentApi.LoadPermissions(_Id, "folder", 0);

        ltrTypes.Text = _MessageHelper.GetMessage("Smart Forms txt");

        if (isBlog)
        {
            _BlogData = _ContentApi.BlogObject(_FolderData);
            _IsUserBlog = _ContentApi.IsUserBlog(_BlogData.Id);
            _FolderData.PublishPdfEnabled = false;
            EditFolderToolBar();
            phSubjects.Visible = true;
            phBlogRoll.Visible = true;
            phDescription.Visible = false;
        }
        else
        {
            EditFolderToolBar();
        }

        template_data = _ContentApi.GetAllTemplates("TemplateFileName");
        xmlconfig_data = _ContentApi.GetAllXmlConfigurations("title");

        oldfolderdescription.Value = Server.HtmlDecode(_FolderData.Description);
        folderdescription.Value = Server.HtmlDecode(_FolderData.Description);
        folder_id.Value = _FolderData.Id.ToString();
        if (_Id == 0)
        {
            phFolderProperties1.Visible = true;
            lit_ef_folder.Text = _FolderData.Name + "<input type=\"hidden\" value=\"" + _FolderData.Name + "\" name=\"foldername\"/>";
            lit_ef_folder.Text += "<input type=\"hidden\" value=\"" + _FolderData.Name + "\" name=\"oldfoldername\"/>";
        }
        else
        {
            if (isBlog)
            {
                phBlogProperties1.Visible = true;
                phBlogProperties2.Visible = true;
                td_vf_nametxt.InnerHtml = "<input type=\"text\" maxlength=\"75\" size=\"30\" value=\"" + _FolderData.Name + "\" name=\"foldername\" />";
                td_vf_nametxt.InnerHtml += "<input type=\"hidden\" value=\"" + EkFunctions.HtmlEncode(_FolderData.Name) + "\" name=\"oldfoldername\" id=\"oldfoldername\" />";
                td_vf_nametxt.InnerHtml += "<input type=\"hidden\" name=\"isblog\" id=\"isblog\" value=\"true\"/>";
                td_vf_titletxt.InnerHtml = "<input type=\"text\" maxlength=\"75\" size=\"30\" value=\"" + _BlogData.Title + "\" name=\"blogtitle\" id=\"blogtitle\" />";
                td_vf_visibilitytxt.InnerHtml = "<select name=\"blog_visibility\" id=\"blog_visibility\">";
                if (_BlogData.Visibility == Ektron.Cms.Common.EkEnumeration.BlogVisibility.Public)
                {
                    td_vf_visibilitytxt.InnerHtml += "<option value=\"0\" selected>" + _MessageHelper.GetMessage("lbl public") + "</option>";
                    td_vf_visibilitytxt.InnerHtml += "<option value=\"1\">" + _MessageHelper.GetMessage("lbl private") + "</option>";
                }
                else
                {
                    td_vf_visibilitytxt.InnerHtml += "<option value=\"0\">" + _MessageHelper.GetMessage("lbl public") + "</option>";
                    td_vf_visibilitytxt.InnerHtml += "<option value=\"1\" selected>" + _MessageHelper.GetMessage("lbl private") + "</option>";
                }
                td_vf_visibilitytxt.InnerHtml += "</select>";
                tagline.Value = Server.HtmlDecode(_BlogData.Tagline);
                if (_BlogData.PostsVisible < 0)
                {
                    td_vf_postsvisibletxt.InnerHtml = "<input type=\"text\" name=\"postsvisible\" id=\"postsvisible\" value=\"\" size=\"1\" maxlength=\"3\"/>";
                }
                else
                {
                    td_vf_postsvisibletxt.InnerHtml = "<input type=\"text\" name=\"postsvisible\" id=\"postsvisible\" value=\"" + _BlogData.PostsVisible.ToString() + "\" size=\"1\" maxlength=\"3\"/>";
                }
                td_vf_postsvisibletxt.InnerHtml += "<div class=\"ektronCaption\">"+ _MessageHelper.GetMessage("Post Visible warning")+"</div>";
                if (_BlogData.EnableComments == true)
                {
                    td_vf_commentstxt.InnerHtml += "<input type=\"checkbox\" name=\"enable_comments\" id=\"enable_comments\" checked=\"checked\" onclick=\"UpdateBlogCheckBoxes();\" />" + _MessageHelper.GetMessage("lbl enable comments");
                    td_vf_commentstxt.InnerHtml += "<br />";
                    if (_BlogData.ModerateComments)
                    {
                        td_vf_commentstxt.InnerHtml += "<input type=\"checkbox\" name=\"moderate_comments\" id=\"moderate_comments\" checked=\"checked\" />" + _MessageHelper.GetMessage("lbl moderate comments");
                    }
                    else
                    {
                        td_vf_commentstxt.InnerHtml += "<input type=\"checkbox\" name=\"moderate_comments\" id=\"moderate_comments\" />"+ _MessageHelper.GetMessage("lbl moderate comments");
                    }
                    td_vf_commentstxt.InnerHtml += "<br />";
                    if (_BlogData.RequiresAuthentication)
                    {
                        td_vf_commentstxt.InnerHtml += "<input type=\"checkbox\" name=\"require_authentication\" id=\"require_authentication\" checked=\"checked\" />" + _MessageHelper.GetMessage("lbl require authentication");
                    }
                    else
                    {
                        td_vf_commentstxt.InnerHtml += "<input type=\"checkbox\" name=\"require_authentication\" id=\"require_authentication\" />" + _MessageHelper.GetMessage("lbl require authentication");
                    }
                }
                else
                {
                    td_vf_commentstxt.InnerHtml += "<input type=\"checkbox\" name=\"enable_comments\" id=\"enable_comments\" onclick=\"UpdateBlogCheckBoxes();\" />"+_MessageHelper.GetMessage("lbl enable comments")+"<br />";
                    td_vf_commentstxt.InnerHtml += "<input type=\"checkbox\" name=\"moderate_comments\" id=\"moderate_comments\" disabled=\"disabled\"/>"+ _MessageHelper.GetMessage("lbl moderate comments")+"<br />";
                    td_vf_commentstxt.InnerHtml += "<input type=\"checkbox\" name=\"require_authentication\" id=\"require_authentication\" disabled=\"disabled\"/>" + _MessageHelper.GetMessage("lbl require authentication")+"<br />";
                }
                if (_BlogData.NotifyURL != "")
                {
                    td_vf_updateservicestxt.InnerHtml += "<input type=\"checkbox\" name=\"chknotify_url\" id=\"chknotify_url\" checked=\"checked\" />"+ _MessageHelper.GetMessage("lbl Notify blog");
                    td_vf_updateservicestxt.InnerHtml += "<br />";
                    td_vf_updateservicestxt.InnerHtml += "<input type=\"text\" maxlength=\"75\" size=\"40\" value=\"" + EkFunctions.HtmlEncode(_BlogData.NotifyURL) + "\" name=\"notify_url\" id=\"notify_url\"/>";
                }
                else
                {
                    td_vf_updateservicestxt.InnerHtml += "<input type=\"checkbox\" name=\"chknotify_url\" id=\"chknotify_url\" />" + _MessageHelper.GetMessage("lbl Notify blog");
                    td_vf_updateservicestxt.InnerHtml += "<br />";
                    td_vf_updateservicestxt.InnerHtml += "<input type=\"text\" maxlength=\"75\" size=\"40\" value=\"\" name=\"notify_url\" id=\"notify_url\"/>";
                }
            }
            else
            {
                phFolderProperties1.Visible = true;
                lit_ef_folder.Text = "<input type=\"text\" maxlength=\"100\" size=\"75\" value=\"" + _FolderData.Name + "\" name=\"foldername\"><input type=\"hidden\" value=\"\" name=\"oldfoldername\" id=\"oldfoldername\" />";
            }
        }
        if ((_FolderData.StyleSheetInherited) && (_FolderData.StyleSheet != ""))
        {
            lit_ef_ss.Text = _ContentApi.SitePath + "<input type=\"text\" maxlength=\"255\" size=\"" + (75 - _ContentApi.SitePath.Length) + "\" value=\"\" name=\"stylesheet\" />";
            lit_ef_ss.Text += "<br/>";
            lit_ef_ss.Text += "<span class=\"ektronCaption\">";
            lit_ef_ss.Text += _MessageHelper.GetMessage("inherited style sheet msg") + _ContentApi.SitePath + _FolderData.StyleSheet;
            lit_ef_ss.Text += "</span>";
        }
        else
        {
            lit_ef_ss.Text = _ContentApi.SitePath + "<input type=\"text\" maxlength=\"255\" size=\"" + (75 - _ContentApi.SitePath.Length) + "\" value=\"" + _FolderData.StyleSheet + "\" name=\"stylesheet\" />";
        }
        lit_ef_templatedata.Text = "<input type=\"hidden\" maxlength=\"255\" size=\"" + (75 - _ContentApi.SitePath.Length) + "\" value=\"\" name=\"templatefilename\" id=\"templatefilename\" />";

        DrawContentTemplatesTable();
        DrawFlaggingOptions();
        long iTmpCaller = _ContentApi.RequestInformationRef.CallerId;
        try
        {
            _ContentApi.RequestInformationRef.CallerId = Ektron.Cms.Common.EkConstants.InternalAdmin;
            _ContentApi.RequestInformationRef.UserId = Ektron.Cms.Common.EkConstants.InternalAdmin;

            AssetConfigInfo[] asset_config = _ContentApi.GetAssetMgtConfigInfo();
            if (asset_config[10].Value.IndexOf("ektron.com") > -1)
            {
                ltrCheckPdfServiceProvider.Text = _MessageHelper.GetMessage("pdf service provider");
            }
            else
            {
                ltrCheckPdfServiceProvider.Text = "";
            }
        }
        catch (Exception ex)
        {
            string _error = ex.Message;
        }
        finally
        {
            _ContentApi.RequestInformationRef.CallerId = iTmpCaller;
            _ContentApi.RequestInformationRef.UserId = iTmpCaller;
        }

        if (_FolderData.PublishPdfEnabled && _FolderType != (int)Ektron.Cms.Common.EkEnumeration.FolderType.Calendar)
        {
            phPDF.Visible = true;
            _IsPublishedAsPdf = (string)(_FolderData.PublishPdfActive ? "checked=\"checked\" " : string.Empty);
            this.lblPublishAsPdf.InnerText = _MessageHelper.GetMessage("publish as pdf");
        }
        else
        {
            _IsPublishedAsPdf = string.Empty;
            phPDF.Visible = false;
        }

        // only top level folders can be domain folders and only if not a blog folder already
        CommonApi m_refCommonAPI = new CommonApi();
        Ektron.Cms.Common.EkRequestInformation request_info = m_refCommonAPI.RequestInformationRef;

        if ((_FolderType != 1) && (_FolderData.ParentId == 0) && (_Id != 0))
        {
            SettingsData settings_list;
            SiteAPI m_refSiteAPI = new SiteAPI();

            settings_list = m_refSiteAPI.GetSiteVariables(-1);
            //string schk = "";
            string disdomain = "";
            //if (_FolderData.IsDomainFolder)
            //{
            //    schk = " checked ";
            //}
            //else
            //{
            //    disdomain = " disabled ";
            //}
            if (!_FolderData.IsDomainFolder)
            {
                disdomain = " disabled ";
            }
            if (_FolderType == 2 && LicenseManager.IsFeatureEnable(request_info, Feature.MultiSite))
            {
                // Domain folder checkbox replaced to hidden field.

                //DomainFolder.Text += "<tr><td colspan=""2"">&nbsp;</td></tr><tr><td colspan=""2"" class=""input-box-text"">Multi-Site Domain Configuration:</td></tr>"
                //DomainFolder.Text += "<tr><td colspan=""2""><input type=""checkbox""  disabled= ""true"" name=""IsDomainFolder"" id=""IsDomainFolder""" & schk & " onClick="""
                //If (settings_list.AsynchronousStaging) Then
                //    DomainFolder.Text += "document.forms[0].DomainStaging.disabled = !document.forms[0].IsDomainFolder.checked; "
                //End If
                //DomainFolder.Text += "document.forms[0].DomainProduction.disabled = !document.forms[0].IsDomainFolder.checked;"
                //If (Not request_info.LinkManagement) Then
                //    DomainFolder.Text += " if (document.forms[0].IsDomainFolder.checked) alert('Please set ek_LinkManagement to True in your web.config');"
                //End If
                //DomainFolder.Text += """/><label for=""IsDomainFolder"">" & m_refMsg.GetMessage("alt Domain for this folder") & "</label></td></tr>"

                DomainFolder.Text += "<input type=\"hidden\" name=\"IsDomainFolder\" id=\"IsDomainFolder\" value=\"on\"/>";

                // staging field should only show up on staging servers; production server can see production field
                DomainFolder.Text += "<tr>";
                DomainFolder.Text += "<td class=\"label\"><label for=\"DomainStaging\">" + _MessageHelper.GetMessage("lbl Staging Domain") + ":</label></td>";
                DomainFolder.Text += "<td class=\"value\">http://&nbsp;<input type=\"text\" name=\"DomainStaging\" id=\"DomainStaging\" size=\"50\" value=\"" + _FolderData.DomainStaging + ("\"" + disdomain) + "/></td>";
                DomainFolder.Text += "</tr>";

                DomainFolder.Text += "<tr>";
                DomainFolder.Text += "<td class=\"label\"><label for=\"DomainProduction\">" + _MessageHelper.GetMessage("lbl Production Domain") + ":</label></td>";
                DomainFolder.Text += "<td class=\"value\">http://&nbsp;<input type=\"text\" name=\"DomainProduction\" id=\"DomainProduction\" size=\"50\" value=\"" + _FolderData.DomainProduction + ("\"" + disdomain) + "/></td>";
                DomainFolder.Text += "</tr>";
                if (_FolderData.IsDomainFolder && _FolderData.ParentId == 0)
                {
                    StringBuilder categorydata = new StringBuilder();
                    if ((_FolderData.FolderTaxonomy != null) && _FolderData.FolderTaxonomy.Length > 0)
                    {
                        for (int d = 0; d <= _FolderData.FolderTaxonomy.Length - 1; d++)
                        {
                            if (_SelectedTaxonomyList.Length > 0)
                            {
                                _SelectedTaxonomyList = _SelectedTaxonomyList + "," + _FolderData.FolderTaxonomy[d].TaxonomyId;
                            }
                            else
                            {
                                _SelectedTaxonomyList = _FolderData.FolderTaxonomy[d].TaxonomyId.ToString();
                            }
                        }
                    }
                    _CurrentCategoryChecked = Convert.ToInt32(_FolderData.CategoryRequired);
                    current_category_required.Value = _CurrentCategoryChecked.ToString();
                    inherit_taxonomy_from.Value = _FolderData.TaxonomyInheritedFrom.ToString();
                }
            }
        }

        // handle dynamic replication settings
        if (request_info.EnableReplication && !(_FolderType == (int)Ektron.Cms.Common.EkEnumeration.FolderType.DiscussionForum || _FolderType == (int)Ektron.Cms.Common.EkEnumeration.FolderType.DiscussionBoard))
        {
            bool bShowReplicationMethod = true;
            if (_FolderData.ParentId != 0 && (_FolderType == (int)Ektron.Cms.Common.EkEnumeration.FolderType.Blog))
            {
                // don't show for blogs under community folder
                FolderData tmp_folder_data = null;
                tmp_folder_data = this._ContentApi.EkContentRef.GetFolderById(_FolderData.ParentId);
                if (tmp_folder_data.FolderType == (int)Ektron.Cms.Common.EkEnumeration.FolderType.Community)
                {
                    bShowReplicationMethod = false;
                }
            }
            if (bShowReplicationMethod)
            {
                string schk = "";
                if (_FolderData.ReplicationMethod == 1)
                {
                    schk = " checked";
                }

                if (!_FolderData.IsCommunityFolder)
                {
                    ReplicationMethod.Text = _MessageHelper.GetMessage("lbl folderdynreplication");
                    ReplicationMethod.Text += "<input type=\"checkbox\" name=\"EnableReplication\" id=\"EnableReplication\" value=\"1\"" + schk + " ><label for=\"EnableReplication\"/>" + _MessageHelper.GetMessage("replicate folder contents") + "</label>";
                }
            }
            else
            {
                // if we're not showing it, it means replication is enabled because we're under a parent community folder
                ReplicationMethod.Text = "<input type=\"hidden\" name=\"EnableReplication\" value=\"1\" />";
            }
        }

        // show categories if its a blog
        if (isBlog)
        {
            ltr_vf_categories.Text += "<div id=\"parah\">";
            if (!(_BlogData.Categories == null) && _BlogData.Categories.Length > 0 && _BlogData.Categories[0].Length > 0)
            {
                for (i = 0; i <= _BlogData.Categories.Length - 1; i++)
                {
                    ltr_vf_categories.Text += "<input type=\'text\' id=\'category" + i.ToString() + "\' name=\'category" + i.ToString() + "\' onChange=\'saveValue(" + i.ToString() + ",this.value)\' value=\'" + Strings.Replace((string)(_BlogData.Categories[i].ToString()), "~@~@~", ";", 1, -1, 0).Replace("\'", "&#39;") + "\' maxlength=\'75\' size=\'75\'/> ";
                    ltr_vf_categories.Text += "<a href=\"#Remove\" onclick=\"removeInput(" + i.ToString() + ");return false;\" class=\"button buttonInlineBlock redHover buttonRemove\">" + _MessageHelper.GetMessage("btn remove") + "</a>";
                    ltr_vf_categories.Text += "<div class=\'ektronTopSpace\'></div>";
                    ltr_vf_categories.Text += "<script type=\"text/javascript\">addInputInit(\'" + Strings.Replace((string)(_BlogData.Categories[i].ToString()), "~@~@~", ";", 1, -1, 0).Replace("\'", "\\\'") + "\');</script>";
                    //<p>" & blog_data.Categories(i).ToString() & "</p>"
                }
                ltr_vf_categories.Text += "</div>";
                ltr_vf_categories.Text += "<input type=\"hidden\" id=\"categorylength\" name=\"categorylength\" value=\"" + _BlogData.Categories.Length.ToString() + "\" />";
            }
            else
            {
                ltr_vf_categories.Text += "</div>";
                ltr_vf_categories.Text += "<input type=\"hidden\" id=\"categorylength\" name=\"categorylength\" value=\"0\" />";
            }
            ltr_vf_categories.Text += "<a href=\"#Add\" onclick=\"addInput();return false;\" class=\"button buttonInlineBlock greenHover buttonAdd\">" + this._MessageHelper.GetMessage("lnk add new subject") + "</a>";
            ltr_vf_categories.Text += "<a href=\"#Remove\" onclick=\"deleteInput();return false;\" class=\"button buttonInlineBlock redHover buttonRemove\">" + this._MessageHelper.GetMessage("lnk remove last subject") + "</a>";
            Literal ltrT = new Literal();
            ltrT.Text += "<div id=\"proll\" name=\"proll\">";
            if (!(_BlogData.BlogRoll == null) && _BlogData.BlogRoll.Length() > 0)
            {
                for (i = 0; i <= _BlogData.BlogRoll.Length() - 1; i++)
                {
                    ltrT.Text += "<a href=\"#\" class=\"button buttonInlineBlock redHover buttonRemove\" onClick=\"removeRoll(" + i.ToString() + ")\">Remove Roll Link</a>";
                    ltrT.Text += "<div class=\"ektronTopSpace\"></div>";
                    ltrT.Text += "<table class=\"ektronGrid\">";
                    ltrT.Text += "  <tr>";
                    ltrT.Text += "      <td class=\"label\">Link Name:</td>";
                    ltrT.Text += "      <td class=\"value\"><input name=\"editfolder_linkname" + i.ToString() + "\" type=\"text\" value=\"" + EkFunctions.HtmlEncode(_BlogData.BlogRoll.RollItem(i).LinkName) + "\" size=\"55\" id=\"editfolder_linkname" + i.ToString() + "\" onChange=\"saveRoll(" + i.ToString() + ",this.value,\'linkname\')\" /></td>";
                    ltrT.Text += "  </tr>";
                    ltrT.Text += "  <tr>";
                    ltrT.Text += "      <td class=\"label\">URL:</td>";
                    ltrT.Text += "      <td class=\"value\"><input name=\"editfolder_url" + i.ToString() + "\" type=\"text\" value=\"" + EkFunctions.HtmlEncode(_BlogData.BlogRoll.RollItem(i).URL) + "\" size=\"55\" id=\"editfolder_url" + i.ToString() + "\" onChange=\"saveRoll(" + i.ToString() + ",this.value,\'url\')\" /></td>";
                    ltrT.Text += "  </tr>";
                    ltrT.Text += "  <tr>";
                    ltrT.Text += "      <td class=\"label\">Short Description:</td>";
                    ltrT.Text += "      <td class=\"value\"><input name=\"editfolder_short" + i.ToString() + "\" type=\"text\" value=\"" + EkFunctions.HtmlEncode(_BlogData.BlogRoll.RollItem(i).ShortDescription) + "\" size=\"55\" id=\"editfolder_short" + i.ToString() + "\" onChange=\"saveRoll(" + i.ToString() + ",this.value,\'short\')\" /></td>";
                    ltrT.Text += "  </tr>";
                    ltrT.Text += "  <tr>";
                    ltrT.Text += "      <td class=\"label\">Relationship:</td>";
                    ltrT.Text += "      <td class=\"value\">";
                    ltrT.Text += "          <input name=\"editfolder_rel" + i.ToString() + "\" type=\"text\" value=\"" + EkFunctions.HtmlEncode(_BlogData.BlogRoll.RollItem(i).Relationship) + "\" size=\"45\" id=\"editfolder_rel" + i.ToString() + "\" onChange=\"saveRoll(" + i.ToString() + ",this.value,\'rel\')\" />&nbsp;\"";
                    ltrT.Text += "          <a style=\"padding-top: .25em; padding-bottom: .25em;\" class=\"button buttonInline blueHover buttonEdit\" href=\"#\" onClick=\"window.open(\'blogs/xfnbuilder.aspx?field=editfolder_rel" + i.ToString() + "&id=" + i.ToString() + "\',\'XFNBuilder\',\'location=0,status=0,scrollbars=0,width=500,height=300\');\">Edit</a>";
                    ltrT.Text += "      </td>";
                    ltrT.Text += "  </tr>";
                    ltrT.Text += "</table>";
                    ltrT.Text += "<div class=\"ektronTopSpace\"></div>";
                    ltrT.Text += "<script type=\"text/javascript\">addRollInit(\'" + Strings.Replace(_BlogData.BlogRoll.RollItem(i).LinkName, "\'", "\\\'", 1, -1, 0) + "\',\'" + Strings.Replace(_BlogData.BlogRoll.RollItem(i).URL, "\'", "\\\'", 1, -1, 0) + "\',\'" + Strings.Replace(_BlogData.BlogRoll.RollItem(i).ShortDescription, "\'", "\\\'", 1, -1, 0) + "\',\'" + Strings.Replace(_BlogData.BlogRoll.RollItem(i).Relationship, "\'", "\\\'", 1, -1, 0) + "\');</script>";
                }
            }
            ltrT.Text += "</div>";
            ltrT.Text += "<input type=\"hidden\" id=\"rolllength\" name=\"rolllength\" value=\"" + _BlogData.BlogRoll.Length().ToString() + "\" />";
            ltrT.Text += "<div class=\"ektronTopSpace\"></div>";
            ltrT.Text += "<a href=\"javascript:addRoll()\" class=\"button buttonInlineBlock greenHover buttonAdd\">" + _MessageHelper.GetMessage("lnk add new roll link") + "</a>";
            ltrT.Text += "<a href=\"javascript:deleteRoll()\" class=\"button buttonInlineBlock redHover buttonRemove\">" + _MessageHelper.GetMessage("lnk remove last roll link") + "</a>";
            lbl_vf_roll.Controls.Add(ltrT);
        }

        if (_Id == 0)
        {
            js_ef_focus.Text = "Ektron.ready(function(){document.forms.frmContent.stylesheet.focus();});";
        }
        else
        {
            if (!(Request.QueryString["showpane"] != ""))
            {
                js_ef_focus.Text = "Ektron.ready(function() { document.forms.frmContent.foldername.focus();" + Environment.NewLine;
                js_ef_focus.Text += "   if( $ektron(\'#web_alert_inherit_checkbox\').length > 0 ){" + Environment.NewLine;
                js_ef_focus.Text += "       if( $ektron(\'#web_alert_inherit_checkbox\')[0].checked ){" + Environment.NewLine;
                js_ef_focus.Text += "           $ektron(\'.selectContent\').css(\'display\', \'none\');" + Environment.NewLine;
                js_ef_focus.Text += "           $ektron(\'.useCurrent\').css(\'display\', \'none\');" + Environment.NewLine;
                js_ef_focus.Text += "       } " + Environment.NewLine;
                js_ef_focus.Text += "   } " + Environment.NewLine;
                js_ef_focus.Text += "});" + Environment.NewLine;
            }
            js_ef_focus.Text += "function UpdateBlogCheckBoxes() {" + Environment.NewLine;
            js_ef_focus.Text += "   if (document.forms[0].enable_comments.checked == true) {" + Environment.NewLine;
            js_ef_focus.Text += "       document.forms[0].moderate_comments.disabled = false;" + Environment.NewLine;
            js_ef_focus.Text += "       document.forms[0].require_authentication.disabled = false;" + Environment.NewLine;
            js_ef_focus.Text += "   } else {" + Environment.NewLine;
            js_ef_focus.Text += "       document.forms[0].moderate_comments.disabled = true;" + Environment.NewLine;
            js_ef_focus.Text += "       document.forms[0].require_authentication.disabled = true;" + Environment.NewLine;
            js_ef_focus.Text += "   }" + Environment.NewLine;
            js_ef_focus.Text += "}" + Environment.NewLine;
        }
        DrawFolderTaxonomyTable();
        DisplaySitemapPath();
        DisplayMetadataInfo();
        DisplaySubscriptionInfo();
        DrawContentTypesTable();
        DrawContentAliasesTable();
        IsContentSearchableSection();
        IsDisplaySettings();
        if (_FolderType == 2) //OrElse folder_data.Id = 0 Avoiding sitealias for root.
        {
            phSiteAlias.Visible = true;
            phSiteAlias2.Visible = true;
            DisplaySiteAlias();
        }
        Showpane();

        if (_FolderData.IsCommunityFolder)
        {
            Display_AddCommunityFolder();
        }
    }
        public HttpResponseMessage CreateBlog()
        {
            if (blogService.GetBlog() != null)
            {
                ApplicationDbContext context = new ApplicationDbContext();

                var user = context.Users.Find(User.Identity.GetUserId());

                var data = blogService.GetBlog();
                List <TextModel>        texts       = new List <TextModel>();
                List <ImageModel>       images      = new List <ImageModel>();
                List <VideoModel>       videos      = new List <VideoModel>();
                List <GalleryModel>     gallerys    = new List <GalleryModel>();
                List <GMapsMarkerModel> gmapsmarker = new List <GMapsMarkerModel>();
                foreach (var text in data.Elements)
                {
                    if (text is TextElement)
                    {
                        texts.Add(new TextModel {
                            Text = text.value, Position = text.position
                        });
                    }
                    else if (text is ImageElement)
                    {
                        var image = text as ImageElement;

                        images.Add(new ImageModel {
                            Base64 = image.base64, Position = image.position
                        });
                    }
                    else if (text is GalleryElement)
                    {
                        var gallery      = text as GalleryElement;
                        var galleryImage = new List <GalleryImageModel>();
                        gallery.Images.ForEach(image => { galleryImage.Add(new GalleryImageModel {
                                Base64 = image.base64
                            }); });
                        gallerys.Add(new GalleryModel {
                            Position = gallery.position, ClassName = gallery.ClassName, GalleryImageModels = galleryImage
                        });
                    }
                    else
                    {
                        var video = text as VideoElement;
                        videos.Add(new VideoModel {
                            Source = video.Src, Position = video.position
                        });
                    }
                }

                foreach (var marker in data.GMapsMarker)
                {
                    gmapsmarker.Add(new GMapsMarkerModel {
                        Latitude = marker.Latitude, Longitude = marker.Longitude
                    });
                }



                //add everything to db
                string   externaluserid = String.Format("{0}:{1}:{2}", user.Id, user.LastName, Guid.NewGuid().ToString());
                BlogData blog           = new BlogData {
                    ApplicationUser = user, Title = data.Title, Subtitle = data.Subtitle, GalleryModels = gallerys, ImageModels = images, TextModels = texts, GMapsMarkerModels = gmapsmarker, ExternalId = Guid.NewGuid(), ExternalUser = externaluserid, IsVisibleFromOutside = false, VideoModels = videos
                };
                context.BlogDatas.Add(blog);

                context.SaveChanges();
                context.Dispose();

                //clear service
                blogService.clearData();
                return(new HttpResponseMessage(HttpStatusCode.OK)
                {
                    Content = new StringContent(blog.BlogDataId.ToString())
                });
            }
            else
            {
                return(new HttpResponseMessage(HttpStatusCode.BadRequest)
                {
                    Content = new StringContent("Preview Data service is empty. Please make sure data is pushed to preview or use Post /CreateBlogWithoutPreview")
                });
            }
        }
Ejemplo n.º 6
0
 public ErrorController(BlogData data) : base(data)
 {
 }
Ejemplo n.º 7
0
 public HomeController(BlogData blogData, IBlogUnitOfWork blogUnitOfWork) : base(blogData)
 {
     _blogData  = blogData;
     unitOfWork = blogUnitOfWork;
 }
Ejemplo n.º 8
0
 public ArchiveController(BlogData blogData, IBlogUnitOfWork blogUnitOfWork) : base(blogData)
 {
     _blogUnitOfWork = blogUnitOfWork;
 }
Ejemplo n.º 9
0
    public bool ViewContentByCategory()
    {
        _CurrentUserId = _ContentApi.UserId;
        _AppImgPath = _ContentApi.AppImgPath;
        _AppPath = _ContentApi.AppPath;
        _SitePath = _ContentApi.SitePath;
        _EnableMultilingual = _ContentApi.EnableMultilingual;

        url_action.Text = _PageAction;
        url_id.Text = _Id.ToString();

        if (_FolderData == null)
        {
            _FolderData = _ContentApi.GetFolderById(_Id);
        }
        if (_FolderData == null)
        {
            Response.Redirect((string)("reterror.aspx?info=" + _MessageHelper.GetMessage("com: folder does not exist")), true);
            return false;
        }
        else
        {
            if (_FolderData.XmlConfiguration != null)
            {
                _HasXmlConfig = true;
            }
            _PermissionData = _ContentApi.LoadPermissions(_Id, "folder", 0);
            _FolderType = _FolderData.FolderType;
        }

        //Setting JS Variable for global use through workarea.aspx page.
        pasteFolderType.Text = Convert.ToString(_FolderData.FolderType);
        pasteFolderId.Text = Convert.ToString(_FolderData.Id);
        pasteParentId.Text = Convert.ToString(_FolderData.ParentId);

        if (!string.IsNullOrEmpty(Request.QueryString["IsArchivedEvent"]))
        {
            _IsArchivedEvent = Convert.ToBoolean(Request.QueryString["IsArchivedEvent"]);
            is_archived.Text = Convert.ToString(_IsArchivedEvent);
        }

        _AssetInfoData = _ContentApi.GetAssetSupertypes();
        if ((Ektron.Cms.Common.EkConstants.CMSContentType_Content == Convert.ToInt32(_ContentTypeSelected)) || (Ektron.Cms.Common.EkConstants.CMSContentType_Archive_Content == Convert.ToInt32(_ContentTypeSelected)) || (Ektron.Cms.Common.EkConstants.CMSContentType_XmlConfig == Convert.ToInt32(_ContentTypeSelected)))
        {
            _ContentType = int.Parse(_ContentTypeSelected);
        }
        else if (Ektron.Cms.Common.EkConstants.CMSContentType_Forms == Convert.ToInt32(_ContentTypeSelected) || Ektron.Cms.Common.EkConstants.CMSContentType_Archive_Forms == Convert.ToInt32(_ContentTypeSelected))
        {
            _ContentType = int.Parse(_ContentTypeSelected);
        }
        else if (_ManagedAsset_Min <= Convert.ToInt32(_ContentTypeSelected) && Convert.ToInt32(_ContentTypeSelected) <= _ManagedAsset_Max)
        {
            if (DoesAssetSupertypeExist(_AssetInfoData, int.Parse(_ContentTypeSelected)))
            {
                _ContentType = int.Parse(_ContentTypeSelected);
            }
        }
        else if (Convert.ToInt32(_ContentTypeSelected) == _CMSContentType_AllTypes)
        {
            _ContentType = Ektron.Cms.Common.EkConstants.CMSContentType_NonLibraryForms;
        }
        else if (_IsArchivedEvent == true && (Convert.ToInt32(_ContentTypeSelected) == EkConstants.CMSContentType_Archive_ManagedFiles || Convert.ToInt32(_ContentTypeSelected) == EkConstants.CMSContentType_Archive_OfficeDoc || Convert.ToInt32(_ContentTypeSelected) == EkConstants.CMSContentType_Archive_MultiMedia || Convert.ToInt32(_ContentTypeSelected) == EkConstants.CMSContentType_Archive_Images))
        {
            _ContentType = int.Parse(_ContentTypeSelected);
        }

        _ContentTypeSelected = _ContentType.ToString();

        _PageData = new Microsoft.VisualBasic.Collection();
        _PageData.Add(_Id, "FolderID", null, null);
        if (_FolderData.FolderType == 1) //blog
        {
            _PageData.Add("BlogPost", "OrderBy", null, null);
        }
        else
        {
            _PageData.Add(_OrderBy, "OrderBy", null, null);
        }
        if (Request.QueryString["orderbydirection"] == "desc")
            direction = "desc";
        else
            direction = "asc";
        _OrderByDirection = direction;
        _PageData.Add(_OrderByDirection, "OrderByDirection", null, null);
        _PageData.Add(_ContentLanguage, "m_intContentLanguage", null, null);
        switch ((Ektron.Cms.Common.EkEnumeration.FolderType)_FolderData.FolderType)
        {
            case Ektron.Cms.Common.EkEnumeration.FolderType.Blog:
                _ContentType = Ektron.Cms.Common.EkConstants.CMSContentType_Content;
                _PageData.Add(_ContentType, "ContentType", null, null);
                break;
            case Ektron.Cms.Common.EkEnumeration.FolderType.DiscussionForum:
                _ContentType = Ektron.Cms.Common.EkConstants.CMSContentType_Content;
                _PageData.Add(_ContentType, "ContentType", null, null);
                break;
            default:
                if (_ContentType > 0)
                {
                    _PageData.Add(_ContentType, "ContentType", null, null);
                }
                break;
        }

        if (_ContentType == 1 && _ContentSubTypeSelected != Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.AllTypes)
        {
            _PageData.Add(_ContentSubTypeSelected, "ContentSubType", null, null);
        }

        if ((Ektron.Cms.Common.EkEnumeration.FolderType)(_FolderData.FolderType) == Ektron.Cms.Common.EkEnumeration.FolderType.Calendar)
        {
            calendardisplay.Visible = true;
            pnlThreadedDiscussions.Visible = false;
            if ((Request.QueryString["showAddEventForm"] != null) && Request.QueryString["showAddEventForm"] == "true")
            {
                if (ViewState["AddEventFormDisplay"] == null || System.Convert.ToBoolean(ViewState["AddEventFormDisplay"]) == false) //only show once
                {
                    ViewState.Add("AddEventFormDisplay", true);
                    DateTime startDT = DateTime.Now.Date.AddHours(8);
                    if (Request.QueryString["startDT"] != null)
                    {
                        startDT = DateTime.ParseExact(Request.QueryString["startDT"], "yyyyMMddHHmm", new System.Globalization.CultureInfo(1033));
                    }
                    calendardisplay.ShowInsertForm(startDT);
                }
            }
            if (Request.QueryString["editEvent"] != null)
            {
                if (ViewState["editEvent"] == null || System.Convert.ToBoolean(ViewState["editEvent"]) == false) //only show once
                {
                    ViewState.Add("editEvent", true);
                    calendardisplay.ShowEditForm(Request.QueryString["editEvent"]);
                }
            }

            ScriptManager.RegisterClientScriptBlock(Page, typeof(UserControl), "CalendarCleanup", "try{ window.EditorCleanup(); }catch(ex){}", true);
        }
        _PagingPageSize = _ContentApi.RequestInformationRef.PagingSize;
        if ((Ektron.Cms.Common.EkEnumeration.FolderType)(_FolderData.FolderType) == Ektron.Cms.Common.EkEnumeration.FolderType.Blog)
        {
            _BlogData = _ContentApi.BlogObject(_FolderData);
        }

        //if it's a calendar then we do it on prerender
        if ((Ektron.Cms.Common.EkEnumeration.FolderType)(_FolderData.FolderType) != Ektron.Cms.Common.EkEnumeration.FolderType.Calendar)
        {
            if (_PageAction == "viewarchivecontentbycategory")
            {
                _EkContentCol = _EkContent.GetAllViewArchiveContentInfov5_0(_PageData, _PagingCurrentPageNumber, _PagingPageSize, ref _PagingTotalPagesNumber);
                _NextActionType = "ViewContentByCategory";
            }
            else if (_PageAction == "viewcontentbycategory")
            {
                _EkContentCol = _EkContent.GetAllViewableChildContentInfoV5_0(_PageData, _PagingCurrentPageNumber, _PagingPageSize, ref _PagingTotalPagesNumber);
                _NextActionType = "ViewArchiveContentByCategory";
            }
            //paging goes here

            int i;
            for (i = 0; i <= _EkContentCol.Count - 1; i++)
            {
                if (_EkContentCol.get_Item(i).ContentStatus == "A")
                {
                    _TakeAction = true;
                    _CheckedInOrApproved = true;
                    break;
                }
                else
                {
                    if (_EkContentCol.get_Item(i).ContentStatus == "I")
                    {
                        _CheckedInOrApproved = true;
                    }
                }
            }
        }
        else
        {
            if (_PageAction == "viewarchivecontentbycategory")
            {
                _NextActionType = "ViewContentByCategory";
            }
            else if (_PageAction == "viewcontentbycategory")
            {
                _NextActionType = "ViewArchiveContentByCategory";
            }
        }

        switch ((Ektron.Cms.Common.EkEnumeration.FolderType)(_FolderData.FolderType))
        {
            case Ektron.Cms.Common.EkEnumeration.FolderType.Catalog:
                if (_PageAction == "viewarchivecontentbycategory")
                {
                    _NextActionType = "ViewContentByCategory";
                }
                else if (_PageAction == "viewcontentbycategory")
                {
                    _NextActionType = "ViewArchiveContentByCategory";
                }

                Page.ClientScript.RegisterClientScriptBlock(typeof(string), "objselnotice", "<script type=\"text/javascript\">var objSelSupertype = null;</script>");

                CatalogEntry CatalogManager = new CatalogEntry(_ContentApi.RequestInformationRef);
                System.Collections.Generic.List<EntryData> entryList = new System.Collections.Generic.List<EntryData>();
                Ektron.Cms.Common.Criteria<EntryProperty> entryCriteria = new Ektron.Cms.Common.Criteria<EntryProperty>();

                entryCriteria.AddFilter(EntryProperty.CatalogId, Ektron.Cms.Common.CriteriaFilterOperator.EqualTo, _Id);
                entryCriteria.PagingInfo.CurrentPage = Convert.ToInt32(_PagingCurrentPageNumber.ToString());
                entryCriteria.PagingInfo.RecordsPerPage = _ContentApi.RequestInformationRef.PagingSize;

                if (_ContentApi.RequestInformationRef.ContentLanguage > 0)
                {
                    entryCriteria.AddFilter(EntryProperty.LanguageId, Ektron.Cms.Common.CriteriaFilterOperator.EqualTo, _ContentApi.RequestInformationRef.ContentLanguage);
                }

                switch (this._ContentTypeQuerystringParam)
                {
                    case "0":
                        long[] IdList = new long[3];
                        IdList[0] = Convert.ToInt64(Ektron.Cms.Common.EkEnumeration.CatalogEntryType.Product);
                        IdList[1] = Convert.ToInt64(Ektron.Cms.Common.EkEnumeration.CatalogEntryType.ComplexProduct);
                        entryCriteria.AddFilter(EntryProperty.EntryType, Ektron.Cms.Common.CriteriaFilterOperator.In, IdList);
                        break;
                    case "2":
                        entryCriteria.AddFilter(EntryProperty.EntryType, Ektron.Cms.Common.CriteriaFilterOperator.EqualTo, Ektron.Cms.Common.EkEnumeration.CatalogEntryType.Kit);
                        break;
                    case "3":
                        entryCriteria.AddFilter(EntryProperty.EntryType, Ektron.Cms.Common.CriteriaFilterOperator.EqualTo, Ektron.Cms.Common.EkEnumeration.CatalogEntryType.Bundle);
                        break;
                    case "4":
                        entryCriteria.AddFilter(EntryProperty.EntryType, Ektron.Cms.Common.CriteriaFilterOperator.EqualTo, Ektron.Cms.Common.EkEnumeration.CatalogEntryType.SubscriptionProduct);
                        break;
                }

                if (_PageAction == "viewarchivecontentbycategory")
                {
                    entryCriteria.AddFilter(EntryProperty.IsArchived, Ektron.Cms.Common.CriteriaFilterOperator.EqualTo, true);
                }
                else
                {
                    entryCriteria.AddFilter(EntryProperty.IsArchived, Ektron.Cms.Common.CriteriaFilterOperator.EqualTo, false);
                }
                if (Request.QueryString["orderbydirection"] == "desc")
                    direction = "desc";
                else
                    direction = "asc";
                if(direction == "desc")
                    entryCriteria.OrderByDirection = (EkEnumeration.OrderByDirection)OrderByDirection.Descending;
                else
                entryCriteria.OrderByDirection = (EkEnumeration.OrderByDirection)OrderByDirection.Ascending;

                switch (_OrderBy.ToLower())
                {
                    case "language":
                        entryCriteria.OrderByField = EntryProperty.LanguageId;
                        break;
                    case "id":
                        entryCriteria.OrderByField = EntryProperty.Id;
                        break;
                    case "status":
                        entryCriteria.OrderByField = EntryProperty.ContentStatus;
                        break;
                    case "entrytype":
                        entryCriteria.OrderByField = EntryProperty.EntryType;
                        break;
                    case "sale":
                        entryCriteria.OrderByField = EntryProperty.SalePrice;
                        break;
                    case "list":
                        entryCriteria.OrderByField = EntryProperty.ListPrice;
                        break;
                    default: //"title"
                        entryCriteria.OrderByField = EntryProperty.Title;
                        break;
                }

                entryList = CatalogManager.GetList(entryCriteria);

                for (int j = 0; j <= entryList.Count - 1; j++)
                {
                    if (entryList[j].Status == "A")
                    {
                        _TakeAction = true;
                        _CheckedInOrApproved = true;
                        break;
                    }
                    else
                    {
                        if (entryList[j].Status == "I")
                        {
                            _CheckedInOrApproved = true;
                        }
                    }
                }

                _PagingTotalPagesNumber = System.Convert.ToInt32(entryCriteria.PagingInfo.TotalPages);

                //paging goes here

                ViewCatalogToolBar(entryList.Count);
                Populate_ViewCatalogGrid(_EkContentCol, entryList);
                _ContentType = int.Parse(_ContentTypeSelected);
                break;
            case Ektron.Cms.Common.EkEnumeration.FolderType.Blog:
                _IsMyBlog = System.Convert.ToBoolean((_BlogData.Id == _ContentApi.GetUserBlog(_ContentApi.UserId)) ? true : false);
                Page.ClientScript.RegisterClientScriptBlock(typeof(string), "objselnotice", "<script type=\"text/javascript\">var objSelSupertype = null;</script>");
                if (!string.IsNullOrEmpty(Request.QueryString["ContType"]) && (Request.QueryString["ContType"] == Ektron.Cms.Common.EkConstants.CMSContentType_BlogComments.ToString()))
                {
                    _ContentType = System.Convert.ToInt32(Request.QueryString["ContType"]);
                    _Task = _ContentApi.EkTaskRef;
                    if (!string.IsNullOrEmpty(Request.QueryString["contentid"]))
                    {
                        _PostID = Convert.ToInt64(Request.QueryString["contentid"]);
                        _ContentData = _ContentApi.GetContentById(_PostID, 0);

                        Ektron.Cms.PageRequestData null_EktronCmsPageRequestData = null;
                        _Comments = _Task.GetTasks(_PostID, -1, -1, Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.CMSTaskItemType.BlogCommentItem), "postcomment", 0, ref null_EktronCmsPageRequestData, "");
                    }
                    else
                    {

                        Ektron.Cms.PageRequestData null_EktronCmsPageRequestData2 = null;
                        _Comments = _Task.GetTasks(-1, -1, -1, Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.CMSTaskItemType.BlogCommentItem), "", 0, ref null_EktronCmsPageRequestData2, "");
                    }
                    ViewBlogContentByCategoryToolBar();
                    Populate_ViewBlogCommentsByCategoryGrid(_Comments);
                }
                else
                {
                    Hashtable BlogPostCommentTally = new Hashtable();
                    BlogPostCommentTally = _EkContent.TallyCommentsForBlogPosts(_Id);
                    ViewBlogContentByCategoryToolBar();
                    Populate_ViewBlogPostsByCategoryGrid(_EkContentCol, BlogPostCommentTally);
                }
                break;
            case Ektron.Cms.Common.EkEnumeration.FolderType.Media:
                Page.ClientScript.RegisterClientScriptBlock(typeof(string), "objselnotice", "<script type=\"text/javascript\">var objSelSupertype = null;</script>");
                ViewContentByCategoryToolBar();
                Populate_ViewMediaGrid(_EkContentCol);
                break;
            case Ektron.Cms.Common.EkEnumeration.FolderType.DiscussionBoard:
                Page.ClientScript.RegisterClientScriptBlock(typeof(string), "objselnotice", "<script type=\"text/javascript\">var objSelSupertype = null;</script>");
                ViewDiscussionBoardToolBar();
                Populate_ViewDiscussionBoardGrid();
                break;
            case Ektron.Cms.Common.EkEnumeration.FolderType.DiscussionForum:
                Page.ClientScript.RegisterClientScriptBlock(typeof(string), "objselnotice", "<script type=\"text/javascript\">var objSelSupertype = null;</script>");
                bool bCanModerate = false;
                int itotalpages = 1;
                int icurrentpage = 1;
                if (!string.IsNullOrEmpty(Request.QueryString["ContType"]) && (Request.QueryString["ContType"] == Ektron.Cms.Common.EkConstants.CMSContentType_BlogComments.ToString()))
                {
                    _ContentType = System.Convert.ToInt32(Request.QueryString["ContType"]);
                    if (this._ContentApi.UserId > 0 && ((!(_PermissionData == null) && _PermissionData.CanAddToImageLib == true) || _PermissionData.IsAdmin))
                    {
                        bCanModerate = true;
                    }
                    _DiscussionBoard = _ContentApi.GetTopic(_ContentId, true);
                    if (_DiscussionBoard == null)
                    {
                        throw new Exception("You may not have permission to view this object or it has been deleted.");
                    }
                    _BoardID = _DiscussionBoard.Id;
                    _ContentData = (ContentData)(_DiscussionBoard.Forums[0].Topics[0]);
                    _PermissionData = _ContentApi.LoadPermissions(_ContentId, "content", ContentAPI.PermissionResultType.All);
                    ViewRepliesToolBar();
                    _Task = _ContentApi.EkTaskRef;
                    if (!string.IsNullOrEmpty(Request.QueryString["contentid"]))
                    {
                        _PostID = Convert.ToInt64(Request.QueryString["contentid"]);
                        _Comments = _Task.GetTopicReplies(_PostID, _DiscussionBoard.Id, ref icurrentpage, 0, 0, ref itotalpages, bCanModerate);
                    }
                    else
                    {

                        Ektron.Cms.PageRequestData null_EktronCmsPageRequestData3 = null;
                        _Comments = _Task.GetTasks(-1, -1, -1, Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.CMSTaskItemType.TopicReplyItem), "", 0, ref null_EktronCmsPageRequestData3, "");
                    }
                    Populate_ViewTopicRepliesGrid(_Comments);
                }
                else
                {
                    ArrayList ForumPostCommentTally = new ArrayList();
                    DiscussionBoard thisboard;
                    bool bModerator = false;
                    if (_PermissionData.IsAdmin == true || _PermissionData.CanAddToImageLib == true)
                    {
                        bModerator = true;
                    }
                    thisboard = _EkContent.GetForumbyID(_Id.ToString(), bModerator, _PagingCurrentPageNumber, ref this._PagingTotalPagesNumber, "", this._ContentApi.RequestInformationRef.PagingSize);

                    //paging here

                    ForumPostCommentTally = _EkContent.GetRepliesForTopics(_Id);
                    ViewDiscussionForumToolBar();
                    Populate_ViewForumPostsByCategoryGrid(thisboard.Forums[0].Topics, ForumPostCommentTally);
                }
                break;
            case Ektron.Cms.Common.EkEnumeration.FolderType.Calendar:
                ViewCalendarToolBar();
                break;
            default:
                ViewContentByCategoryToolBar();
                Populate_ViewContentByCategoryGrid(_EkContentCol);
                break;
        }

        Util_SetJs();
        return true;
    }
Ejemplo n.º 10
0
    private void Display_EditControls()
    {
        int intContentLanguage = 1033;
        PermissionData security_lib_data;
        int i = 0;
        bool bEphoxSupport = false;
        string aliasContentType = string.Empty;

        folder_data = null;
        try
        {
            netscape.Value = "";
            language_data = m_refSiteApi.GetLanguageById(m_intContentLanguage);
            ImagePath = language_data.ImagePath;
            BrowserCode = language_data.BrowserCode;
            for (i = 0; i <= Ektron.Cms.Common.EkConstants.m_AssetInfoKeys.Length - 1; i++)
            {
                asset_info.Add(Ektron.Cms.Common.EkConstants.m_AssetInfoKeys[i], "");
            }
            Page.ClientScript.RegisterHiddenField("TaxonomyOverrideId", Convert.ToString(TaxonomyOverrideId));
            if (IsMac && m_SelectedEditControl != "ContentDesigner" && m_strType == "update")
            {
                //We do not support XML content and Form. Check if the content is XML or form and if it is then don't proceed further.
                ContentData cData;
                cData = m_refContApi.GetContentById(m_intItemId, 0);
                if ((cData.Type == 2) || ((cData.XmlConfiguration != null) && (cData.XmlConfiguration.PackageXslt.Length > 0)))
                {
                    bEphoxSupport = false;
                }
                else
                {
                    bEphoxSupport = true;
                }
                if (!bEphoxSupport)
                {
                    //Show not supported message
                    throw (new Exception("Forms and XML Editing is not supported on MAC."));
                }
            }
            if ((Request.QueryString["pullapproval"] == "true") && (m_strType == "update"))
            {
                ret = m_refContent.TakeOwnership(m_intItemId);
            }
            var2 = m_refContent.GetEditorVariablev2_0(m_intItemId, m_strType); //TODO:Verify info param via var1 removed
            security_data = m_refContApi.LoadPermissions(m_intItemId, "content", 0);
            endDateActionSel = GetEndDateActionStrings();
            endDateActionSize = Convert.ToInt32(endDateActionSel["SelectionSize"]);
            if (security_data != null)
            {
                IsAdmin = security_data.IsAdmin;
            }
            active_subscription_list = m_refContApi.GetAllActiveSubscriptions();
            settings_data = m_refSiteApi.GetSiteVariables(CurrentUserID);

            if (m_strType == "update")
            {
                content_edit_data = m_refContApi.GetContentForEditing(m_intItemId);
                UserRights = m_refContApi.LoadPermissions(m_intItemId, "content", ContentAPI.PermissionResultType.Content);
                lContentType = content_edit_data.Type;
                lContentSubType = content_edit_data.SubType;
                if (content_edit_data.Type == 2 || 4 == content_edit_data.Type)
                {
                    bIsFormDesign = true;
                    m_intContentType = 2;
                }
                if (!(content_edit_data == null))
                {
                    security_lib_data = m_refContApi.LoadPermissions(content_edit_data.FolderId, "folder", 0);
                    UploadPrivs = security_lib_data.CanAddToFileLib || security_lib_data.CanAddToImageLib;
                    m_strContentTitle = Server.HtmlDecode(content_edit_data.Title);
                    m_strAssetFileName = content_edit_data.AssetData.FileName;
                    m_strContentHtml = content_edit_data.Html;
                    content_teaser = content_edit_data.Teaser;
                    meta_data = content_edit_data.MetaData;

                    content_comment = Server.HtmlDecode(content_edit_data.Comment);
                    content_stylesheet = content_edit_data.StyleSheet;
                    m_intContentFolder = content_edit_data.FolderId;
                    m_intTaxFolderId = content_edit_data.FolderId;
                    intContentLanguage = content_edit_data.LanguageId;
                    go_live = content_edit_data.GoLive;
                    end_date = content_edit_data.EndDate;
                    end_date_action = content_edit_data.EndDateAction.ToString();
                    intInheritFrom = m_refContent.GetFolderInheritedFrom(m_intContentFolder);

                    subscription_data_list = m_refContApi.GetSubscriptionsForFolder(intInheritFrom);
                    subscription_properties_list = m_refContApi.GetSubscriptionPropertiesForContent(m_refContentId); //first try content
                    if (subscription_properties_list == null)
                    {
                        subscription_properties_list = m_refContApi.GetSubscriptionPropertiesForFolder(intInheritFrom); //then get folder
                        subscribed_data_list = subscription_data_list;
                    }
                    else //content is populated.
                    {
                        subscribed_data_list = m_refContApi.GetSubscriptionsForContent(m_refContentId); // get subs for folder
                    }

                    if (!(meta_data == null))
                    {
                        MetaDataNumber = meta_data.Length;
                    }
                    PreviousState = content_edit_data.CurrentStatus;
                    iMaxContLength = content_edit_data.MaxContentSize;
                    iMaxSummLength = content_edit_data.MaxSummarySize;
                    path = content_edit_data.Path;
                    m_intManualAliasId = content_edit_data.ManualAliasId;

                    folder_data = m_refContApi.GetFolderById(m_intContentFolder);

                    if ((path.Substring(path.Length - 1, 1) == "\\"))
                    {
                        path = path.Substring(path.Length -(path.Length - 1));
                    }
                    //Check to see if this belongs to XML configuration
                    if (lContentType != 2)
                    {
                        xmlconfig_data = content_edit_data.XmlConfiguration;
                        if (!(xmlconfig_data == null))
                        {
                            editorPackage = xmlconfig_data.PackageXslt;
                            MultiTemplateID.Text = "<input type=\"hidden\" name=\"xid\" value=\"" + content_edit_data.XmlConfiguration.Id.ToString() + "\">";
                            if (editorPackage.Length > 0)
                            {
                                bVer4Editor = true; // this means that we will be using the new Package Design for the content
                            }
                        }
                    }

                    if (m_strContentTitle != "")
                    {
                        MetaComplete = UserRights.CanMetadataComplete; //Changed from 1 to true
                    }
                    asset_info["AssetID"] = content_edit_data.AssetData.Id;
                    asset_info["AssetVersion"] = content_edit_data.AssetData.Version;
                    asset_info["MimeType"] = content_edit_data.AssetData.MimeType;
                    asset_info["FileExtension"] = content_edit_data.AssetData.FileExtension;
                }
                validTypes.Value = Convert.ToString(asset_info["FileExtension"]);
            }
            else
            {

                UserRights = m_refContApi.LoadPermissions(m_intItemId, "folder", ContentAPI.PermissionResultType.Folder);
                folder_data = m_refContApi.GetFolderById(m_intItemId);
                MetaComplete = UserRights.CanMetadataComplete;
                if (m_intXmlConfigId > -1)
                {
                    xmlconfig_data = m_refContApi.GetXmlConfiguration(m_intXmlConfigId);
                    MultiTemplateID.Text = "<input type=\"hidden\" name=\"xid\" value=\"" + m_intXmlConfigId.ToString() + "\">";
                }
                else
                {
                    if ((folder_data.XmlConfiguration != null) && (folder_data.XmlConfiguration.Length > 0) && (Request.QueryString["AllowHTML"] != "1"))
                    {
                        xmlconfig_data = folder_data.XmlConfiguration[0];
                    }
                    else
                    {
                        xmlconfig_data = null;
                    }
                }
                if (!(xmlconfig_data == null))
                {
                    editorPackage = xmlconfig_data.PackageXslt;
                    if (editorPackage.Length > 0)
                    {
                        bVer4Editor = true;
                    }
                }
                content_stylesheet = m_refContApi.GetStyleSheetByFolderID(m_intItemId);
                security_lib_data = m_refContApi.LoadPermissions(m_intItemId, "folder", 0);
                UploadPrivs = security_lib_data.CanAddToFileLib || security_lib_data.CanAddToImageLib;
                string TmpId = Request.QueryString["content_id"];
                if (!String.IsNullOrEmpty(TmpId))
                {
                    //translating asset
                    if (Request.QueryString["type"] == "add")
                    {
                        if (!String.IsNullOrEmpty(Request.QueryString["back_LangType"]))
                        {
                            m_refContApi.ContentLanguage = Convert.ToInt32(Request.QueryString["back_LangType"]);
                        }
                        else
                        {
                            m_refContApi.ContentLanguage = System.Convert.ToInt32(Ektron.Cms.CommonApi.GetEcmCookie()["DefaultLanguage"]);
                        }
                    }
                    content_data = m_refContApi.GetContentById(Convert.ToInt64(TmpId), 0);
                    if (content_data != null)
                    {
                        if (content_data.SubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderData || content_data.SubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderMasterData || content_data.SubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.WebEvent)
                        {
                            isOfficeDoc.Value = "true";
                        }
                        if (m_intXmlConfigId == -1)
                        {
                            if (content_data.XmlConfiguration != null)
                            {
                                m_intXmlConfigId = content_data.XmlConfiguration.Id;
                                xmlconfig_data = content_data.XmlConfiguration;
                                editorPackage = xmlconfig_data.PackageXslt;
                                if (editorPackage.Length > 0)
                                {
                                    bVer4Editor = true;
                                }
                                MultiTemplateID.Text = "<input type=\"hidden\" name=\"xid\" value=\"" + m_intXmlConfigId.ToString() + "\">";
                            }
                        }

                        m_strContentTitle = Server.HtmlDecode(content_data.Title);
                        m_strAssetFileName = content_data.AssetData.FileName;
                        m_strContentHtml = content_data.Html;
                        content_teaser = content_data.Teaser;
                        content_comment = Server.HtmlDecode(content_data.Comment);
                        go_live = content_data.GoLive;
                        end_date = content_data.EndDate;
                        end_date_action = content_data.EndDateAction.ToString();
                        lContentType = content_data.Type;
                        lContentSubType = content_data.SubType;
                        if (m_strType == "add")
                        {
                            if (Utilities.IsAssetType(lContentType))
                            {
                                m_strContentTitle = Server.HtmlDecode(content_data.Title);
                                validTypes.Value = content_data.AssetData.FileExtension;
                            }
                        }
                        else
                        {
                            asset_info["AssetID"] = content_data.AssetData.Id;
                            asset_info["AssetVersion"] = content_data.AssetData.Version;
                            asset_info["AssetFilename"] = content_data.AssetData.FileName;
                            asset_info["MimeType"] = content_data.AssetData.MimeType;
                            asset_info["FileExtension"] = content_data.AssetData.FileExtension;
                            asset_info["MimeName"] = content_data.AssetData.MimeName;
                            asset_info["ImageUrl"] = content_data.AssetData.ImageUrl;
                            if (Convert.ToString(asset_info["MimeType"]) == "application/x-shockwave-flash")
                            {
                                asset_info["MediaAsset"] = true;
                            }
                            else
                            {
                                asset_info["MediaAsset"] = false;
                            }
                            validTypes.Value = Convert.ToString(asset_info["FileExtension"]);
                            //Next
                        }
                    }
                }
                else
                {
                    //Adding new file
                    List<string> fileTypeCol = new List<string>(DocumentManagerData.Instance.FileTypes.Split(",".ToCharArray()));
                    string allTypes = "";
                    foreach (string type in fileTypeCol)
                    {
                        if (allTypes.Length > 0)
                        {
                            allTypes += (string)("," + type.Trim().Replace("*.", ""));
                        }
                        else
                        {
                            allTypes += type.Trim().Replace("*.", "");
                        }
                    }
                    validTypes.Value = allTypes;
                }
                m_intContentFolder = m_intItemId;
                intInheritFrom = m_refContent.GetFolderInheritedFrom(m_intContentFolder);
                subscription_data_list = m_refContApi.GetSubscriptionsForFolder(intInheritFrom); //AGofPA get subs for folder; set break inheritance flag false
                subscription_properties_list = m_refContApi.GetSubscriptionPropertiesForFolder(intInheritFrom); //get folder properties
                subscribed_data_list = subscription_data_list; //get subs for folder
                intContentLanguage = m_intContentLanguage;
                m_refContApi.ContentLanguage = m_intContentLanguage;

                meta_data = m_refContApi.GetMetaDataTypes("id");
                path = m_refContApi.GetPathByFolderID(m_intContentFolder);
                if ((path.Substring(path.Length - 1, 1) == "\\"))
                {
                    path = path.Substring(path.Length - (path.Length - 1));
                }
                iMaxContLength = int.Parse(settings_data.MaxContentSize);
                iMaxSummLength = int.Parse(settings_data.MaxSummarySize);
            }
            if (folder_data.FolderType == 1)
            {
                m_bIsBlog = true;
                blog_data = m_refContApi.BlogObject(folder_data);
                if (m_strType == "update")
                {
                    blog_post_data = m_refContApi.GetBlogPostData(m_intItemId);
                }
                else if (m_strType == "add" && m_refContentId > 0) // add new lang
                {
                    blog_post_data = m_refContApi.EkContentRef.GetBlogPostDataOnly(m_refContentId, back_LangType);
                }
                else
                {
                    blog_post_data = m_refContApi.GetBlankBlogPostData();
                }
            }
            if (xmlconfig_data != null)
            {
                Collection collXmlConfigData = (Collection)xmlconfig_data.LogicalPathComplete;
                if (bVer4Editor == false) //only do this if we are using the old method
                {
                    urlxml = "?Edit_xslt=";
                    if (xmlconfig_data.EditXslt.Length > 0)
                    {
                        urlxml = urlxml + EkFunctions.UrlEncode(Convert.ToString(collXmlConfigData["EditXslt"]));
                        if (m_strContentHtml.Trim().Length == 0)
                        {
                            m_strContentHtml = "<root> </root>";
                        }
                    }
                    urlxml = urlxml + "&Save_xslt=";
                    if (xmlconfig_data.SaveXslt.Length > 0)
                    {
                        save_xslt_file = Convert.ToString(collXmlConfigData["SaveXslt"]);
                        urlxml = urlxml + EkFunctions.UrlEncode(save_xslt_file);
                    }
                    urlxml = urlxml + "&Schema=";
                    if (xmlconfig_data.XmlSchema.Length > 0)
                    {
                        m_strSchemaFile = Convert.ToString(collXmlConfigData["XmlSchema"]);
                        urlxml = urlxml + EkFunctions.UrlEncode(m_strSchemaFile);
                    }
                    xml_config = AppeWebPath + "cms_xmlconfig.aspx" + urlxml;
                    if (xmlconfig_data.XmlAdvConfig.Length > 0)
                    {
                        xml_config = Convert.ToString(collXmlConfigData["XmlAdvConfig"] + urlxml);
                    }
                    m_strSchemaFile = Convert.ToString(collXmlConfigData["XmlSchema"]);
                    m_strNamespaceFile = Convert.ToString(collXmlConfigData["XmlNameSpace"]);
                }
            }

            //DHTML RENDERING
            //ASSET CONFIG
            for (i = 0; i <= Ektron.Cms.Common.EkConstants.m_AssetInfoKeys.Length - 1; i++)
            {
                AssetHidden.Text += "<input type=\"hidden\" name=\"asset_" + Strings.LCase(Ektron.Cms.Common.EkConstants.m_AssetInfoKeys[i]) + "\" value=\"" + EkFunctions.HtmlEncode(asset_info[Ektron.Cms.Common.EkConstants.m_AssetInfoKeys[i]].ToString()) + "\">";
            }
            content_type.Value = Convert.ToString(lContentType);
            content_subtype.Value = Convert.ToString(lContentSubType);
            if (m_SelectedEditControl != "ContentDesigner")
            {
                jsEditorScripts.Text = Utilities.EditorScripts(var2, AppeWebPath, BrowserCode);
            }
            AutoNav.Text = path.Replace("\\", "\\\\");
            invalidFormatMsg.Text = m_refMsg.GetMessage("js: invalid date format error msg");
            invalidYearMsg.Text = m_refMsg.GetMessage("js: invalid year error msg");
            invalidMonthMsg.Text = m_refMsg.GetMessage("js: invalid month error msg");
            invalidDayMsg.Text = m_refMsg.GetMessage("js: invalid day error msg");
            invalidTimeMsg.Text = m_refMsg.GetMessage("js: invalid time error msg");

            if (MetaComplete)
            {
                ecmMetaComplete.Text = "1";
            }
            else
            {
                ecmMetaComplete.Text = "0";
            }
            ecmMonths.Text = "";
            jsNullContent.Text = m_refMsg.GetMessage("null content warning msg");
            jsEDWarning.Text = m_refMsg.GetMessage("js: earlier end date warning");
            jsMetaCompleteWarning.Text = m_refMsg.GetMessage("js: alert cannot submit meta incomplete") + "\\n" + m_refMsg.GetMessage("js: alert save or checkin or complete meta");
            jsSetActionFunction.Text = SetActionClientScript(folder_data.PublishHtmlActive, (xmlconfig_data != null && 1 == lContentType));
            jsSitePath.Text = m_refContApi.SitePath;
            jsEditProLocale.Text = AppeWebPath + "locale" + AppLocaleString + "b.xml";
            ValidateContentPanel.Text = " var errReason = 0;" + "\r\n";
            ValidateContentPanel.Text += "var errReasonT = 0;" + "\r\n";
            ValidateContentPanel.Text += "var errAccess = false;" + "\r\n";
            ValidateContentPanel.Text += "var errMessage = \"\";" + "\r\n";
            ValidateContentPanel.Text += "var sInvalidContent = \"Continue saving invalid document?\";" + "\r\n";
            if (m_SelectedEditControl != "ContentDesigner")
            {
                ValidateContentPanel.Text += "if (eWebEditProMessages) {" + "\r\n";
                ValidateContentPanel.Text += "  sInvalidContent = eWebEditProMessages.invalidContent;" + "\r\n";
                ValidateContentPanel.Text += "}" + "\r\n";
            }
            ValidateContentPanel.Text += "var errContent = \"" + m_refMsg.GetMessage("js: alert invalid data") + "\";" + "\r\n";
            ValidateContentPanel.Text += "var objValidateInstance = null;" + "\r\n";
            if (m_SelectedEditControl != "ContentDesigner")
            {
                ValidateContentPanel.Text += "objValidateInstance = eWebEditPro.instances[\"content_html\"];" + "\r\n";
                ValidateContentPanel.Text += "if (objValidateInstance){" + "\r\n";
                ValidateContentPanel.Text += "	if (!eWebEditPro.instances[\"content_html\"].validateContent()) {" + "\r\n";
                ValidateContentPanel.Text += "		errReason = objValidateInstance.event.reason;" + "\r\n";
                ValidateContentPanel.Text += "		if (-1001 == errReason || -1002 == errReason || 1003 == errReason || -1003 == errReason) {" + "\r\n";
                ValidateContentPanel.Text += "			errAccess = true;" + "\r\n";
                ValidateContentPanel.Text += "		}" + "\r\n";
                ValidateContentPanel.Text += "	}" + "\r\n";
                ValidateContentPanel.Text += "}" + "\r\n";
            }
            else
            {
                ValidateContentPanel.Text += "  if (\"object\" == typeof Ektron && Ektron.ContentDesigner && Ektron.ContentDesigner.instances) {" + "\r\n";
                ValidateContentPanel.Text += "      var objContentEditor = Ektron.ContentDesigner.instances[\"content_html\"];" + "\r\n";
                ValidateContentPanel.Text += "      if (objContentEditor && \"function\" == typeof objContentEditor.validateContent) {" + "\r\n";
                ValidateContentPanel.Text += "          errMessage = objContentEditor.validateContent();" + "\r\n";
                ValidateContentPanel.Text += "      }" + "\r\n";
                ValidateContentPanel.Text += "      if (errMessage != null && errMessage != \"\") {" + "\r\n";
                ValidateContentPanel.Text += "          if (\"object\" == typeof errMessage && \"undefined\" == typeof errMessage.code) {" + "\r\n";
                ValidateContentPanel.Text += "              alert(errMessage.join(\"\\n\\n\\n\"));" + "\r\n";
                ValidateContentPanel.Text += "		        return false;" + "\r\n";
                ValidateContentPanel.Text += "          }" + "\r\n";
                ValidateContentPanel.Text += "          else if (\"object\" == typeof errMessage && \"string\" == typeof errMessage.msg) {" + "\r\n";
                ValidateContentPanel.Text += "		        errReason = errMessage.code;" + "\r\n";
                ValidateContentPanel.Text += "			    errAccess = true;" + "\r\n";
                ValidateContentPanel.Text += "              alert(\"Content is invalid.\" + \"\\n\\n\" + errMessage.msg);" + "\r\n";
                ValidateContentPanel.Text += "          }" + "\r\n";
                ValidateContentPanel.Text += "          else if (\"string\" == typeof errMessage && errMessage.length > 0) {" + "\r\n";
                ValidateContentPanel.Text += "              alert(errMessage);" + "\r\n";
                ValidateContentPanel.Text += "		        return false;" + "\r\n";
                ValidateContentPanel.Text += "          }" + "\r\n";
                ValidateContentPanel.Text += "      }" + "\r\n";
                ValidateContentPanel.Text += "  }" + "\r\n";
            }
            ValidateContentPanel.Text += "var objTeaserInstance = null;" + "\r\n";
            if (m_SelectedEditControl != "ContentDesigner")
            {
                ValidateContentPanel.Text += "objTeaserInstance = eWebEditPro.instances[\"content_teaser\"];" + "\r\n";
                ValidateContentPanel.Text += "if (objTeaserInstance){" + "\r\n";
                ValidateContentPanel.Text += "	if (!objTeaserInstance.validateContent()) {" + "\r\n";
                ValidateContentPanel.Text += "		errReasonT = objTeaserInstance.event.reason;" + "\r\n";
                ValidateContentPanel.Text += "		if (-1001 == errReasonT || -1002 == errReasonT || 1003 == errReasonT || -1003 == errReasonT) {" + "\r\n";
                ValidateContentPanel.Text += "			errAccess = true;" + "\r\n";
                ValidateContentPanel.Text += "		}" + "\r\n";
                ValidateContentPanel.Text += "	}" + "\r\n";
                ValidateContentPanel.Text += "}" + "\r\n";
            }
            else
            {
                ValidateContentPanel.Text += "  if (\"object\" == typeof Ektron && Ektron.ContentDesigner && Ektron.ContentDesigner.instances && (\"\" == errMessage || null == errMessage)) {" + "\r\n";
                ValidateContentPanel.Text += "      var teaserName = \"content_teaser\";" + "\r\n";
                ValidateContentPanel.Text += "      if (document.forms[0].response) {" + "\r\n";
                ValidateContentPanel.Text += "        var iTeaser = 0;" + "\r\n";
                ValidateContentPanel.Text += "        for (var i = 0; i < document.forms[0].response.length; i++) {" + "\r\n";
                ValidateContentPanel.Text += "            if (document.forms[0].response[i].checked) {" + "\r\n";
                ValidateContentPanel.Text += "                iTeaser = i;" + "\r\n";
                ValidateContentPanel.Text += "            }" + "\r\n";
                ValidateContentPanel.Text += "        }" + "\r\n";
                ValidateContentPanel.Text += "        switch (iTeaser) {" + "\r\n";
                ValidateContentPanel.Text += "            case 2: " + "\r\n";
                ValidateContentPanel.Text += "                teaserName = \"forms_transfer\";" + "\r\n";
                ValidateContentPanel.Text += "                break;" + "\r\n";
                ValidateContentPanel.Text += "            case 1:" + "\r\n";
                ValidateContentPanel.Text += "                teaserName = \"forms_redirect\";" + "\r\n";
                ValidateContentPanel.Text += "                break;" + "\r\n";
                ValidateContentPanel.Text += "            case 0:" + "\r\n";
                ValidateContentPanel.Text += "            default:" + "\r\n";
                ValidateContentPanel.Text += "                teaserName = \"content_teaser\";" + "\r\n";
                ValidateContentPanel.Text += "                break;" + "\r\n";
                ValidateContentPanel.Text += "        }" + "\r\n";
                ValidateContentPanel.Text += "      }" + "\r\n";
                ValidateContentPanel.Text += "      var objTeaserEditor = Ektron.ContentDesigner.instances[teaserName];" + "\r\n";
                ValidateContentPanel.Text += "      if (objTeaserEditor && \"function\" == typeof objTeaserEditor.validateContent){" + "\r\n";
                ValidateContentPanel.Text += "          errMessage = objTeaserEditor.validateContent();" + "\r\n";
                ValidateContentPanel.Text += "      }" + "\r\n";
                ValidateContentPanel.Text += "      if (errMessage != null && errMessage != \"\") {" + "\r\n";
                ValidateContentPanel.Text += "          if (\"object\" == typeof errMessage && \"undefined\" == typeof errMessage.code) {" + "\r\n";
                ValidateContentPanel.Text += "              alert(errMessage.join(\"\\n\\n\\n\"));" + "\r\n";
                ValidateContentPanel.Text += "		        return false;" + "\r\n";
                ValidateContentPanel.Text += "          }" + "\r\n";
                ValidateContentPanel.Text += "          else if (\"object\" == typeof errMessage && \"string\" == typeof errMessage.msg) {" + "\r\n";
                ValidateContentPanel.Text += "		        errReason = errMessage.code;" + "\r\n";
                ValidateContentPanel.Text += "			    errAccess = true;" + "\r\n";
                ValidateContentPanel.Text += "              alert(\"Content is invalid.\" + \"\\n\\n\" + errMessage.msg);" + "\r\n";
                ValidateContentPanel.Text += "          }" + "\r\n";
                ValidateContentPanel.Text += "          else if (\"string\" == typeof errMessage && errMessage.length > 0) {" + "\r\n";
                ValidateContentPanel.Text += "              alert(errMessage);" + "\r\n";
                ValidateContentPanel.Text += "		        return false;" + "\r\n";
                ValidateContentPanel.Text += "          }" + "\r\n";
                ValidateContentPanel.Text += "      }" + "\r\n";
                ValidateContentPanel.Text += "  }" + "\r\n";
            }
            ValidateContentPanel.Text += "if (errReason != 0 || errReasonT != 0) {" + "\r\n";
            ValidateContentPanel.Text += "	if (errReasonT != 0 && typeof objTeaserInstance != \"undefined\" && objTeaserInstance) {" + "\r\n";
            ValidateContentPanel.Text += "		errMessage = objTeaserInstance.event.message + \"\";" + "\r\n";
            ValidateContentPanel.Text += "	}" + "\r\n";
            ValidateContentPanel.Text += "	if (errReason != 0 && typeof objValidateInstance != \"undefined\" && objValidateInstance) {" + "\r\n";
            ValidateContentPanel.Text += "		errMessage = objValidateInstance.event.message + \"\";" + "\r\n";
            ValidateContentPanel.Text += "	}" + "\r\n";
            ValidateContentPanel.Text += "	if (false == errAccess) {" + "\r\n";
            ValidateContentPanel.Text += "		alert(errContent + \"\\n\"  + errMessage);" + "\r\n";
            ValidateContentPanel.Text += "		$ektron(document).trigger(\"wizardPanelShown\");" + "\r\n";
            ValidateContentPanel.Text += "		return false;" + "\r\n";
            ValidateContentPanel.Text += "	}" + "\r\n";
            ValidateContentPanel.Text += "	else {" + "\r\n";
            if ("2" == settings_data.Accessibility)
            {
                ValidateContentPanel.Text += " if (typeof Button != \"undefined\") {" + "\r\n";
                ValidateContentPanel.Text += "		if (\"publish\" == Button.toLowerCase() || \"submit\" == Button.toLowerCase()) {" + "\r\n";
                ValidateContentPanel.Text += "			alert(errContent);" + "\r\n";
                ValidateContentPanel.Text += "			$ektron(document).trigger(\"wizardPanelShown\");" + "\r\n";
                ValidateContentPanel.Text += "			return false;" + "\r\n";
                ValidateContentPanel.Text += "		}" + "\r\n";
                ValidateContentPanel.Text += "		else { " + "\r\n";
                ValidateContentPanel.Text += "			if (confirm(errContent + \"\\n\" + sInvalidContent)) {" + "\r\n";
                ValidateContentPanel.Text += "				return true;" + "\r\n";
                ValidateContentPanel.Text += "			} " + "\r\n";
                ValidateContentPanel.Text += "			else {" + "\r\n";
                ValidateContentPanel.Text += "			    $ektron(document).trigger(\"wizardPanelShown\");" + "\r\n";
                ValidateContentPanel.Text += "			    return false;" + "\r\n";
                ValidateContentPanel.Text += "			} " + "\r\n";
                ValidateContentPanel.Text += "		}" + "\r\n";
                ValidateContentPanel.Text += " }" + "\r\n";
            }
            else if ("1" == settings_data.Accessibility)
            {
                ValidateContentPanel.Text += " if (confirm(errContent + \"\\n\" + sInvalidContent)) {" + "\r\n";
                ValidateContentPanel.Text += "	return true;" + "\r\n";
                ValidateContentPanel.Text += " } " + "\r\n";
                ValidateContentPanel.Text += " else {$ektron(document).trigger(\"wizardPanelShown\"); return false;} " + "\r\n";
            }
            ValidateContentPanel.Text += "	}" + "\r\n";
            ValidateContentPanel.Text += "}" + "\r\n";
            //Change the action page
            FormAction = (string)("edit.aspx?close=" + Request.QueryString["close"] + "&LangType=" + m_intContentLanguage + "&content_id=" + m_refContentId + (this.TaxonomyOverrideId > 0 ? ("&TaxonomyId=" + this.TaxonomyOverrideId.ToString()) : "") + (this.TaxonomySelectId > 0 ? ("&SelTaxonomyId=" + this.TaxonomySelectId.ToString()) : "") + "&back_file=" + back_file + "&back_action=" + back_action + "&back_folder_id=" + back_folder_id + "&back_id=" + back_id + "&back_form_id=" + back_form_id + "&control=" + controlName + "&buttonid=" + buttonId.Value + "&back_LangType=" + back_LangType + back_callerpage + back_origurl);
            if (Request.QueryString["pullapproval"] != null)
            {
                FormAction += (string)("&pullapproval=" + Request.QueryString["pullapproval"]);
            }
            PostBackPage.Text = "<script>document.forms[0].action = \"" + FormAction + "\";";
            if (Utilities.IsAssetType(lContentType))
            {
                PostBackPage.Text += "document.forms[0].enctype = \"multipart/form-data\";";
            }

            PostBackPage.Text += "</script>";
            LoadingImg.Text = m_refMsg.GetMessage("one moment msg");

            content_title.Value = Server.HtmlDecode(m_strContentTitle);
            if (content_title.Attributes["class"] == null)
            {
                content_title.Attributes.Add("class", "");
            }
            if (lContentSubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderMasterData)
            {
                content_title.Attributes["class"] = "masterlayout";
                if (!(m_strType == "update"))
                {
                    content_title.Disabled = true;
                }
                phAlias.Visible = false;
                EditAliasHtml.Visible = false;
            }
            else
            {
                content_title.Attributes.Remove("class");
            }

            if (EnableMultilingual == 1)
            {
                lblLangName.Text = "[" + language_data.Name + "]";
            }
            StringBuilder sbFolderBreadcrumb = new StringBuilder();
            string strDisabled = "";
            if (!(m_strType == "update"))
            {
                QLink_Search.Text = "<td nowrap=\"nowrap\" class=\"checkboxIsSearchable\" >";
                QLink_Search.Text += "<input type=\"hidden\" name=\"AddQlink\" value=\"AddQlink\">";

                if (Request.Cookies[DMSCookieName] != null && Request.Cookies[DMSCookieName].Value == "2010")
                {
                    if (folder_data.IscontentSearchable)
                        QLink_Search.Text += "<input type=\"hidden\" name=\"IsSearchable\" value=\"IsSearchable\">";
                }
                else
                {
                if (security_data.IsAdmin)
                {
                    if (folder_data.IscontentSearchable)
                        QLink_Search.Text += "<input type=\"checkbox\" name=\"IsSearchable\" " + strDisabled + " checked value=\"IsSearchable\" >" + m_refMsg.GetMessage("lbl content searchable"); //m_refMsg.GetMessage("Content Searchable")
                    else
                        QLink_Search.Text += "<input type=\"checkbox\" name=\"IsSearchable\" " + strDisabled + " >" + m_refMsg.GetMessage("lbl content searchable"); //m_refMsg.GetMessage("Content Searchable")
                }
                else
                {
                        //Need to inherit from parent.
                        if (folder_data.IscontentSearchable)
                    QLink_Search.Text += "<input type=\"hidden\" name=\"IsSearchable\" value=\"IsSearchable\">";

                    }
                }
                QLink_Search.Text += "</td>";
            }
            else
            {
                TR_Properties.Visible = false;
                TR_Properties.Height = new Unit(0);
            }

            if (QLink_Search.Text != "")
            {
                QLink_Search.Text = "<table><tr>" + QLink_Search.Text + "</tr></table>";
            }
            content_id.Value = Convert.ToString(m_refContentId);
            eType.Value = m_strType;
            mycollection.Value = strMyCollection;
            addto.Value = strAddToCollectionType;
            content_folder.Value = Convert.ToString(m_intContentFolder);
            content_language.Value = Convert.ToString(intContentLanguage);
            maxcontentsize.Value = iMaxContLength.ToString();
            if (bVer4Editor)
            {
                Ver4Editor.Value = "true";
            }
            else
            {
                Ver4Editor.Value = "false";
            }
            createtask.Value = Request.QueryString["dontcreatetask"];

            EnumeratedHiddenFields.Text = HideVariables();
            eWebEditProJS.Text = EditProJS();

            if (m_intContentType == 2)
            {
                divContentText.Text = m_refMsg.GetMessage("form text");
                divSummaryText.Text = m_refMsg.GetMessage("postback text");
            }
            else
            {
                divContentText.Text = m_refMsg.GetMessage("content text");
                divSummaryText.Text = m_refMsg.GetMessage("Summary text");
            }

            phMetadata.Visible = true;
            if (this.Request.QueryString["type"] == "update")
            {
                aliasContentType = this.content_edit_data.ContType.ToString();
            }

            if ((m_urlAliasSettings.IsManualAliasEnabled || m_urlAliasSettings.IsAutoAliasEnabled) && m_refContApi.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.EditAlias) && Request.QueryString["type"] != "multiple,add" && lContentSubType != Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderMasterData) //And Not (m_bIsBlog)
            {
                if ((content_edit_data != null) && (content_edit_data.AssetData != null) && Ektron.Cms.Common.EkFunctions.IsImage((string)("." + content_edit_data.AssetData.FileExtension)))
                {
                    phAlias.Visible = false;
                    EditAliasHtml.Visible = false;
                }
                else
                {
                    phAlias.Visible = true;
                    EditAliasHtml.Visible = true;
                }
            }
            EditContentHtmlScripts();
            EditSummaryHtmlScripts();
            EditMetadataHtmlScripts();
            EditAliasHtmlScripts();
            EditScheduleHtmlScripts();
            EditCommentHtmlScripts();
            EditSubscriptionHtmlScripts();
            EditSelectedTemplate();
            EditTaxonomyScript();

            if (eWebEditProPromptOnUnload == 1)
            {
                jsActionOnUnload.Text = "eWebEditPro.actionOnUnload = EWEP_ONUNLOAD_PROMPT;";
            }

            if (Convert.ToString(m_intContentFolder) != "")
            {
                defaultFolderId.Text = m_intContentFolder.ToString();
            }
            else
            {
                defaultFolderId.Text = "0";
            }

            //Summary_Meta_win
            if (!String.IsNullOrEmpty(Request.QueryString["summary"]))
            {
                Summary_Meta_Win.Text = "<script language=\"JavaScript1.2\">";
                Summary_Meta_Win.Text += "PopUpWindow(\'editsummaryarea.aspx?id=" + m_intItemId + "&LangType=" + m_intContentLanguage + "&editor=true\',\'Summary\',790,580,1,1);";
                Summary_Meta_Win.Text += "</script>";
            }
            if (!String.IsNullOrEmpty(Request.QueryString["meta"]))
            {
                Summary_Meta_Win.Text += "<script language=\"JavaScript1.2\">";
                if (MetaDataNumber > 0)
                {
                    Summary_Meta_Win.Text += "PopUpWindow(\'editmeta_dataarea.aspx?id=" + m_intItemId + "&LangType=" + m_intContentLanguage + "&editor=true\',\'Metadata\',790,580,1,1);";

                }
                else
                {
                    Summary_Meta_Win.Text += "alert(\'No metadata defined\');  ";
                }
                Summary_Meta_Win.Text += "</script>";
            }
            //TAXONOMY DATA
            if (IsAdmin || m_refContApi.EkUserRef.IsARoleMember(Convert.ToInt64(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.TaxonomyAdministrator), CurrentUserID, false))
            {
                TaxonomyRoleExists = true;
            }
            TaxonomyBaseData[] taxonomy_cat_arr = null;
            if (m_strType != "add" && m_strType != "multiple" && (!(m_strType.IndexOf("add", System.StringComparison.InvariantCultureIgnoreCase) > 0 || m_strType.IndexOf("multiple", System.StringComparison.InvariantCultureIgnoreCase) > 0)) || (m_strType == "add" && m_refContentId > 0))
            {
                int tmpLang = 1033;
                int originalLangID = 1033;
                if (m_strType == "add" && m_refContentId > 0) //New Language
                {
                    if (!(Request.QueryString["con_lang_id"] == null) && Request.QueryString["con_lang_id"] != "")
                    {
                        originalLangID = Convert.ToInt32(Request.QueryString["con_lang_id"]);
                    }
                    tmpLang = m_refContent.RequestInformation.ContentLanguage; //Backup the current langID
                    m_refContent.RequestInformation.ContentLanguage = originalLangID;
                    taxonomy_cat_arr = m_refContent.ReadAllAssignedCategory(m_refContentId);
                    m_refContent.RequestInformation.ContentLanguage = tmpLang;
                }
                else
                {
                    taxonomy_cat_arr = m_refContent.ReadAllAssignedCategory(m_intItemId);
                }
                if ((taxonomy_cat_arr != null) && taxonomy_cat_arr.Length > 0)
                {
                    foreach (TaxonomyBaseData taxonomy_cat in taxonomy_cat_arr)
                    {
                        if (taxonomy_cat.LanguageId == 0 || taxonomy_cat.LanguageId == m_refContent.RequestInformation.ContentLanguage)
                        {
                            if (taxonomyselectedtree.Value == "")
                            {
                                taxonomyselectedtree.Value = Convert.ToString(taxonomy_cat.Id);
                            }
                            else
                            {
                                taxonomyselectedtree.Value = taxonomyselectedtree.Value + "," + Convert.ToString(taxonomy_cat.Id);
                            }
                        }
                    }
                }
                TaxonomyTreeIdList = (string)taxonomyselectedtree.Value;
                if (TaxonomyTreeIdList.Trim().Length > 0)
                {
                    if (m_strType == "add" && m_refContentId > 0) //New Language
                    {
                        m_refContent.RequestInformation.ContentLanguage = originalLangID; //Backup the current LangID
                        TaxonomyTreeParentIdList = m_refContent.ReadDisableNodeList(m_refContentId);
                        m_refContent.RequestInformation.ContentLanguage = tmpLang;
                    }
                    else
                    {
                        TaxonomyTreeParentIdList = m_refContent.ReadDisableNodeList(m_intItemId);
                    }
                }
            }
            else
            {
                if (TaxonomySelectId > 0)
                {
                    taxonomyselectedtree.Value = TaxonomySelectId.ToString();
                    TaxonomyTreeIdList = (string)taxonomyselectedtree.Value;
                    taxonomy_cat_arr = m_refContent.GetTaxonomyRecursiveToParent(TaxonomySelectId, m_refContent.RequestInformation.ContentLanguage, 0);
                    if ((taxonomy_cat_arr != null) && taxonomy_cat_arr.Length > 0)
                    {
                        foreach (TaxonomyBaseData taxonomy_cat in taxonomy_cat_arr)
                        {
                            if (TaxonomyTreeParentIdList == "")
                            {
                                TaxonomyTreeParentIdList = Convert.ToString(taxonomy_cat.Id);
                            }
                            else
                            {
                                TaxonomyTreeParentIdList = TaxonomyTreeParentIdList + "," + Convert.ToString(taxonomy_cat.Id);
                            }
                        }
                    }
                }
            }

            TaxonomyRequest taxonomy_request = new TaxonomyRequest();
            TaxonomyBaseData[] taxonomy_data_arr = null;
            Utilities.SetLanguage(m_refContApi);
            taxonomy_request.TaxonomyId = m_intContentFolder;
            taxonomy_request.TaxonomyLanguage = m_refContApi.ContentLanguage;
            taxonomy_data_arr = m_refContent.GetAllFolderTaxonomy(m_intContentFolder);
            bool HideCategoryTab = false;
            if (Request.QueryString["HideCategoryTab"] != null)
            {
                HideCategoryTab = Convert.ToBoolean(Request.QueryString["HideCategoryTab"]);
            }
            if (HideCategoryTab || (taxonomy_data_arr == null || taxonomy_data_arr.Length == 0) && (TaxonomyOverrideId == 0))
            {
                if (!HideCategoryTab && folder_data != null && folder_data.FolderType == Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.FolderType.Blog) && TaxonomySelectId > 0 && m_intTaxFolderId == folder_data.Id && TaxonomyTreeIdList.Trim().Length > 0)
                {
                    m_intTaxFolderId = 0;
                }
                else
                {
                    phTaxonomy.Visible = false;
                    EditTaxonomyHtml.Visible = false;
                    DisplayTab = false;
                    taxonomyselectedtree.Value = taxonomy_cat_arr != null && taxonomy_cat_arr.Length > 0 && (taxonomy_cat_arr[0].LanguageId == 0 | taxonomy_cat_arr[0].LanguageId == m_refContent.RequestInformation.ContentLanguage) ? taxonomyselectedtree.Value : "";
                }
            }

            //CALL THE TOOLBAR
            if (folder_data == null)
            {
                LoadToolBar("");
            }
            else
            {
                LoadToolBar(folder_data.Name);
            }

            if (lContentSubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.WebEvent)
            {
                WebEventCont.Text = "true";
                phContent.Visible = false;
                phEditContent.Visible = false;
            }
            //-------------------DisplayTabs Based on selected options from Folder properties----------------------------------
            if (((folder_data.DisplaySettings & (int)EkEnumeration.FolderTabDisplaySettings.AllTabs) == (int)EkEnumeration.FolderTabDisplaySettings.AllTabs) && folder_data.DisplaySettings != 0)
            {
                if ((folder_data.DisplaySettings & (int)EkEnumeration.FolderTabDisplaySettings.Summary) == (int)EkEnumeration.FolderTabDisplaySettings.Summary)
                { phEditSummary.Visible = true; }
                else
                {
                    if (Request.QueryString["form_type"] == null && Request.QueryString["back_form_id"] == null && Request.QueryString["form_id"] == null && m_bIsBlog != true)
                    {
                        phEditSummary.Visible = false;
                        phSummary.Visible = false;
                    }
                }
                if ((folder_data.DisplaySettings & (int)EkEnumeration.FolderTabDisplaySettings.MetaData) == (int)EkEnumeration.FolderTabDisplaySettings.MetaData)
                {if(phMetadata.Visible)
                    phMetadata.Visible = true; }
                else
                {
                    if (!metadataRequired)
                        phMetadata.Visible = false;
                }
                if ((m_urlAliasSettings.IsManualAliasEnabled || m_urlAliasSettings.IsAutoAliasEnabled) && m_refContApi.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.EditAlias) && Request.QueryString["type"] != "multiple,add" && lContentSubType != Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderMasterData) //And Not (m_bIsBlog)
                {
                    if (!((content_edit_data != null) && (content_edit_data.AssetData != null) && Ektron.Cms.Common.EkFunctions.IsImage((string)("." + content_edit_data.AssetData.FileExtension))))
                    {
                        if ((folder_data.DisplaySettings & (int)EkEnumeration.FolderTabDisplaySettings.Aliasing) == (int)EkEnumeration.FolderTabDisplaySettings.Aliasing)
                        { phAlias.Visible = true; }
                        else
                        {
                            if (!folder_data.AliasRequired)
                                phAlias.Visible = false;
                        }
                    }
                }
                if ((folder_data.DisplaySettings & (int)EkEnumeration.FolderTabDisplaySettings.Schedule) == (int)EkEnumeration.FolderTabDisplaySettings.Schedule)
                { PhSchedule.Visible = true; }
                else
                {
                    PhSchedule.Visible = false;
                }
                if ((folder_data.DisplaySettings & (int)EkEnumeration.FolderTabDisplaySettings.Comment) == (int)EkEnumeration.FolderTabDisplaySettings.Comment)
                { PhComment.Visible = true; }
                else
                {
                    PhComment.Visible = false;
                }
                if ((folder_data.DisplaySettings & (int)EkEnumeration.FolderTabDisplaySettings.Templates) == (int)EkEnumeration.FolderTabDisplaySettings.Templates)
                { phTemplates.Visible = true; }
                else
                {
                    phTemplates.Visible = false;
                }
                if ((folder_data.DisplaySettings & (int)EkEnumeration.FolderTabDisplaySettings.Taxonomy) == (int)EkEnumeration.FolderTabDisplaySettings.Taxonomy)
                { if(phTaxonomy.Visible)
                    phTaxonomy.Visible = true; }
                else
                {
                    if (!folder_data.IsCategoryRequired)
                        phTaxonomy.Visible = false;
                }
            }

            //-------------------DisplayTabs Based on selected options from Folder properties End------------------------------
        }
        catch (Exception ex)
        {
            throw (new Exception(ex.Message));
        }
    }