2014-11-20 16:28:50 +11:00
|
|
|
using System.Net.Http.Formatting;
|
|
|
|
|
using Umbraco.Web.Models.Trees;
|
|
|
|
|
using Umbraco.Web.Mvc;
|
|
|
|
|
using Umbraco.Web.WebApi.Filters;
|
|
|
|
|
using Constants = Umbraco.Core.Constants;
|
|
|
|
|
|
|
|
|
|
namespace Umbraco.Web.Trees
|
|
|
|
|
{
|
|
|
|
|
[UmbracoTreeAuthorize(Constants.Trees.Languages)]
|
2019-01-22 09:31:47 +01:00
|
|
|
[Tree(Constants.Applications.Settings, Constants.Trees.Languages, SortOrder = 11, TreeGroup = Constants.Trees.Groups.Settings)]
|
2014-11-20 16:28:50 +11:00
|
|
|
[PluginController("UmbracoTrees")]
|
2019-01-22 09:31:47 +01:00
|
|
|
[CoreTree]
|
2014-11-20 16:28:50 +11:00
|
|
|
public class LanguageTreeController : TreeController
|
|
|
|
|
{
|
|
|
|
|
protected override TreeNodeCollection GetTreeNodes(string id, FormDataCollection queryStrings)
|
|
|
|
|
{
|
2018-03-21 11:42:09 +00:00
|
|
|
//We don't have any child nodes & only use the root node to load a custom UI
|
|
|
|
|
return new TreeNodeCollection();
|
|
|
|
|
}
|
2014-11-20 17:54:30 +11:00
|
|
|
|
2018-03-21 11:42:09 +00:00
|
|
|
protected override MenuItemCollection GetMenuForNode(string id, FormDataCollection 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;
|
2014-11-20 16:28:50 +11:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2018-03-21 11:42:09 +00:00
|
|
|
/// Helper method to create a root model for a tree
|
2014-11-20 16:28:50 +11:00
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
2018-03-21 11:42:09 +00:00
|
|
|
protected override TreeNode CreateRootNode(FormDataCollection queryStrings)
|
2014-11-20 16:28:50 +11:00
|
|
|
{
|
2018-03-21 11:42:09 +00:00
|
|
|
var root = base.CreateRootNode(queryStrings);
|
2014-11-20 17:54:30 +11:00
|
|
|
|
2018-03-21 11:42:09 +00:00
|
|
|
//this will load in a custom UI instead of the dashboard for the root node
|
2018-10-05 11:51:34 +02:00
|
|
|
root.RoutePath = $"{Constants.Applications.Settings}/{Constants.Trees.Languages}/overview";
|
2018-04-03 11:25:59 +02:00
|
|
|
root.Icon = "icon-globe";
|
2018-03-21 15:53:09 +00:00
|
|
|
root.HasChildren = false;
|
|
|
|
|
root.MenuUrl = null;
|
2014-11-20 16:28:50 +11:00
|
|
|
|
2018-03-21 11:42:09 +00:00
|
|
|
return root;
|
2014-11-20 16:28:50 +11:00
|
|
|
}
|
|
|
|
|
}
|
2015-10-29 16:26:06 +01:00
|
|
|
}
|