Esempio n. 1
0
        public static DeleteContentOptions Parse()
        {
            ItemUri uri = ItemUri.ParseQueryString();

            Assert.IsNotNull(uri, "itemUri is null");
            Sitecore.Data.Items.Item item = Database.GetItem(uri);
            Assert.IsNotNull(item, "Item \"{0}\" not found", new object[] { uri });
            DeleteContentOptions options = new DeleteContentOptions(item);

            options.ExpandStandardValuesTokens = MainUtil.GetBool(WebUtil.GetQueryString("expandtokens"), false);
            return(options);
        }
Esempio n. 2
0
 protected override void OnLoad(EventArgs e)
 {
     Assert.ArgumentNotNull(e, "e");
     base.OnLoad(e);
     if (!Context.ClientPage.IsEvent)
     {
         DeleteContentOptions options = DeleteContentOptions.Parse();
         //this.sortBy = options.SortBy;
         this.expandStandardValuesTokens = options.ExpandStandardValuesTokens;
         string contentQuery = "*";
         Assert.IsNotNullOrEmpty(contentQuery, "query");
         Item[] itemsToSort = this.GetItems(options.Item, contentQuery);
         Array.Sort <Item>(itemsToSort, new DefaultComparer());
         if (itemsToSort.Length < 1)
         {
             base.OK.Disabled = true;
         }
         else
         {
             this.MainContainer.Controls.Clear();
             this.MainContainer.InnerHtml = this.Render(itemsToSort);
         }
     }
 }