diff --git a/src/Umbraco.Core/Constants-Applications.cs b/src/Umbraco.Core/Constants-Applications.cs
index 12f7076fc4..38dc22c473 100644
--- a/src/Umbraco.Core/Constants-Applications.cs
+++ b/src/Umbraco.Core/Constants-Applications.cs
@@ -107,6 +107,11 @@
public const string Languages = "languages";
+ ///
+ /// alias for the user types tree.
+ ///
+ public const string UserTypes = "userTypes";
+
//TODO: Fill in the rest!
}
}
diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/cs.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/cs.xml
index 62aeb85cc0..c1e806177a 100644
--- a/src/Umbraco.Web.UI/Umbraco/config/lang/cs.xml
+++ b/src/Umbraco.Web.UI/Umbraco/config/lang/cs.xml
@@ -963,6 +963,7 @@
Stylopisy
Šablony
XSLT soubory
+ Typy Uživatelů
Nová aktualizace je připrvena
diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/nb.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/nb.xml
index a02fa21219..0d527fe4d8 100644
--- a/src/Umbraco.Web.UI/Umbraco/config/lang/nb.xml
+++ b/src/Umbraco.Web.UI/Umbraco/config/lang/nb.xml
@@ -928,6 +928,7 @@ Vennlig hilsen Umbraco roboten
Maler
XSLT Filer
Analytics
+ Brukertyper typer
Ny oppdatering er klar
diff --git a/src/Umbraco.Web.UI/config/trees.config b/src/Umbraco.Web.UI/config/trees.config
index 42bc28239b..e66d083efd 100644
--- a/src/Umbraco.Web.UI/config/trees.config
+++ b/src/Umbraco.Web.UI/config/trees.config
@@ -26,7 +26,7 @@
-
+
diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/da.xml b/src/Umbraco.Web.UI/umbraco/config/lang/da.xml
index 446796dd88..aad5e0d69b 100644
--- a/src/Umbraco.Web.UI/umbraco/config/lang/da.xml
+++ b/src/Umbraco.Web.UI/umbraco/config/lang/da.xml
@@ -986,7 +986,6 @@ Mange hilsner fra Umbraco robotten
Medlemstype
Dokumenttyper
Dokumenttyper
-
Pakker
Pakker
Python
@@ -999,6 +998,7 @@ Mange hilsner fra Umbraco robotten
Skabeloner
XSLT-filer
Analytics
+ Bruger Typer
Ny opdatering er klar
diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/de.xml b/src/Umbraco.Web.UI/umbraco/config/lang/de.xml
index 1dab89a922..158bb06287 100644
--- a/src/Umbraco.Web.UI/umbraco/config/lang/de.xml
+++ b/src/Umbraco.Web.UI/umbraco/config/lang/de.xml
@@ -946,6 +946,7 @@ Ihr freundlicher Umbraco-Robot
Vorlagen
XSLT-Dateien
Auswertungen
+ Benutzertypen
Neues Update verfügbar
diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/en.xml b/src/Umbraco.Web.UI/umbraco/config/lang/en.xml
index 0842755da3..f6d092ba31 100644
--- a/src/Umbraco.Web.UI/umbraco/config/lang/en.xml
+++ b/src/Umbraco.Web.UI/umbraco/config/lang/en.xml
@@ -1188,6 +1188,7 @@ To manage your website, simply open the Umbraco back office and start adding con
Templates
XSLT Files
Analytics
+ User Types
New update ready
diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml b/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml
index ce25e990c8..f89eb06b94 100644
--- a/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml
+++ b/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml
@@ -1192,6 +1192,7 @@ To manage your website, simply open the Umbraco back office and start adding con
Templates
XSLT Files
Analytics
+ User Types
New update ready
diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/es.xml b/src/Umbraco.Web.UI/umbraco/config/lang/es.xml
index c1478abbb1..ef67c6e6d4 100644
--- a/src/Umbraco.Web.UI/umbraco/config/lang/es.xml
+++ b/src/Umbraco.Web.UI/umbraco/config/lang/es.xml
@@ -850,6 +850,7 @@
Hojas de estilo
Plantillas
Archivos XSLT
+ Tipos de Usuarios
Existe una nueva actualización
diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/fr.xml b/src/Umbraco.Web.UI/umbraco/config/lang/fr.xml
index a7b219618e..b8b7051fc5 100644
--- a/src/Umbraco.Web.UI/umbraco/config/lang/fr.xml
+++ b/src/Umbraco.Web.UI/umbraco/config/lang/fr.xml
@@ -984,6 +984,7 @@ Pour gérer votre site, ouvrez simplement le backoffice Umbraco et commencez à
Feuilles de style
Modèles
Fichiers XSLT
+ Types d'utilisateurs
Nouvelle mise à jour prête
diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/he.xml b/src/Umbraco.Web.UI/umbraco/config/lang/he.xml
index 4b006e8524..8722008a2e 100644
--- a/src/Umbraco.Web.UI/umbraco/config/lang/he.xml
+++ b/src/Umbraco.Web.UI/umbraco/config/lang/he.xml
@@ -869,6 +869,7 @@ To manage your website, simply open the Umbraco back office and start adding con
גיליונות סגנון
תבניות
קבצי XSLT
+ משתמש מקליד
עידכון חדש זמין
diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/it.xml b/src/Umbraco.Web.UI/umbraco/config/lang/it.xml
index d07d0cb049..f4475cb23c 100644
--- a/src/Umbraco.Web.UI/umbraco/config/lang/it.xml
+++ b/src/Umbraco.Web.UI/umbraco/config/lang/it.xml
@@ -842,6 +842,7 @@ Per gestire il tuo sito web, è sufficiente aprire il back office di Umbraco e i
Fogli di stile
Templates
Files XSLT
+ Tipi di Utente
diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/ja.xml b/src/Umbraco.Web.UI/umbraco/config/lang/ja.xml
index a59a020455..b92f17a57e 100644
--- a/src/Umbraco.Web.UI/umbraco/config/lang/ja.xml
+++ b/src/Umbraco.Web.UI/umbraco/config/lang/ja.xml
@@ -1172,6 +1172,7 @@ Runwayをインストールして作られた新しいウェブサイトがど
テンプレート
XSLT ファイル
アナリティクス
+ ユーザータイプ
新しい更新があります
diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/ko.xml b/src/Umbraco.Web.UI/umbraco/config/lang/ko.xml
index ee8db9901c..9743954202 100644
--- a/src/Umbraco.Web.UI/umbraco/config/lang/ko.xml
+++ b/src/Umbraco.Web.UI/umbraco/config/lang/ko.xml
@@ -846,6 +846,7 @@
스타일시트
템플릿
XSLT 파일
+ 사용자 유형
새 업데이트가 준비되었습니다.
diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/nl.xml b/src/Umbraco.Web.UI/umbraco/config/lang/nl.xml
index 9c8f587ca2..9cf8e76337 100644
--- a/src/Umbraco.Web.UI/umbraco/config/lang/nl.xml
+++ b/src/Umbraco.Web.UI/umbraco/config/lang/nl.xml
@@ -951,6 +951,7 @@ Om een vertalingstaak te sluiten, ga aub naar het detailoverzicht en klik op de
Stylesheets
Sjablonen
XSLT Bestanden
+ Gebruiker Types
Nieuwe update beschikbaar
diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/pl.xml b/src/Umbraco.Web.UI/umbraco/config/lang/pl.xml
index 3c24885eb3..132f5ee65e 100644
--- a/src/Umbraco.Web.UI/umbraco/config/lang/pl.xml
+++ b/src/Umbraco.Web.UI/umbraco/config/lang/pl.xml
@@ -742,6 +742,7 @@ Miłego dnia!]]>
Arkusze stylów
Szablony
Pliki XSLT
+ Typy Użytkowników
Aktualizacja jest gotowa
diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/pt.xml b/src/Umbraco.Web.UI/umbraco/config/lang/pt.xml
index 4c039524ab..9cf9181c80 100644
--- a/src/Umbraco.Web.UI/umbraco/config/lang/pt.xml
+++ b/src/Umbraco.Web.UI/umbraco/config/lang/pt.xml
@@ -830,6 +830,7 @@ Para fechar a tarefa de tradução vá até os detalhes e clique no botão "Fech
Stylesheets
Modelos
Arquivos XSLT
+ Tipos de Usuários
Nova atualização pronta
diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/ru.xml b/src/Umbraco.Web.UI/umbraco/config/lang/ru.xml
index fec3e5f897..5075fd8eb9 100644
--- a/src/Umbraco.Web.UI/umbraco/config/lang/ru.xml
+++ b/src/Umbraco.Web.UI/umbraco/config/lang/ru.xml
@@ -1161,6 +1161,7 @@
Стили CSS
Шаблоны
Файлы XSLT
+ Типы пользователей
Доступны обновления
diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/sv.xml b/src/Umbraco.Web.UI/umbraco/config/lang/sv.xml
index b620ecc168..3c7947ccee 100644
--- a/src/Umbraco.Web.UI/umbraco/config/lang/sv.xml
+++ b/src/Umbraco.Web.UI/umbraco/config/lang/sv.xml
@@ -851,6 +851,7 @@
Stilmallar
Sidmallar
XSLT-filer
+ Användartyper
Ny uppdatering tillgänglig
diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/zh.xml b/src/Umbraco.Web.UI/umbraco/config/lang/zh.xml
index 6237bb4f07..9ced516644 100644
--- a/src/Umbraco.Web.UI/umbraco/config/lang/zh.xml
+++ b/src/Umbraco.Web.UI/umbraco/config/lang/zh.xml
@@ -920,6 +920,7 @@
样式表
模板
XSLT文件
+ 用户类型
有可用更新
diff --git a/src/Umbraco.Web/Trees/UserTypesTreeController.cs b/src/Umbraco.Web/Trees/UserTypesTreeController.cs
new file mode 100644
index 0000000000..ab0bcef8b4
--- /dev/null
+++ b/src/Umbraco.Web/Trees/UserTypesTreeController.cs
@@ -0,0 +1,66 @@
+using System;
+using System.Globalization;
+using System.Linq;
+using System.Net.Http.Formatting;
+using Umbraco.Core;
+using Umbraco.Core.Services;
+using Umbraco.Web.Models.Trees;
+using Umbraco.Web.Mvc;
+using Umbraco.Web.WebApi.Filters;
+using Umbraco.Web._Legacy.Actions;
+using Constants = Umbraco.Core.Constants;
+
+namespace Umbraco.Web.Trees
+{
+ [UmbracoTreeAuthorize(Constants.Trees.UserTypes)]
+ [Tree(Constants.Applications.Users, Constants.Trees.UserTypes, null, sortOrder: 1)]
+ [PluginController("UmbracoTrees")]
+ [CoreTree]
+ public class UserTypesTreeController : TreeController
+ {
+ protected override TreeNodeCollection GetTreeNodes(string id, FormDataCollection queryStrings)
+ {
+ var nodes = new TreeNodeCollection();
+
+ var userTypes = Services.UserService.GetAllUserTypes();
+ userTypes = userTypes.OrderBy(ut => ut.Name);
+
+ foreach (var userType in userTypes)
+ {
+ nodes.Add(
+ CreateTreeNode(
+ userType.Id.ToString(CultureInfo.InvariantCulture),
+ "-1",
+ queryStrings,
+ userType.Name,
+ "icon-users",
+ false,
+ "/" + queryStrings.GetValue("application") + "/framed/"
+ + Uri.EscapeDataString("users/EditUserType.aspx?id=" + userType.Id)));
+ }
+
+ return nodes;
+ }
+
+ protected override MenuItemCollection GetMenuForNode(string id, FormDataCollection queryStrings)
+ {
+ var menu = new MenuItemCollection();
+
+ if (id == Constants.System.Root.ToInvariantString())
+ {
+ // root actions
+ menu.Items.Add(Services.TextService.Localize("actions", ActionNew.Instance.Alias))
+ .ConvertLegacyMenuItem(null, "userTypes", queryStrings.GetValue("application"));
+
+ menu.Items.Add(Services.TextService.Localize("actions", ActionRefresh.Instance.Alias), true);
+ return menu;
+ }
+
+ // delete user type
+ menu.Items.Add(Services.TextService.Localize("actions", ActionDelete.Instance.Alias))
+ .ConvertLegacyMenuItem(null, "userTypes", queryStrings.GetValue("application"));
+
+ return menu;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj
index d869580f85..73d7326473 100644
--- a/src/Umbraco.Web/Umbraco.Web.csproj
+++ b/src/Umbraco.Web/Umbraco.Web.csproj
@@ -329,6 +329,7 @@
+
@@ -1593,7 +1594,6 @@
-
XmlTree.xsd
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/UserTypes.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/UserTypes.cs
deleted file mode 100644
index 05155148a6..0000000000
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/UserTypes.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-using Umbraco.Core.Services;
-using System;
-using umbraco.BusinessLogic;
-using System.Collections.Generic;
-using Umbraco.Core;
-using Umbraco.Web.Trees;
-
-namespace umbraco.cms.presentation.Trees
-{
- [Tree(Constants.Applications.Users, "userTypes", "User Types", sortOrder: 1)]
- public class UserTypes : BaseTree
- {
-
- public UserTypes(string application) : base(application) { }
-
- public override void RenderJS(ref System.Text.StringBuilder Javascript)
- {
- Javascript.Append(
- @"
-function openUserTypes(id) {
- UmbClientMgr.contentFrame('users/EditUserType.aspx?id=' + id);
-}
-");
- }
-
- public override void Render(ref XmlTree tree)
- {
- var userTypes = Services.UserService.GetAllUserTypes();
- foreach (var userType in userTypes)
- {
- if (userType.Id > 1) //don't show the admin user type, they should always have full permissions
- {
- XmlTreeNode node = XmlTreeNode.Create(this);
- node.NodeID = userType.Id.ToString();
- node.Action = string.Format("javascript:openUserTypes({0})", userType.Id);
- node.Icon = "icon-users";
- node.Text = userType.Name;
-
- OnBeforeNodeRender(ref tree, ref node, EventArgs.Empty);
- if (node != null)
- {
- tree.Add(node);
- OnAfterNodeRender(ref tree, ref node, EventArgs.Empty);
- }
- }
- }
- }
-
- protected override void CreateRootNode(ref XmlTreeNode rootNode)
- {
- rootNode.Text = Services.TextService.Localize("user/userTypes");
- }
- }
-}
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/users/EditUserType.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/users/EditUserType.aspx.cs
index 24153c0270..740c6d2b3c 100644
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/users/EditUserType.aspx.cs
+++ b/src/Umbraco.Web/umbraco.presentation/umbraco/users/EditUserType.aspx.cs
@@ -41,15 +41,14 @@ namespace umbraco.cms.presentation.user
if (!int.TryParse(Request.QueryString["id"], out m_userTypeID))
return;
- if (!IsPostBack)
- {
- BindActions();
-
- ClientTools
- .SetActiveTreeType(TreeDefinitionCollection.Instance.FindTree().Tree.Alias)
- .SyncTree(m_userTypeID.ToString(), false);
- }
+ if (!IsPostBack)
+ {
+ BindActions();
+ ClientTools
+ .SetActiveTreeType(Constants.Trees.UserTypes)
+ .SyncTree(m_userTypeID.ToString(), false);
+ }
}
void save_Click(object sender, EventArgs e)