2018-12-06 09:32:04 +00:00
|
|
|
|
using System.Net.Http.Formatting;
|
2019-11-05 12:54:22 +01:00
|
|
|
|
using Umbraco.Core;
|
2018-10-02 14:14:25 +02:00
|
|
|
|
using Umbraco.Web.Models.Trees;
|
|
|
|
|
|
using Umbraco.Web.Mvc;
|
|
|
|
|
|
using Umbraco.Web.WebApi.Filters;
|
2019-11-05 13:45:42 +01:00
|
|
|
|
using Constants = Umbraco.Core.Constants;
|
2018-10-02 14:14:25 +02:00
|
|
|
|
|
|
|
|
|
|
namespace Umbraco.Web.Trees
|
|
|
|
|
|
{
|
|
|
|
|
|
[UmbracoTreeAuthorize(Constants.Trees.Packages)]
|
2019-01-22 09:31:47 +01:00
|
|
|
|
[Tree(Constants.Applications.Packages, Constants.Trees.Packages, SortOrder = 0, IsSingleNodeTree = true)]
|
2018-10-02 14:14:25 +02:00
|
|
|
|
[PluginController("UmbracoTrees")]
|
|
|
|
|
|
[CoreTree]
|
|
|
|
|
|
public class PackagesTreeController : TreeController
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Helper method to create a root model for a tree
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
protected override TreeNode CreateRootNode(FormDataCollection queryStrings)
|
|
|
|
|
|
{
|
|
|
|
|
|
var root = base.CreateRootNode(queryStrings);
|
2018-12-06 09:32:04 +00:00
|
|
|
|
|
|
|
|
|
|
//this will load in a custom UI instead of the dashboard for the root node
|
2019-11-05 13:45:42 +01:00
|
|
|
|
root.RoutePath = $"{Constants.Applications.Packages}/{Constants.Trees.Packages}/repo";
|
2018-10-02 14:14:25 +02:00
|
|
|
|
root.Icon = "icon-box";
|
2018-12-06 09:32:04 +00:00
|
|
|
|
|
|
|
|
|
|
root.HasChildren = false;
|
2018-10-02 14:14:25 +02:00
|
|
|
|
return root;
|
|
|
|
|
|
}
|
2018-12-06 09:32:04 +00:00
|
|
|
|
|
2019-01-09 20:57:02 +11:00
|
|
|
|
|
2018-10-02 14:14:25 +02:00
|
|
|
|
protected override TreeNodeCollection GetTreeNodes(string id, FormDataCollection queryStrings)
|
|
|
|
|
|
{
|
2018-12-06 09:32:04 +00:00
|
|
|
|
//full screen app without tree nodes
|
|
|
|
|
|
return TreeNodeCollection.Empty;
|
2018-10-02 14:14:25 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override MenuItemCollection GetMenuForNode(string id, FormDataCollection queryStrings)
|
|
|
|
|
|
{
|
2018-12-06 09:32:04 +00:00
|
|
|
|
//doesn't have a menu, this is a full screen app without tree nodes
|
|
|
|
|
|
return MenuItemCollection.Empty;
|
2018-10-02 14:14:25 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|