public void Edit(ClientPipelineArgs args) { if (args.IsPostBack) { if (!args.HasResult) { return; } Value = args.Result; SetModified(); SheerResponse.Refresh(this); } else { Assert.IsNotNull(DialogUrl, "Dialog URL"); var urlString = new UrlString(UIUtil.GetUri(DialogUrl)); var itemUri = new ItemUri(ItemId, Sitecore.Configuration.Factory.GetDatabase("master")); var fieldItem = Sitecore.Context.ContentDatabase.GetItem(FieldId); urlString["itemUri"] = itemUri.ToString(); urlString["fieldName"] = fieldItem.Name; Sitecore.Context.ClientPage.ClientResponse.ShowModalDialog(urlString.ToString(), "650px", "700px", string.Empty, true); args.WaitForPostBack(); } }
private static List <Item> BuildItems() { List <Item> objList = new List <Item>(); ItemUri queryString = ItemUri.ParseQueryString(); Assert.IsNotNull((object)queryString, "Item Uri not found"); Item obj = Database.GetItem(queryString); Assert.IsNotNull((object)obj, "Item \"{0}\" not found.", (object)queryString.ToString()); return(Sitecore.Data.Masters.Masters.GetMasters(obj)); }
public override void OpenTemplateFieldSorter(ItemUri templateUri) { Assert.ArgumentNotNull(templateUri, nameof(templateUri)); var window = TemplateFieldSorterFactory.CreateEditor(templateUri.ToString()); if (window != null) { window.Initialize(templateUri); } }
public static string DecodeUri(this ItemUri origin) { return(HttpUtility.UrlDecode(origin.ToString())); }
protected void LoadItem(ItemUri uri, string root) { Assert.ArgumentNotNull(uri, "uri"); Assert.ArgumentNotNull(root, "root"); if (Database.GetItem(uri) == null) { SheerResponse.Alert("The selected item could not be found.\n\nIt may have been deleted by another user.\n\nSelect another item.", new string[0]); } else { NameValueCollection values2 = new NameValueCollection(); values2.Add("uri", uri.ToString()); values2.Add("root", root); values2.Add("disablehistory", this.DisableHistory ? "1" : "0"); NameValueCollection parameters = values2; Context.ClientPage.Start(this, "LoadItemPipeline", parameters); } }
public void Edit(ClientPipelineArgs args) { if (args.IsPostBack) { if (!args.HasResult) return; Value = args.Result; SetModified(); SheerResponse.Refresh(this); } else { Assert.IsNotNull(DialogUrl, "Dialog URL"); var urlString = new UrlString(UIUtil.GetUri(DialogUrl)); var itemUri = new ItemUri(ItemId, Sitecore.Configuration.Factory.GetDatabase("master")); var fieldItem = Sitecore.Context.ContentDatabase.GetItem(FieldId); urlString["itemUri"] = itemUri.ToString(); urlString["fieldName"] = fieldItem.Name; Sitecore.Context.ClientPage.ClientResponse.ShowModalDialog(urlString.ToString(), "650px", "700px", string.Empty, true); args.WaitForPostBack(); } }