();
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/create.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/create.aspx.cs
index 58d5d391a2..ca384bd3af 100644
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/create.aspx.cs
+++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/create.aspx.cs
@@ -15,6 +15,7 @@ using umbraco.presentation;
using umbraco.BusinessLogic.Actions;
using umbraco.BasePages;
using umbraco.cms.businesslogic.web;
+using Umbraco.Core;
namespace umbraco.dialogs
{
@@ -40,7 +41,7 @@ namespace umbraco.dialogs
{
int nodeId = int.Parse(helper.Request("nodeId"));
//ensure they have access to create under this node!!
- if (helper.Request("app") == "media" || CheckCreatePermissions(nodeId))
+ if (helper.Request("app") == Constants.Applications.Media || CheckCreatePermissions(nodeId))
{
//pane_chooseName.Text = ui.Text("create", "updateData", this.getUser());
cms.businesslogic.CMSNode c = new cms.businesslogic.CMSNode(nodeId);
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/moveOrCopy.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/moveOrCopy.aspx.cs
index d8d313419b..3d0348e26f 100644
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/moveOrCopy.aspx.cs
+++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/moveOrCopy.aspx.cs
@@ -13,6 +13,7 @@ using umbraco.cms.businesslogic;
using umbraco.cms.presentation.user;
using umbraco.interfaces;
using Umbraco.Web;
+using Umbraco.Core;
namespace umbraco.dialogs
{
@@ -34,7 +35,7 @@ namespace umbraco.dialogs
//Document Type copy Hack...
var app = Request.GetItemAsString("app");
- if (app == "settings")
+ if (app == Constants.Applications.Settings)
{
pane_form.Visible = false;
pane_form_notice.Visible = false;
@@ -72,7 +73,7 @@ namespace umbraco.dialogs
var cmsNode = new CMSNode(int.Parse(Request.GetItemAsString("id")));
var validAction = true;
- if (app == "content" && cmsNode.HasChildren)
+ if (app == Constants.Applications.Content && cmsNode.HasChildren)
validAction = ValidAction(Request.GetItemAsString("mode") == "cut" ? 'M' : 'O');
@@ -177,7 +178,7 @@ namespace umbraco.dialogs
public void HandleMoveOrCopy(object sender, EventArgs e)
{
- if (Request["app"] == "settings")
+ if (Request["app"] == Constants.Applications.Settings)
HandleDocumentTypeCopy();
else
HandleDocumentMoveOrCopy();
@@ -243,7 +244,7 @@ namespace umbraco.dialogs
if (Request["mode"] == "cut")
{
- if (Request["app"] == "content")
+ if (Request["app"] == Constants.Applications.Content)
{
//PPH changed this to document instead of cmsNode to handle republishing.
var documentId = int.Parse(Request.GetItemAsString("id"));
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/search.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/search.aspx.cs
index 5e9df5ed2e..acc3604bd0 100644
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/search.aspx.cs
+++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/search.aspx.cs
@@ -8,6 +8,7 @@ using System.Xml;
using Examine;
using Examine.LuceneEngine.SearchCriteria;
using System.Linq;
+using Umbraco.Core;
namespace umbraco.presentation.dialogs
@@ -52,7 +53,7 @@ namespace umbraco.presentation.dialogs
}
//if it doesn't start with "*", then search only nodeName and nodeId
- var internalSearcher = (app == "member")
+ var internalSearcher = (app == Constants.Applications.Members)
? UmbracoContext.Current.InternalMemberSearchProvider
: UmbracoContext.Current.InternalSearchProvider;
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/sort.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/sort.aspx.cs
index 12b1dfd708..825e85e030 100644
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/sort.aspx.cs
+++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/sort.aspx.cs
@@ -41,7 +41,7 @@ namespace umbraco.cms.presentation
int parentId;
if (int.TryParse(Request.GetItemAsString("ID"), out parentId))
{
- if (app == "media")
+ if (app == Constants.Applications.Media)
{
icon = "../images/umbraco/mediaPhoto.gif";
var mediaService = ApplicationContext.Current.Services.MediaService;
@@ -59,7 +59,7 @@ namespace umbraco.cms.presentation
}
}
- if (app == "content")
+ if (app == Constants.Applications.Content)
{
var contentService = ApplicationContext.Current.Services.ContentService;
@@ -78,7 +78,7 @@ namespace umbraco.cms.presentation
// "hack for stylesheet"
// TODO: I can't see where this is being used at all..?
- if (app == "settings")
+ if (app == Constants.Applications.Settings)
{
icon = "../images/umbraco/settingCss.gif";
var ss = new StyleSheet(parentId);
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/editContent.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/editContent.aspx.cs
index 2020f56f03..1bef8254df 100644
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/editContent.aspx.cs
+++ b/src/Umbraco.Web/umbraco.presentation/umbraco/editContent.aspx.cs
@@ -502,7 +502,7 @@ namespace umbraco.cms.presentation
private bool CheckUserValidation()
{
// Validate permissions
- if (!base.ValidateUserApp("content"))
+ if (!base.ValidateUserApp(Constants.Applications.Content))
{
ShowUserValidationError("The current user doesn't have access to this application
Please contact the system administrator if you think that you should have access.
");
return false;
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/login.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/login.aspx.cs
index d4e5a1531a..e1847f22a4 100644
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/login.aspx.cs
+++ b/src/Umbraco.Web/umbraco.presentation/umbraco/login.aspx.cs
@@ -16,6 +16,7 @@ using umbraco.businesslogic.Exceptions;
using umbraco.IO;
using umbraco.cms.businesslogic.web;
using System.Linq;
+using Umbraco.Core;
namespace umbraco.cms.presentation
{
@@ -168,7 +169,7 @@ namespace umbraco.cms.presentation
{
BusinessLogic.User.MakeNew(loginName, loginName, string.Empty, email, BusinessLogic.UserType.GetUserType(2));
BusinessLogic.User u = new BusinessLogic.User(loginName);
- u.addApplication("content");
+ u.addApplication(Constants.Applications.Content);
}
}
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/plugins/tinymce3/insertLink.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/plugins/tinymce3/insertLink.aspx.cs
index 255c310b98..ba471014e5 100644
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/plugins/tinymce3/insertLink.aspx.cs
+++ b/src/Umbraco.Web/umbraco.presentation/umbraco/plugins/tinymce3/insertLink.aspx.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
+using Umbraco.Core;
namespace umbraco.presentation.plugins.tinymce3
{
@@ -23,7 +24,7 @@ namespace umbraco.presentation.plugins.tinymce3
tp.Controls.Add(pane_content);
- if (CurrentUser.GetApplications().Find(t => t.alias == "media") != null)
+ if (CurrentUser.GetApplications().Find(t => t.alias == Constants.Applications.Media) != null)
{
uicontrols.TabPage tp2 = tv_options.NewTabPage(ui.Text("media"));
tp2.HasMenu = false;
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/uQuery/MediaExtensions.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/uQuery/MediaExtensions.cs
index 3213099c25..a37830852e 100644
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/uQuery/MediaExtensions.cs
+++ b/src/Umbraco.Web/umbraco.presentation/umbraco/uQuery/MediaExtensions.cs
@@ -191,7 +191,7 @@ namespace umbraco
///
public static string GetImageUrl(this Media media)
{
- if (media.ContentType.Alias.Equals("Image"))
+ if (media.ContentType.Alias.Equals(Constants.Conventions.MediaTypes.Image))
{
var url = media.GetProperty(Constants.Conventions.Media.File);
if (!string.IsNullOrEmpty(url))
@@ -210,7 +210,7 @@ namespace umbraco
///
public static string GetImageThumbnailUrl(this Media media)
{
- if (media.ContentType.Alias.Equals("Image"))
+ if (media.ContentType.Alias.Equals(Constants.Conventions.MediaTypes.Image))
{
var url = media.GetProperty(Constants.Conventions.Media.File);
if (!string.IsNullOrEmpty(url))
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/uQuery/uQuery-UmbracoObjectType.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/uQuery/uQuery-UmbracoObjectType.cs
index f9a4a4a969..f6774223ab 100644
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/uQuery/uQuery-UmbracoObjectType.cs
+++ b/src/Umbraco.Web/umbraco.presentation/umbraco/uQuery/uQuery-UmbracoObjectType.cs
@@ -88,7 +88,7 @@ namespace umbraco
///
/// Recycle Bin
///
- [Guid(Constants.ObjectTypes.RecycleBin)]
+ [Guid(Constants.ObjectTypes.ContentRecycleBin)]
[FriendlyName("Recycle Bin")]
RecycleBin,
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/umbraco.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/umbraco.aspx.cs
index 8fd2a6428f..7604ae23f9 100644
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/umbraco.aspx.cs
+++ b/src/Umbraco.Web/umbraco.presentation/umbraco/umbraco.aspx.cs
@@ -36,7 +36,7 @@ namespace umbraco.cms.presentation
protected void Page_Load(object sender, System.EventArgs e)
{
var apps = this.getUser().Applications.ToList();
- bool userHasAccesstodefaultApp = apps.Where(x => x.alias == "content").Count() > 0;
+ bool userHasAccesstodefaultApp = apps.Where(x => x.alias == Umbraco.Core.Constants.Applications.Content).Count() > 0;
// Load user module icons ..
if (apps.Count() > 1)
@@ -82,7 +82,7 @@ namespace umbraco.cms.presentation
}
else
{
- DefaultApp = "content";
+ DefaultApp = Umbraco.Core.Constants.Applications.Content;
}
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/users/EditUser.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/users/EditUser.aspx.cs
index 1d79e5b1d4..55303bc219 100644
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/users/EditUser.aspx.cs
+++ b/src/Umbraco.Web/umbraco.presentation/umbraco/users/EditUser.aspx.cs
@@ -117,7 +117,7 @@ namespace umbraco.cms.presentation.user
DefaultToLiveEditing.Checked = u.DefaultToLiveEditing;
PlaceHolder medias = new PlaceHolder();
- mediaPicker.AppAlias = "media";
+ mediaPicker.AppAlias = Constants.Applications.Media;
mediaPicker.TreeAlias = "media";
if (u.StartMediaId > 0)
@@ -128,7 +128,7 @@ namespace umbraco.cms.presentation.user
medias.Controls.Add(mediaPicker);
PlaceHolder content = new PlaceHolder();
- contentPicker.AppAlias = "content";
+ contentPicker.AppAlias = Constants.Applications.Content;
contentPicker.TreeAlias = "content";
if (u.StartNodeId > 0)
@@ -246,7 +246,7 @@ namespace umbraco.cms.presentation.user
// Handle content and media pickers
PlaceHolder medias = new PlaceHolder();
- cMediaPicker.AppAlias = "media";
+ cMediaPicker.AppAlias = Constants.Applications.Media;
cMediaPicker.TreeAlias = "media";
if (userChannel.MediaFolder > 0)
@@ -257,7 +257,7 @@ namespace umbraco.cms.presentation.user
medias.Controls.Add(cMediaPicker);
PlaceHolder content = new PlaceHolder();
- cContentPicker.AppAlias = "content";
+ cContentPicker.AppAlias = Constants.Applications.Content;
cContentPicker.TreeAlias = "content";
if (userChannel.StartNode > 0)
@@ -494,7 +494,7 @@ namespace umbraco.cms.presentation.user
c.DocumentTypeAlias = cDocumentType.SelectedValue;
//
- c.MediaTypeAlias = "image";
+ c.MediaTypeAlias = Constants.Conventions.MediaTypes.Image; // [LK:2013-03-22] This was previously lowercase; unsure if using const will cause an issue.
c.MediaTypeFileProperty = Constants.Conventions.Media.File;
c.ImageSupport = true;
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/MediaUploader.ashx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/MediaUploader.ashx.cs
index afb12c3c10..bc681ddf2b 100644
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/MediaUploader.ashx.cs
+++ b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/MediaUploader.ashx.cs
@@ -14,6 +14,7 @@ using umbraco.BasePages;
using umbraco.BusinessLogic;
using umbraco.businesslogic.Exceptions;
using umbraco.cms.businesslogic.media;
+using Umbraco.Core;
namespace umbraco.presentation.umbraco.webservices
{
@@ -222,7 +223,7 @@ namespace umbraco.presentation.umbraco.webservices
if (mp != null && mp.ValidateUser(username, password))
{
var user = new User(username);
- isValid = user.Applications.Any(app => app.alias == "media");
+ isValid = user.Applications.Any(app => app.alias == Constants.Applications.Media);
if (isValid)
AuthenticatedUser = user;
@@ -234,7 +235,7 @@ namespace umbraco.presentation.umbraco.webservices
var user = new User(username);
if (t != null)
- isValid = user.LoginName.ToLower() == t.Name.ToLower() && user.Applications.Any(app => app.alias == "media");
+ isValid = user.LoginName.ToLower() == t.Name.ToLower() && user.Applications.Any(app => app.alias == Constants.Applications.Media);
if (isValid)
AuthenticatedUser = user;
@@ -250,7 +251,7 @@ namespace umbraco.presentation.umbraco.webservices
private void CreateMediaTree(IEnumerable nodes, FolderListItem folder)
{
- foreach (var media in nodes.Where(media => media != null && media.ContentType != null && media.ContentType.Alias == "Folder"))
+ foreach (var media in nodes.Where(media => media != null && media.ContentType != null && media.ContentType.Alias == Constants.Conventions.MediaTypes.Folder))
{
var subFolder = new FolderListItem
{
@@ -303,7 +304,7 @@ namespace umbraco.presentation.umbraco.webservices
}
}
- var media = Media.MakeNew(name, MediaType.GetByAlias("Folder"), User.GetUser(0), parent.Id);
+ var media = Media.MakeNew(name, MediaType.GetByAlias(Constants.Conventions.MediaTypes.Folder), User.GetUser(0), parent.Id);
media.sortOrder = 0;
media.Save();
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/nodeSorter.asmx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/nodeSorter.asmx.cs
index e767cf5fd9..146553b637 100644
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/nodeSorter.asmx.cs
+++ b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/nodeSorter.asmx.cs
@@ -11,6 +11,7 @@ using Umbraco.Web.Security;
using umbraco.BasePages;
using umbraco.BusinessLogic.Actions;
using umbraco.cms.businesslogic.web;
+using Umbraco.Core;
namespace umbraco.presentation.webservices
{
@@ -36,7 +37,7 @@ namespace umbraco.presentation.webservices
// Root nodes?
if (ParentId == -1)
{
- if (App == "media")
+ if (App == Constants.Applications.Media)
{
foreach (cms.businesslogic.media.Media child in cms.businesslogic.media.Media.GetRootMedias())
nodes.Add(new SortNode(child.Id, child.sortOrder, child.Text, child.CreateDateTime));
@@ -48,7 +49,7 @@ namespace umbraco.presentation.webservices
else
{
// "hack for stylesheet"
- if (App == "settings")
+ if (App == Constants.Applications.Settings)
{
var styleSheet = new StyleSheet(cmsNode.Id);
foreach (var child in styleSheet.Properties)
@@ -83,8 +84,8 @@ namespace umbraco.presentation.webservices
{
var tmp = SortOrder.Split(',');
- var isContent = Context.Request.GetItemAsString("app") == "content" | helper.Request("app") == "";
- var isMedia = Context.Request.GetItemAsString("app") == "media";
+ var isContent = Context.Request.GetItemAsString("app") == Constants.Applications.Content | helper.Request("app") == "";
+ var isMedia = Context.Request.GetItemAsString("app") == Constants.Applications.Media;
for (var i = 0; i < tmp.Length; i++)
{
@@ -136,7 +137,7 @@ namespace umbraco.presentation.webservices
}
// fire actionhandler, check for content
- if ((helper.Request("app") == "content" | helper.Request("app") == "") && ParentId > 0)
+ if ((helper.Request("app") == Constants.Applications.Content | helper.Request("app") == "") && ParentId > 0)
global::umbraco.BusinessLogic.Actions.Action.RunActionHandlers(new Document(ParentId), ActionSort.Instance);
}
}
diff --git a/src/umbraco.businesslogic/ApplicationDefinitions.cs b/src/umbraco.businesslogic/ApplicationDefinitions.cs
index d26488773c..c2e8e9178b 100644
--- a/src/umbraco.businesslogic/ApplicationDefinitions.cs
+++ b/src/umbraco.businesslogic/ApplicationDefinitions.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using umbraco.interfaces;
+using Umbraco.Core;
namespace umbraco.businesslogic
{
@@ -10,31 +11,31 @@ namespace umbraco.businesslogic
// the application.config. On app startup, Umbraco will look for any
// unregistered classes with an ApplicationAttribute and add them to the cache
- [Application("content", "Content", ".traycontent")]
+ [Application(Constants.Applications.Content, "Content", ".traycontent")]
public class ContentApplicationDefinition : IApplication
{ }
- [Application("media", "Media", ".traymedia", sortOrder: 1)]
+ [Application(Constants.Applications.Media, "Media", ".traymedia", sortOrder: 1)]
public class MediaApplicationDefinition : IApplication
{ }
- [Application("settings", "Settings", ".traysettings", sortOrder: 2)]
+ [Application(Constants.Applications.Settings, "Settings", ".traysettings", sortOrder: 2)]
public class SettingsApplicationDefinition : IApplication
{ }
- [Application("developer", "Developer", ".traydeveloper", sortOrder: 3)]
+ [Application(Constants.Applications.Developer, "Developer", ".traydeveloper", sortOrder: 3)]
public class DeveloperApplicationDefinition : IApplication
{ }
- [Application("users", "Users", ".trayusers", sortOrder: 4)]
+ [Application(Constants.Applications.Users, "Users", ".trayusers", sortOrder: 4)]
public class UsersApplicationDefinition : IApplication
{ }
- [Application("member", "Members", ".traymember", sortOrder: 5)]
+ [Application(Constants.Applications.Members, "Members", ".traymember", sortOrder: 5)]
public class MembersApplicationDefinition : IApplication
{ }
- [Application("translation", "Translation", ".traytranslation", sortOrder: 6)]
+ [Application(Constants.Applications.Translation, "Translation", ".traytranslation", sortOrder: 6)]
public class TranslationApplicationDefinition : IApplication
{ }
}
diff --git a/src/umbraco.cms/businesslogic/RecycleBin.cs b/src/umbraco.cms/businesslogic/RecycleBin.cs
index 84e4319aa3..3f4ad28b94 100644
--- a/src/umbraco.cms/businesslogic/RecycleBin.cs
+++ b/src/umbraco.cms/businesslogic/RecycleBin.cs
@@ -18,8 +18,8 @@ namespace umbraco.cms.businesslogic
///
public enum RecycleBinType
{
- Content = -20,
- Media = -21
+ Content = Constants.System.RecycleBinContent,
+ Media = Constants.System.RecycleBinMedia
}
private const string m_ChildCountSQL = @"select count(id) from umbracoNode where nodeObjectType = @nodeObjectType and path like '%,{0},%'";
diff --git a/src/umbraco.cms/businesslogic/media/UmbracoFileMediaFactory.cs b/src/umbraco.cms/businesslogic/media/UmbracoFileMediaFactory.cs
index ef7942a5aa..26a3fdfe83 100644
--- a/src/umbraco.cms/businesslogic/media/UmbracoFileMediaFactory.cs
+++ b/src/umbraco.cms/businesslogic/media/UmbracoFileMediaFactory.cs
@@ -14,7 +14,7 @@ namespace umbraco.cms.businesslogic.media
{
public override string MediaTypeAlias
{
- get { return "File"; }
+ get { return Constants.Conventions.MediaTypes.File; }
}
public override List Extensions
diff --git a/src/umbraco.cms/businesslogic/media/UmbracoImageMediaFactory.cs b/src/umbraco.cms/businesslogic/media/UmbracoImageMediaFactory.cs
index e1dbfb6f11..c415516102 100644
--- a/src/umbraco.cms/businesslogic/media/UmbracoImageMediaFactory.cs
+++ b/src/umbraco.cms/businesslogic/media/UmbracoImageMediaFactory.cs
@@ -9,7 +9,7 @@ namespace umbraco.cms.businesslogic.media
{
public override string MediaTypeAlias
{
- get { return "Image"; }
+ get { return Constants.Conventions.MediaTypes.Image; }
}
public override List Extensions
diff --git a/src/umbraco.cms/businesslogic/media/UmbracoMediaFactory.cs b/src/umbraco.cms/businesslogic/media/UmbracoMediaFactory.cs
index 0fa1caa041..6f6d395b31 100644
--- a/src/umbraco.cms/businesslogic/media/UmbracoMediaFactory.cs
+++ b/src/umbraco.cms/businesslogic/media/UmbracoMediaFactory.cs
@@ -30,7 +30,7 @@ namespace umbraco.cms.businesslogic.media
{
var parentNode = new Media(parentNodeId);
- return parentNodeId <= -1 || user.Applications.Any(app => app.alias.ToLower() == "media") && (user.StartMediaId <= 0 || ("," + parentNode.Path + ",").Contains("," + user.StartMediaId + ",")) && parentNode.ContentType.AllowedChildContentTypeIDs.Contains(MediaType.GetByAlias(MediaTypeAlias).Id);
+ return parentNodeId <= -1 || user.Applications.Any(app => app.alias.ToLower() == Constants.Applications.Media) && (user.StartMediaId <= 0 || ("," + parentNode.Path + ",").Contains("," + user.StartMediaId + ",")) && parentNode.ContentType.AllowedChildContentTypeIDs.Contains(MediaType.GetByAlias(MediaTypeAlias).Id);
}
catch
{
diff --git a/src/umbraco.cms/helpers/DeepLink.cs b/src/umbraco.cms/helpers/DeepLink.cs
index 1ab9c50820..595647c612 100644
--- a/src/umbraco.cms/helpers/DeepLink.cs
+++ b/src/umbraco.cms/helpers/DeepLink.cs
@@ -4,6 +4,7 @@ using System.Linq;
using System.Text;
using umbraco.BusinessLogic;
using System.Web;
+using Umbraco.Core;
namespace umbraco.cms.helpers
{
@@ -50,57 +51,57 @@ namespace umbraco.cms.helpers
switch (type)
{
case DeepLinkType.Content:
- section = "content";
+ section = Constants.Applications.Content;
editorUrl = "editContent.aspx";
idKey = "id";
break;
case DeepLinkType.Css:
- section = "settings";
+ section = Constants.Applications.Settings;
editorUrl = "settings/stylesheet/editStylesheet.aspx";
idKey = "id";
break;
case DeepLinkType.DataType:
- section = "developer";
+ section = Constants.Applications.Developer;
editorUrl = "developer/datatypes/editDataType.aspx";
idKey = "id";
break;
case DeepLinkType.DocumentType:
- section = "settings";
+ section = Constants.Applications.Settings;
editorUrl = "settings/editNodeTypeNew.aspx";
idKey = "id";
break;
case DeepLinkType.Javascript:
- section = "settings";
+ section = Constants.Applications.Settings;
editorUrl = "settings/scripts/editScript.aspx";
idKey = "file";
break;
case DeepLinkType.Macro:
- section = "developer";
+ section = Constants.Applications.Developer;
editorUrl = "developer/macros/editMacro.aspx";
idKey = "macroID";
break;
case DeepLinkType.Media:
- section = "media";
+ section = Constants.Applications.Media;
editorUrl = "editMedia.aspx";
idKey = "id";
break;
case DeepLinkType.MediaType:
- section = "settings";
+ section = Constants.Applications.Settings;
editorUrl = "settings/editMediaType.aspx";
idKey = "id";
break;
case DeepLinkType.RazorScript:
- section = "developer";
+ section = Constants.Applications.Developer;
editorUrl = "developer/python/editPython.aspx";
idKey = "file";
break;
case DeepLinkType.Template:
- section = "settings";
+ section = Constants.Applications.Settings;
editorUrl = "settings/editTemplate.aspx";
idKey = "templateId";
break;
case DeepLinkType.XSLT:
- section = "developer";
+ section = Constants.Applications.Developer;
editorUrl = "developer/xslt/editXslt.aspx";
idKey = "file";
break;
diff --git a/src/umbraco.controls/TreePicker/SimpleContentPicker.cs b/src/umbraco.controls/TreePicker/SimpleContentPicker.cs
index 9866048294..de93637134 100644
--- a/src/umbraco.controls/TreePicker/SimpleContentPicker.cs
+++ b/src/umbraco.controls/TreePicker/SimpleContentPicker.cs
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
+using Umbraco.Core;
namespace umbraco.uicontrols.TreePicker
{
@@ -11,7 +12,7 @@ namespace umbraco.uicontrols.TreePicker
{
get
{
- return TreeUrlGenerator.GetPickerUrl("content", "content");
+ return TreeUrlGenerator.GetPickerUrl(Constants.Applications.Content, "content");
}
}
diff --git a/src/umbraco.controls/TreePicker/SimpleMediaPicker.cs b/src/umbraco.controls/TreePicker/SimpleMediaPicker.cs
index d91ca6cbba..c7c7125f1e 100644
--- a/src/umbraco.controls/TreePicker/SimpleMediaPicker.cs
+++ b/src/umbraco.controls/TreePicker/SimpleMediaPicker.cs
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
+using Umbraco.Core;
namespace umbraco.uicontrols.TreePicker
{
@@ -11,7 +12,7 @@ namespace umbraco.uicontrols.TreePicker
{
get
{
- return TreeUrlGenerator.GetPickerUrl("media", "media");
+ return TreeUrlGenerator.GetPickerUrl(Constants.Applications.Media, "media");
}
}
diff --git a/src/umbraco.editorControls/MultiNodeTreePicker/MNTP_DataEditor.cs b/src/umbraco.editorControls/MultiNodeTreePicker/MNTP_DataEditor.cs
index 0f884d951f..72d36c8fa2 100644
--- a/src/umbraco.editorControls/MultiNodeTreePicker/MNTP_DataEditor.cs
+++ b/src/umbraco.editorControls/MultiNodeTreePicker/MNTP_DataEditor.cs
@@ -44,7 +44,7 @@ namespace umbraco.editorControls.MultiNodeTreePicker
//need to add our tree definitions to the collection.
//find the content tree to duplicate
- var contentTree = TreeDefinitionCollection.Instance.Single(x => x.Tree.Alias.ToUpper() == "CONTENT");
+ var contentTree = TreeDefinitionCollection.Instance.Single(x => string.Equals(x.Tree.Alias, Umbraco.Core.Constants.Applications.Content, StringComparison.OrdinalIgnoreCase));
var filteredContentTree = new TreeDefinition(typeof(FilteredContentTree),
new umbraco.BusinessLogic.ApplicationTree(true, false, 0,
contentTree.Tree.ApplicationAlias,
@@ -58,7 +58,7 @@ namespace umbraco.editorControls.MultiNodeTreePicker
contentTree.App);
//find the media tree to duplicate
- var mediaTree = TreeDefinitionCollection.Instance.Single(x => x.Tree.Alias.ToUpper() == "MEDIA");
+ var mediaTree = TreeDefinitionCollection.Instance.Single(x => string.Equals(x.Tree.Alias, Umbraco.Core.Constants.Applications.Media, StringComparison.OrdinalIgnoreCase));
var filteredMediaTree = new TreeDefinition(typeof(FilteredMediaTree),
new umbraco.BusinessLogic.ApplicationTree(true, false, 0,
mediaTree.Tree.ApplicationAlias,
@@ -83,9 +83,9 @@ namespace umbraco.editorControls.MultiNodeTreePicker
///