Gets trees and sections loading now in a much more simplified way without any xml, now to cleanup
This commit is contained in:
@@ -14,13 +14,13 @@ namespace Umbraco.Web.Search
|
||||
{
|
||||
private readonly Dictionary<string, SearchableApplicationTree> _dictionary;
|
||||
|
||||
public SearchableTreeCollection(IEnumerable<ISearchableTree> items, IApplicationTreeService treeService)
|
||||
public SearchableTreeCollection(IEnumerable<ISearchableTree> items, ITreeService treeService)
|
||||
: base(items)
|
||||
{
|
||||
_dictionary = CreateDictionary(treeService);
|
||||
}
|
||||
|
||||
private Dictionary<string, SearchableApplicationTree> CreateDictionary(IApplicationTreeService treeService)
|
||||
private Dictionary<string, SearchableApplicationTree> CreateDictionary(ITreeService treeService)
|
||||
{
|
||||
var appTrees = treeService.GetAll()
|
||||
.OrderBy(x => x.SortOrder)
|
||||
@@ -29,10 +29,10 @@ namespace Umbraco.Web.Search
|
||||
var searchableTrees = this.ToArray();
|
||||
foreach (var appTree in appTrees)
|
||||
{
|
||||
var found = searchableTrees.FirstOrDefault(x => x.TreeAlias.InvariantEquals(appTree.Alias));
|
||||
var found = searchableTrees.FirstOrDefault(x => x.TreeAlias.InvariantEquals(appTree.TreeAlias));
|
||||
if (found != null)
|
||||
{
|
||||
dictionary[found.TreeAlias] = new SearchableApplicationTree(appTree.ApplicationAlias, appTree.Alias, found);
|
||||
dictionary[found.TreeAlias] = new SearchableApplicationTree(appTree.ApplicationAlias, appTree.TreeAlias, found);
|
||||
}
|
||||
}
|
||||
return dictionary;
|
||||
|
||||
Reference in New Issue
Block a user