{{vm.labels.defaultLanguage}}
diff --git a/src/Umbraco.Web.UI.Client/src/views/media/edit.html b/src/Umbraco.Web.UI.Client/src/views/media/edit.html
index 2dfc8c967e..be1219f052 100644
--- a/src/Umbraco.Web.UI.Client/src/views/media/edit.html
+++ b/src/Umbraco.Web.UI.Client/src/views/media/edit.html
@@ -13,7 +13,8 @@
hide-icon="true"
hide-description="true"
hide-alias="true"
- navigation="content.apps">
+ navigation="content.apps"
+ on-select-navigation-item="appChanged(app)">
diff --git a/src/Umbraco.Web.UI.Client/src/views/media/media.edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/media/media.edit.controller.js
index cc63b5f9f0..19932887fd 100644
--- a/src/Umbraco.Web.UI.Client/src/views/media/media.edit.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/media/media.edit.controller.js
@@ -95,8 +95,11 @@ function mediaEditController($scope, $routeParams, $q, appState, mediaResource,
function init() {
- // set first app to active
- $scope.content.apps[0].active = true;
+ if (!$scope.app) {
+ // set first app to active
+ $scope.content.apps[0].active = true;
+ $scope.app = $scope.content.apps[0];
+ }
// setup infinite mode
if(infiniteMode) {
@@ -207,6 +210,10 @@ function mediaEditController($scope, $routeParams, $q, appState, mediaResource,
}
};
+ $scope.appChanged = function (app) {
+ $scope.app = app;
+ }
+
evts.push(eventsService.on("editors.mediaType.saved", function(name, args) {
// if this media item uses the updated media type we need to reload the media item
if(args && args.mediaType && args.mediaType.key === $scope.content.contentType.key) {
diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js
index 33a819fa1c..2181361470 100644
--- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js
@@ -58,7 +58,7 @@ angular.module("umbraco")
//initialize the standard editor functionality for Umbraco
tinyMceService.initializeEditor({
editor: editor,
- value: $scope.model.value,
+ model: $scope.model,
currentForm: angularHelper.getCurrentForm($scope)
});
diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj
index 2fc199d06a..418e5de677 100644
--- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj
+++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj
@@ -95,8 +95,8 @@
-
-
+
+
all
@@ -107,7 +107,7 @@
- 8.0.0-alpha.26
+ 8.0.0-alpha.31
@@ -164,13 +164,6 @@
directoryBrowser.aspx
-
- ChangeDocType.aspx
- ASPXCodeBehind
-
-
- ChangeDocType.aspx
-
default.Master
ASPXCodeBehind
@@ -294,15 +287,6 @@
-
-
-
-
-
-
-
- ASPXCodeBehind
-
@@ -316,7 +300,6 @@
-
diff --git a/src/Umbraco.Web.UI/Umbraco/Views/Default.cshtml b/src/Umbraco.Web.UI/Umbraco/Views/Default.cshtml
index 8c684562cf..6b7906dac5 100644
--- a/src/Umbraco.Web.UI/Umbraco/Views/Default.cshtml
+++ b/src/Umbraco.Web.UI/Umbraco/Views/Default.cshtml
@@ -118,7 +118,7 @@
on-login="hideLoginScreen()">
- @Html.BareMinimumServerVariablesScript(Url, Url.Action("ExternalLogin", "BackOffice", new { area = ViewBag.UmbracoPath }), Model.Features, Current.Config.Global())
+ @Html.BareMinimumServerVariablesScript(Url, Url.Action("ExternalLogin", "BackOffice", new { area = ViewBag.UmbracoPath }), Model.Features, Current.Configs.Global())
-
-
-
-
-
-
<%= Services.TextService.Localize("defaultdialogs/siterepublishHelp")%>
-
-
-
-
-
-
-
-
-
-
-
<%= Services.TextService.Localize("defaultdialogs/siterepublished")%>
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Umbraco.Web.UI/web.Template.config b/src/Umbraco.Web.UI/web.Template.config
index 4e067bc681..68fee030a0 100644
--- a/src/Umbraco.Web.UI/web.Template.config
+++ b/src/Umbraco.Web.UI/web.Template.config
@@ -299,11 +299,11 @@
diff --git a/src/Umbraco.Web/Actions/ActionChangeDocType.cs b/src/Umbraco.Web/Actions/ActionChangeDocType.cs
index 73772699d0..56868e9fb0 100644
--- a/src/Umbraco.Web/Actions/ActionChangeDocType.cs
+++ b/src/Umbraco.Web/Actions/ActionChangeDocType.cs
@@ -5,16 +5,17 @@ using Umbraco.Web.UI.Pages;
namespace Umbraco.Web.Actions
{
- ///
- /// This action is invoked when the document type of a piece of content is changed
- ///
- public class ActionChangeDocType : IAction
- {
- public char Letter => '7';
- public string Alias => "changeDocType";
- public string Category => Constants.Conventions.PermissionCategories.AdministrationCategory;
- public string Icon => "axis-rotation-2";
- public bool ShowInNotifier => true;
- public bool CanBePermissionAssigned => true;
- }
+ //TODO: Add this back in when we support this functionality again
+ /////
+ ///// This action is invoked when the document type of a piece of content is changed
+ /////
+ //public class ActionChangeDocType : IAction
+ //{
+ // public char Letter => '7';
+ // public string Alias => "changeDocType";
+ // public string Category => Constants.Conventions.PermissionCategories.AdministrationCategory;
+ // public string Icon => "axis-rotation-2";
+ // public bool ShowInNotifier => true;
+ // public bool CanBePermissionAssigned => true;
+ //}
}
diff --git a/src/Umbraco.Web/Cache/DistributedCacheBinderComponent.cs b/src/Umbraco.Web/Cache/DistributedCacheBinderComponent.cs
index 91646e3624..94d274731d 100644
--- a/src/Umbraco.Web/Cache/DistributedCacheBinderComponent.cs
+++ b/src/Umbraco.Web/Cache/DistributedCacheBinderComponent.cs
@@ -4,9 +4,19 @@ namespace Umbraco.Web.Cache
{
public class DistributedCacheBinderComponent : IComponent
{
+ private readonly IDistributedCacheBinder _binder;
+
public DistributedCacheBinderComponent(IDistributedCacheBinder distributedCacheBinder)
{
- distributedCacheBinder.BindEvents();
+ _binder = distributedCacheBinder;
}
+
+ public void Initialize()
+ {
+ _binder.BindEvents();
+ }
+
+ public void Terminate()
+ { }
}
}
diff --git a/src/Umbraco.Web/Components/BackOfficeUserAuditEventsComponent.cs b/src/Umbraco.Web/Components/BackOfficeUserAuditEventsComponent.cs
index 81b900fc3a..545a781a8d 100644
--- a/src/Umbraco.Web/Components/BackOfficeUserAuditEventsComponent.cs
+++ b/src/Umbraco.Web/Components/BackOfficeUserAuditEventsComponent.cs
@@ -12,17 +12,14 @@ namespace Umbraco.Web.Components
private readonly IAuditService _auditService;
private readonly IUserService _userService;
- private IUser GetPerformingUser(int userId)
- {
- var found = userId >= 0 ? _userService.GetUserById(userId) : null;
- return found ?? new User {Id = 0, Name = "SYSTEM", Email = ""};
- }
-
public BackOfficeUserAuditEventsComponent(IAuditService auditService, IUserService userService)
{
_auditService = auditService;
_userService = userService;
+ }
+ public void Initialize()
+ {
//BackOfficeUserManager.AccountLocked += ;
//BackOfficeUserManager.AccountUnlocked += ;
BackOfficeUserManager.ForgotPasswordRequested += OnForgotPasswordRequest;
@@ -34,7 +31,15 @@ namespace Umbraco.Web.Components
BackOfficeUserManager.PasswordChanged += OnPasswordChanged;
BackOfficeUserManager.PasswordReset += OnPasswordReset;
//BackOfficeUserManager.ResetAccessFailedCount += ;
+ }
+ public void Terminate()
+ { }
+
+ private IUser GetPerformingUser(int userId)
+ {
+ var found = userId >= 0 ? _userService.GetUserById(userId) : null;
+ return found ?? new User { Id = 0, Name = "SYSTEM", Email = "" };
}
private static string FormatEmail(IMembershipUser user)
@@ -42,7 +47,6 @@ namespace Umbraco.Web.Components
return user == null ? string.Empty : user.Email.IsNullOrWhiteSpace() ? "" : $"<{user.Email}>";
}
-
private void OnLoginSuccess(object sender, EventArgs args)
{
if (args is IdentityAuditEventArgs identityArgs)
diff --git a/src/Umbraco.Web/Components/DatabaseServerRegistrarAndMessengerComponent.cs b/src/Umbraco.Web/Components/DatabaseServerRegistrarAndMessengerComponent.cs
index bd3b50bd9a..2e3132a82c 100644
--- a/src/Umbraco.Web/Components/DatabaseServerRegistrarAndMessengerComponent.cs
+++ b/src/Umbraco.Web/Components/DatabaseServerRegistrarAndMessengerComponent.cs
@@ -121,7 +121,10 @@ namespace Umbraco.Web.Components
new BackgroundTaskRunnerOptions { AutoStart = true }, logger);
_processTaskRunner = new BackgroundTaskRunner("ServerInstProcess",
new BackgroundTaskRunnerOptions { AutoStart = true }, logger);
+ }
+ public void Initialize()
+ {
//We will start the whole process when a successful request is made
UmbracoModule.RouteAttempt += RegisterBackgroundTasksOnce;
@@ -129,6 +132,9 @@ namespace Umbraco.Web.Components
_messenger.Startup();
}
+ public void Terminate()
+ { }
+
///
/// Handle when a request is made
///
diff --git a/src/Umbraco.Web/Components/NotificationsComponent.cs b/src/Umbraco.Web/Components/NotificationsComponent.cs
index 9314181c15..4b447598a3 100644
--- a/src/Umbraco.Web/Components/NotificationsComponent.cs
+++ b/src/Umbraco.Web/Components/NotificationsComponent.cs
@@ -18,27 +18,39 @@ namespace Umbraco.Web.Components
{
public sealed class NotificationsComponent : IComponent
{
- public NotificationsComponent(INotificationService notificationService, Notifier notifier, ActionCollection actions)
+ private readonly Notifier _notifier;
+ private readonly ActionCollection _actions;
+
+ public NotificationsComponent(Notifier notifier, ActionCollection actions)
+ {
+ _notifier = notifier;
+ _actions = actions;
+ }
+
+ public void Initialize()
{
//Send notifications for the send to publish action
- ContentService.SentToPublish += (sender, args) => notifier.Notify(actions.GetAction(), args.Entity);
+ ContentService.SentToPublish += (sender, args) => _notifier.Notify(_actions.GetAction(), args.Entity);
//Send notifications for the published action
- ContentService.Published += (sender, args) => notifier.Notify(actions.GetAction(), args.PublishedEntities.ToArray());
+ ContentService.Published += (sender, args) => _notifier.Notify(_actions.GetAction(), args.PublishedEntities.ToArray());
//Send notifications for the saved action
- ContentService.Sorted += (sender, args) => ContentServiceSorted(notifier, sender, args, actions);
+ ContentService.Sorted += (sender, args) => ContentServiceSorted(_notifier, sender, args, _actions);
//Send notifications for the update and created actions
- ContentService.Saved += (sender, args) => ContentServiceSaved(notifier, sender, args, actions);
+ ContentService.Saved += (sender, args) => ContentServiceSaved(_notifier, sender, args, _actions);
//Send notifications for the delete action
- ContentService.Deleted += (sender, args) => notifier.Notify(actions.GetAction(), args.DeletedEntities.ToArray());
+ ContentService.Deleted += (sender, args) => _notifier.Notify(_actions.GetAction(), args.DeletedEntities.ToArray());
//Send notifications for the unpublish action
- ContentService.Unpublished += (sender, args) => notifier.Notify(actions.GetAction(), args.PublishedEntities.ToArray());
+ ContentService.Unpublished += (sender, args) => _notifier.Notify(_actions.GetAction(), args.PublishedEntities.ToArray());
}
+ public void Terminate()
+ { }
+
private void ContentServiceSorted(Notifier notifier, IContentService sender, Core.Events.SaveEventArgs args, ActionCollection actions)
{
var parentId = args.SavedEntities.Select(x => x.ParentId).Distinct().ToList();
diff --git a/src/Umbraco.Web/Components/PublicAccessComponent.cs b/src/Umbraco.Web/Components/PublicAccessComponent.cs
index 09c1108295..e08d42d961 100644
--- a/src/Umbraco.Web/Components/PublicAccessComponent.cs
+++ b/src/Umbraco.Web/Components/PublicAccessComponent.cs
@@ -8,11 +8,14 @@ namespace Umbraco.Web.Components
{
public sealed class PublicAccessComponent : IComponent
{
- public PublicAccessComponent()
+ public void Initialize()
{
MemberGroupService.Saved += MemberGroupService_Saved;
}
+ public void Terminate()
+ { }
+
static void MemberGroupService_Saved(IMemberGroupService sender, Core.Events.SaveEventArgs e)
{
foreach (var grp in e.SavedEntities)
diff --git a/src/Umbraco.Web/Composing/Current.cs b/src/Umbraco.Web/Composing/Current.cs
index fc67465e1a..ffe07393e6 100644
--- a/src/Umbraco.Web/Composing/Current.cs
+++ b/src/Umbraco.Web/Composing/Current.cs
@@ -201,7 +201,7 @@ namespace Umbraco.Web.Composing
public static TypeLoader TypeLoader => CoreCurrent.TypeLoader;
- public static UmbracoConfig Config => CoreCurrent.Config;
+ public static Configs Configs => CoreCurrent.Configs;
public static UrlSegmentProviderCollection UrlSegmentProviders => CoreCurrent.UrlSegmentProviders;
diff --git a/src/Umbraco.Web/CompositionExtensions.cs b/src/Umbraco.Web/CompositionExtensions.cs
index 5adae22b4a..f72c876a61 100644
--- a/src/Umbraco.Web/CompositionExtensions.cs
+++ b/src/Umbraco.Web/CompositionExtensions.cs
@@ -8,6 +8,7 @@ using Umbraco.Web.Mvc;
using Umbraco.Web.PublishedCache;
using Umbraco.Web.Routing;
using Umbraco.Web.ContentApps;
+using Umbraco.Web.Tour;
// the namespace here is intentional - although defined in Umbraco.Web assembly,
// this class should be visible when using Umbraco.Core.Components, alongside
@@ -70,6 +71,12 @@ namespace Umbraco.Core.Components
public static HealthCheckCollectionBuilder HealthChecks(this Composition composition)
=> composition.WithCollectionBuilder();
+ ///
+ /// Gets the TourFilters collection builder.
+ ///
+ public static TourFilterCollectionBuilder TourFilters(this Composition composition)
+ => composition.WithCollectionBuilder();
+
///
/// Gets the url providers collection builder.
///
diff --git a/src/Umbraco.Web/Editors/AuthenticationController.cs b/src/Umbraco.Web/Editors/AuthenticationController.cs
index 594b450e82..231ec9ba67 100644
--- a/src/Umbraco.Web/Editors/AuthenticationController.cs
+++ b/src/Umbraco.Web/Editors/AuthenticationController.cs
@@ -300,7 +300,7 @@ namespace Umbraco.Web.Editors
{
// If this feature is switched off in configuration the UI will be amended to not make the request to reset password available.
// So this is just a server-side secondary check.
- if (Current.Config.Umbraco().Security.AllowPasswordReset == false)
+ if (Current.Configs.Settings().Security.AllowPasswordReset == false)
{
throw new HttpResponseException(HttpStatusCode.BadRequest);
}
diff --git a/src/Umbraco.Web/Editors/BackOfficeController.cs b/src/Umbraco.Web/Editors/BackOfficeController.cs
index e323f92c57..6294a0377f 100644
--- a/src/Umbraco.Web/Editors/BackOfficeController.cs
+++ b/src/Umbraco.Web/Editors/BackOfficeController.cs
@@ -233,7 +233,7 @@ namespace Umbraco.Web.Editors
[HttpGet]
public JsonNetResult GetGridConfig()
{
- var gridConfig = Current.Config.Grids();
+ var gridConfig = Current.Configs.Grids();
return new JsonNetResult { Data = gridConfig.EditorsConfig.Editors, Formatting = Formatting.Indented };
}
diff --git a/src/Umbraco.Web/Editors/BackOfficeServerVariables.cs b/src/Umbraco.Web/Editors/BackOfficeServerVariables.cs
index c92a88d5b1..71ceb6f4b4 100644
--- a/src/Umbraco.Web/Editors/BackOfficeServerVariables.cs
+++ b/src/Umbraco.Web/Editors/BackOfficeServerVariables.cs
@@ -314,25 +314,25 @@ namespace Umbraco.Web.Editors
{"appPluginsPath", IOHelper.ResolveUrl(SystemDirectories.AppPlugins).TrimEnd('/')},
{
"imageFileTypes",
- string.Join(",", Current.Config.Umbraco().Content.ImageFileTypes)
+ string.Join(",", Current.Configs.Settings().Content.ImageFileTypes)
},
{
"disallowedUploadFiles",
- string.Join(",", Current.Config.Umbraco().Content.DisallowedUploadFiles)
+ string.Join(",", Current.Configs.Settings().Content.DisallowedUploadFiles)
},
{
"allowedUploadFiles",
- string.Join(",", Current.Config.Umbraco().Content.AllowedUploadFiles)
+ string.Join(",", Current.Configs.Settings().Content.AllowedUploadFiles)
},
{
"maxFileSize",
GetMaxRequestLength()
},
- {"keepUserLoggedIn", Current.Config.Umbraco().Security.KeepUserLoggedIn},
- {"usernameIsEmail", Current.Config.Umbraco().Security.UsernameIsEmail},
+ {"keepUserLoggedIn", Current.Configs.Settings().Security.KeepUserLoggedIn},
+ {"usernameIsEmail", Current.Configs.Settings().Security.UsernameIsEmail},
{"cssPath", IOHelper.ResolveUrl(SystemDirectories.Css).TrimEnd('/')},
- {"allowPasswordReset", Current.Config.Umbraco().Security.AllowPasswordReset},
- {"loginBackgroundImage", Current.Config.Umbraco().Content.LoginBackgroundImage},
+ {"allowPasswordReset", Current.Configs.Settings().Security.AllowPasswordReset},
+ {"loginBackgroundImage", Current.Configs.Settings().Content.LoginBackgroundImage},
{"showUserInvite", EmailSender.CanSendRequiredEmail},
{"canSendRequiredEmail", EmailSender.CanSendRequiredEmail},
}
diff --git a/src/Umbraco.Web/Editors/DataTypeController.cs b/src/Umbraco.Web/Editors/DataTypeController.cs
index 79671595f4..335b609b0a 100644
--- a/src/Umbraco.Web/Editors/DataTypeController.cs
+++ b/src/Umbraco.Web/Editors/DataTypeController.cs
@@ -344,7 +344,7 @@ namespace Umbraco.Web.Editors
public IDictionary> GetGroupedPropertyEditors()
{
var datatypes = new List();
- var showDeprecatedPropertyEditors = Current.Config.Umbraco().Content.ShowDeprecatedPropertyEditors;
+ var showDeprecatedPropertyEditors = Current.Configs.Settings().Content.ShowDeprecatedPropertyEditors;
var propertyEditors = Current.PropertyEditors
.Where(x=>x.IsDeprecated == false || showDeprecatedPropertyEditors);
diff --git a/src/Umbraco.Web/Editors/MediaController.cs b/src/Umbraco.Web/Editors/MediaController.cs
index 2cbe32fb89..2c6ba06dc2 100644
--- a/src/Umbraco.Web/Editors/MediaController.cs
+++ b/src/Umbraco.Web/Editors/MediaController.cs
@@ -703,13 +703,13 @@ namespace Umbraco.Web.Editors
var safeFileName = fileName.ToSafeFileName();
var ext = safeFileName.Substring(safeFileName.LastIndexOf('.') + 1).ToLower();
- if (Current.Config.Umbraco().Content.IsFileAllowedForUpload(ext))
+ if (Current.Configs.Settings().Content.IsFileAllowedForUpload(ext))
{
var mediaType = Constants.Conventions.MediaTypes.File;
if (result.FormData["contentTypeAlias"] == Constants.Conventions.MediaTypes.AutoSelect)
{
- if (Current.Config.Umbraco().Content.ImageFileTypes.Contains(ext))
+ if (Current.Configs.Settings().Content.ImageFileTypes.Contains(ext))
{
mediaType = Constants.Conventions.MediaTypes.Image;
}
diff --git a/src/Umbraco.Web/Editors/PackageInstallController.cs b/src/Umbraco.Web/Editors/PackageInstallController.cs
index 94465feab8..aee74551ea 100644
--- a/src/Umbraco.Web/Editors/PackageInstallController.cs
+++ b/src/Umbraco.Web/Editors/PackageInstallController.cs
@@ -8,7 +8,6 @@ using System.Net.Http;
using System.Threading.Tasks;
using System.Web.Http;
using System.Xml;
-using umbraco.cms.businesslogic.packager;
using Umbraco.Core;
using Umbraco.Core.Configuration;
using Umbraco.Core.Events;
@@ -26,6 +25,8 @@ using Umbraco.Web.UI;
using Umbraco.Web.UI.JavaScript;
using Umbraco.Web.WebApi;
using Umbraco.Web.WebApi.Filters;
+using Umbraco.Web._Legacy.Packager;
+using Umbraco.Web._Legacy.Packager.PackageInstance;
using File = System.IO.File;
using Notification = Umbraco.Web.Models.ContentEditing.Notification;
using Version = System.Version;
@@ -194,7 +195,7 @@ namespace Umbraco.Web.Editors
{
try
{
- global::umbraco.cms.businesslogic.packager.PackageAction
+ global::Umbraco.Web._Legacy.Packager.PackageInstance.PackageAction
.UndoPackageAction(pack.Data.Name, n.Attributes["alias"].Value, n);
}
catch (Exception ex)
@@ -310,7 +311,7 @@ namespace Umbraco.Web.Editors
private void PopulateFromPackageData(LocalPackageInstallModel model)
{
- var ins = new global::umbraco.cms.businesslogic.packager.Installer(Security.CurrentUser.Id);
+ var ins = new global::Umbraco.Web._Legacy.Packager.Installer(Security.CurrentUser.Id);
//this will load in all the metadata too
var tempDir = ins.Import(model.ZipFilePath, false);
@@ -500,7 +501,7 @@ namespace Umbraco.Web.Editors
[HttpPost]
public PackageInstallModel Import(PackageInstallModel model)
{
- var ins = new global::umbraco.cms.businesslogic.packager.Installer(Security.CurrentUser.Id);
+ var ins = new global::Umbraco.Web._Legacy.Packager.Installer(Security.CurrentUser.Id);
var tempPath = ins.Import(model.ZipFilePath);
//now we need to check for version comparison
@@ -528,7 +529,7 @@ namespace Umbraco.Web.Editors
[HttpPost]
public PackageInstallModel InstallFiles(PackageInstallModel model)
{
- var ins = new global::umbraco.cms.businesslogic.packager.Installer(Security.CurrentUser.Id);
+ var ins = new global::Umbraco.Web._Legacy.Packager.Installer(Security.CurrentUser.Id);
ins.LoadConfig(IOHelper.MapPath(model.TemporaryDirectoryPath));
ins.InstallFiles(model.Id, IOHelper.MapPath(model.TemporaryDirectoryPath));
@@ -562,7 +563,7 @@ namespace Umbraco.Web.Editors
[HttpPost]
public PackageInstallModel InstallData(PackageInstallModel model)
{
- var ins = new global::umbraco.cms.businesslogic.packager.Installer(Security.CurrentUser.Id);
+ var ins = new global::Umbraco.Web._Legacy.Packager.Installer(Security.CurrentUser.Id);
ins.LoadConfig(IOHelper.MapPath(model.TemporaryDirectoryPath));
ins.InstallBusinessLogic(model.Id, IOHelper.MapPath(model.TemporaryDirectoryPath));
return model;
@@ -576,7 +577,7 @@ namespace Umbraco.Web.Editors
[HttpPost]
public PackageInstallResult CleanUp(PackageInstallModel model)
{
- var ins = new global::umbraco.cms.businesslogic.packager.Installer(Security.CurrentUser.Id);
+ var ins = new global::Umbraco.Web._Legacy.Packager.Installer(Security.CurrentUser.Id);
var tempDir = IOHelper.MapPath(model.TemporaryDirectoryPath);
ins.LoadConfig(IOHelper.MapPath(model.TemporaryDirectoryPath));
ins.InstallCleanUp(model.Id, IOHelper.MapPath(model.TemporaryDirectoryPath));
diff --git a/src/Umbraco.Web/Editors/RedirectUrlManagementController.cs b/src/Umbraco.Web/Editors/RedirectUrlManagementController.cs
index fda57afd12..aa2626ca3b 100644
--- a/src/Umbraco.Web/Editors/RedirectUrlManagementController.cs
+++ b/src/Umbraco.Web/Editors/RedirectUrlManagementController.cs
@@ -34,7 +34,7 @@ namespace Umbraco.Web.Editors
[HttpGet]
public IHttpActionResult GetEnableState()
{
- var enabled = Current.Config.Umbraco().WebRouting.DisableRedirectUrlTracking == false;
+ var enabled = Current.Configs.Settings().WebRouting.DisableRedirectUrlTracking == false;
var userIsAdmin = Umbraco.UmbracoContext.Security.CurrentUser.IsAdmin();
return Ok(new { enabled, userIsAdmin });
}
diff --git a/src/Umbraco.Web/Editors/TourController.cs b/src/Umbraco.Web/Editors/TourController.cs
index 81fa930c41..f2a546e407 100644
--- a/src/Umbraco.Web/Editors/TourController.cs
+++ b/src/Umbraco.Web/Editors/TourController.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using Newtonsoft.Json;
+using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core.Configuration;
using Umbraco.Core.IO;
@@ -26,7 +27,7 @@ namespace Umbraco.Web.Editors
{
var result = new List();
- if (Current.Config.Umbraco().BackOffice.Tours.EnableTours == false)
+ if (Current.Configs.Settings().BackOffice.Tours.EnableTours == false)
return result;
//get all filters that will be applied to all tour aliases
diff --git a/src/Umbraco.Web/Editors/UpdateCheckController.cs b/src/Umbraco.Web/Editors/UpdateCheckController.cs
index 64c6aa30aa..cd11382d13 100644
--- a/src/Umbraco.Web/Editors/UpdateCheckController.cs
+++ b/src/Umbraco.Web/Editors/UpdateCheckController.cs
@@ -3,6 +3,7 @@ using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Web.Http.Filters;
+using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core.Configuration;
using Umbraco.Core.Models;
@@ -59,9 +60,9 @@ namespace Umbraco.Web.Editors
var cookie = new CookieHeaderValue("UMB_UPDCHK", "1")
{
Path = "/",
- Expires = DateTimeOffset.Now.AddDays(Current.Config.Global().VersionCheckPeriod),
+ Expires = DateTimeOffset.Now.AddDays(Current.Configs.Global().VersionCheckPeriod),
HttpOnly = true,
- Secure = Current.Config.Global().UseHttps
+ Secure = Current.Configs.Global().UseHttps
};
context.Response.Headers.AddCookies(new[] { cookie });
}
diff --git a/src/Umbraco.Web/Editors/UsersController.cs b/src/Umbraco.Web/Editors/UsersController.cs
index 9f30b01467..7577624621 100644
--- a/src/Umbraco.Web/Editors/UsersController.cs
+++ b/src/Umbraco.Web/Editors/UsersController.cs
@@ -98,7 +98,7 @@ namespace Umbraco.Web.Editors
var safeFileName = fileName.ToSafeFileName();
var ext = safeFileName.Substring(safeFileName.LastIndexOf('.') + 1).ToLower();
- if (Current.Config.Umbraco().Content.DisallowedUploadFiles.Contains(ext) == false)
+ if (Current.Configs.Settings().Content.DisallowedUploadFiles.Contains(ext) == false)
{
//generate a path of known data, we don't want this path to be guessable
user.Avatar = "UserAvatars/" + (user.Id + safeFileName).ToSHA1() + "." + ext;
@@ -195,7 +195,7 @@ namespace Umbraco.Web.Editors
// so to do that here, we'll need to check if this current user is an admin and if not we should exclude all user who are
// also admins
- var hideDisabledUsers = Current.Config.Umbraco().Security.HideDisabledUsersInBackoffice;
+ var hideDisabledUsers = Current.Configs.Settings().Security.HideDisabledUsersInBackoffice;
var excludeUserGroups = new string[0];
var isAdmin = Security.CurrentUser.IsAdmin();
if (isAdmin == false)
@@ -253,7 +253,7 @@ namespace Umbraco.Web.Editors
throw new HttpResponseException(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState));
}
- if (Current.Config.Umbraco().Security.UsernameIsEmail)
+ if (Current.Configs.Settings().Security.UsernameIsEmail)
{
//ensure they are the same if we're using it
userSave.Username = userSave.Email;
@@ -345,7 +345,7 @@ namespace Umbraco.Web.Editors
}
IUser user;
- if (Current.Config.Umbraco().Security.UsernameIsEmail)
+ if (Current.Configs.Settings().Security.UsernameIsEmail)
{
//ensure it's the same
userSave.Username = userSave.Email;
@@ -419,7 +419,7 @@ namespace Umbraco.Web.Editors
if (user != null && (extraCheck == null || extraCheck(user)))
{
ModelState.AddModelError(
- Current.Config.Umbraco().Security.UsernameIsEmail ? "Email" : "Username",
+ Current.Configs.Settings().Security.UsernameIsEmail ? "Email" : "Username",
"A user with the username already exists");
throw new HttpResponseException(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState));
}
@@ -539,7 +539,7 @@ namespace Umbraco.Web.Editors
// if the found user has his email for username, we want to keep this synced when changing the email.
// we have already cross-checked above that the email isn't colliding with anything, so we can safely assign it here.
- if (Current.Config.Umbraco().Security.UsernameIsEmail && found.Username == found.Email && userSave.Username != userSave.Email)
+ if (Current.Configs.Settings().Security.UsernameIsEmail && found.Username == found.Email && userSave.Username != userSave.Email)
{
userSave.Username = userSave.Email;
}
diff --git a/src/Umbraco.Web/HealthCheck/HealthCheckController.cs b/src/Umbraco.Web/HealthCheck/HealthCheckController.cs
index 5df534232c..2f72b946de 100644
--- a/src/Umbraco.Web/HealthCheck/HealthCheckController.cs
+++ b/src/Umbraco.Web/HealthCheck/HealthCheckController.cs
@@ -4,6 +4,7 @@ using System.ComponentModel;
using System.Configuration;
using System.Linq;
using System.Web.Http;
+using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core.Logging;
using Umbraco.Core.Configuration;
@@ -28,7 +29,7 @@ namespace Umbraco.Web.HealthCheck
_checks = checks ?? throw new ArgumentNullException(nameof(checks));
_logger = logger ?? throw new ArgumentNullException(nameof(logger));
- var healthCheckConfig = Current.Config.HealthChecks();
+ var healthCheckConfig = Current.Configs.HealthChecks();
_disabledCheckIds = healthCheckConfig.DisabledChecks
.Select(x => x.Id)
.ToList();
diff --git a/src/Umbraco.Web/HealthCheck/NotificationMethods/EmailNotificationMethod.cs b/src/Umbraco.Web/HealthCheck/NotificationMethods/EmailNotificationMethod.cs
index 6b1091a0c3..87c0e4f46d 100644
--- a/src/Umbraco.Web/HealthCheck/NotificationMethods/EmailNotificationMethod.cs
+++ b/src/Umbraco.Web/HealthCheck/NotificationMethods/EmailNotificationMethod.cs
@@ -70,7 +70,7 @@ namespace Umbraco.Web.HealthCheck.NotificationMethods
private MailMessage CreateMailMessage(string subject, string message)
{
- var to = Current.Config.Umbraco().Content.NotificationEmailAddress;
+ var to = Current.Configs.Settings().Content.NotificationEmailAddress;
if (string.IsNullOrWhiteSpace(subject))
subject = "Umbraco Health Check Status";
diff --git a/src/Umbraco.Web/HealthCheck/NotificationMethods/NotificationMethodBase.cs b/src/Umbraco.Web/HealthCheck/NotificationMethods/NotificationMethodBase.cs
index 88caff1da7..cf71be3c34 100644
--- a/src/Umbraco.Web/HealthCheck/NotificationMethods/NotificationMethodBase.cs
+++ b/src/Umbraco.Web/HealthCheck/NotificationMethods/NotificationMethodBase.cs
@@ -2,6 +2,7 @@
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
+using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core.Configuration;
using Umbraco.Core.Configuration.HealthChecks;
@@ -20,7 +21,7 @@ namespace Umbraco.Web.HealthCheck.NotificationMethods
return;
}
- var healthCheckConfig = Current.Config.HealthChecks();
+ var healthCheckConfig = Current.Configs.HealthChecks();
var notificationMethods = healthCheckConfig.NotificationSettings.NotificationMethods;
var notificationMethod = notificationMethods[attribute.Alias];
if (notificationMethod == null)
diff --git a/src/Umbraco.Web/HtmlHelperRenderExtensions.cs b/src/Umbraco.Web/HtmlHelperRenderExtensions.cs
index e47af9d302..2e82fe252d 100644
--- a/src/Umbraco.Web/HtmlHelperRenderExtensions.cs
+++ b/src/Umbraco.Web/HtmlHelperRenderExtensions.cs
@@ -65,7 +65,7 @@ namespace Umbraco.Web
if (UmbracoContext.Current.InPreviewMode)
{
var htmlBadge =
- String.Format(Current.Config.Umbraco().Content.PreviewBadge,
+ String.Format(Current.Configs.Settings().Content.PreviewBadge,
IOHelper.ResolveUrl(SystemDirectories.Umbraco),
UmbracoContext.Current.HttpContext.Server.UrlEncode(UmbracoContext.Current.HttpContext.Request.Path));
return new MvcHtmlString(htmlBadge);
diff --git a/src/Umbraco.Web/Install/Controllers/InstallPackageController.cs b/src/Umbraco.Web/Install/Controllers/InstallPackageController.cs
index eb7d02053b..1fd2ac27bb 100644
--- a/src/Umbraco.Web/Install/Controllers/InstallPackageController.cs
+++ b/src/Umbraco.Web/Install/Controllers/InstallPackageController.cs
@@ -56,7 +56,7 @@ namespace Umbraco.Web.Install.Controllers
UmbracoVersion.Current,
UmbracoContext.Current.Security.CurrentUser.Id);
- var installer = new global::umbraco.cms.businesslogic.packager.Installer(UmbracoContext.Current.Security.CurrentUser.Id);
+ var installer = new global::Umbraco.Web._Legacy.Packager.Installer(UmbracoContext.Current.Security.CurrentUser.Id);
var tempFile = installer.Import(packageFile);
installer.LoadConfig(tempFile);
@@ -79,7 +79,7 @@ namespace Umbraco.Web.Install.Controllers
public HttpResponseMessage InstallPackageFiles(InstallPackageModel model)
{
model.PackageFile = HttpUtility.UrlDecode(model.PackageFile);
- var installer = new global::umbraco.cms.businesslogic.packager.Installer(UmbracoContext.Current.Security.CurrentUser.Id);
+ var installer = new global::Umbraco.Web._Legacy.Packager.Installer(UmbracoContext.Current.Security.CurrentUser.Id);
installer.LoadConfig(model.PackageFile);
installer.InstallFiles(model.ManifestId, model.PackageFile);
return Json(new
@@ -135,7 +135,7 @@ namespace Umbraco.Web.Install.Controllers
public HttpResponseMessage InstallBusinessLogic(InstallPackageModel model)
{
model.PackageFile = HttpUtility.UrlDecode(model.PackageFile);
- var installer = new global::umbraco.cms.businesslogic.packager.Installer(UmbracoContext.Current.Security.CurrentUser.Id);
+ var installer = new global::Umbraco.Web._Legacy.Packager.Installer(UmbracoContext.Current.Security.CurrentUser.Id);
installer.LoadConfig(model.PackageFile);
installer.InstallBusinessLogic(model.ManifestId, model.PackageFile);
return Json(new
@@ -156,7 +156,7 @@ namespace Umbraco.Web.Install.Controllers
public HttpResponseMessage CleanupInstallation(InstallPackageModel model)
{
model.PackageFile = HttpUtility.UrlDecode(model.PackageFile);
- var installer = new global::umbraco.cms.businesslogic.packager.Installer(UmbracoContext.Current.Security.CurrentUser.Id);
+ var installer = new global::Umbraco.Web._Legacy.Packager.Installer(UmbracoContext.Current.Security.CurrentUser.Id);
installer.LoadConfig(model.PackageFile);
installer.InstallCleanUp(model.ManifestId, model.PackageFile);
diff --git a/src/Umbraco.Web/Install/InstallSteps/NewInstallStep.cs b/src/Umbraco.Web/Install/InstallSteps/NewInstallStep.cs
index 10a84b9350..64b8568fe5 100644
--- a/src/Umbraco.Web/Install/InstallSteps/NewInstallStep.cs
+++ b/src/Umbraco.Web/Install/InstallSteps/NewInstallStep.cs
@@ -145,7 +145,7 @@ namespace Umbraco.Web.Install.InstallSteps
// In this one case when it's a brand new install and nothing has been configured, make sure the
// back office cookie is cleared so there's no old cookies lying around causing problems
- _http.ExpireCookie(Current.Config.Umbraco().Security.AuthCookieName);
+ _http.ExpireCookie(Current.Configs.Settings().Security.AuthCookieName);
return true;
}
diff --git a/src/Umbraco.Web/Install/InstallSteps/StarterKitCleanupStep.cs b/src/Umbraco.Web/Install/InstallSteps/StarterKitCleanupStep.cs
index 5738f2a67c..9345a0fc96 100644
--- a/src/Umbraco.Web/Install/InstallSteps/StarterKitCleanupStep.cs
+++ b/src/Umbraco.Web/Install/InstallSteps/StarterKitCleanupStep.cs
@@ -1,8 +1,8 @@
using System;
using System.Linq;
using System.Web;
-using umbraco.cms.businesslogic.packager;
using Umbraco.Web.Install.Models;
+using Umbraco.Web._Legacy.Packager;
namespace Umbraco.Web.Install.InstallSteps
{
diff --git a/src/Umbraco.Web/Install/InstallSteps/StarterKitDownloadStep.cs b/src/Umbraco.Web/Install/InstallSteps/StarterKitDownloadStep.cs
index b8ae600dba..8f9f9242d7 100644
--- a/src/Umbraco.Web/Install/InstallSteps/StarterKitDownloadStep.cs
+++ b/src/Umbraco.Web/Install/InstallSteps/StarterKitDownloadStep.cs
@@ -2,12 +2,13 @@
using System.Collections.Generic;
using System.Linq;
using System.Web;
-using umbraco.cms.businesslogic.packager;
using Umbraco.Core.Services;
using Umbraco.Core.Configuration;
using Umbraco.Web.Composing;
using Umbraco.Web.Install.Models;
using Umbraco.Web.Security;
+using Umbraco.Web._Legacy.Packager;
+using Umbraco.Web._Legacy.Packager.PackageInstance;
namespace Umbraco.Web.Install.InstallSteps
{
diff --git a/src/Umbraco.Web/Install/InstallSteps/StarterKitInstallStep.cs b/src/Umbraco.Web/Install/InstallSteps/StarterKitInstallStep.cs
index 844a27a576..8bec4ca199 100644
--- a/src/Umbraco.Web/Install/InstallSteps/StarterKitInstallStep.cs
+++ b/src/Umbraco.Web/Install/InstallSteps/StarterKitInstallStep.cs
@@ -1,9 +1,9 @@
using System;
using System.Linq;
using System.Web;
-using umbraco.cms.businesslogic.packager;
using Umbraco.Web.Composing;
using Umbraco.Web.Install.Models;
+using Umbraco.Web._Legacy.Packager;
namespace Umbraco.Web.Install.InstallSteps
{
diff --git a/src/Umbraco.Web/Logging/WebProfilerComponent.cs b/src/Umbraco.Web/Logging/WebProfilerComponent.cs
index 418ea66d23..b61bcd372c 100755
--- a/src/Umbraco.Web/Logging/WebProfilerComponent.cs
+++ b/src/Umbraco.Web/Logging/WebProfilerComponent.cs
@@ -1,6 +1,5 @@
using System;
using System.Web;
-using Umbraco.Core;
using Umbraco.Core.Components;
using Umbraco.Core.Logging;
@@ -9,30 +8,38 @@ namespace Umbraco.Web.Logging
internal sealed class WebProfilerComponent : IComponent
{
private readonly WebProfiler _profiler;
+ private readonly bool _profile;
- public WebProfilerComponent(IProfiler profiler, ILogger logger, IRuntimeState runtime)
+ public WebProfilerComponent(IProfiler profiler, ILogger logger)
{
+ _profile = true;
+
// although registered in WebRuntime.Compose, ensure that we have not
// been replaced by another component, and we are still "the" profiler
_profiler = profiler as WebProfiler;
- if (_profiler == null)
- {
- // if VoidProfiler was registered, let it be known
- var vp = profiler as VoidProfiler;
- if (vp != null)
- logger.Info("Profiler is VoidProfiler, not profiling (must run debug mode to profile).");
- return;
- }
+ if (_profiler != null) return;
+
+ // if VoidProfiler was registered, let it be known
+ if (profiler is VoidProfiler)
+ logger.Info("Profiler is VoidProfiler, not profiling (must run debug mode to profile).");
+ _profile = false;
+ }
+
+ public void Initialize()
+ {
+ if (!_profile) return;
// bind to ApplicationInit - ie execute the application initialization for *each* application
// it would be a mistake to try and bind to the current application events
UmbracoApplicationBase.ApplicationInit += InitializeApplication;
}
+ public void Terminate()
+ { }
+
private void InitializeApplication(object sender, EventArgs args)
{
- var app = sender as HttpApplication;
- if (app == null) return;
+ if (!(sender is HttpApplication app)) return;
// for *each* application (this will run more than once)
app.BeginRequest += (s, a) => _profiler.UmbracoApplicationBeginRequest(s, a);
diff --git a/src/Umbraco.Web/Macros/MacroRenderer.cs b/src/Umbraco.Web/Macros/MacroRenderer.cs
index d3c646465c..e0a0fd65c8 100755
--- a/src/Umbraco.Web/Macros/MacroRenderer.cs
+++ b/src/Umbraco.Web/Macros/MacroRenderer.cs
@@ -312,7 +312,7 @@ namespace Umbraco.Web.Macros
Alias = macro.Alias,
MacroSource = macro.MacroSource,
Exception = e,
- Behaviour = Current.Config.Umbraco().Content.MacroErrorBehaviour
+ Behaviour = Current.Configs.Settings().Content.MacroErrorBehaviour
};
OnError(macroErrorEventArgs);
@@ -604,7 +604,7 @@ namespace Umbraco.Web.Macros
querystring += $"&umb_{ide.Key}={HttpContext.Current.Server.UrlEncode((ide.Value ?? String.Empty).ToString())}";
// create a new 'HttpWebRequest' object to the mentioned URL.
- var useSsl = Current.Config.Global().UseHttps;
+ var useSsl = Current.Configs.Global().UseHttps;
var protocol = useSsl ? "https" : "http";
var currentRequest = HttpContext.Current.Request;
var serverVars = currentRequest.ServerVariables;
@@ -619,7 +619,7 @@ namespace Umbraco.Web.Macros
// propagate the user's context
// TODO: this is the worst thing ever.
// also will not work if people decide to put their own custom auth system in place.
- var inCookie = currentRequest.Cookies[Current.Config.Umbraco().Security.AuthCookieName];
+ var inCookie = currentRequest.Cookies[Current.Configs.Settings().Security.AuthCookieName];
if (inCookie == null) throw new NullReferenceException("No auth cookie found");
var cookie = new Cookie(inCookie.Name, inCookie.Value, inCookie.Path, serverVars["SERVER_NAME"]);
myHttpWebRequest.CookieContainer = new CookieContainer();
diff --git a/src/Umbraco.Web/Models/ContentEditing/ContentTypeBasic.cs b/src/Umbraco.Web/Models/ContentEditing/ContentTypeBasic.cs
index f19753b1d8..6aca5d8054 100644
--- a/src/Umbraco.Web/Models/ContentEditing/ContentTypeBasic.cs
+++ b/src/Umbraco.Web/Models/ContentEditing/ContentTypeBasic.cs
@@ -76,7 +76,7 @@ namespace Umbraco.Web.Models.ContentEditing
{
return IconIsClass
? string.Empty
- : string.Format("{0}images/umbraco/{1}", Current.Config.Global().Path.EnsureEndsWith("/"), Icon);
+ : string.Format("{0}images/umbraco/{1}", Current.Configs.Global().Path.EnsureEndsWith("/"), Icon);
}
}
diff --git a/src/Umbraco.Web/Models/ContentEditing/UserInvite.cs b/src/Umbraco.Web/Models/ContentEditing/UserInvite.cs
index 893a3d8020..b18b1539be 100644
--- a/src/Umbraco.Web/Models/ContentEditing/UserInvite.cs
+++ b/src/Umbraco.Web/Models/ContentEditing/UserInvite.cs
@@ -34,7 +34,7 @@ namespace Umbraco.Web.Models.ContentEditing
if (UserGroups.Any() == false)
yield return new ValidationResult("A user must be assigned to at least one group", new[] { "UserGroups" });
- if (Current.Config.Umbraco().Security.UsernameIsEmail == false && Username.IsNullOrWhiteSpace())
+ if (Current.Configs.Settings().Security.UsernameIsEmail == false && Username.IsNullOrWhiteSpace())
yield return new ValidationResult("A username cannot be empty", new[] { "Username" });
}
}
diff --git a/src/Umbraco.Web/Models/Mapping/DataTypeMapperProfile.cs b/src/Umbraco.Web/Models/Mapping/DataTypeMapperProfile.cs
index d9330ac610..425e447c9c 100644
--- a/src/Umbraco.Web/Models/Mapping/DataTypeMapperProfile.cs
+++ b/src/Umbraco.Web/Models/Mapping/DataTypeMapperProfile.cs
@@ -20,7 +20,7 @@ namespace Umbraco.Web.Models.Mapping
public DataTypeMapperProfile(PropertyEditorCollection propertyEditors, ILogger logger)
{
// create, capture, cache
- var availablePropertyEditorsResolver = new AvailablePropertyEditorsResolver(Current.Config.Umbraco().Content);
+ var availablePropertyEditorsResolver = new AvailablePropertyEditorsResolver(Current.Configs.Settings().Content);
var configurationDisplayResolver = new DataTypeConfigurationFieldDisplayResolver(logger);
var databaseTypeResolver = new DatabaseTypeResolver();
diff --git a/src/Umbraco.Web/Models/Mapping/MediaMapperProfile.cs b/src/Umbraco.Web/Models/Mapping/MediaMapperProfile.cs
index dc0aa16b74..bda8c8563f 100644
--- a/src/Umbraco.Web/Models/Mapping/MediaMapperProfile.cs
+++ b/src/Umbraco.Web/Models/Mapping/MediaMapperProfile.cs
@@ -53,7 +53,7 @@ namespace Umbraco.Web.Models.Mapping
.ForMember(dest => dest.Tabs, opt => opt.ResolveUsing(tabsAndPropertiesResolver))
.ForMember(dest => dest.AdditionalData, opt => opt.Ignore())
.ForMember(dest => dest.ContentType, opt => opt.ResolveUsing(mediaTypeBasicResolver))
- .ForMember(dest => dest.MediaLink, opt => opt.ResolveUsing(content => string.Join(",", content.GetUrls(Current.Config.Umbraco().Content, logger))))
+ .ForMember(dest => dest.MediaLink, opt => opt.ResolveUsing(content => string.Join(",", content.GetUrls(Current.Configs.Settings().Content, logger))))
.ForMember(dest => dest.ContentApps, opt => opt.ResolveUsing(mediaAppResolver))
.ForMember(dest => dest.VariesByCulture, opt => opt.MapFrom(src => src.ContentType.VariesByCulture()));
diff --git a/src/Umbraco.Web/Models/Trees/TreeNode.cs b/src/Umbraco.Web/Models/Trees/TreeNode.cs
index cca2bf8091..6e13773754 100644
--- a/src/Umbraco.Web/Models/Trees/TreeNode.cs
+++ b/src/Umbraco.Web/Models/Trees/TreeNode.cs
@@ -112,7 +112,7 @@ namespace Umbraco.Web.Models.Trees
return IOHelper.ResolveUrl("~" + Icon.TrimStart('~'));
//legacy icon path
- return string.Format("{0}images/umbraco/{1}", Current.Config.Global().Path.EnsureEndsWith("/"), Icon);
+ return string.Format("{0}images/umbraco/{1}", Current.Configs.Global().Path.EnsureEndsWith("/"), Icon);
}
}
diff --git a/src/Umbraco.Web/Mvc/UmbracoAuthorizeAttribute.cs b/src/Umbraco.Web/Mvc/UmbracoAuthorizeAttribute.cs
index 205bb0926d..8b76a2069d 100644
--- a/src/Umbraco.Web/Mvc/UmbracoAuthorizeAttribute.cs
+++ b/src/Umbraco.Web/Mvc/UmbracoAuthorizeAttribute.cs
@@ -57,7 +57,7 @@ namespace Umbraco.Web.Mvc
{
if (redirectToUmbracoLogin)
{
- _redirectUrl = Current.Config.Global().Path.EnsureStartsWith("~");
+ _redirectUrl = Current.Configs.Global().Path.EnsureStartsWith("~");
}
}
diff --git a/src/Umbraco.Web/Mvc/UmbracoRequireHttpsAttribute.cs b/src/Umbraco.Web/Mvc/UmbracoRequireHttpsAttribute.cs
index 502386e9cb..366f5de8db 100644
--- a/src/Umbraco.Web/Mvc/UmbracoRequireHttpsAttribute.cs
+++ b/src/Umbraco.Web/Mvc/UmbracoRequireHttpsAttribute.cs
@@ -1,4 +1,5 @@
using System.Web.Mvc;
+using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core.Configuration;
using GlobalSettings = Umbraco.Core.Configuration.GlobalSettings;
@@ -17,7 +18,7 @@ namespace Umbraco.Web.Mvc
protected override void HandleNonHttpsRequest(AuthorizationContext filterContext)
{
// If umbracoUseSSL is set, let base method handle redirect. Otherwise, we don't care.
- if (Current.Config.Global().UseHttps)
+ if (Current.Configs.Global().UseHttps)
{
base.HandleNonHttpsRequest(filterContext);
}
@@ -30,7 +31,7 @@ namespace Umbraco.Web.Mvc
public override void OnAuthorization(AuthorizationContext filterContext)
{
// If umbracoSSL is set, let base method handle checking for HTTPS. Otherwise, we don't care.
- if (Current.Config.Global().UseHttps)
+ if (Current.Configs.Global().UseHttps)
{
base.OnAuthorization(filterContext);
}
diff --git a/src/Umbraco.Web/Mvc/UmbracoViewPageOfTModel.cs b/src/Umbraco.Web/Mvc/UmbracoViewPageOfTModel.cs
index 86277cd18d..394aa39dd9 100644
--- a/src/Umbraco.Web/Mvc/UmbracoViewPageOfTModel.cs
+++ b/src/Umbraco.Web/Mvc/UmbracoViewPageOfTModel.cs
@@ -216,7 +216,7 @@ namespace Umbraco.Web.Mvc
{
// creating previewBadge markup
markupToInject =
- string.Format(Current.Config.Umbraco().Content.PreviewBadge,
+ string.Format(Current.Configs.Settings().Content.PreviewBadge,
IOHelper.ResolveUrl(SystemDirectories.Umbraco),
Server.UrlEncode(UmbracoContext.Current.HttpContext.Request.Path));
}
diff --git a/src/Umbraco.Web/PropertyEditors/PropertyEditorsComponent.cs b/src/Umbraco.Web/PropertyEditors/PropertyEditorsComponent.cs
index e719a72160..2fc3badb85 100644
--- a/src/Umbraco.Web/PropertyEditors/PropertyEditorsComponent.cs
+++ b/src/Umbraco.Web/PropertyEditors/PropertyEditorsComponent.cs
@@ -1,5 +1,4 @@
using System.Linq;
-using Umbraco.Core;
using Umbraco.Core.Components;
using Umbraco.Core.Models;
using Umbraco.Core.PropertyEditors;
@@ -9,18 +8,26 @@ namespace Umbraco.Web.PropertyEditors
{
internal sealed class PropertyEditorsComponent : IComponent
{
+ private readonly PropertyEditorCollection _propertyEditors;
+
public PropertyEditorsComponent(PropertyEditorCollection propertyEditors)
{
- var fileUpload = propertyEditors.OfType().FirstOrDefault();
+ _propertyEditors = propertyEditors;
+ }
+
+ public void Initialize()
+ {
+ var fileUpload = _propertyEditors.OfType