protected void SystemMenu_Click() { var contextMenu = new Sitecore.Web.UI.HtmlControls.Menu(); SheerResponse.DisableOutput(); Item item = Client.CoreDatabase.GetItem(Sitecore.ItemBucket.Kernel.Util.Constants.ContentEditorSystemMenu); if (item != null) { contextMenu.AddFromDataSource(item, string.Empty); SheerResponse.EnableOutput(); SheerResponse.ShowContextMenu("SystemMenu", "below", contextMenu); } }
protected void Validator_ContextMenu(string markerId) { Assert.ArgumentNotNull(markerId, "markerId"); Assert.IsTrue(UserOptions.ContentEditor.ShowValidatorBar, "Validator bar is switched off in Content Editor."); var byMarkerID = ValidatorManager.GetValidators(ValidatorsMode.ValidatorBar, this.ValidatorsKey).GetByMarkerID(markerId); if (byMarkerID != null) { SheerResponse.DisableOutput(); var contextMenu = new Sitecore.Web.UI.HtmlControls.Menu(); if (byMarkerID.HasMenu) { Assert.IsNotNull(Context.ContentDatabase, "Content database not found."); Assert.IsNotNull(byMarkerID.ValidatorID, "Validator ID is null."); Item item = Context.ContentDatabase.GetItem(byMarkerID.ValidatorID); if (item != null) { contextMenu.AddFromDataSource(item, byMarkerID.MarkerID); contextMenu.AddDivider(); } } contextMenu.Add("Suppress Validation Rule", string.Empty, string.Format("Validator_SuppressValidator(\"{0}\")", markerId)); SheerResponse.EnableOutput(); SheerResponse.ShowContextMenu(Context.ClientPage.ClientRequest.Control, string.Empty, contextMenu); } }
protected void SystemMenu_Click() { Sitecore.Web.UI.HtmlControls.Menu contextMenu = new Sitecore.Web.UI.HtmlControls.Menu(); SheerResponse.DisableOutput(); Item item = Client.CoreDatabase.GetItem("/sitecore/content/Applications/Content Editor/Menues/System"); if (item != null) { contextMenu.AddFromDataSource(item, string.Empty); SheerResponse.EnableOutput(); SheerResponse.ShowContextMenu("SystemMenu", "below", contextMenu); } }