private void PopulatePreviewGrid(XmlConfigData xml_config_data) { System.Web.UI.WebControls.BoundColumn colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "TITLE"; colBound.HeaderText = m_refMsg.GetMessage("lbl Preview XSLT on empty XML document"); colBound.ItemStyle.CssClass = "label left"; colBound.ItemStyle.Wrap = false; colBound.HeaderStyle.Height = Unit.Empty; colBound.ItemStyle.Height = Unit.Empty; PreviewGrid.Columns.Add(colBound); DataTable dt = new DataTable(); DataRow dr; dt.Columns.Add(new DataColumn("TITLE", typeof(string))); dr = dt.NewRow(); dr[0] = m_refContentApi.XSLTransform("<root></root>", xml_config_data.PackageDisplayXslt, false, false, null, true, true); dt.Rows.Add(dr); DataView dv = new DataView(dt); PreviewGrid.DataSource = dv; PreviewGrid.DataBind(); }
private void PopulatePropertiesGrid(XmlConfigData xml_config_data, long entryId, string subscriptionProvider) { Collection xml_data_logical_path = new Collection(); xml_data_logical_path = (Collection)xml_config_data.LogicalPathComplete; System.Web.UI.WebControls.BoundColumn colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "TITLE"; colBound.ItemStyle.CssClass = "label"; PropertiesGrid.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "VALUE"; PropertiesGrid.Columns.Add(colBound); DataTable dt = new DataTable(); DataRow dr; dt.Columns.Add(new DataColumn("TITLE", typeof(string))); dt.Columns.Add(new DataColumn("VALUE", typeof(string))); dr = dt.NewRow(); dr[0] = m_refMsg.GetMessage("generic title label"); dr[1] = xml_config_data.Title; dt.Rows.Add(dr); dr = dt.NewRow(); dr[0] = m_refMsg.GetMessage("id label"); dr[1] = xml_config_data.Id; dt.Rows.Add(dr); dr = dt.NewRow(); dr[0] = m_refMsg.GetMessage("lbl product type class"); dr[1] = Util_ShowType(entryId); dt.Rows.Add(dr); if (entryId == Convert.ToInt64(EkEnumeration.CatalogEntryType.SubscriptionProduct)) { dr = dt.NewRow(); dr[0] = m_refMsg.GetMessage("lbl commerce subscription provider"); dr[1] = subscriptionProvider; dt.Rows.Add(dr); } dr = dt.NewRow(); dr[0] = m_refMsg.GetMessage("description label"); dr[1] = xml_config_data.Description; dt.Rows.Add(dr); if (xml_config_data.PackageDisplayXslt.Length > 0) { //dr = dt.NewRow //dr(0) = "" //dr(1) = "REMOVE-ITEM" //dt.Rows.Add(dr) } else { StringBuilder sb = new StringBuilder(); dr = dt.NewRow(); dr[0] = m_refMsg.GetMessage("editor info label"); sb.Append(" <div class=\"innerTable\">"); sb.Append(" <table>"); sb.Append(" <tbody>"); sb.Append(" <tr>"); sb.Append(" <th>" + m_refMsg.GetMessage("edit xslt label") + "</th>"); sb.Append(" <td>" + ((xml_data_logical_path["EditXslt"].ToString() == string.Empty) ? "-" : (xml_data_logical_path["EditXslt"])) + "</td>"); sb.Append(" </tr>"); sb.Append(" <tr>"); sb.Append(" <th>" + m_refMsg.GetMessage("save xslt label") + "</th>"); sb.Append(" <td>" + ((xml_data_logical_path["SaveXslt"].ToString() == string.Empty) ? "-" : (xml_data_logical_path["SaveXslt"])) + "</td>"); sb.Append(" </tr>"); sb.Append(" <tr>"); sb.Append(" <th>" + m_refMsg.GetMessage("advanced config label") + "</th>"); sb.Append(" <td>" + ((xml_data_logical_path["XmlAdvConfig"].ToString() == string.Empty) ? "-" : (xml_data_logical_path["XmlAdvConfig"])) + "</td>"); sb.Append(" </tr>"); sb.Append(" </tbody>"); sb.Append(" </table>"); sb.Append(" </div>"); dr[1] = sb.ToString(); dt.Rows.Add(dr); dr = dt.NewRow(); dr[0] = m_refMsg.GetMessage("validation info label"); sb = new StringBuilder(); sb.Append(" <div class=\"innerTable\">"); sb.Append(" <table"); sb.Append(" <tbody>"); sb.Append(" <tr>"); sb.Append(" <th>" + m_refMsg.GetMessage("xml schema label") + "</th>"); sb.Append(" <td>" + ((xml_data_logical_path["XmlSchema"].ToString() == string.Empty) ? "-" : (xml_data_logical_path["XmlSchema"])) + "</td>"); sb.Append(" </tr>"); sb.Append(" <tr>"); sb.Append(" <th>" + m_refMsg.GetMessage("target namespace label") + "</th>"); sb.Append(" <td>" + ((xml_data_logical_path["XmlNameSpace"].ToString() == string.Empty) ? "-" : (xml_data_logical_path["XmlNameSpace"])) + "</td>"); sb.Append(" </tr>"); sb.Append(" </tbody>"); sb.Append(" </table>"); sb.Append(" </div>"); dr[1] = sb.ToString(); dt.Rows.Add(dr); } DataView dv = new DataView(dt); PropertiesGrid.DataSource = dv; PropertiesGrid.DataBind(); }
private void ViewXmlConfigToolBar(XmlConfigData xml_config_data) { System.Text.StringBuilder result = new System.Text.StringBuilder(); string pkDisplay = xml_config_data.PackageDisplayXslt; //cXmlCollection("PackageDisplayXslt") string PackageXslt = xml_config_data.PackageXslt; //cXmlCollection("PackageXslt") string caller = Request.QueryString["caller"]; bool eIntranet = false; result.Append("<table><tr>"); txtTitleBar.InnerHtml = m_refStyle.GetTitleBar((string)(m_refMsg.GetMessage("view xml config msg") + " \"" + xml_config_data.Title + "\"")); if (!Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(m_refContentApi.RequestInformationRef, Ektron.Cms.DataIO.LicenseManager.Feature.MembershipUsers) && xml_config_data.Id == 15) { eIntranet = true; } if (caller == null) { result.Append(m_refStyle.GetButtonEventsWCaption(m_refContentApi.AppPath + "images/UI/Icons/back.png", "xml_config.aspx?action=ViewAllXmlConfigurations", m_refMsg.GetMessage("alt back button text"), m_refMsg.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true)); bool primaryCssApplied = false; if (bIsAdmin) { result.Append(m_refStyle.GetButtonEventsWCaption(m_refContentApi.AppPath + "images/UI/Icons/add.png", "xml_config.aspx?action=NewInheritConfiguration&id=" + ConfigId + "", m_refMsg.GetMessage("alt Create a new xml configuration based on this configuration"), m_refMsg.GetMessage("btn add xml"), "", StyleHelper.AddButtonCssClass, !primaryCssApplied)); primaryCssApplied = true; result.Append(m_refStyle.GetButtonEventsWCaption(m_refContentApi.AppPath + "images/UI/Icons/contentEdit.png", "xml_config.aspx?action=EditXmlConfiguration&id=" + ConfigId + "", m_refMsg.GetMessage("alt edit button text (xml config)"), m_refMsg.GetMessage("btn edit"), "", StyleHelper.EditButtonCssClass)); if ((xml_config_data.EditXslt.Length == 0) || pkDisplay.Length > 0) { result.Append(m_refStyle.GetButtonEventsWCaption(m_refContentApi.AppPath + "images/ui/icons/contentSmartFormEdit.png", "editdesign.aspx?action=EditPackage&id=" + ConfigId + "", m_refMsg.GetMessage("alt Design mode Package"), m_refMsg.GetMessage("btn data design"), "", StyleHelper.EditSmartformButtonCssClass)); } } if (pkDisplay.Length > 0) { result.Append(m_refStyle.GetButtonEventsWCaption(m_refContentApi.AppPath + "images/ui/icons/FileTypes/xsl.png", "viewXslt.aspx?id=" + ConfigId + "", m_refMsg.GetMessage("alt View the presentation Xslt"), m_refMsg.GetMessage("btn view xslt"), "", StyleHelper.ViewXslButtonCssClass, !primaryCssApplied)); primaryCssApplied = true; } if (bIsAdmin && !eIntranet) { result.Append(m_refStyle.GetButtonEventsWCaption(m_refContentApi.AppPath + "images/UI/Icons/delete.png", "xml_config.aspx?action=DeleteXmlConfiguration&id=" + ConfigId + "", m_refMsg.GetMessage("alt delete button text (xml config)"), m_refMsg.GetMessage("btn delete"), "OnClick=\"return ConfirmDelete();\"", StyleHelper.DeleteButtonCssClass, !primaryCssApplied)); primaryCssApplied = true; } } else { result.Append(m_refStyle.GetButtonEventsWCaption(m_refContentApi.AppPath + "images/UI/Icons/cancel.png", "", m_refMsg.GetMessage("alt back button text"), m_refMsg.GetMessage("btn cancel"), "OnClick=\"javascript:self.close();\"", StyleHelper.CancelButtonCssClass, true)); } result.Append(StyleHelper.ActionBarDivider); result.Append("<td>"); result.Append(m_refStyle.GetHelpButton(m_strPageAction, "")); result.Append("</td>"); result.Append("</tr></table>"); htmToolBar.InnerHtml = result.ToString(); result = null; }
private void PopulateDisplayGrid(XmlConfigData xml_config_data) { Collection xml_data_logical_path = new Collection(); xml_data_logical_path = (Collection)xml_config_data.LogicalPathComplete; System.Web.UI.WebControls.BoundColumn colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "TITLE"; colBound.ItemStyle.Width = 200; colBound.HeaderStyle.CssClass = "center"; colBound.ItemStyle.CssClass = "right"; colBound.HeaderText = m_refMsg.GetMessage("lbl xslt"); DisplayGrid.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "VALUE"; colBound.HeaderStyle.CssClass = "center"; colBound.ItemStyle.CssClass = "left"; colBound.HeaderText = m_refMsg.GetMessage("generic path"); DisplayGrid.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "DEFAULT"; colBound.ItemStyle.Width = 50; colBound.HeaderStyle.CssClass = "center"; colBound.ItemStyle.CssClass = "center"; colBound.HeaderText = m_refMsg.GetMessage("lbl default"); DisplayGrid.Columns.Add(colBound); DataTable dt = new DataTable(); DataRow dr; bool bValidDefaultXslt = false; dt.Columns.Add(new DataColumn("TITLE", typeof(string))); dt.Columns.Add(new DataColumn("VALUE", typeof(string))); dt.Columns.Add(new DataColumn("DEFAULT", typeof(string))); string defaultCheck = "<img alt=\"Default\" title=\"Default\" src=\"" + _ContentApi.ApplicationPath + "images/ui/icons/check.png\" />"; dr = dt.NewRow(); dr[0] = m_refMsg.GetMessage("xslt 1 label"); dr[2] = " "; if (xml_config_data.DefaultXslt == "1") { if (xml_data_logical_path["Xslt1"].ToString() != "") { bValidDefaultXslt = true; dr[2] += defaultCheck; } } dr[1] = xml_data_logical_path["Xslt1"]; dt.Rows.Add(dr); dr = dt.NewRow(); dr[0] = m_refMsg.GetMessage("xslt 2 label"); dr[2] = " "; if (xml_config_data.DefaultXslt == "2") { if (xml_data_logical_path["Xslt2"].ToString() != "") { bValidDefaultXslt = true; dr[2] += defaultCheck; } } dr[1] = xml_data_logical_path["Xslt2"]; dt.Rows.Add(dr); dr = dt.NewRow(); dr[0] = m_refMsg.GetMessage("xslt 3 label"); dr[2] = " "; if (xml_config_data.DefaultXslt == "3") { if (xml_data_logical_path["Xslt3"].ToString() != "") { bValidDefaultXslt = true; dr[2] += defaultCheck; } } dr[1] = xml_data_logical_path["Xslt3"]; dt.Rows.Add(dr); dr = dt.NewRow(); dr[0] = m_refMsg.GetMessage("lbl XSLT packaged") + ":"; dr[2] = " "; if (xml_config_data.DefaultXslt == "0") { dr[2] += defaultCheck; } else { if (!(bValidDefaultXslt)) { dr[2] += defaultCheck; } } dr[1] = " "; dt.Rows.Add(dr); if (xml_config_data.PackageXslt.Length > 0) { //dr = dt.NewRow //dr(0) = "" //dr(1) = "REMOVE-ITEM" //dt.Rows.Add(dr) h3Xpaths.InnerText = "XPaths"; string xPaths = string.Empty; int counter = 1; foreach (object item in m_refContentApi.GetXPaths(xml_config_data.PackageXslt)) { xPaths += "<li" + (counter % 2 == 0 ? " class=\"stripe\">" : ">") + Convert.ToString(item) + "</li>"; counter++; } litXpaths.Text = xPaths; //dr = dt.NewRow //dr(0) = "XPaths:" //dr(2) = " " //Dim item As Object //dr(1) = "" //For Each item In m_refContentApi.GetXPaths(xml_config_data.PackageXslt) // dr(1) += Convert.ToString(item) & "<br/>" //Next //dt.Rows.Add(dr) } DataView dv = new DataView(dt); DisplayGrid.DataSource = dv; DisplayGrid.DataBind(); }
private void PopulatePropertiesGrid(XmlConfigData xml_config_data) { System.Web.UI.WebControls.BoundColumn colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "TITLE"; colBound.ItemStyle.CssClass = "label"; PropertiesGrid.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "VALUE"; colBound.ItemStyle.CssClass = "readOnlyValue"; PropertiesGrid.Columns.Add(colBound); DataTable dt = new DataTable(); DataRow dr; dt.Columns.Add(new DataColumn("TITLE", typeof(string))); dt.Columns.Add(new DataColumn("VALUE", typeof(string))); dr = dt.NewRow(); dr[0] = "<strong class=\'headerRow\'>" + m_refMsg.GetMessage("general information") + "</strong>"; dr[1] = "REMOVE-ITEM"; dt.Rows.Add(dr); dr = dt.NewRow(); dr[0] = m_refMsg.GetMessage("generic title label"); dr[1] = xml_config_data.Title; dt.Rows.Add(dr); dr = dt.NewRow(); dr[0] = m_refMsg.GetMessage("id label"); dr[1] = xml_config_data.Id; dt.Rows.Add(dr); dr = dt.NewRow(); dr[0] = m_refMsg.GetMessage("description label"); dr[1] = xml_config_data.Description; dt.Rows.Add(dr); if (xml_config_data.PackageDisplayXslt.Length > 0) { // do nothing } else { Collection collLpath = (Collection)xml_config_data.LogicalPathComplete; dr = dt.NewRow(); dr[0] = "<strong class=\'headerRow\'>" + m_refMsg.GetMessage("editor info label") + "</strong>"; dr[1] = "REMOVE-ITEM"; dt.Rows.Add(dr); dr = dt.NewRow(); dr[0] = m_refMsg.GetMessage("edit xslt label"); dr[1] = collLpath["EditXslt"]; dt.Rows.Add(dr); dr = dt.NewRow(); dr[0] = m_refMsg.GetMessage("save xslt label"); dr[1] = collLpath["SaveXslt"]; dt.Rows.Add(dr); dr = dt.NewRow(); dr[0] = m_refMsg.GetMessage("advanced config label"); dr[1] = collLpath["XmlAdvConfig"]; dt.Rows.Add(dr); dr = dt.NewRow(); dr[0] = "<strong class=\'headerRow\'>" + m_refMsg.GetMessage("validation info label") + "</strong>"; dr[1] = "REMOVE-ITEM"; dt.Rows.Add(dr); dr = dt.NewRow(); dr[0] = m_refMsg.GetMessage("xml schema label"); dr[1] = collLpath["XmlSchema"]; dt.Rows.Add(dr); dr = dt.NewRow(); dr[0] = m_refMsg.GetMessage("target namespace label"); dr[1] = collLpath["XmlNameSpace"]; dt.Rows.Add(dr); } DataView dv = new DataView(dt); PropertiesGrid.DataSource = dv; PropertiesGrid.DataBind(); }
private void ViewProductTypeToolBar(XmlConfigData product_type_data) { System.Text.StringBuilder result = new System.Text.StringBuilder(); string pkDisplay = product_type_data.PackageDisplayXslt; //cXmlCollection("PackageDisplayXslt") string PackageXslt = product_type_data.PackageXslt; //cXmlCollection("PackageXslt") string caller = Request.QueryString["caller"]; result.Append("<table><tr>"); txtTitleBar.InnerHtml = m_refStyle.GetTitleBar((string)(m_refMsg.GetMessage("lbl view product type msg") + " \"" + product_type_data.Title + "\"")); if (caller == "") { result.Append(m_refStyle.GetButtonEventsWCaption(m_refContentApi.AppPath + "images/UI/Icons/back.png", m_sProductTypePage, m_refMsg.GetMessage("alt back button text"), m_refMsg.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true)); result.Append(m_refStyle.GetButtonEventsWCaption(m_refContentApi.AppPath + "images/UI/Icons/contentEdit.png", m_sProductTypePage + "?action=editproducttype&id=" + ConfigId + "", m_refMsg.GetMessage("alt edit button text (xml config)"), m_refMsg.GetMessage("btn edit"), "", StyleHelper.EditButtonCssClass, true)); if ((product_type_data.EditXslt.Length == 0) || pkDisplay.Length > 0) { result.Append(m_refStyle.GetButtonEventsWCaption(m_refContentApi.AppPath + "images/ui/icons/contentSmartFormEdit.png", "../editdesign.aspx?action=EditPackage&type=product&id=" + ConfigId + "", m_refMsg.GetMessage("alt Design mode Package"), m_refMsg.GetMessage("btn data design"), "", StyleHelper.EditSmartformButtonCssClass)); } // result.Append(m_refStyle.GetButtonEventsWCaption(m_refContentApi.AppPath & "images/UI/Icons/add.png", m_sProductTypePage & "?action=newinheritproducttype&id=" & ConfigId & "", m_refMsg.GetMessage("alt Create a new xml configuration based on this configuration"), m_refMsg.GetMessage("btn add xml"), "")) if (pkDisplay.Length > 0) { result.Append(m_refStyle.GetButtonEventsWCaption(m_refContentApi.AppPath + "images/ui/icons/FileTypes/xsl.png", "../viewXslt.aspx?id=" + ConfigId + "", m_refMsg.GetMessage("alt View the presentation Xslt"), m_refMsg.GetMessage("btn view xslt"), "", StyleHelper.ViewXslButtonCssClass)); } result.Append(m_refStyle.GetButtonEventsWCaption(m_refContentApi.AppPath + "images/UI/Icons/delete.png", m_sProductTypePage + "?action=deleteproducttype&id=" + ConfigId + "", m_refMsg.GetMessage("alt delete button text (xml config)"), m_refMsg.GetMessage("btn delete"), "OnClick=\"return ConfirmDelete();\"", StyleHelper.DeleteButtonCssClass)); } else { result.Append(m_refStyle.GetButtonEventsWCaption(m_refContentApi.AppPath + "images/UI/Icons/cancel.png", "", m_refMsg.GetMessage("alt back button text"), m_refMsg.GetMessage("btn cancel"), "OnClick=\"javascript:self.close();\"", StyleHelper.CancelButtonCssClass, true)); } result.Append(StyleHelper.ActionBarDivider); result.Append("<td>"); result.Append(m_refStyle.GetHelpButton(m_strPageAction, "")); result.Append("</td>"); result.Append("</tr></table>"); htmToolBar.InnerHtml = result.ToString(); result = null; }
public static bool IsNonFormattedContentAllowed(XmlConfigData[] active_list) { return Ektron.Cms.Common.EkFunctions.IsNonFormattedContentAllowed(active_list); }
private void PopulateDisplayGrid(XmlConfigData xml_config_data) { System.Web.UI.WebControls.BoundColumn colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "TITLE"; colBound.HeaderText = ""; colBound.ItemStyle.Wrap = false; colBound.HeaderStyle.Height = Unit.Empty; colBound.ItemStyle.Height = Unit.Empty; colBound.ItemStyle.CssClass = "label"; DisplayGrid.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "VALUE"; colBound.HeaderText = ""; colBound.ItemStyle.Wrap = false; colBound.HeaderStyle.Height = Unit.Empty; colBound.ItemStyle.Height = Unit.Empty; DisplayGrid.Columns.Add(colBound); DataTable dt = new DataTable(); DataRow dr; bool bValidDefaultXslt = false; dt.Columns.Add(new DataColumn("TITLE", typeof(string))); dt.Columns.Add(new DataColumn("VALUE", typeof(string))); dr = dt.NewRow(); dr[0] = m_refMsg.GetMessage("xslt 1 label"); Collection collLPath = (Collection)xml_config_data.LogicalPathComplete; if (xml_config_data.DefaultXslt == "1") { if (collLPath["Xslt1"].ToString() != "") { bValidDefaultXslt = true; dr[0] += "*"; } } dr[1] = collLPath["Xslt1"]; dt.Rows.Add(dr); dr = dt.NewRow(); dr[0] = m_refMsg.GetMessage("xslt 2 label"); if (xml_config_data.DefaultXslt == "2") { if (!string.IsNullOrEmpty(collLPath["Xslt2"].ToString())) { bValidDefaultXslt = true; dr[0] += "*"; } } dr[1] = collLPath["Xslt2"]; dt.Rows.Add(dr); dr = dt.NewRow(); dr[0] = m_refMsg.GetMessage("xslt 3 label"); if (xml_config_data.DefaultXslt == "3") { if (!string.IsNullOrEmpty(collLPath["Xslt3"].ToString())) { bValidDefaultXslt = true; dr[0] += "*"; } } dr[1] = collLPath["Xslt3"]; dt.Rows.Add(dr); dr = dt.NewRow(); dr[0] = m_refMsg.GetMessage("lbl XSLT packaged"); if (xml_config_data.DefaultXslt == "0") { dr[0] += "*"; } else { if (!(bValidDefaultXslt)) { dr[0] += "*"; } } dr[1] = " "; dt.Rows.Add(dr); if (xml_config_data.PackageXslt.Length > 0) { dr = dt.NewRow(); dr = dt.NewRow(); dr[0] = "<strong class=\'headerRow\'>" + m_refMsg.GetMessage("lbl xpaths") + "</strong>"; dr[1] = "REMOVE-ITEM"; dt.Rows.Add(dr); dr = dt.NewRow(); dr[0] = ""; foreach (object item in m_refContentApi.GetXPaths(xml_config_data.PackageXslt)) { dr[0] += "<label class=\"addLeft\">" + Convert.ToString(item) + "</label><br/>"; } dr[1] = "REMOVE-ITEM"; dt.Rows.Add(dr); } DataView dv = new DataView(dt); DisplayGrid.DataSource = dv; DisplayGrid.DataBind(); }
public static bool IsDefaultXmlConfig(long xml_id, XmlConfigData[] active_list) { foreach (XmlConfigData xmlData in active_list) { if (xmlData.Id == xml_id) { if (xmlData.IsDefault) { return true; } else { return false; } } } return false; }
public static bool IsHTMLDefault(XmlConfigData[] active_list) { foreach (XmlConfigData xmlData in active_list) { if (xmlData.IsDefault && xmlData.Id != 0) { return false; } } return true; }
private void DisplayControl() { if (_IsProduct) { EditProductDesignToolBar(); } else { EditDesignToolBar(); } _XmlId = _Id; //stop _StyleSheets = (Collection)_EkContent.GetAllStyleSheets(); _StyleCount = Convert.ToInt32(_StyleSheets["NumberOfStyleSheets"]); _st = new object[_StyleCount + 1]; for (_ii = 1; _ii <= _StyleCount; _ii++) { _KeyName = "StyleSheet_" + _ii; _st[_ii] = _StyleSheets[_KeyName]; } _XmlConfigData = _ContentApi.GetXmlConfiguration(_Id); PermissionData cPer; object content_html; object content_title; object content_stylesheet; cPer = _ContentApi.LoadPermissions(_Id, "content", 0); content_html = _XmlConfigData.PackageXslt; _StyleSheet = _XmlConfigData.DesignStyleSheet; content_title = "Design Mode"; content_stylesheet = ""; TD_ColTitle.InnerHtml = _XmlConfigData.Title; if (_StyleCount != 0) { stylesheetoptions.Items.Add(new ListItem("--" + "-- Select a style sheet --" + "--", "ignore")); for (_ii = 1; _ii <= _StyleCount; _ii++) { stylesheetoptions.Items.Add(new ListItem(_st[_ii].ToString(), _st[_ii].ToString())); } if (_StyleSheet != "") { stylesheetoptions.SelectedValue = _StyleSheet; } stylesheetoptions.Attributes.Add("onchange", "SetStyleSheet();"); } SettingsData SiteVars; SiteVars = (new SiteAPI()).GetSiteVariables(_CurrentUserId); _MaxContLength = Convert.ToInt32(SiteVars.MaxContentSize); _XmlStartTag = "<index_cms>"; _XmlEndTag = "</index_cms>"; _MyStart = content_html.ToString().IndexOf(_XmlStartTag.ToString()) + 1; _IndexCms = ""; if (_MyStart > 0) { _MyEnd = content_html.ToString().IndexOf(_XmlEndTag.ToString()) + 1; if (_MyEnd > 0) { _MyStart = _MyStart + Strings.Len(_XmlStartTag); _MyLength = _MyEnd - _MyStart; _IndexCms = Strings.Mid(content_html.ToString(), System.Convert.ToInt32(_MyStart), System.Convert.ToInt32(_MyLength)); _IndexCms = EkFunctions.HtmlEncode(_IndexCms.ToString()); } } _ContLoop = 1; if (content_html.ToString().Length > _MaxContLength) { _Var1 = System.Convert.ToString(Strings.Len(content_html)); } else { _Var1 = _MaxContLength.ToString(); } while (_ContLoop <= Convert.ToInt64(_Var1)) { hiddenfields.Text += "<input type=\"hidden\" name=\"hiddencontent" + (_Segment + 1) + "\" value=\"\">"; _ContLoop = _ContLoop + 65000; _Segment = System.Convert.ToInt32(_Segment + 1); } loadSegmentsFn.Text = GetLoadSegmentsScript(); if (_UploadPrivs == false) { DisabledUpload.Text = "DisableUpload(\'content_html\');"; } if ("ContentDesigner" == _SelectedEditControl) { _ContentDesigner.Visible = true; _ContentDesigner.Width = new Unit(100, UnitType.Percentage); _ContentDesigner.Height = new Unit(635, UnitType.Pixel); string smartFormDesign = _ContentApi.TransformXsltPackage(content_html.ToString(), Server.MapPath((string) (_ContentDesigner.ScriptLocation + "unpackageDesign.xslt")), true); _ContentDesigner.Content = smartFormDesign; // Selecting a CSS stylesheet is only for eWebEditPro SelectStyleCaption.Visible = false; SelectStyleControl.Visible = false; } else { Ektron.Cms.Controls.HtmlEditor ctlEditor = new Ektron.Cms.Controls.HtmlEditor(); phEditContent.Controls.Remove(_ContentDesigner); ctlEditor.WorkareaMode(2); // We are designing in the workarea ctlEditor.ID = "content_html"; ctlEditor.Width = new Unit(100, UnitType.Percentage); ctlEditor.Height = new Unit(90, UnitType.Percentage); ctlEditor.Path = _AppeWebPath; ctlEditor.MaxContentSize = System.Convert.ToInt32(_MaxContLength); ctlEditor.Text = content_html.ToString(); phEditContent.Controls.Add(ctlEditor); } }
public bool EditProductType() { if (!(Request.QueryString["id"] == null)) { if (Request.QueryString["id"] != "") { m_intId = Convert.ToInt64(Request.QueryString["id"]); } } if (!(Page.IsPostBack)) { if (PageAction.ToString().ToLower() == "newinheritconfiguration") { // Display_NewInheritProductType() } else { Display_EditProductType(); } return (false); } else { cXmlCollection = new XmlConfigData(); if (PageAction == "newinheritconfiguration") { // Process_ReplicateXmlConfig() return (true); } else { return (Process_UpdateProductType()); } } }
private void Display_EditXmlConfig() { cXmlCollection = _ContentApi.GetXmlConfiguration(m_intId); if (cXmlCollection == null) { cXmlCollection = new XmlConfigData(); } EditXmlConfigToolBar(); m_strTitle = cXmlCollection.Title; pkDisplay = cXmlCollection.PackageDisplayXslt; }
private void Display_EditProductType() { cXmlCollection = _ContentApi.GetXmlConfiguration(m_intId); if (cXmlCollection == null) { cXmlCollection = new XmlConfigData(); } lbl_desc.Text = m_refMsg.GetMessage("generic description"); // m_strTitle = pProductType.Title // pkDisplay = pProductType.PackageDisplayXslt }
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)); } }