protected override void Render(HtmlTextWriter writer) { IContentAdapterProvider adapters = Engine.Resolve <IContentAdapterProvider>(); if (Nodes == null) { Nodes = new BranchHierarchyBuilder(SelectedItem, RootNode, true) .Children((item) => adapters.ResolveAdapter <NodeAdapter>(item).GetChildren(item, Interfaces.Managing)) .Build(); } TreeUtility.Write(Nodes, SelectedItem, adapters, Filter, SelectableTypes, SelectableExtensions, excludeRoot: false, target: Target, writer: writer); }
public override void ProcessRequest(HttpContext context) { string target = context.Request["target"] ?? Targets.Preview; var selection = new SelectionUtility(context.Request, N2.Context.Current); ContentItem selectedItem = selection.SelectedItem; context.Response.ContentType = "text/plain"; ItemFilter filter = Engine.EditManager.GetEditorFilter(context.User); IContentAdapterProvider adapters = Engine.Resolve <IContentAdapterProvider>(); var node = new TreeHierarchyBuilder(selectedItem, 2) .Children((item) => adapters.ResolveAdapter <NodeAdapter>(item).GetChildren(item, Interfaces.Managing)) .Build(); string selectableTypes = context.Request["selectableTypes"]; string selectableExtensions = context.Request["selectableExtensions"]; TreeUtility.Write(node, selectedItem, adapters, filter, selectableTypes, selectableExtensions, excludeRoot: true, target: target, writer: context.Response.Output); }