public string GetPageBuilderEditAnchor(long Id, int languageId, string quickLink, bool isPrimary) { //make popup window with link to this pageids wireframe, and pass in the id and an edit flag ContentAPI capi = new ContentAPI(); FolderData fd = capi.GetFolderById(capi.GetFolderIdForContentId(Id)); AliasData aliasData = new AliasData(); string URL = ""; AliasSettings aliasSettings = ObjectFactory.GetAliasSettingsManager(this.m_refAPI.RequestInformationRef).Get(); if (aliasSettings.IsAliasingEnabled) { IAliasManager aliasManager = ObjectFactory.GetAliasManager(this.m_refAPI.RequestInformationRef); aliasData = aliasManager.GetAlias(Id, languageId, EkEnumeration.TargetType.Content); URL = aliasData.Alias; } // Note that the internal API changed, if a content items has a default alias it will be passed into this funciton as param quicklink. // Keeping this code incase other places are calling this function without alias in quicklink param if (String.IsNullOrEmpty(URL)) { URL = quickLink; } // If it is a multi site, use the quicklink as the alias will not function in other domains. ALias is tied to domain. if (fd.IsDomainFolder && aliasData != null && !string.IsNullOrEmpty(aliasData.TargetURL)) { URL = aliasData.TargetURL.TrimStart('/'); } else if (fd.IsDomainFolder) { URL = URL.TrimStart('/'); } if (URL.Contains("?")) { URL = URL + "&ektronPageBuilderEdit=true"; } else { URL = URL + "?ektronPageBuilderEdit=true"; } if (URL.IndexOf("LangType=") == -1) { URL = URL + "&LangType=" + languageId.ToString(); } URL = this.m_refAPI.SitePath + URL; URL = GetButtonEventsWCaption(m_refAPI.AppImgPath + "layout_edit.gif", "#", m_refMsg.GetMessage("generic edit page layout"), m_refMsg.GetMessage("generic edit page layout"), "OnClick=\"window.open(\'" + URL + "\', \'CMS400EditPage\');return false;\"", EditButtonCssClass, isPrimary); return URL; }
void EditEvent(string settings) { try { tabTesting.Visible = _ShowTestingTab; string webserviceURL = _api.SitePath + "widgets/contentblock/CBHandler.ashx"; // Register JS JS.RegisterJSInclude(this, JS.ManagedScript.EktronJS); Ektron.Cms.API.JS.RegisterJSInclude(this, Ektron.Cms.API.JS.ManagedScript.EktronClueTipJS); JS.RegisterJSInclude(this, JS.ManagedScript.EktronScrollToJS); JS.RegisterJSInclude(this, _api.SitePath + "widgets/contentblock/behavior.js", "ContentBlockWidgetBehaviorJS"); // Insert CSS Links Css.RegisterCss(this, _api.SitePath + "widgets/contentblock/CBStyle.css", "CBWidgetCSS"); //cbstyle will include the other req'd stylesheets Ektron.Cms.Framework.UI.Packages.jQuery.jQueryUI.ThemeRoller.Register(this); //cbstyle will include the other req'd stylesheets JS.RegisterJSBlock(this, "Ektron.PFWidgets.ContentBlock.webserviceURL = \"" + webserviceURL + "\"; Ektron.PFWidgets.ContentBlock.setupAll('"+ ClientID +"');", "EktronPFWidgetsCBInit"); IsGoogleMultivariate = cbMultiVariate.Checked; GoogleSectionName = tbSectionName.Text; ViewSet.SetActiveView(Edit); if (ContentBlockId > 0) { tbData.Text = ContentBlockId.ToString(); ContentAPI capi = new ContentAPI(); long folderid = capi.GetFolderIdForContentId(ContentBlockId); tbFolderPath.Text = folderid.ToString(); while (folderid != 0) { folderid = capi.GetParentIdByFolderId(folderid); if (folderid > 0) tbFolderPath.Text += "," + folderid.ToString(); } } } catch (Exception e) { errorLb.Text = e.Message + e.Data + e.StackTrace + e.Source + e.ToString(); _host.Title = _host.Title + " error"; ViewSet.SetActiveView(View); } }
public string GetPageBuilderEditAnchor(long Id, int languageId, string quickLink, bool isPrimary) { //make popup window with link to this pageids wireframe, and pass in the id and an edit flag ContentAPI capi = new ContentAPI(); FolderData fd = capi.GetFolderById(capi.GetFolderIdForContentId(Id)); string URL = ""; Ektron.Cms.API.UrlAliasing.UrlAliasCommon u = new Ektron.Cms.API.UrlAliasing.UrlAliasCommon(); URL = u.GetAliasForContent(Id); if (URL == string.Empty || fd.IsDomainFolder) { URL = quickLink; } if (URL.Contains("?")) { URL = URL + "&ektronPageBuilderEdit=true"; } else { URL = URL + "?ektronPageBuilderEdit=true"; } if (URL.IndexOf("LangType=") == -1) { URL = URL + "&LangType=" + languageId.ToString(); } URL = this.m_refAPI.SitePath + URL; URL = GetButtonEventsWCaption(m_refAPI.AppImgPath + "layout_edit.gif", "#", m_refMsg.GetMessage("generic edit page layout"), m_refMsg.GetMessage("generic edit page layout"), "OnClick=\"window.open(\'" + URL + "\', \'CMS400EditPage\');return false;\"", EditButtonCssClass, isPrimary); return URL; }