private string DrawContentTemplatesEntry(int row_id, string name, long template_id, bool isEnabled) { StringBuilder str = new StringBuilder(); bool isDefault = false; if (template_id == _FolderData.TemplateId) { isDefault = true; } str.Append("<tr id=\"trow_" + template_id + "\">"); str.Append("<td width=\"10%\" class=\"center\">"); if (isDefault == true && isEnabled) { str.Append("<input type=\"radio\" id=\"tdefault\" name=\"tdefault\" value=\"" + name + "\" checked disabled />"); } else if (isDefault == true && !isEnabled) { str.Append("<input type=\"radio\" id=\"tdefault\" name=\"tdefault\" value=\"" + name + "\" checked disabled />"); } else if (!isEnabled) { str.Append("<input type=\"radio\" id=\"tdefault\" name=\"tdefault\" value=\"" + name + "\" disabled />"); } else { str.Append("<input type=\"radio\" id=\"tdefault\" name=\"tdefault\" value=\"" + name + "\" disabled />"); } str.Append("</td>"); str.Append("<td width=\"90%\" colspan=\"2\">"); str.Append(name); Ektron.Cms.PageBuilder.WireframeData wfd = new Ektron.Cms.PageBuilder.WireframeModel().FindByTemplateID(template_id); if (wfd != null) { if (wfd.Template.SubType == EkEnumeration.TemplateSubType.Wireframes) { str.Append(" (" + _MessageHelper.GetMessage("lbl pagebuilder wireframe template") + ")"); } else if (wfd.Template.SubType == EkEnumeration.TemplateSubType.MasterLayout) { str.Append(" (" + _MessageHelper.GetMessage("lbl pagebuilder master layouts") + ")"); } } str.Append("<input id=\"tinput_" + template_id + "\" name=\"tinput_" + template_id + "\" type=\"hidden\" value=\"" + template_id + "\" />"); str.Append("</td>"); str.Append("</tr>"); return str.ToString(); }
private void UpdateTemplate() { long template_id = System.Convert.ToInt64(Request.QueryString["id"]); SetTitleBarToMessage("lbl update template"); criteria.AddFilter(Ektron.Cms.Device.CmsDeviceConfigurationProperty.Id, CriteriaFilterOperator.GreaterThanOrEqualTo, "0"); dList = cDevice.GetList(criteria); if (Request.Form["updateTemplate"] == null) { TemplateData templateData = m_refContentApi.EkContentRef.GetTemplateInfoByID(template_id); string templateName = templateData.FileName; sitePathValue.Text = "<td class=\"nowrap\">" + m_refContentApi.SitePath + "</td><td class=\"fullWidth\"><input type=\"text\" id=\"updateTemplate\" maxlength=\"180\" class=\"fullWidth\" name=\"updateTemplate\" value=\"" + templateName + "\"/></td>"; ltrTemplateDetails.Text = "<tr><td>" + m_refMsg.GetMessage("lbl template name") + ":</td><td></td><td><input id=\"updatetemplateName\" title=\"" + m_refMsg.GetMessage("lbl template name") + "\" maxlength=\"50\" name=\"updatetemplateName\" type=\"text\" value=\"" + templateData.TemplateName + "\"/></td></tr>" + "<tr><td>" + m_refMsg.GetMessage("lbl template description") + ":</td><td></td><td><input id=\"updatetemplateDescription\" title=\"" + m_refMsg.GetMessage("lbl template description") + "\" maxlength=\"200\" name=\"updatetemplateDescription\" type=\"text\" value=\"" + templateData.Description + "\"/></td></tr>"; browsebuttontd.Visible = true; cbPageBuilderTemplate.Enabled = true; pnlPageBuilder.Visible = true; Ektron.Cms.Widget.WidgetTypeModel model = new Ektron.Cms.Widget.WidgetTypeModel(); Ektron.Cms.Widget.WidgetTypeData[] widgetTypes = model.FindAll(); repWidgetTypes.DataSource = widgetTypes; repWidgetTypes.DataBind(); Ektron.Cms.PageBuilder.WireframeModel wireframeModel = new Ektron.Cms.PageBuilder.WireframeModel(); Ektron.Cms.PageBuilder.WireframeData wireframe = wireframeModel.FindByTemplateID(template_id); if (wireframe != null) { Ektron.Cms.Widget.WidgetTypeData[] selectedWidgets = wireframeModel.GetAssociatedWidgetTypes(wireframe.ID); //lblThumbnailFileName.Text = wireframe.ThumbnailFile List<string> widgetIds = new List<string>(); foreach (Ektron.Cms.Widget.WidgetTypeData widget in selectedWidgets) { widgetIds.Add(widget.ID.ToString()); } ClientScript.RegisterClientScriptBlock(this.GetType(), "pageBuilderSelectedIds", "Ektron.ready(function(){SelectWidgets([" + string.Join(", ", widgetIds.ToArray()) + "]);});", true); cbPageBuilderTemplate.Checked = true; if (wireframe.Template.SubType == Ektron.Cms.Common.EkEnumeration.TemplateSubType.MasterLayout) { browsebuttontd.Visible = false; sitePathValue.Text = "<td class=\"nowrap\">" + templateName + "</td><td class=\"fullWidth\"><input type=\"text\" id=\"updateTemplate\" class=\"masterlayout\" style=\"display:none\" name=\"updateTemplate\" value=\"" + templateName + "\"/></td>"; cbPageBuilderTemplate.Enabled = false; } } //Code to show device types string valDeviceInputs = ""; if (m_refContentApi.RequestInformationRef.IsDeviceDetectionEnabled) { List<DeviceTemplateData> templateDevices = m_refContentApi.EkContentRef.GetTemplateDevicesByID(template_id); StringBuilder sb = new StringBuilder(); if ((dList.Count > 0)) { Int32 i = 0; sb.Append("<tr>").Append(Environment.NewLine); sb.Append(" <td >").Append(Environment.NewLine); sb.Append(" <br/><label class=\"deviceheader\" for=\"lblDeviceConfiguration\">").Append(m_refMsg.GetMessage("device configuration")).Append("</label>").Append(Environment.NewLine); sb.Append(" </td>").Append(Environment.NewLine); sb.Append("</tr>").Append(Environment.NewLine); foreach (CmsDeviceConfigurationData dItem in dList) { if (dItem.Name != "Generic") { chkID = dItem.Id; DeviceTemplateData deviceMatch = templateDevices.Find(GetDeviceItem); sb.Append("<tr>").Append(Environment.NewLine); sb.Append(" <td class=\"devicelabel\">").Append(Environment.NewLine); if ((deviceMatch != null) && deviceMatch.IsEnabled == true) { sb.Append(" <input type=\"checkbox\" class=\"pageBuilderCheckbox clearfix\" checked=\"checked\" name=\"cbDeviceTemplate_").Append(dItem.Id).Append("\" id=\"cbDeviceTemplate_").Append(dItem.Id).Append("\" />").Append(Environment.NewLine); } else { sb.Append(" <input type=\"checkbox\" class=\"pageBuilderCheckbox clearfix\" name=\"cbDeviceTemplate_").Append(dItem.Id).Append("\" id=\"cbDeviceTemplate_").Append(dItem.Id).Append("\" />").Append(Environment.NewLine); } sb.Append(" <label for=\"addTemplateDevice_").Append(dItem.Id).Append("\">").Append(dItem.Name).Append("</label>").Append(Environment.NewLine); sb.Append(" </td>").Append(Environment.NewLine); sb.Append(" <td class=\"nowrap\">").Append(Environment.NewLine); sb.Append(m_refContentApi.SitePath).Append(Environment.NewLine); sb.Append(" </td>").Append(Environment.NewLine); sb.Append(" <td>").Append(Environment.NewLine); if ((deviceMatch != null)) { sb.Append(" <input type=\"text\" id=\"updateDeviceTemplate_").Append(dItem.Id).Append("\" maxlength=\"180\" class=\"masterlayout\" name=\"updateDeviceTemplate_").Append(dItem.Id).Append("\" value=\"").Append(deviceMatch.FileName).Append("\" />"); } else { sb.Append(" <input type=\"text\" id=\"updateDeviceTemplate_").Append(dItem.Id).Append("\" maxlength=\"180\" class=\"masterlayout\" name=\"updateDeviceTemplate_").Append(dItem.Id).Append("\" value=\"\" />"); } sb.Append(" </td>").Append(Environment.NewLine); sb.Append(" <td class=\"value\">").Append(Environment.NewLine); sb.Append(" <input type=\"button\" id=\"btnDeviceTemplate_").Append(dItem.Id).Append("\" value=\"...\" class=\"ektronModal browseButton\" onclick=\"SetBtnClicked(").Append(dItem.Id).Append(");OnBrowseButtonClicked()\" />").Append(Environment.NewLine); sb.Append(" </td>").Append(Environment.NewLine); sb.Append("<tr>").Append(Environment.NewLine); if (i > 0) { valDeviceInputs += "," + dItem.Id; } else { valDeviceInputs += dItem.Id; } i = i + 1; } } ltrDeviceConfigurations.Text = sb.ToString(); } } AddBackButton("template_config.aspx?view=list"); AddButton(m_refContentApi.AppPath + "images/UI/Icons/save.png", "javascript:ConfirmNotEmpty('updateTemplate','" + valDeviceInputs + "');", m_refMsg.GetMessage("lbl update template"), m_refMsg.GetMessage("lbl update template"), "", StyleHelper.SaveButtonCssClass, true); AddHelpButton("template_update"); } else { Ektron.Cms.PageBuilder.WireframeModel wireframeModel = new Ektron.Cms.PageBuilder.WireframeModel(); Ektron.Cms.PageBuilder.WireframeData wireframe = wireframeModel.FindByTemplateID(template_id); if (wireframe != null) { if (cbPageBuilderTemplate.Checked == true) { wireframe.Path = Request.Form["updateTemplate"]; wireframe.Template.FileName = wireframe.Path; wireframe.Template.Description = AntiXss.HtmlEncode(Request.Form["updatetemplateDescription"]); wireframe.Template.TemplateName = AntiXss.HtmlEncode(Request.Form["updatetemplateName"]); if (wireframe.Template.SubType == Ektron.Cms.Common.EkEnumeration.TemplateSubType.MasterLayout) { wireframe.Template.Thumbnail = m_templateModel.GenerateThumbnail(wireframe.Template.MasterLayoutID); } else { string tempLocation = string.Empty; if (wireframe.Path.IndexOf("?") != -1) { tempLocation = wireframe.Path.Substring(0, wireframe.Path.IndexOf("?")).ToString(); } else { tempLocation = wireframe.Path; } wireframe.Template.Thumbnail = m_templateModel.GenerateThumbnail(tempLocation); } wireframeModel.Update(wireframe); wireframeModel.RemoveAllWidgetTypeAssociations(wireframe.ID); foreach (string Key in Request.Form.AllKeys) { if (Key.StartsWith("widget")) { try { wireframeModel.AddWidgetTypeAssociation(wireframe.ID, long.Parse(Key.Substring(6))); } catch (Exception ex) { EkException.ThrowException(ex); } } } } else { wireframeModel.Remove(wireframe.ID); } } else if (cbPageBuilderTemplate.Checked) { string strThumbnail = (string)(m_templateModel.GenerateThumbnail(Request.Form["updateTemplate"].ToString())); wireframe = wireframeModel.Create(Request.Form["updateTemplate"], template_id, System.IO.Path.GetFileName(strThumbnail), AntiXss.HtmlEncode(Request.Form["updatetemplateDescription"].ToString()), AntiXss.HtmlEncode(Request.Form["updatetemplateName"].ToString())); foreach (string Key in Request.Form.AllKeys) { if (Key.StartsWith("widget")) { try { wireframeModel.AddWidgetTypeAssociation(wireframe.ID, long.Parse(Key.Substring(6))); } catch (Exception ex) { EkException.ThrowException(ex); } } } } else { Collection newtemplatedata = new Collection(); TemplateData updateTemplateData = new TemplateData(); updateTemplateData.Id = template_id; updateTemplateData.FileName = Request.Form["updateTemplate"].ToString(); updateTemplateData.Description = AntiXss.HtmlEncode(Request.Form["updatetemplateDescription"].ToString()); updateTemplateData.TemplateName = AntiXss.HtmlEncode(Request.Form["updatetemplateName"].ToString()); m_refContentApi.EkContentRef.UpdateTemplatev2_0(updateTemplateData); } if (m_refContentApi.RequestInformationRef.IsDeviceDetectionEnabled) { SaveDeviceTemplates(dList, template_id, "update"); } Response.Redirect("template_config.aspx?view=list", false); } }
private void DeleteTemplate() { long template_id = System.Convert.ToInt64(Request.QueryString["id"]); Ektron.Cms.PageBuilder.WireframeModel wireframeModel = new Ektron.Cms.PageBuilder.WireframeModel(); Ektron.Cms.PageBuilder.WireframeData wireframe = wireframeModel.FindByTemplateID(template_id); SetTitleBarToMessage("lbl delete template"); AddBackButton("template_config.aspx?view=list"); AddHelpButton("template_delete"); long[] folders = m_refContentApi.EkContentRef.GetTemplateDefaultFolderUsage(template_id); Collection contentBlockInfo = m_refContentApi.EkContentRef.GetTemplateContentBlockUsage(template_id); StringBuilder str = new StringBuilder(); str.Append("<div class=\"ektronPageContainer\">"); if (folders.Length > 0) { str.Append(m_refMsg.GetMessage("lbl folders with") + " " + "\'<i>" + m_refContentApi.EkContentRef.GetTemplateNameByID(template_id) + "</i>\'" + " " + m_refMsg.GetMessage("lbl as their default template") + ":"); str.Append("<div class=\"ektronTopSpace\"></div>"); str.Append("<table width=\"100%\" class=\"ektronGrid ektronBorder\">"); str.Append("<tbody>"); str.Append("<tr class=\"title-header\">"); str.Append("<th>Folder Path</th>"); str.Append("</tr>"); int i = 0; for (i = 0; i <= folders.Length - 1; i++) { str.Append("<tr>"); str.Append("<td>" + m_refContentApi.GetFolderById(folders[i]).NameWithPath + "</td>"); str.Append("</tr>"); } str.Append("</tbody>"); str.Append("</table>"); str.Append("<div class=\"ektronTopSpace\"></div>"); str.Append(m_refMsg.GetMessage("alert msg set folders") + " " + "\'<i>" + m_refContentApi.EkContentRef.GetTemplateNameByID(template_id) + "</i>\'."); } else { if (contentBlockInfo.Count == 0 || !(Request.Form["deleteTemplate"] == null)) { bool messageadded = false; if (wireframe != null) { if (wireframe.Template.SubType == Ektron.Cms.Common.EkEnumeration.TemplateSubType.MasterLayout) { //delete the layout as well Ektron.Cms.PageBuilder.TemplateModel templmodel = new Ektron.Cms.PageBuilder.TemplateModel(); string status = string.Empty; Ektron.Cms.SiteAPI siteApi = new Ektron.Cms.SiteAPI(); Ektron.Cms.LanguageData[] langData = siteApi.GetAllActiveLanguages(); int j = 0; for (j = 0; j <= langData.Length - 1; j++) { long contType = this.ContentAPIRef.EkContentRef.GetContentType(wireframe.Template.MasterLayoutID, langData[j].Id); if (contType != 0) { int tempLang = System.Convert.ToInt32(ContentAPIRef.ContentLanguage); ContentAPIRef.ContentLanguage = langData[j].Id; status = (string)(this.ContentAPIRef.EkContentRef.GetContentStatev2_0(wireframe.Template.MasterLayoutID)["ContentStatus"]); if (status == "O" || status == "S") { Collection permissions = ContentAPIRef.EkContentRef.CanIv2_0(wireframe.Template.MasterLayoutID, "content"); if (permissions.Contains("CanIApprove") && System.Convert.ToBoolean(permissions["CanIApprove"])) { ContentAPIRef.EkContentRef.TakeOwnership(wireframe.Template.MasterLayoutID); } } if (status == "S") { ContentAPIRef.EkContentRef.CheckContentOutv2_0(wireframe.Template.MasterLayoutID); } status = (string)(this.ContentAPIRef.EkContentRef.GetContentStatev2_0(wireframe.Template.MasterLayoutID)["ContentStatus"]); if (status == "O") { ContentAPIRef.EkContentRef.CheckIn(wireframe.Template.MasterLayoutID, ""); } Ektron.Cms.Content.Behaviors.DeleteContentBehavior deletebehavior = new Ektron.Cms.Content.Behaviors.DeleteContentBehavior(ContentAPIRef.RequestInformationRef); deletebehavior.Delete(wireframe.Template.MasterLayoutID, null); ContentAPIRef.ContentLanguage = tempLang; //if content exists and status is now M then show tell user that layout has been marked for delete if (!messageadded) { Collection cont = ContentAPIRef.EkContentRef.GetContentByIDv2_0(wireframe.Template.MasterLayoutID); if (cont.Contains("ContentStatus")) { if ((string)cont["ContentStatus"] == "M") { str.Append("Template <i>" + wireframe.Template.FileName + "</i> is a Master Layout and has been marked for delete. When an approver approves this delete it will be removed from the templates list."); messageadded = true; } } } } } } else { wireframeModel.Remove(wireframe.ID); Response.Redirect("template_config.aspx", false); } } try { m_refContentApi.EkContentRef.PurgeTemplate(template_id); } catch (Exception ex) { string _error = ex.Message; } if (!messageadded) { Response.Redirect("template_config.aspx", false); } } else { LocalizationAPI objLocalizationApi = new LocalizationAPI(); str.Append(m_refMsg.GetMessage("lbl content with") + " " + "\'<i>" + m_refContentApi.EkContentRef.GetTemplateNameByID(template_id) + "</i>\'" + " " + m_refMsg.GetMessage("lbl as a template") + ":"); str.Append("<div class=\"ektronTopSpace\"></div>"); str.Append("<table width=\"100%\" class=\"ektronGrid ektronBorder\">"); str.Append("<tbody>"); str.Append("<tr class=\"title-header\">"); str.Append("<th width=\"70%\" align=\"center\">Title</th>"); str.Append("<th width=\"15%\" align=\"center\">ID</th>"); str.Append("<th width=\"15%\" align=\"center\">Language</th>"); str.Append("</tr>"); int i = 0; foreach (Collection col in contentBlockInfo) { str.Append("<tr>"); m_refContentApi.ContentLanguage = Convert.ToInt32(col["language_id"]); ContentData content_data = m_refContentApi.EkContentRef.GetContentById(Convert.ToInt64(col["content_id"]), Ektron.Cms.Content.EkContent.ContentResultType.Published); str.Append("<td>" + content_data.Title + "</td>"); str.Append("<td align=\"center\">" + content_data.Id + "</td>"); str.Append("<td align=\"center\"><img src=\"" + objLocalizationApi.GetFlagUrlByLanguageID(content_data.LanguageId) + "\" /></td>"); str.Append("</tr>"); i++; } str.Append("</tbody>"); str.Append("</table>"); if (wireframe == null || wireframe.Template.SubType != Ektron.Cms.Common.EkEnumeration.TemplateSubType.MasterLayout) { str.Append("<div class=\"ektronTopSpace\"></div>"); str.Append(m_refMsg.GetMessage("alert msg del template")); str.Append(" <input type=\"submit\" id=\"deleteTemplate\" name=\"deleteTemplate\" value=\"Delete\" /> "); str.Append("<input type=\"button\" id=\"cancelDelete\" name=\"cancelDelete\" value=\"Cancel\" onclick=\"window.location.replace(\'template_config.aspx\')\" />"); } else { str.Append("<div class=\"ektronTopSpace\"></div>"); str.Append(m_refMsg.GetMessage("alert msg set layout") + " " + "\'<i>" + wireframe.Template.FileName + "</i>\'."); } } } str.Append("</div>"); MainBody.Text = str.ToString(); }
private void AddTemplate() { SetTitleBarToMessage("lbl add new template"); criteria.AddFilter(Ektron.Cms.Device.CmsDeviceConfigurationProperty.Id, CriteriaFilterOperator.GreaterThanOrEqualTo, "0"); dList = cDevice.GetList(criteria); if (Request.Form["addTemplate"] == null) { sitePathValue.Text = "<td class=\"nowrap\">" + m_refContentApi.SitePath + "</td><td><input type=\"text\" id=\"addTemplate\" maxlength=\"180\" onkeypress=\"return disableEnterKey(event)\" class=\"ektronInputTextMedium\" name=\"addTemplate\" value=\"\"/></td>"; ltrTemplateDetails.Text = "<tr><td>" + m_refMsg.GetMessage("lbl template name") + ":</td><td></td><td><input id=\"templateName\" title=\"" + m_refMsg.GetMessage("lbl template name") + "\" maxlength=\"50\" name=\"templateName\" type=\"text\" value=\"\"/></td></tr>" + "<tr><td>" + m_refMsg.GetMessage("lbl template description") + ":</td><td></td><td><input id=\"templateDescription\" title=\"" + m_refMsg.GetMessage("lbl template description") + "\" maxlength=\"200\" name=\"templateDescription\" type=\"text\" value=\"\"/></td></tr>"; pnlPageBuilder.Visible = true; Ektron.Cms.Widget.WidgetTypeController.SyncWidgetsDirectory(m_refContentApi.RequestInformationRef.WidgetsPath); Ektron.Cms.Widget.WidgetTypeModel model = new Ektron.Cms.Widget.WidgetTypeModel(); Ektron.Cms.Widget.WidgetTypeData[] widgetTypes = model.FindAll(); repWidgetTypes.DataSource = widgetTypes; repWidgetTypes.DataBind(); string valDeviceInputs = ""; if ((m_refContentApi.RequestInformationRef.IsDeviceDetectionEnabled)) { StringBuilder sb = new StringBuilder(); if ((dList.Count > 0)) { Int32 i = 0; sb.Append("<tr>").Append(Environment.NewLine); sb.Append(" <td >").Append(Environment.NewLine); sb.Append(" <br/><label class=\"deviceheader\" for=\"lblDeviceConfiguration\">").Append("Device Configurations").Append("</label>").Append(Environment.NewLine); sb.Append(" </td>").Append(Environment.NewLine); sb.Append("</tr>").Append(Environment.NewLine); foreach (CmsDeviceConfigurationData dItem in dList) { if (dItem.Name != "Generic") { sb.Append("<tr>").Append(Environment.NewLine); sb.Append(" <td class=\"devicelabel\" >").Append(Environment.NewLine); sb.Append(" <input type=\"checkbox\" class=\"pageBuilderCheckbox clearfix\" name=\"cbDeviceTemplate_").Append(dItem.Id).Append("\" id=\"cbDeviceTemplate_").Append(dItem.Id).Append("\" />").Append(Environment.NewLine); sb.Append(" <label for=\"addTemplateDevice_").Append(dItem.Id).Append("\">").Append(dItem.Name).Append("</label>").Append(Environment.NewLine); sb.Append(" </td>").Append(Environment.NewLine); sb.Append(" <td class=\"nowrap\">").Append(Environment.NewLine); sb.Append(m_refContentApi.SitePath).Append(Environment.NewLine); sb.Append(" </td> ").Append(Environment.NewLine); sb.Append(" <td> ").Append(Environment.NewLine); sb.Append(" <input type=\"text\" id=\"updateDeviceTemplate_").Append(dItem.Id).Append("\" maxlength=\"180\" class=\"ektronInputTextMedium\" name=\"updateDeviceTemplate_").Append(dItem.Id).Append("\" value=\"\" />"); sb.Append(" </td>").Append(Environment.NewLine); sb.Append(" <td class=\"value\">").Append(Environment.NewLine); sb.Append(" <input type=\"button\" id=\"btnDeviceTemplate_").Append(dItem.Id).Append("\" value=\"...\" class=\"ektronModal browseButton\" onclick=\"SetBtnClicked(").Append(dItem.Id).Append(");OnBrowseButtonClicked()\" />").Append(Environment.NewLine); sb.Append(" </td>").Append(Environment.NewLine); sb.Append("</tr>").Append(Environment.NewLine); if (i > 0) { valDeviceInputs += "," + dItem.Id; } else { valDeviceInputs += dItem.Id; } i = i + 1; } } ltrDeviceConfigurations.Text = sb.ToString(); } } AddButton(m_refContentApi.AppPath + "images/UI/Icons/cancel.png", "javascript:CancelAddTemplate();", m_refMsg.GetMessage("btn cancel"), m_refMsg.GetMessage("btn cancel"), "", StyleHelper.CancelButtonCssClass, true); AddButton(m_refContentApi.AppPath + "images/UI/Icons/save.png", "javascript:ConfirmNotEmpty('addTemplate','" + valDeviceInputs + "');", m_refMsg.GetMessage("lbl Add New Template to System"), m_refMsg.GetMessage("lbl Add New Template to System"), "", StyleHelper.SaveButtonCssClass, true); AddHelpButton("template_add"); } else { long template_id = 0; string strThumbnail = ""; string strLocation = ""; if (Request.Form["addtemplate"].IndexOf("?") != -1) { strLocation = (string)(Request.Form["addTemplate"].Substring(0, System.Convert.ToInt32(Request.Form["addtemplate"].IndexOf("?"))).ToString()); } else { strLocation = (string)(Request.Form["addTemplate"].ToString()); } strThumbnail = (string)(m_templateModel.GenerateThumbnail(strLocation)); if (cbPageBuilderTemplate.Checked) { Ektron.Cms.PageBuilder.WireframeModel model = new Ektron.Cms.PageBuilder.WireframeModel(); Ektron.Cms.PageBuilder.WireframeData wireframe = model.Create(Request.Form["addTemplate"].ToString(), System.IO.Path.GetFileName(strThumbnail), AntiXss.HtmlEncode(Request.Form["templateDescription"].ToString()), AntiXss.HtmlEncode(Request.Form["templateName"].ToString())); if (wireframe.ID == 0) { Utilities.ShowError((string)(m_refMsg.GetMessage("msg template aleady exists"))); return; } foreach (string Key in Request.Form.AllKeys) { if (Key.StartsWith("widget")) { try { model.AddWidgetTypeAssociation(wireframe.ID, long.Parse(Key.Substring(6))); } catch (Exception ex) { EkException.ThrowException(ex); } } } template_id = wireframe.Template.Id; } else { Collection newtemplatedata = new Collection(); newtemplatedata.Add(Request.Form["addTemplate"].ToString(), "TemplateFileName", null, null); newtemplatedata.Add(AntiXss.HtmlEncode(Request.Form["templateName"].ToString()), "TemplateName", null, null); newtemplatedata.Add(AntiXss.HtmlEncode(Request.Form["templateDescription"].ToString()), "Description", null, null); template_id = m_refContentApi.EkContentRef.AddTemplatev2_0(newtemplatedata); if (template_id == 0) { Utilities.ShowError((string)(m_refMsg.GetMessage("msg template aleady exists"))); return; } } if (m_refContentApi.RequestInformationRef.IsDeviceDetectionEnabled) { SaveDeviceTemplates(dList, template_id, "add"); } ClientScript.RegisterClientScriptBlock(this.GetType(), "windowCloseScript", "AddTemplateEntry(" + template_id + ", \'" + (cbPageBuilderTemplate.Checked ? Request.Form["addTemplate"].ToString().Replace("\'", "\\\'") + " (Wireframe Template)" : Request.Form["addTemplate"].ToString().Replace("\'", "\\\'")) + "\');", true); //ClientScript.RegisterClientScriptBlock(this.GetType(), "windowCloseScript", "AddTemplateEntry(" + template_id + ", \'" + Request.Form["addTemplate"].ToString().Replace("\'", "\\\'") + "\');", true); } }
private void ViewContentByCategoryToolBar() { System.Text.StringBuilder result = new System.Text.StringBuilder(); string altText = ""; long ParentId = _FolderData.ParentId; int count = 0; int lAddMultiType = 0; bool bSelectedFound = false; bool bViewContent = System.Convert.ToBoolean("viewcontentbycategory" == _PageAction); // alternative is archived content Ektron.Cms.PageBuilder.WireframeModel wireframeModel = new Ektron.Cms.PageBuilder.WireframeModel(); if (bViewContent) { txtTitleBar.InnerHtml = _StyleHelper.GetTitleBar((string)(_MessageHelper.GetMessage("view contents of folder msg") + " \"" + _FolderData.Name + "\"")) + " <img style=\'vertical-align:middle;\' src=\'" + _LocalizationApi.GetFlagUrlByLanguageID(_ContentLanguage) + "\' />"; altText = _MessageHelper.GetMessage("Archive Content Title"); } else { txtTitleBar.InnerHtml = _StyleHelper.GetTitleBar((string)(_MessageHelper.GetMessage("view archive content title") + " \"" + _FolderData.Name + "\"")) + " <img style=\'vertical-align:middle;\' src=\'" + _LocalizationApi.GetFlagUrlByLanguageID(_ContentLanguage) + "\' />"; altText = _MessageHelper.GetMessage("view content title"); } result.Append("<table><tr>" + "\r\n"); if ((_PermissionData.CanAdd && bViewContent) || _PermissionData.IsReadOnly == true) { if (_PermissionData.CanAdd && bViewContent) { if (!bSelectedFound) { _ContentType = System.Convert.ToInt32(_CMSContentType_AllTypes); } } } string buttonId; if ((_PermissionData.CanAdd || _PermissionData.CanAddFolders) && bViewContent) { buttonId = Guid.NewGuid().ToString(); result.Append("<td class=\"menuRootItem\" onclick=\"MenuUtil.use(event, \'file\', \'" + buttonId + "\');\" onmouseover=\"this.className=\'menuRootItemSelected\';MenuUtil.use(event, \'file\', \'" + buttonId + "\');\" onmouseout=\"this.className=\'menuRootItem\'\"><span id=\"" + buttonId + "\" class=\"new\">" + _MessageHelper.GetMessage("lbl New") + "</span></td>"); } if ((_PermissionData.CanAdd) || _PermissionData.IsReadOnly) { buttonId = Guid.NewGuid().ToString(); result.Append("<td class=\"menuRootItem\" onclick=\"MenuUtil.use(event, \'view\', \'" + buttonId + "\');\" onmouseover=\"this.className=\'menuRootItemSelected\';MenuUtil.use(event, \'view\', \'" + buttonId + "\');\" onmouseout=\"this.className=\'menuRootItem\'\"><span id=\"" + buttonId + "\" class=\"folderView\">" + _MessageHelper.GetMessage("lbl View") + "</span></td>"); } int totalPages = 1; if (_PageAction == "viewarchivecontentbycategory") { // no comparable method; use member variable holding page count when viewing archived items (maybe we should always do this and drop the api hit of doing it again?) totalPages = _PagingTotalPagesNumber; } else { _ContentApi.GetChildContentByFolderId(_Id, false, "name", 1, ref totalPages, 1); } if ((_PermissionData.CanDeleteFolders && bViewContent && _Id != 0) || ((bViewContent && (_PermissionData.IsAdmin || IsFolderAdmin()) || _PermissionData.CanDelete) && totalPages > 0)) { buttonId = Guid.NewGuid().ToString(); result.Append("<td class=\"menuRootItem\" onclick=\"MenuUtil.use(event, \'delete\', \'" + buttonId + "\');\" onmouseover=\"this.className=\'menuRootItemSelected\';MenuUtil.use(event, \'delete\', \'" + buttonId + "\');\" onmouseout=\"this.className=\'menuRootItem\'\"><span id=\"" + buttonId + "\" class=\"delete\">" + _MessageHelper.GetMessage("lbl Delete") + "</span></td>"); } buttonId = Guid.NewGuid().ToString(); result.Append("<td class=\"menuRootItem\" onclick=\"MenuUtil.use(event, \'action\', \'" + buttonId + "\');\" onmouseover=\"this.className=\'menuRootItemSelected\';MenuUtil.use(event, \'action\', \'" + buttonId + "\');\" onmouseout=\"this.className=\'menuRootItem\'\"><span id=\"" + buttonId + "\" class=\"action\">" + _MessageHelper.GetMessage("lbl Action") + "</span></td>"); if (_EnableMultilingual == 1) { SiteAPI m_refsite = new SiteAPI(); LanguageData[] language_data = new LanguageData[1]; language_data = m_refsite.GetAllActiveLanguages(); } XmlConfigData[] active_xml_list; active_xml_list = _ContentApi.GetEnabledXmlConfigsByFolder(_FolderData.Id); bool smartFormsRequired = System.Convert.ToBoolean(!Utilities.IsNonFormattedContentAllowed(active_xml_list)); bool canAddAssets = System.Convert.ToBoolean((_PermissionData.CanAdd || _PermissionData.CanAddFolders) && bViewContent); if (_ContentLanguage < 1 || _FolderData.FolderType == Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.FolderType.Blog) || _FolderData.FolderType == Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.FolderType.DiscussionForum) || _FolderData.FolderType == Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.FolderType.DiscussionBoard) || smartFormsRequired == true || canAddAssets == false) { } else { if (Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(_ContentApi.RequestInformationRef, Feature.DocumentManagement, false)) { if (Request.Browser.Browser == "IE" && Request.UserAgent.Contains("Windows NT 6.0") && Request.ServerVariables["HTTPS"] == "on") //Vista IE Https then take the user to file upload since vista https is not supported by webdav { result.Append("<td id='DmsMenu'> <a class=\"ek_thickbox " + StyleHelper.MergeCssClasses(new string[2] { StyleHelper.SecondaryFunctionCssClass, StyleHelper.AddAssetButtonCssClass }) + "\" href=\"" + _ContentApi.AppPath + "edit.aspx?id=" + _FolderData.Id + "&ContType=103&type=add&close=false&lang_id=" + _ContentLanguage.ToString() + "title=\"" + _MessageHelper.GetMessage("lbl file upload") + "\"><img id=\"DeskTopHelp\" title= \"" + _MessageHelper.GetMessage("alt add assets text") + "\" border=\"0\" src=\"images/UI/Icons/Import.png\"/></a> </td>"); } else { //result.Append("<td id='DmsMenu'> <a class=\"ek_thickbox " + StyleHelper.MergeCssClasses(new string[2] { StyleHelper.SecondaryFunctionCssClass, StyleHelper.AddAssetButtonCssClass }) + "\" href=\"" + _ContentApi.AppPath + "DragDropCtl.aspx?id=" + _Id.ToString() + "&lang_id=" + _ContentLanguage.ToString() + "&EkTB_iframe=true&height=120&width=500&refreshCaller=true&scrolling=false&modal=true\" class=\"ek_thickbox\" title=\"" + _MessageHelper.GetMessage("document management system") + "\"><img id=\"DeskTopHelp\" title= \"" + _MessageHelper.GetMessage("alt add assets text") + "\" border=\"0\" src=\"images/UI/Icons/Import.png\"/></a> </td>"); result.Append("<td id='DmsMenu'> <a class=\"ek_thickbox " + StyleHelper.MergeCssClasses(new string[2] { StyleHelper.SecondaryFunctionCssClass, StyleHelper.AddAssetButtonCssClass }) + "\" href=\"#\" onclick=\"ektb_show('" + _MessageHelper.GetMessage("document management system") + "', '" + _ContentApi.AppPath + "DragDropCtl.aspx?id=" + _Id.ToString() + "&lang_id=" + _ContentLanguage.ToString() + "&height=120&width=500&refreshCaller=true&scrolling=false&modal=true&EkTB_iframe=true', null, '', false);\" class=\"ek_thickbox\" title=\"" + _MessageHelper.GetMessage("document management system") + "\"><img id=\"DeskTopHelp\" title= \"" + _MessageHelper.GetMessage("alt add assets text") + "\" border=\"0\" src=\"images/UI/Icons/Import.png\"/></a> </td>"); } } } result.Append(StyleHelper.ActionBarDivider); result.Append("<td>"); result.Append(_StyleHelper.GetHelpButton(_PageAction, "")); result.Append("</td>"); result.Append("</tr></table>"); result.Append("<script type=\"text/javascript\">" + Environment.NewLine); result.Append(" var filemenu = new Menu( \"file\" );" + Environment.NewLine); if (_PermissionData.CanAddFolders || (_ContentApi.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.CommerceAdmin) && Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(_ContentApi.RequestInformationRef, Ektron.Cms.DataIO.LicenseManager.Feature.eCommerce))) { if (_PermissionData.CanAddFolders) { if (!_FolderData.IsCommunityFolder) { result.Append(" filemenu.addItem(\" <img src=\'images/UI/Icons/folder.png\' /> " + _MessageHelper.GetMessage("lbl Folder") + "\", function() { window.location.href = \'content.aspx?LangType=" + _ContentLanguage + "&type=folder&action=AddSubFolder&id=" + _Id + "\' } );" + Environment.NewLine); } result.Append(" filemenu.addItem(\" <img valign=\'middle\' src=\'" + "images/UI/Icons/tree/folderBlogClosed.png" + "\' /> " + _MessageHelper.GetMessage("lbl Blog") + "\", function() { window.location.href = \'content.aspx?LangType=" + _ContentLanguage + "&action=AddSubFolder&type=blog&id=" + _Id + "\' } );" + Environment.NewLine); result.Append(" filemenu.addItem(\" <img valign=\'middle\' src=\'" + "images/UI/Icons/folderBoard.png" + "\' /> " + _MessageHelper.GetMessage("lbl Discussion Board") + "\", function() { window.location.href = \'content.aspx?LangType=" + _ContentLanguage + "&action=AddSubFolder&type=discussionboard&id=" + _Id + "\' } );" + Environment.NewLine); result.Append(" filemenu.addItem(\" <img valign=\'middle\' src=\'" + "images/UI/Icons/folderCommunity.png" + "\' /> " + _MessageHelper.GetMessage("lbl Community Folder") + "\", function() { window.location.href = \'content.aspx?LangType=" + _ContentLanguage + "&action=AddSubFolder&type=communityfolder&id=" + _Id + "\' } );" + Environment.NewLine); result.Append(" filemenu.addItem(\" <img valign=\'middle\' src=\'" + "images/ui/icons/tree/folderCalendarClosed.png" + "\' /> " + _MessageHelper.GetMessage("lbl Calendar Folder") + "\", function() { window.location.href = \'content.aspx?LangType=" + _ContentLanguage + "&action=AddSubFolder&type=calendar&id=" + _Id + "\' } );" + Environment.NewLine); if (Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(_ContentApi.RequestInformationRef, Ektron.Cms.DataIO.LicenseManager.Feature.eCommerce)) { result.Append(" filemenu.addItem(\" <img valign=\'middle\' src=\'" + "images/UI/Icons/folderGreen.png" + "\' /> " + _MessageHelper.GetMessage("lbl commerce catalog") + "\", function() { window.location.href = \'content.aspx?LangType=" + _ContentLanguage + "&action=AddSubFolder&type=catalog&id=" + _Id + "\' } );" + Environment.NewLine); } if (_Id == 0 && LicenseManager.IsFeatureEnable(_ContentApi.RequestInformationRef, Feature.MultiSite)) //domain folder { result.Append(" filemenu.addItem(\" <img valign=\'middle\' src=\'" + "images/UI/Icons/folderSite.png" + "\' /> " + _MessageHelper.GetMessage("lbl site Folder") + "\", function() { window.location.href = \'content.aspx?LangType=" + _ContentLanguage + "&type=site&action=AddSubFolder&id=" + _Id + "\' } );" + Environment.NewLine); } result.Append(" filemenu.addBreak();" + Environment.NewLine); } else { result.Append(" filemenu.addItem(\" <img valign=\'middle\' src=\'" + "images/UI/Icons/folderGreen.png" + "\' /> " + _MessageHelper.GetMessage("lbl commerce catalog") + "\", function() { window.location.href = \'content.aspx?LangType=" + _ContentLanguage + "&action=AddSubFolder&type=catalog&id=" + _Id + "\' } );" + Environment.NewLine); result.Append(" filemenu.addBreak();" + Environment.NewLine); } } if (_PermissionData.CanAdd) { TemplateData[] active_templates; active_templates = _ContentApi.GetEnabledTemplatesByFolder(_FolderData.Id); bool foundWireframe = false; bool foundNormal = false; bool foundmasterlayout = false; foreach (TemplateData t in active_templates) { if (t.SubType == Ektron.Cms.Common.EkEnumeration.TemplateSubType.Wireframes) { foundWireframe = true; } else if (t.SubType == Ektron.Cms.Common.EkEnumeration.TemplateSubType.MasterLayout) { foundmasterlayout = true; } else { foundNormal = true; } if (foundWireframe && foundNormal && foundmasterlayout) { break; } } if (Utilities.IsNonFormattedContentAllowed(active_xml_list) && foundNormal) { result.Append(" filemenu.addItem(\" <img valign=\'middle\' src=\'" + "images/UI/Icons/contentHtml.png" + "\' /> " + _MessageHelper.GetMessage("lbl html content") + "\", function() { " + _StyleHelper.GetAddAnchorByContentType(_Id, Ektron.Cms.Common.EkConstants.CMSContentType_Content, true) + " } );" + Environment.NewLine); if (((!_IsMac) && (!(_AssetInfoData == null))) || ("ContentDesigner" == _SelectedEditControl)) { result.Append(" filemenu.addItem(\" <img valign=\'middle\' src=\'" + "images/UI/Icons/contentForm.png" + "\' /> " + _MessageHelper.GetMessage("lbl html formsurvey") + "\", function() { " + _StyleHelper.GetAddAnchorByContentType(_Id, Ektron.Cms.Common.EkConstants.CMSContentType_Forms, false) + " } );" + Environment.NewLine); } } if (foundWireframe || foundmasterlayout) //folder has a wireframe associated { // Register JS Ektron.Cms.API.JS.RegisterJS(this, Ektron.Cms.API.JS.ManagedScript.EktronJS); Ektron.Cms.API.JS.RegisterJS(this, Ektron.Cms.API.JS.ManagedScript.EktronXmlJS); Ektron.Cms.API.JS.RegisterJS(this, Ektron.Cms.API.JS.ManagedScript.EktronThickBoxJS); Ektron.Cms.API.JS.RegisterJS(this, Ektron.Cms.API.JS.ManagedScript.EktronModalJS); Ektron.Cms.API.JS.RegisterJS(this, _ContentApi.AppPath + "PageBuilder/Wizards/js/ektron.pagebuilder.wizards.js", "EktronPageBuilderWizardsJS"); Ektron.Cms.API.JS.RegisterJS(this, _ContentApi.AppPath + "PageBuilder/Wizards/js/wizardResources.aspx", "EktronPageBuilderWizardResourcesJS"); // register necessary CSS Ektron.Cms.API.Css.RegisterCss(this, Ektron.Cms.API.Css.ManagedStyleSheet.EktronModalCss); Ektron.Cms.API.Css.RegisterCss(this, _ContentApi.AppPath + "PageBuilder/Wizards/css/ektron.pagebuilder.wizards.css", "EktronPageBuilderWizardsCSS"); if (foundWireframe || foundmasterlayout) { string layoutstr; layoutstr = "tmpContLang = AddNewPage(); if (tmpContLang > 0) { Ektron.PageBuilder.Wizards.showAddPage({mode: \'add\', folderId: " + _FolderData.Id + ", language: tmpContLang, fromWorkarea: true}) };"; result.Append(" filemenu.addItem(\" <img valign=\'middle\' src=\'" + "images/application/layout_content.png" + "\' /> " + _MessageHelper.GetMessage("lbl pagebuilder layouts") + "\", function() { " + layoutstr + " } );" + Environment.NewLine); } if (foundWireframe && _ContentApi.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.CreateMasterLayout)) { string masterstr; masterstr = "tmpContLang = AddNewPage(); if (tmpContLang > 0) { Ektron.PageBuilder.Wizards.showAddMasterPage({mode: \'add\', folderId: " + _FolderData.Id + ", language: tmpContLang, fromWorkarea: true}) };"; result.Append(" filemenu.addItem(\" <img valign=\'middle\' src=\'" + "images/application/layout_content.png" + "\' /> " + _MessageHelper.GetMessage("lbl pagebuilder master layouts") + "\", function() { " + masterstr + " } );" + Environment.NewLine); } } if (!_IsMac || ("ContentDesigner" == _SelectedEditControl)) { if ((foundWireframe && foundNormal) || foundNormal) { if (active_xml_list.Length > 0 && Utilities.IsNonFormattedContentAllowed(active_xml_list)) { if ((active_xml_list.Length == 1 && active_xml_list[0] == null) || (active_xml_list.Length == 1 && active_xml_list[0].Id == 0)) { } else { result.Append(" var contentTypesMenu = new Menu( \"contentTypes\" );" + Environment.NewLine); result.Append(" filemenu.addBreak();" + Environment.NewLine); int k; for (k = 0; k <= active_xml_list.Length - 1; k++) { if (active_xml_list[k].Id != 0) { result.Append(" contentTypesMenu.addItem(\" <img valign=\'middle\' src=\'" + _ContentApi.AppPath + "images/ui/icons/contentsmartform.png" + "\'/> " + active_xml_list[k].Title + "\", function() { " + _StyleHelper.GetTypeOverrideAddAnchor(_Id, active_xml_list[k].Id, Ektron.Cms.Common.EkConstants.CMSContentType_Content) + " } );" + Environment.NewLine); } } //result.Append(" contentTypesMenu.addBreak();" & Environment.NewLine) result.Append(" filemenu.addMenu(\" <img valign=\'middle\' src=\'" + _ContentApi.AppPath + "images/ui/icons/contentsmartform.png" + "\'/> " + _MessageHelper.GetMessage("lbl smart form") + "\", contentTypesMenu);" + Environment.NewLine); } } else if (active_xml_list.Length > 0 && !Utilities.IsNonFormattedContentAllowed(active_xml_list)) { result.Append(" filemenu.addBreak();" + Environment.NewLine); int k; for (k = 0; k <= active_xml_list.Length - 1; k++) { if (active_xml_list[k].Id != 0) { result.Append(" filemenu.addItem(\" <img valign=\'middle\' src=\'" + _ContentApi.AppPath + "images/ui/icons/contentsmartform.png" + "\'/> " + active_xml_list[k].Title + "\", function() { " + _StyleHelper.GetTypeOverrideAddAnchor(_Id, active_xml_list[k].Id, Ektron.Cms.Common.EkConstants.CMSContentType_Content) + " } );" + Environment.NewLine); } } } } result.Append(" filemenu.addBreak();" + Environment.NewLine); } //If ((Not m_bIsMac) AndAlso (Not (IsNothing(asset_data))) AndAlso Utilities.IsNonFormattedContentAllowed(active_xml_list)) Then if ((!(_AssetInfoData == null)) && Utilities.IsNonFormattedContentAllowed(active_xml_list)) { if (_AssetInfoData.Length > 0) { for (count = 0; count <= _AssetInfoData.Length - 1; count++) { if (_ManagedAsset_Min <= _AssetInfoData[count].TypeId && _AssetInfoData[count].TypeId <= _ManagedAsset_Max) { if ("*" == _AssetInfoData[count].PluginType) { lAddMultiType = _AssetInfoData[count].TypeId; } } } string imgsrc = string.Empty; string txtCommName = string.Empty; if (Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(_ContentApi.RequestInformationRef, Feature.DocumentManagement, false)) { imgsrc = " <img valign=\'middle\' src=\'" + "images/UI/Icons/contentDMSDocument.png" + "\' /> "; txtCommName = _MessageHelper.GetMessage("lbl dms documents"); result.Append("filemenu.addItem(\"" + imgsrc + "" + txtCommName + "\", function() { " + _StyleHelper.GetAddAnchorByContentType(_Id, 103, false) + " } );" + Environment.NewLine); result.Append(" if (ShowMultipleUpload() && CheckSTSUpload()) {"); imgsrc = " <img valign=\'middle\' src=\'" + "images/ui/icons/contentStack.png" + "\' /> "; txtCommName = _MessageHelper.GetMessage("lbl multiple documents"); if (Request.Cookies["DMS_Office_ver"] == null || string.IsNullOrEmpty(Request.Cookies["DMS_Office_ver"].Value)) { result.Append("filemenu.addItem(\"" + imgsrc + "" + txtCommName + "\", function() { " + _StyleHelper.GetAddAnchorByContentType(_Id, 9875, false) + " } );" + Environment.NewLine); } else { result.Append("filemenu.addItem(\"" + imgsrc + "" + txtCommName + "\", function() { " + _StyleHelper.GetAddAnchorByContentType(_Id, 9876, false) + " } );" + Environment.NewLine); } result.Append("}"); } } } } if (CanDoCollections || CanDoMenus) { result.Append(" filemenu.addBreak();" + Environment.NewLine); if (CanDoCollections) { result.Append(" filemenu.addItem(\" <img valign=\'middle\' src=\'" + "images/UI/Icons/collection.png" + "\' /> " + _MessageHelper.GetMessage("lbl Collection") + "\", function() { window.location.href = \'collections.aspx?LangType=" + _ContentLanguage + "&action=Add&folderid=" + _Id + "\' } );" + Environment.NewLine); } if (CanDoMenus) { result.Append(" filemenu.addItem(\" <img valign=\'middle\' src=\'" + "images/UI/Icons/menu.png" + "\' /> " + _MessageHelper.GetMessage("lbl Menu") + "\", function() { window.location.href = \'collections.aspx?LangType=" + _ContentLanguage + "&action=AddMenu&back=" + EkFunctions.UrlEncode("content.aspx?action=ViewContentByCategory&id=" + _Id) + "&folderid=" + _Id + "\' } );" + Environment.NewLine); } result.Append("" + Environment.NewLine); } if (_PermissionData.CanAdd || _PermissionData.CanAddFolders) { result.Append(" MenuUtil.add( filemenu );" + Environment.NewLine); } result.Append(" var viewmenu = new Menu( \"view\" );" + Environment.NewLine); if (bViewContent) { result.Append(" viewmenu.addItem(\" <img valign=\'middle\' src=\'" + "images/UI/Icons/folderView.png" + "\' /> " + MakeBold(_MessageHelper.GetMessage("lbl All Types"), 98, Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.AllTypes) + "\", function() { UpdateView(" + _CMSContentType_AllTypes + "); } );" + Environment.NewLine); result.Append(" viewmenu.addItem(\" <img valign=\'middle\' src=\'" + "images/UI/Icons/contentHtml.png" + "\' /> " + MakeBold(_MessageHelper.GetMessage("lbl html content"), Ektron.Cms.Common.EkConstants.CMSContentType_Content, Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.Content) + "\", function() { UpdateViewwithSubtype(" + Ektron.Cms.Common.EkConstants.CMSContentType_Content + ", " + (int)Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.Content + ",false" + "); } );" + Environment.NewLine); if (((!_IsMac) && (!(_AssetInfoData == null))) || ("ContentDesigner" == _SelectedEditControl)) { result.Append(" viewmenu.addItem(\" <img valign=\'middle\' src=\'" + "images/UI/Icons/contentForm.png" + "\' /> " + MakeBold(_MessageHelper.GetMessage("lbl html formsurvey"), Ektron.Cms.Common.EkConstants.CMSContentType_Forms, Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.AllTypes) + "\", function() { UpdateView(" + Ektron.Cms.Common.EkConstants.CMSContentType_Forms + "); } );" + Environment.NewLine); } if (wireframeModel.FindByFolderID(_FolderData.Id).Length > 0) //folder has a wireframe associated { result.Append(" viewmenu.addItem(\" <img valign=\'middle\' src=\'" + "images/application/layout_content.png" + "\' /> " + MakeBold(_MessageHelper.GetMessage("lbl pagebuilder layouts"), Ektron.Cms.Common.EkConstants.CMSContentType_Content, Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderData) + "\", function() { UpdateViewwithSubtype(" + Ektron.Cms.Common.EkConstants.CMSContentType_Content + ", " + (int)Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderData + ",false " + "); } );" + Environment.NewLine); result.Append(" viewmenu.addItem(\" <img valign=\'middle\' src=\'" + "images/application/layout_content.png" + "\' /> " + MakeBold(_MessageHelper.GetMessage("lbl pagebuilder master layouts"), Ektron.Cms.Common.EkConstants.CMSContentType_Content, Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderMasterData) + "\", function() { UpdateViewwithSubtype(" + Ektron.Cms.Common.EkConstants.CMSContentType_Content + ", " + (int)Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderMasterData + ",false " + "); } );" + Environment.NewLine); } } else { result.Append(" viewmenu.addItem(\" <img valign=\'middle\' src=\'" + "images/UI/Icons/folderView.png" + "\' /> " + MakeBold(_MessageHelper.GetMessage("lbl All Types"), 98, Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.AllTypes) + "\", function() { UpdateArchiveView(" + _CMSContentType_AllTypes + ",true " + "); } );" + Environment.NewLine); result.Append(" viewmenu.addItem(\" <img valign=\'middle\' src=\'" + "images/UI/Icons/contentHtml.png" + "\' /> " + MakeBold(_MessageHelper.GetMessage("lbl html content"), Ektron.Cms.Common.EkConstants.CMSContentType_Content, Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.Content) + "\", function() { UpdateViewwithSubtype(" + Ektron.Cms.Common.EkConstants.CMSContentType_Content + ", " + (int)Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.Content + ",true " + "); } );" + Environment.NewLine); if (((!_IsMac) && (!(_AssetInfoData == null))) || ("ContentDesigner" == _SelectedEditControl)) { result.Append(" viewmenu.addItem(\" <img valign=\'middle\' src=\'" + "images/UI/Icons/contentForm.png" + "\' /> " + MakeBold(_MessageHelper.GetMessage("lbl html formsurvey"), Ektron.Cms.Common.EkConstants.CMSContentType_Forms, Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.AllTypes) + "\", function() { UpdateArchiveView(" + Ektron.Cms.Common.EkConstants.CMSContentType_Forms + ",true " + "); } );" + Environment.NewLine); } if (wireframeModel.FindByFolderID(_FolderData.Id).Length > 0) //folder has a wireframe associated { result.Append(" viewmenu.addItem(\" <img valign=\'middle\' src=\'" + "images/application/layout_content.png" + "\' /> " + MakeBold(_MessageHelper.GetMessage("lbl pagebuilder layouts"), Ektron.Cms.Common.EkConstants.CMSContentType_Content, Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderData) + "\", function() { UpdateViewwithSubtype(" + Ektron.Cms.Common.EkConstants.CMSContentType_Content + ", " + (int)Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderData + ",true " + "); } );" + Environment.NewLine); result.Append(" viewmenu.addItem(\" <img valign=\'middle\' src=\'" + "images/application/layout_content.png" + "\' /> " + MakeBold(_MessageHelper.GetMessage("lbl pagebuilder master layouts"), Ektron.Cms.Common.EkConstants.CMSContentType_Content, Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderMasterData) + "\", function() { UpdateViewwithSubtype(" + Ektron.Cms.Common.EkConstants.CMSContentType_Content + ", " + (int)Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderMasterData + ",true " + "); } );" + Environment.NewLine); } } result.Append(" viewmenu.addBreak();" + Environment.NewLine); if (((_PermissionData.CanAdd) && bViewContent) || _PermissionData.IsReadOnly == true) { if ((_AssetInfoData != null) && Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(_ContentApi.RequestInformationRef, Feature.DocumentManagement, false)) { if (_AssetInfoData.Length > 0) { for (count = 0; count <= _AssetInfoData.Length - 1; count++) { if (_ManagedAsset_Min <= _AssetInfoData[count].TypeId && _AssetInfoData[count].TypeId <= _ManagedAsset_Max) { if ("*" == _AssetInfoData[count].PluginType) { lAddMultiType = _AssetInfoData[count].TypeId; } else { string imgsrc = string.Empty; string txtCommName = string.Empty; if (_IsArchivedEvent) { if (_AssetInfoData[count].TypeId + 1000 == 1101) { imgsrc = " <img src=\'" + "images/UI/Icons/FileTypes/word.png" + "\' /> "; txtCommName = _MessageHelper.GetMessage("lbl Office Documents"); } else if (_AssetInfoData[count].TypeId + 1000 == 1102) { imgsrc = " <img valign=\'middle\' src=\'" + "images/UI/Icons/contentManagedFiles.png" + " \' /> "; txtCommName = _MessageHelper.GetMessage("lbl Managed Files"); } else if (_AssetInfoData[count].TypeId + 1000 == 1106) { imgsrc = " <img valign=\'middle\' src=\'" + "images/UI/Icons/FileTypes/image.png" + " \' /> "; txtCommName = _MessageHelper.GetMessage("lbl image assets"); } else if (_AssetInfoData[count].TypeId + 1000 == 1104) { imgsrc = " <img valign=\'middle\' src=\'" + "images/UI/Icons/film.png" + " \' /> "; txtCommName = _MessageHelper.GetMessage("lbl Multimedia"); } else { imgsrc = " "; } if (_AssetInfoData[count].TypeId + 1000 != 1105) { result.Append("viewmenu.addItem(\"" + imgsrc + "" + MakeBold(txtCommName, System.Convert.ToInt32(_AssetInfoData[count].TypeId + 1000), Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.AllTypes) + "\", function() { UpdateView(" + (_AssetInfoData[count].TypeId + 1000) + "); } );" + Environment.NewLine); } } else { if (_AssetInfoData[count].TypeId == 101) { imgsrc = " <img src=\'" + "images/UI/Icons/FileTypes/word.png" + "\' /> "; txtCommName = _MessageHelper.GetMessage("lbl Office Documents"); } else if (_AssetInfoData[count].TypeId == 102) { imgsrc = " <img valign=\'middle\' src=\'" + "images/UI/Icons/contentManagedFiles.png" + " \' /> "; txtCommName = _MessageHelper.GetMessage("lbl Managed Files"); } else if (_AssetInfoData[count].TypeId == 106) { imgsrc = " <img valign=\'middle\' src=\'" + "images/UI/Icons/FileTypes/image.png" + " \' /> "; txtCommName = _MessageHelper.GetMessage("lbl image assets"); } else if (_AssetInfoData[count].TypeId == 104) { imgsrc = " <img valign=\'middle\' src=\'" + "images/UI/Icons/film.png" + " \' /> "; txtCommName = _MessageHelper.GetMessage("lbl Multimedia"); } else { imgsrc = " "; } if (_AssetInfoData[count].TypeId != 105) { result.Append("viewmenu.addItem(\"" + imgsrc + "" + MakeBold(txtCommName, _AssetInfoData[count].TypeId, Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.AllTypes) + "\", function() { UpdateView(" + _AssetInfoData[count].TypeId + "); } );" + Environment.NewLine); } } } } } } } AddLanguageMenu(result); result.Append(" viewmenu.addBreak();" + Environment.NewLine); if (bViewContent && CanDoMenus) { result.Append(" viewmenu.addItem(\" <img valign=\'middle\' src=\'" + "images/UI/Icons/menu.png" + "\' /> " + _MessageHelper.GetMessage("lbl Menu") + "\", function() { window.location.href = \'collections.aspx?LangType=" + _ContentLanguage + "&action=ViewAllMenus&folderid=" + _Id + "\' } );" + Environment.NewLine); } if (bViewContent && CanDoCollections) { result.Append(" viewmenu.addItem(\" <img valign=\'middle\' src=\'" + "images/UI/Icons/collection.png" + "\' /> " + _MessageHelper.GetMessage("lbl Collection") + "\", function() { window.location.href = \'collections.aspx?LangType=" + _ContentLanguage + "&action=mainPage&folderid=" + _Id + "\' } );" + Environment.NewLine); } if (bViewContent) { result.Append(" viewmenu.addItem(\" <img valign=\'middle\' src=\'" + "images/UI/Icons/contentArchived.png" + "\' /> " + _MessageHelper.GetMessage("archive content") + "\", function() { window.location.href = \'content.aspx?action=" + _NextActionType + "&id=" + _Id + "&IsArchivedEvent=true" + "&LangType=" + _ContentLanguage + ((Ektron.Cms.Common.EkConstants.IsAssetContentType(Convert.ToInt64(_ContentTypeSelected), false)) ? ("&" + _ContentTypeUrlParam + "=" + Ektron.Cms.Common.EkConstants.MakeArchiveAssetContentType(Convert.ToInt64(_ContentTypeSelected))) : ((Ektron.Cms.Common.EkConstants.IsArchiveAssetContentType(Convert.ToInt64(_ContentTypeSelected))) ? ("&" + _ContentTypeUrlParam + "=" + Ektron.Cms.Common.EkConstants.MakeNonArchiveAssetContentType(Convert.ToInt64(_ContentTypeSelected))) : "")) + "\' } );" + Environment.NewLine); } else { result.Append(" viewmenu.addItem(\" <img valign=\'middle\' src=\'" + "images/UI/Icons/contentArchived.png" + "\' /> " + _MessageHelper.GetMessage("top Content") + "\", function() { window.location.href = \'content.aspx?action=" + _NextActionType + "&id=" + _Id + "&LangType=" + _ContentLanguage + ((Ektron.Cms.Common.EkConstants.IsAssetContentType(Convert.ToInt64(_ContentTypeSelected), false)) ? ("&" + _ContentTypeUrlParam + "=" + (Convert.ToInt32(Ektron.Cms.Common.EkConstants.MakeArchiveAssetContentType(Convert.ToInt64(_ContentTypeSelected))))) : ((Ektron.Cms.Common.EkConstants.IsArchiveAssetContentType(Convert.ToInt64(_ContentTypeSelected))) ? ("&" + _ContentTypeUrlParam + "=" + Ektron.Cms.Common.EkConstants.MakeNonArchiveAssetContentType(Convert.ToInt64(_ContentTypeSelected))) : "")) + "\' } );" + Environment.NewLine); } if (((_PermissionData.CanEditFolders || _PermissionData.CanEditApprovals) && bViewContent) || IsFolderAdmin()) { result.Append(" viewmenu.addBreak();" + Environment.NewLine); result.Append(" viewmenu.addItem(\" <img src=\'" + "images/UI/Icons/properties.png" + " \' /> " + _MessageHelper.GetMessage("lbl Folder Properties") + "\", function() { window.location.href = \'content.aspx?LangType=" + _ContentLanguage + "&action=ViewFolder&id=" + _Id + "\' } );" + Environment.NewLine); } result.Append(" MenuUtil.add( viewmenu );" + Environment.NewLine); // Delete Menu if ((_PermissionData.CanDeleteFolders && bViewContent && _Id != 0) || ((bViewContent && (_PermissionData.IsAdmin || IsFolderAdmin()) || _PermissionData.CanDelete) && totalPages > 0)) { result.Append(" var deletemenu = new Menu( \"delete\" );" + Environment.NewLine); if (_PermissionData.CanDeleteFolders && bViewContent && _Id != 0) { string folderImgPath = "images/UI/Icons/folderDelete.png"; switch (_FolderType) { case 2: //Domain folderImgPath = "images/UI/Icons/folderSiteDelete.png"; break; case 6: //Community folderImgPath = "images/UI/Icons/folderCommunityDelete.png"; break; default: break; // use the default. } result.Append(" deletemenu.addItem(\" <img src=\'" + folderImgPath + " \' /> " + _MessageHelper.GetMessage("lbl This Folder") + "\", function() { if( ConfirmFolderDelete(" + _Id + ") ) { window.location.href = \'content.aspx?LangType=" + _ContentLanguage + "&action=DoDeleteFolder&id=" + _Id + "&ParentID=" + ParentId + "\'; }} );" + Environment.NewLine); } if (bViewContent && (_PermissionData.IsAdmin || IsFolderAdmin()) || _PermissionData.CanDelete) { // get a count for the content in this folder if (totalPages > 0) { if ((Convert.ToString(_EnableMultilingual) == "1") && (_ContentLanguage < 1)) { result.Append(" deletemenu.addItem(\" <img src=\'" + "images/UI/Icons/contentHtmlDelete.png" + " \' /> " + _MessageHelper.GetMessage("top Content") + "\", function() { alert(\'A language must be selected!\'); } );" + Environment.NewLine); } else { //44595 - Delete content from the archive view should show up archived list rather than live content list. if (_PageAction == "viewarchivecontentbycategory") { result.Append(" deletemenu.addItem(\" <img src=\'" + "images/UI/Icons/contentDelete.png" + " \' /> " + _MessageHelper.GetMessage("top Content") + "\", function() { window.location.href = \'content.aspx?LangType=" + _ContentLanguage + "&action=DeleteContentByCategory&id=" + _Id + "&showarchive=true\'; } );" + Environment.NewLine); } else { result.Append(" deletemenu.addItem(\" <img src=\'" + "images/UI/Icons/contentDelete.png" + " \' /> " + _MessageHelper.GetMessage("top Content") + "\", function() { window.location.href = \'content.aspx?LangType=" + _ContentLanguage + "&action=DeleteContentByCategory&id=" + _Id + "\'; } );" + Environment.NewLine); } } } } result.Append(" MenuUtil.add( deletemenu );" + Environment.NewLine); } } result.Append(" var actionmenu = new Menu( \"action\" );" + Environment.NewLine); if (_ContentApi.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.AdminXliff) && bViewContent && Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(_ContentApi.RequestInformationRef, Feature.Xliff, false)) { result.Append(" actionmenu.addItem(\" <img src=\'" + "images/UI/Icons/translationExport.png" + " \' /> " + this._MessageHelper.GetMessage("lbl Export for translation") + "\", function() { window.location.href = \'content.aspx?LangType=" + _ContentLanguage + "&action=Localize&backpage=ViewContentByCategory&id=" + _Id + "\'; } );" + Environment.NewLine); } result.Append(" actionmenu.addItem(\" <img src=\'" + "images/UI/Icons/magnifier.png" + " \' /> " + _MessageHelper.GetMessage("generic Search") + "\", function() { window.location.href = \'isearch.aspx?LangType=" + _ContentLanguage + "&action=showdlg&folderid=" + _Id + "\'; } );" + Environment.NewLine); result.Append(" actionmenu.addBreak();" + Environment.NewLine); if (_CheckedInOrApproved && bViewContent && (_PermissionData.IsAdmin || IsFolderAdmin() || IsCopyOrMoveAdmin()) && (_PermissionData.CanAdd || _PermissionData.CanEdit)) { if (Convert.ToString(_EnableMultilingual) == "1" && _ContentLanguage < 1) { result.Append(" actionmenu.addItem(\" <img src=\'" + "images/UI/Icons/cut.png" + " \' /> " + _MessageHelper.GetMessage("lbl cut") + "\", function() { alert(\'A language must be selected!\'); } );" + Environment.NewLine); result.Append(" actionmenu.addItem(\" <img src=\'" + "images/UI/Icons/contentCopy.png" + " \' /> " + _MessageHelper.GetMessage("lbl copy") + "\", function() { alert(\'A language must be selected!\'); } );" + Environment.NewLine); } else { result.Append(" actionmenu.addItem(\" <img src=\'" + "images/UI/Icons/cut.png" + " \' /> " + _MessageHelper.GetMessage("lbl cut") + "\", function() { setClipBoard(); } );" + Environment.NewLine); result.Append(" actionmenu.addItem(\" <img src=\'" + "images/UI/Icons/contentCopy.png" + " \' /> " + _MessageHelper.GetMessage("lbl copy") + "\", function() { setCopyClipBoard(); }) ;" + Environment.NewLine); } } SiteAPI site = new SiteAPI(); EkSite ekSiteRef = site.EkSiteRef; if (_ContentApi.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.SyncAdmin) || _ContentApi.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.SyncUser)) { result.Append(GetSyncMenuOption()); } result.Append(" MenuUtil.add( actionmenu );" + Environment.NewLine); result.Append(" </script>" + Environment.NewLine); result.Append("" + Environment.NewLine); htmToolBar.InnerHtml = result.ToString(); }
private void EditSelectedTemplate() { StringBuilder str = new StringBuilder(); bool bShowTemplateUI = false; int iContType; if (Request.QueryString["ContType"] == null) { iContType = Ektron.Cms.Common.EkConstants.CMSContentType_Content; } else { iContType = Convert.ToInt32(Request.QueryString["ContType"]); } if (m_strType == "add") { if (iContType == Ektron.Cms.Common.EkConstants.CMSContentType_Content || iContType == Ektron.Cms.Common.EkConstants.CMSContentType_Forms || iContType == EkConstants.CMSContentType_Media || iContType == EkConstants.CMSContentType_Archive_Content || iContType == EkConstants.CMSContentType_Archive_Forms || iContType == EkConstants.CMSContentType_Archive_Media) { bShowTemplateUI = true; } } else { if (content_edit_data != null) { iContType = content_edit_data.Type; if (iContType == Ektron.Cms.Common.EkConstants.CMSContentType_Content || iContType == Ektron.Cms.Common.EkConstants.CMSContentType_Forms || iContType == EkConstants.CMSContentType_Media || iContType == EkConstants.CMSContentType_Archive_Content || iContType == EkConstants.CMSContentType_Archive_Forms || iContType == EkConstants.CMSContentType_Archive_Media) { bShowTemplateUI = true; } } } if (!bShowTemplateUI) { str.Append( m_refMsg.GetMessage("Generic Not Applicable")); } else { if ((m_strType == "add" && (content_data != null) && (content_data.SubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderData || content_data.SubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderMasterData)) || ((content_edit_data != null) && (content_edit_data.SubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderData || content_edit_data.SubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderMasterData))) { //show available wireframes Ektron.Cms.PageBuilder.WireframeModel wfm = new Ektron.Cms.PageBuilder.WireframeModel(); Ektron.Cms.PageBuilder.WireframeData[] active_template_list = wfm.FindByFolderID(folder_data.Id); long selected_templateid = this.m_refContApi.GetSelectedTemplateByContent(m_refContentId, m_refContApi.RequestInformationRef.ContentLanguage); if (selected_templateid == 0) { //check if this is a translation, if so, get the one from the original language if (!string.IsNullOrEmpty(Request.QueryString["translate"]) && !string.IsNullOrEmpty(Request.QueryString["con_lang_id"])) { int originalLang = Int32.Parse(Request.QueryString["con_lang_id"]); selected_templateid = this.m_refContApi.GetSelectedTemplateByContent(m_refContentId, originalLang); } //check if default language has one if (selected_templateid == 0 && m_refContApi.RequestInformationRef.ContentLanguage != m_refContApi.RequestInformationRef.DefaultContentLanguage) { selected_templateid = this.m_refContApi.GetSelectedTemplateByContent(m_refContentId, m_refContApi.RequestInformationRef.DefaultContentLanguage); } if (selected_templateid == 0)//just use the default { selected_templateid = folder_data.TemplateId; } } if (active_template_list.Length < 1 && selected_templateid == 0) { phTemplates.Visible = false; EditTemplateHtml.Visible = false; } str.Append("<table class=\"ektronForm\">"); str.Append("<tr>"); str.Append("<td class=\"label\">"); str.Append(m_refMsg.GetMessage("template label") + ":"); str.Append("</td>"); str.Append("<td class=\"value\">"); str.Append("<select id=\"templateSelect\" name=\"templateSelect\">"); foreach (Ektron.Cms.PageBuilder.WireframeData wireframe in active_template_list) { if (wireframe.Template.Id == selected_templateid) { str.Append("<option value=\"" + wireframe.Template.Id + "\" selected>" + wireframe.Path + "</option>"); } else { str.Append("<option value=\"" + wireframe.Template.Id + "\">" + wireframe.Path + "</option>"); } } if (active_template_list.Length == 0) { Ektron.Cms.PageBuilder.TemplateModel templModel = new Ektron.Cms.PageBuilder.TemplateModel(); TemplateData selectedTemplate = templModel.FindByID(selected_templateid); string selectedTemplateName = (selectedTemplate != null) ? selectedTemplate.TemplateName : ""; str.Append("<option value=\"" + selected_templateid + "\" selected>" + selectedTemplateName + "</option>"); } str.Append("</select>"); str.Append("</td>"); str.Append("</tr>"); str.Append("</table>"); if (content_edit_data != null) { if (content_edit_data.LockedContentLink) { str.AppendLine("<br/>"); str.AppendLine("<label>Quicklink Locked:</label><input type=\"checkbox\" onclick=\"DisableTemplateSelect(this.checked)\" name=\"chkLockedContentLink\" id=\"chkLockedContentLink\"" + (content_edit_data.LockedContentLink ? "checked=\"true\"" : "") + "\"/>"); str.AppendLine("<br/>"); str.AppendLine("<label>Quicklink:</label> \"" + content_edit_data.Quicklink + "\""); str.AppendLine("<script language=\"Javascript\"> DisableTemplateSelect(true) </script>"); } else { str.AppendLine("<input type=\"hidden\" name=\"chkLockedContentLink\" id=\"chkLockedContentLink\" value=\"false\" />"); } } else { str.AppendLine("<input type=\"hidden\" name=\"chkLockedContentLink\" id=\"chkLockedContentLink\" value=\"false\" />"); } } else { TemplateData[] active_template_list = m_refContApi.GetEnabledTemplatesByFolder(folder_data.Id); if (active_template_list.Length < 1) { phTemplates.Visible = false; EditTemplateHtml.Visible = false; } long selected_folder = this.m_refContApi.GetSelectedTemplateByContent(m_refContentId, m_refContApi.RequestInformationRef.ContentLanguage); if (selected_folder == 0) { selected_folder = folder_data.TemplateId; } str.Append("<table class=\"ektronForm\">"); str.Append("<tr>"); str.Append("<td class=\"label\">"); str.Append(m_refMsg.GetMessage("template label") + ":"); str.Append("</td>"); str.Append("<td class=\"value\">"); str.Append("<select id=\"templateSelect\" name=\"templateSelect\">"); foreach (TemplateData template in active_template_list) { if (template.SubType != Ektron.Cms.Common.EkEnumeration.TemplateSubType.Wireframes) { if (template.Id == selected_folder) { str.Append("<option value=\"" + template.Id + "\" selected>" + template.FileName + "</option>"); } else { str.Append("<option value=\"" + template.Id + "\">" + template.FileName + "</option>"); } } } if (active_template_list.Length == 0) { str.Append("<option value=\"" + folder_data.TemplateId + "\">" + folder_data.TemplateFileName + "</option>"); } str.Append("</select>"); str.Append("</td>"); str.Append("</tr>"); str.Append("</table>"); if (content_edit_data != null) { if (content_edit_data.LockedContentLink) { str.AppendLine("<br/>"); str.AppendLine("<label>Quicklink Locked:</label><input type=\"checkbox\" onclick=\"DisableTemplateSelect(this.checked)\" name=\"chkLockedContentLink\" id=\"chkLockedContentLink\"" + (content_edit_data.LockedContentLink ? "checked=\"true\"" : "") + "\"/>"); str.AppendLine("<br/>"); str.AppendLine("<label>Quicklink:</label> \"" + content_edit_data.Quicklink + "\""); str.AppendLine("<script language=\"Javascript\"> DisableTemplateSelect(true) </script>"); } else { str.AppendLine("<input type=\"hidden\" name=\"chkLockedContentLink\" id=\"chkLockedContentLink\" value=\"false\" />"); } } else { str.AppendLine("<input type=\"hidden\" name=\"chkLockedContentLink\" id=\"chkLockedContentLink\" value=\"false\" />"); } } } EditTemplateHtml.Text = "<div id=\"dvTemplates\">" + str.ToString() + "</div>"; }