From 099c1ff2ea43b3359e6ca92408ac30dd6a0e245f Mon Sep 17 00:00:00 2001 From: Shannon Date: Tue, 24 Sep 2013 10:39:47 +1000 Subject: [PATCH 01/17] Fixes: U4-2914 Examine doesn't index newly created items --- src/Umbraco.Web/Search/ExamineEvents.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/Umbraco.Web/Search/ExamineEvents.cs b/src/Umbraco.Web/Search/ExamineEvents.cs index de120db8ac..fc1d1c77d0 100644 --- a/src/Umbraco.Web/Search/ExamineEvents.cs +++ b/src/Umbraco.Web/Search/ExamineEvents.cs @@ -50,10 +50,13 @@ namespace Umbraco.Web.Search if (registeredProviders == 0) return; + MediaService.Created += MediaServiceCreated; MediaService.Saved += MediaServiceSaved; MediaService.Deleted += MediaServiceDeleted; MediaService.Moved += MediaServiceMoved; MediaService.Trashed += MediaServiceTrashed; + + ContentService.Created += ContentServiceCreated; ContentService.Saved += ContentServiceSaved; ContentService.Deleted += ContentServiceDeleted; ContentService.Moved += ContentServiceMoved; @@ -78,6 +81,18 @@ namespace Umbraco.Web.Search } } + [SecuritySafeCritical] + static void ContentServiceCreated(IContentService sender, Core.Events.NewEventArgs e) + { + IndexConent(e.Entity); + } + + [SecuritySafeCritical] + static void MediaServiceCreated(IMediaService sender, Core.Events.NewEventArgs e) + { + IndexMedia(e.Entity); + } + [SecuritySafeCritical] static void ContentServiceTrashed(IContentService sender, Core.Events.MoveEventArgs e) { From c739146f2445798d9b1d363b26bc21224296198e Mon Sep 17 00:00:00 2001 From: Shannon Date: Tue, 24 Sep 2013 19:27:13 +1000 Subject: [PATCH 02/17] Completes: U4-2917 Remove canvas/live editing support, U4-2919 Remove defaultToLiveEditing column, U4-2825 Remove default permissions column --- .../UmbracoSettings/ContentElement.cs | 17 - .../UmbracoSettings/IContentSection.cs | 2 - src/Umbraco.Core/Models/Membership/IUser.cs | 1 - src/Umbraco.Core/Models/Membership/User.cs | 3 +- src/Umbraco.Core/Models/Rdbms/UserDto.cs | 13 +- .../Persistence/Factories/UserFactory.cs | 8 +- .../Persistence/Mappers/UserMapper.cs | 1 - .../Migrations/Initial/BaseDataCreation.cs | 2 +- ...perty.cs => AlterCmsMacroPropertyTable.cs} | 2 +- ...missionUserColumn.cs => AlterUserTable.cs} | 8 +- src/Umbraco.Core/Services/UserService.cs | 1 - src/Umbraco.Core/Umbraco.Core.csproj | 4 +- .../UmbracoSettings/ContentElementTests.cs | 5 - .../Repositories/UserRepositoryTest.cs | 3 - .../Services/UserServiceTests.cs | 1 - .../TestHelpers/Entities/MockedUser.cs | 1 - .../config/ClientDependency.Release.config | 2 - .../config/ClientDependency.config | 4 +- .../config/umbracoSettings.Release.config | 3 - src/Umbraco.Web.UI/umbraco/config/lang/da.xml | 1 - src/Umbraco.Web.UI/umbraco/config/lang/de.xml | 1 - src/Umbraco.Web.UI/umbraco/config/lang/en.xml | 1 - .../umbraco/config/lang/en_us.xml | 1 - src/Umbraco.Web.UI/umbraco/config/lang/es.xml | 1 - src/Umbraco.Web.UI/umbraco/config/lang/fr.xml | 1 - src/Umbraco.Web.UI/umbraco/config/lang/he.xml | 1 - src/Umbraco.Web.UI/umbraco/config/lang/it.xml | 1 - src/Umbraco.Web.UI/umbraco/config/lang/ja.xml | 1 - src/Umbraco.Web.UI/umbraco/config/lang/ko.xml | 1 - src/Umbraco.Web.UI/umbraco/config/lang/nl.xml | 1 - src/Umbraco.Web.UI/umbraco/config/lang/no.xml | 1 - src/Umbraco.Web.UI/umbraco/config/lang/pl.xml | 1 - src/Umbraco.Web.UI/umbraco/config/lang/pt.xml | 1 - src/Umbraco.Web.UI/umbraco/config/lang/ru.xml | 1 - src/Umbraco.Web.UI/umbraco/config/lang/sv.xml | 1 - src/Umbraco.Web.UI/umbraco/config/lang/zh.xml | 1 - src/Umbraco.Web/Umbraco.Web.csproj | 88 ---- src/Umbraco.Web/UmbracoContext.cs | 10 - .../umbraco.presentation/UmbracoContext.cs | 25 +- .../umbraco.presentation/UmbracoRequest.cs | 3 - .../umbraco.presentation/UmbracoResponse.cs | 3 - .../UmbracoServerUtility.cs | 3 - .../umbraco.presentation/default.aspx.cs | 7 +- .../umbraco.presentation/library.cs | 33 +- .../CanvasClientDependencyProvider.cs | 74 ---- .../LiveEditing/Controls/Communicator.cs | 137 ------ .../Controls/LiveEditingManager.cs | 198 --------- .../Controls/LiveEditingToolbar.cs | 308 ------------- .../LiveEditing/DefaultLiveEditingContext.cs | 183 -------- .../LiveEditing/ILiveEditingContext.cs | 34 -- .../umbraco/LiveEditing/LiveEditing.cd | 65 --- .../Menu/DefaultLiveEditingMenu.cs | 13 - .../LiveEditing/Menu/ILiveEditingMenu.cs | 13 - .../umbraco/LiveEditing/Modules/AddModule.cs | 79 ---- .../umbraco/LiveEditing/Modules/BaseModule.cs | 50 --- .../Modules/CreateModule/CreateModule.cs | 140 ------ .../umbraco/LiveEditing/Modules/CssModule.cs | 72 --- .../Modules/DeleteModule/DeleteModule.cs | 92 ---- .../Modules/ItemEditing/ItemEditor.cs | 414 ------------------ .../Modules/ItemEditing/ItemUpdate.cs | 108 ----- .../ItemEditing/LiveEditingItemRenderer.cs | 167 ------- .../Modules/ItemEditing/PageElementEditor.cs | 262 ----------- .../Modules/MacroModule/MacroModule.cs | 179 -------- .../Modules/MacroModule/TemplateUpdate.cs | 41 -- .../umbraco/LiveEditing/Modules/Separator.cs | 19 - .../Modules/SkinModule/CssParser.aspx | 1 - .../Modules/SkinModule/CssParser.aspx.cs | 59 --- .../SkinModule/CssParser.aspx.designer.cs | 15 - .../Modules/SkinModule/ImageUploader.aspx | 193 -------- .../Modules/SkinModule/ImageUploader.aspx.cs | 181 -------- .../SkinModule/ImageUploader.aspx.designer.cs | 186 -------- .../ModuleInjectionMacroRenderer.aspx | 1 - .../ModuleInjectionMacroRenderer.aspx.cs | 38 -- ...uleInjectionMacroRenderer.aspx.designer.cs | 15 - .../Modules/SkinModule/ModuleInjector.aspx | 141 ------ .../Modules/SkinModule/ModuleInjector.aspx.cs | 103 ----- .../ModuleInjector.aspx.designer.cs | 78 ---- .../Modules/SkinModule/ModuleInstaller.aspx | 1 - .../SkinModule/ModuleInstaller.aspx.cs | 68 --- .../ModuleInstaller.aspx.designer.cs | 15 - .../Modules/SkinModule/ModuleSelector.ascx | 55 --- .../Modules/SkinModule/ModuleSelector.ascx.cs | 102 ----- .../ModuleSelector.ascx.designer.cs | 33 -- .../Modules/SkinModule/SkinCustomizer.ascx | 125 ------ .../Modules/SkinModule/SkinCustomizer.ascx.cs | 369 ---------------- .../SkinCustomizer.ascx.designer.cs | 105 ----- .../Modules/SkinModule/SkinModule.cs | 269 ------------ .../Modules/SkinModule/SkinModule.js | 1 - .../LiveEditing/Modules/SkinModule/skin.png | Bin 3764 -> 0 bytes .../UnpublishModule/UnpublishModule.cs | 107 ----- .../LiveEditing/Updates/DefaultUpdateList.cs | 134 ------ .../umbraco/LiveEditing/Updates/IUpdate.cs | 18 - .../LiveEditing/Updates/IUpdateList.cs | 74 ---- .../umbraco/LiveEditing/Utility.cs | 68 --- .../umbraco/Trees/loadContent.cs | 4 - .../umbraco/canvas.aspx.cs | 51 --- .../umbraco/login.aspx.cs | 31 +- .../umbraco/masterpages/default.Master.cs | 92 +--- .../umbraco/templateControls/Item.cs | 6 +- .../umbraco/users/EditUser.aspx.cs | 17 +- src/umbraco.businesslogic/UmbracoSettings.cs | 10 +- src/umbraco.businesslogic/User.cs | 29 +- src/umbraco.cms/Actions/ActionLiveEdit.cs | 59 --- src/umbraco.cms/umbraco.cms.csproj | 1 - .../BaseTreePickerEditor.cs | 5 +- .../macrocontainer/Editor.cs | 23 +- .../macrocontainer/MacroEditor.cs | 67 +-- .../tinyMCE3/TinyMCE.cs | 3 +- 108 files changed, 78 insertions(+), 5793 deletions(-) rename src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/{AddEditorAliasToCmsMacroProperty.cs => AlterCmsMacroPropertyTable.cs} (95%) rename src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/{RemoveDefaultPermissionUserColumn.cs => AlterUserTable.cs} (54%) delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/CanvasClientDependencyProvider.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Controls/Communicator.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Controls/LiveEditingManager.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Controls/LiveEditingToolbar.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/DefaultLiveEditingContext.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/ILiveEditingContext.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/LiveEditing.cd delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Menu/DefaultLiveEditingMenu.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Menu/ILiveEditingMenu.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/AddModule.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/BaseModule.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/CreateModule/CreateModule.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/CssModule.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/DeleteModule/DeleteModule.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/ItemEditing/ItemEditor.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/ItemEditing/ItemUpdate.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/ItemEditing/LiveEditingItemRenderer.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/ItemEditing/PageElementEditor.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/MacroModule/MacroModule.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/MacroModule/TemplateUpdate.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/Separator.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/CssParser.aspx delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/CssParser.aspx.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/CssParser.aspx.designer.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ImageUploader.aspx delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ImageUploader.aspx.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ImageUploader.aspx.designer.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ModuleInjectionMacroRenderer.aspx delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ModuleInjectionMacroRenderer.aspx.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ModuleInjectionMacroRenderer.aspx.designer.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ModuleInjector.aspx delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ModuleInjector.aspx.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ModuleInjector.aspx.designer.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ModuleInstaller.aspx delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ModuleInstaller.aspx.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ModuleInstaller.aspx.designer.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ModuleSelector.ascx delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ModuleSelector.ascx.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ModuleSelector.ascx.designer.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/SkinCustomizer.ascx delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/SkinCustomizer.ascx.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/SkinCustomizer.ascx.designer.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/SkinModule.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/SkinModule.js delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/skin.png delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/UnpublishModule/UnpublishModule.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Updates/DefaultUpdateList.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Updates/IUpdate.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Updates/IUpdateList.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Utility.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/canvas.aspx.cs delete mode 100644 src/umbraco.cms/Actions/ActionLiveEdit.cs diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/ContentElement.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/ContentElement.cs index 64fdcf82ad..1403617fd7 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/ContentElement.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/ContentElement.cs @@ -18,18 +18,6 @@ namespace Umbraco.Core.Configuration.UmbracoSettings get { return (ContentScriptEditorElement)this["scripteditor"]; } } - [ConfigurationProperty("EnableCanvasEditing")] - internal InnerTextConfigurationElement EnableCanvasEditing - { - get - { - return new OptionalInnerTextConfigurationElement( - (InnerTextConfigurationElement)this["EnableCanvasEditing"], - //set the default - false); - } - } - [ConfigurationProperty("ResolveUrlsFromTextString")] internal InnerTextConfigurationElement ResolveUrlsFromTextString { @@ -330,11 +318,6 @@ namespace Umbraco.Core.Configuration.UmbracoSettings get { return ScriptEditor.ScriptFileTypes; } } - bool IContentSection.EnableCanvasEditing - { - get { return EnableCanvasEditing; } - } - bool IContentSection.ResolveUrlsFromTextString { get { return ResolveUrlsFromTextString; } diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/IContentSection.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/IContentSection.cs index f8c0e02ea9..53cfec5d22 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/IContentSection.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/IContentSection.cs @@ -20,8 +20,6 @@ namespace Umbraco.Core.Configuration.UmbracoSettings bool ScriptEditorDisable { get; } - bool EnableCanvasEditing { get; } - bool ResolveUrlsFromTextString { get; } bool UploadAllowDirectories { get; } diff --git a/src/Umbraco.Core/Models/Membership/IUser.cs b/src/Umbraco.Core/Models/Membership/IUser.cs index 264ccbf1a7..b0ba6817f8 100644 --- a/src/Umbraco.Core/Models/Membership/IUser.cs +++ b/src/Umbraco.Core/Models/Membership/IUser.cs @@ -15,7 +15,6 @@ namespace Umbraco.Core.Models.Membership int StartContentId { get; set; } int StartMediaId { get; set; } string Language { get; set; } - bool DefaultToLiveEditing { get; set; } bool NoConsole { get; set; } IUserType UserType { get; } diff --git a/src/Umbraco.Core/Models/Membership/User.cs b/src/Umbraco.Core/Models/Membership/User.cs index ddcc28cccb..9840c25b98 100644 --- a/src/Umbraco.Core/Models/Membership/User.cs +++ b/src/Umbraco.Core/Models/Membership/User.cs @@ -90,11 +90,10 @@ namespace Umbraco.Core.Models.Membership [DataMember] public string Language { get; set; } + [DataMember] public string DefaultPermissions { get; set; } - [DataMember] - public bool DefaultToLiveEditing { get; set; } [DataMember] public bool NoConsole { get; set; } diff --git a/src/Umbraco.Core/Models/Rdbms/UserDto.cs b/src/Umbraco.Core/Models/Rdbms/UserDto.cs index 6958bd5d37..18f14efdf3 100644 --- a/src/Umbraco.Core/Models/Rdbms/UserDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/UserDto.cs @@ -46,21 +46,12 @@ namespace Umbraco.Core.Models.Rdbms [Column("userEmail")] public string Email { get; set; } - - [Column("userDefaultPermissions")] - [NullSetting(NullSetting = NullSettings.Null)] - [Length(50)] - public string DefaultPermissions { get; set; } - + [Column("userLanguage")] [NullSetting(NullSetting = NullSettings.Null)] [Length(10)] public string UserLanguage { get; set; } - - [Column("defaultToLiveEditing")] - [Constraint(Default = "0")] - public bool DefaultToLiveEditing { get; set; } - + [ResultColumn] public List User2AppDtos { get; set; } } diff --git a/src/Umbraco.Core/Persistence/Factories/UserFactory.cs b/src/Umbraco.Core/Persistence/Factories/UserFactory.cs index c1be1d360b..572bc7e624 100644 --- a/src/Umbraco.Core/Persistence/Factories/UserFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/UserFactory.cs @@ -30,11 +30,10 @@ namespace Umbraco.Core.Persistence.Factories IsLockedOut = dto.Disabled, IsApproved = dto.Disabled == false, Email = dto.Email, - Language = dto.UserLanguage, - DefaultToLiveEditing = dto.DefaultToLiveEditing, + Language = dto.UserLanguage, NoConsole = dto.NoConsole, - //NOTE: The umbracoUser.DefaultPermissions column is never used, the default permission come from the user type's default permissions + //NOTE: The default permission come from the user type's default permissions DefaultPermissions = _userType.Permissions }; @@ -56,7 +55,6 @@ namespace Umbraco.Core.Persistence.Factories { ContentStartId = entity.StartContentId, MediaStartId = entity.StartMediaId, - DefaultToLiveEditing = entity.DefaultToLiveEditing, Disabled = entity.IsApproved == false, Email = entity.Email, Login = entity.Username, @@ -65,8 +63,6 @@ namespace Umbraco.Core.Persistence.Factories UserLanguage = entity.Language, UserName = entity.Name, Type = short.Parse(entity.UserType.Id.ToString(CultureInfo.InvariantCulture)), - //NOTE: This column in the db is *not* used so we'll just let it remain null - DefaultPermissions = null, User2AppDtos = new List() }; diff --git a/src/Umbraco.Core/Persistence/Mappers/UserMapper.cs b/src/Umbraco.Core/Persistence/Mappers/UserMapper.cs index 68bf091fc5..f8bebb32d2 100644 --- a/src/Umbraco.Core/Persistence/Mappers/UserMapper.cs +++ b/src/Umbraco.Core/Persistence/Mappers/UserMapper.cs @@ -37,7 +37,6 @@ namespace Umbraco.Core.Persistence.Mappers //CacheMap(src => src.DefaultPermissions, dto => dto.DefaultPermissions); CacheMap(src => src.StartMediaId, dto => dto.MediaStartId); CacheMap(src => src.StartContentId, dto => dto.ContentStartId); - CacheMap(src => src.DefaultToLiveEditing, dto => dto.DefaultToLiveEditing); CacheMap(src => src.IsApproved, dto => dto.Disabled); CacheMap(src => src.NoConsole, dto => dto.NoConsole); CacheMap(src => src.UserType, dto => dto.Type); diff --git a/src/Umbraco.Core/Persistence/Migrations/Initial/BaseDataCreation.cs b/src/Umbraco.Core/Persistence/Migrations/Initial/BaseDataCreation.cs index 389b6143e5..7fc3b248df 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Initial/BaseDataCreation.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Initial/BaseDataCreation.cs @@ -137,7 +137,7 @@ namespace Umbraco.Core.Persistence.Migrations.Initial private void CreateUmbracoUserData() { - _database.Insert("umbracoUser", "id", false, new UserDto { Id = 0, Disabled = false, NoConsole = false, Type = 1, ContentStartId = -1, MediaStartId = -1, UserName = "Administrator", Login = "admin", Password = "default", Email = "", UserLanguage = "en", DefaultPermissions = null, DefaultToLiveEditing = false }); + _database.Insert("umbracoUser", "id", false, new UserDto { Id = 0, Disabled = false, NoConsole = false, Type = 1, ContentStartId = -1, MediaStartId = -1, UserName = "Administrator", Login = "admin", Password = "default", Email = "", UserLanguage = "en" }); //_database.Update("SET id = @IdAfter WHERE id = @IdBefore AND userLogin = @Login", new { IdAfter = 0, IdBefore = 1, Login = "admin" }); } diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AddEditorAliasToCmsMacroProperty.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AlterCmsMacroPropertyTable.cs similarity index 95% rename from src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AddEditorAliasToCmsMacroProperty.cs rename to src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AlterCmsMacroPropertyTable.cs index b1a7fd0816..c93b095e69 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AddEditorAliasToCmsMacroProperty.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AlterCmsMacroPropertyTable.cs @@ -9,7 +9,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven /// editorAlias column (and maintaing data so we can reference it) /// [Migration("7.0.0", 5, GlobalSettings.UmbracoMigrationName)] - public class AddEditorAliasToCmsMacroProperty : MigrationBase + public class AlterCmsMacroPropertyTable : MigrationBase { public override void Up() { diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/RemoveDefaultPermissionUserColumn.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AlterUserTable.cs similarity index 54% rename from src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/RemoveDefaultPermissionUserColumn.cs rename to src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AlterUserTable.cs index b80a002a74..72ea0362f7 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/RemoveDefaultPermissionUserColumn.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSeven/AlterUserTable.cs @@ -4,11 +4,15 @@ using Umbraco.Core.Configuration; namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven { [Migration("7.0.0", 2, GlobalSettings.UmbracoMigrationName)] - public class RemoveDefaultPermissionUserColumn : MigrationBase + public class AlterUserTable : MigrationBase { public override void Up() { - //Delete.Column("userDefaultPermissions").FromTable("umbracoUser"); + Delete.Column("userDefaultPermissions").FromTable("umbracoUser"); + + //"[DF_umbracoUser_defaultToLiveEditing]"" + Delete.DefaultConstraint().OnTable("umbracoUser").OnColumn("defaultToLiveEditing"); + Delete.Column("defaultToLiveEditing").FromTable("umbracoUser"); } public override void Down() diff --git a/src/Umbraco.Core/Services/UserService.cs b/src/Umbraco.Core/Services/UserService.cs index 421283e3e1..b725e7e123 100644 --- a/src/Umbraco.Core/Services/UserService.cs +++ b/src/Umbraco.Core/Services/UserService.cs @@ -220,7 +220,6 @@ namespace Umbraco.Core.Services var user = new User(userType) { - DefaultToLiveEditing = false, Email = email, Language = Umbraco.Core.Configuration.GlobalSettings.DefaultUILanguage, Name = name, diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj index e2f9310ac2..1c931e7b7c 100644 --- a/src/Umbraco.Core/Umbraco.Core.csproj +++ b/src/Umbraco.Core/Umbraco.Core.csproj @@ -406,11 +406,11 @@ - + - + diff --git a/src/Umbraco.Tests/Configurations/UmbracoSettings/ContentElementTests.cs b/src/Umbraco.Tests/Configurations/UmbracoSettings/ContentElementTests.cs index 866f9b1884..99cf4a7614 100644 --- a/src/Umbraco.Tests/Configurations/UmbracoSettings/ContentElementTests.cs +++ b/src/Umbraco.Tests/Configurations/UmbracoSettings/ContentElementTests.cs @@ -145,11 +145,6 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings Assert.IsTrue(SettingsSection.Content.PropertyContextHelpOption == "text"); } [Test] - public void EnableCanvasEditing() - { - Assert.IsTrue(SettingsSection.Content.EnableCanvasEditing == false); - } - [Test] public void PreviewBadge() { Assert.IsTrue(SettingsSection.Content.PreviewBadge == @"In Preview Mode - click to end"); diff --git a/src/Umbraco.Tests/Persistence/Repositories/UserRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/UserRepositoryTest.cs index 1c269b1be9..5425a99f5e 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/UserRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/UserRepositoryTest.cs @@ -142,7 +142,6 @@ namespace Umbraco.Tests.Persistence.Repositories resolved.NoConsole = true; resolved.StartContentId = 10; resolved.StartMediaId = 11; - resolved.DefaultToLiveEditing = true; resolved.Email = "new@new.com"; resolved.Username = "newName"; resolved.RemoveAllowedSection("content"); @@ -161,7 +160,6 @@ namespace Umbraco.Tests.Persistence.Repositories Assert.That(updatedItem.NoConsole, Is.EqualTo(resolved.NoConsole)); Assert.That(updatedItem.StartContentId, Is.EqualTo(resolved.StartContentId)); Assert.That(updatedItem.StartMediaId, Is.EqualTo(resolved.StartMediaId)); - Assert.That(updatedItem.DefaultToLiveEditing, Is.EqualTo(resolved.DefaultToLiveEditing)); Assert.That(updatedItem.Email, Is.EqualTo(resolved.Email)); Assert.That(updatedItem.Username, Is.EqualTo(resolved.Username)); Assert.That(updatedItem.AllowedSections.Count(), Is.EqualTo(1)); @@ -515,7 +513,6 @@ namespace Umbraco.Tests.Persistence.Repositories Assert.That(updatedItem.NoConsole, Is.EqualTo(originalUser.NoConsole)); Assert.That(updatedItem.StartContentId, Is.EqualTo(originalUser.StartContentId)); Assert.That(updatedItem.StartMediaId, Is.EqualTo(originalUser.StartMediaId)); - Assert.That(updatedItem.DefaultToLiveEditing, Is.EqualTo(originalUser.DefaultToLiveEditing)); Assert.That(updatedItem.Email, Is.EqualTo(originalUser.Email)); Assert.That(updatedItem.Username, Is.EqualTo(originalUser.Username)); Assert.That(updatedItem.AllowedSections.Count(), Is.EqualTo(2)); diff --git a/src/Umbraco.Tests/Services/UserServiceTests.cs b/src/Umbraco.Tests/Services/UserServiceTests.cs index b36520d927..429404034a 100644 --- a/src/Umbraco.Tests/Services/UserServiceTests.cs +++ b/src/Umbraco.Tests/Services/UserServiceTests.cs @@ -214,7 +214,6 @@ namespace Umbraco.Tests.Services Assert.That(updatedItem.NoConsole, Is.EqualTo(originalUser.NoConsole)); Assert.That(updatedItem.StartContentId, Is.EqualTo(originalUser.StartContentId)); Assert.That(updatedItem.StartMediaId, Is.EqualTo(originalUser.StartMediaId)); - Assert.That(updatedItem.DefaultToLiveEditing, Is.EqualTo(originalUser.DefaultToLiveEditing)); Assert.That(updatedItem.Email, Is.EqualTo(originalUser.Email)); Assert.That(updatedItem.Username, Is.EqualTo(originalUser.Username)); Assert.That(updatedItem.AllowedSections.Count(), Is.EqualTo(0)); diff --git a/src/Umbraco.Tests/TestHelpers/Entities/MockedUser.cs b/src/Umbraco.Tests/TestHelpers/Entities/MockedUser.cs index b29b475689..65725a63c3 100644 --- a/src/Umbraco.Tests/TestHelpers/Entities/MockedUser.cs +++ b/src/Umbraco.Tests/TestHelpers/Entities/MockedUser.cs @@ -22,7 +22,6 @@ namespace Umbraco.Tests.TestHelpers.Entities DefaultPermissions = "ABC", StartContentId = -1, StartMediaId = -1, - DefaultToLiveEditing = false, Email = "test" + suffix + "@test.com", Username = "TestUser" + suffix }; diff --git a/src/Umbraco.Web.UI/config/ClientDependency.Release.config b/src/Umbraco.Web.UI/config/ClientDependency.Release.config index d031ac1eb6..1cce8a4204 100644 --- a/src/Umbraco.Web.UI/config/ClientDependency.Release.config +++ b/src/Umbraco.Web.UI/config/ClientDependency.Release.config @@ -23,8 +23,6 @@ NOTES: - - diff --git a/src/Umbraco.Web.UI/config/ClientDependency.config b/src/Umbraco.Web.UI/config/ClientDependency.config index 9aed0f5518..33970c4f69 100644 --- a/src/Umbraco.Web.UI/config/ClientDependency.config +++ b/src/Umbraco.Web.UI/config/ClientDependency.config @@ -10,7 +10,7 @@ NOTES: * Compression/Combination/Minification is not enabled unless debug="false" is specified on the 'compiliation' element in the web.config * A new version will invalidate both client and server cache and create new persisted files --> - + - diff --git a/src/Umbraco.Web.UI/config/umbracoSettings.Release.config b/src/Umbraco.Web.UI/config/umbracoSettings.Release.config index 13e09c4ce3..36e85d567a 100644 --- a/src/Umbraco.Web.UI/config/umbracoSettings.Release.config +++ b/src/Umbraco.Web.UI/config/umbracoSettings.Release.config @@ -72,9 +72,6 @@ text - - false - In Preview Mode - click to end]]> diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/da.xml b/src/Umbraco.Web.UI/umbraco/config/lang/da.xml index 7951e3995d..f042148b92 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/da.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/da.xml @@ -721,7 +721,6 @@ Mange hilsner fra umbraco robotten Skift dit kodeord Du kan ændre dit kodeord, som giver dig adgang til Umbraco Back Office ved at udfylde formularen og klikke på knappen 'Skift dit kodeord' Indholdskanal - Skift til Canvas ved login Beskrivelsesfelt Deaktivér User Dokumenttype diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/de.xml b/src/Umbraco.Web.UI/umbraco/config/lang/de.xml index e1b0c1c929..ad26262d2e 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/de.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/de.xml @@ -818,7 +818,6 @@ Ihr freundlicher Umbraco-Robot Kennwort ändern Sie können Ihr Kennwort für den Zugriff auf den Umbraco-Verwaltungsbereich ändern, indem Sie das nachfolgende Formular ausfüllen und auf die 'Kennwort ändern'-Schaltfläche klicken Schnittstelle für externe Editoren - Nach dem Anmelden direkt zum 'Canvas'-Modus wechseln Feld für Beschreibung Benutzer endgültig deaktivieren Dokumenttyp diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/en.xml b/src/Umbraco.Web.UI/umbraco/config/lang/en.xml index 18307882f6..2cdbe6c463 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/en.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/en.xml @@ -911,7 +911,6 @@ To manage your website, simply open the umbraco back office and start adding con Confirm new password You can change your password for accessing the Umbraco Back Office by filling out the form below and click the 'Change Password' button Content Channel - Redirect to canvas on login Description field Disable User Document Type 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 fccee0ba38..1a21b2f596 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml @@ -960,7 +960,6 @@ To manage your website, simply open the umbraco back office and start adding con Confirm new password You can change your password for accessing the Umbraco Back Office by filling out the form below and click the 'Change Password' button Content Channel - Redirect to canvas on login Description field Disable User Document Type diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/es.xml b/src/Umbraco.Web.UI/umbraco/config/lang/es.xml index 58c11a3c5f..c69b42522c 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/es.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/es.xml @@ -718,7 +718,6 @@ However, Runway offers an easy foundation based on best practices to get you sta TRANSLATE ME: 'Change Your Password' TRANSLATE ME: 'You can change your password for accessing the Umbraco Back Office by filling out the form below and click the 'Change Password' button' Canal de contenido - Redirigir al canvas al entrar Campo descriptivo Deshabilitar usuario Tipo de documento diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/fr.xml b/src/Umbraco.Web.UI/umbraco/config/lang/fr.xml index c1de4bb6dc..0f10085ab9 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/fr.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/fr.xml @@ -919,7 +919,6 @@ Pour gerer votre site, accéder simplement au back office et commencez à contri Confirmer votre nouveau mot de passe Vous pouvez modifier votre mot de passe pour accéder au backoffice d'Umbraco en remplissant le formulaire ci-dessous et en cliquant sur le bouton 'Change Password' Section contenu - Rediriger en mode edition live après l'authentification Champ description Désactiver l'utilisateur Type de document diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/he.xml b/src/Umbraco.Web.UI/umbraco/config/lang/he.xml index 05fa3c1476..066804d191 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/he.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/he.xml @@ -836,7 +836,6 @@ To manage your website, simply open the umbraco back office and start adding con שנה את הסיסמה שלך בעמוד זה ניתן לשנות את הסיסמה שלך ולאחר מכן ללחוץ על הכפתור 'שנה סיסמה' למטה ערוץ תוכן - לאחר כניסה למערכת הפנה אוטומטית למצב עריכה "קנבס" שדה תיאור נטרל משתמש שדה מסמך diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/it.xml b/src/Umbraco.Web.UI/umbraco/config/lang/it.xml index f9f86be651..8cecd7bbb7 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/it.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/it.xml @@ -816,7 +816,6 @@ Per gestire il tuo sito web, è sufficiente aprire il back office di Umbraco e i Conferma la nuova password Contenuto del canale - Ridireziona al canvas al login Campo Descrizione Disabilita l'utente Tipo di Documento diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/ja.xml b/src/Umbraco.Web.UI/umbraco/config/lang/ja.xml index 819461321b..330886f493 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/ja.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/ja.xml @@ -857,7 +857,6 @@ Runwayをインストールして作られた新しいウェブサイトがど 新パスワードの確認 Umbracoの管理画面にアクセスするためのパスワードを変更するには、以下のフォームに新しいパスワード入力して「パスワードの変更」ボタンをクリックしてください。 コンテントチャンネル - ログオン後ライブ編集にリダイレクト 概要フィールド ユーザーを無効にする ドキュメントタイプ diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/ko.xml b/src/Umbraco.Web.UI/umbraco/config/lang/ko.xml index 8e9c1ef827..0212898dff 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/ko.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/ko.xml @@ -819,7 +819,6 @@ Change Your Password You can change your password for accessing the Umbraco Back Office by filling out the form below and click the 'Change Password' button 컨텐츠 채널 - 로그인시 canvas로 리다이렉트 설명 필드 사용자 비활성화 문서 타입 diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/nl.xml b/src/Umbraco.Web.UI/umbraco/config/lang/nl.xml index c2ce3fae8f..39c7f53647 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/nl.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/nl.xml @@ -781,7 +781,6 @@ Om een vertalingstaak te sluiten, ga aub naar het detailoverzicht en klik op de Verander je wachtwoord Je kunt je wachtwoord veranderen door onderstaan formulier in te vullen en op de knop 'Verander wachtwoord' te klikken Content Channel - Doorlinken naar Canvas bij inloggen Omschrijving Geblokkeerde gebruiker Documenttype diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/no.xml b/src/Umbraco.Web.UI/umbraco/config/lang/no.xml index 3ff64211bb..4e76541b2e 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/no.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/no.xml @@ -788,7 +788,6 @@ Vennlig hilsen umbraco roboten Bytt passord Du kan endre passordet til Umbraco ved å fylle ut skjemaet under og klikke "Bytt passord" knappen. Innholdskanal - Videresend til Canvas ved login Beskrivelsesfelt Deaktiver bruker Dokumenttype diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/pl.xml b/src/Umbraco.Web.UI/umbraco/config/lang/pl.xml index 996998c706..65ecae12a3 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/pl.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/pl.xml @@ -711,7 +711,6 @@ Miłego dnia!]]> TRANSLATE ME: 'Change Your Password' TRANSLATE ME: 'You can change your password for accessing the Umbraco Back Office by filling out the form below and click the 'Change Password' button' Zawartość - Przekieruj do logowania online Opis Wyłącz użytkownika Typ dokumentu diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/pt.xml b/src/Umbraco.Web.UI/umbraco/config/lang/pt.xml index 3653a60101..f795e16d3c 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/pt.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/pt.xml @@ -803,7 +803,6 @@ Para fechar a tarefa de tradução vá até os detalhes e clique no botão "Fech Alterar Sua Senha você pode alterar sua senha para acessar a área administrativa do Umbraco preenchendo o formulário abaixo e clicando no botão 'Alterar Senha' Canal de Conteúdo - Redirecionar à Tela de Edição após login Campo de descrição Desabilitar Usuário Tipo de Documento diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/ru.xml b/src/Umbraco.Web.UI/umbraco/config/lang/ru.xml index 547a653f3d..2bbadf234a 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/ru.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/ru.xml @@ -888,7 +888,6 @@ Вы можете сменить свой пароль для доступа к административной панели Umbraco, заполнив нижеследующие поля и нажав на кнопку 'Изменить пароль' Подтверждение нового пароля Канал содержимого - При входе перевести в режим редактирования "на месте" Поле описания Отключить пользователя Тип документа diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/sv.xml b/src/Umbraco.Web.UI/umbraco/config/lang/sv.xml index 19c4601348..99f34163b5 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/sv.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/sv.xml @@ -745,7 +745,6 @@ Du kan byta ditt lösenord för Umbraco Back Office genom att fylla i nedanstående formulär och klicka på knappen "Ändra lösenord". Bekräfta det nya lösenordet Innehållskanal - Gå direkt till Canvas efter inloggning Fält för beskrivning Avaktivera användare Dokumenttyp diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/zh.xml b/src/Umbraco.Web.UI/umbraco/config/lang/zh.xml index a586389379..49213b98c9 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/zh.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/zh.xml @@ -850,7 +850,6 @@ 要改变密码,请在框中输入新密码,然后单击“更改密码”。 确认新密码 内容频道 - 登录后进入实时编辑模式 描述字段 禁用用户 文档类型 diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index ec8dec8fdf..12a6f1dc7d 100644 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -684,9 +684,6 @@ ASPXCodeBehind - - ASPXCodeBehind - ASPXCodeBehind @@ -1120,59 +1117,6 @@ TemplateSkinning.aspx - - Code - - - CssParser.aspx - ASPXCodeBehind - - - CssParser.aspx - - - ImageUploader.aspx - ASPXCodeBehind - - - ImageUploader.aspx - - - ModuleInjectionMacroRenderer.aspx - ASPXCodeBehind - - - ModuleInjectionMacroRenderer.aspx - - - ModuleInjector.aspx - ASPXCodeBehind - - - ModuleInjector.aspx - - - ModuleInstaller.aspx - ASPXCodeBehind - - - ModuleInstaller.aspx - - - ModuleSelector.ascx - ASPXCodeBehind - - - ModuleSelector.ascx - - - SkinCustomizer.ascx - ASPXCodeBehind - - - SkinCustomizer.ascx - - MemberSearch.ascx ASPXCodeBehind @@ -1495,28 +1439,6 @@ language.aspx - - - - - - - - - - - - - - - - - - - - - - EditMember.aspx ASPXCodeBehind @@ -1950,15 +1872,6 @@ ASPXCodeBehind - - - - - ASPXCodeBehind - - - - ASPXCodeBehind @@ -2067,7 +1980,6 @@ SettingsSingleFileGenerator Settings1.Designer.cs - diff --git a/src/Umbraco.Web/UmbracoContext.cs b/src/Umbraco.Web/UmbracoContext.cs index be62950600..f479cc3ac6 100644 --- a/src/Umbraco.Web/UmbracoContext.cs +++ b/src/Umbraco.Web/UmbracoContext.cs @@ -1,22 +1,12 @@ using System; using System.Web; using Umbraco.Core; -using Umbraco.Core.Services; -using Umbraco.Core.CodeAnnotations; using Umbraco.Web.PublishedCache; using Umbraco.Web.Routing; using Umbraco.Web.Security; using umbraco; -using umbraco.IO; -using umbraco.presentation; -using umbraco.presentation.LiveEditing; -using umbraco.BasePages; -using umbraco.cms.businesslogic.web; using umbraco.BusinessLogic; -using System.Xml; using umbraco.presentation.preview; -using Examine.Providers; -using Examine; using IOHelper = Umbraco.Core.IO.IOHelper; using SystemDirectories = Umbraco.Core.IO.SystemDirectories; diff --git a/src/Umbraco.Web/umbraco.presentation/UmbracoContext.cs b/src/Umbraco.Web/umbraco.presentation/UmbracoContext.cs index e4570e54ee..612427d18a 100644 --- a/src/Umbraco.Web/umbraco.presentation/UmbracoContext.cs +++ b/src/Umbraco.Web/umbraco.presentation/UmbracoContext.cs @@ -1,10 +1,8 @@ using System; using System.Web; using Umbraco.Core.Configuration; -using umbraco.presentation.LiveEditing; using umbraco.BasePages; using umbraco.cms.businesslogic.web; -using System.Xml.Linq; using umbraco.BusinessLogic; using System.Xml; using umbraco.presentation.preview; @@ -115,28 +113,7 @@ namespace umbraco.presentation return !UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema; } } - - /// - /// Gets the current Live Editing Context. - /// - public virtual ILiveEditingContext LiveEditingContext - { - get - { - ILiveEditingContext value = (ILiveEditingContext)_httpContext.Items["LiveEditingContext"]; - if (value == null) - { - LiveEditingContext = value = new DefaultLiveEditingContext(); - } - return value; - } - - set - { - _httpContext.Items["LiveEditingContext"] = value; - } - } - + /// /// Gets the response for the current context /// diff --git a/src/Umbraco.Web/umbraco.presentation/UmbracoRequest.cs b/src/Umbraco.Web/umbraco.presentation/UmbracoRequest.cs index 5b6207654b..1201bb6a5e 100644 --- a/src/Umbraco.Web/umbraco.presentation/UmbracoRequest.cs +++ b/src/Umbraco.Web/umbraco.presentation/UmbracoRequest.cs @@ -1,8 +1,5 @@ using System; using System.Web; -using umbraco.presentation.LiveEditing; -using umbraco.BasePages; -using umbraco.cms.businesslogic.web; namespace umbraco.presentation { diff --git a/src/Umbraco.Web/umbraco.presentation/UmbracoResponse.cs b/src/Umbraco.Web/umbraco.presentation/UmbracoResponse.cs index 33abc4d5cf..e7168e8735 100644 --- a/src/Umbraco.Web/umbraco.presentation/UmbracoResponse.cs +++ b/src/Umbraco.Web/umbraco.presentation/UmbracoResponse.cs @@ -1,8 +1,5 @@ using System; using System.Web; -using umbraco.presentation.LiveEditing; -using umbraco.BasePages; -using umbraco.cms.businesslogic.web; namespace umbraco.presentation { diff --git a/src/Umbraco.Web/umbraco.presentation/UmbracoServerUtility.cs b/src/Umbraco.Web/umbraco.presentation/UmbracoServerUtility.cs index dabed36edf..b50fddc254 100644 --- a/src/Umbraco.Web/umbraco.presentation/UmbracoServerUtility.cs +++ b/src/Umbraco.Web/umbraco.presentation/UmbracoServerUtility.cs @@ -1,8 +1,5 @@ using System; using System.Web; -using umbraco.presentation.LiveEditing; -using umbraco.BasePages; -using umbraco.cms.businesslogic.web; using System.Xml.Linq; using umbraco.IO; using umbraco.presentation.preview; diff --git a/src/Umbraco.Web/umbraco.presentation/default.aspx.cs b/src/Umbraco.Web/umbraco.presentation/default.aspx.cs index f19c8fd5f6..8a44676516 100644 --- a/src/Umbraco.Web/umbraco.presentation/default.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/default.aspx.cs @@ -123,11 +123,8 @@ namespace umbraco using (DisposableTimer.DebugDuration("Load")) { base.OnLoad(e); - - // do not validate when liveEditing because there may be a RTE with markup - var liveEditing = umbraco.presentation.UmbracoContext.Current.LiveEditingContext.Enabled; - - if (!liveEditing && ValidateRequest) + + if (ValidateRequest) Request.ValidateInput(); } } diff --git a/src/Umbraco.Web/umbraco.presentation/library.cs b/src/Umbraco.Web/umbraco.presentation/library.cs index abfe246202..111d62cde5 100644 --- a/src/Umbraco.Web/umbraco.presentation/library.cs +++ b/src/Umbraco.Web/umbraco.presentation/library.cs @@ -982,27 +982,20 @@ namespace umbraco { if (UmbracoConfiguration.Current.UmbracoSettings.Templates.UseAspNetMasterPages) { - if (!UmbracoContext.Current.LiveEditingContext.Enabled) - { - using (var sw = new StringWriter()) - { - try - { - var altTemplate = TemplateId == -1 ? null : (int?)TemplateId; - var templateRenderer = new TemplateRenderer(Umbraco.Web.UmbracoContext.Current, PageId, altTemplate); - templateRenderer.Render(sw); - } - catch (Exception ee) - { - sw.Write("", PageId, ee); - } - - return sw.ToString(); - } - } - else + using (var sw = new StringWriter()) { - return "RenderTemplate not supported in Canvas"; + try + { + var altTemplate = TemplateId == -1 ? null : (int?)TemplateId; + var templateRenderer = new TemplateRenderer(Umbraco.Web.UmbracoContext.Current, PageId, altTemplate); + templateRenderer.Render(sw); + } + catch (Exception ee) + { + sw.Write("", PageId, ee); + } + + return sw.ToString(); } } else diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/CanvasClientDependencyProvider.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/CanvasClientDependencyProvider.cs deleted file mode 100644 index a90f1c134b..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/CanvasClientDependencyProvider.cs +++ /dev/null @@ -1,74 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using ClientDependency.Core; -using ClientDependency.Core.FileRegistration.Providers; -using umbraco.presentation; - -namespace umbraco.presentation.LiveEditing -{ - public class CanvasClientDependencyProvider : LazyLoadProvider - { - public new const string DefaultName = "CanvasProvider"; - - /// - /// override to never render out the dependency handler address (no compression, combination, etc...) - /// - /// - /// - /// - /// - protected override string RenderJsDependencies(IEnumerable jsDependencies, System.Web.HttpContextBase http, IDictionary htmlAttributes) - { - if (!jsDependencies.Any()) - return string.Empty; - - var sb = new StringBuilder(); - - foreach (var dependency in jsDependencies) - { - sb.Append(RenderSingleJsFile(string.Format("'{0}','{1}'", dependency.FilePath, string.Empty), new Dictionary())); - } - - return sb.ToString(); - } - - /// - /// override to never render out the dependency handler address (no compression, combination, etc...) - /// - /// - /// - /// - /// - protected override string RenderCssDependencies(IEnumerable cssDependencies, System.Web.HttpContextBase http, IDictionary htmlAttributes) - { - if (!cssDependencies.Any()) - return string.Empty; - - var sb = new StringBuilder(); - - foreach (var dependency in cssDependencies) - { - sb.Append(RenderSingleCssFile(dependency.FilePath, new Dictionary())); - } - - return sb.ToString(); - } - - protected override string RenderSingleCssFile(string css, IDictionary htmlAttributes) - { - if (UmbracoContext.Current.LiveEditingContext.Enabled) - return base.RenderSingleCssFile(css, new Dictionary()); - return string.Empty; - } - - protected override string RenderSingleJsFile(string js, IDictionary htmlAttributes) - { - if (UmbracoContext.Current.LiveEditingContext.Enabled) - return base.RenderSingleJsFile(js, new Dictionary()); - return string.Empty; - } - - } -} \ No newline at end of file diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Controls/Communicator.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Controls/Communicator.cs deleted file mode 100644 index 2fbbb3f1c2..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Controls/Communicator.cs +++ /dev/null @@ -1,137 +0,0 @@ -using System; -using System.Web.UI; -using System.Web.UI.WebControls; -using ClientDependency.Core; - -namespace umbraco.presentation.LiveEditing.Controls -{ - /// - /// Control that can receive messages from the client. - /// - [ClientDependency(100, ClientDependencyType.Javascript, "LiveEditing/Controls/Communicator.js", "UmbracoRoot")] - public class Communicator : Control - { - /// - /// Occurs when the communicator receives a message from the client. - /// - public event EventHandler MessageReceived; - - private UpdatePanel m_MainPanel; - private TextBox m_TypeBox; - private TextBox m_MessageBox; - private Button m_SubmitButton; - - /// - /// Raises the event. - /// - /// An object that contains the event data. - protected override void OnInit(EventArgs e) - { - base.OnInit(e); - EnsureChildControls(); - } - - /// - /// Called by the ASP.NET page framework to notify server controls - /// that use composition-based implementation to create any child controls - /// they contain in preparation for posting back or rendering. - /// - protected override void CreateChildControls() - { - base.CreateChildControls(); - - m_MainPanel = new UpdatePanel(); - m_MainPanel.RenderMode = UpdatePanelRenderMode.Inline; - - // The next two lines ensure that nothing is sent to the client, - // as there's no information to send anyway. This reduces overhead. - m_MainPanel.UpdateMode = UpdatePanelUpdateMode.Conditional; - m_MainPanel.ChildrenAsTriggers = false; - - Controls.Add(m_MainPanel); - - m_TypeBox = new TextBox(); - m_TypeBox.ID = "Type"; - m_TypeBox.EnableViewState = false; - m_TypeBox.ValidationGroup = "Communicator"; - m_MainPanel.ContentTemplateContainer.Controls.Add(m_TypeBox); - - m_MessageBox = new TextBox(); - m_MessageBox.ID = "Message"; - m_MessageBox.EnableViewState = false; - m_MessageBox.ValidationGroup = "Communicator"; - m_MainPanel.ContentTemplateContainer.Controls.Add(m_MessageBox); - - m_SubmitButton = new Button(); - m_SubmitButton.ID = "Submit"; - m_MessageBox.EnableViewState = false; - m_SubmitButton.ValidationGroup = "Communicator"; - m_SubmitButton.Click += new EventHandler(SubmitButton_Click); - m_MainPanel.ContentTemplateContainer.Controls.Add(m_SubmitButton); - - } - - /// - /// Handles the Click event of the m_SubmitButton control. - /// - /// The source of the event. - /// The instance containing the event data. - protected void SubmitButton_Click(object sender, EventArgs e) - { - if (MessageReceived != null) - MessageReceived(this, new MesssageReceivedArgs(m_TypeBox.Text, m_MessageBox.Text)); - } - - /// - /// Sends server control content to a provided object, - /// which writes the content to be rendered on the client. - /// - /// - /// The - /// object that receives the server control content. - /// - protected override void Render(HtmlTextWriter writer) - { - // Write opening tag, not using RenderBeginTag to avoid whitespace being rendered. - // This makes m_MainPanel the first element of the div on all browsers. - writer.AddAttribute(HtmlTextWriterAttribute.Class, "communicator"); - writer.WriteBeginTag("div"); - writer.WriteAttribute("class", "communicator"); - writer.WriteAttribute("style", "display: none;"); - writer.Write(HtmlTextWriter.TagRightChar); - - m_MainPanel.RenderControl(writer); - - writer.WriteEndTag("div"); - } - } - - /// - /// Arguments for the event. - /// - public class MesssageReceivedArgs : EventArgs - { - /// - /// Gets or sets the type of the message. - /// - /// The type. - public virtual string Type { get; protected set; } - - /// - /// Gets or sets the message text. - /// - /// The message. - public virtual string Message { get; protected set; } - - /// - /// Initializes a new instance of the class. - /// - /// The type. - /// The message text. - public MesssageReceivedArgs(string type, string message) - { - Type = type; - Message = message; - } - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Controls/LiveEditingManager.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Controls/LiveEditingManager.cs deleted file mode 100644 index a4b6fd7e0d..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Controls/LiveEditingManager.cs +++ /dev/null @@ -1,198 +0,0 @@ -using System; -using System.Web; -using System.Web.UI; -using System.Web.UI.WebControls; -using umbraco.presentation.LiveEditing.Modules.ItemEditing; -using ClientDependency.Core; -using ClientDependency.Core.Controls; -using umbraco.BasePages; -using System.Collections.Generic; -using umbraco.uicontrols; -using ClientDependency.Core.FileRegistration.Providers; - -namespace umbraco.presentation.LiveEditing.Controls -{ - /// - /// Control that manages Live Editing on a certain page. - /// Provides public properties, events and methods for Live Editing controls. - /// Add this control to a (master) page to enable Live Editing. - /// - [ClientDependency(0, ClientDependencyType.Javascript, "Application/NamespaceManager.js", "UmbracoClient")] - [ClientDependency(1, ClientDependencyType.Css, "LiveEditing/CSS/LiveEditing.css", "UmbracoRoot")] - [ClientDependency(1, ClientDependencyType.Javascript, "ui/jquery.js", "UmbracoClient")] - [ClientDependency(2, ClientDependencyType.Javascript, "Application/JQuery/jquery.noconflict-invoke.js", "UmbracoClient")] - [ClientDependency(3, ClientDependencyType.Javascript, "js/UmbracoSpeechBubble.js", "UmbracoRoot")] - [ClientDependency(4, ClientDependencyType.Javascript, "js/UmbracoSpeechBubbleInit.js", "UmbracoRoot")] - [ClientDependency(10, ClientDependencyType.Javascript, "Application/UmbracoUtils.js", "UmbracoClient")] - [ClientDependency(20, ClientDependencyType.Javascript, "Application/UmbracoClientManager.js", "UmbracoClient")] - public class LiveEditingManager : Control - { - - #region Private Fields - - /// The associated Live Editing context. - private readonly ILiveEditingContext m_Context; - - /// Toolbar instance. - private LiveEditingToolbar m_Toolbar; - - /// Communicator instance. - private Communicator m_Communicator; - - /// Placeholder to which dynamic output can be added. - private PlaceHolder m_Output; - - #endregion - - #region Public Properties - - /// - /// Gets the associated Live Editing context. - /// - /// The Live Editing context. - public ILiveEditingContext LiveEditingContext - { - get { return m_Context; } - } - - #endregion - - #region Public Events - - /// - /// Occurs when a message is received from the client. - /// - public event EventHandler MessageReceived - { - add { m_Communicator.MessageReceived += value; } - remove { m_Communicator.MessageReceived -= value; } - } - - #endregion - - #region Public Constructor - - /// - /// Initializes a new instance of the class. - /// - /// The context. - public LiveEditingManager(ILiveEditingContext context) - { - if (context == null) - throw new ArgumentNullException("context"); - if (!context.Enabled) - throw new ApplicationException("Live Editing is not enabled."); - - m_Context = context; - } - - #endregion - - #region Control Members - - /// - /// Raises the event. - /// - /// An object that contains the event data. - protected override void OnInit(EventArgs e) - { - base.OnInit(e); - - EnsureChildControls(); - } - - protected override void OnPreRender(EventArgs e) - { - base.OnPreRender(e); - } - - /// - /// Called by the ASP.NET page framework to notify server controls - /// that use composition-based implementation to create any child controls - /// they contain in preparation for posting back or rendering. - /// - protected override void CreateChildControls() - { - base.CreateChildControls(); - - //we need a DependencyLoader control - bool isNew; - UmbracoClientDependencyLoader.TryCreate(this, out isNew); - //force it to use the canvas provider - ClientDependencyLoader.Instance.ProviderName = CanvasClientDependencyProvider.DefaultName; - - m_Communicator = new Communicator(); - m_Communicator.ID = "Communicator"; - Controls.Add(m_Communicator); - - m_Toolbar = new LiveEditingToolbar(this); - m_Toolbar.ID = "Toolbar"; - Controls.Add(m_Toolbar); - - UpdatePanel m_OutputWrapper = new UpdatePanel(); - m_OutputWrapper.ID = "OutputWrapper"; - Controls.Add(m_OutputWrapper); - m_Output = new PlaceHolder(); - m_Output.ID = "Output"; - m_OutputWrapper.ContentTemplateContainer.Controls.Add(m_Output); - } - - #endregion - - #region Public Methods - - /// - /// Adds a control to the client output. - /// - /// The control to add. - public virtual void AddClientOutput(Control output) - { - m_Output.Controls.Add(output); - } - - /// - /// Shows a balloon message on the client side. - /// - /// Unescaped title text. - /// Unescaped message text. - /// The icon. - [Obsolete("Use the ClientTools library instead: 'ShowSpeechBubble' method.")] - public virtual void DisplayUserMessage(string title, string message, string icon) - { - - BasePage.speechBubbleIcon ico = BasePage.speechBubbleIcon.info; - try - { - ico = (BasePage.speechBubbleIcon)(Enum.Parse(typeof(BasePage.speechBubbleIcon), icon)); - } - catch { } - - //TODO: Client tools does not work for this implementation since it is relying on the fact that the speech bubble script is - //already loaded and is normally using the UmbracoSpeechBubbleBackEnd.js which is slightly different than the one needed for live - //editing since it's doing some lazy loading with js! - //ClientTools cTools = new ClientTools(Page); - //cTools.ShowSpeechBubble(BasePage.speechBubbleIcon.info, title, message); - - - ScriptManager.RegisterClientScriptBlock(Page, GetType(), new Guid().ToString(), - string.Concat("var sbTimer = setInterval(function() { if (typeof(UmbSpeechBubble) != 'undefined') {UmbSpeechBubble.ShowMessage('", EscapeJavascriptString(icon), "','", EscapeJavascriptString(title), "','", EscapeJavascriptString(message), "'); clearInterval(sbTimer); } }, 100);"), true); - } - - #endregion - - #region Protected Methods - - /// - /// Escapes a Javascript string for use inside a single quoted Javascript literal. - /// - /// The input. - /// The escaped Javascript string. - /// Escaping only concerns slashes, returns and single quotes. This might not be complete. - protected virtual string EscapeJavascriptString(string input) - { - return input.Replace(@"\", @"\\").Replace("\n", @"\n").Replace(@"'", @"\'"); - } - - #endregion - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Controls/LiveEditingToolbar.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Controls/LiveEditingToolbar.cs deleted file mode 100644 index a61fa2e2fd..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Controls/LiveEditingToolbar.cs +++ /dev/null @@ -1,308 +0,0 @@ -using System; -using System.Web.UI; -using System.Web.UI.WebControls; -using umbraco.presentation.LiveEditing.Modules; -using umbraco.presentation.LiveEditing.Modules.CreateModule; -using umbraco.presentation.LiveEditing.Modules.DeleteModule; -using umbraco.presentation.LiveEditing.Modules.ItemEditing; -//using umbraco.presentation.LiveEditing.Modules.MacroEditing; -using umbraco.presentation.LiveEditing.Modules.UnpublishModule; - -using umbraco.BasePages; -using umbraco.cms.businesslogic.web; -using umbraco.BusinessLogic.Actions; -using umbraco.presentation.umbraco.controls; -using ClientDependency.Core; -using umbraco.IO; -using umbraco.presentation.umbraco.LiveEditing.Modules.SkinModule; -using umbraco.cms.businesslogic.skinning; -using umbraco.BusinessLogic; -namespace umbraco.presentation.LiveEditing.Controls -{ - /// - /// The default toolbar used for Live Editing. - /// - [ClientDependency(1, ClientDependencyType.Javascript, "ui/jquery.js", "UmbracoClient")] - [ClientDependency(20, ClientDependencyType.Javascript, "LiveEditing/Controls/LiveEditingToolbar.js", "UmbracoRoot")] - public class LiveEditingToolbar : Control - { - #region Protected Constants - - /// Client ID of the toolbar. - protected const string ToolbarId = "LiveEditingToolbar"; - - /// Title of the toolbar. - protected const string ToolbarTitle = "Umbraco Live Editing Toolbar"; - - #endregion - - #region Private Fields - - private readonly LiveEditingManager m_Manager; - - private readonly UpdatePanel m_MainPanel = new UpdatePanel(); - private readonly LabelButton m_SaveButton = new LabelButton(); - private readonly LabelButton m_SaveAndPublishButton = new LabelButton(); - private readonly Button m_CloseButton = new Button(); - private readonly Panel m_MenuItemsPanel = new Panel(); - private readonly Button m_BackToBackendButton = new Button(); - - #endregion - - #region Public Constructor - - /// - /// Creates a new default toolbar for the specified manager. - /// - /// The manager. - public LiveEditingToolbar(LiveEditingManager manager) - { - if (manager == null) - throw new ArgumentNullException("manager"); - - m_Manager = manager; - - if (!UmbracoContext.Current.LiveEditingContext.InSkinningMode) - { - AddModules(); - } - else - { - AddSkinningModules(); - } - } - - #endregion - - - #region Protected Methods - - /// - /// Adds the modules to the toolbar. - /// - /// Modules should be loaded from a configuration file in the future. - protected virtual void AddModules() - { - m_Manager.LiveEditingContext.Menu.Add(new Separator()); - m_Manager.LiveEditingContext.Menu.Add(new ItemEditor(m_Manager)); - m_Manager.LiveEditingContext.Menu.Add(new CreateModule(m_Manager)); - m_Manager.LiveEditingContext.Menu.Add(new UnpublishModule(m_Manager)); - m_Manager.LiveEditingContext.Menu.Add(new DeleteModule(m_Manager)); - //m_Manager.LiveEditingContext.Menu.Add(new MacroModule(m_Manager)); - - - } - - protected virtual void AddSkinningModules() - { - // SKINNING - // verify access to settings area - if (User.GetCurrent().GetApplications().Find(t => string.Equals(t.alias, Umbraco.Core.Constants.Applications.Settings, StringComparison.OrdinalIgnoreCase)) != null) - { - //only add if there is a skin - NodeFactory.Node n = NodeFactory.Node.GetCurrent(); - - if (!string.IsNullOrEmpty(Skinning.GetCurrentSkinAlias(n.template)) || Skinning.HasAvailableSkins(n.template)) - { - m_Manager.LiveEditingContext.Menu.Add(new Separator()); - m_Manager.LiveEditingContext.Menu.Add(new SkinModule(m_Manager)); - } - } - - } - - /// - /// Refreshes the current page using a client redirect. - /// - protected virtual void RefreshPage() - { - // we're using a client redirect, to enable client balloon messages on exit - string url = library.NiceUrl(UmbracoContext.Current.PageId.Value); - ScriptManager.RegisterClientScriptBlock(Page, GetType(), new Guid().ToString(), - String.Format("window.location.href='{0}';", url), true); - } - - #endregion - - #region Control Overrides - - /// - /// Raises the event. - /// - /// An object that contains the event data. - protected override void OnInit(EventArgs e) - { - base.OnInit(e); - EnsureChildControls(); - m_Manager.MessageReceived += Manager_MessageReceived; - } - - /// - /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation - /// to create any child controls they contain in preparation for posting back or rendering. - /// - protected override void CreateChildControls() - { - base.CreateChildControls(); - - Controls.Add(m_MainPanel); - - // create save button - m_MainPanel.ContentTemplateContainer.Controls.Add(m_SaveButton); - m_SaveButton.CssClass = "button"; - m_SaveButton.ToolTip = "Save"; - m_SaveButton.ImageUrl = String.Format("{0}/images/editor/Save.gif", SystemDirectories.Umbraco); - m_SaveButton.Click += new ImageClickEventHandler(SaveButton_Click); - m_SaveButton.OnClientClick = "return LiveEditingToolbar._save()"; - m_SaveButton.Visible = UmbracoContext.Current.HasPermission(ActionUpdate.Instance.Letter); - - // create save and publish button - m_MainPanel.ContentTemplateContainer.Controls.Add(m_SaveAndPublishButton); - m_SaveAndPublishButton.CssClass = "button"; - m_SaveAndPublishButton.ToolTip = "Save and publish"; - m_SaveAndPublishButton.ImageUrl = String.Format("{0}/images/editor/SaveAndPublish.gif", SystemDirectories.Umbraco); - m_SaveAndPublishButton.Click += new ImageClickEventHandler(SaveAndPublishButton_Click); - m_SaveAndPublishButton.OnClientClick = "return LiveEditingToolbar._saveAndPublish()"; - m_SaveAndPublishButton.Visible = m_SaveButton.Visible - && UmbracoContext.Current.HasPermission(ActionPublish.Instance.Letter); - - - if (!string.IsNullOrEmpty(UmbracoContext.Current.Request["skinning"])) - { - //create back to backend button - m_MainPanel.ContentTemplateContainer.Controls.Add(m_BackToBackendButton); - m_BackToBackendButton.CssClass = "close"; - m_BackToBackendButton.ToolTip = "switch to backoffice"; - m_BackToBackendButton.Text = "switch to backoffice"; - m_BackToBackendButton.Click += new EventHandler(m_BackToBackendButton_Click); - - } - else - { - // create close button - string _btText = "Logout: " + new BasePage().getUser().Name; - m_MainPanel.ContentTemplateContainer.Controls.Add(m_CloseButton); - m_CloseButton.CssClass = "close"; - m_CloseButton.ToolTip = _btText; - m_CloseButton.Text = _btText; - m_CloseButton.Click += new EventHandler(CloseButton_Click); - } - - //m_CloseButton.ImageUrl = String.Format("{0}/images/editor/Close.gif", GlobalSettings_Path); - - - // add the custom menu items - foreach (Control menuItem in m_Manager.LiveEditingContext.Menu) - m_MenuItemsPanel.Controls.Add(menuItem); - m_MenuItemsPanel.CssClass = "ExtraMenuItems"; - m_MainPanel.ContentTemplateContainer.Controls.Add(m_MenuItemsPanel); - - // add the client toolbar - m_MainPanel.ContentTemplateContainer.Controls.Add(new LiteralControl("
")); - } - - void m_BackToBackendButton_Click(object sender, EventArgs e) - { - - ScriptManager.RegisterClientScriptBlock(Page, GetType(), new Guid().ToString(), - String.Format("window.location.href='{0}';", this.ResolveUrl(SystemDirectories.Umbraco + "/")), true); - } - - - /// - /// Sends server control content to a provided object, - /// which writes the content to be rendered on the client. - /// - /// - /// The object - /// that receives the server control content. - /// - protected override void Render(HtmlTextWriter writer) - { - // surround the control with a toolbar div - writer.AddAttribute(HtmlTextWriterAttribute.Id, ToolbarId); - writer.AddAttribute(HtmlTextWriterAttribute.Title, ToolbarTitle); - writer.RenderBeginTag(HtmlTextWriterTag.Div); - - base.Render(writer); - - // close surrrounding div - writer.RenderEndTag(); - } - - #endregion - - #region Event Handlers - - /// - /// Handles the Click event of the SaveButton control. - /// - /// The source of the event. - /// The instance containing the event data. - protected void SaveButton_Click(object sender, ImageClickEventArgs e) - { - m_Manager.LiveEditingContext.Updates.SaveAll(); - m_Manager.DisplayUserMessage("Page saved", "The page was saved successfully. Remember to publish your changes.", "info"); - } - - /// - /// Handles the Click event of the SaveAndPublishButton control. - /// - /// The source of the event. - /// The instance containing the event data. - protected void SaveAndPublishButton_Click(object sender, ImageClickEventArgs e) - { - // save and publish - m_Manager.LiveEditingContext.Updates.SaveAll(); - m_Manager.LiveEditingContext.Updates.PublishAll(); - - // show message to user - m_Manager.DisplayUserMessage("Page published", "The page was published successfully.", "info"); - - // redirect to page (updates everything, and is necessary if the page name was changed) - RefreshPage(); - } - - /// - /// Handles the Click event of the CloseButton control. - /// - /// The source of the event. - /// The instance containing the event data. - protected void CloseButton_Click(object sender, EventArgs e) - { - // disable Live Editing - m_Manager.LiveEditingContext.Enabled = false; - - //ensures that users who are redirected to canvas also gets logged out on exit - int userid = BasePages.UmbracoEnsuredPage.GetUserId(BasePages.UmbracoEnsuredPage.umbracoUserContextID); - if (userid > 0) { - BusinessLogic.User u = new global::umbraco.BusinessLogic.User(userid); - if (u.DefaultToLiveEditing) - new BasePages.BasePage().ClearLogin(); - } - - RefreshPage(); - } - - - /// - /// Handles the MessageReceived event of the Manager control. - /// - /// The sender. - /// The e. - protected void Manager_MessageReceived(object sender, MesssageReceivedArgs e) - { - switch (e.Type) - { - case "save": - SaveButton_Click(sender, null); - break; - case "saveAndPublish": - SaveAndPublishButton_Click(sender, null); - break; - } - } - - #endregion - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/DefaultLiveEditingContext.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/DefaultLiveEditingContext.cs deleted file mode 100644 index 4a5e3d0504..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/DefaultLiveEditingContext.cs +++ /dev/null @@ -1,183 +0,0 @@ -using System; -using System.Web; -using System.Web.UI.WebControls; -using umbraco.BasePages; -using umbraco.presentation.LiveEditing.Menu; -using umbraco.presentation.LiveEditing.Updates; -using System.Web.UI; -using System.IO; -using System.Runtime.Serialization.Formatters.Binary; -using ICSharpCode.SharpZipLib.Zip.Compression.Streams; -using ICSharpCode.SharpZipLib.Zip.Compression; - -namespace umbraco.presentation.LiveEditing -{ - /// - /// Class that encapsulates all Live Editing information for an Umbraco context. - /// - public class DefaultLiveEditingContext : ILiveEditingContext - { - /// The current Live Editing menu. - private ILiveEditingMenu m_Menu; - - /// Current object that maintains the update list accross different requests. - private UpdateListSaver m_fieldUpdateSaver = new UpdateListSaver(); - - /// - /// Creates a default Live Editing context. - /// - public DefaultLiveEditingContext() - { - if (Enabled) - { - Initialize(); - } - } - - /// - /// Initializes this instance. - /// - protected virtual void Initialize() - { - if (m_Menu == null) - { - m_Menu = new DefaultLiveEditingMenu(); - m_Menu.Add(m_fieldUpdateSaver); - } - } - - #region ILiveEditingContext Members - - /// - /// Returns whether Live Editing is enabled. - /// - /// true if Live Editing enabled; - public bool Enabled - { - get - { - if (HttpContext.Current.Session == null || UmbracoEnsuredPage.CurrentUser == null) - return false; - - object umbEditMode = HttpContext.Current.Session["UmbracoLiveEditingMode"]; - return (umbEditMode != null && (bool)umbEditMode); - } - set - { - if (value && UmbracoEnsuredPage.CurrentUser == null) - throw new ApplicationException("Cannot switch to Live Editmode when user is not logged in."); - - HttpContext.Current.Session["UmbracoLiveEditingMode"] = value; - if (value) - { - Initialize(); - } - } - } - - public bool InSkinningMode { - get - { - return HttpContext.Current.Request["umbSkinning"] == "true"; - } - } - - /// - /// Gets the Live Editing menu, or null if Live Editing is disabled. - /// - /// - /// The Live Editing menu, or null if Live Editing is disabled. - /// - public ILiveEditingMenu Menu - { - get { return m_Menu; } - } - - /// - /// Gets the field updates made during this context. - /// - /// The updates. - public IUpdateList Updates - { - get - { - IUpdateList value = m_fieldUpdateSaver.Updates; - if (value == null) - m_fieldUpdateSaver.Updates = value = new DefaultUpdateList(); - return value; - } - } - - #endregion - - /// - /// Dummy control used to save the Updates list into a hidden field. - /// It cannot be stored inside the HTTP Context, because this context changes on every request - /// and we need to have access to this information on every page postback. - /// - protected class UpdateListSaver : PlaceHolder - { - /// The fieldname used to save the updates in. - protected const string UpdatesFieldName = "__LiveEditing_Updates"; - - /// Internal list of updates. - private IUpdateList m_Updates; - - /// Updates serializer. - private static BinaryFormatter serializer = new BinaryFormatter(); - - /// - /// Gets or sets the updates. - /// - /// The updates. - public IUpdateList Updates - { - get - { - if (m_Updates == null) - { - // get the updates out of the hidden field - string value = HttpContext.Current.Request.Params[UpdatesFieldName]; - if (!String.IsNullOrEmpty(value)) - { - // decompress and deserialize the field value - byte[] deflated = Convert.FromBase64CharArray(value.ToCharArray(), 0, value.Length); - Stream inflaterStream = new InflaterInputStream(new MemoryStream(deflated), - new Inflater(true)); - m_Updates = serializer.Deserialize(inflaterStream) as IUpdateList; - } - } - return m_Updates; - } - set - { - m_Updates = value; - } - } - - /// - /// Saves the updates into a hidden field. - /// - /// Ignored. - protected override void Render(HtmlTextWriter writer) - { - // serialize object into compressed stream - MemoryStream deflatedStream = new MemoryStream(); - DeflaterOutputStream deflater = new DeflaterOutputStream(deflatedStream, - new Deflater(Deflater.BEST_COMPRESSION, true)); - if (m_Updates != null) - serializer.Serialize(deflater, m_Updates); - - deflater.Close(); - - // get compressed characters - byte[] deflatedBytes = deflatedStream.ToArray(); - char[] deflatedChars = new char[(int)(Math.Ceiling((double)deflatedBytes.Length / 3) * 4)]; - Convert.ToBase64CharArray(deflatedBytes, 0, deflatedBytes.Length, deflatedChars, 0); - - // register the compressed string as a hidden field - ScriptManager.RegisterHiddenField(Page, UpdatesFieldName, new string(deflatedChars)); - } - } - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/ILiveEditingContext.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/ILiveEditingContext.cs deleted file mode 100644 index 7393cbe5ed..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/ILiveEditingContext.cs +++ /dev/null @@ -1,34 +0,0 @@ -using umbraco.presentation.LiveEditing.Menu; -using umbraco.presentation.LiveEditing.Updates; - -namespace umbraco.presentation.LiveEditing -{ - /// - /// Interfaces that encapsulates all Live Editing information of a specific Umbraco context. - /// - public interface ILiveEditingContext - { - /// - /// Gets or sets whether Live Editing is enabled. - /// - /// true if Live Editing enabled; otherwise, false. - bool Enabled { get; set; } - - /// - /// Gets or set whether Canvas is in Skinning mode - /// - bool InSkinningMode { get; } - - /// - /// Gets the Live Editing menu. - /// - /// The Live Editing menu, or null if Live Editing is disabled. - ILiveEditingMenu Menu { get; } - - /// - /// Gets the field updates made during this context. - /// - /// The updates. - IUpdateList Updates { get; } - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/LiveEditing.cd b/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/LiveEditing.cd deleted file mode 100644 index 0eef6089d2..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/LiveEditing.cd +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - AAACAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAgACAA= - UmbracoContext.cs - - - - - - - - - AAABAAAAQAAEIhAAEAEAAAAQAAAAAEQAAAAAFAgAEAA= - umbraco\LiveEditing\Controls\LiveEditingManager.cs - - - - - - - - - - - BAAAAAAAAAIAKBAAAGCAIAAQAAAAAAQAAFgAAAABAAA= - umbraco\LiveEditing\Controls\LiveEditingToolbar.cs - - - - - - AAAAAAAAQAAAABAQAECAAAAgAAAAAAQAABBAAAAQAAA= - umbraco\LiveEditing\Controls\Communicator.cs - - - - - - AAAAAAAAAAAAAIAAAAAAAAAAAAAIAAAAAAAAAgAAAAA= - umbraco\LiveEditing\ILiveEditingContext.cs - - - - - - - - - - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= - umbraco\LiveEditing\Menu\ILiveEditingMenu.cs - - - - - - AAIAAAAAAAAAAAABAAAAAGAAAAAAAAAAAgAAAAAAIAA= - umbraco\LiveEditing\Updates\IUpdateList.cs - - - - \ No newline at end of file diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Menu/DefaultLiveEditingMenu.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Menu/DefaultLiveEditingMenu.cs deleted file mode 100644 index 846926dac4..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Menu/DefaultLiveEditingMenu.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Collections.Generic; -using System.Web.UI; - -namespace umbraco.presentation.LiveEditing.Menu -{ - /// - /// A default implementation of . - /// - public class DefaultLiveEditingMenu : List, ILiveEditingMenu - { - - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Menu/ILiveEditingMenu.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Menu/ILiveEditingMenu.cs deleted file mode 100644 index d1d7e16c41..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Menu/ILiveEditingMenu.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Collections.Generic; -using System.Web.UI; - -namespace umbraco.presentation.LiveEditing.Menu -{ - /// - /// Interface for a Live Editing menu, which supports the adding of custom menu items. - /// - public interface ILiveEditingMenu : IList - { - - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/AddModule.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/AddModule.cs deleted file mode 100644 index e9f1dabad6..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/AddModule.cs +++ /dev/null @@ -1,79 +0,0 @@ -using System; -using System.Data; -using System.Configuration; -using System.Web; -using System.Web.Security; -using System.Web.UI; -using System.Web.UI.HtmlControls; -using System.Web.UI.WebControls; -using System.Web.UI.WebControls.WebParts; -using AjaxControlToolkit; -using umbraco.cms.businesslogic.web; - -namespace umbraco.presentation.LiveEditing.Modules -{ - public class AddModule:Control - { - protected readonly ILiveEditingContext m_Context; - - protected ImageButton m_AddButton = new ImageButton(); - - protected Panel m_AddModal = new Panel(); - protected ModalPopupExtender m_AddModalExtender = new ModalPopupExtender(); - - public AddModule(ILiveEditingContext context) - { - if (context == null) - throw new ArgumentNullException("context"); - if (!context.Enabled) - throw new ApplicationException("Live Editing is not enabled."); - - m_Context = context; - } - - protected override void OnInit(EventArgs e) - { - base.OnInit(e); - EnsureChildControls(); - - - - - } - - protected override void OnLoad(EventArgs e) - { - base.OnLoad(e); - } - - protected override void CreateChildControls() - { - base.CreateChildControls(); - - - Controls.Add(m_AddButton); - m_AddButton.ID = "LeAddButton"; - m_AddButton.CssClass = "button"; - m_AddButton.ToolTip = "Add"; - m_AddButton.ImageUrl = String.Format("{0}/images/new.gif", GlobalSettings.Path); - - Controls.Add(m_AddModal); - m_AddModal.ID = "LeAddModal"; - m_AddModal.CssClass = "modal"; - m_AddModal.Width = 300; - m_AddModal.Attributes.Add("Style", "display: none"); - - m_AddModal.Controls.Add(new LiteralControl("Hello world from add modal
")); - - - Controls.Add(m_AddModalExtender); - m_AddModalExtender.ID = "ModalAdd"; - m_AddModalExtender.TargetControlID = m_AddButton.ID; - m_AddModalExtender.PopupControlID = m_AddModal.ID; - m_AddModalExtender.BackgroundCssClass = "modalBackground"; - //m_AddModalExtender.OkControlID = m_ConfirmAddButton.ID; - //m_AddModalExtender.CancelControlID = m_CancelAddButton.ID; - //m_AddModalExtender.OnOkScript = "okAddPage()"; - } - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/BaseModule.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/BaseModule.cs deleted file mode 100644 index 4b7bdca396..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/BaseModule.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System; -using System.Web.UI; -using umbraco.presentation.LiveEditing.Controls; - -namespace umbraco.presentation.LiveEditing.Modules -{ - /// - /// Base class that Live Editing modules can choose to extend, providing some common features. - /// Note that inheriting this control is not a requirement for modules. - /// - public abstract class BaseModule : Control - { - /// - /// Gets the current Live Editing manager. - /// - /// The current Live Editing manager. - protected LiveEditingManager Manager { get; private set; } - - /// - /// Gets the current Live Editing context. - /// - /// The current Live Editing context. - protected ILiveEditingContext LiveEditingContext - { - get { return Manager.LiveEditingContext; } - } - - /// - /// Initializes a new instance of the class. - /// - /// The Live Editing manager. - public BaseModule(LiveEditingManager manager) - { - if (manager == null) - throw new ArgumentNullException("manager"); - if (!manager.LiveEditingContext.Enabled) - throw new ApplicationException("Live Editing is not enabled."); - - Manager = manager; - Manager.MessageReceived += Manager_MessageReceived; - } - - /// - /// Handles the MessageReceived event of the Live Editing manager. - /// - /// The sender. - /// The e. - protected virtual void Manager_MessageReceived(object sender, MesssageReceivedArgs e) { } - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/CreateModule/CreateModule.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/CreateModule/CreateModule.cs deleted file mode 100644 index 43748c80bd..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/CreateModule/CreateModule.cs +++ /dev/null @@ -1,140 +0,0 @@ -using System; -using System.Web.UI; -using System.Web.UI.WebControls; -using umbraco.cms.businesslogic.web; -using umbraco.presentation.LiveEditing.Controls; -using Content = umbraco.cms.businesslogic.Content; -using umbraco.BusinessLogic.Actions; -using ClientDependency.Core; -using umbraco.IO; -namespace umbraco.presentation.LiveEditing.Modules.CreateModule -{ - [ClientDependency(200, ClientDependencyType.Javascript, "LiveEditing/Modules/CreateModule/CreateModule.js", "UmbracoRoot")] - [ClientDependency(200, ClientDependencyType.Javascript, "modal/modal.js", "UmbracoClient")] - [ClientDependency(200, ClientDependencyType.Css, "modal/style.css", "UmbracoClient")] - public class CreateModule : BaseModule - { - protected ImageButton m_CreateButton = new ImageButton(); - - protected Panel m_CreateModal; - - protected TextBox m_NameTextBox; - protected DropDownList m_AllowedDocTypesDropdown; - - protected Button m_ConfirmCreateButton; - protected Button m_CancelCreateButton; - - public CreateModule(LiveEditingManager manager) - : base(manager) - { } - - protected override void OnInit(EventArgs e) - { - base.OnInit(e); - EnsureChildControls(); - } - - protected override void CreateChildControls() - { - base.CreateChildControls(); - - m_NameTextBox = new TextBox(); - m_NameTextBox.ID = "NewContentName"; - - m_AllowedDocTypesDropdown = new DropDownList(); - m_AllowedDocTypesDropdown.ID = "AllowedDocTypes"; - - m_ConfirmCreateButton = new Button(); - m_ConfirmCreateButton.ID = "ConfirmCreateButton"; - - m_CancelCreateButton = new Button(); - m_CancelCreateButton.ID = "CancelCreateButton"; - - m_CreateModal = new Panel(); - m_CreateModal.ID = "LeCreateModal"; - m_CreateModal.Attributes.Add("style", "display: none"); - - m_CreateModal.Controls.Add(new LiteralControl("

")); - m_CreateModal.Controls.Add(m_NameTextBox); - m_CreateModal.Controls.Add(new LiteralControl("

")); - m_CreateModal.Controls.Add(m_AllowedDocTypesDropdown); - FillAllowedDoctypes(); - - m_CreateModal.Controls.Add(new LiteralControl("

")); - - m_CreateModal.Controls.Add(m_ConfirmCreateButton); - m_CreateModal.Controls.Add(new LiteralControl(" ")); - m_CreateModal.Controls.Add(m_CancelCreateButton); - - m_ConfirmCreateButton.Text = ui.GetText("ok"); - m_ConfirmCreateButton.ID = "LeCreateModalConfirm"; - m_ConfirmCreateButton.CssClass = "modalbuton"; - m_ConfirmCreateButton.OnClientClick = "CreateModuleOk();"; - - m_CancelCreateButton.Text = ui.GetText("cancel"); - m_CancelCreateButton.CssClass = "modalbuton"; - - m_CreateModal.Controls.Add(new LiteralControl("")); - - Controls.Add(m_CreateModal); - - m_CreateButton.ID = "LeCreateButton"; - m_CreateButton.CssClass = "button"; - m_CreateButton.ToolTip = ui.GetText("create"); - m_CreateButton.ImageUrl = String.Format("{0}/LiveEditing/Modules/CreateModule/create.png", SystemDirectories.Umbraco); - m_CreateButton.Visible = UmbracoContext.Current.HasPermission(ActionNew.Instance.Letter); - m_CreateButton.OnClientClick = "jQuery('#" + m_CreateModal.ClientID + @"').ModalWindowShow('" + ui.GetText("create") + "',true,300,200,50,0, ['.modalbuton'], null);return false;"; - - Controls.Add(m_CreateButton); - } - - private void FillAllowedDoctypes() - { - m_AllowedDocTypesDropdown.Items.Clear(); - int NodeId = (int)UmbracoContext.Current.PageId; - - int[] allowedIds = new int[0]; - if (NodeId > 0) - { - Content c = new Document(NodeId); - allowedIds = c.ContentType.AllowedChildContentTypeIDs; - } - - foreach (DocumentType dt in DocumentType.GetAllAsList()) - { - ListItem li = new ListItem(); - li.Text = dt.Text; - li.Value = dt.Id.ToString(); - - if (NodeId > 0) - { - foreach (int i in allowedIds) if (i == dt.Id) - { - m_AllowedDocTypesDropdown.Items.Add(li); - - } - } - - } - } - - /// - /// Handles the MessageReceived event of the manager. - /// - /// The sender. - /// The e. - protected override void Manager_MessageReceived(object sender, MesssageReceivedArgs e) - { - switch (e.Type) - { - case "createcontent": - var userid = BasePages.UmbracoEnsuredPage.GetUserId(BasePages.UmbracoEnsuredPage.umbracoUserContextID); - var typeToCreate = new DocumentType(Convert.ToInt32(m_AllowedDocTypesDropdown.SelectedValue)); - var newDoc = Document.MakeNew(m_NameTextBox.Text, typeToCreate, new BusinessLogic.User(userid), (int)UmbracoContext.Current.PageId); - newDoc.SaveAndPublish(new BusinessLogic.User(userid)); - Page.Response.Redirect(library.NiceUrl(newDoc.Id), false); - break; - } - } - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/CssModule.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/CssModule.cs deleted file mode 100644 index 472280e94b..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/CssModule.cs +++ /dev/null @@ -1,72 +0,0 @@ -using System; -using System.Data; -using System.Configuration; -using System.Web; -using System.Web.Security; -using System.Web.UI; -using System.Web.UI.HtmlControls; -using System.Web.UI.WebControls; -using System.Web.UI.WebControls.WebParts; -using AjaxControlToolkit; - -namespace umbraco.presentation.LiveEditing.Modules -{ - public class CssModule: Control - { - protected readonly ILiveEditingContext m_Context; - - protected ImageButton m_CssButton = new ImageButton(); - - protected Panel m_CssModal = new Panel(); - protected ModalPopupExtender m_CssModalExtender = new ModalPopupExtender(); - - public CssModule(ILiveEditingContext context) - { - if (context == null) - throw new ArgumentNullException("context"); - if (!context.Enabled) - throw new ApplicationException("Live Editing is not enabled."); - - m_Context = context; - } - - protected override void OnInit(EventArgs e) - { - base.OnInit(e); - EnsureChildControls(); - - } - - protected override void OnLoad(EventArgs e) - { - base.OnLoad(e); - } - - protected override void CreateChildControls() - { - base.CreateChildControls(); - - Controls.Add(m_CssButton); - m_CssButton.ID = "LeCssButton"; - m_CssButton.CssClass = "button"; - m_CssButton.ToolTip = "Edit Css"; - m_CssButton.ImageUrl = String.Format("{0}/images/umbraco/settingCss.gif", GlobalSettings.Path); - - Controls.Add(m_CssModal); - m_CssModal.ID = "LeCssModal"; - m_CssModal.CssClass = "modal"; - m_CssModal.Width = 300; - m_CssModal.Attributes.Add("Style", "display: none"); - - m_CssModal.Controls.Add(new LiteralControl("Hello world from css modal")); - - Controls.Add(m_CssModalExtender); - m_CssModalExtender.TargetControlID = m_CssButton.ID; - m_CssModalExtender.PopupControlID = m_CssModal.ID; - m_CssModalExtender.BackgroundCssClass = "modalBackground"; - - - - } - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/DeleteModule/DeleteModule.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/DeleteModule/DeleteModule.cs deleted file mode 100644 index 08a29a3cb2..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/DeleteModule/DeleteModule.cs +++ /dev/null @@ -1,92 +0,0 @@ -using System; -using System.Web.UI; -using System.Web.UI.WebControls; -using umbraco.cms.businesslogic.web; -using umbraco.presentation.LiveEditing.Controls; -using umbraco.BusinessLogic.Actions; -using ClientDependency.Core; -using umbraco.IO; -namespace umbraco.presentation.LiveEditing.Modules.DeleteModule -{ - [ClientDependency(200, ClientDependencyType.Javascript, "LiveEditing/Modules/DeleteModule/DeleteModule.js", "UmbracoRoot")] - public class DeleteModule : BaseModule - { - protected ImageButton m_DeleteButton; - - protected Panel m_DeleteModal; - - protected Button m_ConfirmDeleteButton; - protected Button m_CancelDeleteButton; - - public DeleteModule(LiveEditingManager manager) - : base(manager) - { } - - protected override void OnInit(EventArgs e) - { - base.OnInit(e); - EnsureChildControls(); - } - - protected override void CreateChildControls() - { - base.CreateChildControls(); - - m_DeleteModal = new Panel(); - m_DeleteModal.ID = "LeDeleteModal"; - m_DeleteModal.Attributes.Add("Style", "display: none"); - - m_ConfirmDeleteButton = new Button(); - m_ConfirmDeleteButton.Text = ui.GetText("ok"); - m_ConfirmDeleteButton.ID = "LeDeleteModalConfirm"; - m_ConfirmDeleteButton.CssClass = "modalbuton"; - m_ConfirmDeleteButton.OnClientClick = "DeleteModuleOk();"; - - m_CancelDeleteButton = new Button(); - m_CancelDeleteButton.ID = "CancelDelete"; - m_CancelDeleteButton.Text = ui.GetText("cancel"); - m_CancelDeleteButton.CssClass = "modalbuton"; - - m_DeleteModal.Controls.Add(new LiteralControl("

" + ui.GetText("confirmdelete") + "

")); - m_DeleteModal.Controls.Add(m_ConfirmDeleteButton); - m_DeleteModal.Controls.Add(new LiteralControl(" ")); - m_DeleteModal.Controls.Add(m_CancelDeleteButton); - - Controls.Add(m_DeleteModal); - - m_DeleteButton = new ImageButton(); - m_DeleteButton.ID = "LeDeleteButton"; - m_DeleteButton.CssClass = "button"; - m_DeleteButton.ToolTip = ui.GetText("delete"); ; - m_DeleteButton.ImageUrl = String.Format("{0}/LiveEditing/Modules/DeleteModule/delete.png", SystemDirectories.Umbraco); - m_DeleteButton.Visible = UmbracoContext.Current.HasPermission(ActionDelete.Instance.Letter); - m_DeleteButton.OnClientClick = "jQuery('#" + m_DeleteModal.ClientID + @"').ModalWindowShow('" + ui.GetText("delete") + "',true,300,200,50,0, ['.modalbuton'], null);return false;"; - - Controls.Add(m_DeleteButton); - } - - - /// - /// Handles the MessageReceived event of the manager. - /// - /// The sender. - /// The e. - protected override void Manager_MessageReceived(object sender, MesssageReceivedArgs e) - { - switch (e.Type) - { - case "deletecontent": - Document currentPage = new Document(int.Parse(UmbracoContext.Current.PageId.ToString())); - string redirectUrl = "/"; - try - { - redirectUrl = library.NiceUrl(currentPage.Parent.Id); - } - catch { } - currentPage.delete(); - Page.Response.Redirect(redirectUrl); - break; - } - } - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/ItemEditing/ItemEditor.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/ItemEditing/ItemEditor.cs deleted file mode 100644 index 4efb1b7b02..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/ItemEditing/ItemEditor.cs +++ /dev/null @@ -1,414 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Web.UI; -using System.Web.UI.HtmlControls; -using System.Web.UI.WebControls; -using Umbraco.Web.Templates; -using umbraco.cms.businesslogic.property; -using umbraco.cms.businesslogic.propertytype; -using umbraco.cms.businesslogic.web; -using umbraco.interfaces; -using umbraco.presentation.LiveEditing.Controls; -using umbraco.presentation.LiveEditing.Updates; -using umbraco.presentation.templateControls; -using ClientDependency.Core; -using ClientDependency.Core.Controls; - -namespace umbraco.presentation.LiveEditing.Modules.ItemEditing -{ - /// - /// Control that wraps the editor control to edit a field in Live Editing mode. - /// - [ClientDependency(1, ClientDependencyType.Javascript, "ui/jquery.js", "UmbracoClient")] - [ClientDependency(21, ClientDependencyType.Javascript, "LiveEditing/Modules/ItemEditing/ItemEditing.js", "UmbracoRoot")] - [ClientDependency(22, ClientDependencyType.Javascript, "LiveEditing/Modules/ItemEditing/ItemEditingInvoke.js", "UmbracoRoot")] - [ClientDependency(23, ClientDependencyType.Javascript, "tinymce3/tiny_mce_src.js", "UmbracoClient")] //For TinyMCE to work in LiveEdit, we need to ensure that this script is run before it loads... - public class ItemEditor : UpdatePanel - { - #region Protected Constants - - /// Name of the wrapper tag. - protected const string EditorWrapperTag = "umbraco:control"; - - #endregion - - #region Private Fields - - /// The current Live Editing manager. - private LiveEditingManager m_Manager; - - /// Control that will contain the editor control. - private PlaceHolder m_Container; - - /// Data type of the field. - private IDataType m_DataType; - - #endregion - - #region Public Properties - - /// - /// Gets or sets the ID of the item that is to be edited. - /// - /// The item ID, or 0 if no item is to be edited. - public virtual int ItemId - { - get { return ViewState["ItemId"] == null ? 0 : (int)ViewState["ItemId"]; } - protected set { ViewState["ItemId"] = value; } - } - - #endregion - - #region Protected Properties - - /// - /// Gets the current Live Editing context. - /// - /// The Live Editing context. - protected ILiveEditingContext LiveEditingContext - { - get { return UmbracoContext.Current.LiveEditingContext; } - } - - #endregion - - #region Public Constructor - - /// - /// Initializes a new instance of the class. - /// - /// The manager. - public ItemEditor(LiveEditingManager manager) - { - m_Manager = manager; - } - - #endregion - - #region Editing Methods - - /// - /// Starts editing the item with the specified ID. - /// - /// The item ID. - public virtual void StartEditing(int itemId) - { - if (ItemId != 0) - throw new ApplicationException(string.Format("Unable to edit item {0}: edit of item {1} still in progress.", itemId, ItemId)); - - // the Render method will render the correct controls later on - ItemId = itemId; - - // add initializing call to client script - ScriptManager.RegisterStartupScript(Page, GetType(), new Guid().ToString(), - string.Format("ItemEditing.startEdit({0});", ItemId), true); - - EnsureChildControls(); - } - - /// - /// Stops editing the current item. - /// - /// Currently triggered by the client. - protected virtual void StopEditing() - { - if (ItemId != 0) - { - Debug.Assert(HasControls()); - - if (m_DataType != null) - { - // load the postback data into the data editor - m_DataType.DataEditor.Save(); - - // store the update with the new data - Item item = FindItem(ItemId); - ItemUpdate update = new ItemUpdate(item.GetParsedNodeId(), item.Field, m_DataType.Data.Value); - LiveEditingContext.Updates.Add(update); - } - - ItemId = 0; - } - } - - #endregion - - #region Control Overrides - - /// - /// Raises the event. - /// - /// The instance containing the event data. - protected override void OnInit(EventArgs e) - { - base.OnInit(e); - - ID = "ItemEditor"; - RenderMode = UpdatePanelRenderMode.Inline; - - m_Manager.MessageReceived += Manager_MessageReceived; - m_Manager.LiveEditingContext.Updates.UpdateAdded += Updates_UpdateAdded; - } - - /// - /// Raises the event. - /// - /// The instance containing the event data. - protected override void OnLoad(EventArgs e) - { - base.OnLoad(e); - - // create editor controls if in edit modoe - //this NEVER fires because onload occurs before ItemId is set in StartEditing - if (ItemId != 0) - { - EnsureChildControls(); - } - - // enable editing on all items - foreach (Item item in Utility.FindControls(Page.Master)) - item.Renderer = LiveEditingItemRenderer.Instance; - - } - - - /// - /// Called by the ASP.NET page framework to notify server controls - /// that use composition-based implementation to create any child controls - /// they contain in preparation for posting back or rendering. - /// - protected override void CreateChildControls() - { - - - if (ItemId != 0) - { - // find the item to edit - Item item = FindItem(ItemId); - - if (item == null) - { - // If the item is not found, two things could have occured: - // 1) the item ID is invalid (unlikely) - // 2) the item is still to be created as the result of an XSLT macro inside another item - // In both cases we can now safely parse already existing Item controls, - // as their values will not have been updated by the current postback. - // Plus we can solve case 2 because parsing makes those items available. - - // force rendition of all macros of page Item controls - foreach (Item findItem in Utility.FindControls(i => i.CanUseLiveEditing, Page.Master)) - ((LiveEditingItemRenderer)findItem.Renderer).ForceParseMacros(findItem); - // try looking up the item again - item = FindItem(ItemId); - } - - // if the item is still not found, the item ID must be invalid - if (item == null) - throw new ApplicationException(string.Format("The item with ID {0} was not found.", ItemId)); - - // add main container - m_Container = new PlaceHolder(); - m_Container.ID = "Container"; - ContentTemplateContainer.Controls.Add(m_Container); - - // add editor control, surrounded by a wrapper - HtmlGenericControl editorControlWrapper = new EditorWrapper(); - editorControlWrapper.ID = "EditorControlWrapper"; - m_Container.Controls.Add(editorControlWrapper); - Control dataEditor = CreateFieldDataEditor(item); - dataEditor.ID = "DataEditor"; - editorControlWrapper.Controls.Add(dataEditor); - - // add hidden submit button to the container - Button submit = new Button(); - // important: set ID so postback always works - submit.ID = "ItemEditor_Submit"; - submit.Style[HtmlTextWriterStyle.Display] = "none"; - submit.Click += new EventHandler(Submit_Click); - submit.EnableViewState = false; - submit.ValidationGroup = "ItemEditor"; - m_Container.Controls.Add(submit); - } - } - - #endregion - - #region Protected Helper Methods - - /// - /// Gets the editor control for the specified item. - /// - /// The item. - /// The editor control. - protected virtual Control CreateFieldDataEditor(Item item) - { - m_DataType = GetDataType(item); - - if (m_DataType != null) - { - Control editor; - - if (m_DataType.DataEditor is ILiveEditingDataEditor) - { - ILiveEditingDataEditor dataEditor = (ILiveEditingDataEditor)m_DataType.DataEditor; - editor = dataEditor.LiveEditingControl; - } - else - { - editor = m_DataType.DataEditor.Editor; - } - - return editor; - } - else - { - return new LiteralControl("Live Editing of this field is not possible."); - } - } - - /// - /// Gets the datatype for the specified item. - /// - /// The item. - /// The datatype. - protected virtual IDataType GetDataType(Item item) - { - // find the property - Property editProperty = null; - if (item.GetParsedNodeId().HasValue) - { - Document document = new Document(item.GetParsedNodeId().Value); - editProperty = document.getProperty(item.Field); - } - - // find the data type - IDataType editDataType = null; - if (editProperty != null) - { - PropertyType editPropertyType = editProperty.PropertyType; - editDataType = editPropertyType.DataTypeDefinition.DataType; - } - else - { - if (item.PageElements[item.Field] != null) - { - editDataType = new PageElementEditor(item); - } - } - - // only allow editing if we the data can be previewed - IDataWithPreview data = editDataType.Data as IDataWithPreview; - if (data == null) - { - editDataType = null; - } - else - { - if (editProperty != null) - data.PropertyId = editProperty.Id; - data.PreviewMode = true; - // display the latest updated value if available - ItemUpdate latestUpdate - = LiveEditingContext.Updates.GetLatest(u => u.NodeId == item.GetParsedNodeId() - && u.Field == item.Field); - if (latestUpdate != null) - data.Value = latestUpdate.Data; - } - - return editDataType; - } - - /// - /// Finds the item width the specified ID. - /// - /// The item ID. - /// - protected virtual Item FindItem(int id) - { - return (Item)Utility.FindControl(item => item.ItemId == id, Page.Master); - } - - #endregion - - #region Event Handlers - - /// - /// Handles the Click event of the Submit button. - /// - /// The source of the event. - /// The instance containing the event data. - protected void Submit_Click(object sender, EventArgs e) - { - StopEditing(); - } - - /// - /// Handles the MessageReceived event of the manager. - /// - /// The sender. - /// The e. - protected void Manager_MessageReceived(object sender, MesssageReceivedArgs e) - { - switch (e.Type) - { - case "edititem": - StartEditing(int.Parse(e.Message)); - break; - } - } - - /// - /// Occurs when a new update is added to the Live Editing update collection. - /// - /// The source of the event. - /// The instance containing the event data. - protected void Updates_UpdateAdded(object sender, UpdateAddedEventArgs e) - { - ItemUpdate update = e.Update as ItemUpdate; - if (update != null) - { - List affectedItems = Utility.FindControls(item => item.GetParsedNodeId() == update.NodeId - && item.Field == update.Field, - Page.Master); - foreach (Item affectedItem in affectedItems) - { - // render the item, temporarily disabling the live editing special output - StringWriter itemRenderOutput = new StringWriter(); - bool liveEditingWasDisabled = affectedItem.LiveEditingDisabled; - affectedItem.LiveEditingDisabled = true; - affectedItem.RenderControl(new HtmlTextWriter(itemRenderOutput)); - affectedItem.LiveEditingDisabled = liveEditingWasDisabled; - - // add the item's contents to the output - HtmlGenericControl itemUpdate = new HtmlGenericControl("umbraco:itemupdate"); - itemUpdate.Attributes["itemId"] = affectedItem.ItemId.ToString(); - itemUpdate.InnerHtml = TemplateUtilities.ParseInternalLinks(itemRenderOutput.ToString()); - itemUpdate.EnableViewState = false; - m_Manager.AddClientOutput(itemUpdate); - } - } - } - - #endregion - - /// - /// Custom tag that wraps the editor control. - /// This class needs to implement to enable correct ViewState handling - /// of the wrapped editor. - /// - protected class EditorWrapper : HtmlGenericControl, INamingContainer - { - /// - /// Initializes a new instance of the class. - /// - public EditorWrapper() - : base(ItemEditor.EditorWrapperTag) - { - ID = "EditorWrapper"; - Style[HtmlTextWriterStyle.Display] = "none"; - } - } - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/ItemEditing/ItemUpdate.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/ItemEditing/ItemUpdate.cs deleted file mode 100644 index c18f0f7a84..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/ItemEditing/ItemUpdate.cs +++ /dev/null @@ -1,108 +0,0 @@ -using System; -using Umbraco.Web.Security; -using umbraco.cms.businesslogic.property; -using umbraco.cms.businesslogic.propertytype; -using umbraco.cms.businesslogic.web; -using umbraco.interfaces; -using umbraco.presentation.LiveEditing.Updates; -using umbraco.BusinessLogic; -using umbraco.BasePages; -using System.Web; -using System.Collections.Generic; - -namespace umbraco.presentation.LiveEditing.Modules.ItemEditing -{ - /// - /// Class that holds information about an update to a certain field of a certain node. - /// - [Serializable] - public class ItemUpdate : IUpdate - { - /// - /// Gets or sets the node id. - /// - /// The node id. - public int? NodeId { get; set; } - - /// - /// Gets or sets the field name. - /// - /// The field name. - public string Field { get; set; } - - /// - /// Gets or sets the field data. - /// - /// The field data. - public object Data { get; set; } - - /// - /// Initializes a new instance of the class. - /// - /// The node id. - /// The field. - /// The data. - public ItemUpdate(int? nodeId, string field, object data) - { - NodeId = nodeId; - Field = field; - Data = data; - } - - #region IUpdate Members - - - /// - /// Saveses this instance. - /// - public void Save() - { - // get the data - Document document = new Document(NodeId.Value); - Property editProperty = document.getProperty(Field); - - IDataType editDataType = null; - if (editProperty != null) - { - // save the property - PropertyType editPropertyType = editProperty.PropertyType; - editDataType = editPropertyType.DataTypeDefinition.DataType; - editDataType.Data.PropertyId = editProperty.Id; - editDataType.Data.Value = Data; - } - else - { - if (Field == "pageName") - { - document.Text = Data.ToString(); - } - } - - document.Save(); - } - - /// - /// Publishes the update. - /// - public void Publish() - { - // keep track of documents published in this request - List publishedDocuments = (List)HttpContext.Current.Items["ItemUpdate_PublishedDocuments"]; - if (publishedDocuments == null) - { - HttpContext.Current.Items["ItemUpdate_PublishedDocuments"] = publishedDocuments = new List(); - } - - // publish each modified document just once (e.g. several fields are updated) - if(!publishedDocuments.Contains(NodeId.Value)) - { - Document document = new Document(NodeId.Value); - document.SaveAndPublish(Umbraco.Web.UmbracoContext.Current.UmbracoUser); - - publishedDocuments.Add(NodeId.Value); - } - } - - #endregion - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/ItemEditing/LiveEditingItemRenderer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/ItemEditing/LiveEditingItemRenderer.cs deleted file mode 100644 index c247e0050a..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/ItemEditing/LiveEditingItemRenderer.cs +++ /dev/null @@ -1,167 +0,0 @@ -using System; -using System.Web.UI; -using umbraco.presentation.LiveEditing.Updates; -using umbraco.presentation.templateControls; -using umbraco.NodeFactory; -using umbraco.cms.businesslogic.web; -using umbraco.interfaces; -using Umbraco.Core; - -namespace umbraco.presentation.LiveEditing.Modules.ItemEditing -{ - /// - /// ItemRenderer that surrounds regular output with a marker tag to enable Live Editing. - /// - public class LiveEditingItemRenderer : ItemRenderer - { - [Obsolete("Use Umbraco.Core.Constants.PropertyEditors.TinyMCEv3 instead")] - public const string RichtexteditorDatatypeId = Constants.PropertyEditors.TinyMCEv3; - - /// Returns the instance of . - public new readonly static LiveEditingItemRenderer Instance = new LiveEditingItemRenderer(); - - /// Name of the marker tag. - protected const string LiveEditingMarkerTag = "umbraco:iteminfo"; - - /// Name of the marker tag's ID attribute. - protected const string LiveEditingMarkerIdAttribute = "itemId"; - - /// Name of the marker tag's field name attribute. - protected const string LiveEditingFieldNameAttribute = "name"; - - /// Name of the marker tag's node ID attribute. - protected const string LiveEditingNodeIdAttribute = "nodeId"; - - /// Format string of the tooltip. - protected const string TooltipTextFormat = "Click to edit the {0} field of '{1}'"; - - /// Default text to display if the item's contents are empty. - protected const string DefaultEmptyTextFormat = "Click here to edit {0}."; - - /// - /// Initializes a new instance of the class. - /// - protected LiveEditingItemRenderer() - { - // Singleton pattern. - } - - /// - /// Inits the specified item. To be called from the OnInit method of Item. - /// - /// The item. - public override void Init(Item item) - { - // Postpone the ParseMacros call (base.Init calls ParseMacros here), - // because we want the updated values to appear in the item, - // and they are only available after the Load event. - // This breaks macro postback support, but we don't need that in Live Editing mode. - } - - /// - /// Forces macros to be parsed. - /// This can be useful if controls, that are created as a result of the parsing, - /// need to be available. - /// - /// This can cause problems however, when called too early. (see comments inside Init) - /// The item. - public void ForceParseMacros(Item item) - { - ParseMacros(item); - } - - /// - /// Sends server control content to a provided object, - /// which writes the content to be rendered on the client. - /// - /// - /// The - /// object that receives the server control content. - /// - public override void Render(Item item, HtmlTextWriter writer) - { - // call ParseMacros now, as we postponed that in Init - ParseMacros(item); - - bool useLiveEditing = item.CanUseLiveEditing; - - // render the marker field opening tag - if (useLiveEditing) - { - // add needed attributes for Live Editing - writer.AddAttribute(LiveEditingMarkerIdAttribute, item.ItemId.ToString()); - writer.AddAttribute(LiveEditingFieldNameAttribute, item.Field); - writer.AddAttribute(LiveEditingNodeIdAttribute, item.GetParsedNodeId().ToString()); - - // add descriptive tooltip - try - { - writer.AddAttribute("title", string.Format(TooltipTextFormat, item.Field, - new Node(item.GetParsedNodeId().Value).Name)); - } - catch{} - - try - { - IDataType dt = new Document(item.GetParsedNodeId().Value).getProperty(item.Field).PropertyType.DataTypeDefinition.DataType; - if (dt.Id == new Guid(Constants.PropertyEditors.TinyMCEv3)) - { - writer.AddAttribute("class", "liveEditingForceBlockMode"); - } - } - catch { } - - - - writer.RenderBeginTag(LiveEditingMarkerTag); - } - - try - { - // render the item as we used to - base.Render(item, writer); - } - - finally - { - // render the marker field closing tag - if (useLiveEditing) - { - writer.RenderEndTag(); - } - } - } - - /// - /// Renders the field contents. - /// Checks via the NodeId attribute whether to fetch data from another page than the current one. - /// - /// - /// A string of field contents (macros not parsed) - /// - protected override string GetFieldContents(Item item) - { - // check if an update has been made to the field, and use the updated value istead - IUpdateList updates = UmbracoContext.Current.LiveEditingContext.Updates; - ItemUpdate latestUpdate = updates.GetLatest(u => u.NodeId == item.GetParsedNodeId() - && u.Field == item.Field); - if (latestUpdate != null) - return latestUpdate.Data as string; //can't use ToString() as a null value will throw an exception - else - return base.GetFieldContents(item); - } - - /// - /// Gets the text to display if the field contents are empty. - /// - /// The item. - /// The text to display. - protected override string GetEmptyText(Item item) - { - string baseEmptyText = base.GetEmptyText(item) ?? string.Empty; - - // always make sure that there is some text, so that empty fields can be edited - return baseEmptyText.Trim().Length > 0 ? baseEmptyText : string.Format(DefaultEmptyTextFormat, item.Field); - } - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/ItemEditing/PageElementEditor.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/ItemEditing/PageElementEditor.cs deleted file mode 100644 index 06129f807c..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/ItemEditing/PageElementEditor.cs +++ /dev/null @@ -1,262 +0,0 @@ -using System; -using System.Web.UI; -using System.Web.UI.WebControls; -using System.Xml; -using umbraco.interfaces; -using umbraco.presentation.templateControls; - -namespace umbraco.presentation.LiveEditing.Modules.ItemEditing -{ - /// - /// Control that lets the user edit page properties in Live Edit mode. - /// - /// Keep this class internal, or it will cause problems since it's not a "real" data editor. - internal class PageElementEditor : Control, IDataWithPreview, IDataType, IDataEditor, ILiveEditingDataEditor - { - /// The item to edit. - private Item m_Item; - - /// Textbox that edits the item. - private TextBox m_FieldContents; - - /// - /// Initializes a new instance of the class. - /// - public PageElementEditor() - { - throw new ApplicationException("Internal class PageElementEditor should never be instantiated this way."); - } - - /// - /// Initializes a new instance of the class. - /// - /// The item. - public PageElementEditor(Item item) - { - m_Item = item; - EnsureChildControls(); - - // does the field belong to the current page? (no node ID) - if (String.IsNullOrEmpty(item.NodeId)) - { - // get the current page's element - Value = item.PageElements[item.Field]; - } - else - { - // get the elements of the chosen page - page itemPage = new page(content.Instance.XmlContent.GetElementById(item.NodeId.ToString())); - Value = itemPage.Elements[item.Field]; - } - } - - /// - /// Called by the ASP.NET page framework to notify server controls - /// that use composition-based implementation to create any child controls - /// they contain in preparation for posting back or rendering. - /// - protected override void CreateChildControls() - { - m_FieldContents = new TextBox(); - Controls.Add(m_FieldContents); - } - - #region IData Members - - /// - /// Gets or sets the property id. - /// - /// The property id. - public int PropertyId - { - set { throw new NotImplementedException(); } - } - - /// - /// Converts the data to XML. - /// - /// The data. - /// The data as XML. - public XmlNode ToXMl(System.Xml.XmlDocument data) - { - throw new NotImplementedException(); - } - - /// - /// Gets or sets the value. - /// - /// The value. - public object Value - { - get - { - return m_FieldContents.Text; - } - set - { - m_FieldContents.Text = value.ToString(); - } - } - - /// - /// Creates a new value - /// - /// The property id. - public void MakeNew(int PropertyId) - { - throw new NotImplementedException(); - } - - /// - /// Deletes this instance. - /// - public void Delete() - { - throw new NotImplementedException(); - } - - #endregion - - #region IDataWithPreview Members - - /// - /// Gets or sets a value indicating whether preview mode is switched on. - /// In preview mode, the setter saves to a temporary location - /// instead of persistent storage, which the getter also reads from on subsequent access. - /// Switching off preview mode restores the persistent value. - /// - /// - /// true if preview mode is switched on; otherwise, false. - /// - public bool PreviewMode - { - get - { - return ViewState["PreviewMode"] == null ? false : (bool)ViewState["PreviewMode"]; - } - set - { - ViewState["PreviewMode"] = value; - } - } - - #endregion - - #region IDataType Members - - /// - /// Gets the id. - /// - /// The id. - public Guid Id - { - get { throw new NotImplementedException(); } - } - - /// - /// Gets the name of the data type. - /// - /// The name of the data type. - public string DataTypeName - { - get { throw new NotImplementedException(); } - } - - /// - /// Gets the data editor. - /// - /// The data editor. - public IDataEditor DataEditor - { - get { return this; } - } - - /// - /// Gets the prevalue editor. - /// - /// The prevalue editor. - public IDataPrevalue PrevalueEditor - { - get { throw new NotImplementedException(); } - } - - /// - /// Gets the data. - /// - /// The data. - public IData Data - { - get { return this; } - } - - /// - /// Gets or sets the data type definition id. - /// - /// The data type definition id. - public int DataTypeDefinitionId - { - get - { - throw new NotImplementedException(); - } - set - { - throw new NotImplementedException(); - } - } - - #endregion - - #region IDataEditor Members - - /// - /// Saves this instance. - /// - public void Save() - { } - - /// - /// Gets a value indicating whether a label is shown - /// - /// true if [show label]; otherwise, false. - public bool ShowLabel - { - get { throw new NotImplementedException(); } - } - - /// - /// Gets a value indicating whether the editor should be treated as a rich text editor. - /// - /// - /// true if [treat as rich text editor]; otherwise, false. - /// - public bool TreatAsRichTextEditor - { - get { throw new NotImplementedException(); } - } - - /// - /// Gets the editor control - /// - /// The editor. - public Control Editor - { - get { throw new NotImplementedException(); } - } - - #endregion - - #region ILiveEditingDataEditor Members - - /// - /// Gets the control used for Live Editing. - /// - /// - public Control LiveEditingControl - { - get { return this; } - } - - #endregion - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/MacroModule/MacroModule.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/MacroModule/MacroModule.cs deleted file mode 100644 index 56a4875793..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/MacroModule/MacroModule.cs +++ /dev/null @@ -1,179 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Web.UI; -using System.Web.UI.WebControls; -using umbraco.controls; -using umbraco.presentation.LiveEditing.Controls; -using umbraco.presentation.LiveEditing.Updates; -using umbraco.presentation.templateControls; -using UM = umbraco.cms.businesslogic.macro; -using ClientDependency.Core; -using umbraco.IO; -namespace umbraco.presentation.LiveEditing.Modules.MacroEditing -{ - - /// - /// - /// THIS MODULE HASN'T YET EVER BEEN INCLUDED IN UMBRACO. - /// - /// SINCE AJAXCONTROLTOOLKIT IS REMOVED, THIS CLASS WILL NEED TO BE REFACTORED LIKE THE - /// OTHER MODULES. - /// - /// WHATEVER FUNCTIONALITY THAT WAS INTENDED FOR THIS MODULE WILL NEED TO BE FIGURED OUT - /// BASED ON THE COMMENTED CODE ALREADY WRITTEN. - /// - /// - [ClientDependency(200, ClientDependencyType.Javascript, "LiveEditing/Modules/MacroModule/MacroModule.js", "UmbracoRoot")] - public class MacroModule : BaseModule - { - - //private ImageButton m_MacroButton = new ImageButton(); - //private DropDownList m_MacroDropDown = new DropDownList(); - //private DropDownList m_ContainerDropDown = new DropDownList(); - //private List containers = new List(); - //private Button m_AddMacroButton = new Button(); - //private Panel m_MacroModal = new Panel(); - //private Panel m_AddMacroStep2 = new Panel(); - //private macroParameterControl m_MacroParameter = new macroParameterControl(); - - public MacroModule(LiveEditingManager manager) - : base(manager) - { } - - protected override void OnInit(EventArgs e) - { - base.OnInit(e); - EnsureChildControls(); - - } - - protected override void OnLoad(EventArgs e) - { - base.OnLoad(e); - } - - protected override void CreateChildControls() - { - base.CreateChildControls(); - - //Controls.Add(m_MacroButton); - //m_MacroButton.ID = "LeMacroButton"; - //m_MacroButton.CssClass = "button"; - //m_MacroButton.ToolTip = "Insert macro"; - //m_MacroButton.ImageUrl = String.Format("{0}/images/editor/insMacro.gif", SystemDirectories.Umbraco); - - //Controls.Add(m_MacroModal); - //m_MacroModal.ID = "LeMacroModal"; - //m_MacroModal.CssClass = "modal"; - //m_MacroModal.Width = 500; - //m_MacroModal.Attributes.Add("Style", "display: none"); - - //m_MacroModal.Controls.Add(new LiteralControl("
Insert macro
")); - //m_MacroModal.Controls.Add(new LiteralControl("
")); - - - //m_MacroModal.Controls.Add(m_MacroDropDown); - //m_MacroDropDown.CssClass = "dropdown"; - //m_MacroDropDown.Items.Clear(); - //m_MacroDropDown.Items.Add(new ListItem("Choose macro", "0")); - //foreach (UM.Macro macro in UM.Macro.GetAll()) - //{ - // m_MacroDropDown.Items.Add(new ListItem(macro.Name, macro.Alias)); - //} - //m_MacroDropDown.AutoPostBack = true; - //m_MacroDropDown.SelectedIndexChanged += new EventHandler(m_MacroDropDown_SelectedIndexChanged); - - //m_MacroModal.Controls.Add(new LiteralControl("
")); - - //m_MacroModal.Controls.Add(m_ContainerDropDown); - //m_ContainerDropDown.CssClass = "dropdown"; - //m_ContainerDropDown.Items.Clear(); - //m_ContainerDropDown.Items.Add(new ListItem("Choose container", "0")); - //foreach (Control ctrl in Page.Controls) - //{ - // FindMacroHolderPanels(ctrl); - - //} - - //m_MacroModal.Controls.Add(new LiteralControl("
")); - //m_MacroModal.Controls.Add(m_AddMacroButton); - //m_AddMacroButton.Text = "Add Macro"; - - //m_AddMacroButton.Click += new EventHandler(m_AddMacroButton_Click); - - - //m_MacroModal.Controls.Add(new LiteralControl("
")); - - } - - void m_MacroDropDown_SelectedIndexChanged(object sender, EventArgs e) - { - //m_MacroModal.Controls.Add(m_AddMacroStep2); - - //m_AddMacroStep2.Controls.Add(new LiteralControl("

Macro Properties

")); - - //m_MacroParameter.MacroAlias = m_MacroDropDown.SelectedValue; - - //m_AddMacroStep2.Controls.Add(m_MacroParameter); - - } - - void m_AddMacroButton_Click(object sender, EventArgs e) - { - //containers.ForEach(delegate(Panel p) - //{ - // if (p.ID == m_ContainerDropDown.SelectedItem.Value) - // { - // Macro macrotoadd = new Macro(); - // macrotoadd.Alias = m_MacroDropDown.SelectedItem.Value; - - // p.Controls.Add(new LiteralControl(string.Format( - // "
handle
", - // macrotoadd.Alias + macrotoadd.ID))); - // p.Controls.Add(macrotoadd); - // p.Controls.Add(new LiteralControl("
")); - // ((UpdatePanel)p.Parent.Parent).Update(); - - - // TemplateUpdate update = new TemplateUpdate(); - // LiveEditingContext.Updates.Add(update); - // } - //}); - } - - private void FindMacroHolderPanels(Control ctrl) - { - //foreach (Control childControl in ctrl.Controls) - //{ - - // if (childControl is Panel) - // { - // if (((Panel)childControl).CssClass == "macro_holder") - // { - // Panel holderPanel = (Panel)childControl; - // containers.Add(holderPanel); - // m_ContainerDropDown.Items.Add(new ListItem(childControl.ID, childControl.ID)); - - // ((UpdatePanel)holderPanel.Parent.Parent).Triggers.Clear(); - // AsyncPostBackTrigger apt = new AsyncPostBackTrigger(); - // apt.ControlID = m_MacroButton.ID; - // apt.EventName = "Click"; - // ((UpdatePanel)holderPanel.Parent.Parent).Triggers.Add(apt); - - // childControl.Controls.Add(new LiteralControl(string.Format( - // "
", - // childControl.ID))); - - - // } - // } - - // if (childControl.HasControls()) - // { - // FindMacroHolderPanels(childControl); - // } - //} - - } - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/MacroModule/TemplateUpdate.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/MacroModule/TemplateUpdate.cs deleted file mode 100644 index 7eab3cd2bb..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/MacroModule/TemplateUpdate.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using umbraco.presentation.LiveEditing.Updates; - -namespace umbraco.presentation.LiveEditing.Modules.MacroEditing -{ - /// - /// Class that holds information about an update to a certain template. - /// - /// Not implemented yet. - [Serializable] - public class TemplateUpdate : IUpdate - { - /// - /// Initializes a new instance of the class. - /// - public TemplateUpdate() - { - - } - - #region IUpdate Members - - /// - /// Saves the update. - /// - public void Save() - { - - } - - /// - /// Publishes the update. - /// - public void Publish() - { - - } - - #endregion - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/Separator.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/Separator.cs deleted file mode 100644 index bf89dc851b..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/Separator.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System.Web.UI.HtmlControls; - -namespace umbraco.presentation.LiveEditing.Modules -{ - /// - /// Module separator item. - /// - public class Separator : HtmlGenericControl - { - /// - /// Initializes a new instance of the class. - /// - public Separator() : base("span") - { - Attributes["class"] = "separator"; - InnerHtml = @" "; - } - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/CssParser.aspx b/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/CssParser.aspx deleted file mode 100644 index 1ebd8692cf..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/CssParser.aspx +++ /dev/null @@ -1 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CssParser.aspx.cs" Inherits="umbraco.presentation.umbraco.LiveEditing.Modules.SkinModule.CssParser" %> \ No newline at end of file diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/CssParser.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/CssParser.aspx.cs deleted file mode 100644 index a967108aab..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/CssParser.aspx.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.UI; -using System.Web.UI.WebControls; -using umbraco.BusinessLogic; -using umbraco.cms.businesslogic.skinning; - -namespace umbraco.presentation.umbraco.LiveEditing.Modules.SkinModule -{ - public partial class CssParser : BasePages.UmbracoEnsuredPage - { - - public CssParser() - { - //for skinning, you need to be a developer - CurrentApp = DefaultApps.developer.ToString(); - } - - //will be used to parse the global variables in the embedded css of a skin manifest - protected void Page_Load(object sender, EventArgs e) - { - Response.ContentType = "text/plain"; - - var skinAlias = Request["skinAlias"]; - - if (!string.IsNullOrEmpty(skinAlias) && Skin.CreateFromAlias(skinAlias) != null) - { - var activeSkin = Skin.CreateFromAlias(skinAlias); - - if (activeSkin.Css != null) - { - - var varValues = new SortedList(); - - foreach (var var in activeSkin.Css.Variables) - { - varValues.Add(var.Name, string.IsNullOrEmpty(Request[var.Name]) ? var.DefaultValue : Request[var.Name]); - - } - - Response.Write(ParseEmbeddedCss(activeSkin.Css.Content,varValues)); - } - - } - } - - private string ParseEmbeddedCss(string content, SortedList varValues) - { - foreach (var var in varValues) - { - content = content.Replace("@" + var.Key, var.Value); - } - - return content; - } - } -} \ No newline at end of file diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/CssParser.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/CssParser.aspx.designer.cs deleted file mode 100644 index fe2a31ba59..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/CssParser.aspx.designer.cs +++ /dev/null @@ -1,15 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace umbraco.presentation.umbraco.LiveEditing.Modules.SkinModule { - - - public partial class CssParser { - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ImageUploader.aspx b/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ImageUploader.aspx deleted file mode 100644 index 63e64045cc..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ImageUploader.aspx +++ /dev/null @@ -1,193 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ImageUploader.aspx.cs" Inherits="umbraco.presentation.umbraco.LiveEditing.Modules.SkinModule.ImageUploader" %> -<%@ Register TagPrefix="umb" Namespace="ClientDependency.Core.Controls" Assembly="ClientDependency.Core" %> -<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %> - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -

- or Cancel -

-
- - - - - - - - -
- -
-
- - -
-
-
-
- - - - - - -
- -

- or Cancel -

- -
- - - - diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ImageUploader.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ImageUploader.aspx.cs deleted file mode 100644 index 2c592a5a79..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ImageUploader.aspx.cs +++ /dev/null @@ -1,181 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.UI; -using System.Web.UI.WebControls; -using System.IO; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Drawing.Imaging; -using umbraco.BusinessLogic; - -namespace umbraco.presentation.umbraco.LiveEditing.Modules.SkinModule -{ - public partial class ImageUploader : BasePages.UmbracoEnsuredPage - { - //max width and height is used to make sure the cropper doesn't grow bigger then the modal window - public int MaxWidth = 700; - public int MaxHeight = 480; - public string scaleWidth = "500px"; - - public ImageUploader() - { - //for skinning, you need to be a developer - CurrentApp = DefaultApps.developer.ToString(); - } - - protected void Page_Load(object sender, EventArgs e) - { - - } - - protected void bt_upload_Click(object sender, EventArgs e) - { - if (FileUpload1.HasFile) - { - - Guid g = Guid.NewGuid(); - DirectoryInfo updir = new DirectoryInfo(IO.IOHelper.MapPath("~/media/upload/" + g)); - - if (!updir.Exists) - updir.Create(); - - FileName.Value = FileUpload1.FileName; - - FileUpload1.SaveAs(updir.FullName + "/" + FileUpload1.FileName); - - if (IsValidImage(updir.FullName + "/" + FileUpload1.FileName)) - { - Image1.ImageUrl = this.ResolveUrl("~/media/upload/" + g) + "/" + FileUpload1.FileName; - Image.Value = Image1.ImageUrl; - - if ((!string.IsNullOrEmpty(Request["w"]) && Request["w"].ToString() != "0") && (!string.IsNullOrEmpty(Request["h"]) && Request["h"].ToString() != "0")) - { - - if (Convert.ToInt32(Request["w"]) > MaxWidth || Convert.ToInt32(Request["h"]) > MaxHeight) - { - System.Drawing.Image img = System.Drawing.Image.FromFile(IO.IOHelper.MapPath(Image.Value)); - - Image1.Width = img.Width / 2; - Image1.Height = img.Height / 2; - - fb_feedback1.Text = "Notice: The below exemple is scaled down 50% as the image is quite large, do not worry, it will be the right size on your website"; - } - - if (Image1.Width.Value > 250) - scaleWidth = (Image1.Width.Value).ToString() + "px"; - - - pnl_crop.Visible = true; - pnl_upload.Visible = false; - } - else - { - Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "setimage", " $(function () { setImage(); })", true); - } - } - else - { - fb_feedback1.Text = "Please choose a valid image file"; - fb_feedback1.type = uicontrols.Feedback.feedbacktype.error; - } - } - } - - protected void bt_uploadother_Click(object sender, EventArgs e) - { - pnl_crop.Visible = false; - pnl_upload.Visible = true; - } - - protected void bt_crop_Click(object sender, EventArgs e) - { - System.Drawing.Image imgToResize = System.Drawing.Image.FromFile(IO.IOHelper.MapPath(Image.Value)); - - int sourceWidth = imgToResize.Width; - int sourceHeight = imgToResize.Height; - - float nPercent = Convert.ToSingle(Scale.Value) / (float)100; - - int destWidth = (int)(sourceWidth * nPercent); - int destHeight = (int)(sourceHeight * nPercent); - - Bitmap b = new Bitmap(Convert.ToInt32(Request["w"]), Convert.ToInt32(Request["h"])); - - Graphics g = Graphics.FromImage((System.Drawing.Image)b); - g.InterpolationMode = InterpolationMode.HighQualityBicubic; - - float x = Convert.ToSingle(X.Value); - float y = Convert.ToSingle(Y.Value); - - if (Convert.ToInt32(Request["w"]) > MaxWidth || Convert.ToInt32(Request["h"]) > MaxHeight) - { - x = x * 2; - y = y * 2; - } - - g.SmoothingMode = SmoothingMode.AntiAlias; - g.InterpolationMode = InterpolationMode.HighQualityBicubic; - - - g.DrawImage(imgToResize, x, y, destWidth, destHeight); - - g.Dispose(); - - - - Guid id = Guid.NewGuid(); - DirectoryInfo updir = new DirectoryInfo(IO.IOHelper.MapPath("~/media/upload/" + id)); - - if (!updir.Exists) - updir.Create(); - - FileInfo img = new FileInfo(IO.IOHelper.MapPath(Image.Value)); - // Copy metadata - ImageCodecInfo[] codecs = ImageCodecInfo.GetImageEncoders(); - ImageCodecInfo codec = null; - - - - for (int i = 0; i < codecs.Length; i++) - { - if (codecs[i].MimeType.Equals("image/jpeg")) - codec = codecs[i]; - } - - // Set compresion ratio to 90% - EncoderParameters ep = new EncoderParameters(); - ep.Param[0] = new EncoderParameter(Encoder.Quality, 90L); - - if(img.Extension.ToLower() == "png") - ((System.Drawing.Image)b).Save(updir.FullName + "/" + FileName.Value,ImageFormat.Png); - else - ((System.Drawing.Image)b).Save(updir.FullName + "/" + FileName.Value, codec, ep); - - Image.Value = this.ResolveUrl("~/media/upload/" + id) + "/" + FileName.Value; - Image1.ImageUrl = Image.Value; - - pnl_crop.Visible = true; - - Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "setimage", " $(function () { setImage(); })", true); - - } - - - private bool IsValidImage(string filename) - { - try - { - System.Drawing.Image newImage = System.Drawing.Image.FromFile(filename); - } - catch (OutOfMemoryException) - { - // Image.FromFile will throw this if file is invalid. - - return false; - } - return true; - } - } -} \ No newline at end of file diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ImageUploader.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ImageUploader.aspx.designer.cs deleted file mode 100644 index f610524593..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ImageUploader.aspx.designer.cs +++ /dev/null @@ -1,186 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace umbraco.presentation.umbraco.LiveEditing.Modules.SkinModule { - - - public partial class ImageUploader { - - /// - /// ClientLoader control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::umbraco.uicontrols.UmbracoClientDependencyLoader ClientLoader; - - /// - /// CssInclude1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.CssInclude CssInclude1; - - /// - /// CssInclude2 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.CssInclude CssInclude2; - - /// - /// JsInclude1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude1; - - /// - /// JsInclude2 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude2; - - /// - /// JsInclude3 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude3; - - /// - /// form1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.HtmlControls.HtmlForm form1; - - /// - /// Image control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.HiddenField Image; - - /// - /// FileName control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.HiddenField FileName; - - /// - /// X control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.HiddenField X; - - /// - /// Y control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.HiddenField Y; - - /// - /// Scale control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.HiddenField Scale; - - /// - /// fb_feedback1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::umbraco.uicontrols.Feedback fb_feedback1; - - /// - /// pnl_upload control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.PlaceHolder pnl_upload; - - /// - /// FileUpload1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.FileUpload FileUpload1; - - /// - /// bt_upload control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Button bt_upload; - - /// - /// pnl_crop control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.PlaceHolder pnl_crop; - - /// - /// Image1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Image Image1; - - /// - /// bt_crop control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Button bt_crop; - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ModuleInjectionMacroRenderer.aspx b/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ModuleInjectionMacroRenderer.aspx deleted file mode 100644 index 253ce9ead3..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ModuleInjectionMacroRenderer.aspx +++ /dev/null @@ -1 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ModuleInjectionMacroRenderer.aspx.cs" Inherits="umbraco.presentation.umbraco.LiveEditing.Modules.SkinModule.ModuleInjectionMacroRenderer" %> diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ModuleInjectionMacroRenderer.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ModuleInjectionMacroRenderer.aspx.cs deleted file mode 100644 index 243add8787..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ModuleInjectionMacroRenderer.aspx.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.UI; -using System.Web.UI.WebControls; -using System.Collections; -using System.Text; -using System.IO; - -namespace umbraco.presentation.umbraco.LiveEditing.Modules.SkinModule -{ - public partial class ModuleInjectionMacroRenderer : UmbracoDefault - { - - - protected override void Render(HtmlTextWriter output) - { - if (!string.IsNullOrEmpty(Request["tag"])) - { - presentation.templateControls.Macro m = new presentation.templateControls.Macro(); - - Hashtable DataValues = helper.ReturnAttributes(Request["tag"]); - - m.Alias = DataValues["alias"].ToString(); - m.MacroAttributes = DataValues; - - StringBuilder sb = new StringBuilder(); - StringWriter tw = new StringWriter(sb); - HtmlTextWriter hw = new HtmlTextWriter(tw); - - m.RenderControl(hw); - - Response.Output.Write(sb.ToString()); - } - } - } -} \ No newline at end of file diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ModuleInjectionMacroRenderer.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ModuleInjectionMacroRenderer.aspx.designer.cs deleted file mode 100644 index 77d6cd4cdf..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ModuleInjectionMacroRenderer.aspx.designer.cs +++ /dev/null @@ -1,15 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace umbraco.presentation.umbraco.LiveEditing.Modules.SkinModule { - - - public partial class ModuleInjectionMacroRenderer { - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ModuleInjector.aspx b/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ModuleInjector.aspx deleted file mode 100644 index 8909fc1f36..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ModuleInjector.aspx +++ /dev/null @@ -1,141 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ModuleInjector.aspx.cs" Inherits="umbraco.presentation.umbraco.LiveEditing.Modules.SkinModule.ModuleInjector" %> -<%@ Register TagPrefix="umb" Namespace="ClientDependency.Core.Controls" Assembly="ClientDependency.Core" %> -<%@ Import Namespace="Umbraco.Core.Configuration" %> -<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %> - - - - - - - - - - - - - - - - - - - -
- - -
-
-
- -
-
-
-
- -
- -

- " - onclick="updateMacro()" /> -

-
- - diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ModuleInjector.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ModuleInjector.aspx.cs deleted file mode 100644 index 7d0957123b..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ModuleInjector.aspx.cs +++ /dev/null @@ -1,103 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.UI; -using System.Web.UI.WebControls; -using System.Reflection; -using Umbraco.Core.IO; -using umbraco.BusinessLogic; - -namespace umbraco.presentation.umbraco.LiveEditing.Modules.SkinModule -{ - public partial class ModuleInjector : BasePages.UmbracoEnsuredPage - { - private cms.businesslogic.macro.Macro _m; - public string _macroAlias = ""; - - public ModuleInjector() - { - //for skinning, you need to be a developer - CurrentApp = DefaultApps.developer.ToString(); - } - - protected void Page_Load(object sender, EventArgs e) - { - renderProperties(); - } - - protected void renderProperties() - { - if (!string.IsNullOrEmpty(Request["macroAlias"])) - { - - - _m = cms.businesslogic.macro.Macro.GetByAlias(Request["macroAlias"]); - - _macroAlias = _m.Alias; - - - //If no properties, we will exit now... - if (_m.Properties.Length == 0) - { - var noProps = new Literal(); - noProps.Text = ""; - macroProperties.Controls.Add(noProps); - } - else - { - //if we have properties, we'll render the controls for them... - foreach (cms.businesslogic.macro.MacroProperty mp in _m.Properties) - { - var macroAssembly = mp.Type.Assembly; - var macroType = mp.Type.Type; - try - { - - var assembly = Assembly.LoadFrom(IOHelper.MapPath(SystemDirectories.Bin + "/" + macroAssembly + ".dll")); - - var type = assembly.GetType(macroAssembly + "." + macroType); - var typeInstance = Activator.CreateInstance(type) as interfaces.IMacroGuiRendering; - if (typeInstance != null) - { - var control = Activator.CreateInstance(type) as Control; - control.ID = mp.Alias; - - if (!IsPostBack) - { - if (Request["umb_" + mp.Alias] != null) - { - if (Request["umb_" + mp.Alias] != "") - { - type.GetProperty("Value").SetValue(control, Convert.ChangeType(Request["umb_" + mp.Alias], type.GetProperty("Value").PropertyType), null); - } - } - } - - // register alias - var pp = new uicontrols.PropertyPanel(); - pp.Text = mp.Name; - pp.Controls.Add(control); - macroProperties.Controls.Add(pp); - - pp.Controls.Add(new LiteralControl("\n")); - - - - } - else - { - Trace.Warn("umbEditContent", "Type doesn't exist or is not umbraco.interfaces.DataFieldI ('" + macroAssembly + "." + macroType + "')"); - } - - } - catch (Exception fieldException) - { - Trace.Warn("umbEditContent", "Error creating type '" + macroAssembly + "." + macroType + "'", fieldException); - } - } - } - } - } - } -} \ No newline at end of file diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ModuleInjector.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ModuleInjector.aspx.designer.cs deleted file mode 100644 index f05377b23e..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ModuleInjector.aspx.designer.cs +++ /dev/null @@ -1,78 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace umbraco.presentation.umbraco.LiveEditing.Modules.SkinModule { - - - public partial class ModuleInjector { - - /// - /// ClientLoader control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::umbraco.uicontrols.UmbracoClientDependencyLoader ClientLoader; - - /// - /// JsInclude1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude1; - - /// - /// CssInclude1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.CssInclude CssInclude1; - - /// - /// CssInclude2 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.CssInclude CssInclude2; - - /// - /// CssInclude3 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.CssInclude CssInclude3; - - /// - /// form1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.HtmlControls.HtmlForm form1; - - /// - /// macroProperties control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.PlaceHolder macroProperties; - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ModuleInstaller.aspx b/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ModuleInstaller.aspx deleted file mode 100644 index 48eb082bca..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ModuleInstaller.aspx +++ /dev/null @@ -1 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ModuleInstaller.aspx.cs" Inherits="umbraco.presentation.umbraco.LiveEditing.Modules.SkinModule.ModuleInstaller" %> diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ModuleInstaller.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ModuleInstaller.aspx.cs deleted file mode 100644 index 1c3cbd306d..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ModuleInstaller.aspx.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.UI; -using System.Web.UI.WebControls; -using umbraco.BusinessLogic; -using umbraco.cms.businesslogic.packager; - -namespace umbraco.presentation.umbraco.LiveEditing.Modules.SkinModule -{ - public partial class ModuleInstaller : BasePages.UmbracoEnsuredPage - { - private readonly cms.businesslogic.packager.repositories.Repository _repo; - private const string RepoGuid = "65194810-1f85-11dd-bd0b-0800200c9a66"; - - public ModuleInstaller() - { - _repo = cms.businesslogic.packager.repositories.Repository.getByGuid(RepoGuid); - - if (_repo == null) - { - throw new InvalidOperationException("Could not find repository with id " + RepoGuid); - } - - //for skinning, you need to be a developer - CurrentApp = DefaultApps.developer.ToString(); - } - - protected void Page_Load(object sender, EventArgs e) - { - if (!string.IsNullOrEmpty(Request["guid"])) - { - - var guid = new Guid(Request["guid"]); - - if (_repo.HasConnection()) - { - var installer = new Installer(); - var tempDir = installer.Import(_repo.fetch(guid.ToString())); - installer.LoadConfig(tempDir); - var packageId = installer.CreateManifest(tempDir, guid.ToString(), RepoGuid); - installer.InstallFiles(packageId, tempDir); - installer.InstallBusinessLogic(packageId, tempDir); - installer.InstallCleanUp(packageId, tempDir); - - //NOTE: This seems excessive to have to re-load all content from the database here!? - library.RefreshContent(); - - if (cms.businesslogic.skinning.Skinning.IsPackageInstalled(new Guid(Request["guid"])) || - cms.businesslogic.skinning.Skinning.IsPackageInstalled(Request["name"])) - { - Response.Write(cms.businesslogic.skinning.Skinning.GetModuleAlias(Request["name"])); - } - else - { - Response.Write("error"); - } - - } - else - { - Response.Write("error"); - } - } - } - } -} \ No newline at end of file diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ModuleInstaller.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ModuleInstaller.aspx.designer.cs deleted file mode 100644 index 8fc8c725fb..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ModuleInstaller.aspx.designer.cs +++ /dev/null @@ -1,15 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace umbraco.presentation.umbraco.LiveEditing.Modules.SkinModule { - - - public partial class ModuleInstaller { - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ModuleSelector.ascx b/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ModuleSelector.ascx deleted file mode 100644 index 01e108cf36..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ModuleSelector.ascx +++ /dev/null @@ -1,55 +0,0 @@ -<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ModuleSelector.ascx.cs" Inherits="umbraco.presentation.umbraco.LiveEditing.Modules.SkinModule.ModuleSelector" %> -<%@ Import Namespace="umbraco.cms.businesslogic.packager.repositories" %> - - -
- - - -
-

Please select the module you wish to insert.

-
    - - -
  • - - - <%# ((Package)Container.DataItem).Text %> - <%# ((Package)Container.DataItem).Text %> - - - -
  • -
    - -
-
- - - -
- -

-Unable to fetch module, please try again later. -

- - - - - - Cancel -
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ModuleSelector.ascx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ModuleSelector.ascx.cs deleted file mode 100644 index 4e3df9371a..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ModuleSelector.ascx.cs +++ /dev/null @@ -1,102 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.UI; -using System.Web.UI.WebControls; -using Umbraco.Core.Logging; -using umbraco.BusinessLogic; -using umbraco.cms.businesslogic.packager; -using Umbraco.Core; - -namespace umbraco.presentation.umbraco.LiveEditing.Modules.SkinModule -{ - public partial class ModuleSelector : System.Web.UI.UserControl - { - private cms.businesslogic.packager.repositories.Repository repo; - private string repoGuid = "65194810-1f85-11dd-bd0b-0800200c9a66"; - - - public ModuleSelector() - { - this.repo = cms.businesslogic.packager.repositories.Repository.getByGuid(this.repoGuid); - - if (repo == null) - { - throw new InvalidOperationException("Could not find repository with id " + this.repoGuid); - } - } - - protected void Page_Load(object sender, EventArgs e) - { - if (User.GetCurrent().GetApplications().Find(t => string.Equals(t.alias, Constants.Applications.Settings, StringComparison.OrdinalIgnoreCase)) == null) - { - throw new Exception("The current user can't edit skins as the user doesn't have access to the Settings section!"); - } - - LoadModules(); - } - - protected void LoadModules() - { - if (this.repo.HasConnection()) - { - try - { - this.rep_modules.DataSource = this.repo.Webservice.StarterKitModules(); - this.rep_modules.DataBind(); - } - catch (Exception exception) - { - LogHelper.Error("An error occurred", exception); - } - } - else - { - this.ShowConnectionError(); - } - } - - private void ShowConnectionError() - { - - noConnectionToRepo.Visible = true; - } - - protected void rep_modules_ItemDataBound(object sender, RepeaterItemEventArgs e) - { - if (e.Item.DataItem != null) - { - cms.businesslogic.packager.repositories.Package p = (cms.businesslogic.packager.repositories.Package)e.Item.DataItem; - - HyperLink link = (HyperLink)e.Item.FindControl("ModuleSelectLink"); - - if (cms.businesslogic.skinning.Skinning.IsPackageInstalled(p.RepoGuid) || - cms.businesslogic.skinning.Skinning.IsPackageInstalled(p.Text)) - { - link.Attributes.Add( - "onclick", - "umbSelectModule('" + cms.businesslogic.skinning.Skinning.GetModuleAlias(p.Text) + "',this);return false;"); - } - else - { - link.Attributes.Add( - "onclick", - "umbInstallModuleAndGetAlias('" + p.RepoGuid +"','"+p.Text+"',this);"); - } - - - } - } - - public string GetThumbNail(string thumb) - { - if(string.IsNullOrEmpty(thumb)) - return "http://our.umbraco.org/css/wiki/package.png"; - else - return "http://our.umbraco.org/" + thumb; - } - - - } -} \ No newline at end of file diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ModuleSelector.ascx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ModuleSelector.ascx.designer.cs deleted file mode 100644 index 83a9bcf51a..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/ModuleSelector.ascx.designer.cs +++ /dev/null @@ -1,33 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace umbraco.presentation.umbraco.LiveEditing.Modules.SkinModule { - - - public partial class ModuleSelector { - - /// - /// rep_modules control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Repeater rep_modules; - - /// - /// noConnectionToRepo control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.HtmlControls.HtmlGenericControl noConnectionToRepo; - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/SkinCustomizer.ascx b/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/SkinCustomizer.ascx deleted file mode 100644 index 8bcd50acd8..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/SkinCustomizer.ascx +++ /dev/null @@ -1,125 +0,0 @@ -<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SkinCustomizer.ascx.cs" Inherits="umbraco.presentation.LiveEditing.Modules.SkinModule.SkinCustomizer" %> -<%@ Import Namespace="umbraco.cms.businesslogic.packager.repositories" %> - -<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %> - - - - -

Connection to repository failed...

-
- - - - - - - -
> - -

- Personalize your skin, by defining colors, images and texts -

- -
- -
- -

- - or Cancel -

- - -

You could also change to another skin: Browse available skins

- -
- - - -
> - -

- Choose a skin from your local collection, or download one from the umbraco package repository -

- - -
- - -
    - - -
  • - <%# ((Skin)Container.DataItem).Text %> - <%# ((Skin)Container.DataItem).Text %> -
    - -
  • -
    - -
- -
- -
- -
-

Looks like there are also some local skins

- - - -
    - - -
  • - <%# ((string)Container.DataItem).ToString() %> - - -
  • -
    - -
- -
- - -
- -

- Go back to your current skin -

- -
- - - - diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/SkinCustomizer.ascx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/SkinCustomizer.ascx.cs deleted file mode 100644 index b494147ef6..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/SkinCustomizer.ascx.cs +++ /dev/null @@ -1,369 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.UI; -using System.Web.UI.WebControls; -using Umbraco.Core.IO; -using Umbraco.Core.Logging; -using umbraco.cms.businesslogic.skinning; -using System.Xml; -using System.Text; -using umbraco.interfaces.skinning; -using umbraco.cms.businesslogic.template; -using umbraco.BusinessLogic; -using umbraco.NodeFactory; -using umbraco.cms.businesslogic.packager; -using System.IO; -using Umbraco.Core; - -namespace umbraco.presentation.LiveEditing.Modules.SkinModule -{ - - public partial class SkinCustomizer : UserControl - { - // Fields - - - private cms.businesslogic.packager.repositories.Repository repo; - private cms.businesslogic.skinning.Skin ActiveSkin; - - private string repoGuid = "65194810-1f85-11dd-bd0b-0800200c9a66"; - - private List sDependencies = new List(); - - // Methods - public SkinCustomizer() - { - this.repo = cms.businesslogic.packager.repositories.Repository.getByGuid(this.repoGuid); - } - - protected void btnOk_Click(object sender, EventArgs e) - { - this.ActiveSkin.SaveOutput(); - - //css vars - SortedList cssVars = new SortedList(); - if (this.ActiveSkin.Css != null) - { - foreach (CssVariable cssVar in this.ActiveSkin.Css.Variables) - { - cssVars.Add(cssVar.Name, cssVar.DefaultValue); - } - } - - - foreach (Dependency dependency in this.sDependencies) - { - if (dependency.DependencyType.Values.Count > 0) - { - string output = dependency.DependencyType.Values[0].ToString(); - foreach (Task task in dependency.Tasks) - { - TaskExecutionDetails details = task.TaskType.Execute(this.ParsePlaceHolders(task.Value, output)); - if (details.TaskExecutionStatus == TaskExecutionStatus.Completed) - { - this.ActiveSkin.AddTaskHistoryNode(task.TaskType.ToXml(details.OriginalValue, details.NewValue)); - } - } - - //css vars - if (!string.IsNullOrEmpty(dependency.Variable)) - { - if(cssVars[dependency.Variable] != null) - cssVars[dependency.Variable] = output; - } - } - } - - if (this.ActiveSkin.Css != null && !string.IsNullOrEmpty(this.ActiveSkin.Css.Content) && !string.IsNullOrEmpty(this.ActiveSkin.Css.TargetFile)) - { - string content = this.ActiveSkin.Css.Content; - //css vars - foreach (var var in cssVars) - { - content = content.Replace("@" + var.Key, var.Value); - } - - //save - - StreamWriter sw = File.AppendText(IO.IOHelper.MapPath(SystemDirectories.Css) + "/" + this.ActiveSkin.Css.TargetFile); - sw.Write(content); - sw.Close(); - } - - //NOTE: This seems excessive to have to re-load all content from the database here!? - library.RefreshContent(); - } - - protected void LoadDependencies() - { - this.ph_dependencies.Controls.Clear(); - StringBuilder builder = new StringBuilder(); - - //css vars default value - string varquery = ""; - - if (this.ActiveSkin.Css != null) - { - - foreach (CssVariable cssVar in this.ActiveSkin.Css.Variables) - { - builder.AppendLine( - string.Format("var cssvar{0} = '{1}';",cssVar.Name,cssVar.DefaultValue)); - - varquery += string.Format("+ '&{0}=' + cssvar{0}.replace('#','%23')", cssVar.Name); - } - } - - //preview css var change - - builder.Append(string.Format("function PreviewCssVariables(){{ var parsedcsscontent; jQuery.get('/umbraco/LiveEditing/Modules/SkinModule/CssParser.aspx?skinAlias={0}'{1}, function(data){{parsedcsscontent= data; jQuery('head').append(''); }}); }}", - this.ActiveSkin.Alias, - varquery)); - - - - builder.Append("\r\n var hasSetTasksClientScriptsRun = false; \r\n function setTasksClientScripts(){ \r\n if(hasSetTasksClientScriptsRun == false){"); - - int c = 0; - foreach (Dependency dependency in this.ActiveSkin.Dependencies) - { - if (dependency.DependencyType != null) - { - this.sDependencies.Add(dependency); - Control editor = dependency.DependencyType.Editor; - editor.ID = "depcontrol" + c; - this.ph_dependencies.addProperty(dependency.Label, editor); - - if(!string.IsNullOrEmpty(dependency.Variable)) - { - //this control is setting a css variable - builder.Append(dependency.DependencyType.CssVariablePreviewClientScript(editor.ClientID, "cssvar" + dependency.Variable)); - - - } - foreach (Task task in dependency.Tasks) - { - builder.Append(task.TaskType.PreviewClientScript(editor.ClientID, dependency.DependencyType.ClientSidePreviewEventType(), dependency.DependencyType.ClientSideGetValueScript())); - } - - c++; - } - } - builder.Append("hasSetTasksClientScriptsRun = true; }}"); - ScriptManager.RegisterClientScriptBlock(this, base.GetType(), "TasksClientScripts", builder.ToString(), true); - } - - protected void LoadSkins() - { - var skinNames = new List(); - - var nullable = Skinning.StarterKitGuid(Node.GetCurrent().template); - - if(nullable.HasValue){ - var p = InstalledPackage.GetByGuid(nullable.Value.ToString()); - if(p.Data.SkinRepoGuid != null && p.Data.SkinRepoGuid != Guid.Empty && p.Data.SkinRepoGuid.ToString() != repoGuid) - this.repo = cms.businesslogic.packager.repositories.Repository.getByGuid(p.Data.SkinRepoGuid.ToString()); - } - - if (!(nullable.HasValue && Skinning.HasAvailableSkins(Node.GetCurrent().template))) - { - this.pChangeSkin.Visible = false; - } - else if (this.repo.HasConnection()) - { - try - { - var skins = this.repo.Webservice.Skins(nullable.ToString()); - this.rep_starterKitDesigns.DataSource = skins; - this.rep_starterKitDesigns.DataBind(); - - foreach (var s in skins) - { - if(!skinNames.Contains(s.Text)) - skinNames.Add(s.Text); - } - } - catch (Exception exception) - { - LogHelper.Error("An error occurred", exception); - } - } - else - { - this.ShowConnectionError(); - } - - //check for local skins - - List localSkins = new List(); - DirectoryInfo dirInfo = new DirectoryInfo(IOHelper.MapPath(SystemDirectories.Masterpages)); - foreach (DirectoryInfo subDur in dirInfo.GetDirectories()) - { - var skinFile = subDur.GetFiles("skin.xml"); - - if (skinFile.Length > 0) - { - string c = Skin.GetSkinNameFromFile(skinFile[0].FullName); - - if (!skinNames.Contains(c)) - localSkins.Add(c); - } - } - - if (localSkins.Count > 0) - { - rep_starterKitDesignsLocal.DataSource = localSkins; - rep_starterKitDesignsLocal.DataBind(); - } - else - { - localSkinsContainer.Visible = false; - } - - - - } - - protected void Page_Load(object sender, EventArgs e) - { - if (User.GetCurrent().GetApplications().Find(t => string.Equals(t.alias, Constants.Applications.Settings, StringComparison.OrdinalIgnoreCase)) == null) - { - throw new Exception("The current user can't edit skins as the user doesn't have access to the Settings section!"); - } - - NodeFactory.Node n = NodeFactory.Node.GetCurrent(); - ActiveSkin = Skin.CreateFromAlias( Skinning.GetCurrentSkinAlias(n.template) ); - - pnl_connectionerror.Visible = false; - - //load dependencies - if (ActiveSkin != null && ActiveSkin.Dependencies.Count > 0) - LoadDependencies(); - else - { - //show skin selection - pCustomizeSkin.Visible = false; - ltCustomizeSkinStyle.Text = ltChangeSkinStyle.Text; - ltChangeSkinStyle.Text = string.Empty; - } - - LoadSkins(); - } - - private string ParsePlaceHolders(string value, string output) - { - value = value.Replace("${Output}", output); - return value; - } - - protected void rep_starterKitDesigns_ItemDataBound(object sender, RepeaterItemEventArgs e) - { - if (e.Item.DataItem != null) - { - cms.businesslogic.packager.repositories.Skin s = (cms.businesslogic.packager.repositories.Skin)e.Item.DataItem; - - if (Skinning.IsSkinInstalled(s.RepoGuid)) - { - Button inst = (Button)e.Item.FindControl("Button1"); - inst.Text = "Apply"; - inst.CommandName = "apply"; - inst.CommandArgument = s.Text; - //inst.ID = s.Text; - - } - - if (ActiveSkin != null && ActiveSkin.Name == s.Text) - { - Button inst = (Button)e.Item.FindControl("Button1"); - inst.Text = "Rollback"; - inst.CommandName = "remove"; - inst.CommandArgument = s.Text; - //inst.ID = s.Text; - } - } - - } - - protected void SelectStarterKitDesign(object sender, EventArgs e) - { - if (((Button)sender).CommandName == "apply") - { - Skinning.ActivateAsCurrentSkin(Skin.CreateFromName(((Button)sender).CommandArgument)); - this.Page.Response.Redirect(library.NiceUrl(int.Parse(UmbracoContext.Current.PageId.ToString())) + "?umbSkinning=true"); - } - else if (((Button)sender).CommandName == "remove") - { - Template template = new Template(Node.GetCurrent().template); - Skinning.RollbackSkin(template.Id); - this.Page.Response.Redirect( library.NiceUrl(int.Parse(UmbracoContext.Current.PageId.ToString())) +"?umbSkinning=true" ); - } - else - { - Guid guid = new Guid(((Button)sender).CommandArgument); - - InstalledPackage p = InstalledPackage.GetByGuid(guid.ToString()); - if (p.Data.SkinRepoGuid != null && p.Data.SkinRepoGuid != Guid.Empty && p.Data.SkinRepoGuid.ToString() != repoGuid) - this.repo = cms.businesslogic.packager.repositories.Repository.getByGuid(p.Data.SkinRepoGuid.ToString()); - - - Installer installer = new Installer(); - if (this.repo.HasConnection()) - { - Installer installer2 = new Installer(); - string tempDir = installer2.Import(this.repo.fetch(guid.ToString())); - installer2.LoadConfig(tempDir); - int packageId = installer2.CreateManifest(tempDir, guid.ToString(), this.repoGuid); - installer2.InstallFiles(packageId, tempDir); - installer2.InstallBusinessLogic(packageId, tempDir); - installer2.InstallCleanUp(packageId, tempDir); - //NOTE: This seems excessive to have to re-load all content from the database here!? - library.RefreshContent(); - Skinning.ActivateAsCurrentSkin(Skin.CreateFromName(((Button)sender).CommandName)); - this.Page.Response.Redirect(library.NiceUrl(int.Parse(UmbracoContext.Current.PageId.ToString())) + "?umbSkinning=true"); - } - else - { - this.ShowConnectionError(); - } - } - } - - - protected void rep_starterKitDesignsLocal_ItemDataBound(object sender, RepeaterItemEventArgs e) - { - if (e.Item.DataItem != null) - { - - if (ActiveSkin != null && ActiveSkin.Name == e.Item.DataItem.ToString()) - { - Button inst = (Button)e.Item.FindControl("btnApply"); - inst.Text = "Rollback"; - inst.CommandName = "remove"; - } - } - - } - - protected void SelectLocalStarterKitDesign(object sender, EventArgs e) - { - if (((Button)sender).CommandName == "apply") - { - Skinning.ActivateAsCurrentSkin(Skin.CreateFromName(((Button)sender).CommandArgument)); - this.Page.Response.Redirect(library.NiceUrl(int.Parse(UmbracoContext.Current.PageId.ToString())) + "?umbSkinning=true"); - } - else if (((Button)sender).CommandName == "remove") - { - Template template = new Template(Node.GetCurrent().template); - Skinning.RollbackSkin(template.Id); - this.Page.Response.Redirect(library.NiceUrl(int.Parse(UmbracoContext.Current.PageId.ToString())) + "?umbSkinning=true"); - } - } - - private void ShowConnectionError() - { - this.pnl_connectionerror.Visible = true; - } - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/SkinCustomizer.ascx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/SkinCustomizer.ascx.designer.cs deleted file mode 100644 index 504c4aa545..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/SkinCustomizer.ascx.designer.cs +++ /dev/null @@ -1,105 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace umbraco.presentation.LiveEditing.Modules.SkinModule { - - - public partial class SkinCustomizer { - - /// - /// pnl_connectionerror control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Panel pnl_connectionerror; - - /// - /// ltCustomizeSkinStyle control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Literal ltCustomizeSkinStyle; - - /// - /// ph_dependencies control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::umbraco.uicontrols.Pane ph_dependencies; - - /// - /// btnOk control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Button btnOk; - - /// - /// pChangeSkin control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.HtmlControls.HtmlGenericControl pChangeSkin; - - /// - /// ltChangeSkinStyle control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Literal ltChangeSkinStyle; - - /// - /// rep_starterKitDesigns control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Repeater rep_starterKitDesigns; - - /// - /// localSkinsContainer control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.HtmlControls.HtmlGenericControl localSkinsContainer; - - /// - /// rep_starterKitDesignsLocal control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Repeater rep_starterKitDesignsLocal; - - /// - /// pCustomizeSkin control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.HtmlControls.HtmlGenericControl pCustomizeSkin; - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/SkinModule.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/SkinModule.cs deleted file mode 100644 index 2405b37695..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/SkinModule.cs +++ /dev/null @@ -1,269 +0,0 @@ -using System; -using umbraco.presentation.LiveEditing.Modules; -using ClientDependency.Core; -using System.Web.UI.WebControls; -using umbraco.presentation.LiveEditing.Controls; -using umbraco.IO; -using System.Web.UI; -using umbraco.cms.businesslogic.skinning; -using ClientDependency.Core.Controls; -using umbraco.presentation.umbraco.controls; -using HtmlAgilityPack; -using umbraco.cms.businesslogic.template; - -namespace umbraco.presentation.umbraco.LiveEditing.Modules.SkinModule -{ - [ClientDependency(200, ClientDependencyType.Javascript, "modal/modal.js", "UmbracoClient")] - [ClientDependency(200, ClientDependencyType.Css, "modal/style.css", "UmbracoClient")] - [ClientDependency(500, ClientDependencyType.Javascript, "LiveEditing/Modules/SkinModule/js/ModuleInjection.js", "UmbracoRoot")] - [ClientDependency(800, ClientDependencyType.Javascript, "LiveEditing/Modules/SkinModule/js/disableInstallButtonsOnClick.js", "UmbracoRoot")] - public class SkinModule : BaseModule - { - protected LabelButton m_SkinButton = new LabelButton(); - protected Panel m_SkinModal; - - protected LabelButton m_ModuleButton = new LabelButton(); - protected Panel m_ModuleModal; - - - public SkinModule(LiveEditingManager manager) - : base(manager) - { } - - protected override void OnInit(EventArgs e) - { - base.OnInit(e); - EnsureChildControls(); - - - } - - protected override void CreateChildControls() - { - base.CreateChildControls(); - - - Skin ActiveSkin = Skin.CreateFromAlias(Skinning.GetCurrentSkinAlias(NodeFactory.Node.GetCurrent().template)); - - - m_SkinModal = new Panel(); - m_SkinModal.ID = "LeSkinModal"; - m_SkinModal.Attributes.Add("style", "display: none"); - - m_SkinModal.Controls.Add(new UserControl().LoadControl(String.Format("{0}/LiveEditing/Modules/SKinModule/SkinCustomizer.ascx", SystemDirectories.Umbraco))); - - Controls.Add(m_SkinModal); - - m_SkinButton.ID = "LeSkinButton"; - m_SkinButton.CssClass = "button"; - m_SkinButton.ToolTip = ActiveSkin != null && ActiveSkin.Dependencies.Count > 0 ? "Customize skin" : "Change skin"; - m_SkinButton.ImageUrl = String.Format("{0}/LiveEditing/Modules/SKinModule/images/skin.gif", SystemDirectories.Umbraco); - - string s = (ActiveSkin != null && ActiveSkin.Dependencies.Count > 0 ? "setTasksClientScripts();" : "") + "jQuery('#" + m_SkinModal.ClientID + @"').show();" + "jQuery('#" + m_SkinModal.ClientID + @"').ModalWindowShowWithoutBackground('" + ui.GetText("skin") + "',true,500,400,50,0, ['.modalbuton'], null);"; - - m_SkinButton.OnClientClick = s +"return false;"; - - Controls.Add(m_SkinButton); - - if (UmbracoContext.Current.LiveEditingContext.InSkinningMode && !string.IsNullOrEmpty(UmbracoContext.Current.Request["umbSkinningConfigurator"])) - { - ScriptManager.RegisterClientScriptBlock( - this, - this.GetType(), - "ShowSkinModule", - "function ShowSkinModule(){" + s + "}", - true); - - - ClientDependencyLoader.Instance.RegisterDependency(500, "LiveEditing/Modules/SkinModule/js/SkinModuleShowOnStartup.js", "UmbracoRoot", ClientDependencyType.Javascript); - } - - // modules - if (CanInsertModules(NodeFactory.Node.GetCurrent().template)) - { - m_ModuleModal = new Panel(); - m_ModuleModal.ID = "LeModuleModal"; - m_ModuleModal.CssClass = "ModuleSelector"; - m_ModuleModal.Attributes.Add("style", "display: none"); - - m_ModuleModal.Controls.Add(new UserControl().LoadControl(String.Format("{0}/LiveEditing/Modules/SKinModule/ModuleSelector.ascx", SystemDirectories.Umbraco))); - - Controls.Add(m_ModuleModal); - - - m_ModuleButton.ID = "LeModuleButton"; - m_ModuleButton.CssClass = "button"; - m_ModuleButton.ToolTip = "Insert Module"; - m_ModuleButton.ImageUrl = String.Format("{0}/LiveEditing/Modules/SKinModule/images/module.gif", SystemDirectories.Umbraco); - - m_ModuleButton.OnClientClick = "umbShowModuleSelection();" + "return false;"; - - Controls.Add(m_ModuleButton); - } - } - - private bool CanInsertModules(int template) - { - Template t = new Template(template); - - HtmlDocument doc = new HtmlDocument(); - doc.Load(t.MasterPageFile); - - if (doc.DocumentNode.SelectNodes(string.Format("//*[@class = '{0}']", "umbModuleContainer")) != null) - return true; - else - { - if (t.HasMasterTemplate) - return CanInsertModules(t.MasterTemplate); - else - return false; - } - - } - - protected override void Manager_MessageReceived(object sender, MesssageReceivedArgs e) - { - switch (e.Type) - { - case "injectmodule": - //update template, insert macro tag - InsertModule(NodeFactory.Node.GetCurrent().template, e.Message.Split(';')[0], e.Message.Split(';')[1], e.Message.Split(';')[2] == "prepend"); - break; - case "movemodule": - - string moduleId = e.Message.Split(';')[0]; - string parentId = e.Message.Split(';')[1]; - - int index = 0; - int.TryParse(e.Message.Split(';')[2], out index); - - HtmlNode module = FindModule(NodeFactory.Node.GetCurrent().template, moduleId, false); - - if (module != null) - { - FindModule(NodeFactory.Node.GetCurrent().template, moduleId, true); - MoveModule(NodeFactory.Node.GetCurrent().template, module, parentId, index); - } - - break; - - case "removemodule": - - FindModule(NodeFactory.Node.GetCurrent().template, e.Message.Split(';')[0], true); - - break; - - } - } - - private bool MoveModule(int template, HtmlNode module, string targetId, int index) - { - Template t = new Template(template); - - string TargetFile = t.MasterPageFile; - string TargetID = targetId; - - HtmlDocument doc = new HtmlDocument(); - doc.Load(TargetFile); - - if (doc.DocumentNode.SelectNodes(string.Format("//*[@id = '{0}']", TargetID)) != null) - { - HtmlNode parent = doc.DocumentNode.SelectSingleNode(string.Format("//*[@id = '{0}']", TargetID)); - - if (index > 0 && parent.ChildNodes.Count > 0) - { - parent.InsertAfter(module, parent.ChildNodes[index - 1]); - } - else if (index == 0 && parent.ChildNodes.Count > 0) - { - parent.InsertBefore(module, parent.ChildNodes[0]); - } - else - { - parent.AppendChild(module); - //parent.ChildNodes.Add(module); - } - - doc.Save(TargetFile); - - return true; - - } - else - { - //might be on master template - if (t.HasMasterTemplate) - return MoveModule(template, module, targetId,index); - else - return false; - } - } - - private HtmlNode FindModule(int template, string id, bool remove) - { - Template t = new Template(template); - string TargetFile = t.MasterPageFile; - string TargetID = id; - - HtmlDocument doc = new HtmlDocument(); - doc.Load(TargetFile); - - if (doc.DocumentNode.SelectSingleNode(string.Format("//*[@id = '{0}']", TargetID)) != null) - { - if (!remove) - return doc.DocumentNode.SelectSingleNode(string.Format("//*[@id = '{0}']", TargetID)); - else - { - HtmlNode r = doc.DocumentNode.SelectSingleNode(string.Format("//*[@id = '{0}']", TargetID)).Clone(); - - doc.DocumentNode.SelectSingleNode(string.Format("//*[@id = '{0}']", TargetID)).RemoveAll(); - - doc.Save(TargetFile); - - return r; - } - } - else - { - if (t.HasMasterTemplate) - return FindModule(template,id,remove); - else - return null; - } - } - private bool InsertModule(int template, string targetId, string tag, bool prepend) - { - Template t = new Template(template); - - string TargetFile = t.MasterPageFile; - string TargetID = targetId; - - HtmlDocument doc = new HtmlDocument(); - doc.Load(TargetFile); - - if (doc.DocumentNode.SelectNodes(string.Format("//*[@id = '{0}']", TargetID)) != null) - { - foreach (HtmlNode target in doc.DocumentNode.SelectNodes(string.Format("//*[@id = '{0}']", TargetID))) - { - HtmlNode macrotag = HtmlNode.CreateNode(tag); - - if (prepend) - target.PrependChild(macrotag); - else - target.AppendChild(macrotag); - } - doc.Save(TargetFile); - - return true; - } - else - { - //might be on master template - if (t.HasMasterTemplate) - return InsertModule(t.MasterTemplate, targetId, tag, prepend); - else - return false; - } - } - } -} \ No newline at end of file diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/SkinModule.js b/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/SkinModule.js deleted file mode 100644 index ab545be481..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/SkinModule.js +++ /dev/null @@ -1 +0,0 @@ -/********************* Live Editing SkinModule functions *********************/ diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/skin.png b/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Modules/SkinModule/skin.png deleted file mode 100644 index ea3f06e5a688563c9425dcaebdcd355873bedbb2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3764 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 euj$0#e+B^I{LK$t{mZ`q0000 - /// Initializes a new instance of the class. - /// - /// The Live Editing manager. - public UnpublishModule(LiveEditingManager manager) - : base(manager) - { } - - /// - /// Raises the event. - /// - /// An object that contains the event data. - protected override void OnInit(EventArgs e) - { - base.OnInit(e); - EnsureChildControls(); - - } - - /// - /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering. - /// - protected override void CreateChildControls() - { - base.CreateChildControls(); - - m_UnpublishModal = new Panel(); - m_UnpublishModal.ID = "LeUnpublishModal"; - m_UnpublishModal.Attributes.Add("Style", "display: none"); - - m_CancelDeleteButton = new Button(); - m_CancelDeleteButton.ID = "CancelUnpublish"; - m_CancelDeleteButton.Text = ui.GetText("cancel"); - m_CancelDeleteButton.CssClass = "modalbuton"; - - m_ConfirmUnpublishButton = new Button(); - m_ConfirmUnpublishButton.Text = ui.GetText("ok"); - m_ConfirmUnpublishButton.ID = "LeUnpublishModalConfirm"; - m_ConfirmUnpublishButton.CssClass = "modalbuton"; - m_ConfirmUnpublishButton.OnClientClick = "UnpublishModuleOk();"; - - m_UnpublishModal.Controls.Add(new LiteralControl("

" + ui.GetText("areyousure") + "

")); - m_UnpublishModal.Controls.Add(m_ConfirmUnpublishButton); - m_UnpublishModal.Controls.Add(new LiteralControl(" ")); - m_UnpublishModal.Controls.Add(m_CancelDeleteButton); - - Controls.Add(m_UnpublishModal); - - m_UnpublishButton = new ImageButton(); - m_UnpublishButton.ID = "LeUnpublishButton"; - m_UnpublishButton.CssClass = "button"; - m_UnpublishButton.ToolTip = "Unpublish"; - m_UnpublishButton.ImageUrl = String.Format("{0}/LiveEditing/Modules/UnpublishModule/unpublish.png", SystemDirectories.Umbraco); - m_UnpublishButton.Visible = UmbracoContext.Current.HasPermission(ActionUnPublish.Instance.Letter); - m_UnpublishButton.OnClientClick = "jQuery('#" + m_UnpublishModal.ClientID + @"').ModalWindowShow('" + ui.GetText("unPublish") + "',true,300,200,50,0, ['.modalbuton'], null);return false;"; - - Controls.Add(m_UnpublishButton); - } - - - /// - /// Handles the MessageReceived event of the Live Editing manager. - /// - /// The sender. - /// The e. - protected override void Manager_MessageReceived(object sender, MesssageReceivedArgs e) - { - switch (e.Type) - { - case "unpublishcontent": - var currentPage = new Document(int.Parse(UmbracoContext.Current.PageId.ToString())); - currentPage.UnPublish(); - string redirectUrl = "/"; - try - { - redirectUrl = library.NiceUrl(currentPage.Parent.Id); - } - catch - { - } - - Page.Response.Redirect(redirectUrl); - break; - } - } - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Updates/DefaultUpdateList.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Updates/DefaultUpdateList.cs deleted file mode 100644 index 2f46cac02b..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Updates/DefaultUpdateList.cs +++ /dev/null @@ -1,134 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; - -namespace umbraco.presentation.LiveEditing.Updates -{ - /// - /// Default implementation of . - /// - [Serializable] - public class DefaultUpdateList : IUpdateList - { - /// The internal list of updates. - private List m_Updates = new List(); - - /// - /// Occurs when an update is added to the list. - /// - [field: NonSerialized] - public event EventHandler UpdateAdded; - - #region IUpdateList Members - - /// - /// Adds the specified item to the list. - /// - /// The item. - public void Add(IUpdate update) - { - m_Updates.Add(update); - if (UpdateAdded != null) - UpdateAdded(this, new UpdateAddedEventArgs(update)); - } - - /// - /// Saves all updates. - /// - public void SaveAll() - { - foreach(IUpdate update in this) - update.Save(); - } - - /// - /// Publishes all updates. - /// - public void PublishAll() - { - foreach (IUpdate update in this) - update.Publish(); - } - - /// - /// Gets all updates of the specified type. - /// - /// Type of updates to find. - /// All matching updates. - public IList GetAll() where T : IUpdate - { - return GetAll(t => true); - } - - /// - /// Gets all updates satisfying the matcher. - /// - /// Type of updates to find. - /// The matcher. - /// All matching updates. - public IList GetAll(Predicate matcher) where T : IUpdate - { - List matchingUpdates = new List(); - foreach(IUpdate update in this) - { - if(update is T && matcher((T)update)) - { - matchingUpdates.Add((T)update); - } - } - return matchingUpdates; - } - - /// - /// Gets the latest update satisfying the matcher. - /// - /// Type of the update. - /// The matcher. - /// - /// The latest matching update if found, otherwise null. - /// - public T GetLatest(Predicate matcher) where T : IUpdate - { - for (int i = m_Updates.Count - 1; i >= 0; i--) - { - IUpdate update = m_Updates[i]; - if (update is T && matcher((T)update)) - return (T)update; - } - return default(T); - } - - #endregion - - #region IEnumerable Members - - /// - /// Returns an enumerator that iterates through the collection. - /// - /// - /// A that can be used to iterate through the collection. - /// - public IEnumerator GetEnumerator() - { - return m_Updates.GetEnumerator(); - } - - #endregion - - #region IEnumerable Members - - /// - /// Returns an enumerator that iterates through the collection. - /// - /// - /// An object that can be used to iterate through the collection. - /// - IEnumerator IEnumerable.GetEnumerator() - { - return ((IEnumerable)m_Updates).GetEnumerator(); - } - - #endregion - - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Updates/IUpdate.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Updates/IUpdate.cs deleted file mode 100644 index 9a7e96d1bb..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Updates/IUpdate.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace umbraco.presentation.LiveEditing.Updates -{ - /// - /// Interface for a class that holds information about a Live Editing update. - /// - public interface IUpdate - { - /// - /// Saves the update. - /// - void Save(); - - /// - /// Publishes the update. - /// - void Publish(); - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Updates/IUpdateList.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Updates/IUpdateList.cs deleted file mode 100644 index 1ad55d551e..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Updates/IUpdateList.cs +++ /dev/null @@ -1,74 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace umbraco.presentation.LiveEditing.Updates -{ - /// - /// Interface for a list of Live Editing updates. - /// - public interface IUpdateList : IEnumerable - { - /// Occurs when an update is added to the list. - event EventHandler UpdateAdded; - - /// - /// Adds the specified item to the list. - /// - /// The item. - void Add(IUpdate update); - - /// - /// Saves all updates. - /// - void SaveAll(); - - /// - /// Publishes all updates. - /// - void PublishAll(); - - /// - /// Gets all updates of the specified type. - /// - /// Type of updates to find. - /// All matching updates. - IList GetAll() where T : IUpdate; - - /// - /// Gets all updates of the specified type satisfying the matcher. - /// - /// Type of updates to find. - /// The matcher. - /// All matching updates. - IList GetAll(Predicate matcher) where T : IUpdate; - - /// - /// Gets the latest update of the specified type satisfying the matcher. - /// - /// Type of the update. - /// The matcher. - /// The latest matching update if found, otherwise null. - T GetLatest(Predicate matcher) where T : IUpdate; - } - - /// - /// Event arguments for the event. - /// - public class UpdateAddedEventArgs : EventArgs - { - /// - /// Gets the added update. - /// - /// The update. - public IUpdate Update { get; private set; } - - /// - /// Initializes a new instance of the class. - /// - /// The update. - public UpdateAddedEventArgs(IUpdate update) - { - Update = update; - } - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Utility.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Utility.cs deleted file mode 100644 index 809a9b9a91..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/LiveEditing/Utility.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Web.UI; - -namespace umbraco.presentation.LiveEditing -{ - /// - /// Utility that simplifies some commmon tasks for Live Editing. - /// - public static class Utility - { - /// - /// Finds a control satisfying a matcher recursively. - /// - /// Type of the control to find. - /// The matcher. - /// Control where the search should start at. - /// The control if found; otherwise null. - public static T FindControl(Predicate matcher, Control root) where T : Control - { - // is this item the one we are looking for? - if (root is T && matcher((T)root)) - return (T)root; - - // try to find the item in child controls recursively - foreach (Control child in root.Controls) - { - T foundControl = FindControl(matcher, child); - if (foundControl != null) - return foundControl; - } - return null; - } - - /// - /// Finds all controls of the given type. - /// - /// Type of the control to find. - /// Control where the search should start at. - /// All satisfying controls. - public static List FindControls(Control root) where T : Control - { - return FindControls(t => true, root); - } - - /// - /// Finds all controls satisfying a matcher recursively. - /// - /// Type of the control to find. - /// The matcher. - /// Control where the search should start at. - /// All satisfying controls. - public static List FindControls(Predicate matcher, Control root) where T : Control - { - List controls = new List(); - - // add current control if it matches - if (root is T && matcher((T)root)) - controls.Add((T)root); - - // add matching child controls recursively - foreach (Control child in root.Controls) - controls.AddRange(FindControls(matcher, child)); - - return controls; - } - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadContent.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadContent.cs index 3b35201928..49251f2ebd 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadContent.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadContent.cs @@ -115,10 +115,6 @@ namespace umbraco { actions.Clear(); actions.Add(ActionNew.Instance); - if (UmbracoConfiguration.Current.UmbracoSettings.Content.EnableCanvasEditing) - { - actions.Add(ActionLiveEdit.Instance); - } actions.Add(ContextMenuSeperator.Instance); actions.Add(ActionDelete.Instance); actions.Add(ContextMenuSeperator.Instance); diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/canvas.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/canvas.aspx.cs deleted file mode 100644 index 9d24ac92aa..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/canvas.aspx.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using Umbraco.Core.Configuration; -using umbraco.BasePages; -using umbraco.BusinessLogic; -using umbraco.businesslogic.Exceptions; - -namespace umbraco.presentation -{ - public partial class LiveEditingEnabler : UmbracoEnsuredPage - { - public LiveEditingEnabler() - { - CurrentApp = DefaultApps.content.ToString(); - } - - protected void Page_Load(object sender, EventArgs e) - { - if ((UmbracoConfiguration.Current.UmbracoSettings.Content.EnableCanvasEditing || !String.IsNullOrEmpty(Request["umbSkinning"])) && getUser() != null) - { - UmbracoContext.Current.LiveEditingContext.Enabled = true; - - var redirUrl = "/"; - if (!string.IsNullOrEmpty(helper.Request("redir"))) - redirUrl = helper.Request("redir"); - else if (Request.UrlReferrer != null && !Request.UrlReferrer.AbsolutePath.Contains("login.aspx")) - redirUrl = Request.UrlReferrer.AbsolutePath; - - Response.Redirect(redirUrl + - (string.IsNullOrEmpty(Request["umbSkinning"]) ? "" : "?umbSkinning=true") + (string.IsNullOrEmpty(Request["umbSkinningConfigurator"]) ? "" : "&umbSkinningConfigurator=true"), true); - } - else if (!UmbracoConfiguration.Current.UmbracoSettings.Content.EnableCanvasEditing) - { - throw new UserAuthorizationException( - "Canvas editing isn't enabled. It can be enabled via the UmbracoSettings.config"); - } - else - { - throw new Exception("User not logged in"); - } - } - - /// - /// form1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.HtmlControls.HtmlForm form1; - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/login.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/login.aspx.cs index 769c6be5df..62c3f32b70 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/login.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/login.aspx.cs @@ -75,36 +75,9 @@ namespace umbraco.cms.presentation if (Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.DefaultBackOfficeUserProvider] is ActiveDirectoryMembershipProvider) ActiveDirectoryMapping(lname.Text, Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.DefaultBackOfficeUserProvider].GetUser(lname.Text, false).Email); - BusinessLogic.User u = new User(lname.Text); + var u = new User(lname.Text); doLogin(u); - - // Check if the user should be redirected to live editing - if (UmbracoConfiguration.Current.UmbracoSettings.Content.EnableCanvasEditing && u.DefaultToLiveEditing) - { - int startNode = u.StartNodeId; - // If the startnode is -1 (access to all content), we'll redirect to the top root node - if (startNode == -1) - { - if (Document.CountLeafNodes(-1, Document._objectType) > 0) - { - //get the first document - var firstNodeId = Document.TopMostNodeIds(Document._objectType).First(); - startNode = new Document(firstNodeId).Id; - } - else - { - throw new Exception("There's currently no content to edit. Please contact your system administrator"); - } - } - string redir = String.Format("{0}/canvas.aspx?redir=/{1}.aspx", SystemDirectories.Umbraco, startNode); - Response.Redirect(redir, true); - } - else if (u.DefaultToLiveEditing) - { - throw new UserAuthorizationException( - "Canvas editing isn't enabled. It can be enabled via the UmbracoSettings.config"); - } - + if (hf_height.Value != "undefined") { Session["windowHeight"] = hf_height.Value; diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/masterpages/default.Master.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/masterpages/default.Master.cs index 2bb660c817..4b765274fb 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/masterpages/default.Master.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/masterpages/default.Master.cs @@ -1,98 +1,26 @@ using System; -using System.Diagnostics; using System.Web.Mvc; using System.Web.UI; -using StackExchange.Profiling; -using Umbraco.Core.Profiling; using Umbraco.Web; -using umbraco.presentation.LiveEditing; -using umbraco.presentation.LiveEditing.Controls; using System.IO; namespace umbraco.presentation.masterpages { - public partial class _default : System.Web.UI.MasterPage + public partial class _default : MasterPage { - protected ILiveEditingContext m_LiveEditingContext = UmbracoContext.Current.LiveEditingContext; - - protected void Page_Load(object sender, EventArgs e) - { - try - { - AddLiveEditingSupport(); - } - catch (Exception ex) - { - throw new ApplicationException("Error adding Canvas support.", ex); - } - } - - protected override void OnPreRender(EventArgs e) - { - base.OnPreRender(e); - } - + protected override void Render(HtmlTextWriter writer) { - if (m_LiveEditingContext.Enabled == false) - { - // profiling - if (string.IsNullOrEmpty(Request.QueryString["umbDebug"]) == false && GlobalSettings.DebugMode) - { - var baseWriter = new StringWriter(); - base.Render(new HtmlTextWriter(baseWriter)); - var baseOutput = baseWriter.ToString(); + // get base output + StringWriter baseWriter = new StringWriter(); + base.Render(new HtmlTextWriter(baseWriter)); + string baseOutput = baseWriter.ToString(); - var htmlHelper = new HtmlHelper(new ViewContext(), new ViewPage()); - baseOutput = baseOutput.Replace("", htmlHelper.RenderProfiler() + ""); - writer.Write(baseOutput); - } + // add custom umbraco namespace (required for events on custom tags in IE) + baseOutput = baseOutput.Replace(" diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Item.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Item.cs index 5d9e608fa8..8a30dfe1ee 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Item.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Item.cs @@ -1,14 +1,11 @@ using System; using System.Collections; using System.ComponentModel; -using System.Security; -using System.Security.Permissions; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Umbraco.Core.Models; using umbraco.BusinessLogic.Actions; -using umbraco.presentation.LiveEditing.Modules.ItemEditing; namespace umbraco.presentation.templateControls { @@ -195,8 +192,7 @@ namespace umbraco.presentation.templateControls m_ItemId = (lastItemId != null ? (int)lastItemId + 1 : 1); HttpContext.Current.Items["LiveEditing_LastItemId"] = m_ItemId; - Renderer = !UmbracoContext.Current.LiveEditingContext.Enabled ? ItemRenderer.Instance - : LiveEditingItemRenderer.Instance; + Renderer = ItemRenderer.Instance; } /// 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 7af9298a15..a3679e4a22 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/users/EditUser.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/users/EditUser.aspx.cs @@ -42,8 +42,6 @@ namespace umbraco.cms.presentation.user protected DropDownList userLanguage = new DropDownList(); protected CheckBox NoConsole = new CheckBox(); protected CheckBox Disabled = new CheckBox(); - protected CheckBox DefaultToLiveEditing = new CheckBox(); - protected controls.ContentPicker mediaPicker = new umbraco.controls.ContentPicker(); protected controls.ContentPicker contentPicker = new umbraco.controls.ContentPicker(); @@ -78,10 +76,7 @@ namespace umbraco.cms.presentation.user { throw new Exception("Admin users can only be edited by admins"); } - - // check if canvas editing is enabled - DefaultToLiveEditing.Visible = UmbracoConfiguration.Current.UmbracoSettings.Content.EnableCanvasEditing; - + // Populate usertype list foreach (UserType ut in UserType.getAll) { @@ -115,8 +110,7 @@ namespace umbraco.cms.presentation.user // Console access and disabling NoConsole.Checked = u.NoConsole; Disabled.Checked = u.Disabled; - DefaultToLiveEditing.Checked = u.DefaultToLiveEditing; - + PlaceHolder medias = new PlaceHolder(); mediaPicker.AppAlias = Constants.Applications.Media; mediaPicker.TreeAlias = "media"; @@ -157,10 +151,7 @@ namespace umbraco.cms.presentation.user //Generel umrbaco access Pane ppAccess = new Pane(); - if (UmbracoConfiguration.Current.UmbracoSettings.Content.EnableCanvasEditing) - { - ppAccess.addProperty(ui.Text("user", "defaultToLiveEditing", base.getUser()), DefaultToLiveEditing); - } + ppAccess.addProperty(ui.Text("user", "noConsole", base.getUser()), NoConsole); ppAccess.addProperty(ui.Text("user", "disabled", base.getUser()), Disabled); @@ -427,7 +418,7 @@ namespace umbraco.cms.presentation.user u.Disabled = Disabled.Checked; - u.DefaultToLiveEditing = DefaultToLiveEditing.Checked; + u.NoConsole = NoConsole.Checked; //u.StartMediaId = int.Parse(mediaStartNode.Value); diff --git a/src/umbraco.businesslogic/UmbracoSettings.cs b/src/umbraco.businesslogic/UmbracoSettings.cs index 5f067477ac..3b5af36d9f 100644 --- a/src/umbraco.businesslogic/UmbracoSettings.cs +++ b/src/umbraco.businesslogic/UmbracoSettings.cs @@ -93,15 +93,7 @@ namespace umbraco { get { return UmbracoConfiguration.Current.UmbracoSettings.Security.KeepUserLoggedIn; } } - - /// - /// Enables the experimental canvas (live) editing on the frontend of the website - /// - public static bool EnableCanvasEditing - { - get { return UmbracoConfiguration.Current.UmbracoSettings.Content.EnableCanvasEditing; } - } - + /// /// Show disabled users in the tree in the Users section in the backoffice /// diff --git a/src/umbraco.businesslogic/User.cs b/src/umbraco.businesslogic/User.cs index 18caa435ad..6c84ef6fd8 100644 --- a/src/umbraco.businesslogic/User.cs +++ b/src/umbraco.businesslogic/User.cs @@ -28,8 +28,7 @@ namespace umbraco.BusinessLogic private UserType _usertype; private bool _userNoConsole; private bool _userDisabled; - private bool _defaultToLiveEditing; - + private Hashtable _notifications = new Hashtable(); private bool _notificationsInitialized = false; @@ -51,7 +50,6 @@ namespace umbraco.BusinessLogic _startmediaid = user.StartMediaId; //this is cached, so should be 'ok' _usertype = UserType.GetUserType(user.UserType.Id); - _defaultToLiveEditing = user.DefaultToLiveEditing; _isInitialized = true; } @@ -99,7 +97,7 @@ namespace umbraco.BusinessLogic _id = ID; using (IRecordsReader dr = SqlHelper.ExecuteReader( - "Select userNoConsole, userDisabled, userType,startStructureID, startMediaId, userName,userLogin,userEmail,userDefaultPermissions, userLanguage, defaultToLiveEditing from umbracoUser where id = @id", + "Select userNoConsole, userDisabled, userType,startStructureID, startMediaId, userName,userLogin,userEmail, userLanguage from umbracoUser where id = @id", SqlHelper.CreateParameter("@id", ID))) { if (dr.Read()) @@ -114,7 +112,6 @@ namespace umbraco.BusinessLogic if (!dr.IsNull("startMediaId")) _startmediaid = dr.GetInt("startMediaID"); _usertype = UserType.GetUserType(dr.GetShort("UserType")); - _defaultToLiveEditing = dr.GetBoolean("defaultToLiveEditing"); } else { @@ -867,28 +864,6 @@ namespace umbraco.BusinessLogic } } - /// - /// Gets or sets a value indicating whether a user should be redirected to liveediting by default. - /// - /// - /// true if defaults to live editing; otherwise, false. - /// - public bool DefaultToLiveEditing - { - get - { - if (!_isInitialized) - setupUser(_id); - return _defaultToLiveEditing; - } - set - { - _defaultToLiveEditing = value; - SqlHelper.ExecuteNonQuery("update umbracoUser set defaultToLiveEditing = @defaultToLiveEditing where id = @id", SqlHelper.CreateParameter("@id", this.Id), SqlHelper.CreateParameter("@defaultToLiveEditing", _defaultToLiveEditing)); - FlushFromCache(); - } - } - /// /// Gets or sets the start content node id. /// diff --git a/src/umbraco.cms/Actions/ActionLiveEdit.cs b/src/umbraco.cms/Actions/ActionLiveEdit.cs deleted file mode 100644 index e287cb8dc6..0000000000 --- a/src/umbraco.cms/Actions/ActionLiveEdit.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System; -using umbraco.interfaces; -using umbraco.BasePages; - -namespace umbraco.BusinessLogic.Actions -{ - public class ActionLiveEdit : IAction - { - //create singleton - private static readonly ActionLiveEdit instance = new ActionLiveEdit(); - private ActionLiveEdit() { } - public static ActionLiveEdit Instance - { - get { return instance; } - } - - #region IAction Members - - public char Letter - { - get { return ':'; } - } - - public bool ShowInNotifier - { - get { return false; } - } - - public bool CanBePermissionAssigned - { - get { return true; } - } - - public string Icon - { - get { return "edit"; } - } - - public string Alias - { - get { return "liveEdit"; } - } - - public string JsFunctionName - { - get - { - return string.Format("{0}.actionLiveEdit()", ClientTools.Scripts.GetAppActions); - } - } - - public string JsSource - { - get { return ""; } - } - - #endregion - } -} diff --git a/src/umbraco.cms/umbraco.cms.csproj b/src/umbraco.cms/umbraco.cms.csproj index 19fa159ac4..1c218bc3a8 100644 --- a/src/umbraco.cms/umbraco.cms.csproj +++ b/src/umbraco.cms/umbraco.cms.csproj @@ -184,7 +184,6 @@ - diff --git a/src/umbraco.editorControls/BaseTreePickerEditor.cs b/src/umbraco.editorControls/BaseTreePickerEditor.cs index 9908d07e46..047b72519b 100644 --- a/src/umbraco.editorControls/BaseTreePickerEditor.cs +++ b/src/umbraco.editorControls/BaseTreePickerEditor.cs @@ -52,9 +52,8 @@ namespace umbraco.editorControls base.OnLoad(e); //need to check if this is an async postback in live editing, because if it is, we need to set the value - if ((ScriptManager.GetCurrent(Page).IsInAsyncPostBack - && UmbracoContext.Current.LiveEditingContext.Enabled) - || !Page.IsPostBack) + //SD: Since live editing is removed I don't really think this is at all necessary but it's still here. + if ((ScriptManager.GetCurrent(Page).IsInAsyncPostBack) || !Page.IsPostBack) { ItemIdValue.Value = StoredItemId != -1 ? StoredItemId.ToString() : ""; } diff --git a/src/umbraco.editorControls/macrocontainer/Editor.cs b/src/umbraco.editorControls/macrocontainer/Editor.cs index 5f9c5ae066..4f0d62630f 100644 --- a/src/umbraco.editorControls/macrocontainer/Editor.cs +++ b/src/umbraco.editorControls/macrocontainer/Editor.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Text; using System.Web.UI; using System.Web.UI.WebControls; +using Umbraco.Core.IO; using umbraco.interfaces; using umbraco.cms.businesslogic.macro; using umbraco.presentation.webservices; @@ -12,7 +13,6 @@ using ClientDependency.Core; using System.Web; using ClientDependency.Core.Controls; using umbraco.presentation; -using umbraco.IO; namespace umbraco.editorControls.macrocontainer { @@ -44,27 +44,18 @@ namespace umbraco.editorControls.macrocontainer { base.OnInit(e); - //SD: This is useless as it won't work in live editing anyways whilst using MS Ajax/ScriptManager for ajax calls - if (!UmbracoContext.Current.LiveEditingContext.Enabled) - { - presentation.webservices.ajaxHelpers.EnsureLegacyCalls(base.Page); - ScriptManager sm = ScriptManager.GetCurrent(base.Page); - ServiceReference webservicePath = new ServiceReference(umbraco.IO.IOHelper.ResolveUrl(umbraco.IO.SystemDirectories.Umbraco) + "/webservices/MacroContainerService.asmx"); + ajaxHelpers.EnsureLegacyCalls(base.Page); + var sm = ScriptManager.GetCurrent(base.Page); + var webservicePath = new ServiceReference(IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/webservices/MacroContainerService.asmx"); - if (!sm.Services.Contains(webservicePath)) - sm.Services.Add(webservicePath); - } - else - { - ClientDependencyLoader.Instance.RegisterDependency("webservices/legacyAjaxCalls.asmx/js", "UmbracoRoot", ClientDependencyType.Javascript); - ClientDependencyLoader.Instance.RegisterDependency("webservices/MacroContainerService.asmx/js", "UmbracoRoot", ClientDependencyType.Javascript); - } + if (!sm.Services.Contains(webservicePath)) + sm.Services.Add(webservicePath); _addMacro = new LinkButton(); _addMacro.ID = ID + "_btnaddmacro"; - _addMacro.Click += new EventHandler(_addMacro_Click); + _addMacro.Click += _addMacro_Click; _addMacro.Text = ui.Text("insertMacro"); _addMacro.CssClass = "macroContainerAdd"; diff --git a/src/umbraco.editorControls/macrocontainer/MacroEditor.cs b/src/umbraco.editorControls/macrocontainer/MacroEditor.cs index 32e918fd0c..a3dd15c849 100644 --- a/src/umbraco.editorControls/macrocontainer/MacroEditor.cs +++ b/src/umbraco.editorControls/macrocontainer/MacroEditor.cs @@ -85,71 +85,36 @@ namespace umbraco.editorControls.macrocontainer { base.OnLoad(e); - - if (!GlobalSettings.RequestIsInUmbracoApplication(HttpContext.Current) && umbraco.presentation.UmbracoContext.Current.LiveEditingContext.Enabled) + if (!Page.IsPostBack) { - if (ViewState[ID + "init"] == null) + + //Handle Initial Request + if (DataValues["macroalias"] != null) { - if (DataValues["macroalias"] != null) - { - //Data is available from the database, initialize the form with the data - string alias = DataValues["macroalias"].ToString(); + //Data is available from the database, initialize the form with the data + string alias = DataValues["macroalias"].ToString(); - //Set Pulldown selected value based on the macro alias - _macroSelectDropdown.SelectedValue = alias; + //Set Pulldown selected value based on the macro alias + _macroSelectDropdown.SelectedValue = alias; - //Create from with values based on the alias - InitializeForm(alias); - } - else - { - this.Visible = false; - } - - ViewState[ID + "init"] = "ok"; + //Create from with values based on the alias + InitializeForm(alias); } else { - //Render form if properties are in the viewstate - if (SelectedProperties.Count > 0) - { - RendeFormControls(); - } + this.Visible = false; } + } else { - - if (!Page.IsPostBack) + //Render form if properties are in the viewstate + if (SelectedProperties.Count > 0) { - - //Handle Initial Request - if (DataValues["macroalias"] != null) - { - //Data is available from the database, initialize the form with the data - string alias = DataValues["macroalias"].ToString(); - - //Set Pulldown selected value based on the macro alias - _macroSelectDropdown.SelectedValue = alias; - - //Create from with values based on the alias - InitializeForm(alias); - } - else - { - this.Visible = false; - } - - } - else - { - //Render form if properties are in the viewstate - if (SelectedProperties.Count > 0) - { - RendeFormControls(); - } + RendeFormControls(); } } + //Make sure child controls get rendered EnsureChildControls(); diff --git a/src/umbraco.editorControls/tinyMCE3/TinyMCE.cs b/src/umbraco.editorControls/tinyMCE3/TinyMCE.cs index a3d6e1c958..adf6a73b6c 100644 --- a/src/umbraco.editorControls/tinyMCE3/TinyMCE.cs +++ b/src/umbraco.editorControls/tinyMCE3/TinyMCE.cs @@ -102,8 +102,7 @@ namespace umbraco.editorControls.tinyMCE3 // If the editor is used in umbraco, use umbraco's own toolbar bool onFront = false; - if (GlobalSettings.RequestIsInUmbracoApplication(HttpContext.Current) || - UmbracoContext.Current.LiveEditingContext.Enabled) + if (GlobalSettings.RequestIsInUmbracoApplication(HttpContext.Current)) { config.Add("theme_umbraco_toolbar_location", "external"); config.Add("skin", "umbraco"); From f127d3192821f145668097fe49310a8d7831b77e Mon Sep 17 00:00:00 2001 From: Shannon Date: Wed, 25 Sep 2013 12:05:07 +1000 Subject: [PATCH 03/17] Gets the rte macro contents rendering with macro parameter values. --- .../src/common/resources/macro.resource.js | 16 +++++- .../src/common/services/macro.service.js | 51 +++++++++++-------- .../src/common/services/tinymce.service.js | 2 +- .../common/dialogs/insertmacro.controller.js | 17 ++++--- .../common/services/macro-service.spec.js | 38 +++++++------- src/Umbraco.Web/Editors/MacroController.cs | 10 +++- src/Umbraco.Web/Editors/MediaController.cs | 2 + 7 files changed, 85 insertions(+), 51 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/resources/macro.resource.js b/src/Umbraco.Web.UI.Client/src/common/resources/macro.resource.js index a8c929118e..4e6c03b51a 100644 --- a/src/Umbraco.Web.UI.Client/src/common/resources/macro.resource.js +++ b/src/Umbraco.Web.UI.Client/src/common/resources/macro.resource.js @@ -40,15 +40,27 @@ function macroResource($q, $http, umbRequestHelper) { * * @param {int} macroId The macro id to get parameters for * @param {int} pageId The current page id + * @param {Array} macroParamDictionary A dictionary of macro parameters * */ - getMacroResultAsHtmlForEditor: function (macroAlias, pageId) { + getMacroResultAsHtmlForEditor: function (macroAlias, pageId, macroParamDictionary) { + + //need to format the query string for the custom dictionary + var query = "macroAlias=" + macroAlias + "&pageId=" + pageId; + if (macroParamDictionary) { + var counter = 0; + _.each(macroParamDictionary, function(val, key) { + query += "¯oParams[" + counter + "].key=" + key + "¯oParams[" + counter + "].value=" + val; + counter++; + }); + } + return umbRequestHelper.resourcePromise( $http.get( umbRequestHelper.getApiUrl( "macroApiBaseUrl", "GetMacroResultAsHtmlForEditor", - [{ macroAlias: macroAlias }, { pageId: pageId }])), + query)), 'Failed to retreive macro result for macro with alias ' + macroAlias); } diff --git a/src/Umbraco.Web.UI.Client/src/common/services/macro.service.js b/src/Umbraco.Web.UI.Client/src/common/services/macro.service.js index 10101f0a98..f6bf63596e 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/macro.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/macro.service.js @@ -52,12 +52,13 @@ function macroService() { var macroString = '"; @@ -80,12 +81,13 @@ function macroService() { var macroString = '"; @@ -108,19 +110,28 @@ function macroService() { var macroString = "@Umbraco.RenderMacro(\"" + args.macroAlias + "\""; - if (args.macroParams && args.macroParams.length > 0) { - macroString += ", new {"; - for (var i = 0; i < args.macroParams.length; i++) { - - var keyVal = args.macroParams[i].alias + "=\"" + (args.macroParams[i].value ? args.macroParams[i].value : "") + "\""; + var hasParams = false; + var paramString; + if (args.marcoParamsDictionary) { + + paramString = ", new {"; - macroString += keyVal; + _.each(args.marcoParamsDictionary, function(val, key) { + + hasParams = true; - if (i < args.macroParams.length - 1) { - macroString += ", "; - } - } - macroString += "}"; + var keyVal = key + "=\"" + (val ? val : "") + "\", "; + + paramString += keyVal; + }); + + //remove the last , + paramString = paramString.trimEnd(", "); + + paramString += "}"; + } + if (hasParams) { + macroString += paramString; } macroString += ")"; diff --git a/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js b/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js index 3387b44b91..532fe06bb5 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js @@ -357,7 +357,7 @@ function tinyMceService(dialogService, $log, imageHelper, assetsService, $timeou //show the throbber $macroDiv.addClass("loading"); - macroResource.getMacroResultAsHtmlForEditor(data.macroAlias, 1234) + macroResource.getMacroResultAsHtmlForEditor(data.macroAlias, 1234, data.marcoParamsDictionary) .then(function (htmlResult) { $macroDiv.removeClass("loading"); diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/insertmacro.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/insertmacro.controller.js index 99e2fca98d..437e5a2472 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/insertmacro.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/insertmacro.controller.js @@ -44,10 +44,13 @@ function InsertMacroController($scope, entityResource, macroResource, umbPropEdi function submitForm() { //collect the value data, close the dialog and send the data back to the caller - var vals = _.map($scope.macroParams, function (item) { - return { value: item.value, alias: item.alias }; - }); + //create a dictionary for the macro params + var paramDictionary = {}; + _.each($scope.macroParams, function (item) { + paramDictionary[item.alias] = item.value; + }); + //need to find the macro alias for the selected id var macroAlias = _.find($scope.macros, function (item) { return item.id == $scope.selectedMacro; @@ -56,16 +59,16 @@ function InsertMacroController($scope, entityResource, macroResource, umbPropEdi //get the syntax based on the rendering engine var syntax; if ($scope.dialogData.renderingEngine && $scope.dialogData.renderingEngine === "WebForms") { - syntax = macroService.generateWebFormsSyntax({ macroAlias: macroAlias, macroParams: vals }); + syntax = macroService.generateWebFormsSyntax({ macroAlias: macroAlias, marcoParamsDictionary: paramDictionary }); } else if ($scope.dialogData.renderingEngine && $scope.dialogData.renderingEngine === "Mvc") { - syntax = macroService.generateMvcSyntax({ macroAlias: macroAlias, macroParams: vals }); + syntax = macroService.generateMvcSyntax({ macroAlias: macroAlias, marcoParamsDictionary: paramDictionary }); } else { - syntax = macroService.generateMacroSyntax({ macroAlias: macroAlias, macroParams: vals }); + syntax = macroService.generateMacroSyntax({ macroAlias: macroAlias, marcoParamsDictionary: paramDictionary }); } - $scope.submit({syntax : syntax, macroAlias: macroAlias, macroParams: vals }); + $scope.submit({ syntax: syntax, macroAlias: macroAlias, marcoParamsDictionary: paramDictionary }); } $scope.macros = []; diff --git a/src/Umbraco.Web.UI.Client/test/unit/common/services/macro-service.spec.js b/src/Umbraco.Web.UI.Client/test/unit/common/services/macro-service.spec.js index 4b578c2418..78768cb4e2 100644 --- a/src/Umbraco.Web.UI.Client/test/unit/common/services/macro-service.spec.js +++ b/src/Umbraco.Web.UI.Client/test/unit/common/services/macro-service.spec.js @@ -47,11 +47,11 @@ describe('macro service tests', function () { var syntax = macroService.generateMacroSyntax({ macroAlias: "myMacro", - macroParams: [ - { alias: "param1", value: "value1" }, - { alias: "param2", value: "value2" }, - { alias: "param3", value: "value3" } - ] + marcoParamsDictionary: { + param1: "value1", + param2: "value2", + param3: "value3" + } }); expect(syntax). @@ -63,7 +63,7 @@ describe('macro service tests', function () { var syntax = macroService.generateMacroSyntax({ macroAlias: "myMacro", - macroParams: [] + marcoParamsDictionary: {} }); expect(syntax). @@ -75,11 +75,11 @@ describe('macro service tests', function () { var syntax = macroService.generateWebFormsSyntax({ macroAlias: "myMacro", - macroParams: [ - { alias: "param1", value: "value1" }, - { alias: "param2", value: "value2" }, - { alias: "param3", value: "value3" } - ] + marcoParamsDictionary: { + param1: "value1", + param2: "value2", + param3: "value3" + } }); expect(syntax). @@ -91,7 +91,7 @@ describe('macro service tests', function () { var syntax = macroService.generateWebFormsSyntax({ macroAlias: "myMacro", - macroParams: [] + marcoParamsDictionary: {} }); expect(syntax). @@ -103,11 +103,11 @@ describe('macro service tests', function () { var syntax = macroService.generateMvcSyntax({ macroAlias: "myMacro", - macroParams: [ - { alias: "param1", value: "value1" }, - { alias: "param2", value: "value2" }, - { alias: "param3", value: "value3" } - ] + marcoParamsDictionary: { + param1: "value1", + param2: "value2", + param3: "value3" + } }); expect(syntax). @@ -116,11 +116,11 @@ describe('macro service tests', function () { }); - it('can generate syntax for webforms with no params', function () { + it('can generate syntax for MVC with no params', function () { var syntax = macroService.generateMvcSyntax({ macroAlias: "myMacro", - macroParams: [] + marcoParamsDictionary: {} }); expect(syntax). diff --git a/src/Umbraco.Web/Editors/MacroController.cs b/src/Umbraco.Web/Editors/MacroController.cs index da7b938f91..a3fee00c75 100644 --- a/src/Umbraco.Web/Editors/MacroController.cs +++ b/src/Umbraco.Web/Editors/MacroController.cs @@ -47,8 +47,14 @@ namespace Umbraco.Web.Editors /// /// /// + /// + /// To send a dictionary as a GET parameter the query should be structured like: + /// + /// ?macroAlias=Test&pageId=3634¯oParams[0].key=myKey¯oParams[0].value=myVal¯oParams[1].key=anotherKey¯oParams[1].value=anotherVal + /// + /// /// - public HttpResponseMessage GetMacroResultAsHtmlForEditor(string macroAlias, int pageId) + public HttpResponseMessage GetMacroResultAsHtmlForEditor(string macroAlias, int pageId, [FromUri]IDictionary macroParams) { var doc = Services.ContentService.GetById(pageId); if (doc == null) @@ -91,7 +97,7 @@ namespace Umbraco.Web.Editors //need to create a specific content result formatted as html since this controller has been configured //with only json formatters. Content = new StringContent( - Umbraco.RenderMacro(macro, new Dictionary(), legacyPage).ToString(), + Umbraco.RenderMacro(macro, macroParams, legacyPage).ToString(), Encoding.UTF8, "text/html" ) diff --git a/src/Umbraco.Web/Editors/MediaController.cs b/src/Umbraco.Web/Editors/MediaController.cs index d1e72831ad..33817e281c 100644 --- a/src/Umbraco.Web/Editors/MediaController.cs +++ b/src/Umbraco.Web/Editors/MediaController.cs @@ -243,6 +243,8 @@ namespace Umbraco.Web.Editors /// /// /// We cannot validate this request with attributes (nicely) due to the nature of the multi-part for data. + /// + /// TOOD: Validate this request properly! /// public async Task PostAddFile() { From 6c9fe2ebd0210fd8c3c8adca07a319fe69fa188e Mon Sep 17 00:00:00 2001 From: Shannon Date: Wed, 25 Sep 2013 13:54:25 +1000 Subject: [PATCH 04/17] Adds dynamic filtering to EntityService (post filtering for GetAll) - updated the insert macro dialog to ensure that it only shows macros flagged for the rte when in rte mode, otherwise shows all of them. adds unit tests for dynamic queryable stuff. --- .../Dynamics/QueryableExtensions.cs | 2 + .../Dynamics/QueryableExtensionTests.cs | 162 ++++++++++++++++++ src/Umbraco.Tests/Umbraco.Tests.csproj | 1 + .../src/common/resources/entity.resource.js | 17 +- .../src/common/services/tinymce.service.js | 11 +- .../common/dialogs/insertmacro.controller.js | 4 +- src/Umbraco.Web/Dynamics/DynamicQueryable.cs | 5 + src/Umbraco.Web/Dynamics/ExpressionParser.cs | 2 + src/Umbraco.Web/Editors/EntityController.cs | 42 ++++- src/Umbraco.Web/Editors/MacroController.cs | 2 + 10 files changed, 237 insertions(+), 11 deletions(-) create mode 100644 src/Umbraco.Tests/Dynamics/QueryableExtensionTests.cs diff --git a/src/Umbraco.Core/Dynamics/QueryableExtensions.cs b/src/Umbraco.Core/Dynamics/QueryableExtensions.cs index f90f08cfa2..b7fea7f68b 100644 --- a/src/Umbraco.Core/Dynamics/QueryableExtensions.cs +++ b/src/Umbraco.Core/Dynamics/QueryableExtensions.cs @@ -57,5 +57,7 @@ namespace Umbraco.Core.Dynamics .Invoke(null, new object[] { source, lambda }); return (IOrderedQueryable)result; } + + } } \ No newline at end of file diff --git a/src/Umbraco.Tests/Dynamics/QueryableExtensionTests.cs b/src/Umbraco.Tests/Dynamics/QueryableExtensionTests.cs new file mode 100644 index 0000000000..e93b7dc50a --- /dev/null +++ b/src/Umbraco.Tests/Dynamics/QueryableExtensionTests.cs @@ -0,0 +1,162 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using NUnit.Framework; +using Umbraco.Core.Dynamics; +using Umbraco.Web.Dynamics; +using Umbraco.Core.Models; + +namespace Umbraco.Tests.Dynamics +{ + //NOTE: there's libraries in both Umbraco.Core.Dynamics and Umbraco.Web.Dynamics - the reason for this is that the Web.Dynamics + // started with the razor macro implementation and is modified with hard coded references to dynamic node and dynamic null, though it seems + // to still work for other regular classes I don't want to move it to the core without removing these references but that would require a lot of work. + + [TestFixture] + public class QueryableExtensionTests + { + + [Test] + public void Order_By_Test_Int() + { + var items = new List + { + new TestModel {Age = 10, Name = "test1", Female = false}, + new TestModel {Age = 31, Name = "someguy", Female = true}, + new TestModel {Age = 11, Name = "test2", Female = true}, + new TestModel {Age = 20, Name = "anothertest", Female = false}, + new TestModel {Age = 55, Name = "blah", Female = false}, + new TestModel {Age = 12, Name = "test3", Female = false} + }; + + var result = items.AsQueryable().OrderBy("Age").ToArray(); + + Assert.AreEqual(10, result.ElementAt(0).Age); + Assert.AreEqual(11, result.ElementAt(1).Age); + Assert.AreEqual(12, result.ElementAt(2).Age); + Assert.AreEqual(20, result.ElementAt(3).Age); + Assert.AreEqual(31, result.ElementAt(4).Age); + Assert.AreEqual(55, result.ElementAt(5).Age); + + } + + [Test] + public void Order_By_Test_String() + { + var items = new List + { + new TestModel {Age = 10, Name = "test1", Female = false}, + new TestModel {Age = 31, Name = "someguy", Female = true}, + new TestModel {Age = 11, Name = "test2", Female = true}, + new TestModel {Age = 20, Name = "anothertest", Female = false}, + new TestModel {Age = 55, Name = "blah", Female = false}, + new TestModel {Age = 12, Name = "test3", Female = false} + }; + + var result = items.AsQueryable().OrderBy("Name").ToArray(); + + Assert.AreEqual("anothertest", result.ElementAt(0).Name); + Assert.AreEqual("blah", result.ElementAt(1).Name); + Assert.AreEqual("someguy", result.ElementAt(2).Name); + Assert.AreEqual("test1", result.ElementAt(3).Name); + Assert.AreEqual("test2", result.ElementAt(4).Name); + Assert.AreEqual("test3", result.ElementAt(5).Name); + + } + + [Test] + public void Where_Test_String() + { + var items = new List + { + new TestModel {Age = 10, Name = "test1", Female = false}, + new TestModel {Age = 31, Name = "someguy", Female = true}, + new TestModel {Age = 11, Name = "test2", Female = true}, + new TestModel {Age = 20, Name = "anothertest", Female = false}, + new TestModel {Age = 55, Name = "blah", Female = false}, + new TestModel {Age = 12, Name = "test3", Female = false} + }; + + var result = items.AsQueryable().Where("Name = \"test1\"").ToArray(); + + Assert.AreEqual(1, result.Count()); + Assert.AreEqual("test1", result.ElementAt(0).Name); + + + } + + [Test] + public void Where_Test_String_With_Params() + { + var items = new List + { + new TestModel {Age = 10, Name = "test1", Female = false}, + new TestModel {Age = 31, Name = "someguy", Female = true}, + new TestModel {Age = 11, Name = "test2", Female = true}, + new TestModel {Age = 20, Name = "anothertest", Female = false}, + new TestModel {Age = 55, Name = "blah", Female = false}, + new TestModel {Age = 12, Name = "test3", Female = false} + }; + + //NOTE: Currently the object query structure is not supported + //var result = items.AsQueryable().Where("Name = @name", new {name = "test1"}).ToArray(); + var result = items.AsQueryable().Where("Name = @Name", new Dictionary { { "Name", "test1" } }).ToArray(); + + Assert.AreEqual(1, result.Count()); + Assert.AreEqual("test1", result.ElementAt(0).Name); + + + } + + [Test] + public void Where_Test_Int_With_Params() + { + var items = new List + { + new TestModel {Age = 10, Name = "test1", Female = false}, + new TestModel {Age = 31, Name = "someguy", Female = true}, + new TestModel {Age = 11, Name = "test2", Female = true}, + new TestModel {Age = 20, Name = "anothertest", Female = false}, + new TestModel {Age = 55, Name = "blah", Female = false}, + new TestModel {Age = 12, Name = "test3", Female = false} + }; + + var result = items.AsQueryable().Where("Age = @Age", new Dictionary { { "Age", 10 } }).ToArray(); + + Assert.AreEqual(1, result.Count()); + Assert.AreEqual("test1", result.ElementAt(0).Name); + + + } + + [Test] + public void Where_Test_Bool_With_Params() + { + var items = new List + { + new TestModel {Age = 10, Name = "test1", Female = false}, + new TestModel {Age = 31, Name = "someguy", Female = true}, + new TestModel {Age = 11, Name = "test2", Female = true}, + new TestModel {Age = 20, Name = "anothertest", Female = false}, + new TestModel {Age = 55, Name = "blah", Female = false}, + new TestModel {Age = 12, Name = "test3", Female = false} + }; + + var result = items.AsQueryable().Where("Female = @Female", new Dictionary { { "Female", true } }).ToArray(); + + Assert.AreEqual(2, result.Count()); + + + } + + private class TestModel + { + public string Name { get; set; } + public int Age { get; set; } + public bool Female { get; set; } + } + + } +} diff --git a/src/Umbraco.Tests/Umbraco.Tests.csproj b/src/Umbraco.Tests/Umbraco.Tests.csproj index 38f3f87c8c..20d9ed5113 100644 --- a/src/Umbraco.Tests/Umbraco.Tests.csproj +++ b/src/Umbraco.Tests/Umbraco.Tests.csproj @@ -237,6 +237,7 @@ + diff --git a/src/Umbraco.Web.UI.Client/src/common/resources/entity.resource.js b/src/Umbraco.Web.UI.Client/src/common/resources/entity.resource.js index 164699eb05..ed4a539cba 100644 --- a/src/Umbraco.Web.UI.Client/src/common/resources/entity.resource.js +++ b/src/Umbraco.Web.UI.Client/src/common/resources/entity.resource.js @@ -128,16 +128,29 @@ function entityResource($q, $http, umbRequestHelper) { * * * @param {string} type Object type name + * @param {string} postFilter optional filter expression which will execute a dynamic where clause on the server + * @param {string} postFilterParams optional parameters for the postFilter expression * @returns {Promise} resourcePromise object containing the entity. * */ - getAll: function (type) { + getAll: function (type, postFilter, postFilterParams) { + + //need to build the query string manually + var query = "type=" + type + "&postFilter=" + (postFilter ? postFilter : ""); + if (postFilter && postFilterParams) { + var counter = 0; + _.each(postFilterParams, function(val, key) { + query += "&postFilterParams[" + counter + "].key=" + key + "&postFilterParams[" + counter + "].value=" + val; + counter++; + }); + } + return umbRequestHelper.resourcePromise( $http.get( umbRequestHelper.getApiUrl( "entityApiBaseUrl", "GetAll", - [{type: type }])), + query)), 'Failed to retreive entity data for type ' + type); }, diff --git a/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js b/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js index 532fe06bb5..6a87ea8a06 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js @@ -216,6 +216,12 @@ function tinyMceService(dialogService, $log, imageHelper, assetsService, $timeou } + /** when the contents load we need to find any macros declared and load in their content */ + editor.on("LoadContent", function(o) { + var asdf = editor.getContent(); + alert(asdf); + }); + /** This prevents any other commands from executing when the current element is the macro so the content cannot be edited */ editor.on('BeforeExecCommand', function (o) { if (isOnMacroElement) { @@ -310,7 +316,10 @@ function tinyMceService(dialogService, $log, imageHelper, assetsService, $timeou /** The insert macro button click event handler */ onclick: function () { - var dialogData; + var dialogData = { + //flag for use in rte so we only show macros flagged for the editor + richTextEditor: true + }; //when we click we could have a macro already selected and in that case we'll want to edit the current parameters //so we'll need to extract them and submit them to the dialog. diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/insertmacro.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/insertmacro.controller.js index 437e5a2472..c2d77eb5c3 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/insertmacro.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/insertmacro.controller.js @@ -104,8 +104,8 @@ function InsertMacroController($scope, entityResource, macroResource, umbPropEdi $scope.wizardStep = "paramSelect"; } - //get the macro list - entityResource.getAll("Macro") + //get the macro list - pass in a filter if it is only for rte + entityResource.getAll("Macro", ($scope.dialogData && $scope.dialogData.richTextEditor && $scope.dialogData.richTextEditor === true) ? "UseInEditor=true" : null) .then(function (data) { $scope.macros = data; diff --git a/src/Umbraco.Web/Dynamics/DynamicQueryable.cs b/src/Umbraco.Web/Dynamics/DynamicQueryable.cs index f4650af6d9..122fa0cd29 100644 --- a/src/Umbraco.Web/Dynamics/DynamicQueryable.cs +++ b/src/Umbraco.Web/Dynamics/DynamicQueryable.cs @@ -11,6 +11,11 @@ using Umbraco.Web.Models; namespace Umbraco.Web.Dynamics { + //TODO: Much of this can move to Umbraco.Core.Dynamics - but somehow need to remove all the hard coded references to things like + // dynamicnull, etc... + //NOTE: The OrderBy stuff here seems to be a bit hacked with hard references to umbraco node objects so don't think it can be + // re-used which is why we have the OrderBy stuff that hasn't been hacked in teh Umbraco.Core.Dynamics + internal static class DynamicQueryable { public static IQueryable Where(this IQueryable source, string predicate, params object[] values) diff --git a/src/Umbraco.Web/Dynamics/ExpressionParser.cs b/src/Umbraco.Web/Dynamics/ExpressionParser.cs index 1ab7b28716..d348682428 100644 --- a/src/Umbraco.Web/Dynamics/ExpressionParser.cs +++ b/src/Umbraco.Web/Dynamics/ExpressionParser.cs @@ -12,6 +12,8 @@ namespace Umbraco.Web.Dynamics { //SD: I wish all of this wasn't hacked and was just the original dynamic linq from MS... sigh. Just // means we can't really use it for anything other than dynamic node (i think) + // I'm fairly sure it's just hte convert to dynamic null stuff... still seems to work for normal linq operations would love to make it + // properly one day. internal class ExpressionParser { diff --git a/src/Umbraco.Web/Editors/EntityController.cs b/src/Umbraco.Web/Editors/EntityController.cs index 05eabdfa86..772f5ecbf3 100644 --- a/src/Umbraco.Web/Editors/EntityController.cs +++ b/src/Umbraco.Web/Editors/EntityController.cs @@ -20,6 +20,7 @@ using Constants = Umbraco.Core.Constants; using Examine; using Examine.LuceneEngine.SearchCriteria; using Examine.SearchCriteria; +using Umbraco.Web.Dynamics; namespace Umbraco.Web.Editors { @@ -69,9 +70,9 @@ namespace Umbraco.Web.Editors return GetResultForAncestors(id, type); } - public IEnumerable GetAll(UmbracoEntityTypes type) + public IEnumerable GetAll(UmbracoEntityTypes type, string postFilter, [FromUri]IDictionary postFilterParams) { - return GetResultForAll(type); + return GetResultForAll(type, postFilter, postFilterParams); } private IEnumerable ExamineSearch(string query, bool isContent) @@ -147,20 +148,49 @@ namespace Umbraco.Web.Editors } } - private IEnumerable GetResultForAll(UmbracoEntityTypes entityType) + /// + /// Gets the result for the entity list based on the type + /// + /// + /// A string where filter that will filter the results dynamically with linq - optional + /// the parameters to fill in the string where filter - optional + /// + private IEnumerable GetResultForAll(UmbracoEntityTypes entityType, string postFilter = null, IDictionary postFilterParams = null) { var objectType = ConvertToObjectType(entityType); if (objectType.HasValue) { - return Services.EntityService.GetAll(objectType.Value).Select(Mapper.Map) - .WhereNotNull(); + //TODO: Should we order this by something ? + var entities = Services.EntityService.GetAll(objectType.Value).WhereNotNull().Select(Mapper.Map); + + //if a post filter is assigned then try to execute it + if (postFilter.IsNullOrWhiteSpace() == false) + { + return postFilterParams == null + ? entities.AsQueryable().Where(postFilter).ToArray() + : entities.AsQueryable().Where(postFilter, postFilterParams).ToArray(); + + } + return entities; } //now we need to convert the unknown ones switch (entityType) { case UmbracoEntityTypes.Macro: //Get all macros from the macro service - return Services.MacroService.GetAll().OrderBy(x => x.Name).Select(Mapper.Map); + var result = Services.MacroService.GetAll().WhereNotNull().OrderBy(x => x.Name).AsQueryable(); + + //if a post filter is assigned then try to execute it + if (postFilter.IsNullOrWhiteSpace() == false) + { + result = postFilterParams == null + ? result.Where(postFilter) + : result.Where(postFilter, postFilterParams); + + } + + return result.Select(Mapper.Map); + case UmbracoEntityTypes.Domain: case UmbracoEntityTypes.Language: diff --git a/src/Umbraco.Web/Editors/MacroController.cs b/src/Umbraco.Web/Editors/MacroController.cs index a3fee00c75..aac9798d23 100644 --- a/src/Umbraco.Web/Editors/MacroController.cs +++ b/src/Umbraco.Web/Editors/MacroController.cs @@ -23,6 +23,8 @@ namespace Umbraco.Web.Editors [PluginController("UmbracoApi")] public class MacroController : UmbracoAuthorizedJsonController { + + /// /// Gets the macro parameters to be filled in for a particular macro /// From 06400f8db5c57af9ab9e634fd52a65a983f55099 Mon Sep 17 00:00:00 2001 From: Shannon Date: Wed, 25 Sep 2013 14:29:59 +1000 Subject: [PATCH 05/17] Gets the modal content loading in the rte on editor load all in async, fixes an issue with valtogglemsg when used in a modal to ensure we unsubscribe from the events when the modal element is destroyed. --- src/Umbraco.Core/Macros/MacroTagParser.cs | 5 +- src/Umbraco.Tests/Macros/MacroParserTests.cs | 10 ++-- .../validation/valtogglemsg.directive.js | 14 ++++- .../src/common/services/macro.service.js | 6 +- .../src/common/services/tinymce.service.js | 59 ++++++++++++++----- .../common/dialogs/insertmacro.controller.js | 12 ++-- .../common/services/macro-service.spec.js | 22 ++++--- 7 files changed, 82 insertions(+), 46 deletions(-) diff --git a/src/Umbraco.Core/Macros/MacroTagParser.cs b/src/Umbraco.Core/Macros/MacroTagParser.cs index 9ba529f7cd..93a72466ed 100644 --- a/src/Umbraco.Core/Macros/MacroTagParser.cs +++ b/src/Umbraco.Core/Macros/MacroTagParser.cs @@ -25,7 +25,7 @@ namespace Umbraco.Core.Macros /// /// {div class='umb-macro-holder'} /// - /// This could be some macro content + /// {ins}Macro alias: {strong}My Macro{/strong}{/ins} /// {/div} /// /// @@ -53,10 +53,11 @@ namespace Umbraco.Core.Macros sb.Append(match.Groups[1].Value.Trim()); sb.Append(" />"); sb.AppendLine(" -->"); + sb.Append(""); sb.Append("Macro alias: "); sb.Append(""); sb.Append(alias); - sb.Append(""); + sb.Append(""); return sb.ToString(); } //replace with nothing if we couldn't find the syntax for whatever reason diff --git a/src/Umbraco.Tests/Macros/MacroParserTests.cs b/src/Umbraco.Tests/Macros/MacroParserTests.cs index ce5ca3d3a8..1154b741b9 100644 --- a/src/Umbraco.Tests/Macros/MacroParserTests.cs +++ b/src/Umbraco.Tests/Macros/MacroParserTests.cs @@ -20,7 +20,7 @@ namespace Umbraco.Tests.Macros

asdfsadf

-Macro alias: Map
+Macro alias: Map

asdfasdf

", result); } @@ -37,7 +37,7 @@ Macro alias: Map

asdfsadf

-Macro alias: Map
+Macro alias: Map

asdfasdf

", result); } @@ -54,7 +54,7 @@ Macro alias: Map

asdfsadf

-Macro alias: Map
+Macro alias: Map

asdfasdf

", result); } @@ -71,7 +71,7 @@ Macro alias: Map

asdfsadf

-Macro alias: Map
+Macro alias: Map

asdfasdf

", result); } @@ -88,7 +88,7 @@ Macro alias: Map

asdfsadf

-Macro alias: Map
+Macro alias: Map

asdfasdf

", result); } diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/validation/valtogglemsg.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/validation/valtogglemsg.directive.js index e2db686605..4ebbb79200 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/validation/valtogglemsg.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/validation/valtogglemsg.directive.js @@ -43,7 +43,8 @@ function valToggleMsg(serverValidationManager) { } }); - scope.$on("saving", function(ev, args) { + //listen for the saving event (the result is a callback method which is called to unsubscribe) + var unsubscribeSaving = scope.$on("saving", function (ev, args) { showValidation = true; if (formCtrl[attr.valMsgFor].$error[attr.valToggleMsg]) { element.show(); @@ -57,11 +58,20 @@ function valToggleMsg(serverValidationManager) { } }); - scope.$on("saved", function (ev, args) { + //listen for the saved event (the result is a callback method which is called to unsubscribe) + var unsubscribeSaved = scope.$on("saved", function (ev, args) { showValidation = false; element.hide(); }); + //when the element is disposed we need to unsubscribe! + // NOTE: this is very important otherwise if this directive is part of a modal, the listener still exists because the dom + // element might still be there even after the modal has been hidden. + element.bind('$destroy', function () { + unsubscribeSaving(); + unsubscribeSaved(); + }); + } }; } diff --git a/src/Umbraco.Web.UI.Client/src/common/services/macro.service.js b/src/Umbraco.Web.UI.Client/src/common/services/macro.service.js index f6bf63596e..9151b4c159 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/macro.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/macro.service.js @@ -26,11 +26,11 @@ function macroService() { var paramExpression = new RegExp("(\\w+?)=['\"](.*?)['\"]", "g"); var paramMatch; var returnVal = { - alias: alias, - params: [] + macroAlias: alias, + marcoParamsDictionary: {} }; while (paramMatch = paramExpression.exec(paramsChunk)) { - returnVal.params.push({ alias: paramMatch[1], value: paramMatch[2] }); + returnVal.marcoParamsDictionary[paramMatch[1]] = paramMatch[2]; } return returnVal; }, diff --git a/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js b/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js index 6a87ea8a06..d3d0060ff5 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js @@ -162,6 +162,39 @@ function tinyMceService(dialogService, $log, imageHelper, assetsService, $timeou return null; } + /** loads in the macro content async from the server */ + function loadMacroContent($macroDiv, macroData) { + + //if we don't have the macroData, then we'll need to parse it from the macro div + if (!macroData) { + var contents = $macroDiv.contents(); + var comment = _.find(contents, function (item) { + return item.nodeType === 8; + }); + if (!comment) { + throw "Cannot parse the current macro, the syntax in the editor is invalid"; + } + var syntax = comment.textContent.trim(); + var parsed = macroService.parseMacroSyntax(syntax); + macroData = parsed; + } + + var $ins = $macroDiv.find("ins"); + + //show the throbber + $macroDiv.addClass("loading"); + + macroResource.getMacroResultAsHtmlForEditor(macroData.macroAlias, 1234, macroData.marcoParamsDictionary) + .then(function (htmlResult) { + + $macroDiv.removeClass("loading"); + htmlResult = htmlResult.trim(); + if (htmlResult !== "") { + $ins.html(htmlResult); + } + }); + } + /** Adds the button instance */ editor.addButton('umbmacro', { icon: 'custom icon-settings-alt', @@ -217,9 +250,14 @@ function tinyMceService(dialogService, $log, imageHelper, assetsService, $timeou } /** when the contents load we need to find any macros declared and load in their content */ - editor.on("LoadContent", function(o) { - var asdf = editor.getContent(); - alert(asdf); + editor.on("LoadContent", function (o) { + + //get all macro divs and load their content + $(editor.dom.select(".umb-macro-holder.mceNonEditable")).each(function() { + loadMacroContent($(this)); + }); + + }); /** This prevents any other commands from executing when the current element is the macro so the content cannot be edited */ @@ -361,20 +399,9 @@ function tinyMceService(dialogService, $log, imageHelper, assetsService, $timeou editor.selection.setNode(macroDiv); var $macroDiv = $(editor.dom.select("div.umb-macro-holder." + uniqueId)); - var $ins = $macroDiv.find("ins"); - //show the throbber - $macroDiv.addClass("loading"); - - macroResource.getMacroResultAsHtmlForEditor(data.macroAlias, 1234, data.marcoParamsDictionary) - .then(function (htmlResult) { - - $macroDiv.removeClass("loading"); - htmlResult = htmlResult.trim(); - if (htmlResult !== "") { - $ins.html(htmlResult); - } - }); + //async load the macro content + loadMacroContent($macroDiv, data); } }); diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/insertmacro.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/insertmacro.controller.js index c2d77eb5c3..1c8d6b4f0b 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/insertmacro.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/insertmacro.controller.js @@ -25,13 +25,13 @@ function InsertMacroController($scope, entityResource, macroResource, umbPropEdi $scope.macroParams = data; //fill in the data if we are editing this macro - if ($scope.dialogData && $scope.dialogData.macroData && $scope.dialogData.macroData.params) { - _.each($scope.dialogData.macroData.params, function(p) { + if ($scope.dialogData && $scope.dialogData.macroData && $scope.dialogData.macroData.marcoParamsDictionary) { + _.each($scope.dialogData.macroData.marcoParamsDictionary, function (val, key) { var prop = _.find($scope.macroParams, function (item) { - return item.alias == p.alias; + return item.alias == key; }); if (prop) { - prop.value = p.value; + prop.value = val; } }); @@ -111,9 +111,9 @@ function InsertMacroController($scope, entityResource, macroResource, umbPropEdi $scope.macros = data; //check if there's a pre-selected macro and if it exists - if ($scope.dialogData && $scope.dialogData.macroData && $scope.dialogData.macroData.alias) { + if ($scope.dialogData && $scope.dialogData.macroData && $scope.dialogData.macroData.macroAlias) { var found = _.find(data, function (item) { - return item.alias === $scope.dialogData.macroData.alias; + return item.alias === $scope.dialogData.macroData.macroAlias; }); if (found) { //select the macro and go to next screen diff --git a/src/Umbraco.Web.UI.Client/test/unit/common/services/macro-service.spec.js b/src/Umbraco.Web.UI.Client/test/unit/common/services/macro-service.spec.js index 78768cb4e2..f9eb19e57b 100644 --- a/src/Umbraco.Web.UI.Client/test/unit/common/services/macro-service.spec.js +++ b/src/Umbraco.Web.UI.Client/test/unit/common/services/macro-service.spec.js @@ -14,12 +14,11 @@ describe('macro service tests', function () { var result = macroService.parseMacroSyntax(""); expect(result).not.toBeNull(); - expect(result.alias).toBe("Map"); - expect(result.params.length).toBe(2); - expect(result.params[0].alias).toBe("test1"); - expect(result.params[0].value).toBe("asdf"); - expect(result.params[1].alias).toBe("test2"); - expect(result.params[1].value).toBe("hello"); + expect(result.macroAlias).toBe("Map"); + expect(result.marcoParamsDictionary.test1).not.toBeUndefined(); + expect(result.marcoParamsDictionary.test1).toBe("asdf"); + expect(result.marcoParamsDictionary.test2).not.toBeUndefined(); + expect(result.marcoParamsDictionary.test2).toBe("hello"); }); @@ -29,12 +28,11 @@ describe('macro service tests', function () { var result = macroService.parseMacroSyntax(""); expect(result).not.toBeNull(); - expect(result.alias).toBe("Map"); - expect(result.params.length).toBe(2); - expect(result.params[0].alias).toBe("test1"); - expect(result.params[0].value).toBe("asdf"); - expect(result.params[1].alias).toBe("test2"); - expect(result.params[1].value).toBe("hello"); + expect(result.macroAlias).toBe("Map"); + expect(result.marcoParamsDictionary.test1).not.toBeUndefined(); + expect(result.marcoParamsDictionary.test1).toBe("asdf"); + expect(result.marcoParamsDictionary.test2).not.toBeUndefined(); + expect(result.marcoParamsDictionary.test2).toBe("hello"); }); From 55e9a4fbb0bb956c0b38a9fa5d243c7c3869f2b3 Mon Sep 17 00:00:00 2001 From: Shannon Date: Wed, 25 Sep 2013 16:30:13 +1000 Subject: [PATCH 06/17] fixes rte property editor to ensure that data is saved since tinymce events are a bit strange. fixes up selection changes and ensures that macro markup in the editor can never be modified. --- .../src/common/services/tinymce.service.js | 71 +++++++++++++++---- .../propertyeditors/rte/rte.controller.js | 29 +++++++- 2 files changed, 83 insertions(+), 17 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js b/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js index d3d0060ff5..82e2eb632c 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js @@ -194,7 +194,7 @@ function tinyMceService(dialogService, $log, imageHelper, assetsService, $timeou } }); } - + /** Adds the button instance */ editor.addButton('umbmacro', { icon: 'custom icon-settings-alt', @@ -204,6 +204,57 @@ function tinyMceService(dialogService, $log, imageHelper, assetsService, $timeou var ctrl = this; var isOnMacroElement = false; + /** + if the selection comes from a different element that is not the macro's + we need to check if the selection includes part of the macro, if so we'll force the selection + to clear to the next element since if people can select part of the macro markup they can then modify it. + */ + function handleSelectionChange() { + + if (!editor.selection.isCollapsed()) { + var endSelection = tinymce.activeEditor.selection.getEnd(); + var startSelection = tinymce.activeEditor.selection.getStart(); + //don't proceed if it's an entire element selected + if (endSelection !== startSelection) { + + //if the end selection is a macro then move the cursor + //NOTE: we don't have to handle when the selection comes from a previous parent because + // that is automatically taken care of with the normal onNodeChanged logic since the + // evt.element will be the macro once it becomes part of the selection. + var $testForMacro = $(endSelection).closest(".umb-macro-holder"); + if ($testForMacro.length > 0) { + + //it came from before so move after, if there is no after then select ourselves + var next = $testForMacro.next(); + if (next.length > 0) { + editor.selection.setCursorLocation($testForMacro.next().get(0)); + } + else { + selectMacroElement($testForMacro.get(0)); + } + + } + } + } + } + + /** helper method to select the macro element */ + function selectMacroElement(macroElement) { + // move selection to top element to ensure we can't edit this + editor.selection.select(macroElement); + + // check if the current selection *is* the element (ie bug) + var currentSelection = editor.selection.getStart(); + if (tinymce.isIE) { + if (!editor.dom.hasClass(currentSelection, 'umb-macro-holder')) { + while (!editor.dom.hasClass(currentSelection, 'umb-macro-holder') && currentSelection.parentNode) { + currentSelection = currentSelection.parentNode; + } + editor.selection.select(currentSelection); + } + } + } + /** * Add a node change handler, test if we're editing a macro and select the whole thing, then set our isOnMacroElement flag. * If we change the selection inside this method, then we end up in an infinite loop, so we have to remove ourselves @@ -214,7 +265,10 @@ function tinyMceService(dialogService, $log, imageHelper, assetsService, $timeou //set our macro button active when on a node of class umb-macro-holder var $macroElement = $(evt.element).closest(".umb-macro-holder"); + + handleSelectionChange(); + //set the button active ctrl.active($macroElement.length !== 0); if ($macroElement.length > 0) { @@ -222,20 +276,8 @@ function tinyMceService(dialogService, $log, imageHelper, assetsService, $timeou //remove the event listener before re-selecting editor.off('NodeChange', onNodeChanged); - - // move selection to top element to ensure we can't edit this - editor.selection.select(macroElement); - // check if the current selection *is* the element (ie bug) - var currentSelection = editor.selection.getStart(); - if (tinymce.isIE) { - if (!editor.dom.hasClass(currentSelection, 'umb-macro-holder')) { - while (!editor.dom.hasClass(currentSelection, 'umb-macro-holder') && currentSelection.parentNode) { - currentSelection = currentSelection.parentNode; - } - editor.selection.select(currentSelection); - } - } + selectMacroElement(macroElement); //set the flag isOnMacroElement = true; @@ -257,7 +299,6 @@ function tinyMceService(dialogService, $log, imageHelper, assetsService, $timeou loadMacroContent($(this)); }); - }); /** This prevents any other commands from executing when the current element is the macro so the content cannot be edited */ 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 183d842dca..5dad072c39 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 @@ -1,6 +1,6 @@ angular.module("umbraco") .controller("Umbraco.Editors.RTEController", - function ($rootScope, $scope, dialogService, $log, imageHelper, assetsService, $timeout, tinyMceService) { + function ($rootScope, $element, $scope, dialogService, $log, imageHelper, assetsService, $timeout, tinyMceService, angularHelper) { //TODO: This should be configurable (i.e. from the config file we have and/or from pre-values) var validElements = "@[id|class|style|title|dir Date: Wed, 25 Sep 2013 16:52:26 +1000 Subject: [PATCH 07/17] Fixes: U4-2918 After I set admin password, the error shows.(7.0.0-build.85, new install) --- .../Configuration/UmbracoSettings/RepositoryElement.cs | 8 ++++---- .../UmbracoSettings/PackageRepositoriesElementTests.cs | 7 +++++++ .../businesslogic/Packager/Repositories/Repository.cs | 10 ++-------- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/RepositoryElement.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/RepositoryElement.cs index 4f2b8931ee..b7a1157c40 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/RepositoryElement.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/RepositoryElement.cs @@ -26,18 +26,18 @@ namespace Umbraco.Core.Configuration.UmbracoSettings set { base["repositoryurl"] = value; } } - [ConfigurationProperty("repositoryurl", DefaultValue = "/umbraco/webservices/api/repository.asmx")] + [ConfigurationProperty("webserviceurl", DefaultValue = "/umbraco/webservices/api/repository.asmx")] public string WebServiceUrl { - get { return (string)base["repositoryurl"]; } - set { base["repositoryurl"] = value; } + get { return (string)base["webserviceurl"]; } + set { base["webserviceurl"] = value; } } public bool HasCustomWebServiceUrl { get { - var prop = Properties["repositoryurl"]; + var prop = Properties["webserviceurl"]; var repoUrl = this[prop] as ConfigurationElement; return (repoUrl != null && repoUrl.ElementInformation.IsPresent); } diff --git a/src/Umbraco.Tests/Configurations/UmbracoSettings/PackageRepositoriesElementTests.cs b/src/Umbraco.Tests/Configurations/UmbracoSettings/PackageRepositoriesElementTests.cs index 93c387094b..cb82978c72 100644 --- a/src/Umbraco.Tests/Configurations/UmbracoSettings/PackageRepositoriesElementTests.cs +++ b/src/Umbraco.Tests/Configurations/UmbracoSettings/PackageRepositoriesElementTests.cs @@ -13,8 +13,15 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings Assert.IsTrue(SettingsSection.PackageRepositories.Repositories.Count() == 2); Assert.IsTrue(SettingsSection.PackageRepositories.Repositories.ElementAt(0).Id == Guid.Parse("65194810-1f85-11dd-bd0b-0800200c9a66")); Assert.IsTrue(SettingsSection.PackageRepositories.Repositories.ElementAt(0).Name == "Umbraco package Repository"); + Assert.IsTrue(SettingsSection.PackageRepositories.Repositories.ElementAt(0).HasCustomWebServiceUrl == false); + Assert.IsTrue(SettingsSection.PackageRepositories.Repositories.ElementAt(0).WebServiceUrl == "/umbraco/webservices/api/repository.asmx"); + Assert.IsTrue(SettingsSection.PackageRepositories.Repositories.ElementAt(0).RepositoryUrl == "http://packages.umbraco.org"); + Assert.IsTrue(SettingsSection.PackageRepositories.Repositories.ElementAt(1).Id == Guid.Parse("163245E0-CD22-44B6-841A-1B9B9D2E955F")); Assert.IsTrue(SettingsSection.PackageRepositories.Repositories.ElementAt(1).Name == "Test Repo"); + Assert.IsTrue(SettingsSection.PackageRepositories.Repositories.ElementAt(1).HasCustomWebServiceUrl == false); + Assert.IsTrue(SettingsSection.PackageRepositories.Repositories.ElementAt(0).WebServiceUrl == "/umbraco/webservices/api/repository.asmx"); + Assert.IsTrue(SettingsSection.PackageRepositories.Repositories.ElementAt(0).RepositoryUrl == "http://packages.umbraco.org"); } } } \ No newline at end of file diff --git a/src/umbraco.cms/businesslogic/Packager/Repositories/Repository.cs b/src/umbraco.cms/businesslogic/Packager/Repositories/Repository.cs index 64a415579f..726bc01437 100644 --- a/src/umbraco.cms/businesslogic/Packager/Repositories/Repository.cs +++ b/src/umbraco.cms/businesslogic/Packager/Repositories/Repository.cs @@ -26,12 +26,6 @@ namespace umbraco.cms.businesslogic.packager.repositories { get { - - if (!WebserviceUrl.Contains("://")) - { - WebserviceUrl = RepositoryUrl.Trim('/') + "/" + WebserviceUrl.Trim('/'); - } - var repo = new RepositoryWebservice(WebserviceUrl); return repo; } @@ -84,7 +78,7 @@ namespace umbraco.cms.businesslogic.packager.repositories }; repository.RepositoryUrl = r.RepositoryUrl; - repository.WebserviceUrl = repository.RepositoryUrl.Trim('/') + "/" + repository.WebserviceUrl.Trim('/'); + repository.WebserviceUrl = repository.RepositoryUrl.Trim('/') + "/" + r.WebServiceUrl.Trim('/'); if (r.HasCustomWebServiceUrl) { string wsUrl = r.WebServiceUrl; @@ -126,7 +120,7 @@ namespace umbraco.cms.businesslogic.packager.repositories }; repository.RepositoryUrl = found.RepositoryUrl; - repository.WebserviceUrl = repository.RepositoryUrl.Trim('/') + "/" + repository.WebserviceUrl.Trim('/'); + repository.WebserviceUrl = repository.RepositoryUrl.Trim('/') + "/" + found.WebServiceUrl.Trim('/'); if (found.HasCustomWebServiceUrl) { From a939c14de96f79175a9cfbc21675772c28677b68 Mon Sep 17 00:00:00 2001 From: Shannon Date: Wed, 25 Sep 2013 17:57:44 +1000 Subject: [PATCH 08/17] Completes: U4-2917 Remove canvas/live editing support, U4-2916 Remove skinning support --- .../Configuration/GlobalSettings.cs | 10 - src/Umbraco.Core/IO/SystemFiles.cs | 8 - src/Umbraco.Core/PluginManager.cs | 4 +- src/Umbraco.Web.UI/Umbraco.Web.UI.csproj | 41 -- .../steps/Skinning/loadStarterKitDesigns.ascx | 69 ---- .../Skinning/loadStarterKitDesigns.ascx.cs | 162 -------- .../loadStarterKitDesigns.ascx.designer.cs | 42 -- .../install/steps/StarterKits.ascx.cs | 20 +- .../install/steps/TheEnd.ascx.cs | 5 +- .../install/steps/TheEnd.ascx.designer.cs | 9 - src/Umbraco.Web.UI/install/steps/theend.ascx | 3 +- .../LiveEditing/Controls/Communicator.js | 33 -- .../Controls/LiveEditingToolbar.js | 99 ----- .../umbraco/LiveEditing/Css/LiveEditing.css | 370 ----------------- .../umbraco/LiveEditing/Images/canvas.gif | Bin 1009 -> 0 bytes .../LiveEditing/Images/dialog_background.png | Bin 13247 -> 0 bytes .../umbraco/LiveEditing/LiveEditing.cd | 65 --- .../Modules/CreateModule/CreateModule.js | 5 - .../Modules/CreateModule/create.png | Bin 3764 -> 0 bytes .../Modules/DeleteModule/DeleteModule.js | 5 - .../Modules/DeleteModule/delete.png | Bin 3604 -> 0 bytes .../Modules/ItemEditing/ItemEditing.js | 341 ---------------- .../Modules/ItemEditing/ItemEditingInvoke.js | 3 - .../Modules/MacroModule/MacroModule.js | 21 - .../Modules/SkinModule/CssParser.aspx | 1 - .../Modules/SkinModule/ImageUploader.aspx | 193 --------- .../ModuleInjectionMacroRenderer.aspx | 1 - .../Modules/SkinModule/ModuleInjector.aspx | 141 ------- .../Modules/SkinModule/ModuleInstaller.aspx | 1 - .../Modules/SkinModule/ModuleSelector.ascx | 55 --- .../Modules/SkinModule/SkinCustomizer.ascx | 125 ------ .../Modules/SkinModule/SkinModule.js | 1 - .../Modules/SkinModule/images/loader.gif | Bin 1737 -> 0 bytes .../Modules/SkinModule/images/module.gif | Bin 610 -> 0 bytes .../Modules/SkinModule/images/skin.gif | Bin 1684 -> 0 bytes .../Modules/SkinModule/js/ModuleInjection.js | 130 ------ .../SkinModule/js/SkinModuleShowOnStartup.js | 1 - .../js/disableInstallButtonsOnClick.js | 8 - .../Modules/SkinModule/js/initcolorpicker.js | 22 -- .../Modules/SkinModule/js/initslider.js | 19 - .../LiveEditing/Modules/SkinModule/skin.png | Bin 3764 -> 0 bytes .../UnpublishModule/UnpublishModule.js | 5 - .../Modules/UnpublishModule/unpublish.png | Bin 3564 -> 0 bytes src/Umbraco.Web.UI/umbraco/canvas.aspx | 16 - .../umbraco/css/umbLiveEditing.css | 14 - .../developer/Packages/StarterKits.aspx.cs | 30 +- .../umbraco/dialogs/TemplateSkinning.aspx | 57 --- .../Application/UmbracoApplicationActions.js | 6 - .../themes/umbraco/editor_template_src.js | 23 +- src/Umbraco.Web/Security/WebSecurity.cs | 2 +- .../Trees/LegacyTreeDataConverter.cs | 8 +- src/Umbraco.Web/Umbraco.Web.csproj | 16 - .../umbraco/Trees/loadPackager.cs | 3 - .../umbraco/Trees/loadTemplates.cs | 2 +- .../umbraco/dashboard/Settings/Applyskin.ascx | 9 - .../dashboard/Settings/Applyskin.ascx.cs | 41 -- .../Settings/Applyskin.ascx.designer.cs | 42 -- .../umbraco/dialogs/TemplateSkinning.aspx | 57 --- .../umbraco/dialogs/TemplateSkinning.aspx.cs | 190 --------- .../dialogs/TemplateSkinning.aspx.designer.cs | 105 ----- .../umbraco/settings/editTemplate.aspx.cs | 2 +- .../umbraco/templateControls/Item.cs | 56 +-- .../BasePages/BasePage.cs | 2 +- src/umbraco.businesslogic/GlobalSettings.cs | 7 +- src/umbraco.businesslogic/IO/SystemFiles.cs | 4 - .../datatype/ClientDependencyAttribute.cs | 102 ----- .../businesslogic/skinning/CssVariable.cs | 29 -- .../skinning/CssVariableProperty.cs | 19 - .../businesslogic/skinning/Dependency.cs | 136 ------- .../businesslogic/skinning/DependencyType.cs | 53 --- .../businesslogic/skinning/EmbeddedCss.cs | 44 --- .../businesslogic/skinning/Skin.cs | 344 ---------------- .../businesslogic/skinning/Skinning.cs | 374 ------------------ .../businesslogic/skinning/Task.cs | 92 ----- .../businesslogic/skinning/TaskType.cs | 68 ---- .../skinning/controls/ColorPicker.cs | 26 -- .../skinning/controls/ImageUploader.cs | 28 -- .../skinning/controls/SliderControl.cs | 35 -- .../skinning/dependencies/Color.cs | 60 --- .../skinning/dependencies/Image.cs | 80 ---- .../skinning/dependencies/Option.cs | 71 ---- .../skinning/dependencies/Slider.cs | 88 ----- .../skinning/dependencies/Text.cs | 60 --- .../skinning/tasks/AddStyleSheetToTemplate.cs | 114 ------ .../businesslogic/skinning/tasks/ModifyCss.cs | 93 ----- .../skinning/tasks/ModifyPageProperty.cs | 77 ---- .../skinning/tasks/ModifyTemplate.cs | 111 ------ src/umbraco.cms/umbraco.cms.csproj | 22 -- .../AbstractPrevalueEditor.cs | 1 + .../MultiNodeTreePicker/MNTP_DataEditor.cs | 4 +- .../MNTP_PrevalueEditor.cs | 3 +- .../MultipleTextstringControl.cs | 1 + .../ResourceExtensions.cs | 1 + .../macrocontainer/Editor.cs | 16 +- .../tinyMCE3/TinyMCE.cs | 30 +- .../tinyMCE3/webcontrol/TinyMCEWebControl.cs | 78 +--- .../tinymce/tinyMCEPreValueConfigurator.cs | 2 +- .../ILiveEditingDataEditor.cs | 18 - .../umbraco.interfaces.csproj | 1 - 99 files changed, 49 insertions(+), 4942 deletions(-) delete mode 100644 src/Umbraco.Web.UI/install/steps/Skinning/loadStarterKitDesigns.ascx delete mode 100644 src/Umbraco.Web.UI/install/steps/Skinning/loadStarterKitDesigns.ascx.cs delete mode 100644 src/Umbraco.Web.UI/install/steps/Skinning/loadStarterKitDesigns.ascx.designer.cs delete mode 100644 src/Umbraco.Web.UI/umbraco/LiveEditing/Controls/Communicator.js delete mode 100644 src/Umbraco.Web.UI/umbraco/LiveEditing/Controls/LiveEditingToolbar.js delete mode 100644 src/Umbraco.Web.UI/umbraco/LiveEditing/Css/LiveEditing.css delete mode 100644 src/Umbraco.Web.UI/umbraco/LiveEditing/Images/canvas.gif delete mode 100644 src/Umbraco.Web.UI/umbraco/LiveEditing/Images/dialog_background.png delete mode 100644 src/Umbraco.Web.UI/umbraco/LiveEditing/LiveEditing.cd delete mode 100644 src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/CreateModule/CreateModule.js delete mode 100644 src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/CreateModule/create.png delete mode 100644 src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/DeleteModule/DeleteModule.js delete mode 100644 src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/DeleteModule/delete.png delete mode 100644 src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/ItemEditing/ItemEditing.js delete mode 100644 src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/ItemEditing/ItemEditingInvoke.js delete mode 100644 src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/MacroModule/MacroModule.js delete mode 100644 src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/CssParser.aspx delete mode 100644 src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/ImageUploader.aspx delete mode 100644 src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/ModuleInjectionMacroRenderer.aspx delete mode 100644 src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/ModuleInjector.aspx delete mode 100644 src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/ModuleInstaller.aspx delete mode 100644 src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/ModuleSelector.ascx delete mode 100644 src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/SkinCustomizer.ascx delete mode 100644 src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/SkinModule.js delete mode 100644 src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/images/loader.gif delete mode 100644 src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/images/module.gif delete mode 100644 src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/images/skin.gif delete mode 100644 src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/js/ModuleInjection.js delete mode 100644 src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/js/SkinModuleShowOnStartup.js delete mode 100644 src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/js/disableInstallButtonsOnClick.js delete mode 100644 src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/js/initcolorpicker.js delete mode 100644 src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/js/initslider.js delete mode 100644 src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/skin.png delete mode 100644 src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/UnpublishModule/UnpublishModule.js delete mode 100644 src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/UnpublishModule/unpublish.png delete mode 100644 src/Umbraco.Web.UI/umbraco/canvas.aspx delete mode 100644 src/Umbraco.Web.UI/umbraco/css/umbLiveEditing.css delete mode 100644 src/Umbraco.Web.UI/umbraco/dialogs/TemplateSkinning.aspx delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/dashboard/Settings/Applyskin.ascx delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/dashboard/Settings/Applyskin.ascx.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/dashboard/Settings/Applyskin.ascx.designer.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/TemplateSkinning.aspx delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/TemplateSkinning.aspx.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/TemplateSkinning.aspx.designer.cs delete mode 100644 src/umbraco.cms/businesslogic/datatype/ClientDependencyAttribute.cs delete mode 100644 src/umbraco.cms/businesslogic/skinning/CssVariable.cs delete mode 100644 src/umbraco.cms/businesslogic/skinning/CssVariableProperty.cs delete mode 100644 src/umbraco.cms/businesslogic/skinning/Dependency.cs delete mode 100644 src/umbraco.cms/businesslogic/skinning/DependencyType.cs delete mode 100644 src/umbraco.cms/businesslogic/skinning/EmbeddedCss.cs delete mode 100644 src/umbraco.cms/businesslogic/skinning/Skin.cs delete mode 100644 src/umbraco.cms/businesslogic/skinning/Skinning.cs delete mode 100644 src/umbraco.cms/businesslogic/skinning/Task.cs delete mode 100644 src/umbraco.cms/businesslogic/skinning/TaskType.cs delete mode 100644 src/umbraco.cms/businesslogic/skinning/controls/ColorPicker.cs delete mode 100644 src/umbraco.cms/businesslogic/skinning/controls/ImageUploader.cs delete mode 100644 src/umbraco.cms/businesslogic/skinning/controls/SliderControl.cs delete mode 100644 src/umbraco.cms/businesslogic/skinning/dependencies/Color.cs delete mode 100644 src/umbraco.cms/businesslogic/skinning/dependencies/Image.cs delete mode 100644 src/umbraco.cms/businesslogic/skinning/dependencies/Option.cs delete mode 100644 src/umbraco.cms/businesslogic/skinning/dependencies/Slider.cs delete mode 100644 src/umbraco.cms/businesslogic/skinning/dependencies/Text.cs delete mode 100644 src/umbraco.cms/businesslogic/skinning/tasks/AddStyleSheetToTemplate.cs delete mode 100644 src/umbraco.cms/businesslogic/skinning/tasks/ModifyCss.cs delete mode 100644 src/umbraco.cms/businesslogic/skinning/tasks/ModifyPageProperty.cs delete mode 100644 src/umbraco.cms/businesslogic/skinning/tasks/ModifyTemplate.cs delete mode 100644 src/umbraco.interfaces/ILiveEditingDataEditor.cs diff --git a/src/Umbraco.Core/Configuration/GlobalSettings.cs b/src/Umbraco.Core/Configuration/GlobalSettings.cs index 24fe959b61..406aa169b6 100644 --- a/src/Umbraco.Core/Configuration/GlobalSettings.cs +++ b/src/Umbraco.Core/Configuration/GlobalSettings.cs @@ -597,21 +597,11 @@ namespace Umbraco.Core.Configuration return context.Request.Path.ToLower().IndexOf(IOHelper.ResolveUrl(SystemDirectories.Umbraco).ToLower()) > -1; } - public static bool RequestIsLiveEditRedirector(HttpContext context) - { - return context.Request.Path.ToLower().IndexOf(SystemDirectories.Umbraco.ToLower() + "/liveediting.aspx") > -1; - } - public static bool RequestIsInUmbracoApplication(HttpContextBase context) { return context.Request.Path.ToLower().IndexOf(IOHelper.ResolveUrl(SystemDirectories.Umbraco).ToLower()) > -1; } - public static bool RequestIsLiveEditRedirector(HttpContextBase context) - { - return context.Request.Path.ToLower().IndexOf(SystemDirectories.Umbraco.ToLower() + "/liveediting.aspx") > -1; - } - /// /// Gets a value indicating whether umbraco should force a secure (https) connection to the backoffice. /// diff --git a/src/Umbraco.Core/IO/SystemFiles.cs b/src/Umbraco.Core/IO/SystemFiles.cs index 9dfde1e442..766ecc5562 100644 --- a/src/Umbraco.Core/IO/SystemFiles.cs +++ b/src/Umbraco.Core/IO/SystemFiles.cs @@ -51,14 +51,6 @@ namespace Umbraco.Core.IO return SystemDirectories.Config + "/dashboard.config"; } } - - public static string SkinningXml - { - get - { - return SystemDirectories.Data + "/skinning.config"; - } - } public static string NotFoundhandlersConfig { diff --git a/src/Umbraco.Core/PluginManager.cs b/src/Umbraco.Core/PluginManager.cs index e24573e4d4..b9f6b75172 100644 --- a/src/Umbraco.Core/PluginManager.cs +++ b/src/Umbraco.Core/PluginManager.cs @@ -497,9 +497,7 @@ namespace Umbraco.Core /// internal IEnumerable ResolveDataTypes() { - //ensure we ignore types that should not be loaded - return ResolveTypes() - .Except(new[] {Type.GetType("umbraco.presentation.LiveEditing.Modules.ItemEditing.PageElementEditor,umbraco")}); + return ResolveTypes(); } /// diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index 70c86231b9..64f99def36 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -352,9 +352,6 @@ RenderingEngine.ascx - - loadStarterKitDesigns.ascx - loadStarterKits.ascx ASPXCodeBehind @@ -369,10 +366,6 @@ StarterKits.ascx - - loadStarterKitDesigns.ascx - ASPXCodeBehind - ASPXCodeBehind @@ -735,8 +728,6 @@ - - @@ -1725,7 +1716,6 @@ - @@ -1750,7 +1740,6 @@ - @@ -1760,20 +1749,6 @@ - - - - - - - - - - - - - - @@ -1804,7 +1779,6 @@ - @@ -1947,7 +1921,6 @@ - @@ -2120,18 +2093,6 @@ - - - - - - - - - - - - @@ -2205,7 +2166,6 @@ Designer - @@ -2234,7 +2194,6 @@ - diff --git a/src/Umbraco.Web.UI/install/steps/Skinning/loadStarterKitDesigns.ascx b/src/Umbraco.Web.UI/install/steps/Skinning/loadStarterKitDesigns.ascx deleted file mode 100644 index 864aeb5082..0000000000 --- a/src/Umbraco.Web.UI/install/steps/Skinning/loadStarterKitDesigns.ascx +++ /dev/null @@ -1,69 +0,0 @@ -<%@ Control Language="C#" AutoEventWireup="True" CodeBehind="LoadStarterKitDesigns.ascx.cs" Inherits="Umbraco.Web.UI.Install.Steps.Skinning.LoadStarterKitDesigns" %> -<%@ Import Namespace="umbraco.cms.businesslogic.packager.repositories" %> - - - -

Starter kit and skin have been installed

- -
- -
- - - - - - -
- -
\ No newline at end of file diff --git a/src/Umbraco.Web.UI/install/steps/Skinning/loadStarterKitDesigns.ascx.cs b/src/Umbraco.Web.UI/install/steps/Skinning/loadStarterKitDesigns.ascx.cs deleted file mode 100644 index b45e00e586..0000000000 --- a/src/Umbraco.Web.UI/install/steps/Skinning/loadStarterKitDesigns.ascx.cs +++ /dev/null @@ -1,162 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.UI.WebControls; -using Umbraco.Core.Configuration; -using Umbraco.Core.Logging; -using Umbraco.Web.Install; -using umbraco; -using GlobalSettings = global::Umbraco.Core.Configuration.GlobalSettings; - -namespace Umbraco.Web.UI.Install.Steps.Skinning -{ - public delegate void StarterKitDesignInstalledEventHandler(); - - public partial class LoadStarterKitDesigns : StepUserControl - { - - public event StarterKitDesignInstalledEventHandler StarterKitDesignInstalled; - - protected virtual void OnStarterKitDesignInstalled() - { - if (StarterKitDesignInstalled != null) - StarterKitDesignInstalled(); - } - - public Guid StarterKitGuid { get; set; } - - private readonly global::umbraco.cms.businesslogic.packager.repositories.Repository _repo; - private const string RepoGuid = "65194810-1f85-11dd-bd0b-0800200c9a66"; - - public LoadStarterKitDesigns() - { - _repo = global::umbraco.cms.businesslogic.packager.repositories.Repository.getByGuid(RepoGuid); - } - - protected override void OnInit(EventArgs e) - { - base.OnInit(e); - - if (_repo == null) - { - throw new InvalidOperationException("Could not find repository with id " + RepoGuid); - } - - if (_repo.HasConnection()) - { - try - { - //clear progress bar cache - InstallHelper.ClearProgress(); - - var skinsCollection = _repo.Webservice.Skins(StarterKitGuid.ToString()); - - var numberOfSkins = skinsCollection.Length; - this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "skinCounter", "var numberOfSkins = " + numberOfSkins, true); - - rep_starterKitDesigns.DataSource = skinsCollection; - rep_starterKitDesigns.DataBind(); - } - catch (Exception ex) - { - LogHelper.Error("An error occurred initializing", ex); - - ShowConnectionError(); - } - } - else - { - ShowConnectionError(); - } - } - - private void ShowConnectionError() - { - - var fb = new global::umbraco.uicontrols.Feedback - { - type = global::umbraco.uicontrols.Feedback.feedbacktype.error, - Text = "No connection to repository. Starter Kits Designs could not be fetched from the repository as there was no connection to: '" + _repo.RepositoryUrl + "'" - }; - - pl_loadStarterKitDesigns.Controls.Clear(); - pl_loadStarterKitDesigns.Controls.Add(fb); - } - - protected void SelectStarterKitDesign(object sender, EventArgs e) - { - InstallHelper.ClearProgress(); - - var kitGuid = new Guid(((LinkButton)sender).CommandArgument); - - if (!global::umbraco.cms.businesslogic.skinning.Skinning.IsSkinInstalled(kitGuid)) - { - - InstallHelper.SetProgress(5, "Fetching starting kit from the repository", ""); - - var installer = new global::umbraco.cms.businesslogic.packager.Installer(); - - if (_repo.HasConnection()) - { - var p = new global::umbraco.cms.businesslogic.packager.Installer(); - - InstallHelper.SetProgress(15, "Connected to repository", ""); - - string tempFile = p.Import(_repo.fetch(kitGuid.ToString())); - p.LoadConfig(tempFile); - int pID = p.CreateManifest(tempFile, kitGuid.ToString(), RepoGuid); - - InstallHelper.SetProgress(30, "Installing skin files", ""); - p.InstallFiles(pID, tempFile); - - InstallHelper.SetProgress(50, "Installing skin system objects", ""); - p.InstallBusinessLogic(pID, tempFile); - - InstallHelper.SetProgress(60, "Finishing skin installation", ""); - p.InstallCleanUp(pID, tempFile); - - library.RefreshContent(); - - InstallHelper.SetProgress(80, "Activating skin", ""); - if (global::umbraco.cms.businesslogic.skinning.Skinning.GetAllSkins().Count > 0) - { - global::umbraco.cms.businesslogic.skinning.Skinning.ActivateAsCurrentSkin( - global::umbraco.cms.businesslogic.skinning.Skinning.GetAllSkins()[0]); - } - - - InstallHelper.SetProgress(100, "Skin installation has been completed", ""); - - try - { - - - if (string.IsNullOrEmpty(GlobalSettings.ConfigurationStatus)) - { - GlobalSettings.ConfigurationStatus = UmbracoVersion.Current.ToString(3); - } - } - catch - { - - } - - try - { - InstallHelper.RedirectToNextStep(Page, GetCurrentStep()); - } - catch - { - OnStarterKitDesignInstalled(); - } - } - else - { - ShowConnectionError(); - } - - } - } - } -} \ No newline at end of file diff --git a/src/Umbraco.Web.UI/install/steps/Skinning/loadStarterKitDesigns.ascx.designer.cs b/src/Umbraco.Web.UI/install/steps/Skinning/loadStarterKitDesigns.ascx.designer.cs deleted file mode 100644 index 7ee546bdd2..0000000000 --- a/src/Umbraco.Web.UI/install/steps/Skinning/loadStarterKitDesigns.ascx.designer.cs +++ /dev/null @@ -1,42 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Umbraco.Web.UI.Install.Steps.Skinning { - - - public partial class LoadStarterKitDesigns { - - /// - /// pl_loadStarterKitDesigns control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.PlaceHolder pl_loadStarterKitDesigns; - - /// - /// pl_CustomizeSkin control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Panel pl_CustomizeSkin; - - /// - /// rep_starterKitDesigns control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Repeater rep_starterKitDesigns; - } -} diff --git a/src/Umbraco.Web.UI/install/steps/StarterKits.ascx.cs b/src/Umbraco.Web.UI/install/steps/StarterKits.ascx.cs index ffb4ad8e39..579f8b7413 100644 --- a/src/Umbraco.Web.UI/install/steps/StarterKits.ascx.cs +++ b/src/Umbraco.Web.UI/install/steps/StarterKits.ascx.cs @@ -10,10 +10,7 @@ namespace Umbraco.Web.UI.Install.Steps protected void Page_Load(object sender, EventArgs e) { - if (!global::umbraco.cms.businesslogic.skinning.Skinning.IsStarterKitInstalled()) - ShowStarterKits(); - else - ShowStarterKitDesigns((Guid)global::umbraco.cms.businesslogic.skinning.Skinning.StarterKitGuid()); + ShowStarterKits(); } @@ -26,19 +23,6 @@ namespace Umbraco.Web.UI.Install.Steps } - - private void ShowStarterKitDesigns(Guid starterKitGuid) - { - var ctrl = (LoadStarterKitDesigns)LoadControl(SystemDirectories.Install + "/steps/Skinning/loadStarterKitDesigns.ascx"); - ctrl.ID = "StarterKitDesigns"; - - ctrl.StarterKitGuid = starterKitGuid; - ph_starterKitDesigns.Controls.Add(ctrl); - - pl_starterKit.Visible = false; - pl_starterKitDesign.Visible = true; - } - - + } } \ No newline at end of file diff --git a/src/Umbraco.Web.UI/install/steps/TheEnd.ascx.cs b/src/Umbraco.Web.UI/install/steps/TheEnd.ascx.cs index 8b824027f1..4053f0c782 100644 --- a/src/Umbraco.Web.UI/install/steps/TheEnd.ascx.cs +++ b/src/Umbraco.Web.UI/install/steps/TheEnd.ascx.cs @@ -20,10 +20,7 @@ namespace Umbraco.Web.UI.Install.Steps // Update ClientDependency version var clientDependencyConfig = new ClientDependencyConfiguration(); var clientDependencyUpdated = clientDependencyConfig.IncreaseVersionNumber(); - - if (!global::umbraco.cms.businesslogic.skinning.Skinning.IsStarterKitInstalled()) - customizeSite.Visible = false; - + } } diff --git a/src/Umbraco.Web.UI/install/steps/TheEnd.ascx.designer.cs b/src/Umbraco.Web.UI/install/steps/TheEnd.ascx.designer.cs index 3d8ea899fc..2c7c5fe114 100644 --- a/src/Umbraco.Web.UI/install/steps/TheEnd.ascx.designer.cs +++ b/src/Umbraco.Web.UI/install/steps/TheEnd.ascx.designer.cs @@ -11,14 +11,5 @@ namespace Umbraco.Web.UI.Install.Steps { public partial class TheEnd { - - /// - /// customizeSite control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.HtmlControls.HtmlGenericControl customizeSite; } } diff --git a/src/Umbraco.Web.UI/install/steps/theend.ascx b/src/Umbraco.Web.UI/install/steps/theend.ascx index 2df9c738ca..11404d8608 100644 --- a/src/Umbraco.Web.UI/install/steps/theend.ascx +++ b/src/Umbraco.Web.UI/install/steps/theend.ascx @@ -31,8 +31,7 @@ jQuery(document).ready(function () { source .NET CMS.
If you installed a starter kit you can start by configuring your new site, just click "Preview your new website" and follow the instructions. Or to start adding content right away click "Set up your new website"

-
    -
  • &umbSkinning=true&umbSkinningConfigurator=true" target="_blank">Set up your new website
  • + diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Controls/Communicator.js b/src/Umbraco.Web.UI/umbraco/LiveEditing/Controls/Communicator.js deleted file mode 100644 index 734bb0933d..0000000000 --- a/src/Umbraco.Web.UI/umbraco/LiveEditing/Controls/Communicator.js +++ /dev/null @@ -1,33 +0,0 @@ -// Umbraco Live Editing: Communicator - -/********************* Communicator Constructor *********************/ - - function UmbracoCommunicator() { } - - - -/********************* Communicator Methods *********************/ - - // Sends a message to the client using the communicator. - UmbracoCommunicator.prototype.SendClientMessage = function(type, message) { - // find the communicator - var divs = document.getElementsByTagName("div"); - var communicator = null; - for (var i = 0; i < divs.length && communicator == null; i++) - if (divs[i].className == "communicator") - communicator = divs[i]; - Sys.Debug.assert(communicator != null, "LiveEditing: Communicator not found."); - - // send the message - var typeBox = communicator.childNodes[0].childNodes[0]; - var messageBox = communicator.childNodes[0].childNodes[1]; - var submit = communicator.childNodes[0].childNodes[2]; - typeBox.value = type; - messageBox.value = message; - submit.click(); - } - - -/********************* Communicator Instance *********************/ - - var UmbracoCommunicator = new UmbracoCommunicator(); \ No newline at end of file diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Controls/LiveEditingToolbar.js b/src/Umbraco.Web.UI/umbraco/LiveEditing/Controls/LiveEditingToolbar.js deleted file mode 100644 index ac5e9457f0..0000000000 --- a/src/Umbraco.Web.UI/umbraco/LiveEditing/Controls/LiveEditingToolbar.js +++ /dev/null @@ -1,99 +0,0 @@ -Type.registerNamespace("umbraco.presentation.LiveEditing.Controls"); - -/************************************ Toolbar class ***********************************/ - -// Constructor. -umbraco.presentation.LiveEditing.Controls.LiveEditingToolbar = function() { - umbraco.presentation.LiveEditing.Controls.LiveEditingToolbar.initializeBase(this); - this._inited = false; - - // init toolbar on application load - var liveEditingToolbar = this; - Sys.Application.add_load(function() { liveEditingToolbar._init(); }); -} - -umbraco.presentation.LiveEditing.Controls.LiveEditingToolbar.prototype = { - // Initialize the toolbar. - _init: function() { - if (!this._inited) { - var liveEditingToolbar = this; - Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function(sender, args) { liveEditingToolbar._handleError(sender, args); }); - this._inited = true; - } - }, - - // Fires the Save event. - _save: function() { - var handler = this.get_events().getHandler("save"); - var args = new Sys.EventArgs(); - args.cancel = false; - if (handler) - handler(this, args); - - if (!args.cancel) { - this.setDirty(false); - UmbSpeechBubble.ShowMessage("Info", "Saving", "Save in progress..."); - } - return !args.cancel; - - }, - - // Adds a listener for the Save event. - add_save: function(handler) { - this.get_events().addHandler("save", handler); - }, - - // Removes a listener for the Save event. - remove_save: function(handler) { - this.get_events().removeHandler("save", handler); - }, - - // Fires the Save and Publish event. - _saveAndPublish: function() { - var handler = this.get_events().getHandler("saveAndPublish"); - var args = new Sys.EventArgs(); - args.cancel = false; - if (handler) - handler(this, args); - - if (!args.cancel) { - this.setDirty(false); - UmbSpeechBubble.ShowMessage("Info", "Publishing", "Save and publish in progress..."); - } - return !args.cancel; - }, - - // Adds a listener for the Save and Publish event. - add_saveAndPublish: function(handler) { - this.get_events().addHandler("saveAndPublish", handler); - }, - - // Removes a listener for the Save and Publish event. - remove_saveAndPublish: function(handler) { - this.get_events().removeHandler("saveAndPublish", handler); - }, - - // Sets whether the pages has unsaved changes. - setDirty: function(isDirty) { - window.onbeforeunload = isDirty ? function() { return "You have unsaved changes."; } : null; - }, - - // Global error handler. Displays a tooltip with the error message. - _handleError: function(sender, args) { - if (args.get_error() != undefined) { - var errorMessage; - if (args.get_response().get_statusCode() == '200') { - errorMessage = args.get_error().message; - } - else { - errorMessage = "An unspecified error occurred."; - } - args.set_errorHandled(true); - UmbSpeechBubble.ShowMessage("info", "Error", errorMessage); - } - } -} - -// Register the class and create a global instance. -umbraco.presentation.LiveEditing.Controls.LiveEditingToolbar.registerClass("umbraco.presentation.LiveEditing.Controls.LiveEditingToolbar", Sys.Component); -var LiveEditingToolbar = new umbraco.presentation.LiveEditing.Controls.LiveEditingToolbar(); \ No newline at end of file diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Css/LiveEditing.css b/src/Umbraco.Web.UI/umbraco/LiveEditing/Css/LiveEditing.css deleted file mode 100644 index f2dc632e6d..0000000000 --- a/src/Umbraco.Web.UI/umbraco/LiveEditing/Css/LiveEditing.css +++ /dev/null @@ -1,370 +0,0 @@ -/***************************************************************** - - Live Editing placeholders - -/****************************************************************/ - -umbraco\:iteminfo { - cursor: pointer; - border: 1px dashed #bbb; - padding: 5px; -} - -.liveEditingForceBlockMode { - display: block; -} - -umbraco\:iteminfo:hover -{ - border: 2px dashed #f36f21; - padding: 5px; -} - -/***************************************************************** - - General Toolbar CSS - -/****************************************************************/ - -html { - margin-top: 30px !important; -} - -#LiveEditingToolbar -{ - font-family:"Trebuchet MS",verdana,arial; - background: url(../../../umbraco_client/tabView/images/background.gif) !important; - position: fixed !important; - width: 100% !important; - height: 34px !important; - top: 0 !important; - left: 0 !important; - text-align: left !important; - border-bottom: 1px solid #B0B0B0 !important; -} - -#LiveEditingToolbar div { - padding: 4px !important; -} - -#LiveEditingToolbar div div { - padding: inherit !important; -} - -#LiveEditingToolbar div.ExtraMenuItems { - display: inline !important; -} - -#LiveEditingToolbar div { - /*background: url(/umbraco/LiveEditing/Images/Canvas.gif) no-repeat right 4px; */ - width: 100%; -} - -#LiveEditingToolbar * div { - background: none; - width: auto; -} - -#LiveEditingToolbar input.button { - cursor: hand !important; - width: 22px !important; - height: 23px !important; - background: none !important; - border: none !important; -} - -#LiveEditingToolbar input.button:hover, #LiveEditingClientToolbar a.mceButtonEnabled:hover { - background-image: url(../../../umbraco_client/menuicon/images/buttonbg.gif) !important; - border: none !important; -} - -#LiveEditingToolbar input.close { - position: absolute !important; - right: 7px !important; - top: 6px !important; - /*border: none !Important; - background: none !Important; */ - color: #000; - width: 150px; -} - -#LiveEditingToolbar input.close:hover { - opacity: 1 !important; -} - -#LiveEditingToolbar img.about { - margin: 0 5px 5px 5px !important; -} - -#LiveEditingClientToolbar, #LiveEditingClientToolbar div { - display: inline !important; -} - -#LiveEditingToolbar span.separator { - padding-right: 7px !important; -} - -#LiveEditingToolbar span.separator span { - border-left: 1px solid #999999 !important; - border-right: 1px solid #EEEEEE !important; - position: absolute !important; - top: 7px !important; - width: 0px !important; - overflow: hidden !important; -} - -#LiveEditingToolbar .umbLabelButton -{ - cursor: hand !important; - float: left; - margin: 1px 5px 1px 1px; - padding: 0 !important; -} - -#LiveEditingToolbar .umbLabelButton:hover -{ - background: #EAEAEA; - border: 1px solid #CAC9C9 !Important; - margin: 0px 4px 0px 0px; -} - -#LiveEditingToolbar .umbLabelButton a -{ - text-decoration: none; - font-size: 80%; - margin-right: 3px; - padding: 5px 0; -} - - -#LiveEditingToolbar .umbLabelButton input.button { - width: 22px !important; - height: 23px !important; - margin-right: 3px; - background: none !important; - border: none !important; - vertical-align: middle; -} - -#LiveEditingToolbar .umbLabelButton input.button:hover { - background-image: none !important; - border: none !important; -} - -/***************************************************************** - - TinyMCE extra CSS - -/****************************************************************/ - -/* hide the temporary TinyMCE container */ -.tinymceContainer { - position: absolute !important; - left: -1000px !important; -} - -#LiveEditingClientToolbar .mceToolbarExternal table { - display: inline !important; - background: none !important; - margin: 0 !important; -} - -#LiveEditingClientToolbar .mceToolbarExternal { - position: absolute !important; - top: 0 !important; -} - -#LiveEditingClientToolbar a.mceButtonEnabled { - width: 22px !important; - height: 23px !important; -} - -/***************************************************************** - - Datatypes extra CSS - -/****************************************************************/ - -.relatedlinksdatatype -{ - background-color: #fff !important; - border: 1px solid #999 !important; -} - -/***************************************************************** - - Modal dialogs - -/****************************************************************/ - -.umbModalBox h1 -{ - font-size: larger !important; -} - -.umbModalBox h2 -{ - font-size: medium !important; -} - -.umbModalBox label -{ - padding-bottom: 2px !Important; - display: block !Important; - color: #666 !Important; - font-family:Trebuchet MS,Lucida Grande,verdana,arial ! important; -} - -.umbModalBox p -{ - font-size: 12px !important; - font-family:Trebuchet MS,Lucida Grande,verdana,arial ! important; - color:Black ! important; - margin-bottom:5px; -} - -.umbModalBox p select -{ - margin-bottom:10px ! important; -} - -.umbModalBox p{font-size: 11px !Important} - - -#skins ul{list-style: none; padding: 0px; display: block; clear: both; height: 200px;} -#skins ul li{margin-right: 12px; float: left; border: 1px solid #efefef; padding: 5px; width: 120px; text-align: center; font-weight: normal;} - - -/***************************************************************** - - Umbraco UI Components - -/****************************************************************/ - -.propertypane { - position: relative; - display: block; - line-height: 1.1; - background: #fff url('/umbraco_client/propertypane/images/propertyBackground.gif') top repeat-x !Important; - background-image:url(/umbraco_client/propertypane/images/propertyBackground.gif) !Important; - padding: 5px; - margin:7px 0px 0px 0px; - border: 1px solid #d9d7d7; - text-align:left; - clear: both; - float: none; - color: black; - font-size: 11px !Important; - } - - .propertypane th - { - vertical-align: top; - text-align:left; - font-weight:bold; - font-family: Trebuchet MS, Lucida Grande, verdana, arial; - font-size:12px; - width: 16%; - } - - .propertypane,.propertypane td - { - font-family: Trebuchet MS, Lucida Grande, verdana, arial; - font-size:12px; - } - - - .propertypane small - { - font-weight: normal; - color: #666; - } - - .propertypane div.propertyItem{ - padding-bottom: 5px; - clear: both; - font-family: Trebuchet MS, Lucida Grande, verdana, arial; - font-size:12px; - } - - .propertypane div.propertyItem .propertyItemheader{ - width: 16%; - padding-right: 1%; - padding-bottom: 10px; - float: left; - clear: left; - font-weight:bold; - } - - .propertypane div.propertyItem .propertyItemContent{ - float: left; - padding-bottom: 5px; - clear: right; - } - - h2.propertypaneTitel{font-size: 14px; color: #999;margin: 7px 0px 0px 0px; padding-bottom: 0px; line-height: 14px;} - - div.propertyPaneFooter{clear: both; height: 1px; overflow: hidden; color: #fff;} - -#LiveEditingToolbar .ModuleSelector -{ - background-color:#FFF !important; - position:absolute; - top:36px; - left:270px; - color:#000; - border-left:5px solid #A3A3A3; - border-right:5px solid #A3A3A3; - border-bottom:5px solid #A3A3A3; - z-index:100; -} - -#LiveEditingToolbar #moduleSelectorContainer -{ - padding:10px; -} - -.umbModuleContainerSelector -{ - cursor:pointer; -} - -p#installingModule img -{ - float:none; - margin:0; - padding:0; -} - -#LiveEditingToolbar #modules ul -{ - list-style-type:none; - margin-left:0px; - margin-right:0px; -} - -#LiveEditingToolbar #modules ul li -{ - display:block; - padding-bottom:5px; - padding-top:5px; - border-bottom:1px solid #c3c3c3; -} - - #LiveEditingToolbar .umbLabelButton a, #LiveEditingToolbar .umbLabelButton a:hover -{ - color:Black !important; -} - -.umbModalBox a, .umbModalBox a:hover -{ - color:#888 !important; -} - -/* skin customize dialog */ -#costumizeSkin #dependencies .propertypane -{ - height:205px; - overflow:scroll; - overflow-x: hidden; -} \ No newline at end of file diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Images/canvas.gif b/src/Umbraco.Web.UI/umbraco/LiveEditing/Images/canvas.gif deleted file mode 100644 index cdc7bd0793a91a93a3d56049f9bd628a8aadae6c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1009 zcmeH`{V&u30EfSgc}dE-m`V$^bx1?Dm}XwKayZe%&8$vRCR5xJqt$iJaTW8@g@o(U zg_}Ds#hi`nCbn)It{hHXb-N^6C#`(9yM4+((NBGTezs?Ow$Ca0$wEF43GFP4D2wDBhbRjJ<>=?&+j~nJ3%zAzW14A6i_WVkaK*26 zG$f!kV`WB(X&L!26`wWcUOoz3AS*%BS=`u1)+gd|I$o5Ur5qIRCu* zyW{5?##>PyjFJP8%2>{#8%HD$(rn&nT7L-_2 zk`2k=24Z6kcO&p&k`zSa5fkbz)546Uv%s`CL)OHR{O}dc*!R9Fl=>joj=UFx1_l(> zD5Rn}6<_9YjvzTfq%cLLQfal?{{DWW(MbH?KP=!)+HNBV9&u#Lx%COcVTy2a^o*6a zE4dC-zl=$_NX2(K7}pY8E7}?EHPA8{^)za{f?D3lj27EfJJWBMrRcmgHoIMmGD=vY zY0pr9ieQMSaN6N;$WOkx&Y@3n6N5+0XQHQhfqAVt?QE^V**->1Q`UJi?CpI+Qvy5= zS31*NE~N}@yx#S|Bg^qgXP<;`8yum39^})(&~qr8(y(LM@j^;~)Z)95#^RocO=Tug tKE+bEdl*C9Lq9sz9K9egC^If^jM-5x4tdzn1om_CtT(NU(xONr{0}%{a!&vN diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Images/dialog_background.png b/src/Umbraco.Web.UI/umbraco/LiveEditing/Images/dialog_background.png deleted file mode 100644 index 208d9c259ae11a8f7ee7e0ab0f147312f6ade91f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 13247 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 - UmbracoContext.cs - - - - - - - - - AAABAAAAQAAEIhAAEAEAAAAQAAAAAEQAAAAAFAgAEAA= - umbraco\LiveEditing\Controls\LiveEditingManager.cs - - - - - - - - - - - BAAAAAAAAAIAKBAAAGCAIAAQAAAAAAQAAFgAAAABAAA= - umbraco\LiveEditing\Controls\LiveEditingToolbar.cs - - - - - - AAAAAAAAQAAAABAQAECAAAAgAAAAAAQAABBAAAAQAAA= - umbraco\LiveEditing\Controls\Communicator.cs - - - - - - AAAAAAAAAAAAAIAAAAAAAAAAAAAIAAAAAAAAAgAAAAA= - umbraco\LiveEditing\ILiveEditingContext.cs - - - - - - - - - - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= - umbraco\LiveEditing\Menu\ILiveEditingMenu.cs - - - - - - AAIAAAAAAAAAAAABAAAAAGAAAAAAAAAAAgAAAAAAIAA= - umbraco\LiveEditing\Updates\IUpdateList.cs - - - - \ No newline at end of file diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/CreateModule/CreateModule.js b/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/CreateModule/CreateModule.js deleted file mode 100644 index e278c4b3ab..0000000000 --- a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/CreateModule/CreateModule.js +++ /dev/null @@ -1,5 +0,0 @@ -/********************* Live Editing CreateModule functions *********************/ -function CreateModuleOk() -{ - UmbracoCommunicator.SendClientMessage('createcontent', ''); -} \ No newline at end of file diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/CreateModule/create.png b/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/CreateModule/create.png deleted file mode 100644 index ea3f06e5a688563c9425dcaebdcd355873bedbb2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3764 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 0, "Live Editing - ItemEditing: Could not find the editor control."); - //this._activeItem.jItem.fadeIn(); - this.moveChildControls(this._editControl, this._activeItem.jItem); - - // Only elements that are currently present, can cause item editing to stop. - // This enables transparent use of dynamically created elements (such as context/dropdown menus) - // as clicks on those elements will not trigger the stop edit signal. - jQuery("*").each(function () { jQuery(this).data("canStopEditing", true); }); - - // raise event - var handler = this.get_events().getHandler("startEdit"); - if (handler) - handler(this, Sys.EventArgs.Empty); - - this.ignoreChildClicks(this._activeItem.jItem); - - LiveEditingToolbar.setDirty(true); - }, - - // Stops the editing of a specified item, and raises the stopEdit event. - stopEdit: function() { - if (this._activeItem != null) { - Sys.Debug.trace("Live Editing - ItemEditing: Stop editing of " + this._activeItem.toString() + "."); - - // raise event - var handler = this.get_events().getHandler("stopEdit"); - if (handler) - handler(this, Sys.EventArgs.Empty); - - // submit changes - Sys.Debug.assert(this._submitControl != null, "Live Editing - ItemEditing: Submit button not set."); - this._submitControl.click(); - - // hide control - //this._activeItem.jItem.fadeOut(); - this._activeItem = null; - this._submitControl = null; - this._editControl = null; - } - }, - - // Adds an event handler to the startEdit event. - add_startEdit: function(handler) { - this.get_events().addHandler("startEdit", handler); - }, - - // Removes an event handler from the startEdit event. - remove_startEdit: function(handler) { - this.get_events().removeHandler("startEdit", handler); - }, - - // Adds an event handler to the stopEdit event. - add_stopEdit: function(handler) { - this.get_events().addHandler("stopEdit", handler); - }, - - // Removes an event handler from the stopEdit event. - remove_stopEdit: function(handler) { - this.get_events().removeHandler("stopEdit", handler); - }, - - // Cancels the save method when an item is active, and postpones it to the next postback. - delaySaveWhenEditing: function(args, type) { - if (this._activeItem != null) { - this.stopEdit(); - args.cancel = true; - (function() { - var f = function() { - Sys.Application.remove_load(f); - setTimeout(function() { - Sys.Debug.trace("Live Editing - Delayed Saving Changes to server"); - UmbracoCommunicator.SendClientMessage(type, ""); - }, 100); - } - Sys.Application.add_load(f); - })(); - } - else { - Sys.Debug.trace("Live Editing - Saving Changes to server"); - if (!Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack()) { - UmbracoCommunicator.SendClientMessage(type, ""); - } - else { - Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function() { - UmbracoCommunicator.SendClientMessage(type, ""); - }); - } - } - }, - - // Enables Live Editing of items. - itemsEnable: function() { - var items = this.getElementsByTagName("umbraco:iteminfo"); - Sys.Debug.trace(" Found " + items.length + " editable Umbraco item(s)."); - - // enhance items with edit functionality - var _this = this; - var i = 0; - items.each(function() { - var item = new umbraco.presentation.LiveEditing.activeItem(jQuery(this)); - _this._items[item.itemId] = item; - Sys.Debug.trace(" " + (++i) + ". " + item.toString() + " is Live Editing enabled."); - }); - // disable hyperlinks to make them clickable for Live Editing - this.disableHyperlinks(); - - // add "stop editing" handler when clicking outside the item - var _this = this; - jQuery(document).mousedown(function(event) { - Sys.Debug.trace("DOCUMENT CLICKED"); - // the canStopEditing property is set in startEdit - if (_this._activeItem != null && jQuery(event.target).data("canStopEditing")) { - if (!_this._activeItem.clicked) - _this.stopEdit(); - else - _this._activeItem.clicked = false; - } - }); - jQuery("#LiveEditingToolbar").mousedown(function() { - Sys.Debug.trace("TOOLBAR CLICKED"); - if (_this._activeItem != null) - _this._activeItem.clicked = true; - }); - }, - - // Update items that have changed. - updateItems: function() { - var itemUpdates = this.getElementsByTagName("umbraco:itemupdate"); - Sys.Debug.trace("Live Editing - ItemEditing: " + itemUpdates.length + " item update(s)."); - - var _this = this; - itemUpdates.each(function() { - var itemUpdate = jQuery(this); - var itemId = itemUpdate.attr("itemId"); - var item = _this._items[itemId]; - - if (item != null) { - Sys.Debug.trace(" Updating " + item.toString() + "."); - - // remove old children and add updates ones - _this.moveChildControls(itemUpdate, item.jItem); - //item.jItem.fadeIn(); - - // disable hyperlinks to make them clickable for Live Editing - _this.disableHyperlinks(); - } - else { - itemUpdate.html(""); - } - }); - }, - - // Update controls that have changed. - updateControls: function() { - Sys.Debug.trace("Live Editing - ItemEditing: In updatecontrols"); - var controlUpdates = this.getElementsByTagName("umbraco:control"); - Sys.Debug.trace("Live Editing - ItemEditing: " + controlUpdates.length + " control update(s)."); - - if (controlUpdates.length == 1) { - if (this._activeItem != null && controlUpdates.children().length > 0) { - Sys.Debug.trace("Live Editing - ItemEditing: updating edit control."); - this.moveChildControls(controlUpdates, this._activeItem.jItem); - this.ignoreChildClicks(); - } - - this._submitControl = controlUpdates.next(); - Sys.Debug.assert(this._submitControl.length > 0, "Live Editing - ItemEditing: Submit button not found."); - } - }, - - // ignores clicks on child elements of the control - ignoreChildClicks: function() { - var _this = this; - this._activeItem.jItem.children().mousedown(function(e) { - _this._activeItem.clicked = true; - }); - }, - - // Moves the child controls from source into destination, overwriting existing elements. - moveChildControls: function(source, dest) { - Sys.Debug.trace("Live Editing - Moving Child Controls"); - - //remove contents in the destination - dest.html(""); - - //add the source to the destination - dest.append(source.html()); - - //remove teh contents from the source - source.html(""); - - }, - - // Gets a list of elements with the specified tagname including namespaced ones - getElementsByTagName: function(tagname) { - var found = jQuery("body").find("*").filter(function(index) { - if (this.nodeType != 3) { - var nn = this.nodeName.toLowerCase(); - var ftn = tagname.toLowerCase(); - var ln = (ftn.indexOf(":") > 0 ? ftn.substr(ftn.indexOf(":") + 1) : ftn); - return (nn == ftn - || (typeof this.scopeName != "undefined" && nn == ln && this.scopeName.toLowerCase() == ftn.substr(0, ftn.indexOf(":")))); - } - return false; - }); - Sys.Debug.trace("found " + found.length + " elements with selector: " + tagname); - return found; - }, - - // Disables hyperlinks inside the specified element. - disableHyperlinks: function() { - jQuery("a").click(function() { - return false; - }); - } -} - -umbraco.presentation.LiveEditing.ItemEditing.registerClass("umbraco.presentation.LiveEditing.ItemEditing", Sys.Component); - -//an object to store the information for the active item -umbraco.presentation.LiveEditing.activeItem = function(item) { - //error checking - if (item != null && item.length != 1) { - return null; - } - //create the object with values, wire up events and return it - var obj = { - jItem: item, - nodeId: item.attr("nodeId"), - fieldName: item.attr("name"), - itemId: item.attr("itemId"), - clicked: false, - toString: function() { - return "Item " + this.itemId + " (node " + this.nodeId + ": " + this.fieldName + ")"; - }, - // Activates an item for editing. - activate: function() { - ItemEditing._items[this.itemId] = this; - if (this != ItemEditing._activeItem) { - Sys.Debug.trace("Live Editing - ItemEditing: " + this.toString() + " was activated."); - if (!Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack()) { - UmbracoCommunicator.SendClientMessage("edititem", this.itemId); - } - else { - var itemId = this.itemId; - Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function() { - if (itemId != 0) { - UmbracoCommunicator.SendClientMessage("edititem", itemId); - itemId = 0; - } - }); - } - //this.jItem.fadeOut(); - } - }, - // Item click handler. - onClick: function(e) { - if (ItemEditing._activeItem != null && ItemEditing._activeItem.itemId == this.itemId) { - Sys.Debug.trace("Live Editing - ItemEditing: " + this.toString() + " click ignored because it is already active."); - } - else { - Sys.Debug.trace("Live Editing - ItemEditing: " + this.toString() + " was clicked."); - e.stopPropagation(); // disable click event propagation to parent elements - this.activate(); - } - } - } - - //keep the scope on the click event method call - obj.jItem.click(function(e) { - obj.onClick.call(obj, e); - }); - - return obj; -} - - -// global instance of the ItemEditing class -function initializeGlobalItemEditing() { - ItemEditing = new umbraco.presentation.LiveEditing.ItemEditing(); -} \ No newline at end of file diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/ItemEditing/ItemEditingInvoke.js b/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/ItemEditing/ItemEditingInvoke.js deleted file mode 100644 index 47c371631d..0000000000 --- a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/ItemEditing/ItemEditingInvoke.js +++ /dev/null @@ -1,3 +0,0 @@ -//this is simply used for live editing in order to invoke a method from a previously lazy loaded script; -//alert("ItemEditingInvoke: " + initializeGlobalItemEditing); -initializeGlobalItemEditing(); \ No newline at end of file diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/MacroModule/MacroModule.js b/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/MacroModule/MacroModule.js deleted file mode 100644 index 80721af012..0000000000 --- a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/MacroModule/MacroModule.js +++ /dev/null @@ -1,21 +0,0 @@ -/********************* Live Editing MacroModule functions *********************/ - -function MacroOnDrop( sender, e ) -{ -var container = e.get_container(); -var item = e.get_droppedItem(); -var position = e.get_position(); - -//alert( String.format( "Container: {0}, Item: {1}, Position: {2}", container.id, item.id, position ) ); - -var instanceId = parseInt(item.getAttribute("InstanceId")); -var columnNo = parseInt(container.getAttribute("columnNo")); -var row = position; - -} - -function okAddMacro(sender, e) -{ - $find('ModalMacro').hide(); - /*__doPostBack('AddMacro', e); */ -} diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/CssParser.aspx b/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/CssParser.aspx deleted file mode 100644 index 1ebd8692cf..0000000000 --- a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/CssParser.aspx +++ /dev/null @@ -1 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CssParser.aspx.cs" Inherits="umbraco.presentation.umbraco.LiveEditing.Modules.SkinModule.CssParser" %> \ No newline at end of file diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/ImageUploader.aspx b/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/ImageUploader.aspx deleted file mode 100644 index 63e64045cc..0000000000 --- a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/ImageUploader.aspx +++ /dev/null @@ -1,193 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ImageUploader.aspx.cs" Inherits="umbraco.presentation.umbraco.LiveEditing.Modules.SkinModule.ImageUploader" %> -<%@ Register TagPrefix="umb" Namespace="ClientDependency.Core.Controls" Assembly="ClientDependency.Core" %> -<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %> - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -

    - or Cancel -

    -
    - - - - - - - - -
    - -
    -
    - - -
    -
    -
    -
    - - - - - - -
    - -

    - or Cancel -

    - -
    - - - - diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/ModuleInjectionMacroRenderer.aspx b/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/ModuleInjectionMacroRenderer.aspx deleted file mode 100644 index 253ce9ead3..0000000000 --- a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/ModuleInjectionMacroRenderer.aspx +++ /dev/null @@ -1 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ModuleInjectionMacroRenderer.aspx.cs" Inherits="umbraco.presentation.umbraco.LiveEditing.Modules.SkinModule.ModuleInjectionMacroRenderer" %> diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/ModuleInjector.aspx b/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/ModuleInjector.aspx deleted file mode 100644 index 8909fc1f36..0000000000 --- a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/ModuleInjector.aspx +++ /dev/null @@ -1,141 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ModuleInjector.aspx.cs" Inherits="umbraco.presentation.umbraco.LiveEditing.Modules.SkinModule.ModuleInjector" %> -<%@ Register TagPrefix="umb" Namespace="ClientDependency.Core.Controls" Assembly="ClientDependency.Core" %> -<%@ Import Namespace="Umbraco.Core.Configuration" %> -<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %> - - - - - - - - - - - - - - - - - - - -
    - - -
    -
    -
    - -
    -
    -
    -
    - -
    - -

    - " - onclick="updateMacro()" /> -

    -
    - - diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/ModuleInstaller.aspx b/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/ModuleInstaller.aspx deleted file mode 100644 index 48eb082bca..0000000000 --- a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/ModuleInstaller.aspx +++ /dev/null @@ -1 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ModuleInstaller.aspx.cs" Inherits="umbraco.presentation.umbraco.LiveEditing.Modules.SkinModule.ModuleInstaller" %> diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/ModuleSelector.ascx b/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/ModuleSelector.ascx deleted file mode 100644 index 01e108cf36..0000000000 --- a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/ModuleSelector.ascx +++ /dev/null @@ -1,55 +0,0 @@ -<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ModuleSelector.ascx.cs" Inherits="umbraco.presentation.umbraco.LiveEditing.Modules.SkinModule.ModuleSelector" %> -<%@ Import Namespace="umbraco.cms.businesslogic.packager.repositories" %> - - -
    - - - -
    -

    Please select the module you wish to insert.

    -
      - - -
    • - - - <%# ((Package)Container.DataItem).Text %> - <%# ((Package)Container.DataItem).Text %> - - - -
    • -
      - -
    -
    - - - -
    - -

    -Unable to fetch module, please try again later. -

    - - - - - - Cancel -
    diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/SkinCustomizer.ascx b/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/SkinCustomizer.ascx deleted file mode 100644 index 8bcd50acd8..0000000000 --- a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/SkinCustomizer.ascx +++ /dev/null @@ -1,125 +0,0 @@ -<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SkinCustomizer.ascx.cs" Inherits="umbraco.presentation.LiveEditing.Modules.SkinModule.SkinCustomizer" %> -<%@ Import Namespace="umbraco.cms.businesslogic.packager.repositories" %> - -<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %> - - - - -

    Connection to repository failed...

    -
    - - - - - - - -
    > - -

    - Personalize your skin, by defining colors, images and texts -

    - -
    - -
    - -

    - - or Cancel -

    - - -

    You could also change to another skin: Browse available skins

    - -
    - - - -
    > - -

    - Choose a skin from your local collection, or download one from the umbraco package repository -

    - - -
    - - -
      - - -
    • - <%# ((Skin)Container.DataItem).Text %> - <%# ((Skin)Container.DataItem).Text %> -
      - -
    • -
      - -
    - -
    - -
    - -
    -

    Looks like there are also some local skins

    - - - -
      - - -
    • - <%# ((string)Container.DataItem).ToString() %> - - -
    • -
      - -
    - -
    - - -
    - -

    - Go back to your current skin -

    - -
    - - - - diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/SkinModule.js b/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/SkinModule.js deleted file mode 100644 index ab545be481..0000000000 --- a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/SkinModule.js +++ /dev/null @@ -1 +0,0 @@ -/********************* Live Editing SkinModule functions *********************/ diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/images/loader.gif b/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/images/loader.gif deleted file mode 100644 index 4e651edc478b3db7ad5758bdb912e890e884aaf7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1737 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 E7fdjV-~a#s diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/js/ModuleInjection.js b/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/js/ModuleInjection.js deleted file mode 100644 index ecaa195dc2..0000000000 --- a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/js/ModuleInjection.js +++ /dev/null @@ -1,130 +0,0 @@ -var umbModuleToInsertAlias; - - -function umbMakeModulesSortable() { - - if (jQuery('.umbModuleContainer').length > 0) { - jQuery('.umbModuleContainer').sortable({ - connectWith: '.umbModuleContainer', - items: '.umbModule', - stop: function (event, ui) { - - UmbracoCommunicator.SendClientMessage("movemodule", ui.item.attr('id') + ";" + ui.item.parent().attr('id') + ";" + jQuery('.umbModule', ui.item.parent()).index(ui.item)); - } - }); - } - -} - -function umbSelectModule(alias,sender) { - jQuery('#modules').hide(); - jQuery('#moduleSelect').show(); - umbShowModuleContainerSelectors(jQuery('span', sender).html()); - umbModuleToInsertAlias = alias; - - jQuery('.selectedModule').html(jQuery('span',sender).html()); - -} -function umbInstallModuleAndGetAlias(guid,name,sender) { - - jQuery('#modules').hide(); - jQuery('.selectedModule').html(name); - jQuery("#installingModule").show(); - - jQuery.post(umbCurrentUmbracoDir + "/LiveEditing/Modules/SkinModule/ModuleInstaller.aspx?guid=" + guid + "&name=" + name, - function (data) { - - if (data == "error") { - - } - else { - jQuery("#installingModule").hide(); - jQuery('#moduleSelect').show(); - umbShowModuleContainerSelectors(jQuery('span', sender).html()); - umbModuleToInsertAlias = data; - - jQuery(sender).attr("onclick", ""); - - jQuery(sender).click(function () { - umbSelectModule(data, this); - return false; - }); - } - - - }); - -} -function umbShowModuleSelection() { - - umbRemoveModuleContainerSelectors(); - - jQuery("#moduleSelect").hide(); - jQuery("#modules").show(); - - jQuery(".ModuleSelector").show(); - -} - -function umbShowModuleContainerSelectors(moduleName) { - - jQuery(".umbModuleContainer").each(function () { - - if (jQuery(this).children().size() > 0) { - jQuery(this).prepend("
    Insert module here
    "); - } - - jQuery(this).append("
    Insert module here
    "); - - }); - - jQuery(".umbModuleContainerSelector").click(function () { - - jQuery(".ModuleSelector").hide(); - Umbraco.Controls.ModalWindow().open(umbCurrentUmbracoDir + '/LiveEditing/Modules/SkinModule/ModuleInjector.aspx?macroAlias=' + umbModuleToInsertAlias + '&target=' + jQuery(this).parent().attr('id') + "&type=" + jQuery(this).attr('rel'), 'Insert ' + moduleName + ' module', true, 550, 550, 50, 0, ['.modalbuton'], null); - - }); -} - -function umbRemoveModuleContainerSelectors() { - jQuery(".umbModuleContainerSelector").remove(); -} - -function umbInsertModule(container,macro,type) { - umbRemoveModuleContainerSelectors(); - - var working = "
    Inserting module...
    "; - - if (type == "append") { - jQuery("#" + container).append(working); - } else { - jQuery("#" + container).prepend(working); - } - - var moduleguid = guid(); - - - - UmbracoCommunicator.SendClientMessage("injectmodule", container + ";" + "
    " + macro + "
    ;" + type); - - //need to lose these replace calls - - jQuery.post(umbCurrentUmbracoDir + "/LiveEditing/Modules/SkinModule/ModuleInjectionMacroRenderer.aspx?tag=" + macro.replace('>', '').replace('<', '').replace('', '') + "&umbPageID=" + umbCurrentPageId, - function (data) { - jQuery(".umbModuleContainerPlaceHolder").html("
    " + data + "
    ;"); - - UmbSpeechBubble.ShowMessage("Info", "Module", "Module inserted"); - }); - - } - - - function S4() { - return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1); - } - function guid() { - return (S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4()); - } - - //startup stuff - umbMakeModulesSortable(); \ No newline at end of file diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/js/SkinModuleShowOnStartup.js b/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/js/SkinModuleShowOnStartup.js deleted file mode 100644 index f21e5aacd0..0000000000 --- a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/js/SkinModuleShowOnStartup.js +++ /dev/null @@ -1 +0,0 @@ -ShowSkinModule(); \ No newline at end of file diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/js/disableInstallButtonsOnClick.js b/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/js/disableInstallButtonsOnClick.js deleted file mode 100644 index 4df5f81ad1..0000000000 --- a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/js/disableInstallButtonsOnClick.js +++ /dev/null @@ -1,8 +0,0 @@ -jQuery('.selectskin').click(function () { - - jQuery('#skinupdateinprogress').show(); - - jQuery('#skins').hide(); - - jQuery('#localSkinsContainer').hide(); -}); \ No newline at end of file diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/js/initcolorpicker.js b/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/js/initcolorpicker.js deleted file mode 100644 index 4a6e407296..0000000000 --- a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/js/initcolorpicker.js +++ /dev/null @@ -1,22 +0,0 @@ -var activecolorpicker; - -jQuery('input.skinningcolorpicker').ColorPicker({ - onSubmit: function (hsb, hex, rgb, el) { - jQuery(el).val('#' + hex); - jQuery(el).ColorPickerHide(); - jQuery(el).trigger('change'); - }, - onBeforeShow: function () { - activecolorpicker = this; - jQuery(this).ColorPickerSetColor(this.value); - }, - onChange: function (hsb, hex, rgb) { - - jQuery(activecolorpicker).val('#' + hex); - jQuery(activecolorpicker).trigger('change'); - } -}) -.bind('keyup', function () { - jQuery(this).ColorPickerSetColor(this.value); -}); - diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/js/initslider.js b/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/js/initslider.js deleted file mode 100644 index 691a6b5001..0000000000 --- a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/js/initslider.js +++ /dev/null @@ -1,19 +0,0 @@ -jQuery(".skinningslider").each(function () { - - var vals = jQuery(this).attr("rel").split(","); - - var minimum = vals[0]; - var maximum = vals[1]; - var initial = vals[2]; - var ratio = vals[3] - var target = vals[4]; - - jQuery(this).slider({ - change: function (event, ui) { if (ratio != "") { jQuery("#" + target).val(ui.value / ratio); } else { jQuery("#" + target).val(ui.value); } jQuery("#" + target).trigger("change"); }, - slide: function (event, ui) { if (ratio != "") { jQuery("#" + target).val(ui.value / ratio); } else { jQuery("#" + target).val(ui.value); } jQuery("#" + target).trigger("change"); }, - min: minimum, - max: maximum, - value: initial - }); - -}); \ No newline at end of file diff --git a/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/skin.png b/src/Umbraco.Web.UI/umbraco/LiveEditing/Modules/SkinModule/skin.png deleted file mode 100644 index ea3f06e5a688563c9425dcaebdcd355873bedbb2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3764 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 mnOym+v^o6$4|3zce-8lTDp?-_2ub$<0000 - - - - - - Untitled Page - - -
    -
    - -
    -
    - - diff --git a/src/Umbraco.Web.UI/umbraco/css/umbLiveEditing.css b/src/Umbraco.Web.UI/umbraco/css/umbLiveEditing.css deleted file mode 100644 index fa189266ea..0000000000 --- a/src/Umbraco.Web.UI/umbraco/css/umbLiveEditing.css +++ /dev/null @@ -1,14 +0,0 @@ -.umbEditItem:hover { - border: 1px dotted orange; - padding: 5px; -} - -.umbLiveEditingToggleButton -{ - display: none; -} - -.umbLiveEditingCancelButton -{ - margin-left: 10px; -} \ No newline at end of file diff --git a/src/Umbraco.Web.UI/umbraco/developer/Packages/StarterKits.aspx.cs b/src/Umbraco.Web.UI/umbraco/developer/Packages/StarterKits.aspx.cs index d7298d09a1..af31f42143 100644 --- a/src/Umbraco.Web.UI/umbraco/developer/Packages/StarterKits.aspx.cs +++ b/src/Umbraco.Web.UI/umbraco/developer/Packages/StarterKits.aspx.cs @@ -13,10 +13,7 @@ namespace Umbraco.Web.UI.Umbraco.Developer.Packages protected void Page_Load(object sender, EventArgs e) { - if (!global::umbraco.cms.businesslogic.skinning.Skinning.IsStarterKitInstalled()) - ShowStarterKits(); - else - ShowSkins((Guid)global::umbraco.cms.businesslogic.skinning.Skinning.StarterKitGuid()); + ShowStarterKits(); } private void ShowStarterKits() @@ -40,22 +37,7 @@ namespace Umbraco.Web.UI.Umbraco.Developer.Packages StarterKitInstalled.Visible = false; } - - public void ShowSkins(Guid starterKitGuid) - { - - var ctrl = (LoadStarterKitDesigns)LoadControl(SystemDirectories.Install + "/steps/Skinning/loadStarterKitDesigns.ascx"); - ctrl.ID = "StarterKitDesigns"; - - ctrl.StarterKitGuid = starterKitGuid; - ctrl.StarterKitDesignInstalled += CtrlStarterKitDesignInstalled; - ph_skins.Controls.Add(ctrl); - - StarterKitNotInstalled.Visible = false; - StarterKitInstalled.Visible = true; - - } - + void StarterkitsctrlStarterKitInstalled() { StarterKitNotInstalled.Visible = false; @@ -65,13 +47,5 @@ namespace Umbraco.Web.UI.Umbraco.Developer.Packages } - void CtrlStarterKitDesignInstalled() - { - StarterKitNotInstalled.Visible = false; - StarterKitInstalled.Visible = false; - - installationCompleted.Visible = true; - } - } } \ No newline at end of file diff --git a/src/Umbraco.Web.UI/umbraco/dialogs/TemplateSkinning.aspx b/src/Umbraco.Web.UI/umbraco/dialogs/TemplateSkinning.aspx deleted file mode 100644 index 829ba939ef..0000000000 --- a/src/Umbraco.Web.UI/umbraco/dialogs/TemplateSkinning.aspx +++ /dev/null @@ -1,57 +0,0 @@ -<%@ Page Language="C#" MasterPageFile="../masterpages/umbracoDialog.Master" AutoEventWireup="true" CodeBehind="TemplateSkinning.aspx.cs" Inherits="umbraco.presentation.umbraco.dialogs.TemplateSkinning" %> -<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %> -<%@ Register TagPrefix="umb" Namespace="ClientDependency.Core.Controls" Assembly="ClientDependency.Core" %> -<%@ Import Namespace="umbraco.cms.businesslogic.packager.repositories" %> - - - - - - - Download more skins - - - - -
    - - - - - or Rollback current skin - - -
    -
    - - - -
    - - -
      - - -
    • - - <%# ((Skin)Container.DataItem).Text %> - - <%# ((Skin)Container.DataItem).Text %> - -
      - - -
    • -
      - - -
    - -
    - -
    - -
    - -
    diff --git a/src/Umbraco.Web.UI/umbraco_client/Application/UmbracoApplicationActions.js b/src/Umbraco.Web.UI/umbraco_client/Application/UmbracoApplicationActions.js index 3ff3e7beec..1b0acc0150 100644 --- a/src/Umbraco.Web.UI/umbraco_client/Application/UmbracoApplicationActions.js +++ b/src/Umbraco.Web.UI/umbraco_client/Application/UmbracoApplicationActions.js @@ -270,12 +270,6 @@ Umbraco.Application.Actions = function () { } }, - actionLiveEdit: function () { - /// - - window.open("canvas.aspx?redir=/" + UmbClientMgr.mainTree().getActionNode().nodeId + ".aspx", "liveediting"); - }, - actionNew: function () { /// Show the create new modal overlay var actionNode = UmbClientMgr.mainTree().getActionNode(); diff --git a/src/Umbraco.Web.UI/umbraco_client/tinymce3/themes/umbraco/editor_template_src.js b/src/Umbraco.Web.UI/umbraco_client/tinymce3/themes/umbraco/editor_template_src.js index 98a1ed21ac..6516bc2f73 100644 --- a/src/Umbraco.Web.UI/umbraco_client/tinymce3/themes/umbraco/editor_template_src.js +++ b/src/Umbraco.Web.UI/umbraco_client/tinymce3/themes/umbraco/editor_template_src.js @@ -843,24 +843,11 @@ }); */ - if (jQuery("#LiveEditingToolbar")) { - // NH: Live editing hack for empty div in IE - if (jQuery.browser.msie) { - var emptyDiv = jQuery("#" + ed.getParam("umbraco_toolbar_id", "*")).prev(); - if (emptyDiv.get(0).tagName == "DIV" && emptyDiv.html() == "") { - emptyDiv.hide(); - } - } - - t._addToolbars(etb, o); - DOM.show(DOM.get(ed.id + '_external')); - } else { - jQuery(document).ready(function () { - t._addToolbars(etb, o); - DOM.show(DOM.get(ed.id + '_external')); - }); - } - + jQuery(document).ready(function () { + t._addToolbars(etb, o); + DOM.show(DOM.get(ed.id + '_external')); + }); + ed.onMouseUp.add(function () { jQuery(".tinymceMenuBar").hide(); jQuery("#" + ed.id + "_external").parent().show(); diff --git a/src/Umbraco.Web/Security/WebSecurity.cs b/src/Umbraco.Web/Security/WebSecurity.cs index 11946fedd5..2c0c8b1176 100644 --- a/src/Umbraco.Web/Security/WebSecurity.cs +++ b/src/Umbraco.Web/Security/WebSecurity.cs @@ -306,7 +306,7 @@ namespace Umbraco.Web.Security var user = CurrentUser; // Check for console access - if (user.IsLockedOut || (user.NoConsole && GlobalSettings.RequestIsInUmbracoApplication(_httpContext) && GlobalSettings.RequestIsLiveEditRedirector(_httpContext) == false)) + if (user.IsLockedOut || (user.NoConsole && GlobalSettings.RequestIsInUmbracoApplication(_httpContext))) { if (throwExceptions) throw new ArgumentException("You have no priviledges to the umbraco console. Please contact your administrator"); return ValidateRequestAttempt.FailedNoPrivileges; diff --git a/src/Umbraco.Web/Trees/LegacyTreeDataConverter.cs b/src/Umbraco.Web/Trees/LegacyTreeDataConverter.cs index 55fd9e6f1f..56ba066f2d 100644 --- a/src/Umbraco.Web/Trees/LegacyTreeDataConverter.cs +++ b/src/Umbraco.Web/Trees/LegacyTreeDataConverter.cs @@ -272,13 +272,7 @@ namespace Umbraco.Web.Trees return Attempt.Succeed( new LegacyUrlAction( "dialogs/assignDomain2.aspx?id=" + nodeId + "&rnd=" + DateTime.UtcNow.Ticks, - ui.GetText("actions", "assignDomain"))); - case "UmbClientMgr.appActions().actionLiveEdit()": - return Attempt.Succeed( - new LegacyUrlAction( - "canvas.aspx?redir=/" + nodeId + ".aspx", - "", - ActionUrlMethod.BlankWindow)); + ui.GetText("actions", "assignDomain"))); case "UmbClientMgr.appActions().actionSendToTranslate()": return Attempt.Succeed( new LegacyUrlAction( diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index 12a6f1dc7d..4f81de58e5 100644 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -1066,13 +1066,6 @@ SettingsDashboardVideos.ascx - - Applyskin.ascx - ASPXCodeBehind - - - Applyskin.ascx - StartupDashboardIntro.ascx @@ -1110,13 +1103,6 @@ Preview.aspx - - TemplateSkinning.aspx - ASPXCodeBehind - - - TemplateSkinning.aspx - MemberSearch.ascx ASPXCodeBehind @@ -1864,14 +1850,12 @@ - ASPXCodeBehind - ASPXCodeBehind diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackager.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackager.cs index c25e446fa3..4935886e9a 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackager.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackager.cs @@ -174,9 +174,6 @@ namespace umbraco treeElement.SetAttribute("text", ui.Text("treeHeaders", "installStarterKit")); - if (cms.businesslogic.skinning.Skinning.IsStarterKitInstalled()) - treeElement.SetAttribute("text", ui.Text("treeHeaders", "installSkin")); - break; default: diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadTemplates.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadTemplates.cs index bde3301b46..b313b200ac 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadTemplates.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadTemplates.cs @@ -27,7 +27,7 @@ using umbraco.cms.businesslogic.template; using umbraco.BusinessLogic.Utils; using umbraco.cms.presentation.Trees; using umbraco.BusinessLogic.Actions; -using umbraco.cms.businesslogic.skinning; + namespace umbraco { diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dashboard/Settings/Applyskin.ascx b/src/Umbraco.Web/umbraco.presentation/umbraco/dashboard/Settings/Applyskin.ascx deleted file mode 100644 index 6f336980ce..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dashboard/Settings/Applyskin.ascx +++ /dev/null @@ -1,9 +0,0 @@ -<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Applyskin.ascx.cs" Inherits="umbraco.presentation.umbraco.dashboard.Settings.Applyskin" %> - - - - - - - - \ No newline at end of file diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dashboard/Settings/Applyskin.ascx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dashboard/Settings/Applyskin.ascx.cs deleted file mode 100644 index 458293c2a1..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dashboard/Settings/Applyskin.ascx.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.UI; -using System.Web.UI.WebControls; -using umbraco.cms.businesslogic.skinning; -using umbraco.cms.businesslogic.template; - -namespace umbraco.presentation.umbraco.dashboard.Settings -{ - public partial class Applyskin : System.Web.UI.UserControl - { - protected void Page_Load(object sender, EventArgs e) - { - - skinpicker.Items.Add("Choose..."); - foreach (Skin s in Skinning.GetAllSkins()) - { - skinpicker.Items.Add( new ListItem(s.Name, s.Alias)); - } - } - - protected void apply(object sender, EventArgs e) - { - if (skinpicker.SelectedIndex > 0) - { - Skin s = Skin.CreateFromAlias(skinpicker.SelectedValue); - Skinning.ActivateAsCurrentSkin(s); - } - } - - protected void rollback(object sender, EventArgs e) - { - Template t = Template.GetByAlias("RunwayHomepage"); - Skinning.RollbackSkin(t.Id); - } - - - } -} \ No newline at end of file diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dashboard/Settings/Applyskin.ascx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dashboard/Settings/Applyskin.ascx.designer.cs deleted file mode 100644 index c9d7cd1b76..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dashboard/Settings/Applyskin.ascx.designer.cs +++ /dev/null @@ -1,42 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace umbraco.presentation.umbraco.dashboard.Settings { - - - public partial class Applyskin { - - /// - /// skinpicker control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.DropDownList skinpicker; - - /// - /// bt_apply control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Button bt_apply; - - /// - /// bt_rollback control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Button bt_rollback; - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/TemplateSkinning.aspx b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/TemplateSkinning.aspx deleted file mode 100644 index 829ba939ef..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/TemplateSkinning.aspx +++ /dev/null @@ -1,57 +0,0 @@ -<%@ Page Language="C#" MasterPageFile="../masterpages/umbracoDialog.Master" AutoEventWireup="true" CodeBehind="TemplateSkinning.aspx.cs" Inherits="umbraco.presentation.umbraco.dialogs.TemplateSkinning" %> -<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %> -<%@ Register TagPrefix="umb" Namespace="ClientDependency.Core.Controls" Assembly="ClientDependency.Core" %> -<%@ Import Namespace="umbraco.cms.businesslogic.packager.repositories" %> - - - - - - - Download more skins - - - - -
    - - - - - or Rollback current skin - - -
    -
    - - - -
    - - -
      - - -
    • - - <%# ((Skin)Container.DataItem).Text %> - - <%# ((Skin)Container.DataItem).Text %> - -
      - - -
    • -
      - - -
    - -
    - -
    - -
    - -
    diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/TemplateSkinning.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/TemplateSkinning.aspx.cs deleted file mode 100644 index 78c6ef69f6..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/TemplateSkinning.aspx.cs +++ /dev/null @@ -1,190 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.UI; -using System.Web.UI.WebControls; -using Umbraco.Core.Logging; -using umbraco.BusinessLogic; -using umbraco.cms.businesslogic.skinning; -using umbraco.cms.businesslogic.template; -using umbraco.cms.businesslogic; - -namespace umbraco.presentation.umbraco.dialogs -{ - public partial class TemplateSkinning : BasePages.UmbracoEnsuredPage - { - private int _templateId = 0; - - private readonly cms.businesslogic.packager.repositories.Repository _repo; - private const string RepoGuid = "65194810-1f85-11dd-bd0b-0800200c9a66"; - - public TemplateSkinning() - { - CurrentApp = DefaultApps.settings.ToString(); - _repo = cms.businesslogic.packager.repositories.Repository.getByGuid(RepoGuid); - - if (_repo == null) - { - throw new InvalidOperationException("Could not find repository with id " + RepoGuid); - } - } - - protected void Page_Load(object sender, EventArgs e) - { - _templateId = int.Parse(Request["id"]); - var t = new Template(_templateId); - - if (Skinning.StarterKitGuid(_templateId).HasValue) - { - p_apply.Visible = true; - - var currentSkin = Skinning.GetCurrentSkinAlias(_templateId); - var templateRoot = FindTemplateRoot(t); - - dd_skins.Items.Add("Choose..."); - foreach (var kvp in Skinning.AllowedSkins(templateRoot)) - { - var li = new ListItem(kvp.Value, kvp.Key); - if (kvp.Key == currentSkin) - li.Selected = true; - - dd_skins.Items.Add(li); - } - - if (!string.IsNullOrEmpty(Skinning.GetCurrentSkinAlias(_templateId))) - { - ph_rollback.Visible = true; - } - } - } - - private int FindTemplateRoot(CMSNode t) - { - if (t.ParentId < 0) - return t.Id; - return FindTemplateRoot(t.Parent); - } - - protected void openRepo(object sender, EventArgs e) { - - var g = Skinning.StarterKitGuid(_templateId); - - - if (g == null || !Skinning.HasAvailableSkins(_templateId)) - { - bt_repo.Visible = false; - } - else - { - if (_repo.HasConnection()) - { - try - { - rep_starterKitDesigns.DataSource = _repo.Webservice.Skins(g.ToString()); - rep_starterKitDesigns.DataBind(); - } - catch (Exception ex) - { - LogHelper.Error("An error occurred", ex); - - //ShowConnectionError(); - } - } - } - - p_apply.Visible = false; - p_download.Visible = true; - - } - - protected void SelectStarterKitDesign(object sender, EventArgs e) - { - if (((Button)sender).CommandName == "apply") - { - var s = Skin.CreateFromName(((Button)sender).CommandArgument); - Skinning.ActivateAsCurrentSkin(s); - - Page.Response.Redirect(library.NiceUrl(int.Parse(UmbracoContext.Current.PageId.ToString()))); - } - else if (((Button)sender).CommandName == "remove") - { - var n = NodeFactory.Node.GetCurrent(); - - var t = new Template(n.template); - Skinning.RollbackSkin(t.Id); - - Page.Response.Redirect(library.NiceUrl(int.Parse(UmbracoContext.Current.PageId.ToString()))); - } - else - { - - var kitGuid = new Guid(((Button)sender).CommandArgument); - - if (_repo.HasConnection()) - { - var p = new cms.businesslogic.packager.Installer(); - - var tempFile = p.Import(_repo.fetch(kitGuid.ToString())); - p.LoadConfig(tempFile); - var pId = p.CreateManifest(tempFile, kitGuid.ToString(), RepoGuid); - - p.InstallFiles(pId, tempFile); - p.InstallBusinessLogic(pId, tempFile); - p.InstallCleanUp(pId, tempFile); - - //NOTE: This seems excessive to have to re-load all content from the database here!? - library.RefreshContent(); - - if (Skinning.GetAllSkins().Count > 0) - { - Skinning.ActivateAsCurrentSkin(Skinning.GetAllSkins()[0]); - } - - - Page.Response.Redirect(library.NiceUrl(int.Parse(UmbracoContext.Current.PageId.ToString()))); - } - } - } - - protected void apply(object sender, EventArgs e) { - - if (dd_skins.SelectedIndex > 0) - { - var s = Skin.CreateFromAlias(dd_skins.SelectedValue); - Skinning.ActivateAsCurrentSkin(s); - } - - } - protected void rollback(object sender, EventArgs e) { - - Skinning.RollbackSkin(_templateId); - } - - protected void rep_starterKitDesigns_ItemDataBound(object sender, RepeaterItemEventArgs e) - { - if (e.Item.DataItem != null) - { - var s = (cms.businesslogic.packager.repositories.Skin)e.Item.DataItem; - - if (Skinning.IsSkinInstalled(s.RepoGuid)) - { - var inst = (Button)e.Item.FindControl("Button1"); - inst.Text = "Apply (already downloaded)"; - inst.CommandName = "apply"; - inst.CommandArgument = s.Text; - - } - - if (Skin.CreateFromAlias(Skinning.GetCurrentSkinAlias(_templateId)).Name == s.Text) - { - var inst = (Button)e.Item.FindControl("Button1"); - inst.Text = "Rollback (active skin)"; - inst.CommandName = "remove"; - inst.CommandArgument = s.Text; - } - } - - } - } -} \ No newline at end of file diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/TemplateSkinning.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/TemplateSkinning.aspx.designer.cs deleted file mode 100644 index bf1ea07579..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/TemplateSkinning.aspx.designer.cs +++ /dev/null @@ -1,105 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace umbraco.presentation.umbraco.dialogs { - - - public partial class TemplateSkinning { - - /// - /// p_apply control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::umbraco.uicontrols.Pane p_apply; - - /// - /// PropertyPanel1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::umbraco.uicontrols.PropertyPanel PropertyPanel1; - - /// - /// dd_skins control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.DropDownList dd_skins; - - /// - /// bt_repo control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.LinkButton bt_repo; - - /// - /// PropertyPanel2 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::umbraco.uicontrols.PropertyPanel PropertyPanel2; - - /// - /// Button1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Button Button1; - - /// - /// ph_rollback control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.PlaceHolder ph_rollback; - - /// - /// lb_rollback control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.LinkButton lb_rollback; - - /// - /// p_download control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::umbraco.uicontrols.Pane p_download; - - /// - /// rep_starterKitDesigns control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Repeater rep_starterKitDesigns; - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/editTemplate.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/editTemplate.aspx.cs index f3a7b650a7..0b8a8f1e7f 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/editTemplate.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/editTemplate.aspx.cs @@ -8,7 +8,7 @@ using Umbraco.Core.Configuration; using Umbraco.Core.IO; using umbraco.BasePages; using umbraco.BusinessLogic; -using umbraco.cms.businesslogic.skinning; + using umbraco.cms.businesslogic.template; using umbraco.cms.presentation.Trees; using umbraco.DataLayer; diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Item.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Item.cs index 8a30dfe1ee..6d0465f693 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Item.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Item.cs @@ -120,20 +120,6 @@ namespace umbraco.presentation.templateControls set { ViewState["DebugMode"] = value; } } - /// - /// Gets or sets a value indicating whether Live Editing is disabled for this field. - /// - /// true if you manually wish to disable Live Editing for this field; otherwise, false (default is false). - [Bindable(true)] - [Category("Umbraco")] - [DefaultValue("")] - [Localizable(true)] - public bool LiveEditingDisabled - { - get { return ((ViewState["LiveEditingDisabled"] == null) ? false : (bool)ViewState["LiveEditingDisabled"]); } - set { ViewState["LiveEditingDisabled"] = value; } - } - public ItemRenderer Renderer { get; set; } #endregion @@ -148,24 +134,7 @@ namespace umbraco.presentation.templateControls { get { return m_ItemId; } } - - /// - /// Gets a value indicating whether this control can be used in Live Editing mode. - /// Checks whether live editing has not been disabled, - /// the control is inside a form tag, - /// the field is editable - /// and the user has sufficient permissions. - /// - /// true if live editing is useLiveEditing; otherwise, false. - public bool CanUseLiveEditing - { - get - { - return !LiveEditingDisabled && IsInsideFormTag() - && FieldSupportsLiveEditing() && FieldEditableWithUserPermissions(); - } - } - + /// /// Gets the Umbraco page elements. /// @@ -186,12 +155,7 @@ namespace umbraco.presentation.templateControls /// Initializes a new instance of the class. ///
public Item() - { - // create page unique ID for this item - object lastItemId = HttpContext.Current.Items["LiveEditing_LastItemId"]; - m_ItemId = (lastItemId != null ? (int)lastItemId + 1 : 1); - HttpContext.Current.Items["LiveEditing_LastItemId"] = m_ItemId; - + { Renderer = ItemRenderer.Instance; } @@ -302,23 +266,7 @@ namespace umbraco.presentation.templateControls #endregion #region Field Information Functions - // 27/08/2008 Ruben Verborgh: This functionality should really be inside some kind of super Field class, - // which could be anything from a property to a dictionary item. - // However, I don't think we should do this in the current Umbraco generation. - /// - /// Gets a value indicating whether Live Editing is useLiveEditing on this field. - /// Certain functionalities of the item field makes it hard to - /// support Live Editing, like dictionary items and recursive values. - /// - /// - /// true if Live Editing is useLiveEditing; otherwise, false. - /// - protected virtual bool FieldSupportsLiveEditing() - { - return !(FieldIsRercursive() || FieldIsDictionaryItem()); - } - /// /// Determines whether the field is a dictionary item. /// diff --git a/src/umbraco.businesslogic/BasePages/BasePage.cs b/src/umbraco.businesslogic/BasePages/BasePage.cs index c0171d7d9a..d30d5aa506 100644 --- a/src/umbraco.businesslogic/BasePages/BasePage.cs +++ b/src/umbraco.businesslogic/BasePages/BasePage.cs @@ -146,7 +146,7 @@ namespace umbraco.BasePages _user = BusinessLogic.User.GetUser(GetUserId("")); // Check for console access - if (_user.Disabled || (_user.NoConsole && GlobalSettings.RequestIsInUmbracoApplication(Context) && GlobalSettings.RequestIsLiveEditRedirector(Context) == false)) + if (_user.Disabled || (_user.NoConsole && GlobalSettings.RequestIsInUmbracoApplication(Context))) { throw new ArgumentException("You have no priviledges to the umbraco console. Please contact your administrator"); } diff --git a/src/umbraco.businesslogic/GlobalSettings.cs b/src/umbraco.businesslogic/GlobalSettings.cs index 0c8f598ec1..2e5ec00903 100644 --- a/src/umbraco.businesslogic/GlobalSettings.cs +++ b/src/umbraco.businesslogic/GlobalSettings.cs @@ -329,12 +329,7 @@ namespace umbraco { return Umbraco.Core.Configuration.GlobalSettings.RequestIsInUmbracoApplication(context); } - - public static bool RequestIsLiveEditRedirector(HttpContext context) - { - return Umbraco.Core.Configuration.GlobalSettings.RequestIsLiveEditRedirector(context); - } - + /// /// Gets a value indicating whether umbraco should force a secure (https) connection to the backoffice. /// diff --git a/src/umbraco.businesslogic/IO/SystemFiles.cs b/src/umbraco.businesslogic/IO/SystemFiles.cs index 874f792cf4..85d2c3d766 100644 --- a/src/umbraco.businesslogic/IO/SystemFiles.cs +++ b/src/umbraco.businesslogic/IO/SystemFiles.cs @@ -38,10 +38,6 @@ namespace umbraco.IO get { return Umbraco.Core.IO.SystemFiles.DashboardConfig; } } - public static string SkinningXml - { - get { return Umbraco.Core.IO.SystemFiles.SkinningXml; } - } public static string NotFoundhandlersConfig { diff --git a/src/umbraco.cms/businesslogic/datatype/ClientDependencyAttribute.cs b/src/umbraco.cms/businesslogic/datatype/ClientDependencyAttribute.cs deleted file mode 100644 index ff0ee1d577..0000000000 --- a/src/umbraco.cms/businesslogic/datatype/ClientDependencyAttribute.cs +++ /dev/null @@ -1,102 +0,0 @@ -using System; -using ClientDependency.Core.Controls; - -namespace umbraco.cms.businesslogic.datatype -{ - /// - /// This attribute is used for data types that uses client assets like Javascript and CSS for liveediting. - /// The Live Editing feature in umbraco will look for this attribute and preload all dependencies to the page - /// to ensure that all client events and assets gets loaded - /// - [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)] - [Obsolete("Use the new ClientDependency framework. Priority and InvokeJavascriptMethodOnLoad are ignored. Documentation here: http://clientdependency.codeplex.com/documentation")] - public class ClientDependencyAttribute : Attribute - { - /// - /// Gets or sets the priority. - /// - /// The priority. - [Obsolete("This property is ignored")] - public int Priority { get; set; } - - /// - /// Gets or sets the file path. - /// - /// The file path. - public string FilePath { get; set; } - - /// - /// Gets or sets the type of the dependency. - /// - /// The type of the dependency. - public ClientDependencyType DependencyType { get; set; } - - /// - /// Gets or sets the name of an optional javascript method that should be called on load. - /// - /// The name of the method. - [Obsolete("This property is ignored")] - public string InvokeJavascriptMethodOnLoad { get; set; } - - /// - /// Initializes a new instance of the class. - /// - /// The priority. - /// Type of the dependency. - /// The file path to the dependency. - public ClientDependencyAttribute(int priority, ClientDependencyType dependencyType, string filePath) - : this(priority, dependencyType, filePath, false, string.Empty) - { } - - /// - /// Initializes a new instance of the class. - /// - /// The priority. - /// Type of the dependency. - /// The file path to the dependency. - /// The name of the Javascript method to invoke when the dependency is loaded. - public ClientDependencyAttribute(int priority, ClientDependencyType dependencyType, string filePath, string invokeJavascriptMethodOnLoad) - : this(priority, dependencyType, filePath, false, invokeJavascriptMethodOnLoad) - { } - - /// - /// Initializes a new instance of the class. - /// - /// The priority. - /// Type of the dependency. - /// The file path to the dependency. - /// if set to true the current umbraco path will be prefixed to the filePath. - public ClientDependencyAttribute(int priority, ClientDependencyType dependencyType, string filePath, bool appendUmbracoPath) - : this(priority, dependencyType, filePath, appendUmbracoPath, String.Empty) - { } - - /// - /// Initializes a new instance of the class. - /// - /// The priority. - /// Type of the dependency. - /// The file path to the dependency. - /// if set to true the current umbraco path will be prefixed to the filePath. - /// The name of the Javascript method to invoke when the dependency is loaded. - public ClientDependencyAttribute(int priority, ClientDependencyType dependencyType, string filePath, bool appendUmbracoPath, string invokeJavascriptMethodOnLoad) - { - if (String.IsNullOrEmpty(filePath)) - throw new ArgumentException("filePath"); - - Priority = priority; - FilePath = appendUmbracoPath ? GlobalSettings.Path + "/" + filePath : filePath; - DependencyType = dependencyType; - InvokeJavascriptMethodOnLoad = invokeJavascriptMethodOnLoad ?? String.Empty; - - ClientDependencyLoader.Instance.RegisterDependency(FilePath, DependencyType == ClientDependencyType.Css ? ClientDependency.Core.ClientDependencyType.Css : ClientDependency.Core.ClientDependencyType.Javascript); - } - } - - /// - /// The type of client file - /// - public enum ClientDependencyType - { - Javascript, Css - } -} \ No newline at end of file diff --git a/src/umbraco.cms/businesslogic/skinning/CssVariable.cs b/src/umbraco.cms/businesslogic/skinning/CssVariable.cs deleted file mode 100644 index 258892b4d9..0000000000 --- a/src/umbraco.cms/businesslogic/skinning/CssVariable.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Xml; - -namespace umbraco.cms.businesslogic.skinning -{ - public class CssVariable - { - public string Name { get; set; } - public string DefaultValue { get; set; } - public List Properties { get; set; } - - - - public static CssVariable CreateFromXmlNode(XmlNode node) - { - CssVariable var = new CssVariable(); - - if (node.Attributes["name"] != null) - var.Name = node.Attributes["name"].Value; - - var.DefaultValue = node.InnerText; - - return var; - } - } -} diff --git a/src/umbraco.cms/businesslogic/skinning/CssVariableProperty.cs b/src/umbraco.cms/businesslogic/skinning/CssVariableProperty.cs deleted file mode 100644 index 5730a00b85..0000000000 --- a/src/umbraco.cms/businesslogic/skinning/CssVariableProperty.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace umbraco.cms.businesslogic.skinning -{ - public class CssVariableProperty - { - public string Name { get; set; } - public List Selectors { get; set; } - - public CssVariableProperty(string name) - { - this.Name = name; - Selectors = new List(); - } - } -} diff --git a/src/umbraco.cms/businesslogic/skinning/Dependency.cs b/src/umbraco.cms/businesslogic/skinning/Dependency.cs deleted file mode 100644 index f8c0c6db23..0000000000 --- a/src/umbraco.cms/businesslogic/skinning/Dependency.cs +++ /dev/null @@ -1,136 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Xml; -using System.Web; -using System.Reflection; -using Umbraco.Core.Logging; - -namespace umbraco.cms.businesslogic.skinning -{ - public class Dependency - { - public Dependency() - { - Tasks = new List(); - Properties = new Dictionary(); - } - - public static Dependency CreateFromXmlNode(XmlNode node) - { - Dependency d = new Dependency(); - - - - if (node.SelectSingleNode("Properties") != null) - { - foreach (XmlNode prop in node.SelectSingleNode("Properties").ChildNodes) - { - if(prop.Name != "Output" && prop.Name != "#comment") - d.Properties.Add(prop.Name, prop.InnerText); - } - } - - - if(node.Attributes["label"] != null) - d.Label = node.Attributes["label"].Value; - - if (node.Attributes["type"] != null) - { - - if (node.Attributes["assembly"] != null) - { - //custom dependency type - - //string assemblyFile = - // HttpContext.Current.Server.MapPath( - // String.Format("{0}/../bin/{1}.dll", - // GlobalSettings.Path, - // node.Attributes["assembly"].Value)); - - //Assembly customAssembly = Assembly.LoadFrom(assemblyFile); - - Assembly customAssembly = Assembly.Load(node.Attributes["assembly"].Value); - - d.DependencyType = (DependencyType)Activator.CreateInstance( - customAssembly.GetType(node.Attributes["type"].Value),d); - - foreach (var prop in d.Properties) - { - d.DependencyType.GetType().InvokeMember(prop.Key, System.Reflection.BindingFlags.SetProperty, null, d.DependencyType, new object[] { prop.Value }); - } - //d.DependencyType.Properties = d.Properties; - - } - else - { - //internal dependency type - - //string assemblyFile = - // HttpContext.Current.Server.MapPath( - // String.Format("{0}/../bin/{1}.dll", - // GlobalSettings.Path, - // "cms")); - - //Assembly defaultAssembly = Assembly.LoadFrom(assemblyFile); - - Assembly defaultAssembly = Assembly.Load("cms"); - - d.DependencyType = (DependencyType)Activator.CreateInstance( - defaultAssembly.GetType( - string.Format( - "umbraco.cms.businesslogic.skinning.dependencies.{0}", - node.Attributes["type"].Value))); - - - foreach (var prop in d.Properties) - { - d.DependencyType.GetType().InvokeMember(prop.Key, System.Reflection.BindingFlags.SetProperty, null, d.DependencyType, new object[] { prop.Value }); - } - - //d.DependencyType.Properties = d.Properties; - } - - XmlNode outputNode = node.SelectSingleNode("Properties/Output"); - - if (outputNode != null) - { - d.DependencyType.Values.Add(outputNode.InnerText); - } - - if (node.Attributes["variable"] != null) - d.Variable = node.Attributes["variable"].Value; - } - - - - - foreach (XmlNode taskNode in node.SelectNodes("Tasks/Task")) - { - try - { - d.Tasks.Add(Task.CreateFromXmlNode(taskNode)); - } - catch (Exception ex) - { - LogHelper.Error("Failed to load task type " + (taskNode.Attributes["type"] != null ? taskNode.Attributes["type"].Value : string.Empty), ex); - } - } - - - return d; - } - - - public DependencyType DependencyType { get; set; } - - public string Label { get; set; } - - public Dictionary Properties {get; set;} - - public List Tasks { get; set; } - - public string Variable { get; set; } - } -} diff --git a/src/umbraco.cms/businesslogic/skinning/DependencyType.cs b/src/umbraco.cms/businesslogic/skinning/DependencyType.cs deleted file mode 100644 index 3f854d4fda..0000000000 --- a/src/umbraco.cms/businesslogic/skinning/DependencyType.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Web.UI.WebControls; -using umbraco.interfaces.skinning; - -namespace umbraco.cms.businesslogic.skinning -{ - public abstract class DependencyType : ProviderBase, IDependencyType - { - public virtual WebControl Editor { get; set; } - public virtual List Values { get; set; } - - public virtual string CssVariablePreviewClientScript(string ControlClientId, string VariableClientId) - { - return string.Format( - @"jQuery('#{0}').bind('{2}', function() {{ - {3} = {1}; - PreviewCssVariables(); - }}); - - - //cancel support (not implemented yet) - jQuery('#cancelSkinCustomization').click(function () {{ - - }}); - - ", - ControlClientId, - this.ClientSideGetValueScript(), - this.ClientSideCssVariablePreviewEventType(), - VariableClientId); - } - - public virtual string ClientSideGetValueScript() - { - return string.Format( - "jQuery('#{0}').val()" - ,Editor.ClientID); - } - public virtual string ClientSidePreviewEventType() - { - return "change"; - } - - public virtual string ClientSideCssVariablePreviewEventType() - { - //should be something that doesn't execute at every change - return "change"; - } - } -} diff --git a/src/umbraco.cms/businesslogic/skinning/EmbeddedCss.cs b/src/umbraco.cms/businesslogic/skinning/EmbeddedCss.cs deleted file mode 100644 index 7ccebf0caf..0000000000 --- a/src/umbraco.cms/businesslogic/skinning/EmbeddedCss.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Xml; - -namespace umbraco.cms.businesslogic.skinning -{ - public class EmbeddedCss - { - public string TargetFile { get; set; } - public List Variables { get; set; } - public string Content { get; set; } - - - public EmbeddedCss() - { - Variables = new List(); - } - - - public static EmbeddedCss CreateFromXmlNode(XmlNode node) - { - EmbeddedCss css = new EmbeddedCss(); - - if (node.Attributes["targetfile"] != null) - css.TargetFile = node.Attributes["targetfile"].Value; - - if (node.SelectSingleNode("Content") != null) - css.Content = node.SelectSingleNode("Content").InnerText; - - - foreach (XmlNode variableNode in node.SelectNodes("Variables/Variable")) - { - - css.Variables.Add(CssVariable.CreateFromXmlNode(variableNode)); - - } - - return css; - - } - } -} diff --git a/src/umbraco.cms/businesslogic/skinning/Skin.cs b/src/umbraco.cms/businesslogic/skinning/Skin.cs deleted file mode 100644 index 82f493798f..0000000000 --- a/src/umbraco.cms/businesslogic/skinning/Skin.cs +++ /dev/null @@ -1,344 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Xml; -using System.IO; -using System.Xml.XPath; -using Umbraco.Core.Logging; -using umbraco.interfaces.skinning; - -namespace umbraco.cms.businesslogic.skinning -{ - public class Skin - { - public Skin() - { - - Dependencies = new List(); - - } - - public static Skin CreateFromFile(string filename) - { - XmlDocument manifest = new XmlDocument(); - - FileInfo f = new FileInfo(filename); - - if (f.Exists) - { - manifest.Load(filename); - - Skin s = Skin.CreateFromXmlNode(manifest.SelectSingleNode("//Skin")); - s.FullFileName = filename; - s.Alias = f.Directory.Name; - - return s; - } - else - return null; - - - } - - public static string GetSkinNameFromFile(string filename) - { - XmlDocument manifest = new XmlDocument(); - - FileInfo f = new FileInfo(filename); - - if (f.Exists) - { - manifest.Load(filename); - return manifest.SelectSingleNode("//Skin/Name").InnerText; - } - else - return null; - } - - public static Skin CreateFromXmlNode(XmlNode node) - { - Skin s = new Skin(); - - - if(node.SelectSingleNode("/Skin/Name") != null) - s.Name = node.SelectSingleNode("/Skin/Name").InnerText; - - if(node.SelectSingleNode("/Skin/Author") != null) - s.Author = node.SelectSingleNode("/Skin/Author").InnerText; - - if(node.SelectSingleNode("/Skin/Version") != null) - s.Version = node.SelectSingleNode("/Skin/Version").InnerText; - - if(node.SelectSingleNode("/Skin/Description") != null) - s.Description = node.SelectSingleNode("/Skin/Description").InnerText; - - - - if (node.SelectSingleNode("/Skin/AllowedRootTemplate") != null) - s.AllowedRootTemplate = node.SelectSingleNode("/Skin/AllowedRootTemplate").InnerText; - - - foreach (XmlNode depNode in node.SelectNodes("/Skin//Dependency")) - { - try - { - s.Dependencies.Add(Dependency.CreateFromXmlNode(depNode)); - } - catch (Exception ex) - { - LogHelper.Error("Failed to load dependency type " + (depNode.Attributes["type"] != null ? depNode.Attributes["type"].Value : string.Empty), ex); - } - } - - if (node.SelectSingleNode("/Skin/CSS") != null) - s.Css = EmbeddedCss.CreateFromXmlNode(node.SelectSingleNode("/Skin/CSS")); - - return s; - } - - public static Skin CreateFromAlias(string alias) - { - string manifest = Path.Combine(IO.IOHelper.MapPath( IO.SystemDirectories.Masterpages + "/" + alias), "skin.xml"); - return CreateFromFile(manifest); - } - - public static Skin CreateFromName(string name) - { - foreach (Skin s in Skinning.GetAllSkins()) - { - if (s.Name == name) - return s; - } - - return null; - } - public bool OverridesTemplates() - { - return (System.IO.Directory.GetFiles(IO.IOHelper.MapPath(SkinFolder), "*.master").Count() > 0); - } - - public bool HasBackupFiles() - { - return System.IO.Directory.Exists( IO.IOHelper.MapPath(SkinBackupFolder) ); - } - - - public void SaveOutput() - { - - XmlDocument manifest = new XmlDocument(); - manifest.Load(FullFileName); - - int i = 1; - foreach (Dependency d in Dependencies) - { - if (d.DependencyType.Values.Count > 0) - { - XmlNode pNode = manifest.SelectSingleNode( - string.Format("/Skin/Dependencies/Dependency[{0}]/Properties", i.ToString())); - - - XmlNode outputNode = pNode.SelectSingleNode("./Output"); - - if (outputNode == null) - { - outputNode = manifest.CreateElement("Output"); - outputNode.InnerText = d.DependencyType.Values[0].ToString(); - pNode.AppendChild(outputNode); - } - else - { - outputNode.InnerText = d.DependencyType.Values[0].ToString(); - } - - - } - - i++; - } - - manifest.Save(FullFileName); - } - - public string FullFileName { get; set; } - - public string Name { get; set; } - - public string Author { get; set; } - public string Version { get; set; } - public string Description { get; set; } - - public string Alias { get; set; } - - - public string AllowedRootTemplate { get; set; } - - - public List Dependencies { get; set; } - - - - public EmbeddedCss Css { get; set; } - - public void RollbackDependencies() - { - - XmlDocument manifest = new XmlDocument(); - manifest.Load(FullFileName); - - //emtpy output tags - - foreach(XmlNode oNode in manifest.SelectNodes("/Skin/Dependencies/Dependency/Properties/Output")) - { - oNode.RemoveAll(); - } - - //execute rollback tasks - XmlNode hNode = manifest.SelectSingleNode("/Skin/History"); - - if (!(hNode == null || hNode.SelectNodes("Task").Count == 0)) - { - XPathNavigator navigator = manifest.CreateNavigator(); - XPathExpression expression = navigator.Compile("/Skin/History/Task"); - - expression.AddSort("@executed", XmlSortOrder.Descending, XmlCaseOrder.UpperFirst, - string.Empty, XmlDataType.Text); - - XPathNodeIterator iterator = navigator.Select(expression); - - foreach (XPathNavigator item in iterator) - { - Task t = Task.CreateFromXmlNode(((System.Xml.IHasXmlNode)item).GetNode()); - t.TaskType.RollBack(((System.Xml.IHasXmlNode)item).GetNode().SelectSingleNode("OriginalValue").InnerText); - } - - hNode.RemoveAll(); - - } - - manifest.Save(FullFileName); - } - - public void DeployTemplateFiles() - { - DeployTemplateFiles(IO.SystemDirectories.Masterpages); - } - - - public void DeployTemplateFiles(string folder) - { - string[] masterFiles = System.IO.Directory.GetFiles(IO.IOHelper.MapPath(SkinFolder), "*.master"); - - if (masterFiles.Count() > 0) - { - if (!System.IO.Directory.Exists(IO.IOHelper.MapPath(SkinBackupFolder))) - System.IO.Directory.CreateDirectory(IO.IOHelper.MapPath(SkinBackupFolder)); - - foreach (string master in masterFiles) - { - FileInfo fi = new FileInfo(master); - string original = Path.Combine(IO.IOHelper.MapPath(IO.SystemDirectories.Masterpages), fi.Name); - string backup = Path.Combine(IO.IOHelper.MapPath(SkinBackupFolder), fi.Name); - - if (System.IO.File.Exists(original)) - System.IO.File.Copy(original, backup, true); - - System.IO.File.Copy(master, original, true); - } - } - } - - - public void RollbackTemplateFiles(){ - RollbackTemplateFiles(IO.SystemDirectories.Masterpages); - } - - public void RollbackTemplateFiles(string folder) - { - string[] masterFiles = System.IO.Directory.GetFiles(IO.IOHelper.MapPath(SkinFolder), "*.master"); - - //1. take the skin files back into skin folder to store the changes made - if (masterFiles.Count() > 0) - { - foreach (string master in masterFiles) - { - FileInfo fi = new FileInfo(master); - string inUse = Path.Combine(IO.IOHelper.MapPath(IO.SystemDirectories.Masterpages), fi.Name); - - - if (System.IO.File.Exists(inUse)) - System.IO.File.Copy(inUse, master, true); - } - } - - - //2. copy the /backup files back to the masterpages to restore the templates to the way they were before the skin was applied - string[] backedUpmasterFiles = System.IO.Directory.GetFiles(IO.IOHelper.MapPath(SkinBackupFolder), "*.master"); - foreach (string backup in backedUpmasterFiles) - { - FileInfo fi = new FileInfo(backup); - string inUse = Path.Combine(IO.IOHelper.MapPath(IO.SystemDirectories.Masterpages), fi.Name); - - System.IO.File.Copy(backup, inUse, true); - System.IO.File.Delete(backup); - } - - //3. put on some clothes - } - - public void ExecuteInstallTasks() - { - XmlDocument manifest = new XmlDocument(); - manifest.Load(FullFileName); - - foreach (XmlNode tNode in manifest.SelectNodes("/Skin/Install/Task")) - { - Task t = Task.CreateFromXmlNode(tNode); - TaskExecutionDetails details = t.TaskType.Execute(t.Value); - - if (details.TaskExecutionStatus == TaskExecutionStatus.Completed) - { - AddTaskHistoryNode( - t.TaskType.ToXml(details.OriginalValue, details.NewValue)); - } - - } - } - - public void AddTaskHistoryNode(XmlNode taskNode) - { - XmlDocument manifest = new XmlDocument(); - manifest.Load(FullFileName); - - XmlNode hNode = manifest.SelectSingleNode("/Skin/History"); - - if (hNode == null) - { - hNode = manifest.CreateElement("History"); - manifest.SelectSingleNode("/Skin").AppendChild(hNode); - } - - hNode.AppendChild(manifest.ImportNode(taskNode, true)); - - manifest.Save(FullFileName); - } - - public string SkinFolder - { - get - { - return IO.SystemDirectories.Masterpages + "/" + Alias; - } - } - - public string SkinBackupFolder - { - get - { - return SkinFolder + "/backup"; - } - } - - } -} diff --git a/src/umbraco.cms/businesslogic/skinning/Skinning.cs b/src/umbraco.cms/businesslogic/skinning/Skinning.cs deleted file mode 100644 index 5d4cfd9f31..0000000000 --- a/src/umbraco.cms/businesslogic/skinning/Skinning.cs +++ /dev/null @@ -1,374 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Xml; -using System.IO; -using System.Collections; -using System.Web; -using System.Web.Caching; -using Umbraco.Core; -using Umbraco.Core.IO; -using umbraco.cms.businesslogic.web; -using umbraco.BusinessLogic; -using umbraco.cms.businesslogic.template; - -namespace umbraco.cms.businesslogic.skinning -{ - - //TODO: Convert the caching to use ApplicationContext.Current.ApplicationCache - - public class Skinning - { - static private readonly Hashtable CheckedPages = new Hashtable(); - static private XmlDocument _skinningXmlContent; - static private string _skinningXmlSource = IOHelper.MapPath(SystemFiles.SkinningXml, false); - - private const string Cachekey = "SkinnableTemplates"; - - private static void ClearCheckPages() - { - CheckedPages.Clear(); - } - - public static void RollbackSkin(int template) - { - string currentSkin = GetCurrentSkinAlias(template); - Skin skin = Skin.CreateFromAlias(currentSkin); - - if (skin != null) - { - skin.RollbackDependencies(); - - if (skin.OverridesTemplates()) - skin.RollbackTemplateFiles(); - - //else - // skin.RollbackDependencies(); - } - - RemoveSkin(template); - Save(); - } - - public static void ActivateAsCurrentSkin(Skin skin) - { - Template t = Template.GetByAlias(skin.AllowedRootTemplate); - ActivateAsCurrentSkin(t.Id, skin.Alias); - } - - public static void ActivateAsCurrentSkin(int template, string skinAlias) - { - //lookup template in skinning.config - string currentSkin = GetCurrentSkinAlias(template); - - //if different from current, and the template is skinned - if (currentSkin != skinAlias) - { - - //this will restore the files to the standard runway, as they looked before the skin was applied - if (currentSkin != string.Empty) - { - RollbackSkin(template); - } - - Skin newSkin = Skin.CreateFromAlias(skinAlias); - - if (newSkin.OverridesTemplates()) - newSkin.DeployTemplateFiles(); - - SetSkin(template, skinAlias); - - newSkin.ExecuteInstallTasks(); - - Save(); - } - } - - private static void Save() - { - var f = File.Open(_skinningXmlSource, FileMode.Create); - SkinXml.Save(f); - f.Close(); - } - - public static string GetCurrentSkinAlias(int templateID) - { - var x = (XmlElement)GetTemplate(templateID); - if (x != null && x.HasAttribute("alias") && !string.IsNullOrEmpty(x.Attributes["alias"].Value)) - return x.Attributes["alias"].Value; - - return string.Empty; - } - - private static void SetSkin(int templateId, string skinAlias) - { - var x = (XmlElement)GetTemplate(templateId); - if (x == null) - { - x = (XmlElement)_skinningXmlContent.CreateNode(XmlNodeType.Element, "skin", ""); - SkinXml.DocumentElement.AppendChild(x); - } - - x.SetAttribute("template", templateId.ToString()); - x.SetAttribute("alias", skinAlias); - Save(); - - ClearCheckPages(); - } - - private static void RemoveSkin(int templateId) - { - var x = (XmlElement)GetTemplate(templateId); - if (x != null) - { - x.ParentNode.RemoveChild(x); - Save(); - ClearCheckPages(); - } - } - - private static XmlNode GetTemplate(int templateId) - { - var x = SkinXml.SelectSingleNode("/skinning/skin [@template=" + templateId.ToString() + "]"); - return x; - } - - public static List GetAllSkins() - { - var skins = new List(); - - foreach (var dir in Directory.GetDirectories(IOHelper.MapPath(SystemDirectories.Masterpages))) - { - if (File.Exists(Path.Combine(dir, "skin.xml"))) - { - var s = Skin.CreateFromFile((Path.Combine(dir, "skin.xml"))); - s.Alias = new DirectoryInfo(dir).Name; - skins.Add(s); - } - } - return skins; - } - - - private static XmlDocument SkinXml - { - get - { - if (_skinningXmlContent == null) - { - if (_skinningXmlSource == null) - { - //if we pop it here it'll make for better stack traces ;) - _skinningXmlSource = IOHelper.MapPath(SystemFiles.SkinningXml, false); - } - - _skinningXmlContent = new XmlDocument(); - - if (!File.Exists(_skinningXmlSource)) - { - var f = File.Open(_skinningXmlSource, FileMode.Create); - var sw = new StreamWriter(f); - sw.WriteLine(""); - sw.Close(); - f.Close(); - } - _skinningXmlContent.Load(_skinningXmlSource); - } - return _skinningXmlContent; - } - } - - public static Dictionary> SkinnableTemplates() - { - var dts = (Dictionary>)HttpRuntime.Cache[Cachekey]; - if (dts == null) - dts = RegisterSkinnableTemplates(); - - return dts; - } - - //this is an pretty expensive operation, so we will cache the result... - private static Dictionary> RegisterSkinnableTemplates() - { - HttpRuntime.Cache.Remove(Cachekey); - - var allowedTemplates = new Dictionary>(); - - foreach (string dir in Directory.GetDirectories(IOHelper.MapPath(SystemDirectories.Masterpages))) - { - if (File.Exists(Path.Combine(dir, "skin.xml"))) - { - var manifest = new XmlDocument(); - manifest.Load(Path.Combine(dir, "skin.xml")); - - var name = XmlHelper.GetNodeValue(manifest.SelectSingleNode("/Skin/Name")); - var types = XmlHelper.GetNodeValue(manifest.SelectSingleNode("/Skin/AllowedRootTemplate")).Split(','); - var alias = new DirectoryInfo(dir).Name; - - //foreach allowed type, test if it is already there... - foreach (var t in types) - { - if (!allowedTemplates.ContainsKey(t)) - allowedTemplates.Add(t, new Dictionary()); - - if (!allowedTemplates[t].ContainsKey(alias)) - allowedTemplates[t].Add(alias, name); - } - } - } - HttpRuntime.Cache.Insert(Cachekey, allowedTemplates, new CacheDependency(IOHelper.MapPath(SystemDirectories.Masterpages))); - - return allowedTemplates; - } - - //Helpers for detecting what skins work with what document types - public static bool IsSkinnable(string templateAlias) - { - return SkinnableTemplates().ContainsKey(templateAlias); - } - - public static bool IsSkinnable(Template template) - { - return IsSkinnable(template.Alias); - } - - - public static Dictionary AllowedSkins(int templateID) - { - var template = new Template(templateID); - return AllowedSkins(template.Alias); - } - - public static Dictionary AllowedSkins(Template template) - { - return AllowedSkins(template.Alias); - } - - public static Dictionary AllowedSkins(string templateAlias) - { - if (IsSkinnable(templateAlias)) - { - return SkinnableTemplates()[templateAlias]; - } - else - return new Dictionary(); - } - - public static bool IsStarterKitInstalled() - { - foreach (var p in packager.InstalledPackage.GetAllInstalledPackages()) - { - if (p.Data.EnableSkins) - return true; - - } - return false; - } - - public static Guid? StarterKitGuid() - { - foreach (var p in packager.InstalledPackage.GetAllInstalledPackages()) - { - if (p.Data.EnableSkins) - return new Guid(p.Data.PackageGuid); - - } - return null; - } - - public static Guid? StarterKitGuid(int template) - { - string packageFile = IOHelper.MapPath(SystemDirectories.Packages) + "/installed/installedPackages.config"; - var installed = new XmlDocument(); - if (File.Exists(packageFile)) - { - installed.Load(packageFile); - - var starterKit = installed.SelectSingleNode( - string.Format("//package [@enableSkins = 'True' and @packageGuid != '' and contains(./templates, '{0}')]", template)); - - if (starterKit != null) - return new Guid(starterKit.Attributes["packageGuid"].Value); - } - - return null; - } - - public static bool HasAvailableSkins(int template) - { - var r = false; - - var g = StarterKitGuid(template); - - if (g != null) - { - try - { - var skinRepoGuid = "65194810-1f85-11dd-bd0b-0800200c9a66"; - - if (packager.InstalledPackage.GetByGuid(g.ToString()).Data.SkinRepoGuid != null && - packager.InstalledPackage.GetByGuid(g.ToString()).Data.SkinRepoGuid != Guid.Empty) - { - skinRepoGuid = packager.InstalledPackage.GetByGuid(g.ToString()).Data.SkinRepoGuid.ToString(); - } - - - var repo = packager.repositories.Repository.getByGuid(skinRepoGuid); - if (repo == null) - { - return false; - } - - r = repo.Webservice.Skins(g.ToString()).Length > 0; - } - catch { } - } - return r; - } - - public static bool IsSkinInstalled(Guid SkinGuid) - { - - return IsPackageInstalled(SkinGuid); - } - - public static bool IsPackageInstalled(Guid PackageGuid) - { - var installed = new XmlDocument(); - installed.Load(IOHelper.MapPath(SystemDirectories.Packages) + "/installed/installedPackages.config"); - - var packageNode = installed.SelectSingleNode( - string.Format("//package [@packageGuid = '{0}']", PackageGuid.ToString())); - - return packageNode != null; - } - - public static bool IsPackageInstalled(string Name) - { - var installed = new XmlDocument(); - installed.Load(IOHelper.MapPath(SystemDirectories.Packages) + "/installed/installedPackages.config"); - - var packageNode = installed.SelectSingleNode( - string.Format("//package [@name = '{0}']", Name)); - - return packageNode != null; - } - - public static string GetModuleAlias(string Name) - { - var installed = new XmlDocument(); - installed.Load(IOHelper.MapPath(SystemDirectories.Packages) + "/installed/installedPackages.config"); - - var packageNode = installed.SelectSingleNode( - string.Format("//package [@name = '{0}']", Name)); - - var macroNode = packageNode.SelectSingleNode(".//macros"); - - var m = new macro.Macro(Convert.ToInt32(macroNode.InnerText.Split(',')[0])); - - return m.Alias; - } - - } -} diff --git a/src/umbraco.cms/businesslogic/skinning/Task.cs b/src/umbraco.cms/businesslogic/skinning/Task.cs deleted file mode 100644 index 653b6d6d2c..0000000000 --- a/src/umbraco.cms/businesslogic/skinning/Task.cs +++ /dev/null @@ -1,92 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Xml; -using System.Web; -using System.Reflection; - -namespace umbraco.cms.businesslogic.skinning -{ - public class Task - { - public Task() - { - Properties = new Dictionary(); - } - - public static Task CreateFromXmlNode(XmlNode node) - { - Task t = new Task(); - - if (node.Attributes["type"] != null) - { - - if (node.Attributes["assembly"] != null) - { - //custom task type - - //string assemblyFile = - // HttpContext.Current.Server.MapPath( - // String.Format("{0}/../bin/{1}.dll", - // GlobalSettings.Path, - // node.Attributes["assembly"].Value)); - - //Assembly customAssembly = Assembly.LoadFrom(assemblyFile); - Assembly customAssembly = Assembly.Load(node.Attributes["assembly"].Value); - - t.TaskType = (TaskType)Activator.CreateInstance( - customAssembly.GetType(node.Attributes["type"].Value)); - - - - } - else - { - //internal dependency type - - //string assemblyFile = - // HttpContext.Current.Server.MapPath( - // String.Format("{0}/../bin/{1}.dll", - // GlobalSettings.Path, - // "cms")); - - //Assembly defaultAssembly = Assembly.LoadFrom(assemblyFile); - - Assembly defaultAssembly = Assembly.Load("cms"); - - t.TaskType = (TaskType)Activator.CreateInstance( - defaultAssembly.GetType( - string.Format( - "umbraco.cms.businesslogic.skinning.tasks.{0}", - node.Attributes["type"].Value))); - } - } - - foreach (XmlNode prop in node.ChildNodes) - { - if (prop.Name != "OriginalValue" && prop.Name != "NewValue") - { - if (prop.Name == "Value") - t.Value = prop.InnerText; - else - t.Properties.Add(prop.Name, prop.InnerText); - - t.TaskType.GetType().InvokeMember( - prop.Name, - System.Reflection.BindingFlags.SetProperty, - null, - t.TaskType, - new object[] { prop.InnerText }); - } - } - return t; - } - - public TaskType TaskType { get; set; } - - public Dictionary Properties { get; set; } - - public string Value { get; set; } - } -} diff --git a/src/umbraco.cms/businesslogic/skinning/TaskType.cs b/src/umbraco.cms/businesslogic/skinning/TaskType.cs deleted file mode 100644 index 4c0092667e..0000000000 --- a/src/umbraco.cms/businesslogic/skinning/TaskType.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using umbraco.interfaces.skinning; -using System.Xml; -using System.Reflection; - -namespace umbraco.cms.businesslogic.skinning -{ - public abstract class TaskType : ProviderBase, ITaskType - { - public abstract TaskExecutionDetails Execute(string Value); - - public virtual TaskExecutionStatus RollBack(string OriginalValue) - { - return Execute(OriginalValue).TaskExecutionStatus; - } - - public abstract string PreviewClientScript(string ControlClientId, string ClientSidePreviewEventType, string ClientSideGetValueScript); - - public String Value { get; set; } - - public virtual XmlNode ToXml(string OriginalValue, string NewValue) - { - XmlDocument d = new XmlDocument(); - - XmlNode n = d.CreateElement("Task"); - - XmlAttribute type = d.CreateAttribute("type"); - type.Value = this.GetType().Name; - n.Attributes.Append(type); - - if (!this.GetType().FullName.Contains("umbraco.cms.businesslogic.skinning")) - { - XmlAttribute assembly = d.CreateAttribute("assembly"); - assembly.Value = this.GetType().Assembly.FullName; - n.Attributes.Append(assembly); - } - - XmlAttribute executed = d.CreateAttribute("executed"); - executed.Value = DateTime.Now.ToString("s"); - n.Attributes.Append(executed); - - foreach(PropertyInfo p in this.GetType().GetProperties()) - { - if(p.Name != "Name" && p.Name != "Description") - { - XmlNode pNode = d.CreateElement(p.Name); - pNode.InnerText = p.GetValue(this,null) != null ? p.GetValue(this,null).ToString() : string.Empty; - - n.AppendChild(pNode); - } - } - - - XmlNode origValNode = d.CreateElement("OriginalValue"); - origValNode.InnerText = OriginalValue; - n.AppendChild(origValNode); - - XmlNode newValNode = d.CreateElement("NewValue"); - newValNode.InnerText = NewValue; - n.AppendChild(newValNode); - - return n; - } - } -} diff --git a/src/umbraco.cms/businesslogic/skinning/controls/ColorPicker.cs b/src/umbraco.cms/businesslogic/skinning/controls/ColorPicker.cs deleted file mode 100644 index ddefa66efb..0000000000 --- a/src/umbraco.cms/businesslogic/skinning/controls/ColorPicker.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Web.UI.WebControls; -using ClientDependency.Core; -using System.Web.UI; -using ClientDependency.Core.Controls; - -namespace umbraco.cms.businesslogic.skinning.controls -{ - [ClientDependency(450,ClientDependencyType.Javascript, "colorpicker/js/colorpicker.js", "UmbracoClient")] - [ClientDependency(460, ClientDependencyType.Javascript, "LiveEditing/Modules/SkinModule/js/initcolorpicker.js", "UmbracoRoot")] - [ClientDependency(200,ClientDependencyType.Css, "colorpicker/css/colorpicker.css", "UmbracoClient")] - public class ColorPicker: TextBox - { - - protected override void Render(HtmlTextWriter writer) - { - this.TextMode = System.Web.UI.WebControls.TextBoxMode.SingleLine; - this.CssClass = "skinningcolorpicker"; - - base.Render(writer); - } - } -} diff --git a/src/umbraco.cms/businesslogic/skinning/controls/ImageUploader.cs b/src/umbraco.cms/businesslogic/skinning/controls/ImageUploader.cs deleted file mode 100644 index 20d340e01e..0000000000 --- a/src/umbraco.cms/businesslogic/skinning/controls/ImageUploader.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Web.UI.WebControls; -using ClientDependency.Core; - - -namespace umbraco.cms.businesslogic.skinning.controls -{ - [ClientDependency(ClientDependencyType.Css, "modal/style.css", "UmbracoClient")] - [ClientDependency(500,ClientDependencyType.Javascript, "modal/modal.js", "UmbracoClient")] - public class ImageUploader : TextBox - { - public int ImageHeight { get; set; } - public int ImageWidth { get; set; } - - protected override void Render(System.Web.UI.HtmlTextWriter writer) - { - base.Render(writer); - - writer.WriteLine( - string.Format( - " Upload image", - "Umbraco.Controls.ModalWindow().open('" + this.ResolveUrl(GlobalSettings.Path) + "/LiveEditing/Modules/SkinModule/ImageUploader.aspx?ctrl=" + this.ClientID + "&w="+this.ImageWidth+"&h="+this.ImageHeight +"','Upload image',true,750,550,50,0, ['.modalbuton'], null);return false;")); - } - } -} diff --git a/src/umbraco.cms/businesslogic/skinning/controls/SliderControl.cs b/src/umbraco.cms/businesslogic/skinning/controls/SliderControl.cs deleted file mode 100644 index 8bc1aa29c3..0000000000 --- a/src/umbraco.cms/businesslogic/skinning/controls/SliderControl.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Web.UI.WebControls; -using ClientDependency.Core.Controls; -using ClientDependency.Core; - -namespace umbraco.cms.businesslogic.skinning.controls -{ - [ClientDependency(430, ClientDependencyType.Javascript, "ui/jqueryui.js", "UmbracoClient")] - [ClientDependency(440, ClientDependencyType.Javascript, "LiveEditing/Modules/SkinModule/js/initslider.js", "UmbracoRoot")] - [ClientDependency(ClientDependencyType.Css, "ui/ui-lightness/jquery-ui.custom.css", "UmbracoClient")] - public class SliderControl: TextBox - { - public int MinimumValue { get; set; } - public int MaximumValue { get; set; } - public int InitialValue { get; set; } - public int Ratio { get; set; } - - protected override void Render(System.Web.UI.HtmlTextWriter writer) - { - this.Attributes.Add("style", "display:none;"); - - base.Render(writer); - - writer.WriteLine( - string.Format( - "
", - MinimumValue + "," + MaximumValue + "," + InitialValue + "," + Ratio +","+this.ClientID)); - - - } - } -} diff --git a/src/umbraco.cms/businesslogic/skinning/dependencies/Color.cs b/src/umbraco.cms/businesslogic/skinning/dependencies/Color.cs deleted file mode 100644 index adb80c7439..0000000000 --- a/src/umbraco.cms/businesslogic/skinning/dependencies/Color.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using umbraco.cms.businesslogic.skinning; -using umbraco.cms.businesslogic.skinning.controls; -using System.Web.UI.WebControls; - -namespace umbraco.cms.businesslogic.skinning.dependencies -{ - public class Color : DependencyType - { - public ColorPicker cp; - public List _value; - - public Color() - { - this.Name = "Color"; - this.Description = "Will render a color picker"; - - - cp = new ColorPicker(); - _value = new List(); - } - - public override WebControl Editor - { - get - { - - if (_value.Count > 0 && !string.IsNullOrEmpty(_value[0].ToString())) - cp.Text = _value[0].ToString(); - - return cp; - } - set - { - base.Editor = value; - } - } - - public override List Values - { - get - { - if (cp.Text != "") - { - _value.Clear(); - _value.Add(cp.Text); - } - return _value; - } - set - { - _value = value; - } - } - - } -} diff --git a/src/umbraco.cms/businesslogic/skinning/dependencies/Image.cs b/src/umbraco.cms/businesslogic/skinning/dependencies/Image.cs deleted file mode 100644 index 3840164d7b..0000000000 --- a/src/umbraco.cms/businesslogic/skinning/dependencies/Image.cs +++ /dev/null @@ -1,80 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Web.UI.WebControls; -using umbraco.cms.businesslogic.skinning.controls; - -namespace umbraco.cms.businesslogic.skinning.dependencies -{ - public class Image: DependencyType - { - - public string Height { get; set; } - public string Width { get; set; } - //currently just returning a textbox, need to replace this with a custom image control - - public ImageUploader iu; - public List _value; - - public Image() - { - this.Name = "Text"; - this.Description = "Will render a text input"; - - - iu = new ImageUploader(); - - _value = new List(); - } - - public override WebControl Editor - { - get - { - iu.TextMode = System.Web.UI.WebControls.TextBoxMode.SingleLine; - iu.CssClass = "image"; - - - int w; - - if(int.TryParse(Width, out w)) - iu.ImageWidth = w; - - int h; - - if(int.TryParse(Height, out h)) - iu.ImageHeight = h; - - - if (_value.Count > 0 && !string.IsNullOrEmpty(_value[0].ToString())) - iu.Text = _value[0].ToString(); - - return iu; - } - set - { - base.Editor = value; - } - } - - - - public override List Values - { - get - { - if (iu.Text != "") - { - _value.Clear(); - _value.Add(iu.Text); - } - return _value; - } - set - { - _value = value; - } - } - } -} diff --git a/src/umbraco.cms/businesslogic/skinning/dependencies/Option.cs b/src/umbraco.cms/businesslogic/skinning/dependencies/Option.cs deleted file mode 100644 index ffa7b8083f..0000000000 --- a/src/umbraco.cms/businesslogic/skinning/dependencies/Option.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Web.UI.WebControls; - -namespace umbraco.cms.businesslogic.skinning.dependencies -{ - public class Option : DependencyType - { - public DropDownList ddl; - public List _value; - - public string Options { get; set; } - - public Option() - { - this.Name = "Option"; - this.Description = "Will render a dropdown"; - - - ddl = new DropDownList(); - _value = new List(); - } - - public override WebControl Editor - { - get - { - ddl.Items.Clear(); - - - ddl.Items.Add(""); - - foreach (string option in Options.Split('|')) - { - string text = option.Split(';')[0]; - string value = option.Split(';').Length == 2 ? option.Split(';')[1] : text; - - ddl.Items.Add(new ListItem(text,value)); - } - - if (_value.Count > 0) - ddl.SelectedValue = _value[0].ToString(); - - return ddl; - } - set - { - base.Editor = value; - } - } - - public override List Values - { - get - { - if (ddl.SelectedValue != "") - { - _value.Clear(); - _value.Add(ddl.SelectedValue); - } - return _value; - } - set - { - _value = value; - } - } - } -} diff --git a/src/umbraco.cms/businesslogic/skinning/dependencies/Slider.cs b/src/umbraco.cms/businesslogic/skinning/dependencies/Slider.cs deleted file mode 100644 index 4e6f450271..0000000000 --- a/src/umbraco.cms/businesslogic/skinning/dependencies/Slider.cs +++ /dev/null @@ -1,88 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using umbraco.cms.businesslogic.skinning.controls; -using System.Web.UI.WebControls; - -namespace umbraco.cms.businesslogic.skinning.dependencies -{ - public class Slider : DependencyType - { - public SliderControl sc; - public List _value; - - public string Minimum { get; set; } - public string Maximum { get; set; } - public string Initial { get; set; } - - public string Ratio { get; set; } - - public Slider() - { - this.Name = "Slider"; - this.Description = "Will render a slider"; - - - sc = new SliderControl(); - _value = new List(); - } - - public override WebControl Editor - { - get - { - - int min; - - if (int.TryParse(Minimum, out min)) - sc.MinimumValue = min; - - int max; - - if (int.TryParse(Maximum, out max)) - sc.MaximumValue = max; - - int ratio; - - if (int.TryParse(Ratio, out ratio)) - sc.Ratio = max; - - int init; - - if (int.TryParse(Initial, out init)) - { - sc.InitialValue = init; - sc.Text = init.ToString(); - } - - - if (_value.Count > 0 && !string.IsNullOrEmpty(_value[0].ToString())) - sc.Text = _value[0].ToString(); - - return sc; - } - set - { - base.Editor = value; - } - } - - public override List Values - { - get - { - if (sc.Text != "") - { - _value.Clear(); - _value.Add(sc.Text); - } - return _value; - } - set - { - _value = value; - } - } - } -} diff --git a/src/umbraco.cms/businesslogic/skinning/dependencies/Text.cs b/src/umbraco.cms/businesslogic/skinning/dependencies/Text.cs deleted file mode 100644 index 1997e68829..0000000000 --- a/src/umbraco.cms/businesslogic/skinning/dependencies/Text.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Web.UI.WebControls; - -namespace umbraco.cms.businesslogic.skinning.dependencies -{ - public class Text : DependencyType - { - public System.Web.UI.WebControls.TextBox tb; - public List _value; - - public Text() - { - this.Name = "Text"; - this.Description = "Will render a text input"; - - - tb = new TextBox(); - _value = new List(); - } - - public override WebControl Editor - { - get - { - tb.TextMode = System.Web.UI.WebControls.TextBoxMode.SingleLine; - tb.CssClass = "text"; - - if (_value.Count > 0 && !string.IsNullOrEmpty(_value[0].ToString())) - tb.Text = _value[0].ToString(); - - return tb; - } - set - { - base.Editor = value; - } - } - - public override List Values - { - get - { - if (tb.Text != "") - { - _value.Clear(); - _value.Add(tb.Text); - } - return _value; - } - set - { - _value = value; - } - } - - } -} diff --git a/src/umbraco.cms/businesslogic/skinning/tasks/AddStyleSheetToTemplate.cs b/src/umbraco.cms/businesslogic/skinning/tasks/AddStyleSheetToTemplate.cs deleted file mode 100644 index 44f67d4506..0000000000 --- a/src/umbraco.cms/businesslogic/skinning/tasks/AddStyleSheetToTemplate.cs +++ /dev/null @@ -1,114 +0,0 @@ -using System; -using umbraco.interfaces.skinning; -using HtmlAgilityPack; -using umbraco.IO; - -namespace umbraco.cms.businesslogic.skinning.tasks -{ - public class AddStyleSheetToTemplate : TaskType - { - public string TargetFile { get; set; } - public string TargetSelector { get; set; } - public string Media { get; set; } - - public AddStyleSheetToTemplate() - { - this.Name = "Add StyleSheet To Template"; - this.Description = "Will add an additional stylesheet to a template"; - } - - public override TaskExecutionDetails Execute(string Value) - { - TaskExecutionDetails d = new TaskExecutionDetails(); - - - HtmlDocument doc = new HtmlDocument(); - doc.Load(IO.IOHelper.MapPath(SystemDirectories.Masterpages) + "/" + TargetFile); - - //if (doc.DocumentNode.SelectSingleNode(string.Format("//link [@href = '{0}']", Value)) == null) - //{ - - HtmlNode target = doc.DocumentNode.SelectSingleNode(string.IsNullOrEmpty(TargetSelector) ? "//head" : TargetSelector.ToLower()); - - if (target != null) - { - - HtmlNode s = doc.CreateElement("link"); - //s.Name = "link"; - s.Attributes.Append("rel", "stylesheet"); - s.Attributes.Append("type", "text/css"); - - - s.Attributes.Append("href", Value); - - - if (!string.IsNullOrEmpty(Media)) - s.Attributes.Append("media", Media); - - target.AppendChild(s); - - doc.Save(IO.IOHelper.MapPath(SystemDirectories.Masterpages) + "/" + TargetFile); - - d.TaskExecutionStatus = TaskExecutionStatus.Completed; - d.NewValue = Value; - } - else - d.TaskExecutionStatus = TaskExecutionStatus.Cancelled; - //} - //else - // d.TaskExecutionStatus = TaskExecutionStatus.Cancelled; - - return d; - } - - public override TaskExecutionStatus RollBack(string OriginalValue) - { - HtmlDocument doc = new HtmlDocument(); - doc.Load(IO.IOHelper.MapPath(SystemDirectories.Masterpages) + "/" + TargetFile); - - HtmlNode s = doc.DocumentNode.SelectSingleNode(string.Format("//link [@href = '{0}']", Value)); - - if (s != null) - { - s.RemoveAll(); - - doc.Save(IO.IOHelper.MapPath(SystemDirectories.Masterpages) + "/" + TargetFile); - - return TaskExecutionStatus.Completed; - } - else - return TaskExecutionStatus.Cancelled; - - - } - - public override string PreviewClientScript(string ControlClientId, string ClientSidePreviewEventType, string ClientSideGetValueScript) - { - return string.Format( - @"var link{4}; - jQuery('#{0}').bind('{2}', function() {{ - jQuery(link{4}).remove(); - link{4} = jQuery(''); - link{4}.attr({{ - type: 'text/css', - rel: 'stylesheet', - {3} - href:{1} - }}); - jQuery('head').append(link{4}); - }}); - - - //cancel support - jQuery('#cancelSkinCustomization').click(function () {{ - jQuery(link{4}).remove(); - }}); - ", - ControlClientId, - ClientSideGetValueScript, - ClientSidePreviewEventType, - string.IsNullOrEmpty(Media) ? "" : string.Format("media :'{0}',",Media), - Guid.NewGuid().ToString().Replace("-", "")); - } - } -} diff --git a/src/umbraco.cms/businesslogic/skinning/tasks/ModifyCss.cs b/src/umbraco.cms/businesslogic/skinning/tasks/ModifyCss.cs deleted file mode 100644 index c4fdf5c07b..0000000000 --- a/src/umbraco.cms/businesslogic/skinning/tasks/ModifyCss.cs +++ /dev/null @@ -1,93 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using umbraco.interfaces.skinning; -using System.IO; -using umbraco.IO; -using System.Web; - -namespace umbraco.cms.businesslogic.skinning.tasks -{ - public class ModifyCss : TaskType - { - public string TargetFile { get; set; } - public string TargetRule { get; set; } - public string TargetParameter { get; set; } - - public ModifyCss() - { - this.Name = "Modify Css"; - this.Description = "Will modify the stylesheet"; - } - - public override TaskExecutionDetails Execute(string Value) - { - TaskExecutionDetails d = new TaskExecutionDetails(); - - //currently just appending it to the end of the css file - StreamWriter sw = File.AppendText(IO.IOHelper.MapPath(SystemDirectories.Css) + "/" + TargetFile); - sw.WriteLine(string.Format("{0}{{ {1}:{2};}}", TargetRule, TargetParameter, Value)); - sw.Close(); - - d.TaskExecutionStatus = TaskExecutionStatus.Completed; - d.OriginalValue = ""; - d.NewValue = Value; - - return d; - } - - public override TaskExecutionStatus RollBack(string OriginalValue) - { - string[] filecontents = File.ReadAllLines(IO.IOHelper.MapPath(SystemDirectories.Css) + "/" + TargetFile); - - for (int i = filecontents.Length; i > 0; i--) - { - if (filecontents[i - 1].Contains(string.Format("{0}{{ {1}:", TargetRule, TargetParameter))) - { - filecontents[i - 1] = string.Empty; - break; - } - } - - StringBuilder s = new StringBuilder(); - - foreach (string line in filecontents) - s.AppendLine(line); - - System.IO.StreamWriter file = new System.IO.StreamWriter(IO.IOHelper.MapPath(SystemDirectories.Css) + "/" + TargetFile); - file.WriteLine(s.ToString()); - - file.Close(); - - - return TaskExecutionStatus.Completed; - } - - public override string PreviewClientScript(string ControlClientId,string ClientSidePreviewEventType, string ClientSideGetValueScript) - { - - return string.Format( - @"jQuery('#{0}').bind('{5}', function() {{ - var val = '{3}'; - jQuery('{1}').css('{2}', val.replace('${{Output}}',{4})); - }}); - - - //cancel support - var init{6} = jQuery('{1}').css('{2}'); - jQuery('#cancelSkinCustomization').click(function () {{ - jQuery('{1}').css('{2}',init{6}); - }}); - - ", - ControlClientId, - TargetRule, - TargetParameter, - Value, - ClientSideGetValueScript, - ClientSidePreviewEventType, - Guid.NewGuid().ToString().Replace("-", "")); - } - } -} diff --git a/src/umbraco.cms/businesslogic/skinning/tasks/ModifyPageProperty.cs b/src/umbraco.cms/businesslogic/skinning/tasks/ModifyPageProperty.cs deleted file mode 100644 index cba9da77fb..0000000000 --- a/src/umbraco.cms/businesslogic/skinning/tasks/ModifyPageProperty.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using umbraco.interfaces.skinning; -using umbraco.cms.businesslogic.web; -using System.Web; - -namespace umbraco.cms.businesslogic.skinning.tasks -{ - public class ModifyPageProperty : TaskType - { - public string PropertyAlias { get; set; } - public string ClientSideContainerID { get; set; } - - public ModifyPageProperty() - { - this.Name = " Modify page property"; - this.Description = "Will modify a property on the current page"; - } - - public override TaskExecutionDetails Execute(string Value) - { - TaskExecutionDetails d = new TaskExecutionDetails(); - - if (HttpContext.Current != null && HttpContext.Current.Items["pageID"] != null) - { - string id = HttpContext.Current.Items["pageID"].ToString(); - - Document doc = new Document(Convert.ToInt32(id)); - - if (doc.getProperty(PropertyAlias) != null) - { - d.OriginalValue = doc.getProperty(PropertyAlias).Value.ToString(); - - doc.getProperty(PropertyAlias).Value = Value; - doc.SaveAndPublish(new BusinessLogic.User(0)); - - d.NewValue = Value; - d.TaskExecutionStatus = TaskExecutionStatus.Completed; - } - else - d.TaskExecutionStatus = TaskExecutionStatus.Cancelled; - - } - else - d.TaskExecutionStatus = TaskExecutionStatus.Cancelled; - - return d; - } - - - public override string PreviewClientScript(string ControlClientId, string ClientSidePreviewEventType, string ClientSideGetValueScript) - { - - - return string.Format( - @"jQuery('#{0}').bind('{3}', function() {{ - jQuery('#{1}').html({2}); - }}); - - //cancel support - var init{4} = jQuery('#{1}').html(); - jQuery('#cancelSkinCustomization').click(function () {{ - jQuery('#{1}').html(init{4}); - }}); - ", - ControlClientId, - ClientSideContainerID, - ClientSideGetValueScript, - ClientSidePreviewEventType, - Guid.NewGuid().ToString().Replace("-", "")); - - - } - } -} diff --git a/src/umbraco.cms/businesslogic/skinning/tasks/ModifyTemplate.cs b/src/umbraco.cms/businesslogic/skinning/tasks/ModifyTemplate.cs deleted file mode 100644 index 7d3d7a7c63..0000000000 --- a/src/umbraco.cms/businesslogic/skinning/tasks/ModifyTemplate.cs +++ /dev/null @@ -1,111 +0,0 @@ -using System; -using umbraco.interfaces.skinning; -using umbraco.IO; -using HtmlAgilityPack; - -namespace umbraco.cms.businesslogic.skinning.tasks -{ - public class ModifyTemplate : TaskType - { - public string TargetFile { get; set; } - public string TargetID { get; set; } - public string TargetAttribute { get; set; } - - public ModifyTemplate() - { - this.Name = " Modify template"; - this.Description = "Will modify a template"; - } - - public override TaskExecutionDetails Execute(string Value) - { - TaskExecutionDetails d = new TaskExecutionDetails(); - - //open template - - HtmlDocument doc = new HtmlDocument(); - doc.Load(IO.IOHelper.MapPath(SystemDirectories.Masterpages) + "/" +TargetFile); - - if (doc.DocumentNode.SelectNodes(string.Format("//*[@id = '{0}']", TargetID)) != null) - { - foreach (HtmlNode target in doc.DocumentNode.SelectNodes(string.Format("//*[@id = '{0}']", TargetID))) - { - if (string.IsNullOrEmpty(TargetAttribute)) - { - d.OriginalValue = target.InnerHtml; - target.InnerHtml = Value; - } - else - { - if (target.Attributes[TargetAttribute] == null) - { - target.Attributes.Append(TargetAttribute, Value); - } - else - { - d.OriginalValue = target.Attributes[TargetAttribute].Value; - target.Attributes[TargetAttribute].Value = Value; - } - } - } - } - doc.Save(IO.IOHelper.MapPath(SystemDirectories.Masterpages) + "/" + TargetFile); - - d.TaskExecutionStatus = TaskExecutionStatus.Completed; - d.NewValue = Value; - //save - - return d; - } - - - public override string PreviewClientScript(string ControlClientId,string ClientSidePreviewEventType, string ClientSideGetValueScript) - { - - if (string.IsNullOrEmpty(TargetAttribute)) - { - return string.Format( - @"jQuery('#{0}').bind('{3}', function() {{ - var val = '{5}'; - jQuery('#{1}').html(val.replace('${{Output}}',{2})); - }}); - - //cancel support - var init{4} = jQuery('#{1}').html(); - jQuery('#cancelSkinCustomization').click(function () {{ - jQuery('#{1}').html(init{4}); - }}); - ", - ControlClientId, - TargetID, - ClientSideGetValueScript, - ClientSidePreviewEventType, - Guid.NewGuid().ToString().Replace("-", ""), - Value); - } - else - { - return string.Format( - @"jQuery('#{0}').bind('{4}', function() {{ - var val = '{6}'; - jQuery('#{1}').attr('{2}',val.replace('${{Output}}',{3})); - }}); - - - //cancel support - var init{5} = jQuery('#{1}').attr('{2}'); - jQuery('#cancelSkinCustomization').click(function () {{ - jQuery('#{1}').attr('{2}',init{5}); - }}); - ", - ControlClientId, - TargetID, - TargetAttribute, - ClientSideGetValueScript, - ClientSidePreviewEventType, - Guid.NewGuid().ToString().Replace("-", ""), - Value); - } - } - } -} diff --git a/src/umbraco.cms/umbraco.cms.csproj b/src/umbraco.cms/umbraco.cms.csproj index 1c218bc3a8..6262adb867 100644 --- a/src/umbraco.cms/umbraco.cms.csproj +++ b/src/umbraco.cms/umbraco.cms.csproj @@ -212,7 +212,6 @@ - @@ -257,34 +256,13 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/src/umbraco.editorControls/AbstractPrevalueEditor.cs b/src/umbraco.editorControls/AbstractPrevalueEditor.cs index 0d6521449a..c63c06ec75 100644 --- a/src/umbraco.editorControls/AbstractPrevalueEditor.cs +++ b/src/umbraco.editorControls/AbstractPrevalueEditor.cs @@ -1,6 +1,7 @@ using System; using System.Web.UI; using System.Web.UI.WebControls; +using ClientDependency.Core; using umbraco.interfaces; using umbraco.cms.businesslogic.datatype; diff --git a/src/umbraco.editorControls/MultiNodeTreePicker/MNTP_DataEditor.cs b/src/umbraco.editorControls/MultiNodeTreePicker/MNTP_DataEditor.cs index 979eb06e80..fde7e6cac0 100644 --- a/src/umbraco.editorControls/MultiNodeTreePicker/MNTP_DataEditor.cs +++ b/src/umbraco.editorControls/MultiNodeTreePicker/MNTP_DataEditor.cs @@ -313,8 +313,8 @@ namespace umbraco.editorControls.MultiNodeTreePicker base.OnLoad(e); //add the js/css required - this.RegisterEmbeddedClientResource("umbraco.editorControls.MultiNodeTreePicker.MultiNodePickerStyles.css", umbraco.cms.businesslogic.datatype.ClientDependencyType.Css); - this.RegisterEmbeddedClientResource("umbraco.editorControls.MultiNodeTreePicker.MultiNodePickerScripts.js", umbraco.cms.businesslogic.datatype.ClientDependencyType.Javascript); + this.RegisterEmbeddedClientResource("umbraco.editorControls.MultiNodeTreePicker.MultiNodePickerStyles.css", ClientDependencyType.Css); + this.RegisterEmbeddedClientResource("umbraco.editorControls.MultiNodeTreePicker.MultiNodePickerScripts.js", ClientDependencyType.Javascript); //update the tree type (we need to do this each time because i don't think view state works with these controls) switch (TreeToRender) diff --git a/src/umbraco.editorControls/MultiNodeTreePicker/MNTP_PrevalueEditor.cs b/src/umbraco.editorControls/MultiNodeTreePicker/MNTP_PrevalueEditor.cs index 352288d301..dbdc356273 100644 --- a/src/umbraco.editorControls/MultiNodeTreePicker/MNTP_PrevalueEditor.cs +++ b/src/umbraco.editorControls/MultiNodeTreePicker/MNTP_PrevalueEditor.cs @@ -3,10 +3,11 @@ using System.Collections; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; +using ClientDependency.Core; using umbraco.cms.businesslogic.datatype; using umbraco.interfaces; using umbraco.uicontrols.TreePicker; -using Umbraco.Core; +using Constants = Umbraco.Core.Constants; namespace umbraco.editorControls.MultiNodeTreePicker { diff --git a/src/umbraco.editorControls/MultipleTextstring/MultipleTextstringControl.cs b/src/umbraco.editorControls/MultipleTextstring/MultipleTextstringControl.cs index fb925d4ee1..384e24144f 100644 --- a/src/umbraco.editorControls/MultipleTextstring/MultipleTextstringControl.cs +++ b/src/umbraco.editorControls/MultipleTextstring/MultipleTextstringControl.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Web.UI; using System.Web.UI.WebControls; +using ClientDependency.Core; using umbraco; using umbraco.cms.businesslogic.datatype; diff --git a/src/umbraco.editorControls/ResourceExtensions.cs b/src/umbraco.editorControls/ResourceExtensions.cs index 18593679f4..e0923669cf 100644 --- a/src/umbraco.editorControls/ResourceExtensions.cs +++ b/src/umbraco.editorControls/ResourceExtensions.cs @@ -1,5 +1,6 @@ using System; using System.Web.UI; +using ClientDependency.Core; using umbraco; using umbraco.cms.businesslogic.datatype; using System.Web.UI.HtmlControls; diff --git a/src/umbraco.editorControls/macrocontainer/Editor.cs b/src/umbraco.editorControls/macrocontainer/Editor.cs index 4f0d62630f..d4cbdeaeca 100644 --- a/src/umbraco.editorControls/macrocontainer/Editor.cs +++ b/src/umbraco.editorControls/macrocontainer/Editor.cs @@ -170,21 +170,7 @@ namespace umbraco.editorControls.macrocontainer base.OnLoad(e); // And a reference to the macro container calls - //if (!UmbracoContext.Current.LiveEditingContext.Enabled) - //{ - // ScriptManager sm = ScriptManager.GetCurrent(base.Page); - // ServiceReference webservicePath = new ServiceReference(SystemDirectories.Webservices + "/MacroContainerService.asmx"); - - // if (!sm.Services.Contains(webservicePath)) - // sm.Services.Add(webservicePath); - //} - //else - //{ - // ClientDependencyLoader.Instance.RegisterDependency("webservices/MacroContainerService.asmx/js", "UmbracoRoot", ClientDependencyType.Javascript); - //} - - - + //ClientDependencyLoader.Instance.RegisterDependency("webservices/MacroContainerService.asmx/js", "UmbracoRoot", ClientDependencyType.Javascript); string script = "function " + ID + "makesortable(){ "; diff --git a/src/umbraco.editorControls/tinyMCE3/TinyMCE.cs b/src/umbraco.editorControls/tinyMCE3/TinyMCE.cs index adf6a73b6c..64d859e45e 100644 --- a/src/umbraco.editorControls/tinyMCE3/TinyMCE.cs +++ b/src/umbraco.editorControls/tinyMCE3/TinyMCE.cs @@ -18,7 +18,7 @@ using umbraco.uicontrols; namespace umbraco.editorControls.tinyMCE3 { - public class TinyMCE : TinyMCEWebControl, IDataEditor, IMenuElement, ILiveEditingDataEditor + public class TinyMCE : TinyMCEWebControl, IDataEditor, IMenuElement { private readonly string _activateButtons = ""; private readonly string _advancedUsers = ""; @@ -38,8 +38,6 @@ namespace umbraco.editorControls.tinyMCE3 private readonly int m_maxImageWidth = 500; private bool _isInitialized; private string _plugins = ""; - private bool m_isInLiveEditingMode; - public TinyMCE(IData Data, string Configuration) { @@ -402,19 +400,6 @@ namespace umbraco.editorControls.tinyMCE3 } } - #region ILiveEditingDataEditor Members - - public Control LiveEditingControl - { - get - { - m_isInLiveEditingMode = true; - base.IsInLiveEditingMode = true; - return this; - } - } - - #endregion #region IMenuElement Members @@ -457,20 +442,9 @@ namespace umbraco.editorControls.tinyMCE3 config.Add("theme_umbraco_versionId", base.VersionId.ToString()); // we'll need to make an extra check for the liveediting as that value is set after the constructor have initialized - if (IsInLiveEditingMode) - { - if (config["theme_umbraco_toolbar_location"] == null) - config.Add("theme_umbraco_toolbar_location", ""); - config["theme_umbraco_toolbar_location"] = "external"; - config.Add("umbraco_toolbar_id", - "LiveEditingClientToolbar"); - } - else - { - config.Add("umbraco_toolbar_id", + config.Add("umbraco_toolbar_id", ElementIdPreFix + ((cms.businesslogic.datatype.DefaultData)_data).PropertyId); - } } else { diff --git a/src/umbraco.editorControls/tinyMCE3/webcontrol/TinyMCEWebControl.cs b/src/umbraco.editorControls/tinyMCE3/webcontrol/TinyMCEWebControl.cs index 8492aaef6a..3093b42003 100644 --- a/src/umbraco.editorControls/tinyMCE3/webcontrol/TinyMCEWebControl.cs +++ b/src/umbraco.editorControls/tinyMCE3/webcontrol/TinyMCEWebControl.cs @@ -26,8 +26,6 @@ namespace umbraco.editorControls.tinyMCE3.webcontrol private int _nodeId = 0; private Guid _versionId; - public bool IsInLiveEditingMode { get; set; } - public int NodeId { set { _nodeId = value; } @@ -109,33 +107,19 @@ namespace umbraco.editorControls.tinyMCE3.webcontrol protected override void Render(HtmlTextWriter writer) { base.Render(writer); - if (!IsInLiveEditingMode) - writer.Write(m_scriptInitBlock.ToString()); - else - // add a marker to tell Live Editing when a tinyMCE control is on the page - writer.Write(""); + // add a marker to tell Live Editing when a tinyMCE control is on the page + writer.Write(""); } protected override void OnLoad(EventArgs args) { - if (!IsInLiveEditingMode) - this.config["elements"] = this.ClientID; + this.config["elements"] = this.ClientID; + bool first = true; - // Render HTML for TinyMCE instance - // in the liveediting mode we're always preloading tinymce script - if (!IsInLiveEditingMode) - { - //TinyMCE uses it's own compressor so leave it up to ScriptManager to render - ScriptManager.RegisterClientScriptInclude(this, this.GetType(), _versionId.ToString(), this.ScriptURI); - } - else - { - //We're in live edit mode so add the base js file to the dependency list - ClientDependencyLoader.Instance.RegisterDependency("tinymce3/tiny_mce_src.js", - "UmbracoClient", ClientDependencyType.Javascript); - } + //TinyMCE uses it's own compressor so leave it up to ScriptManager to render + ScriptManager.RegisterClientScriptInclude(this, this.GetType(), _versionId.ToString(), this.ScriptURI); // Write script tag start m_scriptInitBlock.Append(HtmlTextWriter.TagLeftChar.ToString()); @@ -150,54 +134,28 @@ namespace umbraco.editorControls.tinyMCE3.webcontrol foreach (string key in this.config.Keys) { //TODO: This is a hack to test if we can prevent tinymce from automatically download languages - if (!IsInLiveEditingMode || (key != "language")) - { - string val = this.config[key]; + string val = this.config[key]; - if (!first) - m_scriptInitBlock.Append(",\n"); - else - first = false; + if (!first) + m_scriptInitBlock.Append(",\n"); + else + first = false; - // Is boolean state or string - if (val == "true" || val == "false") - m_scriptInitBlock.Append(key + ":" + this.config[key]); - else - m_scriptInitBlock.Append(key + ":'" + this.config[key] + "'"); - } + // Is boolean state or string + if (val == "true" || val == "false") + m_scriptInitBlock.Append(key + ":" + this.config[key]); + else + m_scriptInitBlock.Append(key + ":'" + this.config[key] + "'"); } m_scriptInitBlock.Append("\n});\n"); - // we're wrapping the tinymce init call in a load function when in live editing, - // so we'll need to close that function declaration - if (IsInLiveEditingMode) - { - m_scriptInitBlock.Append(@"(function() { var f = - function() { - if(document.getElementById('__umbraco_tinyMCE')) - tinyMCE.execCommand('mceAddControl',false,'").Append(ClientID).Append(@"'); - ItemEditing.remove_startEdit(f); - } - ItemEditing.add_startEdit(f);})();"); - m_scriptInitBlock.Append(@"(function() { var f = - function() { - tinyMCE.execCommand('mceRemoveControl',false,'").Append(ClientID).Append(@"'); - ItemEditing.remove_stopEdit(f); - } - ItemEditing.add_stopEdit(f);})();"); - } + // Write script tag end m_scriptInitBlock.Append(HtmlTextWriter.EndTagLeftChars); m_scriptInitBlock.Append("script"); m_scriptInitBlock.Append(HtmlTextWriter.TagRightChar.ToString()); - - // add to script manager - if (IsInLiveEditingMode) - { - ScriptManager.RegisterClientScriptBlock(this, this.GetType(), new Guid().ToString(), - m_scriptInitBlock.ToString(), false); - } + } diff --git a/src/umbraco.editorControls/tinymce/tinyMCEPreValueConfigurator.cs b/src/umbraco.editorControls/tinymce/tinyMCEPreValueConfigurator.cs index de2afaa555..10741b9c35 100644 --- a/src/umbraco.editorControls/tinymce/tinyMCEPreValueConfigurator.cs +++ b/src/umbraco.editorControls/tinymce/tinyMCEPreValueConfigurator.cs @@ -237,7 +237,7 @@ namespace umbraco.editorControls.tinymce data += "|"; - // full width currenctly not useLiveEditing + data += "0|"; /* if (_fullWidth.Checked) diff --git a/src/umbraco.interfaces/ILiveEditingDataEditor.cs b/src/umbraco.interfaces/ILiveEditingDataEditor.cs deleted file mode 100644 index 4a8a2b9eb6..0000000000 --- a/src/umbraco.interfaces/ILiveEditingDataEditor.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Web.UI; - -namespace umbraco.interfaces -{ - /// - /// Data type editor controls can choose to implement this interface - /// to customize their Live Editing behavior. - /// - [Obsolete("ILiveEditingDataEditor is obsolete and is no longer used, it will be removed from the codebase in future versions")] - public interface ILiveEditingDataEditor - { - /// - /// Gets the control used for Live Editing. - /// - Control LiveEditingControl { get; } - } -} diff --git a/src/umbraco.interfaces/umbraco.interfaces.csproj b/src/umbraco.interfaces/umbraco.interfaces.csproj index 0f617173bd..167abaf79d 100644 --- a/src/umbraco.interfaces/umbraco.interfaces.csproj +++ b/src/umbraco.interfaces/umbraco.interfaces.csproj @@ -150,7 +150,6 @@ Code - Code From b2e2a2b004ba6a2aa5a5959c5b29611c31c57d13 Mon Sep 17 00:00:00 2001 From: Shannon Date: Wed, 25 Sep 2013 18:18:36 +1000 Subject: [PATCH 09/17] removes the old skinning.config and updates the installer to not show that option. --- src/Umbraco.Web.UI/Umbraco.Web.UI.csproj | 4 ---- .../config/ClientDependency.config | 2 +- src/Umbraco.Web.UI/config/Dashboard.config | 16 ++++++++++++++++ .../config/Skinning.Release.config | 3 --- src/Umbraco.Web.UI/config/Skinning.config | 4 ---- .../install/steps/StarterKits.ascx | 19 +------------------ .../install/steps/StarterKits.ascx.cs | 4 ++++ 7 files changed, 22 insertions(+), 30 deletions(-) delete mode 100644 src/Umbraco.Web.UI/config/Skinning.Release.config delete mode 100644 src/Umbraco.Web.UI/config/Skinning.config diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index 64f99def36..3c067ea1d3 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -655,9 +655,6 @@ tinyMceConfig.config - - Skinning.config - scripting.config @@ -2106,7 +2103,6 @@ Designer - diff --git a/src/Umbraco.Web.UI/config/ClientDependency.config b/src/Umbraco.Web.UI/config/ClientDependency.config index 33970c4f69..8b4b1b115e 100644 --- a/src/Umbraco.Web.UI/config/ClientDependency.config +++ b/src/Umbraco.Web.UI/config/ClientDependency.config @@ -10,7 +10,7 @@ NOTES: * Compression/Combination/Minification is not enabled unless debug="false" is specified on the 'compiliation' element in the web.config * A new version will invalidate both client and server cache and create new persisted files --> - + - - diff --git a/src/Umbraco.Web.UI/install/steps/StarterKits.ascx.cs b/src/Umbraco.Web.UI/install/steps/StarterKits.ascx.cs index 579f8b7413..7a51a2eede 100644 --- a/src/Umbraco.Web.UI/install/steps/StarterKits.ascx.cs +++ b/src/Umbraco.Web.UI/install/steps/StarterKits.ascx.cs @@ -2,6 +2,7 @@ using Umbraco.Core.IO; using Umbraco.Web.Install; using Umbraco.Web.UI.Install.Steps.Skinning; +using umbraco.cms.businesslogic.packager; namespace Umbraco.Web.UI.Install.Steps { @@ -10,6 +11,9 @@ namespace Umbraco.Web.UI.Install.Steps protected void Page_Load(object sender, EventArgs e) { + if (InstalledPackage.GetAllInstalledPackages().Count > 0) + GotoNextStep(sender, e); + ShowStarterKits(); } From cf462bd28e7f14fdd02f9cb3e2317aa3f20d0bae Mon Sep 17 00:00:00 2001 From: Shannon Date: Wed, 25 Sep 2013 18:49:19 +1000 Subject: [PATCH 10/17] Fixes starter kit installer with no skins --- src/Umbraco.Web.UI/config/Dashboard.config | 25 +------- .../developer/Packages/StarterKits.aspx | 15 +---- .../developer/Packages/StarterKits.aspx.cs | 62 ++++++++++++++----- .../Packages/StarterKits.aspx.designer.cs | 18 ------ 4 files changed, 49 insertions(+), 71 deletions(-) diff --git a/src/Umbraco.Web.UI/config/Dashboard.config b/src/Umbraco.Web.UI/config/Dashboard.config index bfb791d134..d609c78bc8 100644 --- a/src/Umbraco.Web.UI/config/Dashboard.config +++ b/src/Umbraco.Web.UI/config/Dashboard.config @@ -104,28 +104,5 @@ /umbraco/dashboard/ExamineManagement.ascx -
- - contour - - - /umbraco/plugins/umbracocontour/formsdashboard.ascx - -
-
- - content - - - /usercontrols/blog/CommentModeration.ascx - -
-
- - content - - - /usercontrols/blog/CommentModeration.ascx - -
+ \ No newline at end of file diff --git a/src/Umbraco.Web.UI/umbraco/developer/Packages/StarterKits.aspx b/src/Umbraco.Web.UI/umbraco/developer/Packages/StarterKits.aspx index 202e256622..059e0f727a 100644 --- a/src/Umbraco.Web.UI/umbraco/developer/Packages/StarterKits.aspx +++ b/src/Umbraco.Web.UI/umbraco/developer/Packages/StarterKits.aspx @@ -60,19 +60,6 @@ - -

Available skins

-

You can choose from the following skins.

-
Please wait...
-
-
-
- -
-
- - -

Available starter kits

You can choose from the following starter kits, each having specific functionality.

@@ -89,7 +76,7 @@
-

We can not install starterkits when the install directory is not present.

+

We can not install starterkits when the install directory or package repository is not present.

diff --git a/src/Umbraco.Web.UI/umbraco/developer/Packages/StarterKits.aspx.cs b/src/Umbraco.Web.UI/umbraco/developer/Packages/StarterKits.aspx.cs index af31f42143..e5cb1acc7d 100644 --- a/src/Umbraco.Web.UI/umbraco/developer/Packages/StarterKits.aspx.cs +++ b/src/Umbraco.Web.UI/umbraco/developer/Packages/StarterKits.aspx.cs @@ -1,19 +1,63 @@ using System; using System.Linq; using Umbraco.Core.IO; +using Umbraco.Core.Logging; using Umbraco.Web.UI.Install.Steps.Skinning; using Umbraco.Web.UI.Pages; +using System.IO; +using umbraco.cms.businesslogic.packager; namespace Umbraco.Web.UI.Umbraco.Developer.Packages { - using System.IO; + public partial class StarterKits : UmbracoEnsuredPage { + private const string RepoGuid = "65194810-1f85-11dd-bd0b-0800200c9a66"; protected void Page_Load(object sender, EventArgs e) { - ShowStarterKits(); + //check if a starter kit is already isntalled + + var installed = InstalledPackage.GetAllInstalledPackages(); + + if (installed.Count == 0) + { + ShowStarterKits(); + return; + } + + var repo = global::umbraco.cms.businesslogic.packager.repositories.Repository.getByGuid(RepoGuid); + if (repo.HasConnection()) + { + try + { + var kits = repo.Webservice.StarterKits(); + var kitIds = kits.Select(x => x.RepoGuid).ToArray(); + + //if a starter kit is already installed show finish + if (installed.Any(x => kitIds.Contains(Guid.Parse(x.Data.PackageGuid)))) + { + StarterKitNotInstalled.Visible = false; + installationCompleted.Visible = true; + } + else + { + ShowStarterKits(); + } + } + catch (Exception ex) + { + LogHelper.Error("Cannot connect to package repository", ex); + InstallationDirectoryNotAvailable.Visible = true; + StarterKitNotInstalled.Visible = false; + } + } + else + { + InstallationDirectoryNotAvailable.Visible = true; + StarterKitNotInstalled.Visible = false; + } } private void ShowStarterKits() @@ -22,30 +66,18 @@ namespace Umbraco.Web.UI.Umbraco.Developer.Packages { InstallationDirectoryNotAvailable.Visible = true; StarterKitNotInstalled.Visible = false; - StarterKitInstalled.Visible = false; return; } var starterkitsctrl = (LoadStarterKits)LoadControl(SystemDirectories.Install + "/steps/Skinning/loadStarterKits.ascx"); - starterkitsctrl.StarterKitInstalled += StarterkitsctrlStarterKitInstalled; - + ph_starterkits.Controls.Add(starterkitsctrl); StarterKitNotInstalled.Visible = true; - StarterKitInstalled.Visible = false; } - void StarterkitsctrlStarterKitInstalled() - { - StarterKitNotInstalled.Visible = false; - StarterKitInstalled.Visible = false; - - installationCompleted.Visible = true; - - } - } } \ No newline at end of file diff --git a/src/Umbraco.Web.UI/umbraco/developer/Packages/StarterKits.aspx.designer.cs b/src/Umbraco.Web.UI/umbraco/developer/Packages/StarterKits.aspx.designer.cs index efc1a04906..105a8ff5df 100644 --- a/src/Umbraco.Web.UI/umbraco/developer/Packages/StarterKits.aspx.designer.cs +++ b/src/Umbraco.Web.UI/umbraco/developer/Packages/StarterKits.aspx.designer.cs @@ -39,24 +39,6 @@ namespace Umbraco.Web.UI.Umbraco.Developer.Packages { /// protected global::umbraco.uicontrols.Feedback fb; - /// - /// StarterKitInstalled control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::umbraco.uicontrols.Pane StarterKitInstalled; - - /// - /// ph_skins control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.PlaceHolder ph_skins; - /// /// StarterKitNotInstalled control. /// From e02dddc7472da40491cb2599e175d5c7816ba223 Mon Sep 17 00:00:00 2001 From: Shannon Date: Wed, 25 Sep 2013 19:03:05 +1000 Subject: [PATCH 11/17] obsoleting legacy prop eds --- .../MultiNodeTreePicker/BaseTreeExtensions.cs | 1 + .../MultiNodeTreePicker/FilteredContentTree.cs | 1 + .../MultiNodeTreePicker/FilteredMediaTree.cs | 1 + .../MultiNodeTreePicker/HttpCookieExtensions.cs | 1 + .../MultiNodeTreePicker/MNTPResources.Designer.cs | 3 +++ .../MultiNodeTreePicker/MNTP_DataEditor.cs | 1 + .../MultiNodeTreePicker/MNTP_DataType.cs | 1 + .../MultiNodeTreePicker/MNTP_PrevalueEditor.cs | 1 + .../MultiNodeTreePicker/NodeSelectionType.cs | 5 ++++- .../MultiNodeTreePicker/SelectedItemsTemplate.cs | 2 ++ .../MultiNodeTreePicker/XPathExpressionType.cs | 5 ++++- .../MultiNodeTreePicker/XPathFilterType.cs | 5 ++++- .../MultiNodeTreePicker/XmlTreeNodeExtensions.cs | 4 +++- .../MultipleTextstring/MultipleTextstringControl.cs | 1 + .../MultipleTextstring/MultipleTextstringDataType.cs | 1 + .../MultipleTextstring/MultipleTextstringOptions.cs | 4 +++- .../MultipleTextstring/MultipleTextstringPrevalueEditor.cs | 1 + .../checkboxlist/CheckBoxDataType.cs | 1 + src/umbraco.editorControls/checkboxlist/checkboxList.cs | 1 + .../colorpicker/ColorPickerDataType.cs | 1 + src/umbraco.editorControls/colorpicker/colorPicker.cs | 4 +--- .../datefieldmultiple/DataTypeDatefieldMultiple.cs | 1 + src/umbraco.editorControls/datepicker/DateData.cs | 1 + src/umbraco.editorControls/datepicker/DateDataType.cs | 1 + src/umbraco.editorControls/datepicker/dateField.cs | 4 +--- .../dictionaryPicker/dictionaryPicker.cs | 1 + .../dictionaryPicker/dictionaryPickerDataType.cs | 1 + .../dropdownlist/DropDownDataType.cs | 1 + .../dropdownlist/dropDownKeysDataType.cs | 1 + src/umbraco.editorControls/dropdownlist/dropdown.cs | 1 + .../folderbrowser/DataTypeFolderbrowser.cs | 4 +--- src/umbraco.editorControls/folderbrowser/folderBrowser.cs | 1 + src/umbraco.editorControls/imagecropper/Config.cs | 1 + src/umbraco.editorControls/imagecropper/Data.cs | 7 ++++++- src/umbraco.editorControls/imagecropper/DataEditor.cs | 1 + src/umbraco.editorControls/imagecropper/DataType.cs | 1 + src/umbraco.editorControls/imagecropper/DataTypeData.cs | 4 +++- src/umbraco.editorControls/imagecropper/Helper.cs | 4 +++- src/umbraco.editorControls/imagecropper/ImageInfo.cs | 1 + .../imagecropper/ImageManipulation.cs | 1 + src/umbraco.editorControls/imagecropper/PrevalueEditor.cs | 1 + .../imagecropper/Resources.Designer.cs | 3 +++ src/umbraco.editorControls/imagecropper/SaveData.cs | 1 + src/umbraco.editorControls/imagecropper/SmartListBox.cs | 4 +++- src/umbraco.editorControls/label/DataTypeNoEdit.cs | 1 + src/umbraco.editorControls/label/noEdit.cs | 1 + src/umbraco.editorControls/listbox/ListBoxDataType.cs | 1 + src/umbraco.editorControls/listbox/ListBoxKeysDataType.cs | 1 + src/umbraco.editorControls/listbox/dropdownMultiple.cs | 1 + src/umbraco.editorControls/macrocontainer/DataType.cs | 1 + src/umbraco.editorControls/macrocontainer/Editor.cs | 1 + .../macrocontainer/MacroContainerEvent.cs | 1 + src/umbraco.editorControls/macrocontainer/MacroEditor.cs | 1 + .../macrocontainer/PrevalueEditor.cs | 1 + .../mediapicker/MediaPickerDataType.cs | 1 + .../mediapicker/MediaPickerPrevalueEditor.cs | 1 + src/umbraco.editorControls/mediapicker/mediaChooser.cs | 1 + .../memberpicker/MemberPickerDataType.cs | 1 + src/umbraco.editorControls/memberpicker/memberPicker.cs | 1 + src/umbraco.editorControls/numberfield/DataInteger.cs | 1 + src/umbraco.editorControls/numberfield/DataTypeInteger.cs | 1 + src/umbraco.editorControls/numberfield/numberField.cs | 1 + 62 files changed, 91 insertions(+), 18 deletions(-) diff --git a/src/umbraco.editorControls/MultiNodeTreePicker/BaseTreeExtensions.cs b/src/umbraco.editorControls/MultiNodeTreePicker/BaseTreeExtensions.cs index e13bac456d..cbf3b3b9e5 100644 --- a/src/umbraco.editorControls/MultiNodeTreePicker/BaseTreeExtensions.cs +++ b/src/umbraco.editorControls/MultiNodeTreePicker/BaseTreeExtensions.cs @@ -9,6 +9,7 @@ namespace umbraco.editorControls.MultiNodeTreePicker /// /// BaseTree extensions for MultiNodeTreePicker. /// + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public static class BaseTreeExtensions { diff --git a/src/umbraco.editorControls/MultiNodeTreePicker/FilteredContentTree.cs b/src/umbraco.editorControls/MultiNodeTreePicker/FilteredContentTree.cs index 664282ec89..40dfce710b 100644 --- a/src/umbraco.editorControls/MultiNodeTreePicker/FilteredContentTree.cs +++ b/src/umbraco.editorControls/MultiNodeTreePicker/FilteredContentTree.cs @@ -10,6 +10,7 @@ namespace umbraco.editorControls.MultiNodeTreePicker /// /// FilteredContentTree for the MultiNodeTreePicker /// + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class FilteredContentTree : BaseContentTree { /// diff --git a/src/umbraco.editorControls/MultiNodeTreePicker/FilteredMediaTree.cs b/src/umbraco.editorControls/MultiNodeTreePicker/FilteredMediaTree.cs index 764d7ee522..8faea4e395 100644 --- a/src/umbraco.editorControls/MultiNodeTreePicker/FilteredMediaTree.cs +++ b/src/umbraco.editorControls/MultiNodeTreePicker/FilteredMediaTree.cs @@ -9,6 +9,7 @@ namespace umbraco.editorControls.MultiNodeTreePicker /// /// FilteredMediaTree for the MultiNodeTreePicker. /// + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class FilteredMediaTree : BaseMediaTree { /// diff --git a/src/umbraco.editorControls/MultiNodeTreePicker/HttpCookieExtensions.cs b/src/umbraco.editorControls/MultiNodeTreePicker/HttpCookieExtensions.cs index e03b5c2533..30c34a0a1a 100644 --- a/src/umbraco.editorControls/MultiNodeTreePicker/HttpCookieExtensions.cs +++ b/src/umbraco.editorControls/MultiNodeTreePicker/HttpCookieExtensions.cs @@ -13,6 +13,7 @@ namespace umbraco.editorControls.MultiNodeTreePicker /// it is much more complicated to try to persist these values between ajax request, /// given the tree's current architecture. /// + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public static class HttpCookieExtensions { diff --git a/src/umbraco.editorControls/MultiNodeTreePicker/MNTPResources.Designer.cs b/src/umbraco.editorControls/MultiNodeTreePicker/MNTPResources.Designer.cs index b5a6344eae..645332f848 100644 --- a/src/umbraco.editorControls/MultiNodeTreePicker/MNTPResources.Designer.cs +++ b/src/umbraco.editorControls/MultiNodeTreePicker/MNTPResources.Designer.cs @@ -8,6 +8,8 @@ // //------------------------------------------------------------------------------ +using System; + namespace umbraco.editorControls.MultiNodeTreePicker { @@ -22,6 +24,7 @@ namespace umbraco.editorControls.MultiNodeTreePicker [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class MNTPResources { private static global::System.Resources.ResourceManager resourceMan; diff --git a/src/umbraco.editorControls/MultiNodeTreePicker/MNTP_DataEditor.cs b/src/umbraco.editorControls/MultiNodeTreePicker/MNTP_DataEditor.cs index fde7e6cac0..1786aea4ff 100644 --- a/src/umbraco.editorControls/MultiNodeTreePicker/MNTP_DataEditor.cs +++ b/src/umbraco.editorControls/MultiNodeTreePicker/MNTP_DataEditor.cs @@ -27,6 +27,7 @@ namespace umbraco.editorControls.MultiNodeTreePicker [ClientDependency(ClientDependencyType.Javascript, "ui/jquery.tooltip.min.js", "UmbracoClient")] [ClientDependency(ClientDependencyType.Javascript, "controls/Images/ImageViewer.js", "UmbracoRoot")] [ValidationProperty("Value")] + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class MNTP_DataEditor : Control, INamingContainer { #region Static Constructor diff --git a/src/umbraco.editorControls/MultiNodeTreePicker/MNTP_DataType.cs b/src/umbraco.editorControls/MultiNodeTreePicker/MNTP_DataType.cs index f37ff146e1..1933b1dc8d 100644 --- a/src/umbraco.editorControls/MultiNodeTreePicker/MNTP_DataType.cs +++ b/src/umbraco.editorControls/MultiNodeTreePicker/MNTP_DataType.cs @@ -10,6 +10,7 @@ namespace umbraco.editorControls.MultiNodeTreePicker /// /// Multi-node tree picker data type /// + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class MNTP_DataType : AbstractDataEditor { diff --git a/src/umbraco.editorControls/MultiNodeTreePicker/MNTP_PrevalueEditor.cs b/src/umbraco.editorControls/MultiNodeTreePicker/MNTP_PrevalueEditor.cs index dbdc356273..7ae2e83153 100644 --- a/src/umbraco.editorControls/MultiNodeTreePicker/MNTP_PrevalueEditor.cs +++ b/src/umbraco.editorControls/MultiNodeTreePicker/MNTP_PrevalueEditor.cs @@ -14,6 +14,7 @@ namespace umbraco.editorControls.MultiNodeTreePicker /// /// The pre-value editor for the multi node tree picker. /// + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class MNTP_PrevalueEditor : Control, IDataPrevalue { private readonly umbraco.cms.businesslogic.datatype.BaseDataType m_DataType; diff --git a/src/umbraco.editorControls/MultiNodeTreePicker/NodeSelectionType.cs b/src/umbraco.editorControls/MultiNodeTreePicker/NodeSelectionType.cs index 76dc493cee..048e1d9dc8 100644 --- a/src/umbraco.editorControls/MultiNodeTreePicker/NodeSelectionType.cs +++ b/src/umbraco.editorControls/MultiNodeTreePicker/NodeSelectionType.cs @@ -1,8 +1,11 @@ -namespace umbraco.editorControls.MultiNodeTreePicker +using System; + +namespace umbraco.editorControls.MultiNodeTreePicker { /// /// /// + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public enum NodeSelectionType { /// diff --git a/src/umbraco.editorControls/MultiNodeTreePicker/SelectedItemsTemplate.cs b/src/umbraco.editorControls/MultiNodeTreePicker/SelectedItemsTemplate.cs index 92b999457d..f344fd0f4c 100644 --- a/src/umbraco.editorControls/MultiNodeTreePicker/SelectedItemsTemplate.cs +++ b/src/umbraco.editorControls/MultiNodeTreePicker/SelectedItemsTemplate.cs @@ -1,3 +1,4 @@ +using System; using System.Web; using System.Web.UI; using System.Web.UI.HtmlControls; @@ -10,6 +11,7 @@ namespace umbraco.editorControls.MultiNodeTreePicker /// /// The item template for the selected items repeater /// + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] internal class SelectedItemsTemplate : ITemplate { #region ITemplate Members diff --git a/src/umbraco.editorControls/MultiNodeTreePicker/XPathExpressionType.cs b/src/umbraco.editorControls/MultiNodeTreePicker/XPathExpressionType.cs index 43b1fb7bc3..21858e4167 100644 --- a/src/umbraco.editorControls/MultiNodeTreePicker/XPathExpressionType.cs +++ b/src/umbraco.editorControls/MultiNodeTreePicker/XPathExpressionType.cs @@ -1,8 +1,11 @@ -namespace umbraco.editorControls.MultiNodeTreePicker +using System; + +namespace umbraco.editorControls.MultiNodeTreePicker { /// /// An enumerator for the XPath expression. /// + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public enum XPathExpressionType { /// diff --git a/src/umbraco.editorControls/MultiNodeTreePicker/XPathFilterType.cs b/src/umbraco.editorControls/MultiNodeTreePicker/XPathFilterType.cs index 4f4a983425..8c361669c2 100644 --- a/src/umbraco.editorControls/MultiNodeTreePicker/XPathFilterType.cs +++ b/src/umbraco.editorControls/MultiNodeTreePicker/XPathFilterType.cs @@ -1,8 +1,11 @@ -namespace umbraco.editorControls.MultiNodeTreePicker +using System; + +namespace umbraco.editorControls.MultiNodeTreePicker { /// /// An enumerator for the XPath filter, for either enable/disable. /// + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public enum XPathFilterType { /// diff --git a/src/umbraco.editorControls/MultiNodeTreePicker/XmlTreeNodeExtensions.cs b/src/umbraco.editorControls/MultiNodeTreePicker/XmlTreeNodeExtensions.cs index 95814aa855..fe97e13f23 100644 --- a/src/umbraco.editorControls/MultiNodeTreePicker/XmlTreeNodeExtensions.cs +++ b/src/umbraco.editorControls/MultiNodeTreePicker/XmlTreeNodeExtensions.cs @@ -1,4 +1,5 @@ -using System.Linq; +using System; +using System.Linq; using System.Xml.Linq; using System.Xml.XPath; using umbraco.cms.presentation.Trees; @@ -8,6 +9,7 @@ namespace umbraco.editorControls.MultiNodeTreePicker /// /// XmlTreeNode extensions for the MultiNodeTreePicker. /// + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public static class XmlTreeNodeExtensions { //public static void DetermineSelected(this XmlTreeNode node) diff --git a/src/umbraco.editorControls/MultipleTextstring/MultipleTextstringControl.cs b/src/umbraco.editorControls/MultipleTextstring/MultipleTextstringControl.cs index 384e24144f..486cbda3fa 100644 --- a/src/umbraco.editorControls/MultipleTextstring/MultipleTextstringControl.cs +++ b/src/umbraco.editorControls/MultipleTextstring/MultipleTextstringControl.cs @@ -15,6 +15,7 @@ namespace umbraco.editorControls.MultipleTextstring /// The MultipleTextstring control sets a character limit on a TextBox. /// [ValidationProperty("IsValid")] + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class MultipleTextstringControl : PlaceHolder { /// diff --git a/src/umbraco.editorControls/MultipleTextstring/MultipleTextstringDataType.cs b/src/umbraco.editorControls/MultipleTextstring/MultipleTextstringDataType.cs index 7a94406e30..cbe7ef4686 100644 --- a/src/umbraco.editorControls/MultipleTextstring/MultipleTextstringDataType.cs +++ b/src/umbraco.editorControls/MultipleTextstring/MultipleTextstringDataType.cs @@ -7,6 +7,7 @@ namespace umbraco.editorControls.MultipleTextstring /// /// Data Editor for the Multiple Textstring data type. /// + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class MultipleTextstringDataType : AbstractDataEditor { /// diff --git a/src/umbraco.editorControls/MultipleTextstring/MultipleTextstringOptions.cs b/src/umbraco.editorControls/MultipleTextstring/MultipleTextstringOptions.cs index 170950f8b0..e04b8e4d38 100644 --- a/src/umbraco.editorControls/MultipleTextstring/MultipleTextstringOptions.cs +++ b/src/umbraco.editorControls/MultipleTextstring/MultipleTextstringOptions.cs @@ -1,4 +1,5 @@ -using System.ComponentModel; +using System; +using System.ComponentModel; using umbraco.cms.businesslogic.datatype; namespace umbraco.editorControls.MultipleTextstring @@ -6,6 +7,7 @@ namespace umbraco.editorControls.MultipleTextstring /// /// The options for the Multiple Textstring data-type. /// + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class MultipleTextstringOptions : AbstractOptions { /// diff --git a/src/umbraco.editorControls/MultipleTextstring/MultipleTextstringPrevalueEditor.cs b/src/umbraco.editorControls/MultipleTextstring/MultipleTextstringPrevalueEditor.cs index 6d0833f4af..4763b54f44 100644 --- a/src/umbraco.editorControls/MultipleTextstring/MultipleTextstringPrevalueEditor.cs +++ b/src/umbraco.editorControls/MultipleTextstring/MultipleTextstringPrevalueEditor.cs @@ -8,6 +8,7 @@ namespace umbraco.editorControls.MultipleTextstring /// /// The PreValue Editor for the Multiple Textstring data-type. /// + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class MultipleTextstringPrevalueEditor : AbstractJsonPrevalueEditor { /// diff --git a/src/umbraco.editorControls/checkboxlist/CheckBoxDataType.cs b/src/umbraco.editorControls/checkboxlist/CheckBoxDataType.cs index 12519dcd1b..7ca0878c5e 100644 --- a/src/umbraco.editorControls/checkboxlist/CheckBoxDataType.cs +++ b/src/umbraco.editorControls/checkboxlist/CheckBoxDataType.cs @@ -3,6 +3,7 @@ using Umbraco.Core; namespace umbraco.editorControls.checkboxlist { + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class checkboxListDataType : cms.businesslogic.datatype.BaseDataType, interfaces.IDataType { private interfaces.IDataEditor _Editor; diff --git a/src/umbraco.editorControls/checkboxlist/checkboxList.cs b/src/umbraco.editorControls/checkboxlist/checkboxList.cs index 10e789fb11..b05fd1bca1 100644 --- a/src/umbraco.editorControls/checkboxlist/checkboxList.cs +++ b/src/umbraco.editorControls/checkboxlist/checkboxList.cs @@ -7,6 +7,7 @@ using System.Collections.Generic; namespace umbraco.editorControls.checkboxlist { + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class checkboxlistEditor : System.Web.UI.WebControls.CheckBoxList, interfaces.IDataEditor { private String _text; diff --git a/src/umbraco.editorControls/colorpicker/ColorPickerDataType.cs b/src/umbraco.editorControls/colorpicker/ColorPickerDataType.cs index 1bdf605118..1692f41848 100644 --- a/src/umbraco.editorControls/colorpicker/ColorPickerDataType.cs +++ b/src/umbraco.editorControls/colorpicker/ColorPickerDataType.cs @@ -6,6 +6,7 @@ namespace umbraco.editorControls.colorpicker /// /// Summary description for ColorPickerDataType. /// + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class ColorPickerDataType : cms.businesslogic.datatype.BaseDataType, interfaces.IDataType { private interfaces.IDataEditor _Editor; diff --git a/src/umbraco.editorControls/colorpicker/colorPicker.cs b/src/umbraco.editorControls/colorpicker/colorPicker.cs index c8a0626917..5c6200acd6 100644 --- a/src/umbraco.editorControls/colorpicker/colorPicker.cs +++ b/src/umbraco.editorControls/colorpicker/colorPicker.cs @@ -11,9 +11,7 @@ namespace umbraco.editorControls /// /// Summary description for colorPicker. /// - [DefaultProperty("Value"), - ValidationProperty("Value"), - ToolboxData("<{0}:colorPicker runat=server>")] + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class colorPicker : System.Web.UI.WebControls.HiddenField, interfaces.IDataEditor { private interfaces.IData _data; diff --git a/src/umbraco.editorControls/datefieldmultiple/DataTypeDatefieldMultiple.cs b/src/umbraco.editorControls/datefieldmultiple/DataTypeDatefieldMultiple.cs index b54cfb7a42..966dbafe80 100644 --- a/src/umbraco.editorControls/datefieldmultiple/DataTypeDatefieldMultiple.cs +++ b/src/umbraco.editorControls/datefieldmultiple/DataTypeDatefieldMultiple.cs @@ -6,6 +6,7 @@ namespace umbraco.editorControls.datefieldmultiple /// /// Summary description for DataTypeDatefieldMultiple. /// + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class DataTypeDatefieldMultiple : datepicker.DateDataType { private interfaces.IDataEditor _Editor; diff --git a/src/umbraco.editorControls/datepicker/DateData.cs b/src/umbraco.editorControls/datepicker/DateData.cs index fe1edc7be4..56d213d992 100644 --- a/src/umbraco.editorControls/datepicker/DateData.cs +++ b/src/umbraco.editorControls/datepicker/DateData.cs @@ -5,6 +5,7 @@ namespace umbraco.editorControls.datepicker /// /// Summary description for DateData. /// + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class DateData : cms.businesslogic.datatype.DefaultData { public DateData(cms.businesslogic.datatype.BaseDataType DataType) : base(DataType) {} diff --git a/src/umbraco.editorControls/datepicker/DateDataType.cs b/src/umbraco.editorControls/datepicker/DateDataType.cs index 8d044d894a..9a83a3136c 100644 --- a/src/umbraco.editorControls/datepicker/DateDataType.cs +++ b/src/umbraco.editorControls/datepicker/DateDataType.cs @@ -6,6 +6,7 @@ namespace umbraco.editorControls.datepicker /// /// Summary description for DateDataType. /// + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class DateDataType : cms.businesslogic.datatype.BaseDataType,interfaces.IDataType { private interfaces.IDataEditor _Editor; diff --git a/src/umbraco.editorControls/datepicker/dateField.cs b/src/umbraco.editorControls/datepicker/dateField.cs index 2d5cf57793..cb35dd8b20 100644 --- a/src/umbraco.editorControls/datepicker/dateField.cs +++ b/src/umbraco.editorControls/datepicker/dateField.cs @@ -11,9 +11,7 @@ namespace umbraco.editorControls /// /// Summary description for dateField. /// - [DefaultProperty("Text"), - ToolboxData("<{0}:dateField runat=server>")] - [ValidationProperty("Text")] + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class dateField : DateTimePicker, interfaces.IDataEditor { diff --git a/src/umbraco.editorControls/dictionaryPicker/dictionaryPicker.cs b/src/umbraco.editorControls/dictionaryPicker/dictionaryPicker.cs index 6dbc1f31ed..ae4721e328 100644 --- a/src/umbraco.editorControls/dictionaryPicker/dictionaryPicker.cs +++ b/src/umbraco.editorControls/dictionaryPicker/dictionaryPicker.cs @@ -7,6 +7,7 @@ namespace umbraco.editorControls.dictionaryPicker /// /// Summary description for dictionaryPicker. /// + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class dictionaryPicker : System.Web.UI.WebControls.CheckBoxList, interfaces.IDataEditor { private interfaces.IData _data; diff --git a/src/umbraco.editorControls/dictionaryPicker/dictionaryPickerDataType.cs b/src/umbraco.editorControls/dictionaryPicker/dictionaryPickerDataType.cs index c0a1fb8cb9..f67e5d35b2 100644 --- a/src/umbraco.editorControls/dictionaryPicker/dictionaryPickerDataType.cs +++ b/src/umbraco.editorControls/dictionaryPicker/dictionaryPickerDataType.cs @@ -6,6 +6,7 @@ namespace umbraco.editorControls.dictionaryPicker /// /// Summary description for dictionaryPickerDataType. /// + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class dictionaryPickerDataType : cms.businesslogic.datatype.BaseDataType, interfaces.IDataType { diff --git a/src/umbraco.editorControls/dropdownlist/DropDownDataType.cs b/src/umbraco.editorControls/dropdownlist/DropDownDataType.cs index 56bd43a89f..af05a06030 100644 --- a/src/umbraco.editorControls/dropdownlist/DropDownDataType.cs +++ b/src/umbraco.editorControls/dropdownlist/DropDownDataType.cs @@ -6,6 +6,7 @@ namespace umbraco.editorControls.dropdownlist /// /// Summary description for ColorPickerDataType. /// + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class DropdownListDataType : cms.businesslogic.datatype.BaseDataType, interfaces.IDataType { private interfaces.IDataEditor _Editor; diff --git a/src/umbraco.editorControls/dropdownlist/dropDownKeysDataType.cs b/src/umbraco.editorControls/dropdownlist/dropDownKeysDataType.cs index a4308a031d..6f0848ae8d 100644 --- a/src/umbraco.editorControls/dropdownlist/dropDownKeysDataType.cs +++ b/src/umbraco.editorControls/dropdownlist/dropDownKeysDataType.cs @@ -6,6 +6,7 @@ namespace umbraco.editorControls.dropdownlist /// /// Summary description for ColorPickerDataType. /// + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class DropdownListKeysDataType : cms.businesslogic.datatype.BaseDataType, interfaces.IDataType { private interfaces.IDataEditor _Editor; diff --git a/src/umbraco.editorControls/dropdownlist/dropdown.cs b/src/umbraco.editorControls/dropdownlist/dropdown.cs index f4d887cfb4..b14ced4d05 100644 --- a/src/umbraco.editorControls/dropdownlist/dropdown.cs +++ b/src/umbraco.editorControls/dropdownlist/dropdown.cs @@ -10,6 +10,7 @@ using System.Collections.Generic; namespace umbraco.editorControls { + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class dropdown : System.Web.UI.WebControls.DropDownList, interfaces.IDataEditor { private interfaces.IData _data; diff --git a/src/umbraco.editorControls/folderbrowser/DataTypeFolderbrowser.cs b/src/umbraco.editorControls/folderbrowser/DataTypeFolderbrowser.cs index ae24df2aad..cd13412e5c 100644 --- a/src/umbraco.editorControls/folderbrowser/DataTypeFolderbrowser.cs +++ b/src/umbraco.editorControls/folderbrowser/DataTypeFolderbrowser.cs @@ -6,9 +6,7 @@ namespace umbraco.editorControls.folderbrowser /// /// Summary description for DataTypeFolderbrowser. /// - /// - /// Summary description for DataTypeUploadField. - /// + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class DataTypeFolderBrowser : cms.businesslogic.datatype.BaseDataType, interfaces.IDataType { private interfaces.IDataEditor _editor; diff --git a/src/umbraco.editorControls/folderbrowser/folderBrowser.cs b/src/umbraco.editorControls/folderbrowser/folderBrowser.cs index 47037d8068..2bb2f55f0f 100644 --- a/src/umbraco.editorControls/folderbrowser/folderBrowser.cs +++ b/src/umbraco.editorControls/folderbrowser/folderBrowser.cs @@ -8,6 +8,7 @@ namespace umbraco.editorControls /// /// Summary description for folderBrowser. /// + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class folderBrowser : WebControl, interfaces.IDataEditor { public Control Editor { get { return this; } } diff --git a/src/umbraco.editorControls/imagecropper/Config.cs b/src/umbraco.editorControls/imagecropper/Config.cs index 1ee4be2f51..c3be870769 100644 --- a/src/umbraco.editorControls/imagecropper/Config.cs +++ b/src/umbraco.editorControls/imagecropper/Config.cs @@ -3,6 +3,7 @@ using System.Collections; namespace umbraco.editorControls.imagecropper { + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class Config { public string UploadPropertyAlias { get; set; } diff --git a/src/umbraco.editorControls/imagecropper/Data.cs b/src/umbraco.editorControls/imagecropper/Data.cs index b8219279e7..931591b5c2 100644 --- a/src/umbraco.editorControls/imagecropper/Data.cs +++ b/src/umbraco.editorControls/imagecropper/Data.cs @@ -1,5 +1,8 @@ -namespace umbraco.editorControls.imagecropper +using System; + +namespace umbraco.editorControls.imagecropper { + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] struct Crop { public int X; @@ -16,6 +19,7 @@ } } + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] enum DefaultCropPosition { CenterCenter = 0, @@ -29,6 +33,7 @@ RightBottom } + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] struct Preset { public string Name; diff --git a/src/umbraco.editorControls/imagecropper/DataEditor.cs b/src/umbraco.editorControls/imagecropper/DataEditor.cs index 62c83a2383..f5820fb853 100644 --- a/src/umbraco.editorControls/imagecropper/DataEditor.cs +++ b/src/umbraco.editorControls/imagecropper/DataEditor.cs @@ -11,6 +11,7 @@ using umbraco.cms.businesslogic.web; namespace umbraco.editorControls.imagecropper { + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class DataEditor : PlaceHolder, umbraco.interfaces.IDataEditor { private umbraco.interfaces.IData data; diff --git a/src/umbraco.editorControls/imagecropper/DataType.cs b/src/umbraco.editorControls/imagecropper/DataType.cs index f0320dd395..44722d4363 100644 --- a/src/umbraco.editorControls/imagecropper/DataType.cs +++ b/src/umbraco.editorControls/imagecropper/DataType.cs @@ -4,6 +4,7 @@ using Umbraco.Core; namespace umbraco.editorControls.imagecropper { + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class DataType : umbraco.cms.businesslogic.datatype.BaseDataType, umbraco.interfaces.IDataType { private umbraco.interfaces.IDataEditor _editor; diff --git a/src/umbraco.editorControls/imagecropper/DataTypeData.cs b/src/umbraco.editorControls/imagecropper/DataTypeData.cs index 9c68edb04d..7c772b4c47 100644 --- a/src/umbraco.editorControls/imagecropper/DataTypeData.cs +++ b/src/umbraco.editorControls/imagecropper/DataTypeData.cs @@ -1,7 +1,9 @@ -using System.Xml; +using System; +using System.Xml; namespace umbraco.editorControls.imagecropper { + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class DataTypeData : umbraco.cms.businesslogic.datatype.DefaultData { public DataTypeData(umbraco.cms.businesslogic.datatype.BaseDataType DataType) : base(DataType) { } diff --git a/src/umbraco.editorControls/imagecropper/Helper.cs b/src/umbraco.editorControls/imagecropper/Helper.cs index 1294ae367e..da3b732d8a 100644 --- a/src/umbraco.editorControls/imagecropper/Helper.cs +++ b/src/umbraco.editorControls/imagecropper/Helper.cs @@ -1,8 +1,10 @@ -using System.IO; +using System; +using System.IO; using System.Xml.Serialization; namespace umbraco.editorControls.imagecropper { + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] class Helper { diff --git a/src/umbraco.editorControls/imagecropper/ImageInfo.cs b/src/umbraco.editorControls/imagecropper/ImageInfo.cs index 8c4ce9fde9..08bdeab11b 100644 --- a/src/umbraco.editorControls/imagecropper/ImageInfo.cs +++ b/src/umbraco.editorControls/imagecropper/ImageInfo.cs @@ -7,6 +7,7 @@ using umbraco.IO; namespace umbraco.editorControls.imagecropper { + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class ImageInfo { public Image image { get; set; } diff --git a/src/umbraco.editorControls/imagecropper/ImageManipulation.cs b/src/umbraco.editorControls/imagecropper/ImageManipulation.cs index 9835f7b2cb..8e78209a8c 100644 --- a/src/umbraco.editorControls/imagecropper/ImageManipulation.cs +++ b/src/umbraco.editorControls/imagecropper/ImageManipulation.cs @@ -6,6 +6,7 @@ using System.IO; namespace umbraco.editorControls.imagecropper { + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class ImageTransform { public static void Execute(string sourceFile, string name, int cropX, int cropY, int cropWidth, int cropHeight, int sizeWidth, int sizeHeight, long quality) diff --git a/src/umbraco.editorControls/imagecropper/PrevalueEditor.cs b/src/umbraco.editorControls/imagecropper/PrevalueEditor.cs index 3076f96077..14334b8357 100644 --- a/src/umbraco.editorControls/imagecropper/PrevalueEditor.cs +++ b/src/umbraco.editorControls/imagecropper/PrevalueEditor.cs @@ -9,6 +9,7 @@ using umbraco.macroRenderings; namespace umbraco.editorControls.imagecropper { + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class PrevalueEditor : PlaceHolder, IDataPrevalue { private readonly umbraco.cms.businesslogic.datatype.BaseDataType _dataType; diff --git a/src/umbraco.editorControls/imagecropper/Resources.Designer.cs b/src/umbraco.editorControls/imagecropper/Resources.Designer.cs index 4cdbaf2c02..f667e28ce6 100644 --- a/src/umbraco.editorControls/imagecropper/Resources.Designer.cs +++ b/src/umbraco.editorControls/imagecropper/Resources.Designer.cs @@ -8,6 +8,8 @@ // //------------------------------------------------------------------------------ +using System; + namespace umbraco.editorControls.imagecropper { /// @@ -20,6 +22,7 @@ namespace umbraco.editorControls.imagecropper [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class Resources { private static global::System.Resources.ResourceManager resourceMan; diff --git a/src/umbraco.editorControls/imagecropper/SaveData.cs b/src/umbraco.editorControls/imagecropper/SaveData.cs index e962766b89..1ec376e2a8 100644 --- a/src/umbraco.editorControls/imagecropper/SaveData.cs +++ b/src/umbraco.editorControls/imagecropper/SaveData.cs @@ -4,6 +4,7 @@ using System.Xml; namespace umbraco.editorControls.imagecropper { + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class SaveData { public ArrayList data { get; set; } diff --git a/src/umbraco.editorControls/imagecropper/SmartListBox.cs b/src/umbraco.editorControls/imagecropper/SmartListBox.cs index 5556e78777..4616f7f9ff 100644 --- a/src/umbraco.editorControls/imagecropper/SmartListBox.cs +++ b/src/umbraco.editorControls/imagecropper/SmartListBox.cs @@ -1,7 +1,9 @@ -using System.Web.UI.WebControls; +using System; +using System.Web.UI.WebControls; namespace umbraco.editorControls.imagecropper { + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class SmartListBox : ListBox { //Moves the selected items up one level diff --git a/src/umbraco.editorControls/label/DataTypeNoEdit.cs b/src/umbraco.editorControls/label/DataTypeNoEdit.cs index 53fd7ac59c..8aeda1db1e 100644 --- a/src/umbraco.editorControls/label/DataTypeNoEdit.cs +++ b/src/umbraco.editorControls/label/DataTypeNoEdit.cs @@ -6,6 +6,7 @@ namespace umbraco.editorControls.label /// /// Summary description for DataTypeNoEdit. /// + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class DataTypeNoEdit : cms.businesslogic.datatype.BaseDataType,interfaces.IDataType { diff --git a/src/umbraco.editorControls/label/noEdit.cs b/src/umbraco.editorControls/label/noEdit.cs index 9c791c32c5..3bb932bc93 100644 --- a/src/umbraco.editorControls/label/noEdit.cs +++ b/src/umbraco.editorControls/label/noEdit.cs @@ -4,6 +4,7 @@ using System.Web.UI.WebControls; namespace umbraco.editorControls { + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class noEdit : System.Web.UI.WebControls.Label, interfaces.IDataEditor { private interfaces.IData _data; diff --git a/src/umbraco.editorControls/listbox/ListBoxDataType.cs b/src/umbraco.editorControls/listbox/ListBoxDataType.cs index 2494ab329d..fa040d3266 100644 --- a/src/umbraco.editorControls/listbox/ListBoxDataType.cs +++ b/src/umbraco.editorControls/listbox/ListBoxDataType.cs @@ -6,6 +6,7 @@ namespace umbraco.editorControls.listbox /// /// Summary description for ColorPickerDataType. /// + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class ListBoxDataType : cms.businesslogic.datatype.BaseDataType, interfaces.IDataType { private interfaces.IDataEditor _Editor; diff --git a/src/umbraco.editorControls/listbox/ListBoxKeysDataType.cs b/src/umbraco.editorControls/listbox/ListBoxKeysDataType.cs index ff21619e2a..de6de46bca 100644 --- a/src/umbraco.editorControls/listbox/ListBoxKeysDataType.cs +++ b/src/umbraco.editorControls/listbox/ListBoxKeysDataType.cs @@ -6,6 +6,7 @@ namespace umbraco.editorControls.listbox /// /// Summary description for ColorPickerDataType. /// + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class ListBoxKeysDataType : cms.businesslogic.datatype.BaseDataType, interfaces.IDataType { private interfaces.IDataEditor _Editor; diff --git a/src/umbraco.editorControls/listbox/dropdownMultiple.cs b/src/umbraco.editorControls/listbox/dropdownMultiple.cs index 2147430516..b547dc9550 100644 --- a/src/umbraco.editorControls/listbox/dropdownMultiple.cs +++ b/src/umbraco.editorControls/listbox/dropdownMultiple.cs @@ -10,6 +10,7 @@ namespace umbraco.editorControls /// /// Summary description for dropdownMultiple. /// + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class dropdownMultiple : System.Web.UI.WebControls.ListBox, interfaces.IDataEditor { private String _text; diff --git a/src/umbraco.editorControls/macrocontainer/DataType.cs b/src/umbraco.editorControls/macrocontainer/DataType.cs index 763930bee0..4b5b5998f4 100644 --- a/src/umbraco.editorControls/macrocontainer/DataType.cs +++ b/src/umbraco.editorControls/macrocontainer/DataType.cs @@ -6,6 +6,7 @@ using Umbraco.Core; namespace umbraco.editorControls.macrocontainer { + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class DataType : cms.businesslogic.datatype.BaseDataType, interfaces.IDataType { diff --git a/src/umbraco.editorControls/macrocontainer/Editor.cs b/src/umbraco.editorControls/macrocontainer/Editor.cs index d4cbdeaeca..2294b1ff2a 100644 --- a/src/umbraco.editorControls/macrocontainer/Editor.cs +++ b/src/umbraco.editorControls/macrocontainer/Editor.cs @@ -19,6 +19,7 @@ namespace umbraco.editorControls.macrocontainer [ClientDependency(ClientDependencyType.Javascript, "ui/jqueryui.js", "UmbracoClient")] [ClientDependency(ClientDependencyType.Css, "macroContainer/macroContainer.css", "UmbracoClient")] + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class Editor : UpdatePanel, IDataEditor { private IData _data; diff --git a/src/umbraco.editorControls/macrocontainer/MacroContainerEvent.cs b/src/umbraco.editorControls/macrocontainer/MacroContainerEvent.cs index 5ceb848cdb..ae774d2de7 100644 --- a/src/umbraco.editorControls/macrocontainer/MacroContainerEvent.cs +++ b/src/umbraco.editorControls/macrocontainer/MacroContainerEvent.cs @@ -5,6 +5,7 @@ using System.Text; namespace umbraco.editorControls.macrocontainer { + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public static class MacroContainerEvent { public delegate void ExecuteHandler(); diff --git a/src/umbraco.editorControls/macrocontainer/MacroEditor.cs b/src/umbraco.editorControls/macrocontainer/MacroEditor.cs index a3dd15c849..e6a13d8b0c 100644 --- a/src/umbraco.editorControls/macrocontainer/MacroEditor.cs +++ b/src/umbraco.editorControls/macrocontainer/MacroEditor.cs @@ -14,6 +14,7 @@ using System.Web; namespace umbraco.editorControls.macrocontainer { + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class MacroEditor : System.Web.UI.Control { private List _allowedMacros; diff --git a/src/umbraco.editorControls/macrocontainer/PrevalueEditor.cs b/src/umbraco.editorControls/macrocontainer/PrevalueEditor.cs index 2b99d77650..b8aab80f5f 100644 --- a/src/umbraco.editorControls/macrocontainer/PrevalueEditor.cs +++ b/src/umbraco.editorControls/macrocontainer/PrevalueEditor.cs @@ -11,6 +11,7 @@ using System.Web.UI; namespace umbraco.editorControls.macrocontainer { + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class PrevalueEditor : System.Web.UI.WebControls.PlaceHolder, umbraco.interfaces.IDataPrevalue { diff --git a/src/umbraco.editorControls/mediapicker/MediaPickerDataType.cs b/src/umbraco.editorControls/mediapicker/MediaPickerDataType.cs index 03af12e828..b652c8b5a3 100644 --- a/src/umbraco.editorControls/mediapicker/MediaPickerDataType.cs +++ b/src/umbraco.editorControls/mediapicker/MediaPickerDataType.cs @@ -3,6 +3,7 @@ using Umbraco.Core; namespace umbraco.editorControls.mediapicker { + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class MediaPickerDataType : cms.businesslogic.datatype.BaseDataType, interfaces.IDataType { private interfaces.IDataEditor _editor; diff --git a/src/umbraco.editorControls/mediapicker/MediaPickerPrevalueEditor.cs b/src/umbraco.editorControls/mediapicker/MediaPickerPrevalueEditor.cs index baf918d781..674d7d69aa 100644 --- a/src/umbraco.editorControls/mediapicker/MediaPickerPrevalueEditor.cs +++ b/src/umbraco.editorControls/mediapicker/MediaPickerPrevalueEditor.cs @@ -14,6 +14,7 @@ using umbraco.editorControls; namespace umbraco.editorControls.mediapicker { + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class MediaPickerPrevalueEditor : System.Web.UI.WebControls.PlaceHolder, umbraco.interfaces.IDataPrevalue { diff --git a/src/umbraco.editorControls/mediapicker/mediaChooser.cs b/src/umbraco.editorControls/mediapicker/mediaChooser.cs index e523298120..b6a441bce6 100644 --- a/src/umbraco.editorControls/mediapicker/mediaChooser.cs +++ b/src/umbraco.editorControls/mediapicker/mediaChooser.cs @@ -14,6 +14,7 @@ namespace umbraco.editorControls /// Summary description for mediaChooser. /// [ValidationProperty("Value")] + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class mediaChooser : BaseTreePickerEditor { readonly bool _showpreview; diff --git a/src/umbraco.editorControls/memberpicker/MemberPickerDataType.cs b/src/umbraco.editorControls/memberpicker/MemberPickerDataType.cs index 1041160b0a..ece8448d87 100644 --- a/src/umbraco.editorControls/memberpicker/MemberPickerDataType.cs +++ b/src/umbraco.editorControls/memberpicker/MemberPickerDataType.cs @@ -3,6 +3,7 @@ using Umbraco.Core; namespace umbraco.editorControls.memberpicker { + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class MemberPickerDataType : cms.businesslogic.datatype.BaseDataType, interfaces.IDataType { private interfaces.IDataEditor _editor; diff --git a/src/umbraco.editorControls/memberpicker/memberPicker.cs b/src/umbraco.editorControls/memberpicker/memberPicker.cs index 63e7844638..358c7e7cf7 100644 --- a/src/umbraco.editorControls/memberpicker/memberPicker.cs +++ b/src/umbraco.editorControls/memberpicker/memberPicker.cs @@ -12,6 +12,7 @@ namespace umbraco.editorControls /// /// Summary description for memberPicker. /// + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class memberPicker : System.Web.UI.WebControls.DropDownList, interfaces.IDataEditor { diff --git a/src/umbraco.editorControls/numberfield/DataInteger.cs b/src/umbraco.editorControls/numberfield/DataInteger.cs index 2fc4be2d5a..540862b6e9 100644 --- a/src/umbraco.editorControls/numberfield/DataInteger.cs +++ b/src/umbraco.editorControls/numberfield/DataInteger.cs @@ -5,6 +5,7 @@ namespace umbraco.editorControls.numberfield /// /// Summary description for DataInteger. /// + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class DataInteger : cms.businesslogic.datatype.DefaultData { public DataInteger(cms.businesslogic.datatype.BaseDataType DataType) : base(DataType) {} diff --git a/src/umbraco.editorControls/numberfield/DataTypeInteger.cs b/src/umbraco.editorControls/numberfield/DataTypeInteger.cs index 728c88cb21..f9d06af306 100644 --- a/src/umbraco.editorControls/numberfield/DataTypeInteger.cs +++ b/src/umbraco.editorControls/numberfield/DataTypeInteger.cs @@ -6,6 +6,7 @@ namespace umbraco.editorControls.numberfield /// /// Summary description for IDataTypenteger. /// + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class IDataTypenteger : cms.businesslogic.datatype.BaseDataType,interfaces.IDataType { private interfaces.IDataEditor _Editor; diff --git a/src/umbraco.editorControls/numberfield/numberField.cs b/src/umbraco.editorControls/numberfield/numberField.cs index a3f15ddb5b..312377af05 100644 --- a/src/umbraco.editorControls/numberfield/numberField.cs +++ b/src/umbraco.editorControls/numberfield/numberField.cs @@ -5,6 +5,7 @@ using System.Globalization; namespace umbraco.editorControls { + [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class numberField : TextBox, interfaces.IDataEditor { private interfaces.IData _data; From b3914c4eaa14896f6042bf9b7eaec639506d49e3 Mon Sep 17 00:00:00 2001 From: Tim Geyssens Date: Wed, 25 Sep 2013 11:17:32 +0200 Subject: [PATCH 12/17] Embed rte plugin: changes icon --- .../src/common/services/tinymce.service.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js b/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js index 3387b44b91..93ee0d1f1d 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js @@ -22,7 +22,7 @@ function tinyMceService(dialogService, $log, imageHelper, assetsService, $timeou */ createInsertEmbeddedMedia: function (editor, $scope) { editor.addButton('umbembeddialog', { - icon: 'media', + icon: 'custom icon-tv', tooltip: 'Embed', onclick: function () { dialogService.embedDialog({ From ab2b91610390cb86d53e5b4b11bfe31955ea7097 Mon Sep 17 00:00:00 2001 From: Tim Geyssens Date: Wed, 25 Sep 2013 11:21:10 +0200 Subject: [PATCH 13/17] Embed rte plugin: adds cancel button to dialog --- src/Umbraco.Web.UI.Client/src/views/common/dialogs/rteembed.html | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/rteembed.html b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/rteembed.html index 27470349c4..751fdfd0a9 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/rteembed.html +++ b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/rteembed.html @@ -3,6 +3,7 @@
+
From 1e9a17babe4ab8217772f5491ace3872ffb05f59 Mon Sep 17 00:00:00 2001 From: Shannon Date: Wed, 25 Sep 2013 19:23:41 +1000 Subject: [PATCH 14/17] Fixes merge issues, fixes up some unit tests, removes the For config section stuff and simplifies the singleton, refactors it with methods as per discussion with stephen. --- src/Umbraco.Core/ApplicationContext.cs | 3 +- .../Cache/HttpRuntimeCacheProvider.cs | 11 +- .../Configuration/UmbracoConfig.cs | 100 +++++++++++ .../Configuration/UmbracoConfiguration.cs | 158 ------------------ src/Umbraco.Core/IO/IOHelper.cs | 2 +- src/Umbraco.Core/IO/MediaFileSystem.cs | 2 +- src/Umbraco.Core/IO/UmbracoMediaFile.cs | 2 +- src/Umbraco.Core/Models/ContentExtensions.cs | 8 +- src/Umbraco.Core/Models/PropertyExtensions.cs | 4 +- src/Umbraco.Core/Models/Script.cs | 2 +- src/Umbraco.Core/Models/Template.cs | 6 +- .../Repositories/ContentRepository.cs | 2 +- .../Repositories/MediaRepository.cs | 2 +- .../Repositories/MemberRepository.cs | 2 +- .../Repositories/RecycleBinRepository.cs | 2 +- .../Persistence/RepositoryFactory.cs | 4 +- src/Umbraco.Core/PluginManager.cs | 11 -- src/Umbraco.Core/PublishedContentHelper.cs | 2 +- .../Security/AuthenticationExtensions.cs | 12 +- .../Services/ContentTypeService.cs | 2 +- src/Umbraco.Core/Services/PackagingService.cs | 4 +- src/Umbraco.Core/StringExtensions.cs | 4 +- .../Strings/DefaultShortStringHelper.cs | 4 +- .../Strings/LegacyShortStringHelper.cs | 8 +- .../Sync/ConfigServerRegistrar.cs | 2 +- .../Sync/DefaultServerMessenger.cs | 4 +- src/Umbraco.Core/Umbraco.Core.csproj | 2 +- src/Umbraco.Core/XmlHelper.cs | 4 +- .../ContentTypeDefinitionFactory.cs | 2 +- .../Configurations/FileSystemProviderTests.cs | 34 +--- .../UmbracoSettings/UmbracoSettingsTests.cs | 2 +- .../UmbracoSettings/WebRoutingElementTests.cs | 2 +- src/Umbraco.Tests/LibraryTests.cs | 2 +- .../TestHelpers/SettingsForTests.cs | 13 +- src/Umbraco.Tests/XmlHelperTests.cs | 2 +- .../install/steps/DefaultUser.ascx.cs | 8 +- .../umbraco/dialogs/editMacro.aspx | 2 +- .../umbraco/settings/editTemplate.aspx | 2 +- src/Umbraco.Web/BaseRest/BaseRestHandler.cs | 2 +- .../BaseRest/RestExtensionMethodInfo.cs | 2 +- .../Cache/DistributedCacheExtensions.cs | 2 +- .../Editors/BackOfficeController.cs | 2 +- src/Umbraco.Web/HtmlHelperRenderExtensions.cs | 2 +- src/Umbraco.Web/LegacyScheduledTasks.cs | 8 +- .../ImageUrlProviders/ImageUrlProvider.cs | 2 +- src/Umbraco.Web/Models/XmlPublishedContent.cs | 6 +- .../Models/XmlPublishedContentProperty.cs | 2 +- src/Umbraco.Web/Mvc/UmbracoViewPage.cs | 2 +- .../FileUploadPropertyEditor.cs | 2 +- .../FileUploadPropertyValueEditor.cs | 4 +- .../PublishedContentCache.cs | 2 +- .../XmlPublishedCache/PublishedMediaCache.cs | 2 +- .../Routing/ContentFinderByUrlAlias.cs | 2 +- src/Umbraco.Web/Routing/DefaultUrlProvider.cs | 2 +- .../Routing/PublishedContentRequest.cs | 2 +- .../Routing/PublishedContentRequestEngine.cs | 2 +- src/Umbraco.Web/Routing/UrlProvider.cs | 2 +- src/Umbraco.Web/Security/WebSecurity.cs | 4 +- .../DataTypes/LegacyUploadFieldWorkaround.cs | 8 +- .../Templates/TemplateUtilities.cs | 2 +- src/Umbraco.Web/UmbracoModule.cs | 4 +- src/Umbraco.Web/UriUtility.cs | 2 +- src/Umbraco.Web/WebBootManager.cs | 2 +- .../umbraco.presentation/NotFoundHandlers.cs | 6 +- .../umbraco.presentation/UmbracoContext.cs | 2 +- .../umbraco.presentation/content.cs | 30 ++-- .../umbraco.presentation/default.aspx.cs | 6 +- .../umbraco.presentation/helper.cs | 2 +- src/Umbraco.Web/umbraco.presentation/item.cs | 4 +- .../umbraco.presentation/library.cs | 22 +-- src/Umbraco.Web/umbraco.presentation/macro.cs | 12 +- .../umbraco.presentation/publishingService.cs | 2 +- .../umbraco.presentation/requestModule.cs | 12 +- .../umbraco.presentation/template.cs | 6 +- .../ActionHandlers/umbEnsureUniqueName.cs | 2 +- .../umbraco/Trees/loadTemplates.cs | 4 +- .../umbraco/Trees/loadUsers.cs | 4 +- .../umbraco/channels/UmbracoMetaWeblogAPI.cs | 6 +- .../umbraco/controls/ContentControl.cs | 2 +- .../GenericProperties/GenericProperty.ascx.cs | 2 +- .../umbraco/controls/macroParameterControl.cs | 2 +- .../umbraco/create/MediaTypeTasks.cs | 2 +- .../umbraco/create/nodetypeTasks.cs | 2 +- .../umbraco/create/script.ascx.cs | 2 +- .../umbraco/create/templateTasks.cs | 2 +- .../umbraco/create/userTasks.cs | 6 +- .../umbraco/create/xslt.ascx.cs | 4 +- .../umbraco/dashboard/ChangePassword.ascx.cs | 2 +- .../Packages/BrowseRepository.aspx.cs | 2 +- .../developer/Packages/LoadNitros.ascx.cs | 2 +- .../developer/Xslt/xsltInsertValueOf.aspx.cs | 2 +- .../umbraco/dialogs/umbracoField.aspx.cs | 2 +- .../umbraco/login.aspx.cs | 6 +- .../umbraco/nodeFactory/Node.cs | 6 +- .../umbraco/nodeFactory/Page_Legacy.cs | 8 +- .../umbraco/nodeFactory/Property.cs | 2 +- .../umbraco/settings/editTemplate.aspx.cs | 2 +- .../settings/scripts/editScript.aspx.cs | 6 +- .../umbraco/translation/default.aspx.cs | 2 +- .../umbraco/translation/xml.aspx.cs | 2 +- .../umbraco/uQuery/uQuery.cs | 2 +- .../umbraco/users/EditUser.aspx.cs | 10 +- .../umbraco/webservices/MediaUploader.ashx.cs | 2 +- .../webservices/codeEditorSave.asmx.cs | 6 +- .../viewstateMoverModule.cs | 2 +- .../RazorDynamicNode/DynamicNode.cs | 4 +- src/umbraco.businesslogic/Log.cs | 20 +-- src/umbraco.businesslogic/UmbracoSettings.cs | 98 +++++------ src/umbraco.cms/businesslogic/Content.cs | 4 +- .../PackageActions/addStringToHtmlElement.cs | 4 +- .../Packager/Repositories/Repository.cs | 6 +- .../businesslogic/Property/Property.cs | 4 +- .../businesslogic/datatype/FileHandlerData.cs | 12 +- src/umbraco.cms/businesslogic/media/Media.cs | 2 +- .../media/UmbracoMediaFactory.cs | 2 +- .../businesslogic/member/Member.cs | 2 +- .../businesslogic/template/Template.cs | 8 +- src/umbraco.cms/businesslogic/web/Document.cs | 4 +- .../businesslogic/web/DocumentType.cs | 2 +- .../businesslogic/workflow/Notification.cs | 4 +- src/umbraco.cms/helpers/xhtml.cs | 2 +- src/umbraco.controls/CodeArea.cs | 2 +- .../tinyMCE3/TinyMCE.cs | 2 +- .../tinymce/tinyMCEImageHelper.cs | 2 +- .../uploadfield/uploadField.cs | 2 +- 125 files changed, 397 insertions(+), 509 deletions(-) create mode 100644 src/Umbraco.Core/Configuration/UmbracoConfig.cs delete mode 100644 src/Umbraco.Core/Configuration/UmbracoConfiguration.cs diff --git a/src/Umbraco.Core/ApplicationContext.cs b/src/Umbraco.Core/ApplicationContext.cs index 45901847eb..e73bdb9e46 100644 --- a/src/Umbraco.Core/ApplicationContext.cs +++ b/src/Umbraco.Core/ApplicationContext.cs @@ -65,10 +65,9 @@ namespace Umbraco.Core // note - the original umbraco module checks on content.Instance in umbraco.dll // now, the boot task that setup the content store ensures that it is ready bool _isReady = false; - readonly System.Threading.ManualResetEventSlim _isReadyEvent = new System.Threading.ManualResetEventSlim(false); + readonly ManualResetEventSlim _isReadyEvent = new ManualResetEventSlim(false); private DatabaseContext _databaseContext; private ServiceContext _services; - private UmbracoConfiguration _umbracoConfiguration; public bool IsReady { diff --git a/src/Umbraco.Core/Cache/HttpRuntimeCacheProvider.cs b/src/Umbraco.Core/Cache/HttpRuntimeCacheProvider.cs index 5ded474d83..9838f8d1e6 100644 --- a/src/Umbraco.Core/Cache/HttpRuntimeCacheProvider.cs +++ b/src/Umbraco.Core/Cache/HttpRuntimeCacheProvider.cs @@ -1,4 +1,5 @@ using System; +using System.Collections; using System.Linq; using System.Threading; using System.Web; @@ -23,6 +24,11 @@ namespace Umbraco.Core.Cache } protected override DictionaryCacheWrapper DictionaryCache + { + get { return _wrapper; } + } + + /// /// Clears all objects in the System.Web.Cache with the System.Type specified that satisfy the predicate /// public override void ClearCacheObjectTypes(Func predicate) @@ -49,11 +55,6 @@ namespace Umbraco.Core.Cache } } - /// - { - get { return _wrapper; } - } - /// /// Gets (and adds if necessary) an item from the cache with all of the default parameters /// diff --git a/src/Umbraco.Core/Configuration/UmbracoConfig.cs b/src/Umbraco.Core/Configuration/UmbracoConfig.cs new file mode 100644 index 0000000000..4bdadc0a29 --- /dev/null +++ b/src/Umbraco.Core/Configuration/UmbracoConfig.cs @@ -0,0 +1,100 @@ +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Configuration; +using System.Linq; +using System.Threading; +using Umbraco.Core.Configuration.BaseRest; +using Umbraco.Core.Configuration.UmbracoSettings; +using Umbraco.Core.Logging; + +namespace Umbraco.Core.Configuration +{ + /// + /// The gateway to all umbraco configuration + /// + public class UmbracoConfig + { + #region Singleton + + private static readonly Lazy Lazy = new Lazy(() => new UmbracoConfig()); + + public static UmbracoConfig For + { + get { return Lazy.Value; } + } + + #endregion + + /// + /// Default constructor + /// + private UmbracoConfig() + { + if (UmbracoSettings() == null) + { + var umbracoSettings = ConfigurationManager.GetSection("umbracoConfiguration/settings") as IUmbracoSettingsSection; + if (umbracoSettings == null) + { + LogHelper.Warn("Could not load the " + typeof(IUmbracoSettingsSection) + " from config file!"); + } + SetUmbracoSettings(umbracoSettings); + } + + if (BaseRestExtensions() == null) + { + var baseRestExtensions = ConfigurationManager.GetSection("umbracoConfiguration/BaseRestExtensions") as IBaseRestSection; + if (baseRestExtensions == null) + { + LogHelper.Warn("Could not load the " + typeof(IBaseRestSection) + " from config file!"); + } + SetBaseRestExtensions(baseRestExtensions); + } + } + + /// + /// Constructor - can be used for testing + /// + /// + /// + public UmbracoConfig(IUmbracoSettingsSection umbracoSettings, IBaseRestSection baseRestSettings) + { + SetUmbracoSettings(umbracoSettings); + SetBaseRestExtensions(baseRestSettings); + } + + private IUmbracoSettingsSection _umbracoSettings; + + //ONLY for unit testing + internal void SetUmbracoSettings(IUmbracoSettingsSection value) + { + _umbracoSettings = value; + } + + /// + /// Gets the IUmbracoSettings + /// + public IUmbracoSettingsSection UmbracoSettings() + { + return _umbracoSettings; + } + + private IBaseRestSection _baseRestExtensions; + + //ONLY for unit testing + public void SetBaseRestExtensions(IBaseRestSection value) + { + _baseRestExtensions = value; + } + + /// + /// Gets the IBaseRestSection + /// + public IBaseRestSection BaseRestExtensions() + { + return _baseRestExtensions; + } + + //TODO: Add other configurations here ! + } +} \ No newline at end of file diff --git a/src/Umbraco.Core/Configuration/UmbracoConfiguration.cs b/src/Umbraco.Core/Configuration/UmbracoConfiguration.cs deleted file mode 100644 index 1400aad2f2..0000000000 --- a/src/Umbraco.Core/Configuration/UmbracoConfiguration.cs +++ /dev/null @@ -1,158 +0,0 @@ -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Configuration; -using System.Linq; -using System.Threading; -using Umbraco.Core.Configuration.BaseRest; -using Umbraco.Core.Configuration.UmbracoSettings; -using Umbraco.Core.Logging; - -namespace Umbraco.Core.Configuration -{ - /// - /// The gateway to all umbraco configuration - /// - public class UmbracoConfiguration - { - #region Singleton - - private static readonly Lazy Lazy = new Lazy(() => new UmbracoConfiguration()); - - public static UmbracoConfiguration Current - { - get { return Lazy.Value; } - } - - #endregion - - #region Extensible settings - - private static readonly ConcurrentDictionary Sections = new ConcurrentDictionary(); - - - /// - /// Used for unit tests to explicitly associate an IUmbracoConfigurationSection to an implementation - /// - /// - /// - internal static void Set(T implementation) - where T : IUmbracoConfigurationSection - { - Sections.AddOrUpdate(typeof (T), type => implementation, (type, section) => implementation); - } - - /// - /// Used for unit tests to reset the resolved sections - /// - internal static void Reset() - { - Sections.Clear(); - } - - /// - /// Gets the specified UmbracoConfigurationSection. - /// - /// The type of the UmbracoConfigurationSectiont. - /// The UmbracoConfigurationSection of the specified type. - public static T For(System.Configuration.Configuration config = null) - where T : IUmbracoConfigurationSection - { - var sectionType = typeof(T); - return (T)Sections.GetOrAdd(sectionType, type => - { - //if there is no entry for this type - var configurationSections = PluginManager.Current.ResolveUmbracoConfigurationSections(); - var implementationType = configurationSections.FirstOrDefault(TypeHelper.IsTypeAssignableFrom); - if (implementationType == null) - { - throw new InvalidOperationException("Could not find an implementation for " + typeof(T)); - } - - var attr = implementationType.GetCustomAttribute(false); - if (attr == null) - throw new InvalidOperationException(string.Format("Type \"{0}\" is missing attribute ConfigurationKeyAttribute.", sectionType.FullName)); - - var sectionKey = attr.ConfigurationKey; - if (string.IsNullOrWhiteSpace(sectionKey)) - throw new InvalidOperationException(string.Format("Type \"{0}\" {1} value is null or empty.", sectionType.FullName, typeof(ConfigurationKeyAttribute))); - - var section = GetSection(sectionType, sectionKey, config); - - return (T)section; - }); - } - - private static IUmbracoConfigurationSection GetSection(Type sectionType, string key, System.Configuration.Configuration config = null) - { - var section = config == null - ? ConfigurationManager.GetSection(key) - : config.GetSection(key); - - if (section == null) - { - throw new KeyNotFoundException("Could not find/load config section: " + key); - } - - var result = section as IUmbracoConfigurationSection; - if (result == null) - { - throw new InvalidOperationException(string.Format("The section type requested '{0}' does not match the resulting section type '{1}", sectionType, section.GetType())); - } - return result; - } - - #endregion - - /// - /// Default constructor - /// - private UmbracoConfiguration() - { - if (UmbracoSettings == null) - { - var umbracoSettings = ConfigurationManager.GetSection("umbracoConfiguration/settings") as IUmbracoSettingsSection; - if (umbracoSettings == null) - { - LogHelper.Warn("Could not load the " + typeof(IUmbracoSettingsSection) + " from config file!"); - } - UmbracoSettings = umbracoSettings; - } - - if (BaseRestExtensions == null) - { - var baseRestExtensions = ConfigurationManager.GetSection("umbracoConfiguration/BaseRestExtensions") as IBaseRestSection; - if (baseRestExtensions == null) - { - LogHelper.Warn("Could not load the " + typeof(IBaseRestSection) + " from config file!"); - } - BaseRestExtensions = baseRestExtensions; - } - } - - /// - /// Constructor - can be used for testing - /// - /// - /// - public UmbracoConfiguration(IUmbracoSettingsSection umbracoSettings, IBaseRestSection baseRestSettings) - { - UmbracoSettings = umbracoSettings; - BaseRestExtensions = baseRestSettings; - } - - /// - /// Gets the IUmbracoSettings - /// - public IUmbracoSettingsSection UmbracoSettings - { - get; - //This is purely for setting for Unit tests ONLY - internal set; - } - - public IBaseRestSection BaseRestExtensions { get; private set; } - - //TODO: Add other configurations here ! - } -} \ No newline at end of file diff --git a/src/Umbraco.Core/IO/IOHelper.cs b/src/Umbraco.Core/IO/IOHelper.cs index 578dd1c859..32e8660c4b 100644 --- a/src/Umbraco.Core/IO/IOHelper.cs +++ b/src/Umbraco.Core/IO/IOHelper.cs @@ -54,7 +54,7 @@ namespace Umbraco.Core.IO [Obsolete("Use Umbraco.Web.Templates.TemplateUtilities.ResolveUrlsFromTextString instead, this method on this class will be removed in future versions")] internal static string ResolveUrlsFromTextString(string text) { - if (UmbracoConfiguration.Current.UmbracoSettings.Content.ResolveUrlsFromTextString) + if (UmbracoConfig.For.UmbracoSettings().Content.ResolveUrlsFromTextString) { using (var timer = DisposableTimer.DebugDuration(typeof(IOHelper), "ResolveUrlsFromTextString starting", "ResolveUrlsFromTextString complete")) { diff --git a/src/Umbraco.Core/IO/MediaFileSystem.cs b/src/Umbraco.Core/IO/MediaFileSystem.cs index c6877baf3f..4c2d0adbc6 100644 --- a/src/Umbraco.Core/IO/MediaFileSystem.cs +++ b/src/Umbraco.Core/IO/MediaFileSystem.cs @@ -16,7 +16,7 @@ namespace Umbraco.Core.IO private readonly IContentSection _contentConfig; public MediaFileSystem(IFileSystem wrapped) - : this(wrapped, UmbracoConfiguration.Current.UmbracoSettings.Content) + : this(wrapped, UmbracoConfig.For.UmbracoSettings().Content) { } diff --git a/src/Umbraco.Core/IO/UmbracoMediaFile.cs b/src/Umbraco.Core/IO/UmbracoMediaFile.cs index 1754a9b1a8..fafcf32dc3 100644 --- a/src/Umbraco.Core/IO/UmbracoMediaFile.cs +++ b/src/Umbraco.Core/IO/UmbracoMediaFile.cs @@ -135,7 +135,7 @@ namespace Umbraco.Core.IO { get { - return UmbracoConfiguration.Current.UmbracoSettings.Content.ImageFileTypes.InvariantContains(Extension); + return UmbracoConfig.For.UmbracoSettings().Content.ImageFileTypes.InvariantContains(Extension); } } diff --git a/src/Umbraco.Core/Models/ContentExtensions.cs b/src/Umbraco.Core/Models/ContentExtensions.cs index 7e3f5d6d1d..87af20790a 100644 --- a/src/Umbraco.Core/Models/ContentExtensions.cs +++ b/src/Umbraco.Core/Models/ContentExtensions.cs @@ -403,7 +403,7 @@ namespace Umbraco.Core.Models return; var numberedFolder = MediaSubfolderCounter.Current.Increment(); - var fileName = UmbracoConfiguration.Current.UmbracoSettings.Content.UploadAllowDirectories + var fileName = UmbracoConfig.For.UmbracoSettings().Content.UploadAllowDirectories ? Path.Combine(numberedFolder.ToString(CultureInfo.InvariantCulture), name) : numberedFolder + "-" + name; @@ -416,15 +416,15 @@ namespace Umbraco.Core.Models fs.AddFile(fileName, fileStream); //Check if file supports resizing and create thumbnails - var supportsResizing = UmbracoConfiguration.Current.UmbracoSettings.Content.ImageFileTypes.InvariantContains(extension); + var supportsResizing = UmbracoConfig.For.UmbracoSettings().Content.ImageFileTypes.InvariantContains(extension); //the config section used to auto-fill properties IImagingAutoFillUploadField uploadFieldConfigNode = null; //Check for auto fill of additional properties - if (UmbracoConfiguration.Current.UmbracoSettings.Content.ImageAutoFillProperties != null) + if (UmbracoConfig.For.UmbracoSettings().Content.ImageAutoFillProperties != null) { - uploadFieldConfigNode = UmbracoConfiguration.Current.UmbracoSettings.Content.ImageAutoFillProperties + uploadFieldConfigNode = UmbracoConfig.For.UmbracoSettings().Content.ImageAutoFillProperties .FirstOrDefault(x => x.Alias == propertyTypeAlias); } diff --git a/src/Umbraco.Core/Models/PropertyExtensions.cs b/src/Umbraco.Core/Models/PropertyExtensions.cs index a0db710ae7..d013c3d88c 100644 --- a/src/Umbraco.Core/Models/PropertyExtensions.cs +++ b/src/Umbraco.Core/Models/PropertyExtensions.cs @@ -22,13 +22,13 @@ namespace Umbraco.Core.Models internal static XElement ToXml(this Property property, IDataTypeService dataTypeService) { - var nodeName = UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema ? "data" : property.Alias.ToSafeAlias(); + var nodeName = UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema ? "data" : property.Alias.ToSafeAlias(); var xd = new XmlDocument(); var xmlNode = xd.CreateNode(XmlNodeType.Element, nodeName, ""); //Add the property alias to the legacy schema - if (UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema) + if (UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema) { var alias = xd.CreateAttribute("alias"); alias.Value = property.Alias.ToSafeAlias(); diff --git a/src/Umbraco.Core/Models/Script.cs b/src/Umbraco.Core/Models/Script.cs index b83cc245a5..431fecaebc 100644 --- a/src/Umbraco.Core/Models/Script.cs +++ b/src/Umbraco.Core/Models/Script.cs @@ -17,7 +17,7 @@ namespace Umbraco.Core.Models private readonly IContentSection _contentConfig; public Script(string path) - : this(path, UmbracoConfiguration.Current.UmbracoSettings.Content) + : this(path, UmbracoConfig.For.UmbracoSettings().Content) { } diff --git a/src/Umbraco.Core/Models/Template.cs b/src/Umbraco.Core/Models/Template.cs index 5c30b80187..bb8ff3b011 100644 --- a/src/Umbraco.Core/Models/Template.cs +++ b/src/Umbraco.Core/Models/Template.cs @@ -157,18 +157,18 @@ namespace Umbraco.Core.Models public override bool IsValid() { var exts = new List(); - if (UmbracoConfiguration.Current.UmbracoSettings.Templates.DefaultRenderingEngine == RenderingEngine.Mvc) + if (UmbracoConfig.For.UmbracoSettings().Templates.DefaultRenderingEngine == RenderingEngine.Mvc) { exts.Add("cshtml"); exts.Add("vbhtml"); } else { - exts.Add(UmbracoConfiguration.Current.UmbracoSettings.Templates.UseAspNetMasterPages ? "master" : "aspx"); + exts.Add(UmbracoConfig.For.UmbracoSettings().Templates.UseAspNetMasterPages ? "master" : "aspx"); } var dirs = SystemDirectories.Masterpages; - if (UmbracoConfiguration.Current.UmbracoSettings.Templates.DefaultRenderingEngine == RenderingEngine.Mvc) + if (UmbracoConfig.For.UmbracoSettings().Templates.DefaultRenderingEngine == RenderingEngine.Mvc) dirs += "," + SystemDirectories.MvcViews; //Validate file diff --git a/src/Umbraco.Core/Persistence/Repositories/ContentRepository.cs b/src/Umbraco.Core/Persistence/Repositories/ContentRepository.cs index 2695f1ee03..c47dc552f0 100644 --- a/src/Umbraco.Core/Persistence/Repositories/ContentRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/ContentRepository.cs @@ -464,7 +464,7 @@ namespace Umbraco.Core.Persistence.Repositories var parentDirectory = System.IO.Path.GetDirectoryName(relativeFilePath); // don't want to delete the media folder if not using directories. - if (UmbracoConfiguration.Current.UmbracoSettings.Content.UploadAllowDirectories && parentDirectory != fs.GetRelativePath("/")) + if (UmbracoConfig.For.UmbracoSettings().Content.UploadAllowDirectories && parentDirectory != fs.GetRelativePath("/")) { //issue U4-771: if there is a parent directory the recursive parameter should be true fs.DeleteDirectory(parentDirectory, String.IsNullOrEmpty(parentDirectory) == false); diff --git a/src/Umbraco.Core/Persistence/Repositories/MediaRepository.cs b/src/Umbraco.Core/Persistence/Repositories/MediaRepository.cs index f1b3324ea3..bfa22429dd 100644 --- a/src/Umbraco.Core/Persistence/Repositories/MediaRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/MediaRepository.cs @@ -342,7 +342,7 @@ namespace Umbraco.Core.Persistence.Repositories var parentDirectory = System.IO.Path.GetDirectoryName(relativeFilePath); // don't want to delete the media folder if not using directories. - if (UmbracoConfiguration.Current.UmbracoSettings.Content.UploadAllowDirectories && parentDirectory != fs.GetRelativePath("/")) + if (UmbracoConfig.For.UmbracoSettings().Content.UploadAllowDirectories && parentDirectory != fs.GetRelativePath("/")) { //issue U4-771: if there is a parent directory the recursive parameter should be true fs.DeleteDirectory(parentDirectory, String.IsNullOrEmpty(parentDirectory) == false); diff --git a/src/Umbraco.Core/Persistence/Repositories/MemberRepository.cs b/src/Umbraco.Core/Persistence/Repositories/MemberRepository.cs index 414062e211..6f060fc2e3 100644 --- a/src/Umbraco.Core/Persistence/Repositories/MemberRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/MemberRepository.cs @@ -345,7 +345,7 @@ namespace Umbraco.Core.Persistence.Repositories var parentDirectory = System.IO.Path.GetDirectoryName(relativeFilePath); // don't want to delete the media folder if not using directories. - if (UmbracoConfiguration.Current.UmbracoSettings.Content.UploadAllowDirectories && parentDirectory != fs.GetRelativePath("/")) + if (UmbracoConfig.For.UmbracoSettings().Content.UploadAllowDirectories && parentDirectory != fs.GetRelativePath("/")) { //issue U4-771: if there is a parent directory the recursive parameter should be true fs.DeleteDirectory(parentDirectory, String.IsNullOrEmpty(parentDirectory) == false); diff --git a/src/Umbraco.Core/Persistence/Repositories/RecycleBinRepository.cs b/src/Umbraco.Core/Persistence/Repositories/RecycleBinRepository.cs index 246845da0f..83c685d3fa 100644 --- a/src/Umbraco.Core/Persistence/Repositories/RecycleBinRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/RecycleBinRepository.cs @@ -132,7 +132,7 @@ namespace Umbraco.Core.Persistence.Repositories var fs = FileSystemProviderManager.Current.GetFileSystemProvider(); Parallel.ForEach(files, file => { - if (UmbracoConfiguration.Current.UmbracoSettings.Content.UploadAllowDirectories) + if (UmbracoConfig.For.UmbracoSettings().Content.UploadAllowDirectories) { var relativeFilePath = fs.GetRelativePath(file); var parentDirectory = System.IO.Path.GetDirectoryName(relativeFilePath); diff --git a/src/Umbraco.Core/Persistence/RepositoryFactory.cs b/src/Umbraco.Core/Persistence/RepositoryFactory.cs index 72ed34aeb2..dc36fd1483 100644 --- a/src/Umbraco.Core/Persistence/RepositoryFactory.cs +++ b/src/Umbraco.Core/Persistence/RepositoryFactory.cs @@ -15,13 +15,13 @@ namespace Umbraco.Core.Persistence private readonly IUmbracoSettingsSection _settings; public RepositoryFactory() - : this(false, UmbracoConfiguration.Current.UmbracoSettings) + : this(false, UmbracoConfig.For.UmbracoSettings()) { } internal RepositoryFactory(bool disableAllCache) - : this(disableAllCache, UmbracoConfiguration.Current.UmbracoSettings) + : this(disableAllCache, UmbracoConfig.For.UmbracoSettings()) { } diff --git a/src/Umbraco.Core/PluginManager.cs b/src/Umbraco.Core/PluginManager.cs index b9f6b75172..71046e943e 100644 --- a/src/Umbraco.Core/PluginManager.cs +++ b/src/Umbraco.Core/PluginManager.cs @@ -453,17 +453,6 @@ namespace Umbraco.Core return ResolveTypes(); } - /// - /// Returns all classes of type IUmbracoConfigurationSection - /// - /// - internal IEnumerable ResolveUmbracoConfigurationSections() - { - //don't cache the result since it's a one time lookup for a type anyways - //ONLY look in the CORE assembly for performance. - return ResolveTypes(false, new[] { typeof(IUmbracoConfigurationSection).Assembly }); - } - /// /// Returns all classes of type ICacheRefresher /// diff --git a/src/Umbraco.Core/PublishedContentHelper.cs b/src/Umbraco.Core/PublishedContentHelper.cs index b663f3f904..a6a3c1cadc 100644 --- a/src/Umbraco.Core/PublishedContentHelper.cs +++ b/src/Umbraco.Core/PublishedContentHelper.cs @@ -174,7 +174,7 @@ namespace Umbraco.Core var documentElement = e.Name.LocalName; //TODO: See note against this setting, pretty sure we don't need this - if (UmbracoConfiguration.Current.UmbracoSettings.Scripting.NotDynamicXmlDocumentElements.Any( + if (UmbracoConfig.For.UmbracoSettings().Scripting.NotDynamicXmlDocumentElements.Any( tag => string.Equals(tag.Element, documentElement, StringComparison.CurrentCultureIgnoreCase)) == false) { return Attempt.Succeed(new DynamicXml(e)); diff --git a/src/Umbraco.Core/Security/AuthenticationExtensions.cs b/src/Umbraco.Core/Security/AuthenticationExtensions.cs index ad20b90477..01b7639cdc 100644 --- a/src/Umbraco.Core/Security/AuthenticationExtensions.cs +++ b/src/Umbraco.Core/Security/AuthenticationExtensions.cs @@ -26,7 +26,7 @@ namespace Umbraco.Core.Security /// public static void UmbracoLogout(this HttpContextBase http) { - Logout(http, UmbracoConfiguration.Current.UmbracoSettings.Security.AuthCookieName); + Logout(http, UmbracoConfig.For.UmbracoSettings().Security.AuthCookieName); } internal static void UmbracoLogout(this HttpContext http) @@ -43,8 +43,8 @@ namespace Umbraco.Core.Security public static bool RenewUmbracoAuthTicket(this HttpContextBase http, int timeoutInMinutes = 60) { return RenewAuthTicket(http, - UmbracoConfiguration.Current.UmbracoSettings.Security.AuthCookieName, - UmbracoConfiguration.Current.UmbracoSettings.Security.AuthCookieDomain, + UmbracoConfig.For.UmbracoSettings().Security.AuthCookieName, + UmbracoConfig.For.UmbracoSettings().Security.AuthCookieDomain, timeoutInMinutes); } @@ -69,8 +69,8 @@ namespace Umbraco.Core.Security //Umbraco has always persisted it's original cookie for 1 day so we'll keep it that way 1440, "/", - UmbracoConfiguration.Current.UmbracoSettings.Security.AuthCookieName, - UmbracoConfiguration.Current.UmbracoSettings.Security.AuthCookieDomain); + UmbracoConfig.For.UmbracoSettings().Security.AuthCookieName, + UmbracoConfig.For.UmbracoSettings().Security.AuthCookieDomain); } internal static void CreateUmbracoAuthTicket(this HttpContext http, UserData userdata) @@ -85,7 +85,7 @@ namespace Umbraco.Core.Security /// public static FormsAuthenticationTicket GetUmbracoAuthTicket(this HttpContextBase http) { - return GetAuthTicket(http, UmbracoConfiguration.Current.UmbracoSettings.Security.AuthCookieName); + return GetAuthTicket(http, UmbracoConfig.For.UmbracoSettings().Security.AuthCookieName); } internal static FormsAuthenticationTicket GetUmbracoAuthTicket(this HttpContext http) diff --git a/src/Umbraco.Core/Services/ContentTypeService.cs b/src/Umbraco.Core/Services/ContentTypeService.cs index b54db28170..f3017089d7 100644 --- a/src/Umbraco.Core/Services/ContentTypeService.cs +++ b/src/Umbraco.Core/Services/ContentTypeService.cs @@ -567,7 +567,7 @@ namespace Umbraco.Core.Services public string GetContentTypesDtd() { var dtd = new StringBuilder(); - if (UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema) + if (UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema) { dtd.AppendLine(" "); } diff --git a/src/Umbraco.Core/Services/PackagingService.cs b/src/Umbraco.Core/Services/PackagingService.cs index 979cced5ac..7d182e153e 100644 --- a/src/Umbraco.Core/Services/PackagingService.cs +++ b/src/Umbraco.Core/Services/PackagingService.cs @@ -108,7 +108,7 @@ namespace Umbraco.Core.Services internal XElement Export(IContent content, bool deep = false) { //nodeName should match Casing.SafeAliasWithForcingCheck(content.ContentType.Alias); - var nodeName = UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema ? "node" : content.ContentType.Alias.ToSafeAliasWithForcingCheck(); + var nodeName = UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema ? "node" : content.ContentType.Alias.ToSafeAliasWithForcingCheck(); var xml = Export(content, nodeName); xml.Add(new XAttribute("nodeType", content.ContentType.Id)); @@ -862,7 +862,7 @@ namespace Umbraco.Core.Services internal XElement Export(IMedia media, bool deep = false) { //nodeName should match Casing.SafeAliasWithForcingCheck(content.ContentType.Alias); - var nodeName = UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema ? "node" : media.ContentType.Alias.ToSafeAliasWithForcingCheck(); + var nodeName = UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema ? "node" : media.ContentType.Alias.ToSafeAliasWithForcingCheck(); var xml = Export(media, nodeName); xml.Add(new XAttribute("nodeType", media.ContentType.Id)); diff --git a/src/Umbraco.Core/StringExtensions.cs b/src/Umbraco.Core/StringExtensions.cs index 40a71d8d25..fe37350767 100644 --- a/src/Umbraco.Core/StringExtensions.cs +++ b/src/Umbraco.Core/StringExtensions.cs @@ -958,7 +958,7 @@ namespace Umbraco.Core /// Checks UmbracoSettings.ForceSafeAliases to determine whether it should filter the text. public static string ToSafeAliasWithForcingCheck(this string alias) { - return UmbracoConfiguration.Current.UmbracoSettings.Content.ForceSafeAliases ? alias.ToSafeAlias() : alias; + return UmbracoConfig.For.UmbracoSettings().Content.ForceSafeAliases ? alias.ToSafeAlias() : alias; } /// @@ -970,7 +970,7 @@ namespace Umbraco.Core /// Checks UmbracoSettings.ForceSafeAliases to determine whether it should filter the text. public static string ToSafeAliasWithForcingCheck(this string alias, CultureInfo culture) { - return UmbracoConfiguration.Current.UmbracoSettings.Content.ForceSafeAliases ? alias.ToSafeAlias(culture) : alias; + return UmbracoConfig.For.UmbracoSettings().Content.ForceSafeAliases ? alias.ToSafeAlias(culture) : alias; } // note: LegacyShortStringHelper will produce a 100% backward-compatible output for ToUmbracoAlias. diff --git a/src/Umbraco.Core/Strings/DefaultShortStringHelper.cs b/src/Umbraco.Core/Strings/DefaultShortStringHelper.cs index d834d0f81b..547cf6090d 100644 --- a/src/Umbraco.Core/Strings/DefaultShortStringHelper.cs +++ b/src/Umbraco.Core/Strings/DefaultShortStringHelper.cs @@ -57,7 +57,7 @@ namespace Umbraco.Core.Strings static void InitializeLegacyUrlReplaceCharacters() { - foreach (var node in UmbracoConfiguration.Current.UmbracoSettings.RequestHandler.CharCollection) + foreach (var node in UmbracoConfig.For.UmbracoSettings().RequestHandler.CharCollection) { if (node.Char.IsNullOrWhiteSpace() == false) UrlReplaceCharacters[node.Char] = node.Replacement; @@ -227,7 +227,7 @@ function validateSafeAlias(id, value, immediate, callback) {{ public string GetShortStringServicesJavaScript(string controllerPath) { return string.Format(SssjsFormat, - UmbracoConfiguration.Current.UmbracoSettings.Content.ForceSafeAliases ? "true" : "false", controllerPath); + UmbracoConfig.For.UmbracoSettings().Content.ForceSafeAliases ? "true" : "false", controllerPath); } #endregion diff --git a/src/Umbraco.Core/Strings/LegacyShortStringHelper.cs b/src/Umbraco.Core/Strings/LegacyShortStringHelper.cs index 9d8f03427e..1c780703f4 100644 --- a/src/Umbraco.Core/Strings/LegacyShortStringHelper.cs +++ b/src/Umbraco.Core/Strings/LegacyShortStringHelper.cs @@ -94,7 +94,7 @@ function isValidAlias(alias) {{ public string GetShortStringServicesJavaScript(string controllerPath) { return string.Format(SssjsFormat, - UmbracoConfiguration.Current.UmbracoSettings.Content.ForceSafeAliases ? "true" : "false", SssjsValidCharacters, SssjsInvalidFirstCharacters); + UmbracoConfig.For.UmbracoSettings().Content.ForceSafeAliases ? "true" : "false", SssjsValidCharacters, SssjsInvalidFirstCharacters); } #endregion @@ -205,7 +205,7 @@ function isValidAlias(alias) {{ var ext = filePath.Substring(filePath.LastIndexOf('.')); //Because the file usually is downloadable as well we check characters against 'UmbracoSettings.UrlReplaceCharacters' - foreach (var n in UmbracoConfiguration.Current.UmbracoSettings.RequestHandler.CharCollection) + foreach (var n in UmbracoConfig.For.UmbracoSettings().RequestHandler.CharCollection) { if (n.Char.IsNullOrWhiteSpace() == false) fileNamePart = fileNamePart.Replace(n.Char, n.Replacement); @@ -468,14 +468,14 @@ function isValidAlias(alias) {{ public string LegacyFormatUrl(string url) { var newUrl = url.ToLowerInvariant(); - foreach (var n in UmbracoConfiguration.Current.UmbracoSettings.RequestHandler.CharCollection) + foreach (var n in UmbracoConfig.For.UmbracoSettings().RequestHandler.CharCollection) { if (n.Char != "") newUrl = newUrl.Replace(n.Char, n.Replacement); } // check for double dashes - if (UmbracoConfiguration.Current.UmbracoSettings.RequestHandler.RemoveDoubleDashes) + if (UmbracoConfig.For.UmbracoSettings().RequestHandler.RemoveDoubleDashes) { newUrl = Regex.Replace(newUrl, @"[-]{2,}", "-"); } diff --git a/src/Umbraco.Core/Sync/ConfigServerRegistrar.cs b/src/Umbraco.Core/Sync/ConfigServerRegistrar.cs index 99575ab0e6..69f54fcab7 100644 --- a/src/Umbraco.Core/Sync/ConfigServerRegistrar.cs +++ b/src/Umbraco.Core/Sync/ConfigServerRegistrar.cs @@ -17,7 +17,7 @@ namespace Umbraco.Core.Sync private readonly IEnumerable _servers; public ConfigServerRegistrar() - : this(UmbracoConfiguration.Current.UmbracoSettings.DistributedCall.Servers) + : this(UmbracoConfig.For.UmbracoSettings().DistributedCall.Servers) { } diff --git a/src/Umbraco.Core/Sync/DefaultServerMessenger.cs b/src/Umbraco.Core/Sync/DefaultServerMessenger.cs index c15ff006f1..f14e7ad442 100644 --- a/src/Umbraco.Core/Sync/DefaultServerMessenger.cs +++ b/src/Umbraco.Core/Sync/DefaultServerMessenger.cs @@ -39,7 +39,7 @@ namespace Umbraco.Core.Sync /// /// internal DefaultServerMessenger(string login, string password) - : this(login, password, UmbracoConfiguration.Current.UmbracoSettings.DistributedCall.Enabled) + : this(login, password, UmbracoConfig.For.UmbracoSettings().DistributedCall.Enabled) { } @@ -226,7 +226,7 @@ namespace Umbraco.Core.Sync { Login = result.Item1; Password = result.Item2; - _useDistributedCalls = UmbracoConfiguration.Current.UmbracoSettings.DistributedCall.Enabled; + _useDistributedCalls = UmbracoConfig.For.UmbracoSettings().DistributedCall.Enabled; } } catch (Exception ex) diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj index 1c931e7b7c..6cda6187ce 100644 --- a/src/Umbraco.Core/Umbraco.Core.csproj +++ b/src/Umbraco.Core/Umbraco.Core.csproj @@ -157,7 +157,7 @@ - + diff --git a/src/Umbraco.Core/XmlHelper.cs b/src/Umbraco.Core/XmlHelper.cs index e432c237ba..260bb5b86d 100644 --- a/src/Umbraco.Core/XmlHelper.cs +++ b/src/Umbraco.Core/XmlHelper.cs @@ -86,7 +86,7 @@ namespace Umbraco.Core if (nav.MoveToFirstChild()) { var name = nav.LocalName; // must not match an excluded tag - if (UmbracoConfiguration.Current.UmbracoSettings.Scripting.NotDynamicXmlDocumentElements.All(x => x.Element.InvariantEquals(name) == false)) return true; + if (UmbracoConfig.For.UmbracoSettings().Scripting.NotDynamicXmlDocumentElements.All(x => x.Element.InvariantEquals(name) == false)) return true; } doc = null; @@ -121,7 +121,7 @@ namespace Umbraco.Core } var name = elt.Name.LocalName; // must not match an excluded tag - if (UmbracoConfiguration.Current.UmbracoSettings.Scripting.NotDynamicXmlDocumentElements.All(x => x.Element.InvariantEquals(name) == false)) return true; + if (UmbracoConfig.For.UmbracoSettings().Scripting.NotDynamicXmlDocumentElements.All(x => x.Element.InvariantEquals(name) == false)) return true; elt = null; return false; diff --git a/src/Umbraco.Tests/CodeFirst/Definitions/ContentTypeDefinitionFactory.cs b/src/Umbraco.Tests/CodeFirst/Definitions/ContentTypeDefinitionFactory.cs index 8342ff0f32..f1b98c53e6 100644 --- a/src/Umbraco.Tests/CodeFirst/Definitions/ContentTypeDefinitionFactory.cs +++ b/src/Umbraco.Tests/CodeFirst/Definitions/ContentTypeDefinitionFactory.cs @@ -311,7 +311,7 @@ namespace Umbraco.Tests.CodeFirst.Definitions private static IEnumerable AllowedTemplatesConvention(IEnumerable templateNames) { var templates = new List(); - var engine = UmbracoConfiguration.Current.UmbracoSettings.Templates.DefaultRenderingEngine; + var engine = UmbracoConfig.For.UmbracoSettings().Templates.DefaultRenderingEngine; foreach (var templateName in templateNames) { var @alias = engine == RenderingEngine.Mvc diff --git a/src/Umbraco.Tests/Configurations/FileSystemProviderTests.cs b/src/Umbraco.Tests/Configurations/FileSystemProviderTests.cs index 58c576a7e8..bbd584b117 100644 --- a/src/Umbraco.Tests/Configurations/FileSystemProviderTests.cs +++ b/src/Umbraco.Tests/Configurations/FileSystemProviderTests.cs @@ -8,39 +8,7 @@ using Umbraco.Core.Configuration.UmbracoSettings; namespace Umbraco.Tests.Configurations { - [TestFixture] - public class UmbracoConfigurationTests - { - [TearDown] - public void TearDown() - { - UmbracoConfiguration.Reset(); - } - - [Test] - public void Can_Set_Custom_Implementation() - { - var mockedContent = new Mock(); - mockedContent.Setup(section => section.NotificationEmailAddress).Returns("test@test.com"); - UmbracoConfiguration.Set(mockedContent.Object); - - Assert.AreEqual("test@test.com", UmbracoConfiguration.For().NotificationEmailAddress); - } - - [Test] - public void Can_Reset() - { - var mockedContent = new Mock(); - mockedContent.Setup(section => section.NotificationEmailAddress).Returns("test@test.com"); - UmbracoConfiguration.Set(mockedContent.Object); - - UmbracoConfiguration.Reset(); - - Assert.Throws(() => UmbracoConfiguration.For()); - } - - } - + [TestFixture] public class FileSystemProviderTests { diff --git a/src/Umbraco.Tests/Configurations/UmbracoSettings/UmbracoSettingsTests.cs b/src/Umbraco.Tests/Configurations/UmbracoSettings/UmbracoSettingsTests.cs index 11e792a4db..8342bd13a3 100644 --- a/src/Umbraco.Tests/Configurations/UmbracoSettings/UmbracoSettingsTests.cs +++ b/src/Umbraco.Tests/Configurations/UmbracoSettings/UmbracoSettingsTests.cs @@ -29,7 +29,7 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings } else { - SettingsSection = UmbracoConfiguration.For(configuration); + SettingsSection = configuration.GetSection("umbracoConfiguration/settings") as UmbracoSettingsSection; } diff --git a/src/Umbraco.Tests/Configurations/UmbracoSettings/WebRoutingElementTests.cs b/src/Umbraco.Tests/Configurations/UmbracoSettings/WebRoutingElementTests.cs index 39d0b8be7f..fbade43b74 100644 --- a/src/Umbraco.Tests/Configurations/UmbracoSettings/WebRoutingElementTests.cs +++ b/src/Umbraco.Tests/Configurations/UmbracoSettings/WebRoutingElementTests.cs @@ -20,7 +20,7 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings [Test] public virtual void UrlProviderMode() { - Assert.IsTrue(SettingsSection.WebRouting.UrlProviderMode == "Auto"); + Assert.IsTrue(SettingsSection.WebRouting.UrlProviderMode == "AutoLegacy"); } } } \ No newline at end of file diff --git a/src/Umbraco.Tests/LibraryTests.cs b/src/Umbraco.Tests/LibraryTests.cs index 100e7b8b34..20456f4853 100644 --- a/src/Umbraco.Tests/LibraryTests.cs +++ b/src/Umbraco.Tests/LibraryTests.cs @@ -87,7 +87,7 @@ namespace Umbraco.Tests if (cache == null) throw new Exception("Unsupported IPublishedContentCache, only the Xml one is supported."); var umbracoXML = cache.GetXml(UmbracoContext.Current, UmbracoContext.Current.InPreviewMode); - string xpath = UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema ? "./data [@alias='{0}']" : "./{0}"; + string xpath = UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema ? "./data [@alias='{0}']" : "./{0}"; if (umbracoXML.GetElementById(nodeId.ToString()) != null) if ( ",id,parentID,level,writerID,template,sortOrder,createDate,updateDate,nodeName,writerName,path," diff --git a/src/Umbraco.Tests/TestHelpers/SettingsForTests.cs b/src/Umbraco.Tests/TestHelpers/SettingsForTests.cs index 068d8f20a6..4e5249b194 100644 --- a/src/Umbraco.Tests/TestHelpers/SettingsForTests.cs +++ b/src/Umbraco.Tests/TestHelpers/SettingsForTests.cs @@ -18,18 +18,7 @@ namespace Umbraco.Tests.TestHelpers /// public static void ConfigureSettings(IUmbracoSettingsSection settings) { - UmbracoConfiguration.Current.UmbracoSettings = settings; - } - - /// - /// Used for unit tests to explicitly associate an IUmbracoConfigurationSection to an implementation - /// - /// - /// - public static void SetSetting(T implementation) - where T : IUmbracoConfigurationSection - { - UmbracoConfiguration.Set(implementation); + UmbracoConfig.For.SetUmbracoSettings(settings); } /// diff --git a/src/Umbraco.Tests/XmlHelperTests.cs b/src/Umbraco.Tests/XmlHelperTests.cs index dfb7abc46f..ad00a364e6 100644 --- a/src/Umbraco.Tests/XmlHelperTests.cs +++ b/src/Umbraco.Tests/XmlHelperTests.cs @@ -152,7 +152,7 @@ namespace Umbraco.Tests XmlNode n = parentNode.CloneNode(true); // remove all children from original node - string xpath = UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema ? "./node" : "./* [@id]"; + string xpath = UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema ? "./node" : "./* [@id]"; foreach (XmlNode child in parentNode.SelectNodes(xpath)) parentNode.RemoveChild(child); diff --git a/src/Umbraco.Web.UI/install/steps/DefaultUser.ascx.cs b/src/Umbraco.Web.UI/install/steps/DefaultUser.ascx.cs index 5407c7c52d..295b11b8f5 100644 --- a/src/Umbraco.Web.UI/install/steps/DefaultUser.ascx.cs +++ b/src/Umbraco.Web.UI/install/steps/DefaultUser.ascx.cs @@ -22,16 +22,16 @@ namespace Umbraco.Web.UI.Install.Steps if (Page.IsValid) { var u = User.GetUser(0); - var user = Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.DefaultBackOfficeUserProvider].GetUser(0, true); + var user = Membership.Providers[UmbracoConfig.For.UmbracoSettings().Providers.DefaultBackOfficeUserProvider].GetUser(0, true); user.ChangePassword(u.GetPassword(), tb_password.Text.Trim()); // Is it using the default membership provider - if (Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.DefaultBackOfficeUserProvider] is UsersMembershipProvider) + if (Membership.Providers[UmbracoConfig.For.UmbracoSettings().Providers.DefaultBackOfficeUserProvider] is UsersMembershipProvider) { // Save user in membership provider var umbracoUser = user as UsersMembershipUser; umbracoUser.FullName = tb_name.Text.Trim(); - Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.DefaultBackOfficeUserProvider].UpdateUser(umbracoUser); + Membership.Providers[UmbracoConfig.For.UmbracoSettings().Providers.DefaultBackOfficeUserProvider].UpdateUser(umbracoUser); // Save user details u.Email = tb_email.Text.Trim(); @@ -39,7 +39,7 @@ namespace Umbraco.Web.UI.Install.Steps else { u.Name = tb_name.Text.Trim(); - if (!(Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.DefaultBackOfficeUserProvider] is ActiveDirectoryMembershipProvider)) Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.DefaultBackOfficeUserProvider].UpdateUser(user); + if (!(Membership.Providers[UmbracoConfig.For.UmbracoSettings().Providers.DefaultBackOfficeUserProvider] is ActiveDirectoryMembershipProvider)) Membership.Providers[UmbracoConfig.For.UmbracoSettings().Providers.DefaultBackOfficeUserProvider].UpdateUser(user); } // we need to update the login name here as it's set to the old name when saving the user via the membership provider! diff --git a/src/Umbraco.Web.UI/umbraco/dialogs/editMacro.aspx b/src/Umbraco.Web.UI/umbraco/dialogs/editMacro.aspx index 88b62a4e2b..93447605b3 100644 --- a/src/Umbraco.Web.UI/umbraco/dialogs/editMacro.aspx +++ b/src/Umbraco.Web.UI/umbraco/dialogs/editMacro.aspx @@ -14,7 +14,7 @@ (function($) { $(document).ready(function () { Umbraco.Dialogs.EditMacro.getInstance().init({ - useAspNetMasterPages: <%=UmbracoConfiguration.Current.UmbracoSettings.Templates.UseAspNetMasterPages.ToString().ToLower() %>, + useAspNetMasterPages: <%=UmbracoConfig.For.UmbracoSettings().Templates.UseAspNetMasterPages.ToString().ToLower() %>, codeEditorElementId: "<%=Request.GetItemAsString("objectId")%>", renderingEngine: "<%=Request.GetItemAsString("renderingEngine", "Mvc")%>", macroAlias: '<%= _macroAlias %>' diff --git a/src/Umbraco.Web.UI/umbraco/settings/editTemplate.aspx b/src/Umbraco.Web.UI/umbraco/settings/editTemplate.aspx index 0356f4fe07..a6f25da43e 100644 --- a/src/Umbraco.Web.UI/umbraco/settings/editTemplate.aspx +++ b/src/Umbraco.Web.UI/umbraco/settings/editTemplate.aspx @@ -24,7 +24,7 @@ restServiceLocation: "<%= Url.GetSaveFileServicePath() %>", umbracoPath: '<%= IOHelper.ResolveUrl(SystemDirectories.Umbraco) %>', editorClientId: '<%= editorSource.ClientID %>', - useMasterPages: <%=UmbracoConfiguration.Current.UmbracoSettings.Templates.UseAspNetMasterPages.ToString().ToLower()%>, + useMasterPages: <%=UmbracoConfig.For.UmbracoSettings().Templates.UseAspNetMasterPages.ToString().ToLower()%>, templateId: <%= Request.QueryString["templateID"] %>, masterTemplateId: jQuery('#<%= MasterTemplate.ClientID %>').val(), masterPageDropDown: $("#<%= MasterTemplate.ClientID %>"), diff --git a/src/Umbraco.Web/BaseRest/BaseRestHandler.cs b/src/Umbraco.Web/BaseRest/BaseRestHandler.cs index ff468c3847..147f45da70 100644 --- a/src/Umbraco.Web/BaseRest/BaseRestHandler.cs +++ b/src/Umbraco.Web/BaseRest/BaseRestHandler.cs @@ -30,7 +30,7 @@ namespace Umbraco.Web.BaseRest /// A value indicating whether the specified Uri should be routed to the BaseRestHandler. public static bool IsBaseRestRequest(Uri uri) { - return UmbracoConfiguration.Current.BaseRestExtensions.Enabled + return UmbracoConfig.For.BaseRestExtensions().Enabled && uri.AbsolutePath.ToLowerInvariant().StartsWith(BaseUrl); } diff --git a/src/Umbraco.Web/BaseRest/RestExtensionMethodInfo.cs b/src/Umbraco.Web/BaseRest/RestExtensionMethodInfo.cs index 4db612836a..7227091262 100644 --- a/src/Umbraco.Web/BaseRest/RestExtensionMethodInfo.cs +++ b/src/Umbraco.Web/BaseRest/RestExtensionMethodInfo.cs @@ -89,7 +89,7 @@ namespace Umbraco.Web.BaseRest // static RestExtensionMethodInfo GetFromConfiguration(string extensionAlias, string methodName, int paramsCount) { - var config = UmbracoConfiguration.Current.BaseRestExtensions; + var config = UmbracoConfig.For.BaseRestExtensions(); var configExtension = config.Items[extensionAlias]; if (configExtension == null) diff --git a/src/Umbraco.Web/Cache/DistributedCacheExtensions.cs b/src/Umbraco.Web/Cache/DistributedCacheExtensions.cs index 04ddd7e696..a8958b35c5 100644 --- a/src/Umbraco.Web/Cache/DistributedCacheExtensions.cs +++ b/src/Umbraco.Web/Cache/DistributedCacheExtensions.cs @@ -527,7 +527,7 @@ namespace Umbraco.Web.Cache public static void ClearXsltCacheOnCurrentServer(this DistributedCache dc) { - if (UmbracoConfiguration.Current.UmbracoSettings.Content.UmbracoLibraryCacheDuration > 0) + if (UmbracoConfig.For.UmbracoSettings().Content.UmbracoLibraryCacheDuration > 0) { ApplicationContext.Current.ApplicationCache.ClearCacheObjectTypes("MS.Internal.Xml.XPath.XPathSelectionIterator"); } diff --git a/src/Umbraco.Web/Editors/BackOfficeController.cs b/src/Umbraco.Web/Editors/BackOfficeController.cs index af49f1b861..471bfffccf 100644 --- a/src/Umbraco.Web/Editors/BackOfficeController.cs +++ b/src/Umbraco.Web/Editors/BackOfficeController.cs @@ -73,7 +73,7 @@ namespace Umbraco.Web.Editors { {"umbracoPath", GlobalSettings.Path}, {"imageFileTypes", - string.Join(",",UmbracoConfiguration.Current.UmbracoSettings.Content.ImageFileTypes)}, + string.Join(",",UmbracoConfig.For.UmbracoSettings().Content.ImageFileTypes)}, } }, { "isDebuggingEnabled", HttpContext.IsDebuggingEnabled } diff --git a/src/Umbraco.Web/HtmlHelperRenderExtensions.cs b/src/Umbraco.Web/HtmlHelperRenderExtensions.cs index 2a8539bec9..3b4e5b3146 100644 --- a/src/Umbraco.Web/HtmlHelperRenderExtensions.cs +++ b/src/Umbraco.Web/HtmlHelperRenderExtensions.cs @@ -66,7 +66,7 @@ namespace Umbraco.Web if (UmbracoContext.Current.InPreviewMode) { var htmlBadge = - String.Format(UmbracoConfiguration.Current.UmbracoSettings.Content.PreviewBadge, + String.Format(UmbracoConfig.For.UmbracoSettings().Content.PreviewBadge, IOHelper.ResolveUrl(SystemDirectories.Umbraco), IOHelper.ResolveUrl(SystemDirectories.UmbracoClient), UmbracoContext.Current.HttpContext.Server.UrlEncode(UmbracoContext.Current.HttpContext.Request.Path)); diff --git a/src/Umbraco.Web/LegacyScheduledTasks.cs b/src/Umbraco.Web/LegacyScheduledTasks.cs index 7c2557a872..cb5166ff7e 100644 --- a/src/Umbraco.Web/LegacyScheduledTasks.cs +++ b/src/Umbraco.Web/LegacyScheduledTasks.cs @@ -55,8 +55,8 @@ namespace Umbraco.Web int interval = 24 * 60 * 60; //24 hours try { - if (UmbracoConfiguration.Current.UmbracoSettings.Logging.CleaningMiliseconds > -1) - interval = UmbracoConfiguration.Current.UmbracoSettings.Logging.CleaningMiliseconds; + if (UmbracoConfig.For.UmbracoSettings().Logging.CleaningMiliseconds > -1) + interval = UmbracoConfig.For.UmbracoSettings().Logging.CleaningMiliseconds; } catch (Exception e) { @@ -70,8 +70,8 @@ namespace Umbraco.Web int maximumAge = 24 * 60 * 60; try { - if (UmbracoConfiguration.Current.UmbracoSettings.Logging.MaxLogAge > -1) - maximumAge = UmbracoConfiguration.Current.UmbracoSettings.Logging.MaxLogAge; + if (UmbracoConfig.For.UmbracoSettings().Logging.MaxLogAge > -1) + maximumAge = UmbracoConfig.For.UmbracoSettings().Logging.MaxLogAge; } catch (Exception e) { diff --git a/src/Umbraco.Web/Media/ImageUrlProviders/ImageUrlProvider.cs b/src/Umbraco.Web/Media/ImageUrlProviders/ImageUrlProvider.cs index c8606e8897..9777e39fe6 100644 --- a/src/Umbraco.Web/Media/ImageUrlProviders/ImageUrlProvider.cs +++ b/src/Umbraco.Web/Media/ImageUrlProviders/ImageUrlProvider.cs @@ -78,7 +78,7 @@ namespace Umbraco.Web.Media.ImageUrlProviders private static string GetProperty(XPathNodeIterator nodeIterator, string fileProp) { - var xpath = UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema + var xpath = UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema ? string.Format(".//data[@alias = '{0}']", fileProp) : string.Format(".//{0}", fileProp); diff --git a/src/Umbraco.Web/Models/XmlPublishedContent.cs b/src/Umbraco.Web/Models/XmlPublishedContent.cs index a0e1b10539..a34a19ce5e 100644 --- a/src/Umbraco.Web/Models/XmlPublishedContent.cs +++ b/src/Umbraco.Web/Models/XmlPublishedContent.cs @@ -317,7 +317,7 @@ namespace Umbraco.Web.Models if (_pageXmlNode.Attributes.GetNamedItem("writerID") != null) _writerId = int.Parse(_pageXmlNode.Attributes.GetNamedItem("writerID").Value); - if (UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema) + if (UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema) { if (_pageXmlNode.Attributes.GetNamedItem("nodeTypeAlias") != null) _docTypeAlias = _pageXmlNode.Attributes.GetNamedItem("nodeTypeAlias").Value; @@ -343,12 +343,12 @@ namespace Umbraco.Web.Models } // load data - var dataXPath = UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema ? "data" : "* [not(@isDoc)]"; + var dataXPath = UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema ? "data" : "* [not(@isDoc)]"; foreach (XmlNode n in _pageXmlNode.SelectNodes(dataXPath)) _properties.Add(new XmlPublishedContentProperty(n)); // load children - var childXPath = UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema ? "node" : "* [@isDoc]"; + var childXPath = UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema ? "node" : "* [@isDoc]"; var nav = _pageXmlNode.CreateNavigator(); var expr = nav.Compile(childXPath); expr.AddSort("@sortOrder", XmlSortOrder.Ascending, XmlCaseOrder.None, "", XmlDataType.Number); diff --git a/src/Umbraco.Web/Models/XmlPublishedContentProperty.cs b/src/Umbraco.Web/Models/XmlPublishedContentProperty.cs index b900ca6ee8..11326210a5 100644 --- a/src/Umbraco.Web/Models/XmlPublishedContentProperty.cs +++ b/src/Umbraco.Web/Models/XmlPublishedContentProperty.cs @@ -66,7 +66,7 @@ namespace Umbraco.Web.Models // For backward compatibility with 2.x (the version attribute has been removed from 3.0 data nodes) if (propertyXmlData.Attributes.GetNamedItem("versionID") != null) _version = new Guid(propertyXmlData.Attributes.GetNamedItem("versionID").Value); - _alias = UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema ? + _alias = UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema ? propertyXmlData.Attributes.GetNamedItem("alias").Value : propertyXmlData.Name; _value = XmlHelper.GetNodeValue(propertyXmlData); diff --git a/src/Umbraco.Web/Mvc/UmbracoViewPage.cs b/src/Umbraco.Web/Mvc/UmbracoViewPage.cs index 27823aef3e..618e656182 100644 --- a/src/Umbraco.Web/Mvc/UmbracoViewPage.cs +++ b/src/Umbraco.Web/Mvc/UmbracoViewPage.cs @@ -139,7 +139,7 @@ namespace Umbraco.Web.Mvc { // creating previewBadge markup markupToInject = - String.Format(UmbracoConfiguration.Current.UmbracoSettings.Content.PreviewBadge, + String.Format(UmbracoConfig.For.UmbracoSettings().Content.PreviewBadge, IOHelper.ResolveUrl(SystemDirectories.Umbraco), IOHelper.ResolveUrl(SystemDirectories.UmbracoClient), Server.UrlEncode(UmbracoContext.Current.HttpContext.Request.Path)); diff --git a/src/Umbraco.Web/PropertyEditors/FileUploadPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/FileUploadPropertyEditor.cs index 18da7cbcee..76be4d07b4 100644 --- a/src/Umbraco.Web/PropertyEditors/FileUploadPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/FileUploadPropertyEditor.cs @@ -70,7 +70,7 @@ namespace Umbraco.Web.PropertyEditors foreach (var p in model.Properties) { var uploadFieldConfigNode = - UmbracoConfiguration.Current.UmbracoSettings.Content.ImageAutoFillProperties + UmbracoConfig.For.UmbracoSettings().Content.ImageAutoFillProperties .FirstOrDefault(x => x.Alias == p.Alias); if (uploadFieldConfigNode != null) diff --git a/src/Umbraco.Web/PropertyEditors/FileUploadPropertyValueEditor.cs b/src/Umbraco.Web/PropertyEditors/FileUploadPropertyValueEditor.cs index aa000a4a76..c62d5716a7 100644 --- a/src/Umbraco.Web/PropertyEditors/FileUploadPropertyValueEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/FileUploadPropertyValueEditor.cs @@ -93,7 +93,7 @@ namespace Umbraco.Web.PropertyEditors var name = IOHelper.SafeFileName(file.FileName.Substring(file.FileName.LastIndexOf(IOHelper.DirSepChar) + 1, file.FileName.Length - file.FileName.LastIndexOf(IOHelper.DirSepChar) - 1).ToLower()); - var subfolder = UmbracoConfiguration.Current.UmbracoSettings.Content.UploadAllowDirectories + var subfolder = UmbracoConfig.For.UmbracoSettings().Content.UploadAllowDirectories ? currentPersistedFile.Replace(fs.GetUrl("/"), "").Split('/')[0] : currentPersistedFile.Substring(currentPersistedFile.LastIndexOf("/", StringComparison.Ordinal) + 1).Split('-')[0]; @@ -102,7 +102,7 @@ namespace Umbraco.Web.PropertyEditors ? subfolderId.ToString(CultureInfo.InvariantCulture) : MediaSubfolderCounter.Current.Increment().ToString(CultureInfo.InvariantCulture); - var fileName = UmbracoConfiguration.Current.UmbracoSettings.Content.UploadAllowDirectories + var fileName = UmbracoConfig.For.UmbracoSettings().Content.UploadAllowDirectories ? Path.Combine(numberedFolder, name) : numberedFolder + "-" + name; diff --git a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedContentCache.cs b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedContentCache.cs index 613abf8dfc..f0d467723f 100644 --- a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedContentCache.cs +++ b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedContentCache.cs @@ -226,7 +226,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache // that switch schemas fail - so cache and refresh when needed, // ie never when running the actual site - var version = UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema ? 0 : 1; + var version = UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema ? 0 : 1; if (_xPathStringsValue == null || _xPathStringsValue.Version != version) _xPathStringsValue = new XPathStringsDefinition(version); return _xPathStringsValue; diff --git a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedMediaCache.cs b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedMediaCache.cs index fff4528a2c..e62dff9bc0 100644 --- a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedMediaCache.cs +++ b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedMediaCache.cs @@ -253,7 +253,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache if (xpath == null) throw new ArgumentNullException("xpath"); var values = new Dictionary {{"nodeName", xpath.GetAttribute("nodeName", "")}}; - if (!UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema) + if (!UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema) { values.Add("nodeTypeAlias", xpath.Name); } diff --git a/src/Umbraco.Web/Routing/ContentFinderByUrlAlias.cs b/src/Umbraco.Web/Routing/ContentFinderByUrlAlias.cs index 23b12fe614..e0121a4b3c 100644 --- a/src/Umbraco.Web/Routing/ContentFinderByUrlAlias.cs +++ b/src/Umbraco.Web/Routing/ContentFinderByUrlAlias.cs @@ -124,7 +124,7 @@ namespace Umbraco.Web.Routing // that switch schemas fail - so cache and refresh when needed, // ie never when running the actual site - var version = UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema ? 0 : 1; + var version = UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema ? 0 : 1; if (_xPathStringsValue == null || _xPathStringsValue.Version != version) _xPathStringsValue = new XPathStringsDefinition(version); return _xPathStringsValue; diff --git a/src/Umbraco.Web/Routing/DefaultUrlProvider.cs b/src/Umbraco.Web/Routing/DefaultUrlProvider.cs index 922f9fa595..5a9dd9123c 100644 --- a/src/Umbraco.Web/Routing/DefaultUrlProvider.cs +++ b/src/Umbraco.Web/Routing/DefaultUrlProvider.cs @@ -106,7 +106,7 @@ namespace Umbraco.Web.Routing if (mode == UrlProviderMode.AutoLegacy) { - mode = UmbracoConfiguration.Current.UmbracoSettings.RequestHandler.UseDomainPrefixes + mode = UmbracoConfig.For.UmbracoSettings().RequestHandler.UseDomainPrefixes ? UrlProviderMode.Absolute : UrlProviderMode.Auto; } diff --git a/src/Umbraco.Web/Routing/PublishedContentRequest.cs b/src/Umbraco.Web/Routing/PublishedContentRequest.cs index 85dc0c53c1..1ee01a72ab 100644 --- a/src/Umbraco.Web/Routing/PublishedContentRequest.cs +++ b/src/Umbraco.Web/Routing/PublishedContentRequest.cs @@ -164,7 +164,7 @@ namespace Umbraco.Web.Routing IsInternalRedirectPublishedContent = isInternalRedirect; // must restore the template if it's an internal redirect & the config option is set - if (isInternalRedirect && UmbracoConfiguration.Current.UmbracoSettings.WebRouting.InternalRedirectPreservesTemplate) + if (isInternalRedirect && UmbracoConfig.For.UmbracoSettings().WebRouting.InternalRedirectPreservesTemplate) { // restore _template = template; diff --git a/src/Umbraco.Web/Routing/PublishedContentRequestEngine.cs b/src/Umbraco.Web/Routing/PublishedContentRequestEngine.cs index d9769c8474..fb6aca88b3 100644 --- a/src/Umbraco.Web/Routing/PublishedContentRequestEngine.cs +++ b/src/Umbraco.Web/Routing/PublishedContentRequestEngine.cs @@ -532,7 +532,7 @@ namespace Umbraco.Web.Routing // does not apply // + optionnally, apply the alternate template on internal redirects var useAltTemplate = _pcr.IsInitialPublishedContent - || (UmbracoConfiguration.Current.UmbracoSettings.WebRouting.InternalRedirectPreservesTemplate && _pcr.IsInternalRedirectPublishedContent); + || (UmbracoConfig.For.UmbracoSettings().WebRouting.InternalRedirectPreservesTemplate && _pcr.IsInternalRedirectPublishedContent); string altTemplate = useAltTemplate ? _routingContext.UmbracoContext.HttpContext.Request[Constants.Conventions.Url.AltTemplate] : null; diff --git a/src/Umbraco.Web/Routing/UrlProvider.cs b/src/Umbraco.Web/Routing/UrlProvider.cs index 9235248d54..69c56603fa 100644 --- a/src/Umbraco.Web/Routing/UrlProvider.cs +++ b/src/Umbraco.Web/Routing/UrlProvider.cs @@ -28,7 +28,7 @@ namespace Umbraco.Web.Routing var provider = UrlProviderMode.Auto; Mode = provider; - if (Enum.TryParse(UmbracoConfiguration.Current.UmbracoSettings.WebRouting.UrlProviderMode, out provider)) + if (Enum.TryParse(UmbracoConfig.For.UmbracoSettings().WebRouting.UrlProviderMode, out provider)) { Mode = provider; } diff --git a/src/Umbraco.Web/Security/WebSecurity.cs b/src/Umbraco.Web/Security/WebSecurity.cs index 2c0c8b1176..adf1caa1e2 100644 --- a/src/Umbraco.Web/Security/WebSecurity.cs +++ b/src/Umbraco.Web/Security/WebSecurity.cs @@ -177,7 +177,7 @@ namespace Umbraco.Web.Security /// internal bool ValidateBackOfficeCredentials(string username, string password) { - var membershipProvider = Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.DefaultBackOfficeUserProvider]; + var membershipProvider = Membership.Providers[UmbracoConfig.For.UmbracoSettings().Providers.DefaultBackOfficeUserProvider]; return membershipProvider != null && membershipProvider.ValidateUser(username, password); } @@ -189,7 +189,7 @@ namespace Umbraco.Web.Security /// internal bool ChangePassword(string oldpassword, string newpassword) { - var membershipProvider = Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.DefaultBackOfficeUserProvider]; + var membershipProvider = Membership.Providers[UmbracoConfig.For.UmbracoSettings().Providers.DefaultBackOfficeUserProvider]; return membershipProvider.GetUser(CurrentUser.Username, true).ChangePassword(oldpassword, newpassword); } diff --git a/src/Umbraco.Web/Strategies/DataTypes/LegacyUploadFieldWorkaround.cs b/src/Umbraco.Web/Strategies/DataTypes/LegacyUploadFieldWorkaround.cs index e814726a08..a5b1942e1e 100644 --- a/src/Umbraco.Web/Strategies/DataTypes/LegacyUploadFieldWorkaround.cs +++ b/src/Umbraco.Web/Strategies/DataTypes/LegacyUploadFieldWorkaround.cs @@ -27,7 +27,7 @@ namespace Umbraco.Web.Strategies.DataTypes void DocumentBeforeSave(global::umbraco.cms.businesslogic.web.Document sender, global::umbraco.cms.businesslogic.SaveEventArgs e) { - if (UmbracoConfiguration.Current.UmbracoSettings.Content.ImageAutoFillProperties.Any()) + if (UmbracoConfig.For.UmbracoSettings().Content.ImageAutoFillProperties.Any()) { var property = sender.GenericProperties.FirstOrDefault(x => x.PropertyType.DataTypeDefinition.DataType.Id == new Guid(Constants.PropertyEditors.UploadField)); if (property == null) @@ -40,7 +40,7 @@ namespace Umbraco.Web.Strategies.DataTypes void MediaBeforeSave(global::umbraco.cms.businesslogic.media.Media sender, global::umbraco.cms.businesslogic.SaveEventArgs e) { - if (UmbracoConfiguration.Current.UmbracoSettings.Content.ImageAutoFillProperties.Any()) + if (UmbracoConfig.For.UmbracoSettings().Content.ImageAutoFillProperties.Any()) { var property = sender.GenericProperties.FirstOrDefault(x => x.PropertyType.DataTypeDefinition.DataType.Id == new Guid(Constants.PropertyEditors.UploadField)); if (property == null) @@ -53,7 +53,7 @@ namespace Umbraco.Web.Strategies.DataTypes private void FillProperties(global::umbraco.cms.businesslogic.Content content, global::umbraco.cms.businesslogic.property.Property property) { - var uploadFieldConfigNode = UmbracoConfiguration.Current.UmbracoSettings.Content.ImageAutoFillProperties + var uploadFieldConfigNode = UmbracoConfig.For.UmbracoSettings().Content.ImageAutoFillProperties .FirstOrDefault(x => x.Alias == property.PropertyType.Alias); if (uploadFieldConfigNode != null) @@ -77,7 +77,7 @@ namespace Umbraco.Web.Strategies.DataTypes ? fileSystem.GetExtension(path).Substring(1).ToLowerInvariant() : ""; - var isImageType = UmbracoConfiguration.Current.UmbracoSettings.Content.ImageFileTypes.InvariantContains(extension); + var isImageType = UmbracoConfig.For.UmbracoSettings().Content.ImageFileTypes.InvariantContains(extension); var dimensions = isImageType ? GetDimensions(path, fileSystem) : null; diff --git a/src/Umbraco.Web/Templates/TemplateUtilities.cs b/src/Umbraco.Web/Templates/TemplateUtilities.cs index 114cb0de28..fea65fa321 100644 --- a/src/Umbraco.Web/Templates/TemplateUtilities.cs +++ b/src/Umbraco.Web/Templates/TemplateUtilities.cs @@ -56,7 +56,7 @@ namespace Umbraco.Web.Templates /// public static string ResolveUrlsFromTextString(string text) { - if (UmbracoConfiguration.Current.UmbracoSettings.Content.ResolveUrlsFromTextString) + if (UmbracoConfig.For.UmbracoSettings().Content.ResolveUrlsFromTextString) { using (var timer = DisposableTimer.DebugDuration(typeof(IOHelper), "ResolveUrlsFromTextString starting", "ResolveUrlsFromTextString complete")) { diff --git a/src/Umbraco.Web/UmbracoModule.cs b/src/Umbraco.Web/UmbracoModule.cs index 008013b7f5..ea0f861921 100644 --- a/src/Umbraco.Web/UmbracoModule.cs +++ b/src/Umbraco.Web/UmbracoModule.cs @@ -320,7 +320,7 @@ namespace Umbraco.Web { LogHelper.Warn("Umbraco is not ready"); - if (UmbracoConfiguration.Current.UmbracoSettings.Content.EnableSplashWhileLoading == false) + if (UmbracoConfig.For.UmbracoSettings().Content.EnableSplashWhileLoading == false) { // let requests pile up and wait for 10s then show the splash anyway ready = ApplicationContext.Current.WaitForReady(10 * 1000); @@ -398,7 +398,7 @@ namespace Umbraco.Web else if (pcr.Is404) { response.StatusCode = 404; - response.TrySkipIisCustomErrors = UmbracoConfiguration.Current.UmbracoSettings.WebRouting.TrySkipIisCustomErrors; + response.TrySkipIisCustomErrors = UmbracoConfig.For.UmbracoSettings().WebRouting.TrySkipIisCustomErrors; } if (pcr.ResponseStatusCode > 0) diff --git a/src/Umbraco.Web/UriUtility.cs b/src/Umbraco.Web/UriUtility.cs index ae3a95f132..86a97e2857 100644 --- a/src/Umbraco.Web/UriUtility.cs +++ b/src/Umbraco.Web/UriUtility.cs @@ -68,7 +68,7 @@ namespace Umbraco.Web { if (!GlobalSettings.UseDirectoryUrls) path += ".aspx"; - else if (UmbracoConfiguration.Current.UmbracoSettings.RequestHandler.AddTrailingSlash) + else if (UmbracoConfig.For.UmbracoSettings().RequestHandler.AddTrailingSlash) path += "/"; } diff --git a/src/Umbraco.Web/WebBootManager.cs b/src/Umbraco.Web/WebBootManager.cs index e3ef5d5e04..7a5ed69163 100644 --- a/src/Umbraco.Web/WebBootManager.cs +++ b/src/Umbraco.Web/WebBootManager.cs @@ -262,7 +262,7 @@ namespace Umbraco.Web { try { - var user = User.GetUser(UmbracoConfiguration.Current.UmbracoSettings.DistributedCall.UserId); + var user = User.GetUser(UmbracoConfig.For.UmbracoSettings().DistributedCall.UserId); return new System.Tuple(user.LoginName, user.GetPassword()); } catch (Exception e) diff --git a/src/Umbraco.Web/umbraco.presentation/NotFoundHandlers.cs b/src/Umbraco.Web/umbraco.presentation/NotFoundHandlers.cs index 9106fcfc4d..032f08586a 100644 --- a/src/Umbraco.Web/umbraco.presentation/NotFoundHandlers.cs +++ b/src/Umbraco.Web/umbraco.presentation/NotFoundHandlers.cs @@ -75,7 +75,7 @@ namespace umbraco { string langXpath = CreateXPathQuery(domainUrl + "/" + url, false); if (content.Instance.XmlContent.DocumentElement.SelectSingleNode(langXpath) != null) return langXpath; - else if (UmbracoConfiguration.Current.UmbracoSettings.RequestHandler.UseDomainPrefixes) + else if (UmbracoConfig.For.UmbracoSettings().RequestHandler.UseDomainPrefixes) return "/domainprefixes-are-used-so-i-do-not-work"; } } @@ -143,7 +143,7 @@ namespace umbraco { string currentDomain = System.Web.HttpContext.Current.Request.ServerVariables["SERVER_NAME"]; string prefixXPath = ""; if (Domain.Exists(currentDomain)) { - string xpathDomain = UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema ? "//node [@id = '{0}']" : "//* [@isDoc and @id = '{0}']"; + string xpathDomain = UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema ? "//node [@id = '{0}']" : "//* [@isDoc and @id = '{0}']"; prefixXPath = string.Format(xpathDomain, Domain.GetRootFromDomain(currentDomain)); _cacheUrl = false; } @@ -151,7 +151,7 @@ namespace umbraco { // the reason we have almost two identical queries in the xpath is to support scenarios where the user have // entered "/my-url" instead of "my-url" (ie. added a beginning slash) - string xpath = UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema ? "//node [contains(concat(',',translate(data [@alias = 'umbracoUrlAlias'], ' ', ''),','),',{0},') or contains(concat(',',translate(data [@alias = 'umbracoUrlAlias'], ' ', ''),','),',{1},')]" : + string xpath = UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema ? "//node [contains(concat(',',translate(data [@alias = 'umbracoUrlAlias'], ' ', ''),','),',{0},') or contains(concat(',',translate(data [@alias = 'umbracoUrlAlias'], ' ', ''),','),',{1},')]" : "//* [@isDoc and (contains(concat(',',translate(umbracoUrlAlias, ' ', ''),','),',{0},') or contains(concat(',',translate(umbracoUrlAlias, ' ', ''),','),',{1},'))]"; string query = String.Format(prefixXPath + xpath, tempUrl, "/" + tempUrl); XmlNode redir = diff --git a/src/Umbraco.Web/umbraco.presentation/UmbracoContext.cs b/src/Umbraco.Web/umbraco.presentation/UmbracoContext.cs index 612427d18a..1cf985503e 100644 --- a/src/Umbraco.Web/umbraco.presentation/UmbracoContext.cs +++ b/src/Umbraco.Web/umbraco.presentation/UmbracoContext.cs @@ -110,7 +110,7 @@ namespace umbraco.presentation { get { - return !UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema; + return !UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema; } } diff --git a/src/Umbraco.Web/umbraco.presentation/content.cs b/src/Umbraco.Web/umbraco.presentation/content.cs index 15ab10b4a4..9bf99a3b15 100644 --- a/src/Umbraco.Web/umbraco.presentation/content.cs +++ b/src/Umbraco.Web/umbraco.presentation/content.cs @@ -143,7 +143,7 @@ namespace umbraco { _xmlContent = value; - if (!UmbracoConfiguration.Current.UmbracoSettings.Content.XmlCacheEnabled && UmbracoConfiguration.Current.UmbracoSettings.Content.ContinouslyUpdateXmlDiskCache) + if (!UmbracoConfig.For.UmbracoSettings().Content.XmlCacheEnabled && UmbracoConfig.For.UmbracoSettings().Content.ContinouslyUpdateXmlDiskCache) QueueXmlForPersistence(); else // Clear cache... @@ -160,7 +160,7 @@ namespace umbraco /// private void CheckDiskCacheForUpdate() { - if (UmbracoConfiguration.Current.UmbracoSettings.Content.XmlCacheEnabled) + if (UmbracoConfig.For.UmbracoSettings().Content.XmlCacheEnabled) return; lock (TimestampSyncLock) @@ -187,7 +187,7 @@ namespace umbraco /// Returns true of the XML was not populated, returns false if it was already populated private bool CheckXmlContentPopulation() { - if (UmbracoConfiguration.Current.UmbracoSettings.Content.XmlContentCheckForDiskChanges) + if (UmbracoConfig.For.UmbracoSettings().Content.XmlContentCheckForDiskChanges) CheckDiskCacheForUpdate(); if (_xmlContent == null) @@ -208,7 +208,7 @@ namespace umbraco // Only save new XML cache to disk if we just repopulated it // TODO: Re-architect this so that a call to this method doesn't invoke a new thread for saving disk cache - if (!UmbracoConfiguration.Current.UmbracoSettings.Content.XmlCacheEnabled && !IsValidDiskCachePresent()) + if (!UmbracoConfig.For.UmbracoSettings().Content.XmlCacheEnabled && !IsValidDiskCachePresent()) { QueueXmlForPersistence(); } @@ -310,7 +310,7 @@ namespace umbraco // queues this up, because this delegate is executing on a different thread and may complete // after the request which invoked it (which would normally persist the file on completion) // So we are responsible for ensuring the content is persisted in this case. - if (!UmbracoConfiguration.Current.UmbracoSettings.Content.XmlCacheEnabled && UmbracoConfiguration.Current.UmbracoSettings.Content.ContinouslyUpdateXmlDiskCache) + if (!UmbracoConfig.For.UmbracoSettings().Content.XmlCacheEnabled && UmbracoConfig.For.UmbracoSettings().Content.ContinouslyUpdateXmlDiskCache) PersistXmlToFile(xmlDoc); }); @@ -322,7 +322,7 @@ namespace umbraco { // Remove all attributes and data nodes from the published node PublishedNode.Attributes.RemoveAll(); - string xpath = UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema ? "./data" : "./* [not(@id)]"; + string xpath = UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema ? "./data" : "./* [not(@id)]"; foreach (XmlNode n in PublishedNode.SelectNodes(xpath)) PublishedNode.RemoveChild(n); @@ -386,7 +386,7 @@ namespace umbraco // if the document is not there already then it's a new document // we must make sure that its document type exists in the schema var xmlContentCopy2 = xmlContentCopy; - if (currentNode == null && UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema == false) + if (currentNode == null && UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema == false) { xmlContentCopy = ValidateSchema(docNode.Name, xmlContentCopy); if (xmlContentCopy != xmlContentCopy2) @@ -428,7 +428,7 @@ namespace umbraco } // TODO: Update with new schema! - var xpath = UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema + var xpath = UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema ? "./node" : "./* [@id]"; @@ -471,7 +471,7 @@ namespace umbraco /// The parent node. public static void SortNodes(ref XmlNode parentNode) { - var xpath = UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema + var xpath = UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema ? "./node" : "./* [@id]"; @@ -510,7 +510,7 @@ namespace umbraco { // modify a clone of the cache because even though we're into the write-lock // we may have threads reading at the same time. why is this an option? - XmlDocument wip = UmbracoConfiguration.Current.UmbracoSettings.Content.CloneXmlContent + XmlDocument wip = UmbracoConfig.For.UmbracoSettings().Content.CloneXmlContent ? CloneXmlDoc(XmlContentInternal) : XmlContentInternal; @@ -993,7 +993,7 @@ namespace umbraco /// private XmlDocument LoadContent() { - if (!UmbracoConfiguration.Current.UmbracoSettings.Content.XmlCacheEnabled && IsValidDiskCachePresent()) + if (!UmbracoConfig.For.UmbracoSettings().Content.XmlCacheEnabled && IsValidDiskCachePresent()) { try { @@ -1195,13 +1195,13 @@ order by umbracoNode.level, umbracoNode.sortOrder"; if (hierarchy.TryGetValue(parentId, out children)) { - XmlNode childContainer = UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema || + XmlNode childContainer = UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema || String.IsNullOrEmpty(UmbracoSettings.TEMP_FRIENDLY_XML_CHILD_CONTAINER_NODENAME) ? parentNode : parentNode.SelectSingleNode( UmbracoSettings.TEMP_FRIENDLY_XML_CHILD_CONTAINER_NODENAME); - if (!UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema && + if (!UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema && !String.IsNullOrEmpty(UmbracoSettings.TEMP_FRIENDLY_XML_CHILD_CONTAINER_NODENAME)) { if (childContainer == null) @@ -1217,7 +1217,7 @@ order by umbracoNode.level, umbracoNode.sortOrder"; { XmlNode childNode = nodeIndex[childId]; - if (UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema || + if (UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema || String.IsNullOrEmpty(UmbracoSettings.TEMP_FRIENDLY_XML_CHILD_CONTAINER_NODENAME)) { parentNode.AppendChild(childNode); @@ -1320,7 +1320,7 @@ order by umbracoNode.level, umbracoNode.sortOrder"; else { //// Save copy of content - if (UmbracoConfiguration.Current.UmbracoSettings.Content.CloneXmlContent) + if (UmbracoConfig.For.UmbracoSettings().Content.CloneXmlContent) { XmlDocument xmlContentCopy = CloneXmlDoc(_xmlContent); diff --git a/src/Umbraco.Web/umbraco.presentation/default.aspx.cs b/src/Umbraco.Web/umbraco.presentation/default.aspx.cs index 8a44676516..575d9da0e1 100644 --- a/src/Umbraco.Web/umbraco.presentation/default.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/default.aspx.cs @@ -57,7 +57,7 @@ namespace umbraco _upage = _docRequest.UmbracoPage; //we need to check this for backwards compatibility in case people still arent' using master pages - if (UmbracoConfiguration.Current.UmbracoSettings.Templates.UseAspNetMasterPages) + if (UmbracoConfig.For.UmbracoSettings().Templates.UseAspNetMasterPages) { var args = new RequestInitEventArgs() { @@ -90,7 +90,7 @@ namespace umbraco //This is only here for legacy if people arent' using master pages... //TODO: We need to test that this still works!! Or do we ?? - if (!UmbracoConfiguration.Current.UmbracoSettings.Templates.UseAspNetMasterPages) + if (!UmbracoConfig.For.UmbracoSettings().Templates.UseAspNetMasterPages) { var args = new RequestInitEventArgs() { @@ -153,7 +153,7 @@ namespace umbraco if (pos > -1) { string htmlBadge = - String.Format(UmbracoConfiguration.Current.UmbracoSettings.Content.PreviewBadge, + String.Format(UmbracoConfig.For.UmbracoSettings().Content.PreviewBadge, IOHelper.ResolveUrl(SystemDirectories.Umbraco), IOHelper.ResolveUrl(SystemDirectories.UmbracoClient), Server.UrlEncode(UmbracoContext.Current.HttpContext.Request.Path)); diff --git a/src/Umbraco.Web/umbraco.presentation/helper.cs b/src/Umbraco.Web/umbraco.presentation/helper.cs index f5ff53624b..5b05f52b82 100644 --- a/src/Umbraco.Web/umbraco.presentation/helper.cs +++ b/src/Umbraco.Web/umbraco.presentation/helper.cs @@ -121,7 +121,7 @@ namespace umbraco XmlNode element = umbracoXML.GetElementById(splitpath[splitpath.Length - i - 1].ToString()); if (element == null) continue; - string xpath = UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema ? "./data [@alias = '{0}']" : "{0}"; + string xpath = UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema ? "./data [@alias = '{0}']" : "{0}"; XmlNode currentNode = element.SelectSingleNode(string.Format(xpath, keyName)); if (currentNode != null && currentNode.FirstChild != null && diff --git a/src/Umbraco.Web/umbraco.presentation/item.cs b/src/Umbraco.Web/umbraco.presentation/item.cs index 168abe3213..09cb19fced 100644 --- a/src/Umbraco.Web/umbraco.presentation/item.cs +++ b/src/Umbraco.Web/umbraco.presentation/item.cs @@ -114,7 +114,7 @@ namespace umbraco if (element == null) continue; - var xpath = UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema ? "./data [@alias = '{0}']" : "./{0}"; + var xpath = UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema ? "./data [@alias = '{0}']" : "./{0}"; var currentNode = element.SelectSingleNode(string.Format(xpath, _fieldName)); //continue if all is null @@ -184,7 +184,7 @@ namespace umbraco // OTHER FORMATTING FUNCTIONS // If we use masterpages, this is moved to the ItemRenderer to add support for before/after in inline XSLT - if (!UmbracoConfiguration.Current.UmbracoSettings.Templates.UseAspNetMasterPages) + if (!UmbracoConfig.For.UmbracoSettings().Templates.UseAspNetMasterPages) { if (_fieldContent != "" && helper.FindAttribute(attributes, "insertTextBefore") != "") _fieldContent = HttpContext.Current.Server.HtmlDecode(helper.FindAttribute(attributes, "insertTextBefore")) + diff --git a/src/Umbraco.Web/umbraco.presentation/library.cs b/src/Umbraco.Web/umbraco.presentation/library.cs index 111d62cde5..0b6c35e394 100644 --- a/src/Umbraco.Web/umbraco.presentation/library.cs +++ b/src/Umbraco.Web/umbraco.presentation/library.cs @@ -455,12 +455,12 @@ namespace umbraco { try { - if (UmbracoConfiguration.Current.UmbracoSettings.Content.UmbracoLibraryCacheDuration > 0) + if (UmbracoConfig.For.UmbracoSettings().Content.UmbracoLibraryCacheDuration > 0) { XPathNodeIterator retVal = ApplicationContext.Current.ApplicationCache.GetCacheItem( string.Format( "{0}_{1}_{2}", CacheKeys.MediaCacheKey, MediaId, Deep), - TimeSpan.FromSeconds(UmbracoConfiguration.Current.UmbracoSettings.Content.UmbracoLibraryCacheDuration), + TimeSpan.FromSeconds(UmbracoConfig.For.UmbracoSettings().Content.UmbracoLibraryCacheDuration), () => getMediaDo(MediaId, Deep)); if (retVal != null) @@ -489,7 +489,7 @@ namespace umbraco XmlDocument mXml = new XmlDocument(); mXml.LoadXml(m.ToXml(mXml, Deep).OuterXml); XPathNavigator xp = mXml.CreateNavigator(); - string xpath = UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema ? "/node" : String.Format("/{0}", Casing.SafeAliasWithForcingCheck(m.ContentType.Alias)); + string xpath = UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema ? "/node" : String.Format("/{0}", Casing.SafeAliasWithForcingCheck(m.ContentType.Alias)); return xp.Select(xpath); } return null; @@ -506,12 +506,12 @@ namespace umbraco { try { - if (UmbracoConfiguration.Current.UmbracoSettings.Content.UmbracoLibraryCacheDuration > 0) + if (UmbracoConfig.For.UmbracoSettings().Content.UmbracoLibraryCacheDuration > 0) { var retVal = ApplicationContext.Current.ApplicationCache.GetCacheItem( string.Format( "{0}_{1}", CacheKeys.MemberLibraryCacheKey, MemberId), - TimeSpan.FromSeconds(UmbracoConfiguration.Current.UmbracoSettings.Content.UmbracoLibraryCacheDuration), + TimeSpan.FromSeconds(UmbracoConfig.For.UmbracoSettings().Content.UmbracoLibraryCacheDuration), () => getMemberDo(MemberId)); if (retVal != null) @@ -980,7 +980,7 @@ namespace umbraco /// The rendered template as a string public static string RenderTemplate(int PageId, int TemplateId) { - if (UmbracoConfiguration.Current.UmbracoSettings.Templates.UseAspNetMasterPages) + if (UmbracoConfig.For.UmbracoSettings().Templates.UseAspNetMasterPages) { using (var sw = new StringWriter()) { @@ -1860,7 +1860,7 @@ namespace umbraco internal static string GetCurrentNotFoundPageId() { //XmlNode error404Node = UmbracoSettings.GetKeyAsNode("/settings/content/errors/error404"); - if (UmbracoConfiguration.Current.UmbracoSettings.Content.Error404Collection.Count() > 1) + if (UmbracoConfig.For.UmbracoSettings().Content.Error404Collection.Count() > 1) { // try to get the 404 based on current culture (via domain) IContentErrorPage cultureErr; @@ -1869,7 +1869,7 @@ namespace umbraco var d = Domain.GetDomain(HttpContext.Current.Request.ServerVariables["SERVER_NAME"]); // test if a 404 page exists with current culture - cultureErr = UmbracoConfiguration.Current.UmbracoSettings.Content.Error404Collection + cultureErr = UmbracoConfig.For.UmbracoSettings().Content.Error404Collection .FirstOrDefault(x => x.Culture == d.Language.CultureAlias); if (cultureErr != null) @@ -1880,7 +1880,7 @@ namespace umbraco } // test if a 404 page exists with current culture thread - cultureErr = UmbracoConfiguration.Current.UmbracoSettings.Content.Error404Collection + cultureErr = UmbracoConfig.For.UmbracoSettings().Content.Error404Collection .FirstOrDefault(x => x.Culture == System.Threading.Thread.CurrentThread.CurrentUICulture.Name); if (cultureErr != null) { @@ -1888,7 +1888,7 @@ namespace umbraco } // there should be a default one! - cultureErr = UmbracoConfiguration.Current.UmbracoSettings.Content.Error404Collection + cultureErr = UmbracoConfig.For.UmbracoSettings().Content.Error404Collection .FirstOrDefault(x => x.Culture == "default"); if (cultureErr != null) { @@ -1898,7 +1898,7 @@ namespace umbraco else { - return UmbracoConfiguration.Current.UmbracoSettings.Content.Error404Collection.First().ContentId.ToInvariantString(); + return UmbracoConfig.For.UmbracoSettings().Content.Error404Collection.First().ContentId.ToInvariantString(); } return ""; diff --git a/src/Umbraco.Web/umbraco.presentation/macro.cs b/src/Umbraco.Web/umbraco.presentation/macro.cs index 3653098d07..087853f0aa 100644 --- a/src/Umbraco.Web/umbraco.presentation/macro.cs +++ b/src/Umbraco.Web/umbraco.presentation/macro.cs @@ -295,7 +295,7 @@ namespace umbraco Alias = Model.Alias, ItemKey = Model.ScriptName, Exception = e, - Behaviour = UmbracoConfiguration.Current.UmbracoSettings.Content.MacroErrorBehaviour + Behaviour = UmbracoConfig.For.UmbracoSettings().Content.MacroErrorBehaviour }; return GetControlForErrorBehavior("Error loading Partial View script (file: " + ScriptFile + ")", macroErrorEventArgs); }; @@ -363,7 +363,7 @@ namespace umbraco Alias = Model.Alias, ItemKey = Model.TypeName, Exception = e, - Behaviour = UmbracoConfiguration.Current.UmbracoSettings.Content.MacroErrorBehaviour + Behaviour = UmbracoConfig.For.UmbracoSettings().Content.MacroErrorBehaviour }; macroControl = GetControlForErrorBehavior("Error loading userControl '" + Model.TypeName + "'", macroErrorEventArgs); @@ -404,7 +404,7 @@ namespace umbraco Alias = Model.Alias, ItemKey = Model.TypeAssembly, Exception = e, - Behaviour = UmbracoConfiguration.Current.UmbracoSettings.Content.MacroErrorBehaviour + Behaviour = UmbracoConfig.For.UmbracoSettings().Content.MacroErrorBehaviour }; macroControl = GetControlForErrorBehavior("Error loading customControl (Assembly: " + Model.TypeAssembly + ", Type: '" + Model.TypeName + "'", macroErrorEventArgs); @@ -436,7 +436,7 @@ namespace umbraco Alias = Model.Alias, ItemKey = ScriptFile, Exception = e, - Behaviour = UmbracoConfiguration.Current.UmbracoSettings.Content.MacroErrorBehaviour + Behaviour = UmbracoConfig.For.UmbracoSettings().Content.MacroErrorBehaviour }; return GetControlForErrorBehavior("Error loading MacroEngine script (file: " + ScriptFile + ")", macroErrorEventArgs); @@ -892,7 +892,7 @@ namespace umbraco Exceptions.Add(e); LogHelper.WarnWithException("Error parsing XSLT file", e); - var macroErrorEventArgs = new MacroErrorEventArgs { Name = Model.Name, Alias = Model.Alias, ItemKey = Model.Xslt, Exception = e, Behaviour = UmbracoConfiguration.Current.UmbracoSettings.Content.MacroErrorBehaviour }; + var macroErrorEventArgs = new MacroErrorEventArgs { Name = Model.Name, Alias = Model.Alias, ItemKey = Model.Xslt, Exception = e, Behaviour = UmbracoConfig.For.UmbracoSettings().Content.MacroErrorBehaviour }; var macroControl = GetControlForErrorBehavior("Error parsing XSLT file: \\xslt\\" + XsltFile, macroErrorEventArgs); //if it is null, then we are supposed to throw the (original) exception // see: http://issues.umbraco.org/issue/U4-497 at the end @@ -910,7 +910,7 @@ namespace umbraco LogHelper.WarnWithException("Error loading XSLT " + Model.Xslt, true, e); // Invoke any error handlers for this macro - var macroErrorEventArgs = new MacroErrorEventArgs { Name = Model.Name, Alias = Model.Alias, ItemKey = Model.Xslt, Exception = e, Behaviour = UmbracoConfiguration.Current.UmbracoSettings.Content.MacroErrorBehaviour }; + var macroErrorEventArgs = new MacroErrorEventArgs { Name = Model.Name, Alias = Model.Alias, ItemKey = Model.Xslt, Exception = e, Behaviour = UmbracoConfig.For.UmbracoSettings().Content.MacroErrorBehaviour }; var macroControl = GetControlForErrorBehavior("Error reading XSLT file: \\xslt\\" + XsltFile, macroErrorEventArgs); //if it is null, then we are supposed to throw the (original) exception // see: http://issues.umbraco.org/issue/U4-497 at the end diff --git a/src/Umbraco.Web/umbraco.presentation/publishingService.cs b/src/Umbraco.Web/umbraco.presentation/publishingService.cs index 3555c6a368..af88c472cb 100644 --- a/src/Umbraco.Web/umbraco.presentation/publishingService.cs +++ b/src/Umbraco.Web/umbraco.presentation/publishingService.cs @@ -62,7 +62,7 @@ namespace umbraco.presentation // run scheduled url tasks try { - foreach (var t in UmbracoConfiguration.Current.UmbracoSettings.ScheduledTasks.Tasks) + foreach (var t in UmbracoConfig.For.UmbracoSettings().ScheduledTasks.Tasks) { bool runTask = false; if (!ScheduledTaskTimes.ContainsKey(t.Alias)) diff --git a/src/Umbraco.Web/umbraco.presentation/requestModule.cs b/src/Umbraco.Web/umbraco.presentation/requestModule.cs index 3f830aca21..14fe89193e 100644 --- a/src/Umbraco.Web/umbraco.presentation/requestModule.cs +++ b/src/Umbraco.Web/umbraco.presentation/requestModule.cs @@ -157,7 +157,7 @@ namespace umbraco.presentation } // show splash? - else if (UmbracoConfiguration.Current.UmbracoSettings.Content.EnableSplashWhileLoading && content.Instance.isInitializing) + else if (UmbracoConfig.For.UmbracoSettings().Content.EnableSplashWhileLoading && content.Instance.isInitializing) context.RewritePath(string.Format("{0}/splashes/booting.aspx", SystemDirectories.Config)); // rewrite page path else @@ -361,7 +361,7 @@ namespace umbraco.presentation { LogHelper.Info(string.Format("Application started at {0}", DateTime.Now)); - if (UmbracoConfiguration.Current.UmbracoSettings.Logging.AutoCleanLogs) + if (UmbracoConfig.For.UmbracoSettings().Logging.AutoCleanLogs) { AddTask(LOG_SCRUBBER_TASK_NAME, GetLogScrubbingInterval()); } @@ -421,8 +421,8 @@ namespace umbraco.presentation int interval = 24 * 60 * 60; //24 hours try { - if (UmbracoConfiguration.Current.UmbracoSettings.Logging.CleaningMiliseconds > -1) - interval = UmbracoConfiguration.Current.UmbracoSettings.Logging.CleaningMiliseconds; + if (UmbracoConfig.For.UmbracoSettings().Logging.CleaningMiliseconds > -1) + interval = UmbracoConfig.For.UmbracoSettings().Logging.CleaningMiliseconds; } catch (Exception) { @@ -436,8 +436,8 @@ namespace umbraco.presentation int maximumAge = 24 * 60 * 60; try { - if (UmbracoConfiguration.Current.UmbracoSettings.Logging.MaxLogAge > -1) - maximumAge = UmbracoConfiguration.Current.UmbracoSettings.Logging.MaxLogAge; + if (UmbracoConfig.For.UmbracoSettings().Logging.MaxLogAge > -1) + maximumAge = UmbracoConfig.For.UmbracoSettings().Logging.MaxLogAge; } catch (Exception) { diff --git a/src/Umbraco.Web/umbraco.presentation/template.cs b/src/Umbraco.Web/umbraco.presentation/template.cs index 65c8b514b4..1b51a735ca 100644 --- a/src/Umbraco.Web/umbraco.presentation/template.cs +++ b/src/Umbraco.Web/umbraco.presentation/template.cs @@ -265,7 +265,7 @@ namespace umbraco pageContent.Controls.Add(new LiteralControl("
")); // NH: Switching to custom controls for macros - if (UmbracoConfiguration.Current.UmbracoSettings.Templates.UseAspNetMasterPages) + if (UmbracoConfig.For.UmbracoSettings().Templates.UseAspNetMasterPages) { umbraco.presentation.templateControls.Macro macroControl = new umbraco.presentation.templateControls.Macro(); macroControl.Alias = helper.FindAttribute(attributes, "macroalias"); @@ -311,7 +311,7 @@ namespace umbraco { // NH: Switching to custom controls for items - if (UmbracoConfiguration.Current.UmbracoSettings.Templates.UseAspNetMasterPages) + if (UmbracoConfig.For.UmbracoSettings().Templates.UseAspNetMasterPages) { umbraco.presentation.templateControls.Item itemControl = new umbraco.presentation.templateControls.Item(); itemControl.Field = helper.FindAttribute(attributes, "field"); @@ -525,7 +525,7 @@ namespace umbraco this._templateName = t._templateName; // Only check for master on legacy templates - can show error when using master pages. - if (!UmbracoConfiguration.Current.UmbracoSettings.Templates.UseAspNetMasterPages) + if (!UmbracoConfig.For.UmbracoSettings().Templates.UseAspNetMasterPages) { checkForMaster(tId); } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/ActionHandlers/umbEnsureUniqueName.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/ActionHandlers/umbEnsureUniqueName.cs index ed922a8709..8a311aae44 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/ActionHandlers/umbEnsureUniqueName.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/ActionHandlers/umbEnsureUniqueName.cs @@ -38,7 +38,7 @@ namespace umbraco.ActionHandlers public bool Execute(umbraco.cms.businesslogic.web.Document documentObject, interfaces.IAction action) { - if (UmbracoConfiguration.Current.UmbracoSettings.Content.EnsureUniqueNaming) + if (UmbracoConfig.For.UmbracoSettings().Content.EnsureUniqueNaming) { string currentName = documentObject.Text; int uniqueNumber = 1; diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadTemplates.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadTemplates.cs index b313b200ac..5056d970e7 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadTemplates.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadTemplates.cs @@ -72,7 +72,7 @@ namespace umbraco RenderTemplateFolderItems(folder, folderPath, ref tree); else { - if (UmbracoConfiguration.Current.UmbracoSettings.Templates.EnableTemplateFolders) + if (UmbracoConfig.For.UmbracoSettings().Templates.EnableTemplateFolders) RenderTemplateFolders(ref tree); RenderTemplates(ref tree); @@ -195,7 +195,7 @@ namespace umbraco xNode.Source = GetTreeServiceUrl(t.Id); xNode.HasChildren = t.HasChildren; - if (UmbracoConfiguration.Current.UmbracoSettings.Templates.DefaultRenderingEngine == RenderingEngine.Mvc && ViewHelper.ViewExists(t)) + if (UmbracoConfig.For.UmbracoSettings().Templates.DefaultRenderingEngine == RenderingEngine.Mvc && ViewHelper.ViewExists(t)) { xNode.Action = "javascript:openView(" + t.Id + ");"; xNode.Icon = "icon-newspaper-alt"; diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadUsers.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadUsers.cs index 57b8cbd86a..5db7a06dab 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadUsers.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadUsers.cs @@ -72,8 +72,8 @@ function openUser(id) { bool currUserIsAdmin = currUser.IsAdmin(); foreach (User u in users.OrderBy(x => x.Disabled)) { - if (!UmbracoConfiguration.Current.UmbracoSettings.Security.HideDisabledUsersInBackoffice - || (UmbracoConfiguration.Current.UmbracoSettings.Security.HideDisabledUsersInBackoffice && !u.Disabled)) + if (!UmbracoConfig.For.UmbracoSettings().Security.HideDisabledUsersInBackoffice + || (UmbracoConfig.For.UmbracoSettings().Security.HideDisabledUsersInBackoffice && !u.Disabled)) { XmlTreeNode xNode = XmlTreeNode.Create(this); diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/channels/UmbracoMetaWeblogAPI.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/channels/UmbracoMetaWeblogAPI.cs index 348e4ffb81..c048ada53b 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/channels/UmbracoMetaWeblogAPI.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/channels/UmbracoMetaWeblogAPI.cs @@ -76,7 +76,7 @@ namespace umbraco.presentation.channels doc.getProperty(userChannel.FieldExcerptAlias).Value = removeLeftUrl(post.mt_excerpt); - if (UmbracoConfiguration.Current.UmbracoSettings.Content.TidyEditorContent) + if (UmbracoConfig.For.UmbracoSettings().Content.TidyEditorContent) doc.getProperty(userChannel.FieldDescriptionAlias).Value = library.Tidy(removeLeftUrl(post.description), false); else doc.getProperty(userChannel.FieldDescriptionAlias).Value = removeLeftUrl(post.description); @@ -387,7 +387,7 @@ namespace umbraco.presentation.channels // Description - if (UmbracoConfiguration.Current.UmbracoSettings.Content.TidyEditorContent) + if (UmbracoConfig.For.UmbracoSettings().Content.TidyEditorContent) doc.getProperty(userChannel.FieldDescriptionAlias).Value = library.Tidy(removeLeftUrl(post.description), false); else doc.getProperty(userChannel.FieldDescriptionAlias).Value = removeLeftUrl(post.description); @@ -517,7 +517,7 @@ namespace umbraco.presentation.channels private static bool validateUser(string username, string password) { - return Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.DefaultBackOfficeUserProvider].ValidateUser(username, password); + return Membership.Providers[UmbracoConfig.For.UmbracoSettings().Providers.DefaultBackOfficeUserProvider].ValidateUser(username, password); } [XmlRpcMethod("blogger.getUsersBlogs", diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentControl.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentControl.cs index 25905a8a40..7ebe703486 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentControl.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentControl.cs @@ -527,7 +527,7 @@ namespace umbraco.controls { string caption = p.PropertyType.Name; if (p.PropertyType.Description != null && p.PropertyType.Description != String.Empty) - switch (UmbracoConfiguration.Current.UmbracoSettings.Content.PropertyContextHelpOption) + switch (UmbracoConfig.For.UmbracoSettings().Content.PropertyContextHelpOption) { case "icon": caption += " \"""; diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/GenericProperties/GenericProperty.ascx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/GenericProperties/GenericProperty.ascx.cs index 9040931eba..af0986aee0 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/GenericProperties/GenericProperty.ascx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/GenericProperties/GenericProperty.ascx.cs @@ -247,7 +247,7 @@ namespace umbraco.controls.GenericProperties private void SetDefaultDocumentTypeProperty() { var itemToSelect = ddlTypes.Items.Cast() - .FirstOrDefault(item => item.Text.ToLowerInvariant() == UmbracoConfiguration.Current.UmbracoSettings.Content.DefaultDocumentTypeProperty.ToLowerInvariant()); + .FirstOrDefault(item => item.Text.ToLowerInvariant() == UmbracoConfig.For.UmbracoSettings().Content.DefaultDocumentTypeProperty.ToLowerInvariant()); if (itemToSelect != null) { diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/macroParameterControl.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/macroParameterControl.cs index 3048eea2cf..cbabf377fd 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/macroParameterControl.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/macroParameterControl.cs @@ -75,7 +75,7 @@ namespace umbraco.controls /// The correct syntax for the macro including all parameters public string GetMacroTag() { string tag = ""; - if (UmbracoConfiguration.Current.UmbracoSettings.Templates.UseAspNetMasterPages) + if (UmbracoConfig.For.UmbracoSettings().Templates.UseAspNetMasterPages) { tag = " 0) diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/create/userTasks.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/create/userTasks.cs index 17d17a5dc5..bd9443fb3a 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/create/userTasks.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/create/userTasks.cs @@ -37,10 +37,10 @@ namespace umbraco try { // Password is auto-generated. They are they required to change the password by editing the user information. - var u = Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.DefaultBackOfficeUserProvider].CreateUser(Alias, + var u = Membership.Providers[UmbracoConfig.For.UmbracoSettings().Providers.DefaultBackOfficeUserProvider].CreateUser(Alias, Membership.GeneratePassword( - Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.DefaultBackOfficeUserProvider].MinRequiredPasswordLength, - Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.DefaultBackOfficeUserProvider].MinRequiredNonAlphanumericCharacters), + Membership.Providers[UmbracoConfig.For.UmbracoSettings().Providers.DefaultBackOfficeUserProvider].MinRequiredPasswordLength, + Membership.Providers[UmbracoConfig.For.UmbracoSettings().Providers.DefaultBackOfficeUserProvider].MinRequiredNonAlphanumericCharacters), "", "", "", true, null, out status); _returnUrl = string.Format("users/EditUser.aspx?id={0}", u.ProviderUserKey); diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/create/xslt.ascx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/create/xslt.ascx.cs index b6d1929764..db7cdd79c8 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/create/xslt.ascx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/create/xslt.ascx.cs @@ -60,7 +60,7 @@ namespace umbraco.presentation.create private static string getXsltTemplatePath() { - if (UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema) { + if (UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema) { return "/xslt/templates"; } else { return "/xslt/templates/schema2"; @@ -75,7 +75,7 @@ namespace umbraco.presentation.create if (createMacro.Checked) createMacroVal = 1; - var xsltName = UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema ? xsltTemplate.SelectedValue : + var xsltName = UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema ? xsltTemplate.SelectedValue : Path.Combine("schema2", xsltTemplate.SelectedValue); var returnUrl = LegacyDialogHandler.Create( diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dashboard/ChangePassword.ascx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dashboard/ChangePassword.ascx.cs index 3364a8e42a..5ac63185d6 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dashboard/ChangePassword.ascx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dashboard/ChangePassword.ascx.cs @@ -20,7 +20,7 @@ namespace umbraco.presentation.umbraco.dashboard protected void changePassword_Click(object sender, EventArgs e) { User u = User.GetCurrent(); - MembershipProvider provider = Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.DefaultBackOfficeUserProvider]; + MembershipProvider provider = Membership.Providers[UmbracoConfig.For.UmbracoSettings().Providers.DefaultBackOfficeUserProvider]; MembershipUser user = provider.GetUser(u.LoginName, true); diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/BrowseRepository.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/BrowseRepository.aspx.cs index 95471ece48..6085caeb48 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/BrowseRepository.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/BrowseRepository.aspx.cs @@ -56,7 +56,7 @@ namespace umbraco.presentation.developer.packages { UmbracoVersion.Current.Major, UmbracoVersion.Current.Minor, UmbracoVersion.Current.Build, - UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema.ToString(), Environment.Version, + UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema.ToString(), Environment.Version, Umbraco.Core.SystemUtilities.GetCurrentTrustLevel()); } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/LoadNitros.ascx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/LoadNitros.ascx.cs index 59ff27b0ec..f258ecf323 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/LoadNitros.ascx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/LoadNitros.ascx.cs @@ -177,7 +177,7 @@ namespace umbraco.presentation.developer.packages { try { - if (UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema) + if (UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema) rep_nitros.DataSource = repo.Webservice.NitrosCategorizedByVersion(cms.businesslogic.packager.repositories.Version.Version4); else rep_nitros.DataSource = repo.Webservice.NitrosCategorizedByVersion(cms.businesslogic.packager.repositories.Version.Version41); diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/xsltInsertValueOf.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/xsltInsertValueOf.aspx.cs index 9c6c693cd3..b8fbdf25a5 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/xsltInsertValueOf.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/xsltInsertValueOf.aspx.cs @@ -38,7 +38,7 @@ namespace umbraco.developer foreach (PropertyType pt in PropertyType.GetAll()) if (!existingGenProps.Contains("," + pt.Alias + ",")) { - if(UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema) + if(UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema) preValuesSource.Add(string.Format("data [@alias = '{0}']", pt.Alias)); else preValuesSource.Add(pt.Alias); diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/umbracoField.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/umbracoField.aspx.cs index 0317d64f13..6666898a6d 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/umbracoField.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/umbracoField.aspx.cs @@ -43,7 +43,7 @@ namespace umbraco.dialogs pp_removePTags.Text = ui.Text("templateEditor", "removeParagraph"); - if (UmbracoConfiguration.Current.UmbracoSettings.Templates.UseAspNetMasterPages) + if (UmbracoConfig.For.UmbracoSettings().Templates.UseAspNetMasterPages) { tagName.Value = "umbraco:Item"; } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/login.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/login.aspx.cs index 62c3f32b70..f5bb290d47 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/login.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/login.aspx.cs @@ -70,10 +70,10 @@ namespace umbraco.cms.presentation protected void Button1_Click(object sender, System.EventArgs e) { // Authenticate users by using the provider specified in umbracoSettings.config - if (Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.DefaultBackOfficeUserProvider].ValidateUser(lname.Text, passw.Text)) + if (Membership.Providers[UmbracoConfig.For.UmbracoSettings().Providers.DefaultBackOfficeUserProvider].ValidateUser(lname.Text, passw.Text)) { - if (Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.DefaultBackOfficeUserProvider] is ActiveDirectoryMembershipProvider) - ActiveDirectoryMapping(lname.Text, Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.DefaultBackOfficeUserProvider].GetUser(lname.Text, false).Email); + if (Membership.Providers[UmbracoConfig.For.UmbracoSettings().Providers.DefaultBackOfficeUserProvider] is ActiveDirectoryMembershipProvider) + ActiveDirectoryMapping(lname.Text, Membership.Providers[UmbracoConfig.For.UmbracoSettings().Providers.DefaultBackOfficeUserProvider].GetUser(lname.Text, false).Email); var u = new User(lname.Text); doLogin(u); diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/nodeFactory/Node.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/nodeFactory/Node.cs index 35cdf50281..db5046d196 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/nodeFactory/Node.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/nodeFactory/Node.cs @@ -489,7 +489,7 @@ namespace umbraco.NodeFactory if (_pageXmlNode.Attributes.GetNamedItem("writerID") != null) _writerID = int.Parse(_pageXmlNode.Attributes.GetNamedItem("writerID").Value); - if (UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema) + if (UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema) { if (_pageXmlNode.Attributes.GetNamedItem("nodeTypeAlias") != null) _nodeTypeAlias = _pageXmlNode.Attributes.GetNamedItem("nodeTypeAlias").Value; @@ -513,12 +513,12 @@ namespace umbraco.NodeFactory } // load data - string dataXPath = UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema ? "data" : "* [not(@isDoc)]"; + string dataXPath = UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema ? "data" : "* [not(@isDoc)]"; foreach (XmlNode n in _pageXmlNode.SelectNodes(dataXPath)) _properties.Add(new Property(n)); // load children - string childXPath = UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema ? "node" : "* [@isDoc]"; + string childXPath = UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema ? "node" : "* [@isDoc]"; XPathNavigator nav = _pageXmlNode.CreateNavigator(); XPathExpression expr = nav.Compile(childXPath); expr.AddSort("@sortOrder", XmlSortOrder.Ascending, XmlCaseOrder.None, "", XmlDataType.Number); diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/nodeFactory/Page_Legacy.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/nodeFactory/Page_Legacy.cs index 6e900df610..a779d4bcdd 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/nodeFactory/Page_Legacy.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/nodeFactory/Page_Legacy.cs @@ -465,7 +465,7 @@ namespace umbraco.presentation.nodeFactory if (_pageXmlNode.Attributes.GetNamedItem("writerID") != null) _writerID = int.Parse(_pageXmlNode.Attributes.GetNamedItem("writerID").Value); - if (UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema) + if (UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema) { if (_pageXmlNode.Attributes.GetNamedItem("nodeTypeAlias") != null) _nodeTypeAlias = _pageXmlNode.Attributes.GetNamedItem("nodeTypeAlias").Value; @@ -486,12 +486,12 @@ namespace umbraco.presentation.nodeFactory } // load data - string dataXPath = UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema ? "data" : "* [not(@isDoc)]"; + string dataXPath = UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema ? "data" : "* [not(@isDoc)]"; foreach (XmlNode n in _pageXmlNode.SelectNodes(dataXPath)) _properties.Add(new Property(n)); // load children - string childXPath = UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema ? "node" : "* [@isDoc]"; + string childXPath = UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema ? "node" : "* [@isDoc]"; XPathNavigator nav = _pageXmlNode.CreateNavigator(); XPathExpression expr = nav.Compile(childXPath); expr.AddSort("@sortOrder", XmlSortOrder.Ascending, XmlCaseOrder.None, "", XmlDataType.Number); @@ -569,7 +569,7 @@ namespace umbraco.presentation.nodeFactory // For backward compatibility with 2.x (the version attribute has been removed from 3.0 data nodes) if (PropertyXmlData.Attributes.GetNamedItem("versionID") != null) _version = new Guid(PropertyXmlData.Attributes.GetNamedItem("versionID").Value); - _alias = UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema ? + _alias = UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema ? PropertyXmlData.Attributes.GetNamedItem("alias").Value : PropertyXmlData.Name; _value = xmlHelper.GetNodeValue(PropertyXmlData); diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/nodeFactory/Property.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/nodeFactory/Property.cs index a5b85bfc2f..b44a4882b2 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/nodeFactory/Property.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/nodeFactory/Property.cs @@ -48,7 +48,7 @@ namespace umbraco.NodeFactory // For backward compatibility with 2.x (the version attribute has been removed from 3.0 data nodes) if (PropertyXmlData.Attributes.GetNamedItem("versionID") != null) _version = new Guid(PropertyXmlData.Attributes.GetNamedItem("versionID").Value); - _alias = UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema ? + _alias = UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema ? PropertyXmlData.Attributes.GetNamedItem("alias").Value : PropertyXmlData.Name; _value = xmlHelper.GetNodeValue(PropertyXmlData); diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/editTemplate.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/editTemplate.aspx.cs index 0b8a8f1e7f..91835f44ab 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/editTemplate.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/editTemplate.aspx.cs @@ -132,7 +132,7 @@ namespace umbraco.cms.presentation.settings editorSource.Menu.NewElement("div", "splitButtonMacroPlaceHolder", "sbPlaceHolder", 40); - if (UmbracoConfiguration.Current.UmbracoSettings.Templates.UseAspNetMasterPages) + if (UmbracoConfig.For.UmbracoSettings().Templates.UseAspNetMasterPages) { MenuIconI umbContainer = editorSource.Menu.NewIcon(); umbContainer.ImageURL = UmbracoPath + "/images/editor/masterpagePlaceHolder.gif"; diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/scripts/editScript.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/scripts/editScript.aspx.cs index dae8ad16d6..850cc5eb33 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/scripts/editScript.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/scripts/editScript.aspx.cs @@ -57,15 +57,15 @@ namespace umbraco.cms.presentation.settings.scripts lttPath.Text = "" + path + ""; - var exts = UmbracoConfiguration.Current.UmbracoSettings.Content.ScriptFileTypes.ToList(); - if (UmbracoConfiguration.Current.UmbracoSettings.Templates.DefaultRenderingEngine == RenderingEngine.Mvc) + var exts = UmbracoConfig.For.UmbracoSettings().Content.ScriptFileTypes.ToList(); + if (UmbracoConfig.For.UmbracoSettings().Templates.DefaultRenderingEngine == RenderingEngine.Mvc) { exts.Add("cshtml"); exts.Add("vbhtml"); } var dirs = SystemDirectories.Scripts; - if (UmbracoConfiguration.Current.UmbracoSettings.Templates.DefaultRenderingEngine == RenderingEngine.Mvc) + if (UmbracoConfig.For.UmbracoSettings().Templates.DefaultRenderingEngine == RenderingEngine.Mvc) dirs += "," + SystemDirectories.MvcViews; // validate file diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/default.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/translation/default.aspx.cs index 78da6d2d4f..8064dd3627 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/default.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/translation/default.aspx.cs @@ -188,7 +188,7 @@ namespace umbraco.presentation.translation foreach (XmlNode taskXml in tasks) { - string xpath = UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema ? "node" : "* [@isDoc]"; + string xpath = UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema ? "node" : "* [@isDoc]"; XmlNode taskNode = taskXml.SelectSingleNode(xpath); // validate file diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/xml.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/translation/xml.aspx.cs index 6352041dbd..cd070e0a5a 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/xml.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/translation/xml.aspx.cs @@ -69,7 +69,7 @@ namespace umbraco.presentation.translation while (ide.MoveNext()) { var x = (XmlElement)ide.Value; - var parentXpath = UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema ? "//node [@id = '" + x.SelectSingleNode("//node").Attributes.GetNamedItem("parentID").Value + "']" : + var parentXpath = UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema ? "//node [@id = '" + x.SelectSingleNode("//node").Attributes.GetNamedItem("parentID").Value + "']" : "//* [@isDoc and @id = '" + x.SelectSingleNode("//* [@isDoc]").Attributes.GetNamedItem("parentID").Value + "']"; var parent = _xd.SelectSingleNode(parentXpath); diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/uQuery/uQuery.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/uQuery/uQuery.cs index e96fade2b6..0e17c0400f 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/uQuery/uQuery.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/uQuery/uQuery.cs @@ -107,7 +107,7 @@ namespace umbraco try { - isLegacyXmlSchema = UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema; + isLegacyXmlSchema = UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema; } catch (MissingMethodException) { 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 a3679e4a22..cdafda1c0a 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/users/EditUser.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/users/EditUser.aspx.cs @@ -302,7 +302,7 @@ namespace umbraco.cms.presentation.user if (!IsPostBack) { - MembershipUser user = Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.DefaultBackOfficeUserProvider].GetUser(u.LoginName, true); + MembershipUser user = Membership.Providers[UmbracoConfig.For.UmbracoSettings().Providers.DefaultBackOfficeUserProvider].GetUser(u.LoginName, true); uname.Text = u.Name; lname.Text = (user == null) ? u.LoginName : user.UserName; email.Text = (user == null) ? u.Email : user.Email; @@ -367,7 +367,7 @@ namespace umbraco.cms.presentation.user { try { - MembershipUser user = Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.DefaultBackOfficeUserProvider].GetUser(u.LoginName, true); + MembershipUser user = Membership.Providers[UmbracoConfig.For.UmbracoSettings().Providers.DefaultBackOfficeUserProvider].GetUser(u.LoginName, true); string tempPassword = ((controls.passwordChanger)passw.Controls[0]).Password; @@ -379,14 +379,14 @@ namespace umbraco.cms.presentation.user } // Is it using the default membership provider - if (Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.DefaultBackOfficeUserProvider] is UsersMembershipProvider) + if (Membership.Providers[UmbracoConfig.For.UmbracoSettings().Providers.DefaultBackOfficeUserProvider] is UsersMembershipProvider) { // Save user in membership provider UsersMembershipUser umbracoUser = user as UsersMembershipUser; umbracoUser.FullName = uname.Text.Trim(); umbracoUser.Language = userLanguage.SelectedValue; umbracoUser.UserType = UserType.GetUserType(int.Parse(userType.SelectedValue)); - Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.DefaultBackOfficeUserProvider].UpdateUser(umbracoUser); + Membership.Providers[UmbracoConfig.For.UmbracoSettings().Providers.DefaultBackOfficeUserProvider].UpdateUser(umbracoUser); // Save user details u.Email = email.Text.Trim(); @@ -397,7 +397,7 @@ namespace umbraco.cms.presentation.user u.Name = uname.Text.Trim(); u.Language = userLanguage.SelectedValue; u.UserType = UserType.GetUserType(int.Parse(userType.SelectedValue)); - if (!(Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.DefaultBackOfficeUserProvider] is ActiveDirectoryMembershipProvider)) Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.DefaultBackOfficeUserProvider].UpdateUser(user); + if (!(Membership.Providers[UmbracoConfig.For.UmbracoSettings().Providers.DefaultBackOfficeUserProvider] is ActiveDirectoryMembershipProvider)) Membership.Providers[UmbracoConfig.For.UmbracoSettings().Providers.DefaultBackOfficeUserProvider].UpdateUser(user); } 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 6746f15407..403b8e4816 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/MediaUploader.ashx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/MediaUploader.ashx.cs @@ -223,7 +223,7 @@ namespace umbraco.presentation.umbraco.webservices if (!string.IsNullOrEmpty(username) && !string.IsNullOrEmpty(password)) { - var mp = Membership.Providers[UmbracoConfiguration.Current.UmbracoSettings.Providers.DefaultBackOfficeUserProvider]; + var mp = Membership.Providers[UmbracoConfig.For.UmbracoSettings().Providers.DefaultBackOfficeUserProvider]; if (mp != null && mp.ValidateUser(username, password)) { var user = new User(username); diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/codeEditorSave.asmx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/codeEditorSave.asmx.cs index 3f820c1aa4..5a6061e5f1 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/codeEditorSave.asmx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/codeEditorSave.asmx.cs @@ -99,7 +99,7 @@ namespace umbraco.presentation.webservices try { // Check if there's any documents yet - string xpath = UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema ? "/root/node" : "/root/*"; + string xpath = UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema ? "/root/node" : "/root/*"; if (content.Instance.XmlContent.SelectNodes(xpath).Count > 0) { var macroXML = new XmlDocument(); @@ -282,7 +282,7 @@ namespace umbraco.presentation.webservices { var engine = MacroEngineFactory.GetByFilename(tempFileName); var tempErrorMessage = ""; - var xpath = UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema ? "/root/node" : "/root/*"; + var xpath = UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema ? "/root/node" : "/root/*"; if ( !engine.Validate(fileContents, tempFileName, Node.GetNodeByXpath(xpath), out tempErrorMessage)) @@ -380,7 +380,7 @@ namespace umbraco.presentation.webservices SystemDirectories.Scripts); // validate extension IOHelper.ValidateFileExtension(IOHelper.MapPath(SystemDirectories.Scripts + "/" + filename), - UmbracoConfiguration.Current.UmbracoSettings.Content.ScriptFileTypes.ToList()); + UmbracoConfig.For.UmbracoSettings().Content.ScriptFileTypes.ToList()); var val = contents; diff --git a/src/Umbraco.Web/umbraco.presentation/viewstateMoverModule.cs b/src/Umbraco.Web/umbraco.presentation/viewstateMoverModule.cs index 0e110d9759..e2b0cd62ed 100644 --- a/src/Umbraco.Web/umbraco.presentation/viewstateMoverModule.cs +++ b/src/Umbraco.Web/umbraco.presentation/viewstateMoverModule.cs @@ -27,7 +27,7 @@ namespace umbraco.presentation void IHttpModule.Init(HttpApplication context) { - if (UmbracoConfiguration.Current.UmbracoSettings.ViewStateMoverModule.Enable) + if (UmbracoConfig.For.UmbracoSettings().ViewStateMoverModule.Enable) { context.BeginRequest += new EventHandler(context_BeginRequest); } diff --git a/src/umbraco.MacroEngines/RazorDynamicNode/DynamicNode.cs b/src/umbraco.MacroEngines/RazorDynamicNode/DynamicNode.cs index 2359e2eb9c..c4ee935461 100644 --- a/src/umbraco.MacroEngines/RazorDynamicNode/DynamicNode.cs +++ b/src/umbraco.MacroEngines/RazorDynamicNode/DynamicNode.cs @@ -486,7 +486,7 @@ namespace umbraco.MacroEngines var dataType = GetDataType(propResult.ContextAlias, propResult.Alias); //now we need to map to the old object until we can clean all this nonsense up - var configMapping = UmbracoConfiguration.Current.UmbracoSettings.Scripting.DataTypeModelStaticMappings + var configMapping = UmbracoConfig.For.UmbracoSettings().Scripting.DataTypeModelStaticMappings .Select(x => new RazorDataTypeModelStaticMappingItem() { DataTypeGuid = x.DataTypeGuid, @@ -812,7 +812,7 @@ namespace umbraco.MacroEngines //check that the document element is not one of the disallowed elements //allows RTE to still return as html if it's valid xhtml string documentElement = e.Name.LocalName; - if (UmbracoConfiguration.Current.UmbracoSettings.Scripting.NotDynamicXmlDocumentElements.Any(tag => + if (UmbracoConfig.For.UmbracoSettings().Scripting.NotDynamicXmlDocumentElements.Any(tag => string.Equals(tag.Element, documentElement, StringComparison.CurrentCultureIgnoreCase)) == false) { result = new DynamicXml(e); diff --git a/src/umbraco.businesslogic/Log.cs b/src/umbraco.businesslogic/Log.cs index 7bdfe01c73..4803bf5dcc 100644 --- a/src/umbraco.businesslogic/Log.cs +++ b/src/umbraco.businesslogic/Log.cs @@ -31,13 +31,13 @@ namespace umbraco.BusinessLogic if (_externalLoggerInitiated == false) { _externalLoggerInitiated = true; - if (string.IsNullOrEmpty(UmbracoConfiguration.Current.UmbracoSettings.Logging.ExternalLoggerAssembly) == false - && string.IsNullOrEmpty(UmbracoConfiguration.Current.UmbracoSettings.Logging.ExternalLoggerType) == false) + if (string.IsNullOrEmpty(UmbracoConfig.For.UmbracoSettings().Logging.ExternalLoggerAssembly) == false + && string.IsNullOrEmpty(UmbracoConfig.For.UmbracoSettings().Logging.ExternalLoggerType) == false) { try { - var assemblyPath = IOHelper.MapPath(UmbracoConfiguration.Current.UmbracoSettings.Logging.ExternalLoggerAssembly); - _externalLogger = Assembly.LoadFrom(assemblyPath).CreateInstance(UmbracoConfiguration.Current.UmbracoSettings.Logging.ExternalLoggerType) as Interfaces.ILog; + var assemblyPath = IOHelper.MapPath(UmbracoConfig.For.UmbracoSettings().Logging.ExternalLoggerAssembly); + _externalLogger = Assembly.LoadFrom(assemblyPath).CreateInstance(UmbracoConfig.For.UmbracoSettings().Logging.ExternalLoggerType) as Interfaces.ILog; } catch (Exception ee) { @@ -78,21 +78,21 @@ namespace umbraco.BusinessLogic { Instance.ExternalLogger.Add(type, user, nodeId, comment); - if (UmbracoConfiguration.Current.UmbracoSettings.Logging.ExternalLoggerEnableAuditTrail == false) + if (UmbracoConfig.For.UmbracoSettings().Logging.ExternalLoggerEnableAuditTrail == false) { AddLocally(type, user, nodeId, comment); } } else { - if (UmbracoConfiguration.Current.UmbracoSettings.Logging.EnableLogging == false) return; + if (UmbracoConfig.For.UmbracoSettings().Logging.EnableLogging == false) return; - if (UmbracoConfiguration.Current.UmbracoSettings.Logging.DisabledLogTypes.Any(x => x.LogTypeAlias.InvariantEquals(type.ToString())) == false) + if (UmbracoConfig.For.UmbracoSettings().Logging.DisabledLogTypes.Any(x => x.LogTypeAlias.InvariantEquals(type.ToString())) == false) { if (comment != null && comment.Length > 3999) comment = comment.Substring(0, 3955) + "..."; - if (UmbracoConfiguration.Current.UmbracoSettings.Logging.EnableAsyncLogging) + if (UmbracoConfig.For.UmbracoSettings().Logging.EnableAsyncLogging) { ThreadPool.QueueUserWorkItem( delegate { AddSynced(type, user == null ? 0 : user.Id, nodeId, comment); }); @@ -135,7 +135,7 @@ namespace umbraco.BusinessLogic if (comment.Length > 3999) comment = comment.Substring(0, 3955) + "..."; - if (UmbracoConfiguration.Current.UmbracoSettings.Logging.EnableAsyncLogging) + if (UmbracoConfig.For.UmbracoSettings().Logging.EnableAsyncLogging) { ThreadPool.QueueUserWorkItem( delegate { AddSynced(type, user == null ? 0 : user.Id, nodeId, comment); }); @@ -199,7 +199,7 @@ namespace umbraco.BusinessLogic public List GetAuditLogItems(int NodeId) { - if (UmbracoConfiguration.Current.UmbracoSettings.Logging.ExternalLoggerEnableAuditTrail && ExternalLogger != null) + if (UmbracoConfig.For.UmbracoSettings().Logging.ExternalLoggerEnableAuditTrail && ExternalLogger != null) return ExternalLogger.GetAuditLogReader(NodeId); return LogItem.ConvertIRecordsReader(SqlHelper.ExecuteReader( diff --git a/src/umbraco.businesslogic/UmbracoSettings.cs b/src/umbraco.businesslogic/UmbracoSettings.cs index 3b5af36d9f..904c35fc4b 100644 --- a/src/umbraco.businesslogic/UmbracoSettings.cs +++ b/src/umbraco.businesslogic/UmbracoSettings.cs @@ -42,7 +42,7 @@ namespace umbraco /// public static bool UploadAllowDirectories { - get { return UmbracoConfiguration.Current.UmbracoSettings.Content.UploadAllowDirectories; } + get { return UmbracoConfig.For.UmbracoSettings().Content.UploadAllowDirectories; } } /// @@ -51,7 +51,7 @@ namespace umbraco /// true if logging is enabled; otherwise, false. public static bool EnableLogging { - get { return UmbracoConfiguration.Current.UmbracoSettings.Logging.EnableLogging; } + get { return UmbracoConfig.For.UmbracoSettings().Logging.EnableLogging; } } /// @@ -60,7 +60,7 @@ namespace umbraco /// true if async logging is enabled; otherwise, false. public static bool EnableAsyncLogging { - get { return UmbracoConfiguration.Current.UmbracoSettings.Logging.EnableAsyncLogging; } + get { return UmbracoConfig.For.UmbracoSettings().Logging.EnableAsyncLogging; } } /// @@ -68,14 +68,14 @@ namespace umbraco /// public static string ExternalLoggerAssembly { - get { return UmbracoConfiguration.Current.UmbracoSettings.Logging.ExternalLoggerAssembly; } + get { return UmbracoConfig.For.UmbracoSettings().Logging.ExternalLoggerAssembly; } } /// /// Gets the type of an external logger that can be used to store log items in 3rd party systems /// public static string ExternalLoggerType { - get { return UmbracoConfiguration.Current.UmbracoSettings.Logging.ExternalLoggerType; } + get { return UmbracoConfig.For.UmbracoSettings().Logging.ExternalLoggerType; } } /// @@ -83,7 +83,7 @@ namespace umbraco /// public static bool ExternalLoggerLogAuditTrail { - get { return UmbracoConfiguration.Current.UmbracoSettings.Logging.ExternalLoggerEnableAuditTrail; } + get { return UmbracoConfig.For.UmbracoSettings().Logging.ExternalLoggerEnableAuditTrail; } } /// @@ -91,7 +91,7 @@ namespace umbraco /// public static bool KeepUserLoggedIn { - get { return UmbracoConfiguration.Current.UmbracoSettings.Security.KeepUserLoggedIn; } + get { return UmbracoConfig.For.UmbracoSettings().Security.KeepUserLoggedIn; } } /// @@ -99,7 +99,7 @@ namespace umbraco /// public static bool HideDisabledUsersInBackoffice { - get { return UmbracoConfiguration.Current.UmbracoSettings.Security.HideDisabledUsersInBackoffice; } + get { return UmbracoConfig.For.UmbracoSettings().Security.HideDisabledUsersInBackoffice; } } /// @@ -108,7 +108,7 @@ namespace umbraco /// true if logs are to be automatically cleaned; otherwise, false public static bool AutoCleanLogs { - get { return UmbracoConfiguration.Current.UmbracoSettings.Logging.AutoCleanLogs; } + get { return UmbracoConfig.For.UmbracoSettings().Logging.AutoCleanLogs; } } /// @@ -116,12 +116,12 @@ namespace umbraco /// public static int CleaningMiliseconds { - get { return UmbracoConfiguration.Current.UmbracoSettings.Logging.CleaningMiliseconds; } + get { return UmbracoConfig.For.UmbracoSettings().Logging.CleaningMiliseconds; } } public static int MaxLogAge { - get { return UmbracoConfiguration.Current.UmbracoSettings.Logging.MaxLogAge; } + get { return UmbracoConfig.For.UmbracoSettings().Logging.MaxLogAge; } } /// @@ -148,7 +148,7 @@ namespace umbraco /// true if umbraco will use domain prefixes; otherwise, false. public static bool UseDomainPrefixes { - get { return UmbracoConfiguration.Current.UmbracoSettings.RequestHandler.UseDomainPrefixes; } + get { return UmbracoConfig.For.UmbracoSettings().RequestHandler.UseDomainPrefixes; } } /// @@ -157,7 +157,7 @@ namespace umbraco /// public static bool AddTrailingSlash { - get { return UmbracoConfiguration.Current.UmbracoSettings.RequestHandler.AddTrailingSlash; } + get { return UmbracoConfig.For.UmbracoSettings().RequestHandler.AddTrailingSlash; } } /// @@ -166,7 +166,7 @@ namespace umbraco /// true if umbraco will use ASP.NET MasterPages; otherwise, false. public static bool UseAspNetMasterPages { - get { return UmbracoConfiguration.Current.UmbracoSettings.Templates.UseAspNetMasterPages; } + get { return UmbracoConfig.For.UmbracoSettings().Templates.UseAspNetMasterPages; } } @@ -176,7 +176,7 @@ namespace umbraco /// true if umbraco will override templates with skins if present and configured false. public static bool EnableTemplateFolders { - get { return UmbracoConfiguration.Current.UmbracoSettings.Templates.EnableTemplateFolders; } + get { return UmbracoConfig.For.UmbracoSettings().Templates.EnableTemplateFolders; } } /// @@ -184,14 +184,14 @@ namespace umbraco /// public static List NotDynamicXmlDocumentElements { - get { return UmbracoConfiguration.Current.UmbracoSettings.Scripting.NotDynamicXmlDocumentElements.Select(x => x.Element).ToList(); } + get { return UmbracoConfig.For.UmbracoSettings().Scripting.NotDynamicXmlDocumentElements.Select(x => x.Element).ToList(); } } public static List RazorDataTypeModelStaticMapping { get { - var mapping = UmbracoConfiguration.Current.UmbracoSettings.Scripting.DataTypeModelStaticMappings; + var mapping = UmbracoConfig.For.UmbracoSettings().Scripting.DataTypeModelStaticMappings; //now we need to map to the old object until we can clean all this nonsense up return mapping.Select(x => new RazorDataTypeModelStaticMappingItem() @@ -213,7 +213,7 @@ namespace umbraco /// public static bool CloneXmlCacheOnPublish { - get { return UmbracoConfiguration.Current.UmbracoSettings.Content.CloneXmlContent; } + get { return UmbracoConfig.For.UmbracoSettings().Content.CloneXmlContent; } } /// @@ -222,7 +222,7 @@ namespace umbraco /// true if content is parsed; otherwise, false. public static bool TidyEditorContent { - get { return UmbracoConfiguration.Current.UmbracoSettings.Content.TidyEditorContent; } + get { return UmbracoConfig.For.UmbracoSettings().Content.TidyEditorContent; } } /// @@ -231,7 +231,7 @@ namespace umbraco /// The encoding type as string. public static string TidyCharEncoding { - get { return UmbracoConfiguration.Current.UmbracoSettings.Content.TidyCharEncoding; } + get { return UmbracoConfig.For.UmbracoSettings().Content.TidyCharEncoding; } } /// @@ -240,12 +240,12 @@ namespace umbraco /// The property context help option. public static string PropertyContextHelpOption { - get { return UmbracoConfiguration.Current.UmbracoSettings.Content.PropertyContextHelpOption; } + get { return UmbracoConfig.For.UmbracoSettings().Content.PropertyContextHelpOption; } } public static string DefaultBackofficeProvider { - get { return UmbracoConfiguration.Current.UmbracoSettings.Providers.DefaultBackOfficeUserProvider; } + get { return UmbracoConfig.For.UmbracoSettings().Providers.DefaultBackOfficeUserProvider; } } /// @@ -253,7 +253,7 @@ namespace umbraco /// public static bool ForceSafeAliases { - get { return UmbracoConfiguration.Current.UmbracoSettings.Content.ForceSafeAliases; } + get { return UmbracoConfig.For.UmbracoSettings().Content.ForceSafeAliases; } } /// @@ -261,7 +261,7 @@ namespace umbraco /// public static IEnumerable DisallowedUploadFiles { - get { return UmbracoConfiguration.Current.UmbracoSettings.Content.DisallowedUploadFiles; } + get { return UmbracoConfig.For.UmbracoSettings().Content.DisallowedUploadFiles; } } /// @@ -270,7 +270,7 @@ namespace umbraco /// The allowed image file types. public static string ImageFileTypes { - get { return string.Join(",", UmbracoConfiguration.Current.UmbracoSettings.Content.ImageFileTypes.Select(x => x.ToLowerInvariant())); } + get { return string.Join(",", UmbracoConfig.For.UmbracoSettings().Content.ImageFileTypes.Select(x => x.ToLowerInvariant())); } } /// @@ -279,7 +279,7 @@ namespace umbraco /// The allowed script file types. public static string ScriptFileTypes { - get { return string.Join(",", UmbracoConfiguration.Current.UmbracoSettings.Content.ScriptFileTypes); } + get { return string.Join(",", UmbracoConfig.For.UmbracoSettings().Content.ScriptFileTypes); } } /// @@ -288,7 +288,7 @@ namespace umbraco /// public static int UmbracoLibraryCacheDuration { - get { return UmbracoConfiguration.Current.UmbracoSettings.Content.UmbracoLibraryCacheDuration; } + get { return UmbracoConfig.For.UmbracoSettings().Content.UmbracoLibraryCacheDuration; } } /// @@ -297,7 +297,7 @@ namespace umbraco /// The script folder path. public static string ScriptFolderPath { - get { return UmbracoConfiguration.Current.UmbracoSettings.Content.ScriptFolderPath; } + get { return UmbracoConfig.For.UmbracoSettings().Content.ScriptFolderPath; } } /// @@ -305,7 +305,7 @@ namespace umbraco /// public static bool ScriptDisableEditor { - get { return UmbracoConfiguration.Current.UmbracoSettings.Content.ScriptEditorDisable; } + get { return UmbracoConfig.For.UmbracoSettings().Content.ScriptEditorDisable; } } /// @@ -316,7 +316,7 @@ namespace umbraco /// true if umbraco ensures unique node naming; otherwise, false. public static bool EnsureUniqueNaming { - get { return UmbracoConfiguration.Current.UmbracoSettings.Content.EnsureUniqueNaming; } + get { return UmbracoConfig.For.UmbracoSettings().Content.EnsureUniqueNaming; } } /// @@ -325,7 +325,7 @@ namespace umbraco /// The notification email sender. public static string NotificationEmailSender { - get { return UmbracoConfiguration.Current.UmbracoSettings.Content.NotificationEmailAddress; } + get { return UmbracoConfig.For.UmbracoSettings().Content.NotificationEmailAddress; } } /// @@ -336,7 +336,7 @@ namespace umbraco /// public static bool NotificationDisableHtmlEmail { - get { return UmbracoConfiguration.Current.UmbracoSettings.Content.DisableHtmlEmail; } + get { return UmbracoConfig.For.UmbracoSettings().Content.DisableHtmlEmail; } } /// @@ -345,7 +345,7 @@ namespace umbraco /// The allowed attributes on images. public static string ImageAllowedAttributes { - get { return string.Join(",", UmbracoConfiguration.Current.UmbracoSettings.Content.ImageTagAllowedAttributes); } + get { return string.Join(",", UmbracoConfig.For.UmbracoSettings().Content.ImageTagAllowedAttributes); } } public static XmlNode ImageAutoFillImageProperties @@ -376,7 +376,7 @@ namespace umbraco /// public static bool RemoveDoubleDashesFromUrlReplacing { - get { return UmbracoConfiguration.Current.UmbracoSettings.RequestHandler.RemoveDoubleDashes; } + get { return UmbracoConfig.For.UmbracoSettings().RequestHandler.RemoveDoubleDashes; } } /// @@ -387,7 +387,7 @@ namespace umbraco /// true if umbraco uses distributed calls; otherwise, false. public static bool UseDistributedCalls { - get { return UmbracoConfiguration.Current.UmbracoSettings.DistributedCall.Enabled; } + get { return UmbracoConfig.For.UmbracoSettings().DistributedCall.Enabled; } } @@ -397,7 +397,7 @@ namespace umbraco /// The distributed call user. public static int DistributedCallUser { - get { return UmbracoConfiguration.Current.UmbracoSettings.DistributedCall.UserId; } + get { return UmbracoConfig.For.UmbracoSettings().DistributedCall.UserId; } } /// @@ -405,7 +405,7 @@ namespace umbraco /// public static string PreviewBadge { - get { return UmbracoConfiguration.Current.UmbracoSettings.Content.PreviewBadge; } + get { return UmbracoConfig.For.UmbracoSettings().Content.PreviewBadge; } } /// @@ -481,7 +481,7 @@ namespace umbraco /// public static bool UseViewstateMoverModule { - get { return UmbracoConfiguration.Current.UmbracoSettings.ViewStateMoverModule.Enable; } + get { return UmbracoConfig.For.UmbracoSettings().ViewStateMoverModule.Enable; } } @@ -491,7 +491,7 @@ namespace umbraco /// public static bool isXmlContentCacheDisabled { - get { return UmbracoConfiguration.Current.UmbracoSettings.Content.XmlCacheEnabled; } + get { return UmbracoConfig.For.UmbracoSettings().Content.XmlCacheEnabled; } } /// @@ -501,7 +501,7 @@ namespace umbraco /// public static bool XmlContentCheckForDiskChanges { - get { return UmbracoConfiguration.Current.UmbracoSettings.Content.XmlContentCheckForDiskChanges; } + get { return UmbracoConfig.For.UmbracoSettings().Content.XmlContentCheckForDiskChanges; } } /// @@ -511,7 +511,7 @@ namespace umbraco /// public static bool EnableGlobalPreviewStorage { - get { return UmbracoConfiguration.Current.UmbracoSettings.Content.GlobalPreviewStorageEnabled; } + get { return UmbracoConfig.For.UmbracoSettings().Content.GlobalPreviewStorageEnabled; } } /// @@ -522,12 +522,12 @@ namespace umbraco /// public static bool UseLegacyXmlSchema { - get { return UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema; } + get { return UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema; } } public static IEnumerable AppCodeFileExtensionsList { - get { return UmbracoConfiguration.Current.UmbracoSettings.Developer.AppCodeFileExtensions.Select(x => x.Extension); } + get { return UmbracoConfig.For.UmbracoSettings().Developer.AppCodeFileExtensions.Select(x => x.Extension); } } [Obsolete("Use AppCodeFileExtensionsList instead")] @@ -555,7 +555,7 @@ namespace umbraco /// public static bool continouslyUpdateXmlDiskCache { - get { return UmbracoConfiguration.Current.UmbracoSettings.Content.ContinouslyUpdateXmlDiskCache; } + get { return UmbracoConfig.For.UmbracoSettings().Content.ContinouslyUpdateXmlDiskCache; } } /// @@ -566,12 +566,12 @@ namespace umbraco /// public static bool EnableSplashWhileLoading { - get { return UmbracoConfiguration.Current.UmbracoSettings.Content.EnableSplashWhileLoading; } + get { return UmbracoConfig.For.UmbracoSettings().Content.EnableSplashWhileLoading; } } public static bool ResolveUrlsFromTextString { - get { return UmbracoConfiguration.Current.UmbracoSettings.Content.ResolveUrlsFromTextString; } + get { return UmbracoConfig.For.UmbracoSettings().Content.ResolveUrlsFromTextString; } } /// @@ -583,7 +583,7 @@ namespace umbraco /// MacroErrorBehaviour enum defining how to handle macro errors. public static MacroErrorBehaviour MacroErrorBehaviour { - get { return UmbracoConfiguration.Current.UmbracoSettings.Content.MacroErrorBehaviour; } + get { return UmbracoConfig.For.UmbracoSettings().Content.MacroErrorBehaviour; } } /// @@ -595,7 +595,7 @@ namespace umbraco /// MacroErrorBehaviour enum defining how to show icons in the document type editor. public static IconPickerBehaviour IconPickerBehaviour { - get { return UmbracoConfiguration.Current.UmbracoSettings.Content.IconPickerBehaviour; } + get { return UmbracoConfig.For.UmbracoSettings().Content.IconPickerBehaviour; } } /// @@ -605,7 +605,7 @@ namespace umbraco /// If undefined, 'Textstring' is the default public static string DefaultDocumentTypeProperty { - get { return UmbracoConfiguration.Current.UmbracoSettings.Content.DefaultDocumentTypeProperty; } + get { return UmbracoConfig.For.UmbracoSettings().Content.DefaultDocumentTypeProperty; } } private static string _path; diff --git a/src/umbraco.cms/businesslogic/Content.cs b/src/umbraco.cms/businesslogic/Content.cs index b262017553..acd47d0dba 100644 --- a/src/umbraco.cms/businesslogic/Content.cs +++ b/src/umbraco.cms/businesslogic/Content.cs @@ -534,7 +534,7 @@ namespace umbraco.cms.businesslogic protected virtual XmlNode generateXmlWithoutSaving(XmlDocument xd) { - string nodeName = UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema ? "node" : Casing.SafeAliasWithForcingCheck(ContentType.Alias); + string nodeName = UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema ? "node" : Casing.SafeAliasWithForcingCheck(ContentType.Alias); XmlNode x = xd.CreateNode(XmlNodeType.Element, nodeName, ""); XmlPopulate(xd, ref x, false); return x; @@ -595,7 +595,7 @@ namespace umbraco.cms.businesslogic var parentDirectory = System.IO.Path.GetDirectoryName(relativeFilePath); // don't want to delete the media folder if not using directories. - if (UmbracoConfiguration.Current.UmbracoSettings.Content.UploadAllowDirectories && parentDirectory != fs.GetRelativePath("/")) + if (UmbracoConfig.For.UmbracoSettings().Content.UploadAllowDirectories && parentDirectory != fs.GetRelativePath("/")) { //issue U4-771: if there is a parent directory the recursive parameter should be true fs.DeleteDirectory(parentDirectory, String.IsNullOrEmpty(parentDirectory) == false); diff --git a/src/umbraco.cms/businesslogic/Packager/PackageActions/addStringToHtmlElement.cs b/src/umbraco.cms/businesslogic/Packager/PackageActions/addStringToHtmlElement.cs index 6ca7086919..a96f2fc893 100644 --- a/src/umbraco.cms/businesslogic/Packager/PackageActions/addStringToHtmlElement.cs +++ b/src/umbraco.cms/businesslogic/Packager/PackageActions/addStringToHtmlElement.cs @@ -36,7 +36,7 @@ namespace umbraco.cms.businesslogic.packager.standardPackageActions string value = xmlHelper.GetNodeValue(xmlData); template.Template tmp = template.Template.GetByAlias(templateAlias); - if (UmbracoConfiguration.Current.UmbracoSettings.Templates.UseAspNetMasterPages) + if (UmbracoConfig.For.UmbracoSettings().Templates.UseAspNetMasterPages) value = tmp.EnsureMasterPageSyntax(value); _addStringToHtmlElement(tmp, value, templateAlias, htmlElementId, position); @@ -58,7 +58,7 @@ namespace umbraco.cms.businesslogic.packager.standardPackageActions string value = xmlHelper.GetNodeValue(xmlData); template.Template tmp = template.Template.GetByAlias(templateAlias); - if (UmbracoConfiguration.Current.UmbracoSettings.Templates.UseAspNetMasterPages) + if (UmbracoConfig.For.UmbracoSettings().Templates.UseAspNetMasterPages) value = tmp.EnsureMasterPageSyntax(value); _removeStringFromHtmlElement(tmp, value, templateAlias, htmlElementId); diff --git a/src/umbraco.cms/businesslogic/Packager/Repositories/Repository.cs b/src/umbraco.cms/businesslogic/Packager/Repositories/Repository.cs index 726bc01437..d7165557fa 100644 --- a/src/umbraco.cms/businesslogic/Packager/Repositories/Repository.cs +++ b/src/umbraco.cms/businesslogic/Packager/Repositories/Repository.cs @@ -69,7 +69,7 @@ namespace umbraco.cms.businesslogic.packager.repositories var repositories = new List(); - foreach (var r in UmbracoConfiguration.Current.UmbracoSettings.PackageRepositories.Repositories) + foreach (var r in UmbracoConfig.For.UmbracoSettings().PackageRepositories.Repositories) { var repository = new Repository { @@ -107,7 +107,7 @@ namespace umbraco.cms.businesslogic.packager.repositories throw new FormatException("The repositoryGuid is not a valid GUID"); } - var found = UmbracoConfiguration.Current.UmbracoSettings.PackageRepositories.Repositories.FirstOrDefault(x => x.Id == id); + var found = UmbracoConfig.For.UmbracoSettings().PackageRepositories.Repositories.FirstOrDefault(x => x.Id == id); if (found == null) { return null; @@ -196,7 +196,7 @@ namespace umbraco.cms.businesslogic.packager.repositories if (key == string.Empty) { - if (UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema) + if (UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema) fileByteArray = this.Webservice.fetchPackage(packageGuid); else fileByteArray = this.Webservice.fetchPackageByVersion(packageGuid, Version.Version41); diff --git a/src/umbraco.cms/businesslogic/Property/Property.cs b/src/umbraco.cms/businesslogic/Property/Property.cs index 654215c342..b7450612bd 100644 --- a/src/umbraco.cms/businesslogic/Property/Property.cs +++ b/src/umbraco.cms/businesslogic/Property/Property.cs @@ -110,11 +110,11 @@ namespace umbraco.cms.businesslogic.property } public XmlNode ToXml(XmlDocument xd) { - string nodeName = UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema ? "data" : helpers.Casing.SafeAlias(PropertyType.Alias); + string nodeName = UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema ? "data" : helpers.Casing.SafeAlias(PropertyType.Alias); XmlNode x = xd.CreateNode(XmlNodeType.Element, nodeName, ""); // Alias - if (UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema) + if (UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema) { XmlAttribute alias = xd.CreateAttribute("alias"); alias.Value = this.PropertyType.Alias; diff --git a/src/umbraco.cms/businesslogic/datatype/FileHandlerData.cs b/src/umbraco.cms/businesslogic/datatype/FileHandlerData.cs index 3949441dfc..fad101b596 100644 --- a/src/umbraco.cms/businesslogic/datatype/FileHandlerData.cs +++ b/src/umbraco.cms/businesslogic/datatype/FileHandlerData.cs @@ -66,7 +66,7 @@ namespace umbraco.cms.businesslogic.datatype { var fs = FileSystemProviderManager.Current.GetFileSystemProvider(); - var subfolder = UmbracoConfiguration.Current.UmbracoSettings.Content.UploadAllowDirectories + var subfolder = UmbracoConfig.For.UmbracoSettings().Content.UploadAllowDirectories ? currentValue.Replace(fs.GetUrl("/"), "").Split('/')[0] : currentValue.Substring(currentValue.LastIndexOf("/", StringComparison.Ordinal) + 1).Split('-')[0]; @@ -75,7 +75,7 @@ namespace umbraco.cms.businesslogic.datatype ? subfolderId.ToString(CultureInfo.InvariantCulture) : MediaSubfolderCounter.Current.Increment().ToString(CultureInfo.InvariantCulture); - var fileName = UmbracoConfiguration.Current.UmbracoSettings.Content.UploadAllowDirectories + var fileName = UmbracoConfig.For.UmbracoSettings().Content.UploadAllowDirectories ? Path.Combine(numberedFolder, name) : numberedFolder + "-" + name; @@ -103,10 +103,10 @@ namespace umbraco.cms.businesslogic.datatype } // check for auto fill of other properties (width, height, extension and filesize) - if (UmbracoConfiguration.Current.UmbracoSettings.Content.ImageAutoFillProperties.Any()) + if (UmbracoConfig.For.UmbracoSettings().Content.ImageAutoFillProperties.Any()) { var uploadFieldConfigNode = - UmbracoConfiguration.Current.UmbracoSettings.Content.ImageAutoFillProperties.FirstOrDefault(x => x.Alias == PropertyTypeAlias); + UmbracoConfig.For.UmbracoSettings().Content.ImageAutoFillProperties.FirstOrDefault(x => x.Alias == PropertyTypeAlias); if (uploadFieldConfigNode != null) { @@ -139,10 +139,10 @@ namespace umbraco.cms.businesslogic.datatype if (PropertyId == default(int)) return; - if (UmbracoConfiguration.Current.UmbracoSettings.Content.ImageAutoFillProperties.Any()) + if (UmbracoConfig.For.UmbracoSettings().Content.ImageAutoFillProperties.Any()) { var uploadFieldConfigNode = - UmbracoConfiguration.Current.UmbracoSettings.Content.ImageAutoFillProperties.FirstOrDefault(x => x.Alias == PropertyTypeAlias); + UmbracoConfig.For.UmbracoSettings().Content.ImageAutoFillProperties.FirstOrDefault(x => x.Alias == PropertyTypeAlias); if (uploadFieldConfigNode != null) { // get the current document diff --git a/src/umbraco.cms/businesslogic/media/Media.cs b/src/umbraco.cms/businesslogic/media/Media.cs index fb9b46fc84..00ec1efb0b 100644 --- a/src/umbraco.cms/businesslogic/media/Media.cs +++ b/src/umbraco.cms/businesslogic/media/Media.cs @@ -290,7 +290,7 @@ namespace umbraco.cms.businesslogic.media XmlGenerate(xd); // generate preview for blame history? - if (UmbracoConfiguration.Current.UmbracoSettings.Content.GlobalPreviewStorageEnabled) + if (UmbracoConfig.For.UmbracoSettings().Content.GlobalPreviewStorageEnabled) { // Version as new guid to ensure different versions are generated as media are not versioned currently! SavePreviewXml(generateXmlWithoutSaving(xd), Guid.NewGuid()); diff --git a/src/umbraco.cms/businesslogic/media/UmbracoMediaFactory.cs b/src/umbraco.cms/businesslogic/media/UmbracoMediaFactory.cs index c2ed052c4f..29743031fd 100644 --- a/src/umbraco.cms/businesslogic/media/UmbracoMediaFactory.cs +++ b/src/umbraco.cms/businesslogic/media/UmbracoMediaFactory.cs @@ -92,7 +92,7 @@ namespace umbraco.cms.businesslogic.media int subfolderId; var currentValue = prop.Value.ToString(); - var subfolder = UmbracoConfiguration.Current.UmbracoSettings.Content.UploadAllowDirectories + var subfolder = UmbracoConfig.For.UmbracoSettings().Content.UploadAllowDirectories ? currentValue.Replace(FileSystem.GetUrl("/"), "").Split('/')[0] : currentValue.Substring(currentValue.LastIndexOf("/", StringComparison.Ordinal) + 1).Split('-')[0]; diff --git a/src/umbraco.cms/businesslogic/member/Member.cs b/src/umbraco.cms/businesslogic/member/Member.cs index 0c09194686..26497187c5 100644 --- a/src/umbraco.cms/businesslogic/member/Member.cs +++ b/src/umbraco.cms/businesslogic/member/Member.cs @@ -682,7 +682,7 @@ namespace umbraco.cms.businesslogic.member XmlGenerate(xd); // generate preview for blame history? - if (UmbracoConfiguration.Current.UmbracoSettings.Content.GlobalPreviewStorageEnabled) + if (UmbracoConfig.For.UmbracoSettings().Content.GlobalPreviewStorageEnabled) { // Version as new guid to ensure different versions are generated as members are not versioned currently! SavePreviewXml(generateXmlWithoutSaving(xd), Guid.NewGuid()); diff --git a/src/umbraco.cms/businesslogic/template/Template.cs b/src/umbraco.cms/businesslogic/template/Template.cs index 9bacc2e410..beb191067b 100644 --- a/src/umbraco.cms/businesslogic/template/Template.cs +++ b/src/umbraco.cms/businesslogic/template/Template.cs @@ -155,7 +155,7 @@ namespace umbraco.cms.businesslogic.template } dr.Close(); - if (UmbracoConfiguration.Current.UmbracoSettings.Templates.DefaultRenderingEngine == RenderingEngine.Mvc && ViewHelper.ViewExists(this)) + if (UmbracoConfig.For.UmbracoSettings().Templates.DefaultRenderingEngine == RenderingEngine.Mvc && ViewHelper.ViewExists(this)) _design = ViewHelper.GetFileContents(this); else _design = MasterPageHelper.GetFileContents(this); @@ -266,13 +266,13 @@ namespace umbraco.cms.businesslogic.template _design = value.Trim(NewLineChars); //we only switch to MVC View editing if the template has a view file, and MVC editing is enabled - if (UmbracoConfiguration.Current.UmbracoSettings.Templates.DefaultRenderingEngine == RenderingEngine.Mvc && !MasterPageHelper.IsMasterPageSyntax(_design)) + if (UmbracoConfig.For.UmbracoSettings().Templates.DefaultRenderingEngine == RenderingEngine.Mvc && !MasterPageHelper.IsMasterPageSyntax(_design)) { MasterPageHelper.RemoveMasterPageFile(this.Alias); MasterPageHelper.RemoveMasterPageFile(_oldAlias); _design = ViewHelper.UpdateViewFile(this, _oldAlias); } - else if (UmbracoConfiguration.Current.UmbracoSettings.Templates.UseAspNetMasterPages) + else if (UmbracoConfig.For.UmbracoSettings().Templates.UseAspNetMasterPages) { ViewHelper.RemoveViewFile(this.Alias); ViewHelper.RemoveViewFile(_oldAlias); @@ -352,7 +352,7 @@ namespace umbraco.cms.businesslogic.template /// private static RenderingEngine DetermineRenderingEngine(Template t, string design = null) { - var engine = UmbracoConfiguration.Current.UmbracoSettings.Templates.DefaultRenderingEngine; + var engine = UmbracoConfig.For.UmbracoSettings().Templates.DefaultRenderingEngine; if (!design.IsNullOrWhiteSpace() && MasterPageHelper.IsMasterPageSyntax(design)) { diff --git a/src/umbraco.cms/businesslogic/web/Document.cs b/src/umbraco.cms/businesslogic/web/Document.cs index d24a7dc439..eb5b97160e 100644 --- a/src/umbraco.cms/businesslogic/web/Document.cs +++ b/src/umbraco.cms/businesslogic/web/Document.cs @@ -1314,11 +1314,11 @@ namespace umbraco.cms.businesslogic.web x.Attributes.Append(addAttribute(xd, "urlName", urlName)); x.Attributes.Append(addAttribute(xd, "writerName", Writer.Name)); x.Attributes.Append(addAttribute(xd, "creatorName", Creator.Name.ToString())); - if (ContentType != null && UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema) + if (ContentType != null && UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema) x.Attributes.Append(addAttribute(xd, "nodeTypeAlias", ContentType.Alias)); x.Attributes.Append(addAttribute(xd, "path", Path)); - if (!UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema) + if (!UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema) { x.Attributes.Append(addAttribute(xd, "isDoc", "")); } diff --git a/src/umbraco.cms/businesslogic/web/DocumentType.cs b/src/umbraco.cms/businesslogic/web/DocumentType.cs index b12943fd53..c2cb87aa9d 100644 --- a/src/umbraco.cms/businesslogic/web/DocumentType.cs +++ b/src/umbraco.cms/businesslogic/web/DocumentType.cs @@ -87,7 +87,7 @@ namespace umbraco.cms.businesslogic.web public static string GenerateXmlDocumentType() { StringBuilder dtd = new StringBuilder(); - if (UmbracoConfiguration.Current.UmbracoSettings.Content.UseLegacyXmlSchema) + if (UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema) { dtd.AppendLine(" "); } diff --git a/src/umbraco.cms/businesslogic/workflow/Notification.cs b/src/umbraco.cms/businesslogic/workflow/Notification.cs index 837ff3da01..4814eff551 100644 --- a/src/umbraco.cms/businesslogic/workflow/Notification.cs +++ b/src/umbraco.cms/businesslogic/workflow/Notification.cs @@ -158,11 +158,11 @@ namespace umbraco.cms.businesslogic.workflow }; // create the mail message - var mail = new MailMessage(UmbracoConfiguration.Current.UmbracoSettings.Content.NotificationEmailAddress, mailingUser.Email); + var mail = new MailMessage(UmbracoConfig.For.UmbracoSettings().Content.NotificationEmailAddress, mailingUser.Email); // populate the message mail.Subject = ui.Text("notifications", "mailSubject", subjectVars, mailingUser); - if (UmbracoConfiguration.Current.UmbracoSettings.Content.DisableHtmlEmail) + if (UmbracoConfig.For.UmbracoSettings().Content.DisableHtmlEmail) { mail.IsBodyHtml = false; mail.Body = ui.Text("notifications", "mailBody", bodyVars, mailingUser); diff --git a/src/umbraco.cms/helpers/xhtml.cs b/src/umbraco.cms/helpers/xhtml.cs index 2c6d7bbf4a..3ca90d886b 100644 --- a/src/umbraco.cms/helpers/xhtml.cs +++ b/src/umbraco.cms/helpers/xhtml.cs @@ -40,7 +40,7 @@ namespace umbraco.cms.helpers tidy.Options.TidyMark = false; // To avoid entity encoding - tidy.Options.CharEncoding = (TidyNet.CharEncoding)Enum.Parse(typeof(TidyNet.CharEncoding), UmbracoConfiguration.Current.UmbracoSettings.Content.TidyCharEncoding); + tidy.Options.CharEncoding = (TidyNet.CharEncoding)Enum.Parse(typeof(TidyNet.CharEncoding), UmbracoConfig.For.UmbracoSettings().Content.TidyCharEncoding); /* Declare the parameters that is needed */ diff --git a/src/umbraco.controls/CodeArea.cs b/src/umbraco.controls/CodeArea.cs index cbad1a14d8..1d273e32f3 100644 --- a/src/umbraco.controls/CodeArea.cs +++ b/src/umbraco.controls/CodeArea.cs @@ -58,7 +58,7 @@ namespace umbraco.uicontrols { get { - return UmbracoConfiguration.Current.UmbracoSettings.Content.ScriptEditorDisable == false; + return UmbracoConfig.For.UmbracoSettings().Content.ScriptEditorDisable == false; } } diff --git a/src/umbraco.editorControls/tinyMCE3/TinyMCE.cs b/src/umbraco.editorControls/tinyMCE3/TinyMCE.cs index 64d859e45e..b9c5ace6c1 100644 --- a/src/umbraco.editorControls/tinyMCE3/TinyMCE.cs +++ b/src/umbraco.editorControls/tinyMCE3/TinyMCE.cs @@ -326,7 +326,7 @@ namespace umbraco.editorControls.tinyMCE3 parsedString = replaceMacroTags(parsedString).Trim(); // tidy html - refactored, see #30534 - if (UmbracoConfiguration.Current.UmbracoSettings.Content.TidyEditorContent) + if (UmbracoConfig.For.UmbracoSettings().Content.TidyEditorContent) { // always wrap in a
- using

was a bad idea parsedString = "

" + parsedString + "
"; diff --git a/src/umbraco.editorControls/tinymce/tinyMCEImageHelper.cs b/src/umbraco.editorControls/tinymce/tinyMCEImageHelper.cs index 5072726efc..23da99829f 100644 --- a/src/umbraco.editorControls/tinymce/tinyMCEImageHelper.cs +++ b/src/umbraco.editorControls/tinymce/tinyMCEImageHelper.cs @@ -14,7 +14,7 @@ namespace umbraco.editorControls.tinymce { public static string cleanImages(string html) { - var allowedAttributes = UmbracoConfiguration.Current.UmbracoSettings.Content.ImageTagAllowedAttributes.Select(x => x.ToLower()).ToList(); + var allowedAttributes = UmbracoConfig.For.UmbracoSettings().Content.ImageTagAllowedAttributes.Select(x => x.ToLower()).ToList(); //Always add src as it's essential to output any image at all if (allowedAttributes.Contains("src") == false) diff --git a/src/umbraco.editorControls/uploadfield/uploadField.cs b/src/umbraco.editorControls/uploadfield/uploadField.cs index 472a094977..747febe57b 100644 --- a/src/umbraco.editorControls/uploadfield/uploadField.cs +++ b/src/umbraco.editorControls/uploadfield/uploadField.cs @@ -90,7 +90,7 @@ namespace umbraco.editorControls //now check the file type var extension = Path.GetExtension(postedFile.FileName).TrimStart("."); - return UmbracoConfiguration.Current.UmbracoSettings.Content.DisallowedUploadFiles.Any(x => x.InvariantEquals(extension)) == false; + return UmbracoConfig.For.UmbracoSettings().Content.DisallowedUploadFiles.Any(x => x.InvariantEquals(extension)) == false; } public string Text From 04275eba634dd3d513f06455d2449532d35c6552 Mon Sep 17 00:00:00 2001 From: Tim Geyssens Date: Wed, 25 Sep 2013 11:51:12 +0200 Subject: [PATCH 15/17] Embed rte plugin: prettify --- .../src/views/common/dialogs/rteembed.html | 58 ++++++++++--------- 1 file changed, 32 insertions(+), 26 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/rteembed.html b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/rteembed.html index 751fdfd0a9..19498f5c5e 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/rteembed.html +++ b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/rteembed.html @@ -1,33 +1,39 @@ -
+
+ +
-
-
-
- - +
+
+
+ + + +
-
-
-
-
- - - - -
- - x - - +
+ +
+ +
+ + +
+
+ + x + + +
+
+

+
+
+
- -

-
-
-
+
-
-
+
+ From 32ba52f340d45fc58748caeeef54f2cf0cd6bc4c Mon Sep 17 00:00:00 2001 From: Tim Geyssens Date: Wed, 25 Sep 2013 12:07:25 +0200 Subject: [PATCH 16/17] rte: adds iframe as allowed element --- .../src/views/propertyeditors/rte/rte.controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 5dad072c39..338d6adbdf 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 @@ -23,7 +23,7 @@ angular.module("umbraco") + "input[accept|alt|checked|disabled|maxlength|name|readonly|size|src|type|value]," + "kbd,label[for],legend,noscript,optgroup[label|disabled],option[disabled|label|selected|value]," + "q[cite],samp,select[disabled|multiple|name|size],small," - + "textarea[cols|rows|disabled|name|readonly],tt,var,big"; + + "textarea[cols|rows|disabled|name|readonly],tt,var,big,iframe[*]"; //TODO: This should be configurable (i.e. from the config file we have and/or from pre-values) var toolbar = "code | bold italic | styleselect | alignleft aligncenter alignright | bullist numlist | outdent indent | link image umbmediapicker umbiconpicker umbembeddialog umbmacro"; From fb811ce810ef9b5b4a3cfa46bc8306713fe376b5 Mon Sep 17 00:00:00 2001 From: Tim Geyssens Date: Wed, 25 Sep 2013 12:16:11 +0200 Subject: [PATCH 17/17] Embed rte plugin: minor copy update --- .../src/views/common/dialogs/rteembed.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/rteembed.html b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/rteembed.html index 19498f5c5e..e752b0685e 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/rteembed.html +++ b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/rteembed.html @@ -17,7 +17,7 @@
- +