Port 7.7 - WIP

This commit is contained in:
Stephan
2017-09-12 16:22:16 +02:00
parent 1c96df83cd
commit 96c08f24ee
176 changed files with 5490 additions and 4892 deletions

View File

@@ -2,11 +2,14 @@ using System;
using System.Globalization;
using System.Linq;
using System.Net.Http.Formatting;
using AutoMapper;
using Umbraco.Core;
using Umbraco.Core.Services;
using Umbraco.Core.Models;
using Umbraco.Web.Models.ContentEditing;
using Umbraco.Web.Models.Trees;
using Umbraco.Web.Mvc;
using Umbraco.Web.Search;
using Umbraco.Web.WebApi.Filters;
using Umbraco.Web._Legacy.Actions;
using Constants = Umbraco.Core.Constants;
@@ -17,7 +20,7 @@ namespace Umbraco.Web.Trees
[Tree(Constants.Applications.Settings, Constants.Trees.Templates, null, sortOrder:1)]
[PluginController("UmbracoTrees")]
[CoreTree]
public class TemplatesTreeController : TreeController
public class TemplatesTreeController : TreeController, ISearchableTree
{
/// <summary>
/// The method called to render the contents of the tree structure
@@ -121,5 +124,11 @@ namespace Umbraco.Web.Trees
Uri.EscapeDataString("settings/editTemplate.aspx?templateID=" + template.Id)
: null;
}
public IEnumerable<SearchResultItem> Search(string query, int pageSize, long pageIndex, out long totalFound, string searchFrom = null)
{
var results = Services.EntityService.GetPagedDescendantsFromRoot(UmbracoObjectTypes.Template, pageIndex, pageSize, out totalFound, filter: query);
return Mapper.Map<IEnumerable<SearchResultItem>>(results);
}
}
}