diff --git a/src/Umbraco.Web.UI.Client/src/common/mocks/umbraco.servervariables.js b/src/Umbraco.Web.UI.Client/src/common/mocks/umbraco.servervariables.js
index 32bb9b084c..058a8366ae 100644
--- a/src/Umbraco.Web.UI.Client/src/common/mocks/umbraco.servervariables.js
+++ b/src/Umbraco.Web.UI.Client/src/common/mocks/umbraco.servervariables.js
@@ -20,6 +20,7 @@ Umbraco.Sys.ServerVariables = {
},
umbracoSettings: {
"umbracoPath": "/umbraco",
+ "appPluginsPath" : "/App_Plugins",
"imageFileTypes": "jpeg,jpg,gif,bmp,png,tiff,tif"
},
isDebuggingEnabled: true
diff --git a/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js b/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js
index b039134ff8..eca8f70576 100644
--- a/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js
+++ b/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js
@@ -364,7 +364,17 @@ angular.module('umbraco.services')
//by convention we will look into the /views/{treetype}/{action}.html
// for example: /views/content/create.html
- templateUrl = "views/" + treeService.getTreeAlias(args.node) + "/" + args.action.alias + ".html";
+ //we will also check for a 'packageName' in metaData, if it exists, we'll look by convention in that folder
+ // for example: /App_Plugins/{mypackage}/umbraco/{treetype}/create.html
+
+ if (args.action.metaData["packageName"]) {
+
+ templateUrl = Umbraco.Sys.ServerVariables.umbracoSettings.appPluginsPath +
+ "/umbraco/views/" + treeService.getTreeAlias(args.node) + "/" + args.action.alias + ".html";
+ }
+ else {
+ templateUrl = "views/" + treeService.getTreeAlias(args.node) + "/" + args.action.alias + ".html";
+ }
iframe = false;
}
diff --git a/src/Umbraco.Web.UI/App_Plugins/MyPackage/Trees/LegacyTestTree.cs b/src/Umbraco.Web.UI/App_Plugins/MyPackage/Trees/LegacyTestTree.cs
index 8655af9b11..78a9085b7f 100644
--- a/src/Umbraco.Web.UI/App_Plugins/MyPackage/Trees/LegacyTestTree.cs
+++ b/src/Umbraco.Web.UI/App_Plugins/MyPackage/Trees/LegacyTestTree.cs
@@ -10,31 +10,32 @@ using Constants = Umbraco.Core.Constants;
namespace Umbraco.Web.UI.App_Plugins.MyPackage.Trees
{
- //[Tree(Constants.Applications.Settings, "myTree", "My Tree")]
- //[PluginController("MyPackage")]
- //public class MyCustomTree : TreeController
- //{
- // protected override TreeNodeCollection GetTreeNodes(string id, FormDataCollection queryStrings)
- // {
- // if (id == Constants.System.Root.ToInvariantString())
- // {
- // var tree = new TreeNodeCollection
- // {
- // CreateTreeNode("1", queryStrings, "My Node 1"),
- // CreateTreeNode("2", queryStrings, "My Node 2"),
- // CreateTreeNode("3", queryStrings, "My Node 3")
- // };
- // return tree;
- // }
- // throw new NotSupportedException();
- // }
+ [Tree(Constants.Applications.Settings, "myTree", "My Tree")]
+ [PluginController("MyPackage")]
+ public class MyCustomTreeController : TreeController
+ {
+ protected override TreeNodeCollection GetTreeNodes(string id, FormDataCollection queryStrings)
+ {
+ if (id == Constants.System.Root.ToInvariantString())
+ {
+ var tree = new TreeNodeCollection
+ {
+ CreateTreeNode("1", queryStrings, "My Node 1"),
+ CreateTreeNode("2", queryStrings, "My Node 2"),
+ CreateTreeNode("3", queryStrings, "My Node 3")
+ };
+ return tree;
+ }
+ throw new NotSupportedException();
+ }
- // protected override MenuItemCollection GetMenuForNode(string id, FormDataCollection queryStrings)
- // {
- // var menu = new MenuItemCollection();
- // menu.AddMenuItem(new MenuItem("create", "Create"));
- // }
- //}
+ protected override MenuItemCollection GetMenuForNode(string id, FormDataCollection queryStrings)
+ {
+ var menu = new MenuItemCollection("MyPackage");
+ menu.AddMenuItem(new MenuItem("create", "Create"));
+ return menu;
+ }
+ }
public class LegacyTestTree : BaseTree
{
diff --git a/src/Umbraco.Web.UI/config/trees.config b/src/Umbraco.Web.UI/config/trees.config
index 46a523ce38..acafac91f1 100644
--- a/src/Umbraco.Web.UI/config/trees.config
+++ b/src/Umbraco.Web.UI/config/trees.config
@@ -39,4 +39,5 @@
+
\ No newline at end of file
diff --git a/src/Umbraco.Web/Editors/BackOfficeController.cs b/src/Umbraco.Web/Editors/BackOfficeController.cs
index a8a5dc2a63..641d809ca7 100644
--- a/src/Umbraco.Web/Editors/BackOfficeController.cs
+++ b/src/Umbraco.Web/Editors/BackOfficeController.cs
@@ -3,6 +3,7 @@ using System.IO;
using System.Text;
using System.Web.Mvc;
using Umbraco.Core.Configuration;
+using Umbraco.Core.IO;
using Umbraco.Core.Manifest;
using Umbraco.Core;
using Umbraco.Web.Mvc;
@@ -79,6 +80,7 @@ namespace Umbraco.Web.Editors
"umbracoSettings", new Dictionary
{
{"umbracoPath", GlobalSettings.Path},
+ {"appPluginsPath", IOHelper.ResolveUrl(SystemDirectories.AppPlugins).TrimEnd('/')},
{"imageFileTypes",
string.Join(",",UmbracoConfig.For.UmbracoSettings().Content.ImageFileTypes)},
}
diff --git a/src/Umbraco.Web/Mvc/PluginViewEngine.cs b/src/Umbraco.Web/Mvc/PluginViewEngine.cs
index fe39978b6e..96f393920e 100644
--- a/src/Umbraco.Web/Mvc/PluginViewEngine.cs
+++ b/src/Umbraco.Web/Mvc/PluginViewEngine.cs
@@ -7,7 +7,7 @@ using Umbraco.Core.IO;
namespace Umbraco.Web.Mvc
{
///
- /// A view engine to look into the App_Plugins/Packages folder for views for packaged controllers
+ /// A view engine to look into the App_Plugins folder for views for packaged controllers
///
public class PluginViewEngine : FixedRazorViewEngine
{
diff --git a/src/Umbraco.Web/Trees/Menu/MenuItemCollection.cs b/src/Umbraco.Web/Trees/Menu/MenuItemCollection.cs
index 626a7f9f20..4c99a255c7 100644
--- a/src/Umbraco.Web/Trees/Menu/MenuItemCollection.cs
+++ b/src/Umbraco.Web/Trees/Menu/MenuItemCollection.cs
@@ -12,6 +12,7 @@ namespace Umbraco.Web.Trees.Menu
[DataContract(Name = "menuItems", Namespace = "")]
public class MenuItemCollection
{
+ private readonly string _packageFolderName;
private readonly List