private void ViewCatalogToolBar() { System.Text.StringBuilder result = new System.Text.StringBuilder(); if (content_data == null) { content_data = m_refContentApi.GetContentById(m_intId, 0); } long ParentId = content_data.FolderId; Ektron.Cms.Commerce.ProductType pProductType = new Ektron.Cms.Commerce.ProductType(m_refContentApi.RequestInformationRef); int count = 0; int lAddMultiType = 0; bool bSelectedFound = false; bool bViewContent = System.Convert.ToBoolean("view" == m_strPageAction); // alternative is archived content string SRC = ""; string str; string backStr; bool bFromApproval = false; int type = 3333; bool folderIsHidden = m_refContentApi.IsFolderHidden(content_data.FolderId); bool IsOrdered = m_refContentApi.EkContentRef.IsOrdered(content_data.Id); if (type == 1) { if (bFromApproval) { backStr = "back_file=approval.aspx"; } else { backStr = "back_file=content.aspx"; } } else { backStr = "back_file=cmsform.aspx"; } str = Request.QueryString["action"]; if (str != null && str.Length > 0) { backStr = backStr + "&back_action=" + str; } if (bFromApproval) { str = Request.QueryString["page"]; if (str != null && str.Length > 0) { backStr = backStr + "&back_page=" + str; } } if (!bFromApproval) { str = Request.QueryString["folder_id"]; if (str != null && str.Length > 0) { backStr = backStr + "&back_folder_id=" + str; } } if (type == 1) { str = Request.QueryString["id"]; if (str != null && str.Length > 0) { backStr = backStr + "&back_id=" + str; } } else { str = Request.QueryString["form_id"]; if (str != null && str.Length > 0) { backStr = backStr + "&back_form_id=" + str; } } if (!(Request.QueryString["callerpage"] == null)) { str = AntiXss.UrlEncode(Request.QueryString["callerpage"]); if (str != null && str.Length > 0) { backStr = backStr + "&back_callerpage=" + str; } } if (!(Request.QueryString["origurl"] == null)) { str = Request.QueryString["origurl"]; if (str != null && str.Length > 0) { backStr = backStr + "&back_origurl=" + EkFunctions.UrlEncode(str); } } str = ContentLanguage.ToString(); if (str != null && str.Length > 0) { backStr = backStr + "&back_LangType=" + str + "&rnd=" + System.Convert.ToInt32(Conversion.Int((10 * VBMath.Rnd()) + 1)); } SRC = (string)("commerce/catalogentry.aspx?close=false&LangType=" + ContentLanguage + "&id=" + m_intId + "&type=update&" + backStr); if (bFromApproval) { SRC += "&pullapproval=true"; } if (m_strPageAction == "view" || m_strPageAction == "viewstaged") { string WorkareaTitlebarTitle = (string)(m_refMsg.GetMessage("lbl view catalog entry") + " \"" + content_data.Title + "\" "); if (m_strPageAction == "viewstaged") { WorkareaTitlebarTitle = WorkareaTitlebarTitle + m_refMsg.GetMessage("staged version msg"); } txtTitleBar.InnerHtml = m_refStyle.GetTitleBar(WorkareaTitlebarTitle); } result.Append("<table><tr>" + "\r\n"); if ((security_data.CanAdd && bViewContent) || security_data.IsReadOnly == true) { if (security_data.CanAdd && bViewContent) { if (!bSelectedFound) { lContentType = Ektron.Cms.Common.EkConstants.CMSContentType_AllTypes; } } } SetViewImage(""); if (!folderIsHidden && content_data.SubType != Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderData && content_data.SubType != Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderMasterData) //hiding the move button for pagebuilder type. { if (Request.QueryString["callerpage"] == "dashboard.aspx") { result.Append(m_refStyle.GetButtonEventsWCaption(m_refContentApi.AppPath + "images/UI/Icons/back.png", "javascript:top.switchDesktopTab()", m_refMsg.GetMessage("alt back button text"), m_refMsg.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true)); } else if (!String.IsNullOrEmpty(Request.QueryString["callerpage"])) { result.Append(m_refStyle.GetButtonEventsWCaption(m_refContentApi.AppPath + "images/UI/Icons/back.png", (string)(Request.QueryString["callerpage"] + "?" + HttpUtility.UrlDecode(Request.QueryString["origurl"])), m_refMsg.GetMessage("alt back button text"), m_refMsg.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true)); } else if (Request.QueryString["backpage"] == "history") { result.Append(m_refStyle.GetButtonEventsWCaption(m_refContentApi.AppPath + "images/UI/Icons/back.png", "javascript:history.back()", m_refMsg.GetMessage("alt back button text"), m_refMsg.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true)); } else { result.Append(m_refStyle.GetButtonEventsWCaption(m_refContentApi.AppPath + "images/UI/Icons/back.png", (string)("content.aspx?LangType=" + ContentLanguage + "&action=ViewContentByCategory&id=" + content_data.FolderId), m_refMsg.GetMessage("alt back button text"), m_refMsg.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true)); } } string 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\">" + m_refMsg.GetMessage("lbl Action") + "</span></td>"); if ((security_data.CanAdd) || security_data.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\">" + m_refMsg.GetMessage("lbl View") + "</span></td>"); } 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=\"chartBar\">" + m_refMsg.GetMessage("generic reports title") + "</span></td>"); StringBuilder localizationMenuOptions = new StringBuilder(); if (EnableMultilingual == 1) { string strViewDisplay = ""; string strAddDisplay = ""; LanguageData[] result_language; if (security_data.CanEdit || security_data.CanEditSumit) { LocalizationObject l10nObj = new LocalizationObject(); Ektron.Cms.Localization.LocalizationState locState = l10nObj.GetContentLocalizationState(m_intId, content_data); if (m_refStyle.IsExportTranslationSupportedForContentType((EkEnumeration.CMSContentType)content_data.Type)) { string statusIcon = ""; string statusMsg = ""; m_refStyle.GetTranslationStatusIconAndMessage(locState, ref statusIcon, ref statusMsg); // localizationMenuOptions.Append(" {0}.addItem(\" <img height=\'16px\' width=\'16px\' src=\'" + statusIcon + " \' /> " + statusMsg + "\", function() { return false; } );" + Environment.NewLine); // result.Append(m_refStyle.GetTranslationStatusMenu(content_data, m_refMsg.GetMessage("alt click here to update this content translation status"), m_refMsg.GetMessage("lbl mark ready for translation"), locState)); localizationMenuOptions.Append(m_refStyle.PopupTranslationMenu(content_data, locState, "actionmenu", statusMsg, statusIcon, false)); // result.Append(m_refStyle.PopupTranslationMenu(content_data, locState)); if (locState.IsExportableState()) { localizationMenuOptions.Append(" actionmenu.addItem(\" <img height=\'16px\' width=\'16px\' src=\'" + m_refContentApi.AppPath + "images/UI/Icons/translation.png" + " \' /> " + m_refMsg.GetMessage("lbl Export for translation") + "\", function() { window.location.href=\"" + "content.aspx?LangType=" + ContentLanguage + "&action=Localize&backpage=View&id=" + m_intId + "&folder_id=" + content_data.FolderId + "\"; } );" + Environment.NewLine); // result.Append(m_refStyle.GetExportTranslationButton((string)("content.aspx?LangType=" + ContentLanguage + "&action=Localize&backpage=View&id=" + m_intId + "&folder_id=" + content_data.FolderId), m_refMsg.GetMessage("alt Click here to export this content for translation"), m_refMsg.GetMessage("lbl Export for translation"))); } } } result_language = m_refContentApi.DisplayAddViewLanguage(m_intId); for (count = 0; count <= result_language.Length - 1; count++) { if (result_language[count].Type == "VIEW") { if (content_data.LanguageId == result_language[count].Id) { strViewDisplay = strViewDisplay + "<option value=" + result_language[count].Id + " selected>" + result_language[count].Name + "</option>"; } else { strViewDisplay = strViewDisplay + "<option value=" + result_language[count].Id + ">" + result_language[count].Name + "</option>"; } } } bool languageDividerAdded = false; if (strViewDisplay != "") { result.Append(StyleHelper.ActionBarDivider); languageDividerAdded = true; result.Append("<td nowrap=\"true\">" + m_refMsg.GetMessage("lbl View") + ":"); result.Append("<select id=viewcontent name=viewcontent OnChange=\"javascript:LoadContent(\'frmContent\',\'VIEW\');\">"); result.Append(strViewDisplay); result.Append("</select></td>"); } if (security_data.CanAdd) { //If (bCanAddNewLanguage) Then for (count = 0; count <= result_language.Length - 1; count++) { if (result_language[count].Type == "ADD") { strAddDisplay = strAddDisplay + "<option value=" + result_language[count].Id + ">" + result_language[count].Name + "</option>"; } } if (strAddDisplay != "") { if (!languageDividerAdded) { result.Append(StyleHelper.ActionBarDivider); } else { result.Append("<td> </td>"); } result.Append("<td class=\"label\">" + m_refMsg.GetMessage("add title") + ":"); if (folder_data == null) { folder_data = m_refContentApi.GetFolderById(content_data.FolderId); } if (Utilities.IsNonFormattedContentAllowed(m_refContentApi.GetEnabledXmlConfigsByFolder(this.folder_data.Id))) { allowHtml = "&AllowHtml=1"; } result.Append("<select id=addcontent name=addcontent OnChange=\"javascript:LoadContent(\'frmContent\',\'ADD\');\">"); result.Append("<option value=" + "0" + ">" + "-select language-" + "</option>"); result.Append(strAddDisplay); result.Append("</select></td>"); } //End If } //End If } bool canAddAssets = System.Convert.ToBoolean((security_data.CanAdd || security_data.CanAddFolders) && bViewContent); result.Append(StyleHelper.ActionBarDivider); result.Append("<td>"); result.Append(m_refStyle.GetHelpButton(m_strPageAction, "")); result.Append("</td>"); result.Append("</tr></table>"); result.Append("<script language=\"javascript\">" + Environment.NewLine); result.Append(" var filemenu = new Menu( \"file\" );" + Environment.NewLine); if (security_data.CanAddFolders) { result.Append(" filemenu.addItem(\" <img valign=\'center\' src=\'" + "images/ui/icons/folderGreen.png" + "\' /> " + m_refMsg.GetMessage("lbl commerce catalog") + "\", function() { window.location.href = \'content.aspx?LangType=" + ContentLanguage + "&action=AddSubFolder&type=catalog&id=" + m_intId + "\' } );" + Environment.NewLine); result.Append(" filemenu.addBreak();" + Environment.NewLine); } if (security_data.IsCollections || m_refContentApi.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.AminCollectionMenu) || m_refContentApi.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.AdminCollection)) { result.Append("" + Environment.NewLine); } result.Append(" var viewmenu = new Menu( \"view\" );" + Environment.NewLine); if (security_data.CanHistory) { result.Append(" viewmenu.addItem(\" <img height=\'16px\' width=\'16px\' valign=\'center\' src=\'" + "images/ui/icons/history.png" + "\' /> " + MakeBold(m_refMsg.GetMessage("lbl content history"), 98) + "\", function() { top.document.getElementById(\'ek_main\').src=\"historyarea.aspx?action=report&LangType=" + ContentLanguage + "&id=" + m_intId + "\";return false;});" + Environment.NewLine); } if (content_data.Status != "A") { if (!((Ektron.Cms.Common.EkConstants.ManagedAsset_Min <= content_data.Type) && (content_data.Type <= Ektron.Cms.Common.EkConstants.ManagedAsset_Max))) { result.Append(" viewmenu.addItem(\" <img height=\'16px\' width=\'16px\' valign=\'center\' src=\'" + "images/UI/Icons/contentViewDifferences.png" + "\' /> " + MakeBold(m_refMsg.GetMessage("btn view diff"), 98) + "\", function() { PopEditWindow(\'compare.aspx?LangType=" + ContentLanguage + "&id=" + m_intId + "\', \'Compare\', 785, 500, 1, 1); } );" + Environment.NewLine); } } if (security_data.IsAdmin || IsFolderAdmin()) { result.Append(" viewmenu.addItem(\" <img height=\'16px\' width=\'16px\' valign=\'center\' src=\'" + "images/UI/Icons/approvals.png" + "\' /> " + MakeBold(m_refMsg.GetMessage("btn view approvals"), 98) + "\", function() { location.href = \"content.aspx?LangType=" + ContentLanguage + "&action=ViewApprovals&type=content&id=" + m_intId + "\";} );" + Environment.NewLine); result.Append(" viewmenu.addItem(\" <img height=\'16px\' width=\'16px\' valign=\'center\' src=\'" + "images/UI/Icons/permissions.png" + "\' /> " + MakeBold(m_refMsg.GetMessage("btn view permissions"), 98) + "\", function() { location.href = \"content.aspx?LangType=" + ContentLanguage + "&action=ViewPermissions&type=content&id=" + m_intId + "\";} );" + Environment.NewLine); } result.Append(" viewmenu.addBreak();" + Environment.NewLine); result.Append(" viewmenu.addItem(\" <img valign=\'center\' src=\'" + "images/ui/icons/brickLeftRight.png" + "\' /> " + MakeBold(m_refMsg.GetMessage("lbl cross sell"), 98) + "\", function() { location.href = \"commerce/recommendations/recommendations.aspx?action=crosssell&folder=" + m_intFolderId + "&id=" + m_intId + "\";} );" + Environment.NewLine); result.Append(" viewmenu.addItem(\" <img valign=\'center\' src=\'" + "images/ui/icons/brickUp.png" + "\' /> " + MakeBold(m_refMsg.GetMessage("lbl up sell"), Ektron.Cms.Common.EkConstants.CMSContentType_Content) + "\", function() { location.href = \"commerce/recommendations/recommendations.aspx?action=upsell&folder=" + m_intFolderId + "&id=" + m_intId + "\";} );" + Environment.NewLine); if ((security_data.CanEditFolders && bViewContent) || m_refContentApi.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.CommerceAdmin)) { result.Append(" viewmenu.addBreak();" + Environment.NewLine); result.Append(" viewmenu.addItem(\" <img height=\'16px\' width=\'16px\' valign=\'center\' src=\'" + "images/UI/Icons/properties.png" + "\' /> " + MakeBold(m_refMsg.GetMessage("btn properties"), Ektron.Cms.Common.EkConstants.CMSContentType_Content) + "\", function() { window.location.href = \"content.aspx?LangType=" + ContentLanguage + "&action=EditContentProperties&id=" + m_intId + "\";} );" + Environment.NewLine); } if (((security_data.CanAdd) && bViewContent) || security_data.IsReadOnly == true) { if (!(asset_data == null)) { if (asset_data.Length > 0) { for (count = 0; count <= asset_data.Length - 1; count++) { if (Ektron.Cms.Common.EkConstants.ManagedAsset_Min <= asset_data[count].TypeId && asset_data[count].TypeId <= Ektron.Cms.Common.EkConstants.ManagedAsset_Max) { if ("*" == asset_data[count].PluginType) { lAddMultiType = asset_data[count].TypeId; } else { string imgsrc = string.Empty; string txtCommName = string.Empty; if (asset_data[count].TypeId == 101) { imgsrc = " <img src=\'" + "images/UI/Icons/FileTypes/word.png" + "\' /> "; txtCommName = m_refMsg.GetMessage("lbl Office Documents"); } else if (asset_data[count].TypeId == 102 || asset_data[count].TypeId == 106) { imgsrc = " <img valign=\'center\' src=\'" + "images/UI/Icons/contentHtml.png" + " \' /> "; txtCommName = m_refMsg.GetMessage("lbl Managed Files"); } else if (asset_data[count].TypeId == 104) { imgsrc = " <img valign=\'center\' src=\'" + "images/UI/Icons/film.png" + " \' /> "; txtCommName = m_refMsg.GetMessage("lbl Multimedia"); } else { imgsrc = " "; } if (asset_data[count].TypeId != 105) { result.Append("viewmenu.addItem(\"" + imgsrc + "" + MakeBold(txtCommName, System.Convert.ToInt32(asset_data[count].TypeId)) + "\", function() { UpdateView(" + asset_data[count].TypeId + "); } );" + Environment.NewLine); } } } } } } result.Append(" MenuUtil.add( viewmenu );" + Environment.NewLine); result.Append(" var deletemenu = new Menu( \"delete\" );" + Environment.NewLine); result.Append(" deletemenu.addItem(\" <img height=\'16px\' width=\'16px\' valign=\'center\' src=\'" + "images/UI/Icons/chartBar.png" + "\' /> " + m_refMsg.GetMessage("content stats") + "\", function() { location.href = \"ContentStatistics.aspx?LangType=" + ContentLanguage + "&id=" + m_intId + "\";} );" + Environment.NewLine); result.Append(" deletemenu.addItem(\" <img height=\'16px\' width=\'16px\' valign=\'center\' src=\'" + "images/ui/icons/chartPie.png" + "\' /> " + m_refMsg.GetMessage("lbl entry reports") + "\", function() { location.href = \"Commerce/reporting/analytics.aspx?LangType=" + ContentLanguage + "&id=" + m_intId + "\";} );" + Environment.NewLine); string quicklinkUrl = SitePath + content_data.Quicklink; if (Ektron.Cms.Common.EkConstants.IsAssetContentType(content_data.Type, true) && Ektron.Cms.Common.EkFunctions.IsImage((string)("." + content_data.AssetData.FileExtension))) { quicklinkUrl = m_refContentApi.RequestInformationRef.AssetPath + content_data.Quicklink; } else if (Ektron.Cms.Common.EkConstants.IsAssetContentType(content_data.Type, true) && SitePath != "/") { string appPathOnly = m_refContentApi.RequestInformationRef.ApplicationPath.Replace(SitePath, ""); if (content_data.Quicklink.Contains(appPathOnly) || !content_data.Quicklink.Contains("downloadasset.aspx")) { quicklinkUrl = SitePath + ((content_data.Quicklink.StartsWith("/")) ? (content_data.Quicklink.Substring(1)) : content_data.Quicklink); } else { quicklinkUrl = m_refContentApi.RequestInformationRef.ApplicationPath + content_data.Quicklink; } } if (IsAnalyticsViewer() && ObjectFactory.GetAnalytics().HasProviders()) { string modalUrl = string.Format("window.open(\"{0}/analytics/seo.aspx?tab=traffic&uri={1}\", \"Analytics400\", \"width=900,height=580,scrollable=1,resizable=1\");", ApplicationPath, quicklinkUrl); result.Append(" deletemenu.addItem(\" <img height=\'16px\' width=\'16px\' valign=\'center\' src=\'" + "images/ui/icons/chartBar.png" + "\' /> " + m_refMsg.GetMessage("lbl entry analytics") + "\", function() { " + modalUrl + " } );" + Environment.NewLine); } result.Append(" MenuUtil.add( deletemenu );" + Environment.NewLine); } result.Append(" var actionmenu = new Menu( \"action\" );" + Environment.NewLine); if (security_data.CanEdit && (content_data.Status != "S" && content_data.Status != "O" || (content_data.Status == "O" && content_state_data.CurrentUserId == CurrentUserId))) { result.Append(" actionmenu.addItem(\" <img height=\'16px\' width=\'16px\' src=\'" + "images/UI/Icons/contentEdit.png" + " \' /> " + m_refMsg.GetMessage("btn edit") + "\", function() { javascript:top.document.getElementById(\'ek_main\').src=\'" + SRC + "\';return false;\"" + ",\'EDIT\',790,580,1,1);return false;" + "\" ; } );" + Environment.NewLine); } if (security_data.CanDelete) { string href; href = (string)("content.aspx?LangType=" + ContentLanguage + "&action=submitDelCatalogAction&delete_id=" + m_intId + "&page=" + Request.QueryString["calledfrom"] + "&folder_id=" + content_data.FolderId); if (!IsOrdered) { result.Append(" actionmenu.addItem(\" <img height=\'16px\' width=\'16px\' src=\'" + "images/UI/Icons/delete.png" + " \' /> " + m_refMsg.GetMessage("btn delete") + ("\", function() { DeleteConfirmationDialog(\'" + href) + "\');return false;} );" + Environment.NewLine); } } if (security_data.CanEdit) { if ((content_data.Status == "O") && ((content_state_data.CurrentUserId == CurrentUserId) || (security_data.IsAdmin || IsFolderAdmin()))) { if ((content_data.Status == "O") && ((content_state_data.CurrentUserId == CurrentUserId) || (security_data.IsAdmin || m_refContentApi.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.CommerceAdmin)))) { result.Append(" actionmenu.addItem(\" <img height=\'16px\' width=\'16px\' src=\'" + "images/ui/icons/checkIn.png" + " \' /> " + m_refMsg.GetMessage("btn checkin") + "\", function() { DisplayHoldMsg(true); window.location.href = \"content.aspx?LangType=" + ContentLanguage + "&action=CheckIn&id=" + m_intId + "&content_type=" + content_data.Type + "\" ; } );" + Environment.NewLine); } else if (IsFolderAdmin()) { result.Append(" actionmenu.addItem(\" <img height=\'16px\' width=\'16px\' src=\'" + "images/ui/icons/lockEdit.png" + " \' /> " + m_refMsg.GetMessage("lbl take ownership") + "\", function() { DisplayHoldMsg(true); window.location.href = \"content.aspx?LangType=" + ContentLanguage + "&action=TakeOwnerShip&id=" + m_intId + "&content_type=" + content_data.Type + "\" ; } );" + Environment.NewLine); } if (m_strPageAction == "view") { result.Append(" actionmenu.addItem(\" <img height=\'16px\' width=\'16px\' src=\'" + "images/UI/Icons/preview.png" + " \' /> " + m_refMsg.GetMessage("btn view stage") + "\", function() { window.location.href = \"content.aspx?LangType=" + ContentLanguage + "&action=ViewStaged&id=" + m_intId + "\" ; } );" + Environment.NewLine); } else { result.Append(" actionmenu.addItem(\" <img height=\'16px\' width=\'16px\' src=\'" + "images/UI/Icons/contentViewPublished.png" + " \' /> " + m_refMsg.GetMessage("btn view publish") + "\", function() { window.location.href = \"content.aspx?LangType=" + ContentLanguage + "&action=View&id=" + m_intId + "\" ; } );" + Environment.NewLine); } } else if (((content_data.Status == "I") || (content_data.Status == "T")) && (content_data.UserId == CurrentUserId)) { if (security_data.CanPublish) { bool metaRequuired = false; bool categoryRequired = false; bool manaliasRequired = false; string msg = string.Empty; m_refContentApi.EkContentRef.ValidateMetaDataTaxonomyAndAlias(content_data.FolderId, content_data.Id, content_data.LanguageId, ref metaRequuired, ref categoryRequired, ref manaliasRequired); if (metaRequuired == false && categoryRequired == false && manaliasRequired == false) { result.Append(" actionmenu.addItem(\" <img height=\'16px\' width=\'16px\' src=\'" + "images/application/commerce/submit.gif" + " \' /> " + m_refMsg.GetMessage("btn publish") + "\", function() { if(CheckTitle()) { DisplayHoldMsg(true); window.location.href = \"content.aspx?LangType=" + ContentLanguage + "&action=Submit&id=" + m_intId + "\" ; } } );" + Environment.NewLine); } else { if (metaRequuired && categoryRequired && manaliasRequired) { msg = m_refMsg.GetMessage("validate meta and manualalias and category required"); } else if (metaRequuired && categoryRequired && !manaliasRequired) { msg = m_refMsg.GetMessage("validate meta and category required"); } else if (metaRequuired && !categoryRequired && manaliasRequired) { msg = m_refMsg.GetMessage("validate meta and manualalias required"); } else if (!metaRequuired && categoryRequired && manaliasRequired) { msg = m_refMsg.GetMessage("validate manualalias and category required"); } else if (metaRequuired) { msg = m_refMsg.GetMessage("validate meta required"); } else if (manaliasRequired) { msg = m_refMsg.GetMessage("validate manualalias required"); } else { msg = m_refMsg.GetMessage("validate category required"); } result.Append(" actionmenu.addItem(\" <img height=\'16px\' width=\'16px\' src=\'" + "images/application/commerce/submit.gif" + " \' /> " + m_refMsg.GetMessage("btn publish") + "\", function() { DisplayHoldMsg(true); window.location.href = \"alert(\'" + msg + "\')\"" + "; } );" + Environment.NewLine); } } else { result.Append(m_refStyle.GetButtonEventsWCaption(m_refContentApi.AppPath + "images/UI/Icons/approvalSubmitFor.png", "content.aspx?LangType=" + ContentLanguage + "&action=Submit&id=" + m_intId + "&fldid=" + content_data.FolderId + "&page=workarea", m_refMsg.GetMessage("alt submit button text"), m_refMsg.GetMessage("btn submit"), "onclick=\"DisplayHoldMsg(true);return CheckForMeta(" + Convert.ToInt32(security_data.CanMetadataComplete) + ");\"")); //TODO need to pass integer not boolean } if (m_strPageAction == "view") { result.Append(" actionmenu.addItem(\" <img height=\'16px\' width=\'16px\' src=\'" + "images/UI/Icons/preview.png" + " \' /> " + m_refMsg.GetMessage("btn view stage") + "\", function() { window.location.href = \"content.aspx?LangType=" + ContentLanguage + "&action=ViewStaged&id=" + m_intId + "&fldid=" + content_data.FolderId + "\" ; } );" + Environment.NewLine); } else { result.Append(" actionmenu.addItem(\" <img height=\'16px\' width=\'16px\' src=\'" + "images/UI/Icons/contentViewPublished.png" + " \' /> " + m_refMsg.GetMessage("btn view publish") + "\", function() { window.location.href = \"content.aspx?LangType=" + ContentLanguage + "&action=View&id=" + m_intId + "&fldid=" + content_data.FolderId + "\" ; } );" + Environment.NewLine); } } else if ((content_data.Status == "O") || (content_data.Status == "I") || (content_data.Status == "S") || (content_data.Status == "T") || (content_data.Status == "P")) { if (m_strPageAction == "view") { result.Append(" actionmenu.addItem(\" <img height=\'16px\' width=\'16px\' src=\'" + "images/UI/Icons/preview.png" + " \' /> " + m_refMsg.GetMessage("btn view stage") + "\", function() { window.location.href = \"content.aspx?LangType=" + ContentLanguage + "&action=ViewStaged&id=" + m_intId + "&fldid=" + content_data.FolderId + "\" ; } );" + Environment.NewLine); } else { result.Append(" actionmenu.addItem(\" <img height=\'16px\' width=\'16px\' src=\'" + "images/UI/Icons/contentViewPublished.png" + " \' /> " + m_refMsg.GetMessage("btn view publish") + "\", function() { window.location.href = \"content.aspx?LangType=" + ContentLanguage + "&action=View&id=" + m_intId + "&fldid=" + content_data.FolderId + "\" ; } );" + Environment.NewLine); } } if (content_data.Status == "S" || content_data.Status == "M") { Util_CheckIsCurrentApprover(CurrentUserId); ApprovalScript.Visible = true; string AltPublishMsg = ""; string AltApproveMsg = ""; string AltDeclineMsg = ""; string PublishIcon = ""; string CaptionKey = ""; bool m_TaskExists = m_refContent.DoesTaskExistForContent(content_data.Id); string m_sPage = "workarea"; //To be remove not required. if (content_data.Status == "S") { AltPublishMsg = m_refMsg.GetMessage("approvals:Alt Publish Msg (change)"); AltApproveMsg = m_refMsg.GetMessage("approvals:Alt Approve Msg (change)"); AltDeclineMsg = m_refMsg.GetMessage("approvals:Alt Decline Msg (change)"); PublishIcon = "commerce/submit.gif"; CaptionKey = "btn publish"; } else { AltPublishMsg = m_refMsg.GetMessage("approvals:Alt Publish Msg (delete)"); AltApproveMsg = m_refMsg.GetMessage("approvals:Alt Approve Msg (delete)"); AltDeclineMsg = m_refMsg.GetMessage("approvals:Alt Decline Msg (delete)"); PublishIcon = "../UI/Icons/delete.png"; CaptionKey = "btn delete"; } if (security_data.CanPublish && IsLastApproval) { if (m_TaskExists == true) { result.Append(" actionmenu.addItem(\" <img src=\'" + "images/application/" + PublishIcon + " \' /> " + m_refMsg.GetMessage(CaptionKey) + "\", function() { if(CheckTitle()) { DisplayHoldMsg(true); window.location.href = (\'content.aspx?action=approveContent&id=" + content_data.Id + "&fldid=" + content_data.FolderId + "&page=" + m_sPage + "&LangType=" + content_data.LanguageId + "\') ; } } );" + Environment.NewLine); } else { result.Append(" actionmenu.addItem(\" <img src=\'" + "images/application/" + PublishIcon + " \' /> " + m_refMsg.GetMessage(CaptionKey) + "\", function() { if(CheckTitle()) { DisplayHoldMsg(true); window.location.href = \"content.aspx?action=approvecontent&id=" + content_data.Id + "&fldid=" + content_data.FolderId + "&page=" + m_sPage + "&LangType=" + ContentLanguage + "" + "\" ; } } );" + Environment.NewLine); } } else if (security_data.CanApprove && IsCurrentApproval) { if (m_TaskExists == true) { result.Append(" actionmenu.addItem(\" <img src=\'" + "images/application/Commerce/Approve.png" + " \' /> " + m_refMsg.GetMessage("btn approve") + "\", function() { DisplayHoldMsg(true); window.location.href = (\'content.aspx?action=approveContent&id=" + content_data.Id + "&fldid=" + content_data.FolderId + "&page=" + m_sPage + "&LangType=" + content_data.LanguageId + "\') ; } );" + Environment.NewLine); } else { result.Append(" actionmenu.addItem(\" <img src=\'" + "images/application/Commerce/Approve.png" + " \' /> " + m_refMsg.GetMessage("btn approve") + "\", function() { DisplayHoldMsg(true); window.location.href = \"content.aspx?action=approvecontent&id=" + content_data.Id + "&fldid=" + content_data.FolderId + "&page=" + m_sPage + "&LangType=" + ContentLanguage + "" + "\" ; } );" + Environment.NewLine); } } if ((security_data.CanPublish || security_data.CanApprove) && IsCurrentApproval) { if (m_TaskExists == true) { result.Append(" actionmenu.addItem(\" <img src=\'" + "images/application/DMSMenu/page_white_decline.gif" + "\' /> " + m_refMsg.GetMessage("btn decline") + "\", function() { window.location.href = (\'content.aspx?action=declineContent&id=" + content_data.Id + "&fldid=" + content_data.FolderId + "&page=" + m_sPage + "&LangType=" + content_data.LanguageId + "\') ; } );" + Environment.NewLine); } else { result.Append(" actionmenu.addItem(\" <img src=\'" + "images/application/DMSMenu/page_white_decline.gif" + "\' /> " + m_refMsg.GetMessage("btn decline") + "\", function() { DeclineContent(\'" + content_data.Id + "\', \'" + content_data.FolderId + "\', \'" + m_sPage + "\', \'" + ContentLanguage + "\')" + " ; } );" + Environment.NewLine); } } } } else { if (content_data.Status == "S" || content_data.Status == "M") { Util_CheckIsCurrentApprover(CurrentUserId); ApprovalScript.Visible = true; string AltPublishMsg = ""; string AltApproveMsg = ""; string AltDeclineMsg = ""; string PublishIcon = ""; string CaptionKey = ""; bool m_TaskExists = m_refContent.DoesTaskExistForContent(content_data.Id); string m_sPage = "workarea"; //To be remove not required. if (content_data.Status == "S") { AltPublishMsg = m_refMsg.GetMessage("approvals:Alt Publish Msg (change)"); AltApproveMsg = m_refMsg.GetMessage("approvals:Alt Approve Msg (change)"); AltDeclineMsg = m_refMsg.GetMessage("approvals:Alt Decline Msg (change)"); PublishIcon = "commerce/submit.gif"; CaptionKey = "btn publish"; } else { AltPublishMsg = m_refMsg.GetMessage("approvals:Alt Publish Msg (delete)"); AltApproveMsg = m_refMsg.GetMessage("approvals:Alt Approve Msg (delete)"); AltDeclineMsg = m_refMsg.GetMessage("approvals:Alt Decline Msg (delete)"); PublishIcon = "commerce/ApproveDelete.png"; CaptionKey = "approvals:lbl publish msg (delete)"; } if (security_data.CanPublish && IsLastApproval) { if (m_TaskExists == true) { result.Append(" actionmenu.addItem(\" <img src=\'" + "images/application/" + PublishIcon + " \' /> " + m_refMsg.GetMessage(CaptionKey) + "\", function() { if(CheckTitle()) { DisplayHoldMsg(true); window.location.href = (\'content.aspx?action=approveContent&id=" + content_data.Id + "&fldid=" + content_data.FolderId + "&page=" + m_sPage + "&LangType=" + content_data.LanguageId + "\') ; } } );" + Environment.NewLine); } else { result.Append(" actionmenu.addItem(\" <img src=\'" + "images/application/" + PublishIcon + " \' /> " + m_refMsg.GetMessage(CaptionKey) + "\", function() { if(CheckTitle()) { DisplayHoldMsg(true); window.location.href = \"content.aspx?action=approvecontent&id=" + content_data.Id + "&fldid=" + content_data.FolderId + "&page=" + m_sPage + "&LangType=" + ContentLanguage + "" + "\" ; } } );" + Environment.NewLine); } } else if (security_data.CanApprove && IsCurrentApproval) { if (m_TaskExists == true) { result.Append(" actionmenu.addItem(\" <img src=\'" + "images/application/Commerce/Approve.png" + " \' /> " + m_refMsg.GetMessage("btn approve") + "\", function() { DisplayHoldMsg(true); window.location.href = (\'content.aspx?action=approveContent&id=" + content_data.Id + "&fldid=" + content_data.FolderId + "&page=" + m_sPage + "&LangType=" + content_data.LanguageId + "\') ; } );" + Environment.NewLine); } else { result.Append(" actionmenu.addItem(\" <img src=\'" + "images/application/Commerce/Approve.png" + " \' /> " + m_refMsg.GetMessage("btn approve") + "\", function() { DisplayHoldMsg(true); window.location.href = \"content.aspx?action=approvecontent&id=" + content_data.Id + "&fldid=" + content_data.FolderId + "&page=" + m_sPage + "&LangType=" + ContentLanguage + "" + "\" ; } );" + Environment.NewLine); } } if ((security_data.CanPublish || security_data.CanApprove) && IsCurrentApproval) { if (m_TaskExists == true) { result.Append(" actionmenu.addItem(\" <img src=\'" + "images/application/DMSMenu/page_white_decline.gif" + " \' /> " + m_refMsg.GetMessage("btn decline") + "\", function() { window.location.href = (\'content.aspx?action=declineContent&id=" + content_data.Id + "&fldid=" + content_data.FolderId + "&page=" + m_sPage + "&LangType=" + content_data.LanguageId + "\') ; } );" + Environment.NewLine); } else { result.Append(" actionmenu.addItem(\" <img src=\'" + "images/application/DMSMenu/page_white_decline.gif" + " \' /> " + m_refMsg.GetMessage("btn decline") + "\", function() { DeclineContent(\'" + content_data.Id + "\', \'" + content_data.FolderId + "\', \'" + m_sPage + "\', \'" + ContentLanguage + "\')" + " ; } );" + Environment.NewLine); } } if (security_data.CanEditSumit) { // Don't show edit button for Mac when using XML config: if (!(m_bIsMac && (content_data.XmlConfiguration != null)) || m_SelectedEditControl == "ContentDesigner") { // result.Append(m_refStyle.GetEditAnchor(m_intId, , True)) } } if (m_strPageAction == "view") { result.Append(" actionmenu.addItem(\" <img height=\'16px\' width=\'16px\' src=\'" + "images/UI/Icons/preview.png" + " \' /> " + m_refMsg.GetMessage("btn view stage") + "\", function() { window.location.href = \"content.aspx?action=ViewStaged&id=" + m_intId + "&LangType=" + ContentLanguage + "\" ; } );" + Environment.NewLine); } else { result.Append(" actionmenu.addItem(\" <img height=\'16px\' width=\'16px\' src=\'" + "images/UI/Icons/contentViewPublished.png" + " \' /> " + m_refMsg.GetMessage("btn view publish") + "\", function() { window.location.href = \"content.aspx?LangType=" + ContentLanguage + "&action=View&id=" + m_intId + "\" ; } );" + Environment.NewLine); } //End If //END } else { if ((content_data.Status == "O") && ((security_data.IsAdmin || IsFolderAdmin()) || (security_data.CanBreakPending))) { if ((content_data.Status == "O") && ((content_state_data.CurrentUserId == CurrentUserId) || (security_data.IsAdmin || m_refContentApi.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.CommerceAdmin)))) { result.Append(" actionmenu.addItem(\" <img height=\'16px\' width=\'16px\' src=\'" + "images/ui/icons/checkIn.png" + " \' /> " + m_refMsg.GetMessage("btn checkin") + "\", function() { DisplayHoldMsg(true); window.location.href = \"content.aspx?LangType=" + ContentLanguage + "&action=CheckIn&id=" + m_intId + "&fldid=" + content_data.FolderId + "&page=workarea" + "&content_type=" + content_data.Type + "\" ; \"DisplayHoldMsg(true);return true;\"" + " } );" + Environment.NewLine); } if (m_strPageAction == "view") { result.Append(" actionmenu.addItem(\" <img height=\'16px\' width=\'16px\' src=\'" + "images/UI/Icons/preview.png" + " \' /> " + m_refMsg.GetMessage("btn view stage") + "\", function() { window.location.href = \"content.aspx?action=ViewStaged&id=" + m_intId + "&LangType=" + ContentLanguage + "\" ; } );" + Environment.NewLine); } else { result.Append(" actionmenu.addItem(\" <img height=\'16px\' width=\'16px\' src=\'" + "images/UI/Icons/contentViewPublished.png" + " \' /> " + m_refMsg.GetMessage("btn view publish") + "\", function() { window.location.href = \"content.aspx?LangType=" + ContentLanguage + "&action=View&id=" + m_intId + "\" ; } );" + Environment.NewLine); } } } } result.Append(" actionmenu.addItem(\" <img height=\'16px\' width=\'16px\' src=\'" + "images/UI/Icons/linkSearch.png" + " \' /> " + m_refMsg.GetMessage("btn link search") + "\", function() { window.location.href = \"isearch.aspx?LangType=" + ContentLanguage + "&action=dofindcontent&folderid=0&content_id=" + m_intId + ((content_data.AssetData.MimeType.IndexOf("image") != -1) ? "&asset_name=" + content_data.AssetData.Id + "." + content_data.AssetData.FileExtension : "") + "\" ; } );" + Environment.NewLine); if (security_data.CanAddTask) { result.Append(" actionmenu.addItem(\" <img height=\'16px\' width=\'16px\' src=\'" + "images/UI/Icons/taskAdd.png" + " \' /> " + m_refMsg.GetMessage("btn add task") + "\", function() { window.location.href = \"tasks.aspx?LangType=" + ContentLanguage + "&action=AddTask&cid=" + m_intId + "&callbackpage=content.aspx&parm1=action&value1=" + m_strPageAction + "&parm2=id&value2=" + m_intId + "&parm3=LangType&value3=" + ContentLanguage + "\" ; } );" + Environment.NewLine); } if (localizationMenuOptions.Length > 0) { result.Append(" actionmenu.addBreak();" + Environment.NewLine); result.Append(localizationMenuOptions); } result.Append(" MenuUtil.add( actionmenu );" + Environment.NewLine); result.Append(" </script>" + Environment.NewLine); result.Append("" + Environment.NewLine); htmToolBar.InnerHtml = result.ToString(); }
private void Display_ViewContent() { m_refMsg = m_refContentApi.EkMsgRef; bool bCanAlias = false; PermissionData security_task_data; StringBuilder sSummaryText; Ektron.Cms.UrlAliasing.UrlAliasManualApi m_aliasname = new Ektron.Cms.UrlAliasing.UrlAliasManualApi(); Ektron.Cms.UrlAliasing.UrlAliasAutoApi m_autoaliasApi = new Ektron.Cms.UrlAliasing.UrlAliasAutoApi(); Ektron.Cms.Common.UrlAliasManualData d_alias; System.Collections.Generic.List<Ektron.Cms.Common.UrlAliasAutoData> auto_aliaslist = new System.Collections.Generic.List<Ektron.Cms.Common.UrlAliasAutoData>(); Ektron.Cms.UrlAliasing.UrlAliasSettingsApi m_urlAliasSettings = new Ektron.Cms.UrlAliasing.UrlAliasSettingsApi(); int i; bool IsStagingServer; IsStagingServer = m_refContentApi.RequestInformationRef.IsStaging; security_task_data = m_refContentApi.LoadPermissions(m_intId, "tasks", ContentAPI.PermissionResultType.Task); security_data = m_refContentApi.LoadPermissions(m_intId, "content", ContentAPI.PermissionResultType.All); security_data.CanAddTask = security_task_data.CanAddTask; security_data.CanDestructTask = security_task_data.CanDestructTask; security_data.CanRedirectTask = security_task_data.CanRedirectTask; security_data.CanDeleteTask = security_task_data.CanDeleteTask; active_subscription_list = m_refContentApi.GetAllActiveSubscriptions(); if ("viewstaged" == m_strPageAction) { ContentStateData objContentState; objContentState = m_refContentApi.GetContentState(m_intId); if ("A" == objContentState.Status) { // Can't view staged m_strPageAction = "view"; } } try { if (m_strPageAction == "view") { content_data = m_refContentApi.GetContentById(m_intId, 0); } else if (m_strPageAction == "viewstaged") { content_data = m_refContentApi.GetContentById(m_intId, ContentAPI.ContentResultType.Staged); } } catch (Exception ex) { Response.Redirect("reterror.aspx?info=" + EkFunctions.UrlEncode(ex.Message), true); return; } if ((content_data != null) && (Ektron.Cms.Common.EkConstants.IsAssetContentType(Convert.ToInt64 (content_data.Type), Convert.ToBoolean (-1)))) { ContentPaneHeight = "700px"; } //ekrw = m_refContentApi.EkUrlRewriteRef() //ekrw.Load() if (((m_urlAliasSettings.IsManualAliasEnabled || m_urlAliasSettings.IsAutoAliasEnabled) && m_refContentApi.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.EditAlias)) && (content_data != null) && (content_data.AssetData != null) && !(Ektron.Cms.Common.EkFunctions.IsImage((string)("." + content_data.AssetData.FileExtension)))) { bCanAlias = true; } blog_post_data = new BlogPostData(); blog_post_data.Categories = (string[])Array.CreateInstance(typeof(string), 0); if (content_data.MetaData != null) { for (i = 0; i <= (content_data.MetaData.Length - 1); i++) { if ((string)(content_data.MetaData[i].TypeName.ToLower()) == "blog categories") { content_data.MetaData[i].Text = content_data.MetaData[i].Text.Replace("'", "\'"); content_data.MetaData[i].Text = content_data.MetaData[i].Text.Replace(""", "\""); content_data.MetaData[i].Text = content_data.MetaData[i].Text.Replace(">", ">"); content_data.MetaData[i].Text = content_data.MetaData[i].Text.Replace("<", "<"); blog_post_data.Categories = Strings.Split((string)(content_data.MetaData[i].Text), ";", -1, 0); } else if ((string)(content_data.MetaData[i].TypeName.ToLower()) == "blog pingback") { if (!(content_data.MetaData[i].Text.Trim().ToLower() == "no")) { m_bIsBlog = true; } blog_post_data.Pingback = Ektron.Cms.Common.EkFunctions.GetBoolFromYesNo((string)(content_data.MetaData[i].Text)); } else if ((string)(content_data.MetaData[i].TypeName.ToLower()) == "blog tags") { blog_post_data.Tags = (string)(content_data.MetaData[i].Text); } else if ((string)(content_data.MetaData[i].TypeName.ToLower()) == "blog trackback") { blog_post_data.TrackBackURL = (string)(content_data.MetaData[i].Text); } } } //THE FOLLOWING LINES ADDED DUE TO TASK //:BEGIN / PROPOSED BY PAT //TODO: Need to recheck this part of the code e.r. if (content_data == null) { if (ContentLanguage != 0) { if (ContentLanguage.ToString() != (string)(Ektron.Cms.CommonApi.GetEcmCookie()["DefaultLanguage"])) { Response.Redirect((string)(Request.ServerVariables["URL"] + "?" + Strings.Replace(Request.ServerVariables["Query_String"], (string)("LangType=" + ContentLanguage), (string)("LangType=" + m_refContentApi.DefaultContentLanguage), 1, -1, 0)), false); return; } } else { if (ContentLanguage.ToString() != (string)(Ektron.Cms.CommonApi.GetEcmCookie()["DefaultLanguage"])) { Response.Redirect((string)(Request.ServerVariables["URL"] + "?" + Request.ServerVariables["Query_String"] + "&LangType=" + m_refContentApi.DefaultContentLanguage), false); return; } } } //:END if (m_intFolderId == -1) { m_intFolderId = content_data.FolderId; } HoldMomentMsg.Text = m_refMsg.GetMessage("one moment msg"); if ((active_subscription_list == null) || (active_subscription_list.Length == 0)) { phWebAlerts.Visible = false; phWebAlerts2.Visible = false; } content_state_data = m_refContentApi.GetContentState(m_intId); jsFolderId.Text = m_intFolderId.ToString (); jsIsForm.Text = content_data.Type.ToString (); jsBackStr.Text = "back_file=content.aspx"; if (m_strPageAction.Length > 0) { jsBackStr.Text += "&back_action=" + m_strPageAction; } if (Convert.ToString(m_intFolderId).Length > 0) { jsBackStr.Text += "&back_folder_id=" + m_intFolderId; } if (Convert.ToString(m_intId).Length > 0) { jsBackStr.Text += "&back_id=" + m_intId; } if (Convert.ToString((short)ContentLanguage).Length > 0) { jsBackStr.Text += "&back_LangType=" + ContentLanguage; } jsToolId.Text = m_intId.ToString (); jsToolAction.Text = m_strPageAction; jsLangId.Text = m_refContentApi.ContentLanguage.ToString (); if (content_data.Type == 3333) { ViewCatalogToolBar(); } else { ViewToolBar(); } if (bCanAlias && content_data.SubType != Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderMasterData) //And folder_data.FolderType <> 1 Don't Show alias tab for Blogs. { string m_strAliasPageName = ""; d_alias = m_aliasname.GetDefaultAlias(content_data.Id); if (d_alias.QueryString != "") { m_strAliasPageName = d_alias.AliasName + d_alias.FileExtension + d_alias.QueryString; //content_data.ManualAlias } else { m_strAliasPageName = d_alias.AliasName + d_alias.FileExtension; //content_data.ManualAlias } if (m_strAliasPageName != "") { if (IsStagingServer && folder_data.DomainStaging != string.Empty) { m_strAliasPageName = (string)("http://" + folder_data.DomainStaging + "/" + m_strAliasPageName); } else if (folder_data.IsDomainFolder) { m_strAliasPageName = (string)("http://" + folder_data.DomainProduction + "/" + m_strAliasPageName); } else { m_strAliasPageName = SitePath + m_strAliasPageName; } m_strAliasPageName = "<a href=\"" + m_strAliasPageName + "\" target=\"_blank\" >" + m_strAliasPageName + "</a>"; } else { m_strAliasPageName = " [Not Defined]"; } tdAliasPageName.InnerHtml = m_strAliasPageName; } else { phAliases.Visible = false; phAliases2.Visible = false; } auto_aliaslist = m_autoaliasApi.GetListForContent(content_data.Id); autoAliasList.InnerHtml = "<div class=\"ektronHeader\">" + m_refMsg.GetMessage("lbl automatic") + "</div>"; autoAliasList.InnerHtml += "<div class=\"ektronBorder\">"; autoAliasList.InnerHtml += "<table width=\"100%\">"; autoAliasList.InnerHtml += "<tr class=\"title-header\">"; autoAliasList.InnerHtml += "<th>" + m_refMsg.GetMessage("generic type") + "</th>"; autoAliasList.InnerHtml += "<th>" + m_refMsg.GetMessage("lbl alias name") + "</th>"; autoAliasList.InnerHtml += "</tr>"; for (i = 0; i <= auto_aliaslist.Count() - 1; i++) { autoAliasList.InnerHtml += "<tr class=\"row\">"; if (auto_aliaslist[i].AutoAliasType == Ektron.Cms.Common.EkEnumeration.AutoAliasType.Folder) { autoAliasList.InnerHtml += "<td><img src =\"" + m_refContentApi.AppPath + "images/UI/Icons/folder.png\" alt=\"" + m_refContentApi.EkMsgRef.GetMessage("lbl folder") + "\" title=\"" + m_refContentApi.EkMsgRef.GetMessage("lbl folder") + "\"/ ></td>"; } else { autoAliasList.InnerHtml += "<td><img src =\"" + m_refContentApi.AppPath + "images/UI/Icons/taxonomy.png\" alt=\"" + m_refContentApi.EkMsgRef.GetMessage("generic taxonomy lbl") + "\" title=\"" + m_refContentApi.EkMsgRef.GetMessage("generic taxonomy lbl") + "\"/ ></td>"; } if (IsStagingServer && folder_data.DomainStaging != string.Empty) { autoAliasList.InnerHtml = autoAliasList.InnerHtml + "<td> <a href = \"http://" + folder_data.DomainStaging + "/" + auto_aliaslist[i].AliasName + "\" target=\"_blank\" >" + auto_aliaslist[i].AliasName + " </a></td></tr>"; } else if (folder_data.IsDomainFolder) { autoAliasList.InnerHtml += "<td> <a href = \"http://" + folder_data.DomainProduction + "/" + auto_aliaslist[i].AliasName + "\" target=\"_blank\" >" + auto_aliaslist[i].AliasName + " </a></td>"; } else { autoAliasList.InnerHtml += "<td> <a href = \"" + SitePath + auto_aliaslist[i].AliasName + "\" target=\"_blank\" >" + auto_aliaslist[i].AliasName + " </a></td>"; } autoAliasList.InnerHtml += "</tr>"; } autoAliasList.InnerHtml += "</table>"; autoAliasList.InnerHtml += "</div>"; if (content_data == null) { content_data = m_refContentApi.GetContentById(m_intId, 0); } if (content_data.Type == 3333) { m_refCatalog = new CatalogEntry(m_refContentApi.RequestInformationRef); m_refCurrency = new Currency(m_refContentApi.RequestInformationRef); //m_refMedia = MediaData() entry_edit_data = m_refCatalog.GetItemEdit(m_intId, ContentLanguage, false); Ektron.Cms.Commerce.ProductType m_refProductType = new Ektron.Cms.Commerce.ProductType(m_refContentApi.RequestInformationRef); prod_type_data = m_refProductType.GetItem(entry_edit_data.ProductType.Id, true); if (prod_type_data.Attributes.Count == 0) { phAttributes.Visible = false; phAttributes2.Visible = false; } Display_PropertiesTab(content_data); Display_PricingTab(); Display_ItemTab(); Display_MetadataTab(); Display_MediaTab(); } else { ViewContentProperties(content_data); phCommerce.Visible = false; phCommerce2.Visible = false; phItems.Visible = false; } bool bPackageDisplayXSLT = false; string CurrentXslt = ""; int XsltPntr; if ((!(content_data.XmlConfiguration == null)) && (content_data.Type == Ektron.Cms.Common.EkConstants.CMSContentType_CatalogEntry || content_data.Type == Ektron.Cms.Common.EkConstants.CMSContentType_Content || content_data.Type == Ektron.Cms.Common.EkConstants.CMSContentType_Forms)) { if (!(content_data.XmlConfiguration == null)) { if (content_data.XmlConfiguration.DefaultXslt.Length > 0) { if (content_data.XmlConfiguration.DefaultXslt == "0") { bPackageDisplayXSLT = true; } else { bPackageDisplayXSLT = false; } if (!bPackageDisplayXSLT) { XsltPntr = int.Parse(content_data.XmlConfiguration.DefaultXslt); if (XsltPntr > 0) { Collection tmpXsltColl = (Collection)content_data.XmlConfiguration.PhysPathComplete; if (tmpXsltColl["Xslt" + XsltPntr] != null) { CurrentXslt = (string)(tmpXsltColl["Xslt" + XsltPntr]); } else { tmpXsltColl = (Collection)content_data.XmlConfiguration.LogicalPathComplete; CurrentXslt = (string)(tmpXsltColl["Xslt" + XsltPntr]); } } } } else { bPackageDisplayXSLT = true; } //End If Ektron.Cms.Xslt.ArgumentList objXsltArgs = new Ektron.Cms.Xslt.ArgumentList(); objXsltArgs.AddParam("mode", string.Empty, "preview"); if (bPackageDisplayXSLT) { divContentHtml.InnerHtml = m_refContentApi.XSLTransform(content_data.Html, content_data.XmlConfiguration.PackageDisplayXslt, false, false, objXsltArgs, true, true); } else { // CurrentXslt is always obtained from the object in the database. divContentHtml.InnerHtml = m_refContentApi.XSLTransform(content_data.Html, CurrentXslt, true, false, objXsltArgs, true, true); } } else { divContentHtml.InnerHtml = content_data.Html; } } else { if (content_data.Type == 104) { media_html.Value = content_data.MediaText; //Get Url from content string tPath = m_refContentApi.RequestInformationRef.AssetPath + m_refContentApi.EkContentRef.GetFolderParentFolderIdRecursive(content_data.FolderId).Replace(",", "/") + "/" + content_data.AssetData.Id + "." + content_data.AssetData.FileExtension; string mediaHTML = FixPath(content_data.Html, tPath); int scriptStartPtr = 0; int scriptEndPtr = 0; int len = 0; //Registering the javascript & CSS this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "linkReg", "<link href=\"" + m_refContentApi.ApplicationPath + "csslib/EktTabs.css\" rel=\"stylesheet\" type=\"text/css\" />", false); mediaHTML = mediaHTML.Replace("<link href=\"" + m_refContentApi.ApplicationPath + "csslib/EktTabs.css\" rel=\"stylesheet\" type=\"text/css\" />", ""); while (1 == 1) { scriptStartPtr = mediaHTML.IndexOf("<script", scriptStartPtr); scriptEndPtr = mediaHTML.IndexOf("</script>", scriptEndPtr); if (scriptStartPtr == -1 || scriptEndPtr == -1) { break; } len = scriptEndPtr - scriptStartPtr + 9; this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), (string)("scriptreg" + scriptEndPtr), mediaHTML.Substring(scriptStartPtr, len), false); mediaHTML = mediaHTML.Replace(mediaHTML.Substring(scriptStartPtr, len), ""); scriptStartPtr = 0; scriptEndPtr = 0; } media_display_html.Value = mediaHTML; divContentHtml.InnerHtml = "<a href=\"#\" onclick=\"document.getElementById(\'" + divContentHtml.ClientID + "\').innerHTML = document.getElementById(\'" + media_display_html.ClientID + "\').value;return false;\" alt=\"" + m_refMsg.GetMessage("alt show media content") + "\" title=\"" + m_refMsg.GetMessage("alt show media content") + "\">" + m_refMsg.GetMessage("lbl show media content") + "<br/><img align=\"middle\" src=\"" + m_refContentApi.AppPath + "images/filmstrip_ph.jpg\" /></a>"; } else { if (Ektron.Cms.Common.EkConstants.IsAssetContentType(content_data.Type, Convert .ToBoolean (-1))) { string ver = ""; ver = (string)("&version=" + content_data.AssetData.Version); if (IsImage(content_data.AssetData.Version)) { divContentHtml.InnerHtml = "<img src=\"" + m_refContentApi.SitePath + "assetmanagement/DownloadAsset.aspx?ID=" + content_data.AssetData.Id + ver + "\" />"; } else { divContentHtml.InnerHtml = "<div align=\"center\" style=\"padding:15px;\"><a style=\"text-decoration:none;\" href=\"#\" onclick=\"javascript:window.open(\'" + m_refContentApi.SitePath + "assetmanagement/DownloadAsset.aspx?ID=" + content_data.AssetData.Id + ver + "\',\'DownloadAsset\',\'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width=1000,height=800\');return false;\"><img align=\"middle\" src=\"" + m_refContentApi.AppPath + "images/application/download.gif\" />" + m_refMsg.GetMessage("btn download") + " "" + content_data.Title + ""</a></div>"; } } else if (content_data.SubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderData || content_data.SubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderMasterData) { Ektron.Cms.API.UrlAliasing.UrlAliasCommon u = new Ektron.Cms.API.UrlAliasing.UrlAliasCommon(); FolderData fd = this.m_refContentApi.GetFolderById(content_data.FolderId); string stralias = u.GetAliasForContent(content_data.Id); if (stralias == string.Empty || fd.IsDomainFolder) { stralias = content_data.Quicklink; } string link = ""; if (content_data.ContType == (int)EkEnumeration.CMSContentType.Content || (content_data.ContType == (int)EkEnumeration.CMSContentType.Archive_Content && content_data.EndDateAction != 1)) { string url = this.m_refContent.RequestInformation.SitePath + stralias; if (url.Contains("?")) { url += "&"; } else { url += "?"; } if ("viewstaged" == m_strPageAction) { url += "view=staged"; } else { url += "view=published"; } url += (string)("&LangType=" + content_data.LanguageId.ToString()); link = "<a href=\"" + url + "\" onclick=\"window.open(this.href);return false;\">Click here to view the page</a><br/><br/>"; } divContentHtml.InnerHtml = link + Ektron.Cms.PageBuilder.PageData.RendertoString(content_data.Html); } else { if ((int)Ektron.Cms.Common.EkEnumeration.CMSContentType.Forms == content_data.Type || (int)Ektron.Cms.Common.EkEnumeration.CMSContentType.Archive_Forms == content_data.Type) { divContentHtml.InnerHtml = content_data.Html.Replace("[srcpath]", m_refContentApi.ApplicationPath + m_refContentApi.AppeWebPath); divContentHtml.InnerHtml = divContentHtml.InnerHtml.Replace("[skinpath]", m_refContentApi.ApplicationPath + "csslib/ContentDesigner/"); } else { divContentHtml.InnerHtml = content_data.Html; } if (m_bIsBlog) { Collection blogData = m_refContentApi.EkContentRef.GetBlogData(content_data.FolderId); if (blogData != null) { if (blogData["enablecomments"].ToString() != string.Empty) { litBlogComment.Text = "<div class=\"ektronTopSpace\"></div><a class=\"button buttonInline greenHover buttonNoIcon\" href=\"" + m_refContentApi.AppPath + "content.aspx?id=" + content_data.FolderId + "&action=ViewContentByCategory&LangType=" + content_data.LanguageId + "&ContType=" + Ektron.Cms.Common.EkConstants.CMSContentType_BlogComments + "&contentid=" + content_data.Id + "&viewin=" + content_data.LanguageId + "\" title=\"" + m_refMsg.GetMessage("alt view comments label") + "\">" + m_refMsg.GetMessage("view comments") + "</a>"; litBlogComment.Visible = true; } } } } } } sSummaryText = new StringBuilder(); if ((int)Ektron.Cms.Common.EkEnumeration.CMSContentType.Forms == content_data.Type || (int)Ektron.Cms.Common.EkEnumeration.CMSContentType.Archive_Forms == content_data.Type) { if (content_data.Teaser != null) { if (content_data.Teaser.IndexOf("<ektdesignpackage_design") > -1) { string strDesign; strDesign = m_refContentApi.XSLTransform(null, null, true, false, null, true); tdsummarytext.InnerHtml = strDesign; } else { tdsummarytext.InnerHtml = content_data.Teaser; } } else { tdsummarytext.InnerHtml = ""; } } else { if (m_bIsBlog) { sSummaryText.AppendLine("<table class=\"ektronGrid\">"); sSummaryText.AppendLine(" <tr>"); sSummaryText.AppendLine(" <td valign=\"top\" class=\"label\">"); sSummaryText.AppendLine(" " + m_refMsg.GetMessage("generic description") + ""); sSummaryText.AppendLine(" </td>"); sSummaryText.AppendLine(" <td valign=\"top\">"); } sSummaryText.AppendLine(content_data.Teaser); if (m_bIsBlog) { sSummaryText.AppendLine(" </td>"); sSummaryText.AppendLine(" </tr>"); sSummaryText.AppendLine(" <tr>"); sSummaryText.AppendLine(" <td valign=\"top\" class=\"label\">"); sSummaryText.AppendLine(" " + m_refMsg.GetMessage("lbl blog cat") + ""); sSummaryText.AppendLine(" </td>"); sSummaryText.AppendLine(" <td>"); if (!(blog_post_data.Categories == null)) { arrBlogPostCategories = blog_post_data.Categories; if (arrBlogPostCategories.Length > 0) { Array.Sort(arrBlogPostCategories); } } else { arrBlogPostCategories = null; } if (blog_post_data.Categories.Length > 0) { for (i = 0; i <= (blog_post_data.Categories.Length - 1); i++) { if (blog_post_data.Categories[i].ToString() != "") { sSummaryText.AppendLine(" <input type=\"checkbox\" name=\"blogcategories" + i.ToString() + "\" value=\"" + blog_post_data.Categories[i].ToString() + "\" checked=\"true\" disabled> " + Strings.Replace((string)(blog_post_data.Categories[i].ToString()), "~@~@~", ";", 1, -1, 0) + "<br />"); } } } else { sSummaryText.AppendLine("No categories defined."); } sSummaryText.AppendLine(" </td>"); sSummaryText.AppendLine(" </tr>"); sSummaryText.AppendLine(" <tr>"); sSummaryText.AppendLine(" <td class=\"label\" valign=\"top\">"); sSummaryText.AppendLine(" " + m_refMsg.GetMessage("lbl personal tags") + ""); sSummaryText.AppendLine(" </td>"); sSummaryText.AppendLine(" <td>"); if (!(blog_post_data == null)) { sSummaryText.AppendLine(blog_post_data.Tags); } sSummaryText.AppendLine(" </td>"); sSummaryText.AppendLine(" </tr>"); sSummaryText.AppendLine(" <tr>"); sSummaryText.AppendLine(" <td class=\"label\">"); if (!(blog_post_data == null)) { sSummaryText.AppendLine(" <input type=\"hidden\" name=\"blogposttrackbackid\" id=\"blogposttrackbackid\" value=\"" + blog_post_data.TrackBackURLID.ToString() + "\" />"); sSummaryText.AppendLine(" <input type=\"hidden\" id=\"isblogpost\" name=\"isblogpost\" value=\"true\"/>" + m_refMsg.GetMessage("lbl trackback url") + ""); sSummaryText.AppendLine(" </td>"); sSummaryText.AppendLine(" <td>"); sSummaryText.AppendLine("<input type=\"text\" size=\"75\" id=\"trackback\" name=\"trackback\" value=\"" + EkFunctions.HtmlEncode(blog_post_data.TrackBackURL) + "\" disabled/>"); sSummaryText.AppendLine(" </td>"); sSummaryText.AppendLine(" </tr>"); sSummaryText.AppendLine(" <tr>"); sSummaryText.AppendLine(" <td class=\"label\">"); if (blog_post_data.Pingback == true) { sSummaryText.AppendLine("" + m_refMsg.GetMessage("lbl blog ae ping") + ""); sSummaryText.AppendLine(" </td>"); sSummaryText.AppendLine(" <td>"); sSummaryText.AppendLine(" <input type=\"checkbox\" name=\"pingback\" id=\"pingback\" checked disabled/>"); } else { sSummaryText.AppendLine("" + m_refMsg.GetMessage("lbl blog ae ping") + ""); sSummaryText.AppendLine(" </td>"); sSummaryText.AppendLine(" <td>"); sSummaryText.AppendLine(" <input type=\"checkbox\" name=\"pingback\" id=\"pingback\" disabled/>"); } } else { sSummaryText.AppendLine(" <input type=\"hidden\" name=\"blogposttrackbackid\" id=\"blogposttrackbackid\" value=\"\" />"); sSummaryText.AppendLine(" <input type=\"hidden\" id=\"isblogpost\" name=\"isblogpost\" value=\"true\"/>" + m_refMsg.GetMessage("lbl trackback url") + ""); sSummaryText.AppendLine("<input type=\"text\" size=\"75\" id=\"trackback\" name=\"trackback\" value=\"\" disabled/>"); sSummaryText.AppendLine(" </td>"); sSummaryText.AppendLine(" </tr>"); sSummaryText.AppendLine(" <tr>"); sSummaryText.AppendLine(" <td class=\"label\">" + m_refMsg.GetMessage("lbl blog ae ping") + ""); sSummaryText.AppendLine(" </td>"); sSummaryText.AppendLine(" <td>"); sSummaryText.AppendLine(" <input type=\"checkbox\" name=\"pingback\" id=\"pingback\" disabled/>"); } sSummaryText.AppendLine(" </td>"); sSummaryText.AppendLine(" </tr>"); sSummaryText.AppendLine("</table>"); } tdsummarytext.InnerHtml = sSummaryText.ToString(); } ViewMetaData(content_data); tdcommenttext.InnerHtml = content_data.Comment; AddTaskTypeDropDown(); ViewTasks(); ViewSubscriptions(); Ektron.Cms.Content.EkContent cref; cref = m_refContentApi.EkContentRef; TaxonomyBaseData[] dat; dat = cref.GetAllFolderTaxonomy(folder_data.Id); if (dat == null || dat.Length == 0) { phCategories.Visible = false; phCategories2.Visible = false; } ViewAssignedTaxonomy(); if ((content_data != null) && ((content_data.Type >= EkConstants.ManagedAsset_Min && content_data.Type <= EkConstants.ManagedAsset_Max && content_data.Type != 104) || (content_data.Type >= EkConstants.Archive_ManagedAsset_Min && content_data.Type <= EkConstants.Archive_ManagedAsset_Max && content_data.Type != 1104) || content_data.SubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderData || content_data.SubType == Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.PageBuilderMasterData)) { showAlert = false; } if ( (Request.QueryString["menuItemType"] != null && Request.QueryString["menuItemType"].ToLower() == "viewproperties") || (Request.QueryString["tab"] != null && Request.QueryString["tab"].ToLower() == "properties") ) { DefaultTab.Value = "dvProperties"; Util_ReloadTree(content_data.Path, content_data.FolderId); } }
private void ViewCatalogToolBar(long entryCount) { System.Text.StringBuilder result = new System.Text.StringBuilder(); string altText = ""; long ParentId = _FolderData.ParentId; Ektron.Cms.Commerce.ProductType pProductType = new Ektron.Cms.Commerce.ProductType(_ContentApi.RequestInformationRef); bool bSelectedFound = false; bool bViewContent = System.Convert.ToBoolean("viewcontentbycategory" == _PageAction); // alternative is archived content bool bCommerceAdmin = true; bool bFolderAdmin = false; bCommerceAdmin = _ContentApi.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.CommerceAdmin); bFolderAdmin = System.Convert.ToBoolean(bFolderAdmin || bCommerceAdmin); if (bViewContent) { txtTitleBar.InnerHtml = _StyleHelper.GetTitleBar((string)(_MessageHelper.GetMessage("lbl view catalog") + " \"" + _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("lbl view catalog archive") + " \"" + _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 || bCommerceAdmin) && 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 || bCommerceAdmin) { 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>"); } if (bViewContent && (_PermissionData.IsAdmin || bFolderAdmin || bCommerceAdmin) || (_PermissionData.CanDelete)) { 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(); } List<ProductTypeData> active_prod_list = new List<ProductTypeData>(); active_prod_list = pProductType.GetFolderProductTypeList(_FolderData.Id); bool smartFormsRequired = System.Convert.ToBoolean(!Utilities.IsNonFormattedContentAllowed(active_prod_list.ToArray())); bool canAddAssets = System.Convert.ToBoolean((_PermissionData.CanAdd || _PermissionData.CanAddFolders) && bViewContent); 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 || bCommerceAdmin) { 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) { if (active_prod_list.Count > 0) { int k; for (k = 0; k <= active_prod_list.Count - 1; k++) { if (active_prod_list[k].Id != 0) { result.Append(" filemenu.addItem(\" <img valign=\'middle\' src=\'" + "images/ui/icons/"); if (active_prod_list[k].EntryClass == Ektron.Cms.Common.EkEnumeration.CatalogEntryType.SubscriptionProduct) { result.Append("bookGreen.png"); } else if (active_prod_list[k].EntryClass == Ektron.Cms.Common.EkEnumeration.CatalogEntryType.Kit) { result.Append("box.png"); } else if (active_prod_list[k].EntryClass == Ektron.Cms.Common.EkEnumeration.CatalogEntryType.Bundle) { result.Append("package.png"); } else { result.Append("brick.png"); } result.Append("\' /> " + active_prod_list[k].Title + "\", function() { " + _StyleHelper.GetCatalogAddAnchorType(_Id, active_prod_list[k].Id) + " } );" + Environment.NewLine); } } } } if (_PermissionData.CanAdd || _PermissionData.CanAddFolders) { result.Append(" MenuUtil.add( filemenu );" + Environment.NewLine); } result.Append(" var viewmenu = new Menu( \"view\" );" + Environment.NewLine); result.Append(" viewmenu.addItem(\" <img valign=\'middle\' src=\'" + "images/ui/icons/folderGreenView.png" + "\' /> " + MakeBold(_MessageHelper.GetMessage("lbl All Types"), -1, Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.AllTypes) + "\", function() { UpdateView(" + _CMSContentType_AllTypes + "); } );" + Environment.NewLine); result.Append(" viewmenu.addItem(\" <img valign=\'middle\' src=\'" + "Images/ui/icons/brick.png" + "\' /> " + MakeBold(_MessageHelper.GetMessage("lbl commerce products"), 0, Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.AllTypes) + "\", function() { UpdateView(" + Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.CatalogEntryType.Product) + "); } );" + Environment.NewLine); result.Append(" viewmenu.addItem(\" <img valign=\'middle\' src=\'" + "images/ui/icons/box.png" + "\' /> " + MakeBold(_MessageHelper.GetMessage("lbl commerce kits"), 2, Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.AllTypes) + "\", function() { UpdateView(" + Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.CatalogEntryType.Kit) + "); } );" + Environment.NewLine); result.Append(" viewmenu.addItem(\" <img valign=\'middle\' src=\'" + "images/ui/icons/package.png" + "\' /> " + MakeBold(_MessageHelper.GetMessage("lbl commerce bundles"), 3, Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.AllTypes) + "\", function() { UpdateView(" + Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.CatalogEntryType.Bundle) + "); } );" + Environment.NewLine); result.Append(" viewmenu.addItem(\" <img valign=\'middle\' src=\'" + "images/ui/icons/bookGreen.png" + "\' /> " + MakeBold(_MessageHelper.GetMessage("lbl commerce subscriptions"), 4, Ektron.Cms.Common.EkEnumeration.CMSContentSubtype.AllTypes) + "\", function() { UpdateView(" + Convert.ToInt32(Ektron.Cms.Common.EkEnumeration.CatalogEntryType.SubscriptionProduct) + "); } );" + Environment.NewLine); if (((_PermissionData.CanAdd) && bViewContent) || _PermissionData.IsReadOnly == true) { AddLanguageMenu(result); if (bViewContent) { result.Append(" viewmenu.addItem(\" <img valign=\'middle\' src=\'" + "images/UI/Icons/contentArchived.png" + "\' /> " + _MessageHelper.GetMessage("lbl archive entry title") + "\", function() { window.location.href = \'content.aspx?action=" + _NextActionType + "&id=" + _Id + "&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/properties.png" + "\' /> " + _MessageHelper.GetMessage("lbl catalog view entry") + "\", function() { window.location.href = \'content.aspx?action=" + _NextActionType + "&id=" + _Id + "&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); } if (((_PermissionData.CanEditFolders || _PermissionData.CanEditApprovals) && bViewContent) || bFolderAdmin) { result.Append(" viewmenu.addBreak();" + Environment.NewLine); result.Append(" viewmenu.addItem(\" <img src=\'" + "images/UI/Icons/properties.png" + " \' /> " + _MessageHelper.GetMessage("lbl catalog Properties") + "\", function() { window.location.href = \'content.aspx?LangType=" + _ContentLanguage + "&action=ViewFolder&id=" + _Id + "\' } );" + Environment.NewLine); } result.Append(" MenuUtil.add( viewmenu );" + Environment.NewLine); result.Append(" var deletemenu = new Menu( \"delete\" );" + Environment.NewLine); if ((_PermissionData.CanDeleteFolders || bCommerceAdmin) && bViewContent && _Id != 0) { result.Append(" deletemenu.addItem(\" <img src=\'" + "images/UI/Icons/folderGreenDelete.png" + " \' /> " + _MessageHelper.GetMessage("lbl this catalog") + "\", function() { if( ConfirmFolderDelete(" + _Id + ") ) { window.location.href = \'content.aspx?LangType=" + _ContentLanguage + "&action=DoDeleteFolder&id=" + _Id + "&ParentID=" + ParentId + "\'; }} );" + Environment.NewLine); } if ((entryCount > 0) && (bViewContent && (_PermissionData.IsAdmin || bFolderAdmin) || _PermissionData.CanDelete)) { if (Convert.ToString(_EnableMultilingual) == "1" && _ContentLanguage < 1) { result.Append(" deletemenu.addItem(\" <img src=\'" + "images/UI/Icons/brickDelete.png" + " \' /> " + _MessageHelper.GetMessage("lbl catalog del entry") + "\", 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/brickDelete.png" + " \' /> " + _MessageHelper.GetMessage("lbl catalog del entry") + "\", 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/brickDelete.png" + " \' /> " + _MessageHelper.GetMessage("lbl catalog del entry") + "\", 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); result.Append(" actionmenu.addItem(\" <img src=\'" + "images/UI/Icons/magnifier.png" + " \' /> " + _MessageHelper.GetMessage("generic Search") + "\", function() { window.location.href = \'productsearch.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); } } result.Append(" MenuUtil.add( actionmenu );" + Environment.NewLine); result.Append(" </script>" + Environment.NewLine); result.Append("" + Environment.NewLine); htmToolBar.InnerHtml = result.ToString(); }