Migrated section controller + LanguageTreeController, ApplciationTreeController.
Updated AngularJsonOnlyConfigurationAttribute to be a TypeFilterAttribute, to allow injeciton into the filter. Note: Left TODO about checking authorization of proxied trees..
This commit is contained in:
56
src/Umbraco.Web.BackOffice/Trees/LanguageTreeController.cs
Normal file
56
src/Umbraco.Web.BackOffice/Trees/LanguageTreeController.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Web.BackOffice.Filters;
|
||||
using Umbraco.Web.BackOffice.Trees;
|
||||
using Umbraco.Web.Common.Attributes;
|
||||
using Umbraco.Web.Models.Trees;
|
||||
using Umbraco.Web.WebApi;
|
||||
using Constants = Umbraco.Core.Constants;
|
||||
|
||||
namespace Umbraco.Web.Trees
|
||||
{
|
||||
[UmbracoTreeAuthorize(Constants.Trees.Languages)]
|
||||
[Tree(Constants.Applications.Settings, Constants.Trees.Languages, SortOrder = 11, TreeGroup = Constants.Trees.Groups.Settings)]
|
||||
[PluginController("UmbracoTrees")]
|
||||
[CoreTree]
|
||||
public class LanguageTreeController : TreeController
|
||||
{
|
||||
|
||||
public LanguageTreeController(
|
||||
ILocalizedTextService textService,
|
||||
UmbracoApiControllerTypeCollection umbracoApiControllerTypeCollection)
|
||||
: base(textService, umbracoApiControllerTypeCollection)
|
||||
{
|
||||
}
|
||||
protected override TreeNodeCollection GetTreeNodes(string id, FormCollection queryStrings)
|
||||
{
|
||||
//We don't have any child nodes & only use the root node to load a custom UI
|
||||
return new TreeNodeCollection();
|
||||
}
|
||||
|
||||
protected override MenuItemCollection GetMenuForNode(string id, FormCollection queryStrings)
|
||||
{
|
||||
//We don't have any menu item options (such as create/delete/reload) & only use the root node to load a custom UI
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helper method to create a root model for a tree
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
protected override TreeNode CreateRootNode(FormCollection queryStrings)
|
||||
{
|
||||
var root = base.CreateRootNode(queryStrings);
|
||||
|
||||
//this will load in a custom UI instead of the dashboard for the root node
|
||||
root.RoutePath = $"{Constants.Applications.Settings}/{Constants.Trees.Languages}/overview";
|
||||
root.Icon = "icon-globe";
|
||||
root.HasChildren = false;
|
||||
root.MenuUrl = null;
|
||||
|
||||
return root;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user