From e005c5bba6e15210dff1c2f11f5b95d546ce0222 Mon Sep 17 00:00:00 2001 From: Shannon Date: Wed, 23 Dec 2015 13:51:16 +0100 Subject: [PATCH] Massive file cleanup, removed the old BasePage, UmbracoEnsuredPage, ClientTools, moved the menu 'Action' to the Web project until we can remove those too. --- .../Resolvers/ActionsResolverTests.cs | 7 +- .../Services/UserServiceTests.cs | 3 +- src/Umbraco.Tests/TestHelpers/TestHelper.cs | 1 - src/Umbraco.Web.UI/Umbraco.Web.UI.csproj | 2 - .../Umbraco/create/PartialView.ascx.cs | 8 +- src/Umbraco.Web.UI/umbraco/Create.aspx.cs | 2 +- .../umbraco/create/PartialViewMacro.ascx.cs | 6 +- .../umbraco/create/User.ascx.cs | 9 +- .../umbraco/dialogs/ChangeDocType.aspx.cs | 2 +- src/Umbraco.Web.UI/umbraco/js/language.aspx | 1 - .../umbraco/settings/views/EditView.aspx.cs | 21 +- src/Umbraco.Web.UI/umbraco/tree.aspx | 1 - .../Editors/BackOfficeController.cs | 2 +- src/Umbraco.Web/Editors/ContentController.cs | 1 - .../Editors/ContentPostValidateAttribute.cs | 2 +- src/Umbraco.Web/Editors/MediaController.cs | 1 - .../Editors/PackageInstallController.cs | 2 +- .../Install/HttpInstallAuthorizeAttribute.cs | 3 - .../Install/InstallAuthorizeAttribute.cs | 3 - .../InstallSteps/SetUmbracoVersionStep.cs | 2 +- .../LegacyActions}/Action.cs | 523 +++++++++--------- .../LegacyActions}/ActionAssignDomain.cs | 176 +++--- .../LegacyActions}/ActionAudit.cs | 178 +++--- .../LegacyActions}/ActionBrowse.cs | 128 +++-- .../LegacyActions}/ActionChangeDocType.cs | 188 +++---- .../LegacyActions}/ActionCopy.cs | 188 +++---- .../LegacyActions}/ActionDelete.cs | 176 +++--- .../LegacyActions}/ActionDisable.cs | 184 +++--- .../LegacyActions}/ActionEmptyTranscan.cs | 174 +++--- .../LegacyActions}/ActionExport.cs | 178 +++--- .../LegacyActions}/ActionImport.cs | 178 +++--- .../LegacyActions}/ActionMove.cs | 188 +++---- .../LegacyActions}/ActionNew.cs | 174 +++--- .../LegacyActions}/ActionNewFolder.cs | 180 +++--- .../LegacyActions}/ActionNotify.cs | 180 +++--- .../LegacyActions}/ActionNull.cs | 118 ++-- .../LegacyActions}/ActionPackage.cs | 178 +++--- .../LegacyActions}/ActionPackageCreate.cs | 178 +++--- .../LegacyActions}/ActionProtect.cs | 188 +++---- .../LegacyActions}/ActionPublish.cs | 176 +++--- .../LegacyActions}/ActionQuit.cs | 178 +++--- .../LegacyActions}/ActionRePublish.cs | 176 +++--- .../LegacyActions}/ActionRefresh.cs | 190 +++---- .../LegacyActions}/ActionRestore.cs | 6 +- .../LegacyActions}/ActionRights.cs | 188 +++---- .../LegacyActions}/ActionRollback.cs | 186 +++---- .../LegacyActions}/ActionSendToTranslate.cs | 178 +++--- .../LegacyActions}/ActionSort.cs | 188 +++---- .../LegacyActions}/ActionToPublish.cs | 178 +++--- .../LegacyActions}/ActionTranslate.cs | 177 +++--- .../LegacyActions}/ActionUnPublish.cs | 183 +++--- .../LegacyActions}/ActionUpdate.cs | 176 +++--- .../LegacyActions}/ContextMenuSeperator.cs | 108 ++-- .../LegacyActionMenuItemAttribute.cs | 84 +-- .../Models/Mapping/ContentModelMapper.cs | 2 +- src/Umbraco.Web/Models/Trees/MenuItemList.cs | 2 +- .../Mvc/UmbracoAuthorizeAttribute.cs | 2 - .../NotificationServiceExtensions.cs | 1 - .../PublishedContentCache.cs | 3 +- .../Strategies/NotificationsHandler.cs | 2 +- .../Trees/ContentTreeController.cs | 4 +- .../Trees/ContentTreeControllerBase.cs | 4 +- .../Trees/ContentTypeTreeController.cs | 2 +- .../Trees/DataTypeTreeController.cs | 2 +- .../Trees/LanguageTreeController.cs | 2 +- .../Trees/LegacyTreeDataConverter.cs | 2 +- src/Umbraco.Web/Trees/LegacyTreeJavascript.cs | 4 +- src/Umbraco.Web/Trees/MediaTreeController.cs | 2 +- .../Trees/MediaTypeTreeController.cs | 2 +- src/Umbraco.Web/Trees/MemberTreeController.cs | 2 +- .../Trees/MemberTypeTreeController.cs | 2 +- src/Umbraco.Web/Trees/PartialViewsTree.cs | 2 +- .../Trees/TemplatesTreeController.cs | 2 +- .../UI/Controls/UmbracoUserControl.cs | 14 + src/Umbraco.Web/UI/LegacyDialogHandler.cs | 4 - src/Umbraco.Web/UI/Pages/ClientTools.cs | 35 +- src/Umbraco.Web/Umbraco.Web.csproj | 61 +- src/Umbraco.Web/UmbracoContext.cs | 1 - src/Umbraco.Web/UmbracoUserControl.cs | 36 -- src/Umbraco.Web/UriUtility.cs | 1 - ...EnsureUserPermissionForContentAttribute.cs | 2 +- .../EnsureUserPermissionForMediaAttribute.cs | 1 - .../FilterAllowedOutgoingContentAttribute.cs | 2 +- .../WebServices/DomainsApiController.cs | 2 +- .../BasePageExtensions.cs | 60 -- .../umbraco.presentation/helper.cs | 8 +- src/Umbraco.Web/umbraco.presentation/macro.cs | 2 +- .../umbraco/Trees/BaseTree.cs | 2 +- .../umbraco/Trees/NullTree.cs | 2 +- .../umbraco/Trees/TreeDefinitionCollection.cs | 13 - .../umbraco/Trees/UserPermissions.cs | 2 +- .../umbraco/Trees/XmlTree.cs | 12 +- .../umbraco/Trees/loadDictionary.cs | 2 +- .../umbraco/Trees/loadPackager.cs | 7 +- .../umbraco/Trees/loadPackages.cs | 5 +- .../umbraco/Trees/loadRelationTypes.cs | 2 +- .../umbraco/Trees/loadScripts.cs | 2 +- .../umbraco/Trees/loadStylesheets.cs | 2 +- .../umbraco/Trees/loadTemplates.cs | 2 +- .../umbraco/Trees/loadTranslationTasks.cs | 2 +- .../umbraco/Trees/loadUsers.cs | 7 +- .../umbraco/Trees/loadXslt.cs | 2 +- .../umbraco/actions/delete.aspx.cs | 7 +- .../umbraco/actions/editContent.aspx.cs | 3 +- .../umbraco/actions/preview.aspx.cs | 3 +- .../umbraco/actions/publish.aspx.cs | 2 +- .../umbraco/controls/ContentControl.cs | 2 +- .../umbraco/controls/ContentTypeControl.cs | 2 +- .../umbraco/controls/SaveClickEventArgs.cs | 5 +- .../controls/Tree/CustomTreeService.cs | 29 +- .../umbraco/controls/Tree/JTreeContextMenu.cs | 16 +- .../controls/Tree/JTreeContextMenuItem.cs | 10 +- .../umbraco/controls/Tree/TreeControl.ascx.cs | 41 +- .../umbraco/create.aspx.cs | 3 +- .../umbraco/create/CreatedPackageTasks.cs | 8 - .../umbraco/create/MemberGroupTasks.cs | 6 - .../umbraco/create/PartialViewTasksBase.cs | 4 - .../umbraco/create/ScriptTasks.cs | 4 - .../umbraco/create/StylesheetTasks.cs | 8 - .../umbraco/create/XsltTasks.cs | 9 +- .../umbraco/create/dialogHandler_temp.cs | 11 +- .../umbraco/create/dictionaryTasks.cs | 8 - .../umbraco/create/language.ascx.cs | 8 +- .../umbraco/create/languageTasks.cs | 9 - .../umbraco/create/macroTasks.cs | 6 - .../umbraco/create/script.ascx.cs | 16 +- .../umbraco/create/simple.ascx.cs | 8 +- .../umbraco/create/stylesheetPropertyTasks.cs | 8 - .../umbraco/create/templateTasks.cs | 8 - .../umbraco/create/userTasks.cs | 6 - .../umbraco/create/xslt.ascx.cs | 15 +- .../umbraco/dashboard/FeedProxy.aspx.cs | 15 +- .../developer/Macros/assemblyBrowser.aspx.cs | 3 +- .../developer/Macros/editMacro.aspx.cs | 5 +- .../Packages/BrowseRepository.aspx.cs | 3 +- .../developer/Packages/SubmitPackage.aspx.cs | 3 +- .../Packages/directoryBrowser.aspx.cs | 33 -- .../developer/Packages/editPackage.aspx.cs | 12 +- .../Packages/installedPackage.aspx.cs | 5 +- .../developer/Packages/installer.aspx.cs | 4 +- .../RelationTypes/EditRelationType.aspx.cs | 4 +- .../umbraco/developer/Xslt/editXslt.aspx.cs | 2 +- .../developer/Xslt/getXsltStatus.asmx.cs | 9 +- .../Xslt/xsltChooseExtension.aspx.cs | 3 +- .../developer/Xslt/xsltInsertValueOf.aspx.cs | 3 +- .../developer/Xslt/xsltVisualize.aspx.cs | 3 +- .../umbraco/developer/autoDoc.aspx.cs | 3 +- .../umbraco/dialogs/AssignDomain.aspx.cs | 3 +- .../umbraco/dialogs/AssignDomain2.aspx.cs | 2 +- .../umbraco/dialogs/Preview.aspx.cs | 2 +- .../umbraco/dialogs/RegexWs.aspx.cs | 2 +- .../umbraco/dialogs/SendPublish.aspx.cs | 4 +- .../umbraco/dialogs/about.aspx.cs | 3 +- .../umbraco/dialogs/create.aspx.cs | 17 +- .../umbraco/dialogs/cruds.aspx.cs | 3 +- .../umbraco/dialogs/editMacro.aspx.cs | 11 +- .../umbraco/dialogs/emptyTrashcan.aspx.cs | 4 +- .../dialogs/exportDocumenttype.aspx.cs | 2 +- .../dialogs/importDocumenttype.aspx.cs | 4 +- .../umbraco/dialogs/insertMacro.aspx.cs | 18 +- .../dialogs/insertMasterpageContent.aspx.cs | 2 +- .../insertMasterpagePlaceholder.aspx.cs | 2 +- .../umbraco/dialogs/moveOrCopy.aspx.cs | 7 +- .../umbraco/dialogs/notifications.aspx.cs | 15 +- .../umbraco/dialogs/protectPage.aspx.cs | 2 +- .../umbraco/dialogs/republish.aspx.cs | 2 +- .../umbraco/dialogs/rollBack.aspx.cs | 6 +- .../umbraco/dialogs/search.aspx.cs | 2 +- .../umbraco/dialogs/sendToTranslation.aspx.cs | 24 +- .../umbraco/dialogs/sort.aspx.cs | 10 +- .../umbraco/dialogs/treePicker.aspx.cs | 2 +- .../umbraco/dialogs/umbracoField.aspx.cs | 8 +- .../umbraco/dialogs/viewAuditTrail.aspx.cs | 5 +- .../umbraco/js/language.aspx | 1 - .../umbraco/js/language.aspx.cs | 60 -- .../umbraco/js/language.aspx.designer.cs | 15 - .../umbraco/js/language.aspx.resx | 42 -- .../umbraco/masterpages/umbracoPage.Master.cs | 1 + .../umbraco/members/EditMemberGroup.aspx.cs | 5 +- .../umbraco/members/ViewMembers.aspx.cs | 2 +- .../umbraco/members/search.aspx.cs | 2 +- .../umbraco/publishStatus.aspx.cs | 4 +- .../settings/DictionaryItemList.aspx.cs | 2 +- .../settings/EditDictionaryItem.aspx.cs | 7 +- .../umbraco/settings/editLanguage.aspx.cs | 7 +- .../umbraco/settings/editTemplate.aspx.cs | 18 +- .../settings/modals/ShowUmbracoTags.aspx.cs | 2 +- .../settings/scripts/editScript.aspx.cs | 22 +- .../stylesheet/editstylesheet.aspx.cs | 2 +- .../property/EditStyleSheetProperty.aspx.cs | 5 +- .../umbraco/templateControls/Item.cs | 7 +- .../umbraco/templateControls/Macro.cs | 1 + .../umbraco/translation/default.aspx.cs | 21 +- .../umbraco/translation/details.aspx.cs | 20 +- .../umbraco/translation/preview.aspx.cs | 2 +- .../umbraco/translation/xml.aspx.cs | 6 +- .../umbraco.presentation/umbraco/tree.aspx.cs | 127 ----- .../umbraco/treeInit.aspx.cs | 87 --- .../umbraco/users/EditUser.aspx.cs | 27 +- .../umbraco/users/EditUserType.aspx.cs | 31 +- .../umbraco/users/NodePermissions.ascx.cs | 19 +- .../umbraco/users/PermissionEditor.aspx.cs | 19 +- .../umbraco/users/PermissionsHandler.asmx.cs | 26 +- .../umbraco/users/UserPermissions.cs | 20 +- .../webservices/CheckForUpgrade.asmx.cs | 4 +- .../webservices/TreeClientService.asmx.cs | 6 - .../webservices/TreeDataService.ashx.cs | 10 +- .../webservices/codeEditorSave.asmx.cs | 2 +- .../webservices/legacyAjaxCalls.asmx.cs | 56 +- .../umbraco/webservices/nodeSorter.asmx.cs | 12 +- .../umbraco/webservices/trashcan.asmx.cs | 2 - src/UmbracoExamine/BaseUmbracoIndexer.cs | 7 - src/UmbracoExamine/UmbracoContentIndexer.cs | 13 - .../BasePages/BasePage.cs | 411 -------------- .../BasePages/ClientTools.cs | 351 ------------ .../BasePages/DialogPage.cs | 17 - .../BasePages/UmbracoEnsuredPage.cs | 159 ------ src/umbraco.businesslogic/GlobalSettings.cs | 492 ---------------- src/umbraco.businesslogic/User.cs | 12 +- src/umbraco.businesslogic/ui.cs | 11 +- .../umbraco.businesslogic.csproj | 10 - src/umbraco.cms/PluginManagerExtensions.cs | 2 - .../businesslogic/Packager/Installer.cs | 17 +- .../PackageInstance/PackageActions.cs | 2 +- src/umbraco.cms/businesslogic/web/Document.cs | 11 - src/umbraco.cms/umbraco.cms.csproj | 38 -- 226 files changed, 3472 insertions(+), 5763 deletions(-) delete mode 100644 src/Umbraco.Web.UI/umbraco/js/language.aspx delete mode 100644 src/Umbraco.Web.UI/umbraco/tree.aspx rename src/{umbraco.cms/Actions => Umbraco.Web/LegacyActions}/Action.cs (95%) rename src/{umbraco.cms/Actions => Umbraco.Web/LegacyActions}/ActionAssignDomain.cs (90%) rename src/{umbraco.cms/Actions => Umbraco.Web/LegacyActions}/ActionAudit.cs (90%) rename src/{umbraco.cms/Actions => Umbraco.Web/LegacyActions}/ActionBrowse.cs (89%) rename src/{umbraco.cms/Actions => Umbraco.Web/LegacyActions}/ActionChangeDocType.cs (92%) rename src/{umbraco.cms/Actions => Umbraco.Web/LegacyActions}/ActionCopy.cs (89%) rename src/{umbraco.cms/Actions => Umbraco.Web/LegacyActions}/ActionDelete.cs (90%) rename src/{umbraco.cms/Actions => Umbraco.Web/LegacyActions}/ActionDisable.cs (90%) rename src/{umbraco.cms/Actions => Umbraco.Web/LegacyActions}/ActionEmptyTranscan.cs (90%) rename src/{umbraco.cms/Actions => Umbraco.Web/LegacyActions}/ActionExport.cs (90%) rename src/{umbraco.cms/Actions => Umbraco.Web/LegacyActions}/ActionImport.cs (90%) rename src/{umbraco.cms/Actions => Umbraco.Web/LegacyActions}/ActionMove.cs (89%) rename src/{umbraco.cms/Actions => Umbraco.Web/LegacyActions}/ActionNew.cs (89%) rename src/{umbraco.cms/Actions => Umbraco.Web/LegacyActions}/ActionNewFolder.cs (90%) rename src/{umbraco.cms/Actions => Umbraco.Web/LegacyActions}/ActionNotify.cs (90%) rename src/{umbraco.cms/Actions => Umbraco.Web/LegacyActions}/ActionNull.cs (87%) rename src/{umbraco.cms/Actions => Umbraco.Web/LegacyActions}/ActionPackage.cs (90%) rename src/{umbraco.cms/Actions => Umbraco.Web/LegacyActions}/ActionPackageCreate.cs (90%) rename src/{umbraco.cms/Actions => Umbraco.Web/LegacyActions}/ActionProtect.cs (90%) rename src/{umbraco.cms/Actions => Umbraco.Web/LegacyActions}/ActionPublish.cs (90%) rename src/{umbraco.cms/Actions => Umbraco.Web/LegacyActions}/ActionQuit.cs (90%) rename src/{umbraco.cms/Actions => Umbraco.Web/LegacyActions}/ActionRePublish.cs (90%) rename src/{umbraco.cms/Actions => Umbraco.Web/LegacyActions}/ActionRefresh.cs (90%) rename src/{umbraco.cms/Actions => Umbraco.Web/LegacyActions}/ActionRestore.cs (92%) rename src/{umbraco.cms/Actions => Umbraco.Web/LegacyActions}/ActionRights.cs (90%) rename src/{umbraco.cms/Actions => Umbraco.Web/LegacyActions}/ActionRollback.cs (90%) rename src/{umbraco.cms/Actions => Umbraco.Web/LegacyActions}/ActionSendToTranslate.cs (90%) rename src/{umbraco.cms/Actions => Umbraco.Web/LegacyActions}/ActionSort.cs (90%) rename src/{umbraco.cms/Actions => Umbraco.Web/LegacyActions}/ActionToPublish.cs (91%) rename src/{umbraco.cms/Actions => Umbraco.Web/LegacyActions}/ActionTranslate.cs (89%) rename src/{umbraco.cms/Actions => Umbraco.Web/LegacyActions}/ActionUnPublish.cs (90%) rename src/{umbraco.cms/Actions => Umbraco.Web/LegacyActions}/ActionUpdate.cs (90%) rename src/{umbraco.cms/Actions => Umbraco.Web/LegacyActions}/ContextMenuSeperator.cs (87%) rename src/{umbraco.cms/Actions => Umbraco.Web/LegacyActions}/LegacyActionMenuItemAttribute.cs (94%) delete mode 100644 src/Umbraco.Web/UmbracoUserControl.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/BasePageExtensions.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/directoryBrowser.aspx.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/js/language.aspx delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/js/language.aspx.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/js/language.aspx.designer.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/js/language.aspx.resx delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/tree.aspx.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/treeInit.aspx.cs delete mode 100644 src/umbraco.businesslogic/BasePages/BasePage.cs delete mode 100644 src/umbraco.businesslogic/BasePages/ClientTools.cs delete mode 100644 src/umbraco.businesslogic/BasePages/DialogPage.cs delete mode 100644 src/umbraco.businesslogic/BasePages/UmbracoEnsuredPage.cs delete mode 100644 src/umbraco.businesslogic/GlobalSettings.cs diff --git a/src/Umbraco.Tests/Resolvers/ActionsResolverTests.cs b/src/Umbraco.Tests/Resolvers/ActionsResolverTests.cs index 08049c5480..c9bcdcf28c 100644 --- a/src/Umbraco.Tests/Resolvers/ActionsResolverTests.cs +++ b/src/Umbraco.Tests/Resolvers/ActionsResolverTests.cs @@ -1,14 +1,9 @@ using System.Linq; -using Moq; using NUnit.Framework; using Umbraco.Core; -using Umbraco.Core.Cache; -using Umbraco.Core.Logging; using Umbraco.Core.ObjectResolution; -using Umbraco.Core.Profiling; -using Umbraco.Tests.TestHelpers; -using umbraco.BasePages; using umbraco.interfaces; +using Umbraco.Web.UI.Pages; namespace Umbraco.Tests.Resolvers { diff --git a/src/Umbraco.Tests/Services/UserServiceTests.cs b/src/Umbraco.Tests/Services/UserServiceTests.cs index 8ca015d1b8..7a0438bd7f 100644 --- a/src/Umbraco.Tests/Services/UserServiceTests.cs +++ b/src/Umbraco.Tests/Services/UserServiceTests.cs @@ -6,12 +6,11 @@ using NUnit.Framework; using Umbraco.Core.Models.Membership; using Umbraco.Core.Services; using Umbraco.Tests.TestHelpers.Entities; -using umbraco.BusinessLogic.Actions; using Umbraco.Core.Persistence.Querying; using Umbraco.Core.Services; using Umbraco.Tests.TestHelpers; using Umbraco.Tests.TestHelpers.Entities; -using umbraco.BusinessLogic.Actions; +using Umbraco.Web.LegacyActions; namespace Umbraco.Tests.Services { diff --git a/src/Umbraco.Tests/TestHelpers/TestHelper.cs b/src/Umbraco.Tests/TestHelpers/TestHelper.cs index eec71f9a7f..199f72b7f1 100644 --- a/src/Umbraco.Tests/TestHelpers/TestHelper.cs +++ b/src/Umbraco.Tests/TestHelpers/TestHelper.cs @@ -8,7 +8,6 @@ using SqlCE4Umbraco; using Umbraco.Core; using Umbraco.Core.IO; using umbraco.DataLayer; -using GlobalSettings = umbraco.GlobalSettings; namespace Umbraco.Tests.TestHelpers { diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index 99dd58c5fe..9702196738 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -1219,7 +1219,6 @@ - Form @@ -1232,7 +1231,6 @@ - diff --git a/src/Umbraco.Web.UI/Umbraco/create/PartialView.ascx.cs b/src/Umbraco.Web.UI/Umbraco/create/PartialView.ascx.cs index 7b380c2533..d5f380a504 100644 --- a/src/Umbraco.Web.UI/Umbraco/create/PartialView.ascx.cs +++ b/src/Umbraco.Web.UI/Umbraco/create/PartialView.ascx.cs @@ -1,12 +1,6 @@ using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Web.UI; using System.Web.UI.WebControls; -using umbraco.BasePages; using Umbraco.Core; -using Umbraco.Core.IO; using Umbraco.Core.Services; using umbraco.presentation.create; @@ -56,7 +50,7 @@ namespace Umbraco.Web.UI.Umbraco.Create createMacroVal, //apparently we need to pass this value to 'ParentID'... of course! :P then we'll extract it in PartialViewTasks to create it. PartialViewTemplate.SelectedValue + "|||" + FileName.Text); - BasePage.Current.ClientTools + ClientTools .ChangeContentFrameUrl(returnUrl) .ChildNodeCreated() .CloseModalWindow(); diff --git a/src/Umbraco.Web.UI/umbraco/Create.aspx.cs b/src/Umbraco.Web.UI/umbraco/Create.aspx.cs index 304e7ffdb1..3d25b32423 100644 --- a/src/Umbraco.Web.UI/umbraco/Create.aspx.cs +++ b/src/Umbraco.Web.UI/umbraco/Create.aspx.cs @@ -31,7 +31,7 @@ namespace Umbraco.Web.UI.Umbraco { return LegacyDialogHandler.UserHasCreateAccess( new HttpContextWrapper(Context), - getUser(), + UmbracoContext.UmbracoUser, nodeTypeAlias); } diff --git a/src/Umbraco.Web.UI/umbraco/create/PartialViewMacro.ascx.cs b/src/Umbraco.Web.UI/umbraco/create/PartialViewMacro.ascx.cs index 78fbd5b291..7e5418ba03 100644 --- a/src/Umbraco.Web.UI/umbraco/create/PartialViewMacro.ascx.cs +++ b/src/Umbraco.Web.UI/umbraco/create/PartialViewMacro.ascx.cs @@ -1,10 +1,6 @@ using System; -using System.Linq; -using System.Web.UI; using System.Web.UI.WebControls; -using umbraco.BasePages; using Umbraco.Core; -using Umbraco.Core.IO; using Umbraco.Core.Services; using umbraco.presentation.create; @@ -51,7 +47,7 @@ namespace Umbraco.Web.UI.Umbraco.Create createMacroVal, //apparently we need to pass this value to 'ParentID'... of course! :P then we'll extract it in PartialViewTasks to create it. PartialViewTemplate.SelectedValue + "|||" + FileName.Text); - BasePage.Current.ClientTools + ClientTools .ChangeContentFrameUrl(returnUrl) .ChildNodeCreated() .CloseModalWindow(); diff --git a/src/Umbraco.Web.UI/umbraco/create/User.ascx.cs b/src/Umbraco.Web.UI/umbraco/create/User.ascx.cs index 6b01d6131a..3193ddf85a 100644 --- a/src/Umbraco.Web.UI/umbraco/create/User.ascx.cs +++ b/src/Umbraco.Web.UI/umbraco/create/User.ascx.cs @@ -1,14 +1,7 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.Security; -using System.Web.UI; using System.Web.UI.WebControls; using Umbraco.Core.Security; -using umbraco; using Umbraco.Core; -using umbraco.BasePages; namespace Umbraco.Web.UI.Umbraco.Create @@ -66,7 +59,7 @@ namespace Umbraco.Web.UI.Umbraco.Create -1, formatted); - BasePage.Current.ClientTools + ClientTools .ChangeContentFrameUrl(returnUrl) .ChildNodeCreated() .CloseModalWindow(); diff --git a/src/Umbraco.Web.UI/umbraco/dialogs/ChangeDocType.aspx.cs b/src/Umbraco.Web.UI/umbraco/dialogs/ChangeDocType.aspx.cs index ce9d84f31b..113e3e73c6 100644 --- a/src/Umbraco.Web.UI/umbraco/dialogs/ChangeDocType.aspx.cs +++ b/src/Umbraco.Web.UI/umbraco/dialogs/ChangeDocType.aspx.cs @@ -4,9 +4,9 @@ using System.Linq; using System.Text; using System.Web.UI; using System.Web.UI.WebControls; -using umbraco.BasePages; using Umbraco.Core; using Umbraco.Core.Models; +using Umbraco.Web.UI.Pages; namespace Umbraco.Web.UI.Umbraco.Dialogs { diff --git a/src/Umbraco.Web.UI/umbraco/js/language.aspx b/src/Umbraco.Web.UI/umbraco/js/language.aspx deleted file mode 100644 index ce4cc6ede9..0000000000 --- a/src/Umbraco.Web.UI/umbraco/js/language.aspx +++ /dev/null @@ -1 +0,0 @@ -<%@ Page language="c#" Codebehind="language.aspx.cs" AutoEventWireup="True" Inherits="umbraco.js.language" %> diff --git a/src/Umbraco.Web.UI/umbraco/settings/views/EditView.aspx.cs b/src/Umbraco.Web.UI/umbraco/settings/views/EditView.aspx.cs index 2a44431028..230b4fa139 100644 --- a/src/Umbraco.Web.UI/umbraco/settings/views/EditView.aspx.cs +++ b/src/Umbraco.Web.UI/umbraco/settings/views/EditView.aspx.cs @@ -11,15 +11,16 @@ using Umbraco.Core.Logging; using Umbraco.Web.Trees; using Umbraco.Web.UI.Controls; using umbraco; -using umbraco.BasePages; using umbraco.cms.businesslogic.template; using umbraco.cms.presentation.Trees; using Umbraco.Core; using umbraco.uicontrols; +using Umbraco.Core.Configuration; +using Umbraco.Web.UI.Pages; namespace Umbraco.Web.UI.Umbraco.Settings.Views { - public partial class EditView : global::umbraco.BasePages.UmbracoEnsuredPage + public partial class EditView : UmbracoEnsuredPage { private Template _template; public MenuButton SaveButton; @@ -178,13 +179,13 @@ namespace Umbraco.Web.UI.Umbraco.Settings.Views SaveButton.CssClass = "client-side"; Panel1.Text = ui.Text("edittemplate"); - pp_name.Text = ui.Text("name", base.getUser()); - pp_alias.Text = ui.Text("alias", base.getUser()); - pp_masterTemplate.Text = ui.Text("mastertemplate", base.getUser()); + pp_name.Text = ui.Text("name", UmbracoContext.UmbracoUser); + pp_alias.Text = ui.Text("alias", UmbracoContext.UmbracoUser); + pp_masterTemplate.Text = ui.Text("mastertemplate", UmbracoContext.UmbracoUser); // Editing buttons MenuIconI umbField = editorSource.Menu.NewIcon(); - umbField.ImageURL = UmbracoPath + "/images/editor/insField.gif"; + umbField.ImageURL = SystemDirectories.Umbraco + "/images/editor/insField.gif"; umbField.OnClickCommand = ClientTools.Scripts.OpenModalWindow( IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/dialogs/umbracoField.aspx?objectId=" + @@ -210,7 +211,7 @@ namespace Umbraco.Web.UI.Umbraco.Settings.Views editorSource.Menu.InsertNewControl(macroSplitButton, 40); MenuIconI umbTemplateQueryBuilder = editorSource.Menu.NewIcon(); - umbTemplateQueryBuilder.ImageURL = UmbracoPath + "/images/editor/inshtml.gif"; + umbTemplateQueryBuilder.ImageURL = SystemDirectories.Umbraco + "/images/editor/inshtml.gif"; umbTemplateQueryBuilder.OnClickCommand = "editViewEditor.openQueryModal()"; umbTemplateQueryBuilder.AltText = "Open query builder"; @@ -253,21 +254,21 @@ namespace Umbraco.Web.UI.Umbraco.Settings.Views editorSource.Menu.InsertSplitter(); MenuIconI umbRenderBody = editorSource.Menu.NewIcon(); - umbRenderBody.ImageURL = UmbracoPath + "/images/editor/renderbody.gif"; + umbRenderBody.ImageURL = SystemDirectories.Umbraco + "/images/editor/renderbody.gif"; //umbContainer.AltText = ui.Text("template", "insertContentAreaPlaceHolder"); umbRenderBody.AltText = "Insert @RenderBody()"; umbRenderBody.OnClickCommand = "editViewEditor.insertRenderBody()"; MenuIconI umbSection = editorSource.Menu.NewIcon(); - umbSection.ImageURL = UmbracoPath + "/images/editor/masterpagePlaceHolder.gif"; + umbSection.ImageURL = SystemDirectories.Umbraco + "/images/editor/masterpagePlaceHolder.gif"; //umbContainer.AltText = ui.Text("template", "insertContentAreaPlaceHolder"); umbSection.AltText = "Insert Section"; umbSection.OnClickCommand = "editViewEditor.openSnippetModal('section')"; MenuIconI umbRenderSection = editorSource.Menu.NewIcon(); - umbRenderSection.ImageURL = UmbracoPath + "/images/editor/masterpageContent.gif"; + umbRenderSection.ImageURL = SystemDirectories.Umbraco + "/images/editor/masterpageContent.gif"; //umbContainer.AltText = ui.Text("template", "insertContentAreaPlaceHolder"); umbRenderSection.AltText = "Insert @RenderSection"; diff --git a/src/Umbraco.Web.UI/umbraco/tree.aspx b/src/Umbraco.Web.UI/umbraco/tree.aspx deleted file mode 100644 index 3434b1eda5..0000000000 --- a/src/Umbraco.Web.UI/umbraco/tree.aspx +++ /dev/null @@ -1 +0,0 @@ -<%@ Page language="c#" Codebehind="tree.aspx.cs" AutoEventWireup="True" Inherits="umbraco.cms.presentation.tree" trace="false" ContentType="text/xml" ResponseEncoding="UTF-8" %> diff --git a/src/Umbraco.Web/Editors/BackOfficeController.cs b/src/Umbraco.Web/Editors/BackOfficeController.cs index 0dd1272a3b..1c262b192c 100644 --- a/src/Umbraco.Web/Editors/BackOfficeController.cs +++ b/src/Umbraco.Web/Editors/BackOfficeController.cs @@ -33,7 +33,7 @@ using Umbraco.Web.Trees; using Umbraco.Web.UI.JavaScript; using Umbraco.Web.WebApi.Filters; using Umbraco.Web.WebServices; -using Action = umbraco.BusinessLogic.Actions.Action; +using Action = Umbraco.Web.LegacyActions.Action; using Constants = Umbraco.Core.Constants; namespace Umbraco.Web.Editors diff --git a/src/Umbraco.Web/Editors/ContentController.cs b/src/Umbraco.Web/Editors/ContentController.cs index 192b49e2cf..6b4ea0416a 100644 --- a/src/Umbraco.Web/Editors/ContentController.cs +++ b/src/Umbraco.Web/Editors/ContentController.cs @@ -27,7 +27,6 @@ using Umbraco.Web.WebApi.Filters; using umbraco; using Umbraco.Core.Models; using Umbraco.Core.Dynamics; -using umbraco.BusinessLogic.Actions; using umbraco.cms.businesslogic.web; using umbraco.presentation.preview; using Umbraco.Web.UI; diff --git a/src/Umbraco.Web/Editors/ContentPostValidateAttribute.cs b/src/Umbraco.Web/Editors/ContentPostValidateAttribute.cs index 62898e7889..d0edfa34bc 100644 --- a/src/Umbraco.Web/Editors/ContentPostValidateAttribute.cs +++ b/src/Umbraco.Web/Editors/ContentPostValidateAttribute.cs @@ -7,10 +7,10 @@ using System.Web.Http.Filters; using Umbraco.Core; using Umbraco.Core.Models; using Umbraco.Core.Services; +using Umbraco.Web.LegacyActions; using Umbraco.Web.Models.ContentEditing; using Umbraco.Web.Security; using Umbraco.Web.WebApi; -using umbraco.BusinessLogic.Actions; namespace Umbraco.Web.Editors { diff --git a/src/Umbraco.Web/Editors/MediaController.cs b/src/Umbraco.Web/Editors/MediaController.cs index a2637e68e8..07389a246f 100644 --- a/src/Umbraco.Web/Editors/MediaController.cs +++ b/src/Umbraco.Web/Editors/MediaController.cs @@ -30,7 +30,6 @@ using System.Runtime.Serialization; using Umbraco.Web.WebApi.Binders; using Umbraco.Web.WebApi.Filters; using umbraco; -using umbraco.BusinessLogic.Actions; using Constants = Umbraco.Core.Constants; using Umbraco.Core.Configuration; using Umbraco.Core.Persistence.FaultHandling; diff --git a/src/Umbraco.Web/Editors/PackageInstallController.cs b/src/Umbraco.Web/Editors/PackageInstallController.cs index 0b1c1a56dd..b7e6fe7648 100644 --- a/src/Umbraco.Web/Editors/PackageInstallController.cs +++ b/src/Umbraco.Web/Editors/PackageInstallController.cs @@ -93,7 +93,7 @@ namespace Umbraco.Web.Editors //clear the tree cache - we'll do this here even though the browser will reload, but just in case it doesn't can't hurt. //these bits are super old, but cant find another way to do this currently global::umbraco.cms.presentation.Trees.TreeDefinitionCollection.Instance.ReRegisterTrees(); - global::umbraco.BusinessLogic.Actions.Action.ReRegisterActionsAndHandlers(); + global::Umbraco.Web.LegacyActions.Action.ReRegisterActionsAndHandlers(); return model; diff --git a/src/Umbraco.Web/Install/HttpInstallAuthorizeAttribute.cs b/src/Umbraco.Web/Install/HttpInstallAuthorizeAttribute.cs index 4559a42740..bed38b8829 100644 --- a/src/Umbraco.Web/Install/HttpInstallAuthorizeAttribute.cs +++ b/src/Umbraco.Web/Install/HttpInstallAuthorizeAttribute.cs @@ -1,10 +1,7 @@ using System; -using System.Web; using System.Web.Http; using System.Web.Http.Controllers; using Umbraco.Core; -using Umbraco.Web.Security; -using umbraco.BasePages; using Umbraco.Core.Logging; namespace Umbraco.Web.Install diff --git a/src/Umbraco.Web/Install/InstallAuthorizeAttribute.cs b/src/Umbraco.Web/Install/InstallAuthorizeAttribute.cs index ecaf2d6be1..762a26d811 100644 --- a/src/Umbraco.Web/Install/InstallAuthorizeAttribute.cs +++ b/src/Umbraco.Web/Install/InstallAuthorizeAttribute.cs @@ -2,10 +2,7 @@ using System.Web; using System.Web.Mvc; using Umbraco.Core; -using Umbraco.Core.Configuration; using Umbraco.Core.IO; -using Umbraco.Web.Security; -using umbraco.BasePages; namespace Umbraco.Web.Install { diff --git a/src/Umbraco.Web/Install/InstallSteps/SetUmbracoVersionStep.cs b/src/Umbraco.Web/Install/InstallSteps/SetUmbracoVersionStep.cs index 6523925505..3e8c4abbaa 100644 --- a/src/Umbraco.Web/Install/InstallSteps/SetUmbracoVersionStep.cs +++ b/src/Umbraco.Web/Install/InstallSteps/SetUmbracoVersionStep.cs @@ -7,7 +7,7 @@ using Umbraco.Core.Logging; using Umbraco.Web.Cache; using Umbraco.Web.Install.Models; using Umbraco.Web.Security; -using GlobalSettings = umbraco.GlobalSettings; + namespace Umbraco.Web.Install.InstallSteps { diff --git a/src/umbraco.cms/Actions/Action.cs b/src/Umbraco.Web/LegacyActions/Action.cs similarity index 95% rename from src/umbraco.cms/Actions/Action.cs rename to src/Umbraco.Web/LegacyActions/Action.cs index df6c257396..1a29f1611e 100644 --- a/src/umbraco.cms/Actions/Action.cs +++ b/src/Umbraco.Web/LegacyActions/Action.cs @@ -1,265 +1,258 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Web; -using System.Reflection; -using Umbraco.Core; -using Umbraco.Core.Logging; -using umbraco.BasePages; -using umbraco.BusinessLogic.Utils; -using umbraco.cms; -using umbraco.cms.businesslogic.web; -using umbraco.cms.businesslogic.workflow; -using umbraco.interfaces; -using System.Text.RegularExpressions; -using System.Linq; -using Umbraco.Core.IO; -using TypeFinder = Umbraco.Core.TypeFinder; - -namespace umbraco.BusinessLogic.Actions -{ - /// - /// Actions and Actionhandlers are a key concept to umbraco and a developer whom wish to apply - /// businessrules whenever data is changed within umbraco, by implementing the IActionHandler - /// interface it's possible to invoke methods (foreign to umbraco) - this can be used whenever - /// there is a specific rule which needs to be applied to content. - /// - /// The Action class itself has responsibility for registering actions and actionhandlers, - /// and contains methods which will be invoked whenever a change is made to ex. a document, media or member - /// - /// An action/actionhandler will automatically be registered, using reflection - /// which is enabling thirdparty developers to extend the core functionality of - /// umbraco without changing the codebase. - /// - [Obsolete("Actions and ActionHandlers are obsolete and should no longer be used")] - public class Action - { - private static readonly Dictionary ActionJs = new Dictionary(); - - private static readonly object Lock = new object(); - - static Action() - { - ReRegisterActionsAndHandlers(); - } - - /// - /// This is used when an IAction or IActionHandler is installed into the system - /// and needs to be loaded into memory. - /// - /// - /// TODO: this shouldn't be needed... we should restart the app pool when a package is installed! - /// - public static void ReRegisterActionsAndHandlers() - { - lock (Lock) - { - // NOTE use the DirtyBackdoor to change the resolution configuration EXCLUSIVELY - // ie do NOT do ANYTHING else while holding the backdoor, because while it is open - // the whole resolution system is locked => nothing can work properly => deadlocks - - var newResolver = new ActionsResolver( - new ActivatorServiceProvider(), LoggerResolver.Current.Logger, - () => TypeFinder.FindClassesOfType(PluginManager.Current.AssembliesToScan)); - - using (Umbraco.Core.ObjectResolution.Resolution.DirtyBackdoorToConfiguration) - { - ActionsResolver.Reset(false); // and do NOT reset the whole resolution! - ActionsResolver.Current = newResolver; - } - - } - } - - /// - /// Jacascript for the contextmenu - /// Suggestion: this method should be moved to the presentation layer. - /// - /// - /// String representation - public string ReturnJavascript(string language) - { - return findActions(language); - } - - /// - /// Returns a list of JavaScript file paths. - /// - /// - public static List GetJavaScriptFileReferences() - { - return ActionsResolver.Current.Actions - .Where(x => !string.IsNullOrWhiteSpace(x.JsSource)) - .Select(x => x.JsSource).ToList(); - //return ActionJsReference; - } - - /// - /// Javascript menuitems - tree contextmenu - /// Umbraco console - /// - /// Suggestion: this method should be moved to the presentation layer. - /// - /// - /// - private static string findActions(string language) - { - if (!ActionJs.ContainsKey(language)) - { - string _actionJsList = ""; - - foreach (IAction action in ActionsResolver.Current.Actions) - { - // Adding try/catch so this rutine doesn't fail if one of the actions fail - // Add to language JsList - try - { - // NH: Add support for css sprites - string icon = action.Icon; - if (!string.IsNullOrEmpty(icon) && icon.StartsWith(".")) - icon = icon.Substring(1, icon.Length - 1); - else - icon = "images/" + icon; - - _actionJsList += string.Format(",\n\tmenuItem(\"{0}\", \"{1}\", \"{2}\", \"{3}\")", - action.Letter, icon, ui.GetText("actions", action.Alias, language), action.JsFunctionName); - } - catch (Exception ee) - { - LogHelper.Error("Error registrering action to javascript", ee); - } - } - - if (_actionJsList.Length > 0) - _actionJsList = _actionJsList.Substring(2, _actionJsList.Length - 2); - - _actionJsList = "\nvar menuMethods = new Array(\n" + _actionJsList + "\n)\n"; - ActionJs.Add(language, _actionJsList); - } - - return ActionJs[language]; - - } - - /// - /// - /// - /// An arraylist containing all javascript variables for the contextmenu in the tree - [Obsolete("Use ActionsResolver.Current.Actions instead")] - public static ArrayList GetAll() - { - return new ArrayList(ActionsResolver.Current.Actions.ToList()); - } - - /// - /// This method will return a list of IAction's based on a string list. Each character in the list may represent - /// an IAction. This will associate any found IActions based on the Letter property of the IAction with the character being referenced. - /// - /// - /// returns a list of actions that have an associated letter found in the action string list - public static List FromString(string actions) - { - List list = new List(); - foreach (char c in actions.ToCharArray()) - { - IAction action = ActionsResolver.Current.Actions.ToList().Find( - delegate(IAction a) - { - return a.Letter == c; - } - ); - if (action != null) - list.Add(action); - } - return list; - } - - /// - /// Returns the string representation of the actions that make up the actions collection - /// - /// - public static string ToString(List actions) - { - string[] strMenu = Array.ConvertAll(actions.ToArray(), delegate(IAction a) { return (a.Letter.ToString()); }); - return string.Join("", strMenu); - } - - /// - /// Returns a list of IActions that are permission assignable - /// - /// - public static List GetPermissionAssignable() - { - return ActionsResolver.Current.Actions.ToList().FindAll( - delegate(IAction a) - { - return (a.CanBePermissionAssigned); - } - ); - } - - /// - /// Check if the current IAction is using legacy javascript methods - /// - /// - /// false if the Iaction is incompatible with 4.5 - public static bool ValidateActionJs(IAction action) - { - return !action.JsFunctionName.Contains("+"); - } - - /// - /// Method to convert the old modal calls to the new ones - /// - /// - /// - public static string ConvertLegacyJs(string javascript) - { - MatchCollection tags = - Regex.Matches(javascript, "openModal[^;]*;", RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace); - foreach (Match tag in tags) - { - string[] function = tag.Value.Split(','); - if (function.Length > 0) - { - string newFunction = "UmbClientMgr.openModalWindow" + function[0].Substring(9).Replace("parent.nodeID", "UmbClientMgr.mainTree().getActionNode().nodeId").Replace("nodeID", "UmbClientMgr.mainTree().getActionNode().nodeId").Replace("parent.returnRandom()", "'" + Guid.NewGuid().ToString() + "'"); - newFunction += ", " + function[1]; - newFunction += ", true"; - newFunction += ", " + function[2]; - newFunction += ", " + function[3]; - javascript = javascript.Replace(tag.Value, newFunction); - } - } - - return javascript; - } - } - - /// - /// This class is used to manipulate IActions that are implemented in a wrong way - /// For instance incompatible trees with 4.0 vs 4.5 - /// - public class PlaceboAction : IAction - { - public char Letter { get; set; } - public bool ShowInNotifier { get; set; } - public bool CanBePermissionAssigned { get; set; } - public string Icon { get; set; } - public string Alias { get; set; } - public string JsFunctionName { get; set; } - public string JsSource { get; set; } - - public PlaceboAction() { } - public PlaceboAction(IAction legacyAction) - { - Letter = legacyAction.Letter; - ShowInNotifier = legacyAction.ShowInNotifier; - CanBePermissionAssigned = legacyAction.CanBePermissionAssigned; - Icon = legacyAction.Icon; - Alias = legacyAction.Alias; - JsFunctionName = legacyAction.JsFunctionName; - JsSource = legacyAction.JsSource; - } - } - -} +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text.RegularExpressions; +using umbraco; +using umbraco.interfaces; +using Umbraco.Core; +using Umbraco.Core.Logging; +using TypeFinder = Umbraco.Core.TypeFinder; + +namespace Umbraco.Web.LegacyActions +{ + /// + /// Actions and Actionhandlers are a key concept to umbraco and a developer whom wish to apply + /// businessrules whenever data is changed within umbraco, by implementing the IActionHandler + /// interface it's possible to invoke methods (foreign to umbraco) - this can be used whenever + /// there is a specific rule which needs to be applied to content. + /// + /// The Action class itself has responsibility for registering actions and actionhandlers, + /// and contains methods which will be invoked whenever a change is made to ex. a document, media or member + /// + /// An action/actionhandler will automatically be registered, using reflection + /// which is enabling thirdparty developers to extend the core functionality of + /// umbraco without changing the codebase. + /// + [Obsolete("Actions and ActionHandlers are obsolete and should no longer be used")] + public class Action + { + private static readonly Dictionary ActionJs = new Dictionary(); + + private static readonly object Lock = new object(); + + static Action() + { + ReRegisterActionsAndHandlers(); + } + + /// + /// This is used when an IAction or IActionHandler is installed into the system + /// and needs to be loaded into memory. + /// + /// + /// TODO: this shouldn't be needed... we should restart the app pool when a package is installed! + /// + public static void ReRegisterActionsAndHandlers() + { + lock (Lock) + { + // NOTE use the DirtyBackdoor to change the resolution configuration EXCLUSIVELY + // ie do NOT do ANYTHING else while holding the backdoor, because while it is open + // the whole resolution system is locked => nothing can work properly => deadlocks + + var newResolver = new ActionsResolver( + new ActivatorServiceProvider(), LoggerResolver.Current.Logger, + () => TypeFinder.FindClassesOfType(PluginManager.Current.AssembliesToScan)); + + using (Umbraco.Core.ObjectResolution.Resolution.DirtyBackdoorToConfiguration) + { + ActionsResolver.Reset(false); // and do NOT reset the whole resolution! + ActionsResolver.Current = newResolver; + } + + } + } + + /// + /// Jacascript for the contextmenu + /// Suggestion: this method should be moved to the presentation layer. + /// + /// + /// String representation + public string ReturnJavascript(string language) + { + return findActions(language); + } + + /// + /// Returns a list of JavaScript file paths. + /// + /// + public static List GetJavaScriptFileReferences() + { + return ActionsResolver.Current.Actions + .Where(x => !string.IsNullOrWhiteSpace(x.JsSource)) + .Select(x => x.JsSource).ToList(); + //return ActionJsReference; + } + + /// + /// Javascript menuitems - tree contextmenu + /// Umbraco console + /// + /// Suggestion: this method should be moved to the presentation layer. + /// + /// + /// + private static string findActions(string language) + { + if (!ActionJs.ContainsKey(language)) + { + string _actionJsList = ""; + + foreach (IAction action in ActionsResolver.Current.Actions) + { + // Adding try/catch so this rutine doesn't fail if one of the actions fail + // Add to language JsList + try + { + // NH: Add support for css sprites + string icon = action.Icon; + if (!string.IsNullOrEmpty(icon) && icon.StartsWith(".")) + icon = icon.Substring(1, icon.Length - 1); + else + icon = "images/" + icon; + + _actionJsList += string.Format(",\n\tmenuItem(\"{0}\", \"{1}\", \"{2}\", \"{3}\")", + action.Letter, icon, ui.GetText("actions", action.Alias, language), action.JsFunctionName); + } + catch (Exception ee) + { + LogHelper.Error("Error registrering action to javascript", ee); + } + } + + if (_actionJsList.Length > 0) + _actionJsList = _actionJsList.Substring(2, _actionJsList.Length - 2); + + _actionJsList = "\nvar menuMethods = new Array(\n" + _actionJsList + "\n)\n"; + ActionJs.Add(language, _actionJsList); + } + + return ActionJs[language]; + + } + + /// + /// + /// + /// An arraylist containing all javascript variables for the contextmenu in the tree + [Obsolete("Use ActionsResolver.Current.Actions instead")] + public static ArrayList GetAll() + { + return new ArrayList(ActionsResolver.Current.Actions.ToList()); + } + + /// + /// This method will return a list of IAction's based on a string list. Each character in the list may represent + /// an IAction. This will associate any found IActions based on the Letter property of the IAction with the character being referenced. + /// + /// + /// returns a list of actions that have an associated letter found in the action string list + public static List FromString(string actions) + { + List list = new List(); + foreach (char c in actions.ToCharArray()) + { + IAction action = ActionsResolver.Current.Actions.ToList().Find( + delegate(IAction a) + { + return a.Letter == c; + } + ); + if (action != null) + list.Add(action); + } + return list; + } + + /// + /// Returns the string representation of the actions that make up the actions collection + /// + /// + public static string ToString(List actions) + { + string[] strMenu = Array.ConvertAll(actions.ToArray(), delegate(IAction a) { return (a.Letter.ToString()); }); + return string.Join("", strMenu); + } + + /// + /// Returns a list of IActions that are permission assignable + /// + /// + public static List GetPermissionAssignable() + { + return ActionsResolver.Current.Actions.ToList().FindAll( + delegate(IAction a) + { + return (a.CanBePermissionAssigned); + } + ); + } + + /// + /// Check if the current IAction is using legacy javascript methods + /// + /// + /// false if the Iaction is incompatible with 4.5 + public static bool ValidateActionJs(IAction action) + { + return !action.JsFunctionName.Contains("+"); + } + + /// + /// Method to convert the old modal calls to the new ones + /// + /// + /// + public static string ConvertLegacyJs(string javascript) + { + MatchCollection tags = + Regex.Matches(javascript, "openModal[^;]*;", RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace); + foreach (Match tag in tags) + { + string[] function = tag.Value.Split(','); + if (function.Length > 0) + { + string newFunction = "UmbClientMgr.openModalWindow" + function[0].Substring(9).Replace("parent.nodeID", "UmbClientMgr.mainTree().getActionNode().nodeId").Replace("nodeID", "UmbClientMgr.mainTree().getActionNode().nodeId").Replace("parent.returnRandom()", "'" + Guid.NewGuid().ToString() + "'"); + newFunction += ", " + function[1]; + newFunction += ", true"; + newFunction += ", " + function[2]; + newFunction += ", " + function[3]; + javascript = javascript.Replace(tag.Value, newFunction); + } + } + + return javascript; + } + } + + /// + /// This class is used to manipulate IActions that are implemented in a wrong way + /// For instance incompatible trees with 4.0 vs 4.5 + /// + public class PlaceboAction : IAction + { + public char Letter { get; set; } + public bool ShowInNotifier { get; set; } + public bool CanBePermissionAssigned { get; set; } + public string Icon { get; set; } + public string Alias { get; set; } + public string JsFunctionName { get; set; } + public string JsSource { get; set; } + + public PlaceboAction() { } + public PlaceboAction(IAction legacyAction) + { + Letter = legacyAction.Letter; + ShowInNotifier = legacyAction.ShowInNotifier; + CanBePermissionAssigned = legacyAction.CanBePermissionAssigned; + Icon = legacyAction.Icon; + Alias = legacyAction.Alias; + JsFunctionName = legacyAction.JsFunctionName; + JsSource = legacyAction.JsSource; + } + } + +} diff --git a/src/umbraco.cms/Actions/ActionAssignDomain.cs b/src/Umbraco.Web/LegacyActions/ActionAssignDomain.cs similarity index 90% rename from src/umbraco.cms/Actions/ActionAssignDomain.cs rename to src/Umbraco.Web/LegacyActions/ActionAssignDomain.cs index c8af09b345..868b9634aa 100644 --- a/src/umbraco.cms/Actions/ActionAssignDomain.cs +++ b/src/Umbraco.Web/LegacyActions/ActionAssignDomain.cs @@ -1,88 +1,88 @@ -using System; -using umbraco.interfaces; -using umbraco.BasePages; - -namespace umbraco.BusinessLogic.Actions -{ - /// - /// This action is invoked when a domain is being assigned to a document - /// - public class ActionAssignDomain : IAction - { - //create singleton -#pragma warning disable 612,618 - private static readonly ActionAssignDomain m_instance = new ActionAssignDomain(); -#pragma warning restore 612,618 - - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionAssignDomain() { } - - public static ActionAssignDomain Instance - { - get { return m_instance; } - } - - #region IAction Members - - public char Letter - { - get - { - return 'I'; - } - } - - public string JsFunctionName - { - get - { - return string.Format("{0}.actionAssignDomain()", ClientTools.Scripts.GetAppActions); - } - } - - public string JsSource - { - get - { - return null; - } - } - - public string Alias - { - get - { - return "assignDomain"; - } - } - - public string Icon - { - get - { - return "home"; - } - } - - public bool ShowInNotifier - { - get - { - return false; - } - } - public bool CanBePermissionAssigned - { - get - { - return true; - } - } - #endregion - } -} +using System; +using umbraco.interfaces; +using Umbraco.Web.UI.Pages; + +namespace Umbraco.Web.LegacyActions +{ + /// + /// This action is invoked when a domain is being assigned to a document + /// + public class ActionAssignDomain : IAction + { + //create singleton +#pragma warning disable 612,618 + private static readonly ActionAssignDomain m_instance = new ActionAssignDomain(); +#pragma warning restore 612,618 + + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionAssignDomain() { } + + public static ActionAssignDomain Instance + { + get { return m_instance; } + } + + #region IAction Members + + public char Letter + { + get + { + return 'I'; + } + } + + public string JsFunctionName + { + get + { + return string.Format("{0}.actionAssignDomain()", ClientTools.Scripts.GetAppActions); + } + } + + public string JsSource + { + get + { + return null; + } + } + + public string Alias + { + get + { + return "assignDomain"; + } + } + + public string Icon + { + get + { + return "home"; + } + } + + public bool ShowInNotifier + { + get + { + return false; + } + } + public bool CanBePermissionAssigned + { + get + { + return true; + } + } + #endregion + } +} diff --git a/src/umbraco.cms/Actions/ActionAudit.cs b/src/Umbraco.Web/LegacyActions/ActionAudit.cs similarity index 90% rename from src/umbraco.cms/Actions/ActionAudit.cs rename to src/Umbraco.Web/LegacyActions/ActionAudit.cs index 1e45ac1fbf..f976074eb9 100644 --- a/src/umbraco.cms/Actions/ActionAudit.cs +++ b/src/Umbraco.Web/LegacyActions/ActionAudit.cs @@ -1,89 +1,89 @@ -using System; -using umbraco.interfaces; -using umbraco.BasePages; - -namespace umbraco.BusinessLogic.Actions -{ - /// - /// This action is invoked upon viewing audittrailing on a document - /// - public class ActionAudit : IAction - { - //create singleton -#pragma warning disable 612,618 - private static readonly ActionAudit m_instance = new ActionAudit(); -#pragma warning restore 612,618 - - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionAudit() { } - - public static ActionAudit Instance - { - get { return m_instance; } - } - - #region IAction Members - - public char Letter - { - get - { - return 'Z'; - } - } - - public string JsFunctionName - { - get - { - return string.Format("{0}.actionAudit()", ClientTools.Scripts.GetAppActions); - } - } - - public string JsSource - { - get - { - return null; - } - } - - public string Alias - { - get - { - return "auditTrail"; - } - } - - public string Icon - { - get - { - return "time"; - } - } - - public bool ShowInNotifier - { - get - { - return false; - } - } - public bool CanBePermissionAssigned - { - get - { - return true; - } - } - - #endregion - } -} +using System; +using umbraco.interfaces; +using Umbraco.Web.UI.Pages; + +namespace Umbraco.Web.LegacyActions +{ + /// + /// This action is invoked upon viewing audittrailing on a document + /// + public class ActionAudit : IAction + { + //create singleton +#pragma warning disable 612,618 + private static readonly ActionAudit m_instance = new ActionAudit(); +#pragma warning restore 612,618 + + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionAudit() { } + + public static ActionAudit Instance + { + get { return m_instance; } + } + + #region IAction Members + + public char Letter + { + get + { + return 'Z'; + } + } + + public string JsFunctionName + { + get + { + return string.Format("{0}.actionAudit()", ClientTools.Scripts.GetAppActions); + } + } + + public string JsSource + { + get + { + return null; + } + } + + public string Alias + { + get + { + return "auditTrail"; + } + } + + public string Icon + { + get + { + return "time"; + } + } + + public bool ShowInNotifier + { + get + { + return false; + } + } + public bool CanBePermissionAssigned + { + get + { + return true; + } + } + + #endregion + } +} diff --git a/src/umbraco.cms/Actions/ActionBrowse.cs b/src/Umbraco.Web/LegacyActions/ActionBrowse.cs similarity index 89% rename from src/umbraco.cms/Actions/ActionBrowse.cs rename to src/Umbraco.Web/LegacyActions/ActionBrowse.cs index 7d44842f18..50bef10bcf 100644 --- a/src/umbraco.cms/Actions/ActionBrowse.cs +++ b/src/Umbraco.Web/LegacyActions/ActionBrowse.cs @@ -1,65 +1,63 @@ -using System; -using umbraco.interfaces; -using umbraco.BasePages; - -namespace umbraco.BusinessLogic.Actions -{ - /// - /// This action is used as a security constraint that grants a user the ability to view nodes in a tree - /// that has permissions applied to it. - /// - /// - /// This action should not be invoked. It is used as the minimum required permission to view nodes in the content tree. By - /// granting a user this permission, the user is able to see the node in the tree but not edit the document. This may be used by other trees - /// that support permissions in the future. - /// - public class ActionBrowse : IAction - { - //create singleton - private static readonly ActionBrowse instance = new ActionBrowse(); - private ActionBrowse() { } - public static ActionBrowse Instance - { - get { return instance; } - } - - #region IAction Members - - public char Letter - { - get { return 'F'; } - } - - public bool ShowInNotifier - { - get { return false; } - } - - public bool CanBePermissionAssigned - { - get { return true; } - } - - public string Icon - { - get { return ""; } - } - - public string Alias - { - get { return "browse"; } - } - - public string JsFunctionName - { - get { return ""; } - } - - public string JsSource - { - get { return ""; } - } - - #endregion - } -} +using umbraco.interfaces; + +namespace Umbraco.Web.LegacyActions +{ + /// + /// This action is used as a security constraint that grants a user the ability to view nodes in a tree + /// that has permissions applied to it. + /// + /// + /// This action should not be invoked. It is used as the minimum required permission to view nodes in the content tree. By + /// granting a user this permission, the user is able to see the node in the tree but not edit the document. This may be used by other trees + /// that support permissions in the future. + /// + public class ActionBrowse : IAction + { + //create singleton + private static readonly ActionBrowse instance = new ActionBrowse(); + private ActionBrowse() { } + public static ActionBrowse Instance + { + get { return instance; } + } + + #region IAction Members + + public char Letter + { + get { return 'F'; } + } + + public bool ShowInNotifier + { + get { return false; } + } + + public bool CanBePermissionAssigned + { + get { return true; } + } + + public string Icon + { + get { return ""; } + } + + public string Alias + { + get { return "browse"; } + } + + public string JsFunctionName + { + get { return ""; } + } + + public string JsSource + { + get { return ""; } + } + + #endregion + } +} diff --git a/src/umbraco.cms/Actions/ActionChangeDocType.cs b/src/Umbraco.Web/LegacyActions/ActionChangeDocType.cs similarity index 92% rename from src/umbraco.cms/Actions/ActionChangeDocType.cs rename to src/Umbraco.Web/LegacyActions/ActionChangeDocType.cs index aff2b45697..a747375e5c 100644 --- a/src/umbraco.cms/Actions/ActionChangeDocType.cs +++ b/src/Umbraco.Web/LegacyActions/ActionChangeDocType.cs @@ -1,94 +1,94 @@ -using System; -using umbraco.interfaces; -using umbraco.BasePages; - -namespace umbraco.BusinessLogic.Actions -{ - /// - /// This action is invoked when the document type of a piece of content is changed - /// - public class ActionChangeDocType : IAction - { - //create singleton -#pragma warning disable 612,618 - private static readonly ActionChangeDocType m_instance = new ActionChangeDocType(); -#pragma warning restore 612,618 - - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionChangeDocType() { } - - public static ActionChangeDocType Instance - { - get { return m_instance; } - } - - #region IAction Members - - public char Letter - { - get - { - - return '7'; - } - } - - public string JsFunctionName - { - get - { - return string.Format("{0}.actionChangeDocType()", ClientTools.Scripts.GetAppActions); - } - } - - public string JsSource - { - get - { - - return null; - } - } - - public string Alias - { - get - { - - return "changeDocType"; - } - } - - public string Icon - { - get - { - - return "axis-rotation-2"; - } - } - - public bool ShowInNotifier - { - get - { - - return true; - } - } - public bool CanBePermissionAssigned - { - get - { - - return true; - } - } - #endregion - } -} +using System; +using umbraco.interfaces; +using Umbraco.Web.UI.Pages; + +namespace Umbraco.Web.LegacyActions +{ + /// + /// This action is invoked when the document type of a piece of content is changed + /// + public class ActionChangeDocType : IAction + { + //create singleton +#pragma warning disable 612,618 + private static readonly ActionChangeDocType m_instance = new ActionChangeDocType(); +#pragma warning restore 612,618 + + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionChangeDocType() { } + + public static ActionChangeDocType Instance + { + get { return m_instance; } + } + + #region IAction Members + + public char Letter + { + get + { + + return '7'; + } + } + + public string JsFunctionName + { + get + { + return string.Format("{0}.actionChangeDocType()", ClientTools.Scripts.GetAppActions); + } + } + + public string JsSource + { + get + { + + return null; + } + } + + public string Alias + { + get + { + + return "changeDocType"; + } + } + + public string Icon + { + get + { + + return "axis-rotation-2"; + } + } + + public bool ShowInNotifier + { + get + { + + return true; + } + } + public bool CanBePermissionAssigned + { + get + { + + return true; + } + } + #endregion + } +} diff --git a/src/umbraco.cms/Actions/ActionCopy.cs b/src/Umbraco.Web/LegacyActions/ActionCopy.cs similarity index 89% rename from src/umbraco.cms/Actions/ActionCopy.cs rename to src/Umbraco.Web/LegacyActions/ActionCopy.cs index 506c854475..cf20e0f04c 100644 --- a/src/umbraco.cms/Actions/ActionCopy.cs +++ b/src/Umbraco.Web/LegacyActions/ActionCopy.cs @@ -1,94 +1,94 @@ -using System; -using umbraco.interfaces; -using umbraco.BasePages; - -namespace umbraco.BusinessLogic.Actions -{ - /// - /// This action is invoked when copying a document, media, member - /// - public class ActionCopy : IAction - { - //create singleton -#pragma warning disable 612,618 - private static readonly ActionCopy m_instance = new ActionCopy(); -#pragma warning restore 612,618 - - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionCopy() { } - - public static ActionCopy Instance - { - get { return m_instance; } - } - - #region IAction Members - - public char Letter - { - get - { - - return 'O'; - } - } - - public string JsFunctionName - { - get - { - return string.Format("{0}.actionCopy()", ClientTools.Scripts.GetAppActions); - } - } - - public string JsSource - { - get - { - - return null; - } - } - - public string Alias - { - get - { - - return "copy"; - } - } - - public string Icon - { - get - { - - return "documents"; - } - } - - public bool ShowInNotifier - { - get - { - - return true; - } - } - public bool CanBePermissionAssigned - { - get - { - - return true; - } - } - #endregion - } -} +using System; +using umbraco.interfaces; +using Umbraco.Web.UI.Pages; + +namespace Umbraco.Web.LegacyActions +{ + /// + /// This action is invoked when copying a document, media, member + /// + public class ActionCopy : IAction + { + //create singleton +#pragma warning disable 612,618 + private static readonly ActionCopy m_instance = new ActionCopy(); +#pragma warning restore 612,618 + + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionCopy() { } + + public static ActionCopy Instance + { + get { return m_instance; } + } + + #region IAction Members + + public char Letter + { + get + { + + return 'O'; + } + } + + public string JsFunctionName + { + get + { + return string.Format("{0}.actionCopy()", ClientTools.Scripts.GetAppActions); + } + } + + public string JsSource + { + get + { + + return null; + } + } + + public string Alias + { + get + { + + return "copy"; + } + } + + public string Icon + { + get + { + + return "documents"; + } + } + + public bool ShowInNotifier + { + get + { + + return true; + } + } + public bool CanBePermissionAssigned + { + get + { + + return true; + } + } + #endregion + } +} diff --git a/src/umbraco.cms/Actions/ActionDelete.cs b/src/Umbraco.Web/LegacyActions/ActionDelete.cs similarity index 90% rename from src/umbraco.cms/Actions/ActionDelete.cs rename to src/Umbraco.Web/LegacyActions/ActionDelete.cs index 68f9dbc463..b51bb5b99b 100644 --- a/src/umbraco.cms/Actions/ActionDelete.cs +++ b/src/Umbraco.Web/LegacyActions/ActionDelete.cs @@ -1,88 +1,88 @@ -using System; -using umbraco.interfaces; -using umbraco.BasePages; - -namespace umbraco.BusinessLogic.Actions -{ - /// - /// This action is invoked when a document, media, member is deleted - /// - public class ActionDelete : IAction - { - //create singleton -#pragma warning disable 612,618 - private static readonly ActionDelete m_instance = new ActionDelete(); -#pragma warning restore 612,618 - - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionDelete() { } - - public static ActionDelete Instance - { - get { return m_instance; } - } - - #region IAction Members - - public char Letter - { - get - { - return 'D'; - } - } - - public string JsFunctionName - { - get - { - return string.Format("{0}.actionDelete()", ClientTools.Scripts.GetAppActions); - } - } - - public string JsSource - { - get - { - return null; - } - } - - public string Alias - { - get - { - return "delete"; - } - } - - public string Icon - { - get - { - return "delete"; - } - } - - public bool ShowInNotifier - { - get - { - return true; - } - } - public bool CanBePermissionAssigned - { - get - { - return true; - } - } - #endregion - } -} +using System; +using umbraco.interfaces; +using Umbraco.Web.UI.Pages; + +namespace Umbraco.Web.LegacyActions +{ + /// + /// This action is invoked when a document, media, member is deleted + /// + public class ActionDelete : IAction + { + //create singleton +#pragma warning disable 612,618 + private static readonly ActionDelete m_instance = new ActionDelete(); +#pragma warning restore 612,618 + + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionDelete() { } + + public static ActionDelete Instance + { + get { return m_instance; } + } + + #region IAction Members + + public char Letter + { + get + { + return 'D'; + } + } + + public string JsFunctionName + { + get + { + return string.Format("{0}.actionDelete()", ClientTools.Scripts.GetAppActions); + } + } + + public string JsSource + { + get + { + return null; + } + } + + public string Alias + { + get + { + return "delete"; + } + } + + public string Icon + { + get + { + return "delete"; + } + } + + public bool ShowInNotifier + { + get + { + return true; + } + } + public bool CanBePermissionAssigned + { + get + { + return true; + } + } + #endregion + } +} diff --git a/src/umbraco.cms/Actions/ActionDisable.cs b/src/Umbraco.Web/LegacyActions/ActionDisable.cs similarity index 90% rename from src/umbraco.cms/Actions/ActionDisable.cs rename to src/Umbraco.Web/LegacyActions/ActionDisable.cs index e89a39ea46..d00ca9c65d 100644 --- a/src/umbraco.cms/Actions/ActionDisable.cs +++ b/src/Umbraco.Web/LegacyActions/ActionDisable.cs @@ -1,92 +1,92 @@ -using System; -using umbraco.interfaces; -using umbraco.BasePages; - -namespace umbraco.BusinessLogic.Actions -{ - /// - /// This action is invoked when a document is disabled. - /// - public class ActionDisable : IAction - { - //create singleton -#pragma warning disable 612,618 - private static readonly ActionDisable m_instance = new ActionDisable(); -#pragma warning restore 612,618 - - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionDisable() { } - - public static ActionDisable Instance - { - get { return m_instance; } - } - - #region IAction Members - - public char Letter - { - get - { - return 'E'; - } - } - - public string JsFunctionName - { - get - { - return string.Format("{0}.actionDisable()", ClientTools.Scripts.GetAppActions); - } - } - - public string JsSource - { - get - { - return null; - } - } - - public string Alias - { - get - { - - return "disable"; - } - } - - public string Icon - { - get - { - - return "remove"; - } - } - - public bool ShowInNotifier - { - get - { - - return false; - } - } - public bool CanBePermissionAssigned - { - get - { - - return false; - } - } - #endregion - } -} +using System; +using umbraco.interfaces; +using Umbraco.Web.UI.Pages; + +namespace Umbraco.Web.LegacyActions +{ + /// + /// This action is invoked when a document is disabled. + /// + public class ActionDisable : IAction + { + //create singleton +#pragma warning disable 612,618 + private static readonly ActionDisable m_instance = new ActionDisable(); +#pragma warning restore 612,618 + + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionDisable() { } + + public static ActionDisable Instance + { + get { return m_instance; } + } + + #region IAction Members + + public char Letter + { + get + { + return 'E'; + } + } + + public string JsFunctionName + { + get + { + return string.Format("{0}.actionDisable()", ClientTools.Scripts.GetAppActions); + } + } + + public string JsSource + { + get + { + return null; + } + } + + public string Alias + { + get + { + + return "disable"; + } + } + + public string Icon + { + get + { + + return "remove"; + } + } + + public bool ShowInNotifier + { + get + { + + return false; + } + } + public bool CanBePermissionAssigned + { + get + { + + return false; + } + } + #endregion + } +} diff --git a/src/umbraco.cms/Actions/ActionEmptyTranscan.cs b/src/Umbraco.Web/LegacyActions/ActionEmptyTranscan.cs similarity index 90% rename from src/umbraco.cms/Actions/ActionEmptyTranscan.cs rename to src/Umbraco.Web/LegacyActions/ActionEmptyTranscan.cs index c28c775d53..045adff4f7 100644 --- a/src/umbraco.cms/Actions/ActionEmptyTranscan.cs +++ b/src/Umbraco.Web/LegacyActions/ActionEmptyTranscan.cs @@ -1,87 +1,87 @@ -using System; -using umbraco.interfaces; -using umbraco.BasePages; - -namespace umbraco.BusinessLogic.Actions -{ - /// - /// This action is invoked when the trash can is emptied - /// - public class ActionEmptyTranscan : IAction - { - //create singleton - private static readonly ActionEmptyTranscan InnerInstance = new ActionEmptyTranscan(); - - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionEmptyTranscan() { } - - public static ActionEmptyTranscan Instance - { - get { return InnerInstance; } - } - - #region IAction Members - - public char Letter - { - get - { - return 'N'; - } - } - - public string JsFunctionName - { - get - { - return string.Format("{0}.actionEmptyTranscan()", ClientTools.Scripts.GetAppActions); - } - } - - public string JsSource - { - get - { - return null; - } - } - - public string Alias - { - get - { - return "emptyRecycleBin"; - } - } - - public string Icon - { - get - { - return "trash"; - } - } - - public bool ShowInNotifier - { - get - { - return false; - } - } - public bool CanBePermissionAssigned - { - get - { - return false; - } - } - - #endregion - } -} +using System; +using umbraco.interfaces; +using Umbraco.Web.UI.Pages; + +namespace Umbraco.Web.LegacyActions +{ + /// + /// This action is invoked when the trash can is emptied + /// + public class ActionEmptyTranscan : IAction + { + //create singleton + private static readonly ActionEmptyTranscan InnerInstance = new ActionEmptyTranscan(); + + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionEmptyTranscan() { } + + public static ActionEmptyTranscan Instance + { + get { return InnerInstance; } + } + + #region IAction Members + + public char Letter + { + get + { + return 'N'; + } + } + + public string JsFunctionName + { + get + { + return string.Format("{0}.actionEmptyTranscan()", ClientTools.Scripts.GetAppActions); + } + } + + public string JsSource + { + get + { + return null; + } + } + + public string Alias + { + get + { + return "emptyRecycleBin"; + } + } + + public string Icon + { + get + { + return "trash"; + } + } + + public bool ShowInNotifier + { + get + { + return false; + } + } + public bool CanBePermissionAssigned + { + get + { + return false; + } + } + + #endregion + } +} diff --git a/src/umbraco.cms/Actions/ActionExport.cs b/src/Umbraco.Web/LegacyActions/ActionExport.cs similarity index 90% rename from src/umbraco.cms/Actions/ActionExport.cs rename to src/Umbraco.Web/LegacyActions/ActionExport.cs index 1b48b617a9..0b99b027ec 100644 --- a/src/umbraco.cms/Actions/ActionExport.cs +++ b/src/Umbraco.Web/LegacyActions/ActionExport.cs @@ -1,89 +1,89 @@ -using System; -using umbraco.interfaces; -using umbraco.BasePages; - -namespace umbraco.BusinessLogic.Actions -{ - /// - /// This action is invoked when exporting a document type - /// - public class ActionExport : IAction - { - //create singleton -#pragma warning disable 612,618 - private static readonly ActionExport m_instance = new ActionExport(); -#pragma warning restore 612,618 - - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionExport() { } - - public static ActionExport Instance - { - get { return m_instance; } - } - - #region IAction Members - - public char Letter - { - get - { - return '9'; - } - } - - public string JsFunctionName - { - get - { - return string.Format("{0}.actionExport()", ClientTools.Scripts.GetAppActions); - } - } - - public string JsSource - { - get - { - return null; - } - } - - public string Alias - { - get - { - return "exportDocumentType"; - } - } - - public string Icon - { - get - { - return "download-alt"; - } - } - - public bool ShowInNotifier - { - get - { - return false; - } - } - public bool CanBePermissionAssigned - { - get - { - return false; - } - } - - #endregion - } -} +using System; +using umbraco.interfaces; +using Umbraco.Web.UI.Pages; + +namespace Umbraco.Web.LegacyActions +{ + /// + /// This action is invoked when exporting a document type + /// + public class ActionExport : IAction + { + //create singleton +#pragma warning disable 612,618 + private static readonly ActionExport m_instance = new ActionExport(); +#pragma warning restore 612,618 + + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionExport() { } + + public static ActionExport Instance + { + get { return m_instance; } + } + + #region IAction Members + + public char Letter + { + get + { + return '9'; + } + } + + public string JsFunctionName + { + get + { + return string.Format("{0}.actionExport()", ClientTools.Scripts.GetAppActions); + } + } + + public string JsSource + { + get + { + return null; + } + } + + public string Alias + { + get + { + return "exportDocumentType"; + } + } + + public string Icon + { + get + { + return "download-alt"; + } + } + + public bool ShowInNotifier + { + get + { + return false; + } + } + public bool CanBePermissionAssigned + { + get + { + return false; + } + } + + #endregion + } +} diff --git a/src/umbraco.cms/Actions/ActionImport.cs b/src/Umbraco.Web/LegacyActions/ActionImport.cs similarity index 90% rename from src/umbraco.cms/Actions/ActionImport.cs rename to src/Umbraco.Web/LegacyActions/ActionImport.cs index 85ccd10c2d..5e3b953c54 100644 --- a/src/umbraco.cms/Actions/ActionImport.cs +++ b/src/Umbraco.Web/LegacyActions/ActionImport.cs @@ -1,89 +1,89 @@ -using System; -using umbraco.interfaces; -using umbraco.BasePages; - -namespace umbraco.BusinessLogic.Actions -{ - /// - /// This action is invoked when importing a document type - /// - public class ActionImport : IAction - { - //create singleton -#pragma warning disable 612,618 - private static readonly ActionImport m_instance = new ActionImport(); -#pragma warning restore 612,618 - - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionImport() { } - - public static ActionImport Instance - { - get { return m_instance; } - } - - #region IAction Members - - public char Letter - { - get - { - return '8'; - } - } - - public string JsFunctionName - { - get - { - return string.Format("{0}.actionImport()", ClientTools.Scripts.GetAppActions); - } - } - - public string JsSource - { - get - { - return null; - } - } - - public string Alias - { - get - { - return "importDocumentType"; - } - } - - public string Icon - { - get - { - return "page-up"; - } - } - - public bool ShowInNotifier - { - get - { - return false; - } - } - public bool CanBePermissionAssigned - { - get - { - return false; - } - } - - #endregion - } -} +using System; +using umbraco.interfaces; +using Umbraco.Web.UI.Pages; + +namespace Umbraco.Web.LegacyActions +{ + /// + /// This action is invoked when importing a document type + /// + public class ActionImport : IAction + { + //create singleton +#pragma warning disable 612,618 + private static readonly ActionImport m_instance = new ActionImport(); +#pragma warning restore 612,618 + + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionImport() { } + + public static ActionImport Instance + { + get { return m_instance; } + } + + #region IAction Members + + public char Letter + { + get + { + return '8'; + } + } + + public string JsFunctionName + { + get + { + return string.Format("{0}.actionImport()", ClientTools.Scripts.GetAppActions); + } + } + + public string JsSource + { + get + { + return null; + } + } + + public string Alias + { + get + { + return "importDocumentType"; + } + } + + public string Icon + { + get + { + return "page-up"; + } + } + + public bool ShowInNotifier + { + get + { + return false; + } + } + public bool CanBePermissionAssigned + { + get + { + return false; + } + } + + #endregion + } +} diff --git a/src/umbraco.cms/Actions/ActionMove.cs b/src/Umbraco.Web/LegacyActions/ActionMove.cs similarity index 89% rename from src/umbraco.cms/Actions/ActionMove.cs rename to src/Umbraco.Web/LegacyActions/ActionMove.cs index fd642e6b68..a17d13f92a 100644 --- a/src/umbraco.cms/Actions/ActionMove.cs +++ b/src/Umbraco.Web/LegacyActions/ActionMove.cs @@ -1,94 +1,94 @@ -using System; -using umbraco.interfaces; -using umbraco.BasePages; - -namespace umbraco.BusinessLogic.Actions -{ - /// - /// This action is invoked upon creation of a document, media, member - /// - public class ActionMove : IAction - { - //create singleton -#pragma warning disable 612,618 - private static readonly ActionMove m_instance = new ActionMove(); -#pragma warning restore 612,618 - - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionMove() { } - - public static ActionMove Instance - { - get { return m_instance; } - } - - #region IAction Members - - public char Letter - { - get - { - - return 'M'; - } - } - - public string JsFunctionName - { - get - { - return string.Format("{0}.actionMove()", ClientTools.Scripts.GetAppActions); - } - } - - public string JsSource - { - get - { - - return null; - } - } - - public string Alias - { - get - { - - return "move"; - } - } - - public string Icon - { - get - { - - return "enter"; - } - } - - public bool ShowInNotifier - { - get - { - - return true; - } - } - public bool CanBePermissionAssigned - { - get - { - - return true; - } - } - #endregion - } -} +using System; +using umbraco.interfaces; +using Umbraco.Web.UI.Pages; + +namespace Umbraco.Web.LegacyActions +{ + /// + /// This action is invoked upon creation of a document, media, member + /// + public class ActionMove : IAction + { + //create singleton +#pragma warning disable 612,618 + private static readonly ActionMove m_instance = new ActionMove(); +#pragma warning restore 612,618 + + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionMove() { } + + public static ActionMove Instance + { + get { return m_instance; } + } + + #region IAction Members + + public char Letter + { + get + { + + return 'M'; + } + } + + public string JsFunctionName + { + get + { + return string.Format("{0}.actionMove()", ClientTools.Scripts.GetAppActions); + } + } + + public string JsSource + { + get + { + + return null; + } + } + + public string Alias + { + get + { + + return "move"; + } + } + + public string Icon + { + get + { + + return "enter"; + } + } + + public bool ShowInNotifier + { + get + { + + return true; + } + } + public bool CanBePermissionAssigned + { + get + { + + return true; + } + } + #endregion + } +} diff --git a/src/umbraco.cms/Actions/ActionNew.cs b/src/Umbraco.Web/LegacyActions/ActionNew.cs similarity index 89% rename from src/umbraco.cms/Actions/ActionNew.cs rename to src/Umbraco.Web/LegacyActions/ActionNew.cs index 567015c45a..2490cac1fc 100644 --- a/src/umbraco.cms/Actions/ActionNew.cs +++ b/src/Umbraco.Web/LegacyActions/ActionNew.cs @@ -1,87 +1,87 @@ -using System; -using umbraco.interfaces; -using umbraco.BasePages; - -namespace umbraco.BusinessLogic.Actions -{ - /// - /// This action is invoked upon creation of a document - /// - public class ActionNew : IAction - { - //create singleton - private static readonly ActionNew InnerInstance = new ActionNew(); - - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionNew() { } - - public static ActionNew Instance - { - get { return InnerInstance; } - } - - #region IAction Members - - public char Letter - { - get - { - return 'C'; - } - } - - public string JsFunctionName - { - get - { - return string.Format("{0}.actionNew()", ClientTools.Scripts.GetAppActions); - } - } - - public string JsSource - { - get - { - return null; - } - } - - public string Alias - { - get - { - return "create"; - } - } - - public string Icon - { - get - { - return "add"; - } - } - - public bool ShowInNotifier - { - get - { - return true; - } - } - public bool CanBePermissionAssigned - { - get - { - return true; - } - } - - #endregion - } -} +using System; +using umbraco.interfaces; +using Umbraco.Web.UI.Pages; + +namespace Umbraco.Web.LegacyActions +{ + /// + /// This action is invoked upon creation of a document + /// + public class ActionNew : IAction + { + //create singleton + private static readonly ActionNew InnerInstance = new ActionNew(); + + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionNew() { } + + public static ActionNew Instance + { + get { return InnerInstance; } + } + + #region IAction Members + + public char Letter + { + get + { + return 'C'; + } + } + + public string JsFunctionName + { + get + { + return string.Format("{0}.actionNew()", ClientTools.Scripts.GetAppActions); + } + } + + public string JsSource + { + get + { + return null; + } + } + + public string Alias + { + get + { + return "create"; + } + } + + public string Icon + { + get + { + return "add"; + } + } + + public bool ShowInNotifier + { + get + { + return true; + } + } + public bool CanBePermissionAssigned + { + get + { + return true; + } + } + + #endregion + } +} diff --git a/src/umbraco.cms/Actions/ActionNewFolder.cs b/src/Umbraco.Web/LegacyActions/ActionNewFolder.cs similarity index 90% rename from src/umbraco.cms/Actions/ActionNewFolder.cs rename to src/Umbraco.Web/LegacyActions/ActionNewFolder.cs index a812842890..e4e0e3773f 100644 --- a/src/umbraco.cms/Actions/ActionNewFolder.cs +++ b/src/Umbraco.Web/LegacyActions/ActionNewFolder.cs @@ -1,90 +1,90 @@ -using System; -using umbraco.interfaces; -using umbraco.BasePages; - -namespace umbraco.BusinessLogic.Actions -{ - /// - /// This action is invoked upon creation of a document - /// - [Obsolete("This class is no longer used and will be removed in future versions")] - public class ActionNewFolder : IAction - { - //create singleton -#pragma warning disable 612,618 - private static readonly ActionNewFolder m_instance = new ActionNewFolder(); -#pragma warning restore 612,618 - - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionNewFolder() { } - - public static ActionNewFolder Instance - { - get { return m_instance; } - } - - #region IAction Members - - public char Letter - { - get - { - return '!'; - } - } - - public string JsFunctionName - { - get - { - return string.Format("{0}.actionNewFolder()", ClientTools.Scripts.GetAppActions); - } - } - - public string JsSource - { - get - { - return null; - } - } - - public string Alias - { - get - { - return "createFolder"; - } - } - - public string Icon - { - get - { - return "plus-sign-alt"; - } - } - - public bool ShowInNotifier - { - get - { - return false; - } - } - public bool CanBePermissionAssigned - { - get - { - return false; - } - } - - #endregion - } -} +using System; +using umbraco.interfaces; +using Umbraco.Web.UI.Pages; + +namespace Umbraco.Web.LegacyActions +{ + /// + /// This action is invoked upon creation of a document + /// + [Obsolete("This class is no longer used and will be removed in future versions")] + public class ActionNewFolder : IAction + { + //create singleton +#pragma warning disable 612,618 + private static readonly ActionNewFolder m_instance = new ActionNewFolder(); +#pragma warning restore 612,618 + + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionNewFolder() { } + + public static ActionNewFolder Instance + { + get { return m_instance; } + } + + #region IAction Members + + public char Letter + { + get + { + return '!'; + } + } + + public string JsFunctionName + { + get + { + return string.Format("{0}.actionNewFolder()", ClientTools.Scripts.GetAppActions); + } + } + + public string JsSource + { + get + { + return null; + } + } + + public string Alias + { + get + { + return "createFolder"; + } + } + + public string Icon + { + get + { + return "plus-sign-alt"; + } + } + + public bool ShowInNotifier + { + get + { + return false; + } + } + public bool CanBePermissionAssigned + { + get + { + return false; + } + } + + #endregion + } +} diff --git a/src/umbraco.cms/Actions/ActionNotify.cs b/src/Umbraco.Web/LegacyActions/ActionNotify.cs similarity index 90% rename from src/umbraco.cms/Actions/ActionNotify.cs rename to src/Umbraco.Web/LegacyActions/ActionNotify.cs index be1f32055d..6cf11a111b 100644 --- a/src/umbraco.cms/Actions/ActionNotify.cs +++ b/src/Umbraco.Web/LegacyActions/ActionNotify.cs @@ -1,90 +1,90 @@ -using System; -using umbraco.interfaces; -using umbraco.BasePages; - -namespace umbraco.BusinessLogic.Actions -{ - /// - /// This action is invoked when a notification is sent - /// - public class ActionNotify : IAction - { - //create singleton -#pragma warning disable 612,618 - private static readonly ActionNotify m_instance = new ActionNotify(); -#pragma warning restore 612,618 - - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionNotify() { } - - public static ActionNotify Instance - { - get { return m_instance; } - } - - #region IAction Members - - public char Letter - { - get - { - - return 'T'; - } - } - - public string JsFunctionName - { - get - { - return string.Format("{0}.actionNotify()", ClientTools.Scripts.GetAppActions); - } - } - - public string JsSource - { - get - { - - return null; - } - } - - public string Alias - { - get - { - return "notify"; - } - } - - public string Icon - { - get - { - return "megaphone"; - } - } - - public bool ShowInNotifier - { - get - { - return false; - } - } - public bool CanBePermissionAssigned - { - get - { - return false; - } - } - #endregion - } -} +using System; +using umbraco.interfaces; +using Umbraco.Web.UI.Pages; + +namespace Umbraco.Web.LegacyActions +{ + /// + /// This action is invoked when a notification is sent + /// + public class ActionNotify : IAction + { + //create singleton +#pragma warning disable 612,618 + private static readonly ActionNotify m_instance = new ActionNotify(); +#pragma warning restore 612,618 + + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionNotify() { } + + public static ActionNotify Instance + { + get { return m_instance; } + } + + #region IAction Members + + public char Letter + { + get + { + + return 'T'; + } + } + + public string JsFunctionName + { + get + { + return string.Format("{0}.actionNotify()", ClientTools.Scripts.GetAppActions); + } + } + + public string JsSource + { + get + { + + return null; + } + } + + public string Alias + { + get + { + return "notify"; + } + } + + public string Icon + { + get + { + return "megaphone"; + } + } + + public bool ShowInNotifier + { + get + { + return false; + } + } + public bool CanBePermissionAssigned + { + get + { + return false; + } + } + #endregion + } +} diff --git a/src/umbraco.cms/Actions/ActionNull.cs b/src/Umbraco.Web/LegacyActions/ActionNull.cs similarity index 87% rename from src/umbraco.cms/Actions/ActionNull.cs rename to src/Umbraco.Web/LegacyActions/ActionNull.cs index d0afd16685..6fcbc50c83 100644 --- a/src/umbraco.cms/Actions/ActionNull.cs +++ b/src/Umbraco.Web/LegacyActions/ActionNull.cs @@ -1,60 +1,58 @@ -using System; -using umbraco.interfaces; -using umbraco.BasePages; - -namespace umbraco.BusinessLogic.Actions -{ - /// - /// This permission is assigned to a node when there are no permissions assigned to the node. - /// This is used internally to assign no permissions to a node for a user and shouldn't be used in code. - /// - public class ActionNull : IAction - { - //create singleton - private static readonly ActionNull instance = new ActionNull(); - private ActionNull() { } - public static ActionNull Instance - { - get { return instance; } - } - - #region IAction Members - - public char Letter - { - get { return '-'; } - } - - public bool ShowInNotifier - { - get { return false; } - } - - public bool CanBePermissionAssigned - { - get { return false; } - } - - public string Icon - { - get { return string.Empty; } - } - - public string Alias - { - get { return string.Empty; } - } - - public string JsFunctionName - { - get { return string.Empty; } - } - - public string JsSource - { - get { return string.Empty; } - } - - #endregion - } -} +using umbraco.interfaces; + +namespace Umbraco.Web.LegacyActions +{ + /// + /// This permission is assigned to a node when there are no permissions assigned to the node. + /// This is used internally to assign no permissions to a node for a user and shouldn't be used in code. + /// + public class ActionNull : IAction + { + //create singleton + private static readonly ActionNull instance = new ActionNull(); + private ActionNull() { } + public static ActionNull Instance + { + get { return instance; } + } + + #region IAction Members + + public char Letter + { + get { return '-'; } + } + + public bool ShowInNotifier + { + get { return false; } + } + + public bool CanBePermissionAssigned + { + get { return false; } + } + + public string Icon + { + get { return string.Empty; } + } + + public string Alias + { + get { return string.Empty; } + } + + public string JsFunctionName + { + get { return string.Empty; } + } + + public string JsSource + { + get { return string.Empty; } + } + + #endregion + } +} diff --git a/src/umbraco.cms/Actions/ActionPackage.cs b/src/Umbraco.Web/LegacyActions/ActionPackage.cs similarity index 90% rename from src/umbraco.cms/Actions/ActionPackage.cs rename to src/Umbraco.Web/LegacyActions/ActionPackage.cs index 2da54f93bb..a381e37d3a 100644 --- a/src/umbraco.cms/Actions/ActionPackage.cs +++ b/src/Umbraco.Web/LegacyActions/ActionPackage.cs @@ -1,89 +1,89 @@ -using System; -using umbraco.interfaces; -using umbraco.BasePages; - -namespace umbraco.BusinessLogic.Actions -{ - /// - /// This action is invoked upon creation of a document, media, member - /// - public class ActionPackage : IAction - { - //create singleton -#pragma warning disable 612,618 - private static readonly ActionPackage m_instance = new ActionPackage(); -#pragma warning restore 612,618 - - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionPackage() { } - - public static ActionPackage Instance - { - get { return m_instance; } - } - - #region IAction Members - - public char Letter - { - get - { - return 'X'; - } - } - - public string JsFunctionName - { - get - { - return string.Format("{0}.actionPackage()", ClientTools.Scripts.GetAppActions); - } - } - - public string JsSource - { - get - { - return ""; - } - } - - public string Alias - { - get - { - return "importPackage"; - } - } - - public string Icon - { - get - { - return "gift"; - } - } - - public bool ShowInNotifier - { - get - { - return false; - } - } - public bool CanBePermissionAssigned - { - get - { - return false; - } - } - - #endregion - } -} +using System; +using umbraco.interfaces; +using Umbraco.Web.UI.Pages; + +namespace Umbraco.Web.LegacyActions +{ + /// + /// This action is invoked upon creation of a document, media, member + /// + public class ActionPackage : IAction + { + //create singleton +#pragma warning disable 612,618 + private static readonly ActionPackage m_instance = new ActionPackage(); +#pragma warning restore 612,618 + + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionPackage() { } + + public static ActionPackage Instance + { + get { return m_instance; } + } + + #region IAction Members + + public char Letter + { + get + { + return 'X'; + } + } + + public string JsFunctionName + { + get + { + return string.Format("{0}.actionPackage()", ClientTools.Scripts.GetAppActions); + } + } + + public string JsSource + { + get + { + return ""; + } + } + + public string Alias + { + get + { + return "importPackage"; + } + } + + public string Icon + { + get + { + return "gift"; + } + } + + public bool ShowInNotifier + { + get + { + return false; + } + } + public bool CanBePermissionAssigned + { + get + { + return false; + } + } + + #endregion + } +} diff --git a/src/umbraco.cms/Actions/ActionPackageCreate.cs b/src/Umbraco.Web/LegacyActions/ActionPackageCreate.cs similarity index 90% rename from src/umbraco.cms/Actions/ActionPackageCreate.cs rename to src/Umbraco.Web/LegacyActions/ActionPackageCreate.cs index 4d1f43f5ad..a3a4d96543 100644 --- a/src/umbraco.cms/Actions/ActionPackageCreate.cs +++ b/src/Umbraco.Web/LegacyActions/ActionPackageCreate.cs @@ -1,89 +1,89 @@ -using System; -using umbraco.interfaces; -using umbraco.BasePages; - -namespace umbraco.BusinessLogic.Actions -{ - /// - /// This action is invoked upon creation of a document, media, member - /// - public class ActionPackageCreate : IAction - { - //create singleton -#pragma warning disable 612,618 - private static readonly ActionPackageCreate m_instance = new ActionPackageCreate(); -#pragma warning restore 612,618 - - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionPackageCreate() { } - - public static ActionPackageCreate Instance - { - get { return m_instance; } - } - - #region IAction Members - - public char Letter - { - get - { - return 'Y'; - } - } - - public string JsFunctionName - { - get - { - return string.Format("{0}.actionPackageCreate()", ClientTools.Scripts.GetAppActions); - } - } - - public string JsSource - { - get - { - return null; - } - } - - public string Alias - { - get - { - return "createPackage"; - } - } - - public string Icon - { - get - { - return "gift"; - } - } - - public bool ShowInNotifier - { - get - { - return false; - } - } - public bool CanBePermissionAssigned - { - get - { - return false; - } - } - - #endregion - } -} +using System; +using umbraco.interfaces; +using Umbraco.Web.UI.Pages; + +namespace Umbraco.Web.LegacyActions +{ + /// + /// This action is invoked upon creation of a document, media, member + /// + public class ActionPackageCreate : IAction + { + //create singleton +#pragma warning disable 612,618 + private static readonly ActionPackageCreate m_instance = new ActionPackageCreate(); +#pragma warning restore 612,618 + + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionPackageCreate() { } + + public static ActionPackageCreate Instance + { + get { return m_instance; } + } + + #region IAction Members + + public char Letter + { + get + { + return 'Y'; + } + } + + public string JsFunctionName + { + get + { + return string.Format("{0}.actionPackageCreate()", ClientTools.Scripts.GetAppActions); + } + } + + public string JsSource + { + get + { + return null; + } + } + + public string Alias + { + get + { + return "createPackage"; + } + } + + public string Icon + { + get + { + return "gift"; + } + } + + public bool ShowInNotifier + { + get + { + return false; + } + } + public bool CanBePermissionAssigned + { + get + { + return false; + } + } + + #endregion + } +} diff --git a/src/umbraco.cms/Actions/ActionProtect.cs b/src/Umbraco.Web/LegacyActions/ActionProtect.cs similarity index 90% rename from src/umbraco.cms/Actions/ActionProtect.cs rename to src/Umbraco.Web/LegacyActions/ActionProtect.cs index 166e4b656c..a9b7831191 100644 --- a/src/umbraco.cms/Actions/ActionProtect.cs +++ b/src/Umbraco.Web/LegacyActions/ActionProtect.cs @@ -1,94 +1,94 @@ -using System; -using umbraco.interfaces; -using umbraco.BasePages; - -namespace umbraco.BusinessLogic.Actions -{ - /// - /// This action is invoked when a document is protected or unprotected - /// - public class ActionProtect : IAction - { - //create singleton -#pragma warning disable 612,618 - private static readonly ActionProtect m_instance = new ActionProtect(); -#pragma warning restore 612,618 - - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionProtect() { } - - public static ActionProtect Instance - { - get { return m_instance; } - } - - #region IAction Members - - public char Letter - { - get - { - - return 'P'; - } - } - - public string JsFunctionName - { - get - { - return string.Format("{0}.actionProtect()", ClientTools.Scripts.GetAppActions); - } - } - - public string JsSource - { - get - { - - return null; - } - } - - public string Alias - { - get - { - - return "protect"; - } - } - - public string Icon - { - get - { - - return "lock"; - } - } - - public bool ShowInNotifier - { - get - { - - return true; - } - } - public bool CanBePermissionAssigned - { - get - { - - return true; - } - } - #endregion - } -} +using System; +using umbraco.interfaces; +using Umbraco.Web.UI.Pages; + +namespace Umbraco.Web.LegacyActions +{ + /// + /// This action is invoked when a document is protected or unprotected + /// + public class ActionProtect : IAction + { + //create singleton +#pragma warning disable 612,618 + private static readonly ActionProtect m_instance = new ActionProtect(); +#pragma warning restore 612,618 + + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionProtect() { } + + public static ActionProtect Instance + { + get { return m_instance; } + } + + #region IAction Members + + public char Letter + { + get + { + + return 'P'; + } + } + + public string JsFunctionName + { + get + { + return string.Format("{0}.actionProtect()", ClientTools.Scripts.GetAppActions); + } + } + + public string JsSource + { + get + { + + return null; + } + } + + public string Alias + { + get + { + + return "protect"; + } + } + + public string Icon + { + get + { + + return "lock"; + } + } + + public bool ShowInNotifier + { + get + { + + return true; + } + } + public bool CanBePermissionAssigned + { + get + { + + return true; + } + } + #endregion + } +} diff --git a/src/umbraco.cms/Actions/ActionPublish.cs b/src/Umbraco.Web/LegacyActions/ActionPublish.cs similarity index 90% rename from src/umbraco.cms/Actions/ActionPublish.cs rename to src/Umbraco.Web/LegacyActions/ActionPublish.cs index d53a37d5ba..50af6aa184 100644 --- a/src/umbraco.cms/Actions/ActionPublish.cs +++ b/src/Umbraco.Web/LegacyActions/ActionPublish.cs @@ -1,88 +1,88 @@ -using System; -using umbraco.interfaces; -using umbraco.BasePages; - -namespace umbraco.BusinessLogic.Actions -{ - /// - /// This action is invoked when a document is being published - /// - public class ActionPublish : IAction - { - //create singleton -#pragma warning disable 612,618 - private static readonly ActionPublish m_instance = new ActionPublish(); -#pragma warning restore 612,618 - - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionPublish() { } - - public static ActionPublish Instance - { - get { return m_instance; } - } - - #region IAction Members - - public char Letter - { - get - { - return 'U'; - } - } - - public string JsFunctionName - { - get - { - return string.Format("{0}.actionPublish()", ClientTools.Scripts.GetAppActions); - } - } - - public string JsSource - { - get - { - return null; - } - } - - public string Alias - { - get - { - return "publish"; - } - } - - public string Icon - { - get - { - return "globe"; - } - } - - public bool ShowInNotifier - { - get - { - return true; - } - } - public bool CanBePermissionAssigned - { - get - { - return true; - } - } - #endregion - } -} +using System; +using umbraco.interfaces; +using Umbraco.Web.UI.Pages; + +namespace Umbraco.Web.LegacyActions +{ + /// + /// This action is invoked when a document is being published + /// + public class ActionPublish : IAction + { + //create singleton +#pragma warning disable 612,618 + private static readonly ActionPublish m_instance = new ActionPublish(); +#pragma warning restore 612,618 + + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionPublish() { } + + public static ActionPublish Instance + { + get { return m_instance; } + } + + #region IAction Members + + public char Letter + { + get + { + return 'U'; + } + } + + public string JsFunctionName + { + get + { + return string.Format("{0}.actionPublish()", ClientTools.Scripts.GetAppActions); + } + } + + public string JsSource + { + get + { + return null; + } + } + + public string Alias + { + get + { + return "publish"; + } + } + + public string Icon + { + get + { + return "globe"; + } + } + + public bool ShowInNotifier + { + get + { + return true; + } + } + public bool CanBePermissionAssigned + { + get + { + return true; + } + } + #endregion + } +} diff --git a/src/umbraco.cms/Actions/ActionQuit.cs b/src/Umbraco.Web/LegacyActions/ActionQuit.cs similarity index 90% rename from src/umbraco.cms/Actions/ActionQuit.cs rename to src/Umbraco.Web/LegacyActions/ActionQuit.cs index 1bd903fd2a..40437a5990 100644 --- a/src/umbraco.cms/Actions/ActionQuit.cs +++ b/src/Umbraco.Web/LegacyActions/ActionQuit.cs @@ -1,89 +1,89 @@ -using System; -using umbraco.interfaces; -using umbraco.BasePages; - -namespace umbraco.BusinessLogic.Actions -{ - /// - /// This action is invoked when a user logs out - /// - [Obsolete("This should not be used and will be removed from the codebase in future versions")] - public class ActionQuit : IAction - { - //create singleton -#pragma warning disable 612,618 - private static readonly ActionQuit m_instance = new ActionQuit(); -#pragma warning restore 612,618 - - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionQuit() { } - - public static ActionQuit Instance - { - get { return m_instance; } - } - - #region IAction Members - - public char Letter - { - get - { - return 'Q'; - } - } - - public string JsFunctionName - { - get - { - return string.Format("{0}.actionQuit()", ClientTools.Scripts.GetAppActions); - } - } - - public string JsSource - { - get - { - return null; - } - } - - public string Alias - { - get - { - return "logout"; - } - } - - public string Icon - { - get - { - return "signout"; - } - } - - public bool ShowInNotifier - { - get - { - return false; - } - } - public bool CanBePermissionAssigned - { - get - { - return false; - } - } - #endregion - } -} +using System; +using umbraco.interfaces; +using Umbraco.Web.UI.Pages; + +namespace Umbraco.Web.LegacyActions +{ + /// + /// This action is invoked when a user logs out + /// + [Obsolete("This should not be used and will be removed from the codebase in future versions")] + public class ActionQuit : IAction + { + //create singleton +#pragma warning disable 612,618 + private static readonly ActionQuit m_instance = new ActionQuit(); +#pragma warning restore 612,618 + + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionQuit() { } + + public static ActionQuit Instance + { + get { return m_instance; } + } + + #region IAction Members + + public char Letter + { + get + { + return 'Q'; + } + } + + public string JsFunctionName + { + get + { + return string.Format("{0}.actionQuit()", ClientTools.Scripts.GetAppActions); + } + } + + public string JsSource + { + get + { + return null; + } + } + + public string Alias + { + get + { + return "logout"; + } + } + + public string Icon + { + get + { + return "signout"; + } + } + + public bool ShowInNotifier + { + get + { + return false; + } + } + public bool CanBePermissionAssigned + { + get + { + return false; + } + } + #endregion + } +} diff --git a/src/umbraco.cms/Actions/ActionRePublish.cs b/src/Umbraco.Web/LegacyActions/ActionRePublish.cs similarity index 90% rename from src/umbraco.cms/Actions/ActionRePublish.cs rename to src/Umbraco.Web/LegacyActions/ActionRePublish.cs index 2fefb7e2e1..4bab903e7b 100644 --- a/src/umbraco.cms/Actions/ActionRePublish.cs +++ b/src/Umbraco.Web/LegacyActions/ActionRePublish.cs @@ -1,88 +1,88 @@ -using System; -using umbraco.interfaces; -using umbraco.BasePages; - -namespace umbraco.BusinessLogic.Actions -{ - /// - /// This action is invoked when all documents are being republished - /// - public class ActionRePublish : IAction - { - //create singleton -#pragma warning disable 612,618 - private static readonly ActionRePublish m_instance = new ActionRePublish(); -#pragma warning restore 612,618 - - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionRePublish() { } - - public static ActionRePublish Instance - { - get { return m_instance; } - } - - #region IAction Members - - public char Letter - { - get - { - return 'B'; - } - } - - public string JsFunctionName - { - get - { - return string.Format("{0}.actionRePublish()", ClientTools.Scripts.GetAppActions); - } - } - - public string JsSource - { - get - { - return null; - } - } - - public string Alias - { - get - { - return "republish"; - } - } - - public string Icon - { - get - { - return "globe"; - } - } - - public bool ShowInNotifier - { - get - { - return false; - } - } - public bool CanBePermissionAssigned - { - get - { - return false; - } - } - #endregion - } -} +using System; +using umbraco.interfaces; +using Umbraco.Web.UI.Pages; + +namespace Umbraco.Web.LegacyActions +{ + /// + /// This action is invoked when all documents are being republished + /// + public class ActionRePublish : IAction + { + //create singleton +#pragma warning disable 612,618 + private static readonly ActionRePublish m_instance = new ActionRePublish(); +#pragma warning restore 612,618 + + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionRePublish() { } + + public static ActionRePublish Instance + { + get { return m_instance; } + } + + #region IAction Members + + public char Letter + { + get + { + return 'B'; + } + } + + public string JsFunctionName + { + get + { + return string.Format("{0}.actionRePublish()", ClientTools.Scripts.GetAppActions); + } + } + + public string JsSource + { + get + { + return null; + } + } + + public string Alias + { + get + { + return "republish"; + } + } + + public string Icon + { + get + { + return "globe"; + } + } + + public bool ShowInNotifier + { + get + { + return false; + } + } + public bool CanBePermissionAssigned + { + get + { + return false; + } + } + #endregion + } +} diff --git a/src/umbraco.cms/Actions/ActionRefresh.cs b/src/Umbraco.Web/LegacyActions/ActionRefresh.cs similarity index 90% rename from src/umbraco.cms/Actions/ActionRefresh.cs rename to src/Umbraco.Web/LegacyActions/ActionRefresh.cs index e94d4d2fed..addc45ff96 100644 --- a/src/umbraco.cms/Actions/ActionRefresh.cs +++ b/src/Umbraco.Web/LegacyActions/ActionRefresh.cs @@ -1,95 +1,95 @@ -using System; -using umbraco.interfaces; -using umbraco.BasePages; - -namespace umbraco.BusinessLogic.Actions -{ - /// - /// This action is invoked when a node reloads its children - /// Concerns only the tree itself and thus you should not handle - /// this action from without umbraco. - /// - [LegacyActionMenuItem("umbracoMenuActions", "RefreshNode")] - public class ActionRefresh : IAction - { - //create singleton - private static readonly ActionRefresh InnerInstance = new ActionRefresh(); - - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionRefresh() { } - - public static ActionRefresh Instance - { - get { return InnerInstance; } - } - - #region IAction Members - - public char Letter - { - get - { - - return 'L'; - } - } - - public string JsFunctionName - { - get - { - return string.Format("{0}.actionRefresh()", ClientTools.Scripts.GetAppActions); - } - } - - public string JsSource - { - get - { - - return null; - } - } - - public string Alias - { - get - { - - return "refreshNode"; - } - } - - public string Icon - { - get - { - - return "refresh"; - } - } - - public bool ShowInNotifier - { - get - { - - return false; - } - } - public bool CanBePermissionAssigned - { - get - { - - return false; - } - } - #endregion - } -} +using System; +using umbraco.interfaces; +using Umbraco.Web.UI.Pages; + +namespace Umbraco.Web.LegacyActions +{ + /// + /// This action is invoked when a node reloads its children + /// Concerns only the tree itself and thus you should not handle + /// this action from without umbraco. + /// + [LegacyActionMenuItem("umbracoMenuActions", "RefreshNode")] + public class ActionRefresh : IAction + { + //create singleton + private static readonly ActionRefresh InnerInstance = new ActionRefresh(); + + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionRefresh() { } + + public static ActionRefresh Instance + { + get { return InnerInstance; } + } + + #region IAction Members + + public char Letter + { + get + { + + return 'L'; + } + } + + public string JsFunctionName + { + get + { + return string.Format("{0}.actionRefresh()", ClientTools.Scripts.GetAppActions); + } + } + + public string JsSource + { + get + { + + return null; + } + } + + public string Alias + { + get + { + + return "refreshNode"; + } + } + + public string Icon + { + get + { + + return "refresh"; + } + } + + public bool ShowInNotifier + { + get + { + + return false; + } + } + public bool CanBePermissionAssigned + { + get + { + + return false; + } + } + #endregion + } +} diff --git a/src/umbraco.cms/Actions/ActionRestore.cs b/src/Umbraco.Web/LegacyActions/ActionRestore.cs similarity index 92% rename from src/umbraco.cms/Actions/ActionRestore.cs rename to src/Umbraco.Web/LegacyActions/ActionRestore.cs index 9b38918fd4..402ba878c3 100644 --- a/src/umbraco.cms/Actions/ActionRestore.cs +++ b/src/Umbraco.Web/LegacyActions/ActionRestore.cs @@ -1,8 +1,6 @@ -using System; -using umbraco.interfaces; -using umbraco.BasePages; +using umbraco.interfaces; -namespace umbraco.BusinessLogic.Actions +namespace Umbraco.Web.LegacyActions { /// /// This action is invoked when the content item is to be restored from the recycle bin diff --git a/src/umbraco.cms/Actions/ActionRights.cs b/src/Umbraco.Web/LegacyActions/ActionRights.cs similarity index 90% rename from src/umbraco.cms/Actions/ActionRights.cs rename to src/Umbraco.Web/LegacyActions/ActionRights.cs index eb56829843..a91c95713f 100644 --- a/src/umbraco.cms/Actions/ActionRights.cs +++ b/src/Umbraco.Web/LegacyActions/ActionRights.cs @@ -1,94 +1,94 @@ -using System; -using umbraco.interfaces; -using umbraco.BasePages; - -namespace umbraco.BusinessLogic.Actions -{ - /// - /// This action is invoked when rights are changed on a document - /// - public class ActionRights : IAction - { - //create singleton -#pragma warning disable 612,618 - private static readonly ActionRights m_instance = new ActionRights(); -#pragma warning restore 612,618 - - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionRights() { } - - public static ActionRights Instance - { - get { return m_instance; } - } - - #region IAction Members - - public char Letter - { - get - { - - return 'R'; - } - } - - public string JsFunctionName - { - get - { - return string.Format("{0}.actionRights()", ClientTools.Scripts.GetAppActions); - } - } - - public string JsSource - { - get - { - - return null; - } - } - - public string Alias - { - get - { - - return "rights"; - } - } - - public string Icon - { - get - { - - return "vcard"; - } - } - - public bool ShowInNotifier - { - get - { - - return true; - } - } - public bool CanBePermissionAssigned - { - get - { - - return true; - } - } - #endregion - } -} +using System; +using umbraco.interfaces; +using Umbraco.Web.UI.Pages; + +namespace Umbraco.Web.LegacyActions +{ + /// + /// This action is invoked when rights are changed on a document + /// + public class ActionRights : IAction + { + //create singleton +#pragma warning disable 612,618 + private static readonly ActionRights m_instance = new ActionRights(); +#pragma warning restore 612,618 + + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionRights() { } + + public static ActionRights Instance + { + get { return m_instance; } + } + + #region IAction Members + + public char Letter + { + get + { + + return 'R'; + } + } + + public string JsFunctionName + { + get + { + return string.Format("{0}.actionRights()", ClientTools.Scripts.GetAppActions); + } + } + + public string JsSource + { + get + { + + return null; + } + } + + public string Alias + { + get + { + + return "rights"; + } + } + + public string Icon + { + get + { + + return "vcard"; + } + } + + public bool ShowInNotifier + { + get + { + + return true; + } + } + public bool CanBePermissionAssigned + { + get + { + + return true; + } + } + #endregion + } +} diff --git a/src/umbraco.cms/Actions/ActionRollback.cs b/src/Umbraco.Web/LegacyActions/ActionRollback.cs similarity index 90% rename from src/umbraco.cms/Actions/ActionRollback.cs rename to src/Umbraco.Web/LegacyActions/ActionRollback.cs index 474f920703..78de09a770 100644 --- a/src/umbraco.cms/Actions/ActionRollback.cs +++ b/src/Umbraco.Web/LegacyActions/ActionRollback.cs @@ -1,93 +1,93 @@ -using System; -using umbraco.interfaces; -using umbraco.BasePages; - -namespace umbraco.BusinessLogic.Actions -{ - /// - /// This action is invoked when copying a document is being rolled back - /// - public class ActionRollback : IAction - { - //create singleton -#pragma warning disable 612,618 - private static readonly ActionRollback m_instance = new ActionRollback(); -#pragma warning restore 612,618 - - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionRollback() { } - - public static ActionRollback Instance - { - get { return m_instance; } - } - - #region IAction Members - - public char Letter - { - get - { - - return 'K'; - } - } - - public string JsFunctionName - { - get - { - return string.Format("{0}.actionRollback()", ClientTools.Scripts.GetAppActions); - } - } - - public string JsSource - { - get - { - return ""; - } - } - - public string Alias - { - get - { - - return "rollback"; - } - } - - public string Icon - { - get - { - - return "undo"; - } - } - - public bool ShowInNotifier - { - get - { - - return true; - } - } - public bool CanBePermissionAssigned - { - get - { - - return true; - } - } - #endregion - } -} +using System; +using umbraco.interfaces; +using Umbraco.Web.UI.Pages; + +namespace Umbraco.Web.LegacyActions +{ + /// + /// This action is invoked when copying a document is being rolled back + /// + public class ActionRollback : IAction + { + //create singleton +#pragma warning disable 612,618 + private static readonly ActionRollback m_instance = new ActionRollback(); +#pragma warning restore 612,618 + + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionRollback() { } + + public static ActionRollback Instance + { + get { return m_instance; } + } + + #region IAction Members + + public char Letter + { + get + { + + return 'K'; + } + } + + public string JsFunctionName + { + get + { + return string.Format("{0}.actionRollback()", ClientTools.Scripts.GetAppActions); + } + } + + public string JsSource + { + get + { + return ""; + } + } + + public string Alias + { + get + { + + return "rollback"; + } + } + + public string Icon + { + get + { + + return "undo"; + } + } + + public bool ShowInNotifier + { + get + { + + return true; + } + } + public bool CanBePermissionAssigned + { + get + { + + return true; + } + } + #endregion + } +} diff --git a/src/umbraco.cms/Actions/ActionSendToTranslate.cs b/src/Umbraco.Web/LegacyActions/ActionSendToTranslate.cs similarity index 90% rename from src/umbraco.cms/Actions/ActionSendToTranslate.cs rename to src/Umbraco.Web/LegacyActions/ActionSendToTranslate.cs index cd7ec135cc..4e2bf79b14 100644 --- a/src/umbraco.cms/Actions/ActionSendToTranslate.cs +++ b/src/Umbraco.Web/LegacyActions/ActionSendToTranslate.cs @@ -1,89 +1,89 @@ -using System; -using umbraco.interfaces; -using umbraco.BasePages; - -namespace umbraco.BusinessLogic.Actions -{ - /// - /// This action is invoked when a send to translate request occurs - /// - public class ActionSendToTranslate : IAction - { - //create singleton -#pragma warning disable 612,618 - private static readonly ActionSendToTranslate m_instance = new ActionSendToTranslate(); -#pragma warning restore 612,618 - - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionSendToTranslate() { } - - public static ActionSendToTranslate Instance - { - get { return m_instance; } - } - - #region IAction Members - - public char Letter - { - get - { - return '5'; - } - } - - public string JsFunctionName - { - get - { - return string.Format("{0}.actionSendToTranslate()", ClientTools.Scripts.GetAppActions); - } - } - - public string JsSource - { - get - { - return null; - } - } - - public string Alias - { - get - { - return "sendToTranslate"; - } - } - - public string Icon - { - get - { - return "chat"; - } - } - - public bool ShowInNotifier - { - get - { - return true; - } - } - public bool CanBePermissionAssigned - { - get - { - return true; - } - } - - #endregion - } -} +using System; +using umbraco.interfaces; +using Umbraco.Web.UI.Pages; + +namespace Umbraco.Web.LegacyActions +{ + /// + /// This action is invoked when a send to translate request occurs + /// + public class ActionSendToTranslate : IAction + { + //create singleton +#pragma warning disable 612,618 + private static readonly ActionSendToTranslate m_instance = new ActionSendToTranslate(); +#pragma warning restore 612,618 + + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionSendToTranslate() { } + + public static ActionSendToTranslate Instance + { + get { return m_instance; } + } + + #region IAction Members + + public char Letter + { + get + { + return '5'; + } + } + + public string JsFunctionName + { + get + { + return string.Format("{0}.actionSendToTranslate()", ClientTools.Scripts.GetAppActions); + } + } + + public string JsSource + { + get + { + return null; + } + } + + public string Alias + { + get + { + return "sendToTranslate"; + } + } + + public string Icon + { + get + { + return "chat"; + } + } + + public bool ShowInNotifier + { + get + { + return true; + } + } + public bool CanBePermissionAssigned + { + get + { + return true; + } + } + + #endregion + } +} diff --git a/src/umbraco.cms/Actions/ActionSort.cs b/src/Umbraco.Web/LegacyActions/ActionSort.cs similarity index 90% rename from src/umbraco.cms/Actions/ActionSort.cs rename to src/Umbraco.Web/LegacyActions/ActionSort.cs index 7ece758c28..a6db6e215f 100644 --- a/src/umbraco.cms/Actions/ActionSort.cs +++ b/src/Umbraco.Web/LegacyActions/ActionSort.cs @@ -1,94 +1,94 @@ -using System; -using umbraco.interfaces; -using umbraco.BasePages; - -namespace umbraco.BusinessLogic.Actions -{ - /// - /// This action is invoked when children to a document, media, member is being sorted - /// - public class ActionSort : IAction - { - //create singleton -#pragma warning disable 612,618 - private static readonly ActionSort m_instance = new ActionSort(); -#pragma warning restore 612,618 - - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionSort() { } - - public static ActionSort Instance - { - get { return m_instance; } - } - - #region IAction Members - - public char Letter - { - get - { - - return 'S'; - } - } - - public string JsFunctionName - { - get - { - return string.Format("{0}.actionSort()", ClientTools.Scripts.GetAppActions); - } - } - - public string JsSource - { - get - { - - return null; - } - } - - public string Alias - { - get - { - - return "sort"; - } - } - - public string Icon - { - get - { - - return "navigation-vertical"; - } - } - - public bool ShowInNotifier - { - get - { - - return true; - } - } - public bool CanBePermissionAssigned - { - get - { - - return true; - } - } - #endregion - } -} +using System; +using umbraco.interfaces; +using Umbraco.Web.UI.Pages; + +namespace Umbraco.Web.LegacyActions +{ + /// + /// This action is invoked when children to a document, media, member is being sorted + /// + public class ActionSort : IAction + { + //create singleton +#pragma warning disable 612,618 + private static readonly ActionSort m_instance = new ActionSort(); +#pragma warning restore 612,618 + + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionSort() { } + + public static ActionSort Instance + { + get { return m_instance; } + } + + #region IAction Members + + public char Letter + { + get + { + + return 'S'; + } + } + + public string JsFunctionName + { + get + { + return string.Format("{0}.actionSort()", ClientTools.Scripts.GetAppActions); + } + } + + public string JsSource + { + get + { + + return null; + } + } + + public string Alias + { + get + { + + return "sort"; + } + } + + public string Icon + { + get + { + + return "navigation-vertical"; + } + } + + public bool ShowInNotifier + { + get + { + + return true; + } + } + public bool CanBePermissionAssigned + { + get + { + + return true; + } + } + #endregion + } +} diff --git a/src/umbraco.cms/Actions/ActionToPublish.cs b/src/Umbraco.Web/LegacyActions/ActionToPublish.cs similarity index 91% rename from src/umbraco.cms/Actions/ActionToPublish.cs rename to src/Umbraco.Web/LegacyActions/ActionToPublish.cs index c2c6ee96c1..8d2bc39683 100644 --- a/src/umbraco.cms/Actions/ActionToPublish.cs +++ b/src/Umbraco.Web/LegacyActions/ActionToPublish.cs @@ -1,89 +1,89 @@ -using System; -using umbraco.interfaces; -using umbraco.BasePages; - -namespace umbraco.BusinessLogic.Actions -{ - /// - /// This action is invoked when children to a document is being sent to published (by an editor without publishrights) - /// - public class ActionToPublish : IAction - { - //create singleton -#pragma warning disable 612,618 - private static readonly ActionToPublish m_instance = new ActionToPublish(); -#pragma warning restore 612,618 - - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionToPublish() { } - - public static ActionToPublish Instance - { - get { return m_instance; } - } - - #region IAction Members - - public char Letter - { - get - { - return 'H'; - } - } - - public string JsFunctionName - { - get - { - return string.Format("{0}.actionToPublish()", ClientTools.Scripts.GetAppActions); - } - } - - public string JsSource - { - get - { - return null; - } - } - - public string Alias - { - get - { - return "sendtopublish"; - } - } - - public string Icon - { - get - { - return "outbox"; - } - } - - public bool ShowInNotifier - { - get - { - return true; - } - } - public bool CanBePermissionAssigned - { - get - { - //SD: Changed this to true so that any user may be able to perform this action, not just a writer - return true; - } - } - #endregion - } -} +using System; +using umbraco.interfaces; +using Umbraco.Web.UI.Pages; + +namespace Umbraco.Web.LegacyActions +{ + /// + /// This action is invoked when children to a document is being sent to published (by an editor without publishrights) + /// + public class ActionToPublish : IAction + { + //create singleton +#pragma warning disable 612,618 + private static readonly ActionToPublish m_instance = new ActionToPublish(); +#pragma warning restore 612,618 + + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionToPublish() { } + + public static ActionToPublish Instance + { + get { return m_instance; } + } + + #region IAction Members + + public char Letter + { + get + { + return 'H'; + } + } + + public string JsFunctionName + { + get + { + return string.Format("{0}.actionToPublish()", ClientTools.Scripts.GetAppActions); + } + } + + public string JsSource + { + get + { + return null; + } + } + + public string Alias + { + get + { + return "sendtopublish"; + } + } + + public string Icon + { + get + { + return "outbox"; + } + } + + public bool ShowInNotifier + { + get + { + return true; + } + } + public bool CanBePermissionAssigned + { + get + { + //SD: Changed this to true so that any user may be able to perform this action, not just a writer + return true; + } + } + #endregion + } +} diff --git a/src/umbraco.cms/Actions/ActionTranslate.cs b/src/Umbraco.Web/LegacyActions/ActionTranslate.cs similarity index 89% rename from src/umbraco.cms/Actions/ActionTranslate.cs rename to src/Umbraco.Web/LegacyActions/ActionTranslate.cs index 8e7064fa7d..e8dfae59a8 100644 --- a/src/umbraco.cms/Actions/ActionTranslate.cs +++ b/src/Umbraco.Web/LegacyActions/ActionTranslate.cs @@ -1,89 +1,88 @@ -using System; -using umbraco.interfaces; -using umbraco.BasePages; - -namespace umbraco.BusinessLogic.Actions -{ - /// - /// This action is invoked when a translation occurs - /// - public class ActionTranslate : IAction - { - //create singleton -#pragma warning disable 612,618 - private static readonly ActionTranslate m_instance = new ActionTranslate(); -#pragma warning restore 612,618 - - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionTranslate() { } - - public static ActionTranslate Instance - { - get { return m_instance; } - } - - #region IAction Members - - public char Letter - { - get - { - return '4'; - } - } - - public string JsFunctionName - { - get - { - return ""; - } - } - - public string JsSource - { - get - { - return null; - } - } - - public string Alias - { - get - { - return "translate"; - } - } - - public string Icon - { - get - { - return "comments"; - } - } - - public bool ShowInNotifier - { - get - { - return true; - } - } - public bool CanBePermissionAssigned - { - get - { - return true; - } - } - - #endregion - } -} +using System; +using umbraco.interfaces; + +namespace Umbraco.Web.LegacyActions +{ + /// + /// This action is invoked when a translation occurs + /// + public class ActionTranslate : IAction + { + //create singleton +#pragma warning disable 612,618 + private static readonly ActionTranslate m_instance = new ActionTranslate(); +#pragma warning restore 612,618 + + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionTranslate() { } + + public static ActionTranslate Instance + { + get { return m_instance; } + } + + #region IAction Members + + public char Letter + { + get + { + return '4'; + } + } + + public string JsFunctionName + { + get + { + return ""; + } + } + + public string JsSource + { + get + { + return null; + } + } + + public string Alias + { + get + { + return "translate"; + } + } + + public string Icon + { + get + { + return "comments"; + } + } + + public bool ShowInNotifier + { + get + { + return true; + } + } + public bool CanBePermissionAssigned + { + get + { + return true; + } + } + + #endregion + } +} diff --git a/src/umbraco.cms/Actions/ActionUnPublish.cs b/src/Umbraco.Web/LegacyActions/ActionUnPublish.cs similarity index 90% rename from src/umbraco.cms/Actions/ActionUnPublish.cs rename to src/Umbraco.Web/LegacyActions/ActionUnPublish.cs index ed927915a0..aed4e51d47 100644 --- a/src/umbraco.cms/Actions/ActionUnPublish.cs +++ b/src/Umbraco.Web/LegacyActions/ActionUnPublish.cs @@ -1,92 +1,91 @@ -using System; -using umbraco.interfaces; -using umbraco.BasePages; - -namespace umbraco.BusinessLogic.Actions -{ - - - - /// - /// This action is invoked when a document is being unpublished - /// - public class ActionUnPublish : IAction - { - //create singleton -#pragma warning disable 612,618 - private static readonly ActionUnPublish m_instance = new ActionUnPublish(); -#pragma warning restore 612,618 - - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance). - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionUnPublish() { } - - public static ActionUnPublish Instance - { - get { return m_instance; } - } - - #region IAction Members - - public char Letter - { - get - { - return 'Z'; - } - } - - public string JsFunctionName - { - get - { - return ""; - } - } - - public string JsSource - { - get - { - return null; - } - } - - public string Alias - { - get - { - return "unpublish"; - } - } - - public string Icon - { - get - { - return "circle-dotted"; - } - } - - public bool ShowInNotifier - { - get - { - return false; - } - } - public bool CanBePermissionAssigned - { - get - { - return false; - } - } - #endregion - } - -} +using System; +using umbraco.interfaces; + +namespace Umbraco.Web.LegacyActions +{ + + + + /// + /// This action is invoked when a document is being unpublished + /// + public class ActionUnPublish : IAction + { + //create singleton +#pragma warning disable 612,618 + private static readonly ActionUnPublish m_instance = new ActionUnPublish(); +#pragma warning restore 612,618 + + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance). + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionUnPublish() { } + + public static ActionUnPublish Instance + { + get { return m_instance; } + } + + #region IAction Members + + public char Letter + { + get + { + return 'Z'; + } + } + + public string JsFunctionName + { + get + { + return ""; + } + } + + public string JsSource + { + get + { + return null; + } + } + + public string Alias + { + get + { + return "unpublish"; + } + } + + public string Icon + { + get + { + return "circle-dotted"; + } + } + + public bool ShowInNotifier + { + get + { + return false; + } + } + public bool CanBePermissionAssigned + { + get + { + return false; + } + } + #endregion + } + +} diff --git a/src/umbraco.cms/Actions/ActionUpdate.cs b/src/Umbraco.Web/LegacyActions/ActionUpdate.cs similarity index 90% rename from src/umbraco.cms/Actions/ActionUpdate.cs rename to src/Umbraco.Web/LegacyActions/ActionUpdate.cs index 9f48335d1d..dd13df89a4 100644 --- a/src/umbraco.cms/Actions/ActionUpdate.cs +++ b/src/Umbraco.Web/LegacyActions/ActionUpdate.cs @@ -1,88 +1,88 @@ -using System; -using umbraco.interfaces; -using umbraco.BasePages; - -namespace umbraco.BusinessLogic.Actions -{ - /// - /// This action is invoked when copying a document or media - /// - public class ActionUpdate : IAction - { - //create singleton -#pragma warning disable 612,618 - private static readonly ActionUpdate m_instance = new ActionUpdate(); -#pragma warning restore 612,618 - - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionUpdate() { } - - public static ActionUpdate Instance - { - get { return m_instance; } - } - - #region IAction Members - - public char Letter - { - get - { - return 'A'; - } - } - - public string JsFunctionName - { - get - { - return string.Format("{0}.actionUpdate()", ClientTools.Scripts.GetAppActions); - } - } - - public string JsSource - { - get - { - return null; - } - } - - public string Alias - { - get - { - return "update"; - } - } - - public string Icon - { - get - { - return "save"; - } - } - - public bool ShowInNotifier - { - get - { - return true; - } - } - public bool CanBePermissionAssigned - { - get - { - return true; - } - } - #endregion - } -} +using System; +using umbraco.interfaces; +using Umbraco.Web.UI.Pages; + +namespace Umbraco.Web.LegacyActions +{ + /// + /// This action is invoked when copying a document or media + /// + public class ActionUpdate : IAction + { + //create singleton +#pragma warning disable 612,618 + private static readonly ActionUpdate m_instance = new ActionUpdate(); +#pragma warning restore 612,618 + + /// + /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. + /// All Umbraco assemblies should use the singleton instantiation (this.Instance) + /// When this applicatio is refactored, this constuctor should be made private. + /// + [Obsolete("Use the singleton instantiation instead of a constructor")] + public ActionUpdate() { } + + public static ActionUpdate Instance + { + get { return m_instance; } + } + + #region IAction Members + + public char Letter + { + get + { + return 'A'; + } + } + + public string JsFunctionName + { + get + { + return string.Format("{0}.actionUpdate()", ClientTools.Scripts.GetAppActions); + } + } + + public string JsSource + { + get + { + return null; + } + } + + public string Alias + { + get + { + return "update"; + } + } + + public string Icon + { + get + { + return "save"; + } + } + + public bool ShowInNotifier + { + get + { + return true; + } + } + public bool CanBePermissionAssigned + { + get + { + return true; + } + } + #endregion + } +} diff --git a/src/umbraco.cms/Actions/ContextMenuSeperator.cs b/src/Umbraco.Web/LegacyActions/ContextMenuSeperator.cs similarity index 87% rename from src/umbraco.cms/Actions/ContextMenuSeperator.cs rename to src/Umbraco.Web/LegacyActions/ContextMenuSeperator.cs index ea11f06723..8fa86a7f10 100644 --- a/src/umbraco.cms/Actions/ContextMenuSeperator.cs +++ b/src/Umbraco.Web/LegacyActions/ContextMenuSeperator.cs @@ -1,55 +1,53 @@ -using System; -using umbraco.interfaces; -using umbraco.BasePages; - -namespace umbraco.BusinessLogic.Actions -{ - /// - /// Used simply to define context menu seperator items. - /// This should not be used directly in any code except for creating menus. - /// - public class ContextMenuSeperator : IAction - { - //create singleton - private static readonly ContextMenuSeperator instance = new ContextMenuSeperator(); - private ContextMenuSeperator() { } - public static ContextMenuSeperator Instance - { - get { return instance; } - } - - #region IAction Members - - public char Letter - { - get { return ','; } - } - - public string JsFunctionName - { - get { return string.Empty; } - } - public string JsSource - { - get { return string.Empty; } - } - public string Alias - { - get { return string.Empty; } - } - public string Icon - { - get { return string.Empty; } - } - public bool ShowInNotifier - { - get { return false; } - } - public bool CanBePermissionAssigned - { - get { return false; } - } - - #endregion - } -} +using umbraco.interfaces; + +namespace Umbraco.Web.LegacyActions +{ + /// + /// Used simply to define context menu seperator items. + /// This should not be used directly in any code except for creating menus. + /// + public class ContextMenuSeperator : IAction + { + //create singleton + private static readonly ContextMenuSeperator instance = new ContextMenuSeperator(); + private ContextMenuSeperator() { } + public static ContextMenuSeperator Instance + { + get { return instance; } + } + + #region IAction Members + + public char Letter + { + get { return ','; } + } + + public string JsFunctionName + { + get { return string.Empty; } + } + public string JsSource + { + get { return string.Empty; } + } + public string Alias + { + get { return string.Empty; } + } + public string Icon + { + get { return string.Empty; } + } + public bool ShowInNotifier + { + get { return false; } + } + public bool CanBePermissionAssigned + { + get { return false; } + } + + #endregion + } +} diff --git a/src/umbraco.cms/Actions/LegacyActionMenuItemAttribute.cs b/src/Umbraco.Web/LegacyActions/LegacyActionMenuItemAttribute.cs similarity index 94% rename from src/umbraco.cms/Actions/LegacyActionMenuItemAttribute.cs rename to src/Umbraco.Web/LegacyActions/LegacyActionMenuItemAttribute.cs index aefb8733fd..2f99b17788 100644 --- a/src/umbraco.cms/Actions/LegacyActionMenuItemAttribute.cs +++ b/src/Umbraco.Web/LegacyActions/LegacyActionMenuItemAttribute.cs @@ -1,43 +1,43 @@ -using System; -using Umbraco.Core; - -namespace umbraco.BusinessLogic.Actions -{ - /// - /// The attribute to assign to any IAction objects. - /// - /// - /// This is purely used for compatibility reasons for old IActions used in v7 that haven't been upgraded to - /// the new format. - /// - [AttributeUsage(AttributeTargets.Class)] - internal sealed class LegacyActionMenuItemAttribute : Attribute - { - /// - /// This constructor defines both the angular service and method name to use - /// - /// - /// - public LegacyActionMenuItemAttribute(string serviceName, string methodName) - { - Mandate.ParameterNotNullOrEmpty(serviceName, "serviceName"); - Mandate.ParameterNotNullOrEmpty(methodName, "methodName"); - MethodName = methodName; - ServiceName = serviceName; - } - - /// - /// This constructor will assume that the method name equals the type name of the action menu class - /// - /// - public LegacyActionMenuItemAttribute(string serviceName) - { - Mandate.ParameterNotNullOrEmpty(serviceName, "serviceName"); - MethodName = ""; - ServiceName = serviceName; - } - - public string MethodName { get; private set; } - public string ServiceName { get; private set; } - } +using System; +using Umbraco.Core; + +namespace Umbraco.Web.LegacyActions +{ + /// + /// The attribute to assign to any IAction objects. + /// + /// + /// This is purely used for compatibility reasons for old IActions used in v7 that haven't been upgraded to + /// the new format. + /// + [AttributeUsage(AttributeTargets.Class)] + internal sealed class LegacyActionMenuItemAttribute : Attribute + { + /// + /// This constructor defines both the angular service and method name to use + /// + /// + /// + public LegacyActionMenuItemAttribute(string serviceName, string methodName) + { + Mandate.ParameterNotNullOrEmpty(serviceName, "serviceName"); + Mandate.ParameterNotNullOrEmpty(methodName, "methodName"); + MethodName = methodName; + ServiceName = serviceName; + } + + /// + /// This constructor will assume that the method name equals the type name of the action menu class + /// + /// + public LegacyActionMenuItemAttribute(string serviceName) + { + Mandate.ParameterNotNullOrEmpty(serviceName, "serviceName"); + MethodName = ""; + ServiceName = serviceName; + } + + public string MethodName { get; private set; } + public string ServiceName { get; private set; } + } } \ No newline at end of file diff --git a/src/Umbraco.Web/Models/Mapping/ContentModelMapper.cs b/src/Umbraco.Web/Models/Mapping/ContentModelMapper.cs index 8c3095a455..4bdafb029f 100644 --- a/src/Umbraco.Web/Models/Mapping/ContentModelMapper.cs +++ b/src/Umbraco.Web/Models/Mapping/ContentModelMapper.cs @@ -10,10 +10,10 @@ using Umbraco.Core; using Umbraco.Core.Models; using Umbraco.Core.Models.Mapping; using Umbraco.Core.Services; +using Umbraco.Web.LegacyActions; using Umbraco.Web.Models.ContentEditing; using Umbraco.Web.Trees; using Umbraco.Web.Routing; -using umbraco.BusinessLogic.Actions; namespace Umbraco.Web.Models.Mapping { diff --git a/src/Umbraco.Web/Models/Trees/MenuItemList.cs b/src/Umbraco.Web/Models/Trees/MenuItemList.cs index 1f62e59e61..16baf2d5c2 100644 --- a/src/Umbraco.Web/Models/Trees/MenuItemList.cs +++ b/src/Umbraco.Web/Models/Trees/MenuItemList.cs @@ -1,8 +1,8 @@ using System; using System.Collections.Generic; using Umbraco.Core; -using umbraco.BusinessLogic.Actions; using umbraco.interfaces; +using Umbraco.Web.LegacyActions; namespace Umbraco.Web.Models.Trees { diff --git a/src/Umbraco.Web/Mvc/UmbracoAuthorizeAttribute.cs b/src/Umbraco.Web/Mvc/UmbracoAuthorizeAttribute.cs index c5ebf24626..faf5d875f7 100644 --- a/src/Umbraco.Web/Mvc/UmbracoAuthorizeAttribute.cs +++ b/src/Umbraco.Web/Mvc/UmbracoAuthorizeAttribute.cs @@ -2,8 +2,6 @@ using System.Web; using System.Web.Mvc; using Umbraco.Core; -using Umbraco.Web.Security; -using umbraco.BasePages; namespace Umbraco.Web.Mvc { diff --git a/src/Umbraco.Web/NotificationServiceExtensions.cs b/src/Umbraco.Web/NotificationServiceExtensions.cs index 7beff605f9..8817d37853 100644 --- a/src/Umbraco.Web/NotificationServiceExtensions.cs +++ b/src/Umbraco.Web/NotificationServiceExtensions.cs @@ -7,7 +7,6 @@ using Umbraco.Core.Models.EntityBase; using Umbraco.Core.Models.Membership; using Umbraco.Core.Services; using umbraco; -using umbraco.BusinessLogic.Actions; using umbraco.interfaces; namespace Umbraco.Web diff --git a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedContentCache.cs b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedContentCache.cs index c0304d5de6..f7c9a70500 100644 --- a/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedContentCache.cs +++ b/src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedContentCache.cs @@ -16,7 +16,6 @@ using umbraco; using System.Linq; using umbraco.BusinessLogic; using umbraco.presentation.preview; -using GlobalSettings = umbraco.GlobalSettings; namespace Umbraco.Web.PublishedCache.XmlPublishedCache { @@ -179,7 +178,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache } // no domain, respect HideTopLevelNodeFromPath for legacy purposes - if (hasDomains == false && global::umbraco.GlobalSettings.HideTopLevelNodeFromPath) + if (hasDomains == false && GlobalSettings.HideTopLevelNodeFromPath) ApplyHideTopLevelNodeFromPath(umbracoContext, node, pathParts); // assemble the route diff --git a/src/Umbraco.Web/Strategies/NotificationsHandler.cs b/src/Umbraco.Web/Strategies/NotificationsHandler.cs index 3eb750c1fd..034d27139c 100644 --- a/src/Umbraco.Web/Strategies/NotificationsHandler.cs +++ b/src/Umbraco.Web/Strategies/NotificationsHandler.cs @@ -8,7 +8,7 @@ using Umbraco.Core.Configuration; using Umbraco.Core.Models.EntityBase; using Umbraco.Core.Services; using umbraco; -using umbraco.BusinessLogic.Actions; +using Umbraco.Web.LegacyActions; namespace Umbraco.Web.Strategies { diff --git a/src/Umbraco.Web/Trees/ContentTreeController.cs b/src/Umbraco.Web/Trees/ContentTreeController.cs index 4186597034..74c30f48e0 100644 --- a/src/Umbraco.Web/Trees/ContentTreeController.cs +++ b/src/Umbraco.Web/Trees/ContentTreeController.cs @@ -14,10 +14,10 @@ using Umbraco.Web.Models.Trees; using Umbraco.Web.Mvc; using Umbraco.Web.WebApi.Filters; using umbraco; -using umbraco.BusinessLogic.Actions; using umbraco.businesslogic; using umbraco.cms.businesslogic.web; using umbraco.interfaces; +using Umbraco.Web.LegacyActions; using Constants = Umbraco.Core.Constants; namespace Umbraco.Web.Trees @@ -131,7 +131,7 @@ namespace Umbraco.Web.Trees // we need to get the default permissions as you can't set permissions on the very root node //TODO: Use the new services to get permissions - var nodeActions = global::umbraco.BusinessLogic.Actions.Action.FromString( + var nodeActions = global::Umbraco.Web.LegacyActions.Action.FromString( UmbracoUser.GetPermissions(Constants.System.Root.ToInvariantString())) .Select(x => new MenuItem(x)); diff --git a/src/Umbraco.Web/Trees/ContentTreeControllerBase.cs b/src/Umbraco.Web/Trees/ContentTreeControllerBase.cs index 3708c6fd4f..1481e04fe5 100644 --- a/src/Umbraco.Web/Trees/ContentTreeControllerBase.cs +++ b/src/Umbraco.Web/Trees/ContentTreeControllerBase.cs @@ -13,8 +13,8 @@ using Umbraco.Core.Persistence; using Umbraco.Web.Models.Trees; using Umbraco.Web.WebApi.Filters; using umbraco; -using umbraco.BusinessLogic.Actions; using System.Globalization; +using Umbraco.Web.LegacyActions; namespace Umbraco.Web.Trees { @@ -266,7 +266,7 @@ namespace Umbraco.Web.Trees internal IEnumerable GetAllowedUserMenuItemsForNode(IUmbracoEntity dd) { - var actions = global::umbraco.BusinessLogic.Actions.Action.FromString(UmbracoUser.GetPermissions(dd.Path)); + var actions = global::Umbraco.Web.LegacyActions.Action.FromString(UmbracoUser.GetPermissions(dd.Path)); // A user is allowed to delete their own stuff if (dd.CreatorId == UmbracoUser.Id && actions.Contains(ActionDelete.Instance) == false) diff --git a/src/Umbraco.Web/Trees/ContentTypeTreeController.cs b/src/Umbraco.Web/Trees/ContentTypeTreeController.cs index b1fb00bb3d..7a0f0466ec 100644 --- a/src/Umbraco.Web/Trees/ContentTypeTreeController.cs +++ b/src/Umbraco.Web/Trees/ContentTypeTreeController.cs @@ -5,13 +5,13 @@ using System.Net.Http.Formatting; using System.Text; using System.Threading.Tasks; using umbraco; -using umbraco.BusinessLogic.Actions; using Umbraco.Core; using Umbraco.Core.Models; using Umbraco.Core.Models.EntityBase; using Umbraco.Web.Models.Trees; using Umbraco.Web.WebApi.Filters; using Umbraco.Core.Services; +using Umbraco.Web.LegacyActions; namespace Umbraco.Web.Trees { diff --git a/src/Umbraco.Web/Trees/DataTypeTreeController.cs b/src/Umbraco.Web/Trees/DataTypeTreeController.cs index 67da0cf355..29502c76c5 100644 --- a/src/Umbraco.Web/Trees/DataTypeTreeController.cs +++ b/src/Umbraco.Web/Trees/DataTypeTreeController.cs @@ -11,9 +11,9 @@ using Umbraco.Web.Models.Trees; using Umbraco.Web.Mvc; using Umbraco.Web.WebApi.Filters; using umbraco; -using umbraco.BusinessLogic.Actions; using Umbraco.Core.Models.EntityBase; using Umbraco.Core.Services; +using Umbraco.Web.LegacyActions; using Constants = Umbraco.Core.Constants; namespace Umbraco.Web.Trees diff --git a/src/Umbraco.Web/Trees/LanguageTreeController.cs b/src/Umbraco.Web/Trees/LanguageTreeController.cs index 5481b7d40c..9cbd94ead4 100644 --- a/src/Umbraco.Web/Trees/LanguageTreeController.cs +++ b/src/Umbraco.Web/Trees/LanguageTreeController.cs @@ -4,10 +4,10 @@ using System.Globalization; using System.Net.Http.Formatting; using System.Web.Services.Description; using umbraco; -using umbraco.BusinessLogic.Actions; using Umbraco.Core; using Umbraco.Core.Models; using umbraco.presentation.actions; +using Umbraco.Web.LegacyActions; using Umbraco.Web.Models.Trees; using Umbraco.Web.Mvc; using Umbraco.Web.WebApi.Filters; diff --git a/src/Umbraco.Web/Trees/LegacyTreeDataConverter.cs b/src/Umbraco.Web/Trees/LegacyTreeDataConverter.cs index e0e9173d4a..2ce5a36eab 100644 --- a/src/Umbraco.Web/Trees/LegacyTreeDataConverter.cs +++ b/src/Umbraco.Web/Trees/LegacyTreeDataConverter.cs @@ -12,10 +12,10 @@ using Umbraco.Core.Services; using Umbraco.Web.Models.Trees; using umbraco; using umbraco.BusinessLogic; -using umbraco.BusinessLogic.Actions; using umbraco.cms.presentation.Trees; using umbraco.controls.Tree; using umbraco.interfaces; +using Umbraco.Web.LegacyActions; namespace Umbraco.Web.Trees { diff --git a/src/Umbraco.Web/Trees/LegacyTreeJavascript.cs b/src/Umbraco.Web/Trees/LegacyTreeJavascript.cs index ec9951afdb..26aeb12403 100644 --- a/src/Umbraco.Web/Trees/LegacyTreeJavascript.cs +++ b/src/Umbraco.Web/Trees/LegacyTreeJavascript.cs @@ -54,10 +54,10 @@ namespace Umbraco.Web.Trees if (string.IsNullOrEmpty(a.Alias) == false && (string.IsNullOrEmpty(a.JsFunctionName) == false || string.IsNullOrEmpty(a.JsSource) == false)) { // if the action is using invalid javascript we need to do something about this - if (global::umbraco.BusinessLogic.Actions.Action.ValidateActionJs(a) == false) + if (global::Umbraco.Web.LegacyActions.Action.ValidateActionJs(a) == false) { js.AppendLine("function IActionProxy_" + a.Alias.ToSafeAlias() + "() {"); - js.AppendLine(global::umbraco.BusinessLogic.Actions.Action.ConvertLegacyJs(a.JsFunctionName)); + js.AppendLine(global::Umbraco.Web.LegacyActions.Action.ConvertLegacyJs(a.JsFunctionName)); js.AppendLine("}"); } } diff --git a/src/Umbraco.Web/Trees/MediaTreeController.cs b/src/Umbraco.Web/Trees/MediaTreeController.cs index e945b932a3..3727adb544 100644 --- a/src/Umbraco.Web/Trees/MediaTreeController.cs +++ b/src/Umbraco.Web/Trees/MediaTreeController.cs @@ -12,7 +12,7 @@ using Umbraco.Web.Models.Trees; using Umbraco.Web.Mvc; using Umbraco.Web.WebApi.Filters; using umbraco; -using umbraco.BusinessLogic.Actions; +using Umbraco.Web.LegacyActions; using Constants = Umbraco.Core.Constants; namespace Umbraco.Web.Trees diff --git a/src/Umbraco.Web/Trees/MediaTypeTreeController.cs b/src/Umbraco.Web/Trees/MediaTypeTreeController.cs index 98208f8530..0a29676d94 100644 --- a/src/Umbraco.Web/Trees/MediaTypeTreeController.cs +++ b/src/Umbraco.Web/Trees/MediaTypeTreeController.cs @@ -5,13 +5,13 @@ using System.Net.Http.Formatting; using System.Text; using System.Threading.Tasks; using umbraco; -using umbraco.BusinessLogic.Actions; using Umbraco.Core; using Umbraco.Core.Models; using Umbraco.Core.Models.EntityBase; using Umbraco.Web.Models.Trees; using Umbraco.Web.WebApi.Filters; using Umbraco.Core.Services; +using Umbraco.Web.LegacyActions; namespace Umbraco.Web.Trees { diff --git a/src/Umbraco.Web/Trees/MemberTreeController.cs b/src/Umbraco.Web/Trees/MemberTreeController.cs index f04e72becc..0a8d745a45 100644 --- a/src/Umbraco.Web/Trees/MemberTreeController.cs +++ b/src/Umbraco.Web/Trees/MemberTreeController.cs @@ -15,7 +15,7 @@ using Umbraco.Web.Models.Trees; using Umbraco.Web.Mvc; using Umbraco.Web.WebApi.Filters; using umbraco; -using umbraco.BusinessLogic.Actions; +using Umbraco.Web.LegacyActions; using Constants = Umbraco.Core.Constants; namespace Umbraco.Web.Trees diff --git a/src/Umbraco.Web/Trees/MemberTypeTreeController.cs b/src/Umbraco.Web/Trees/MemberTypeTreeController.cs index 060d43f237..788b3dfbcb 100644 --- a/src/Umbraco.Web/Trees/MemberTypeTreeController.cs +++ b/src/Umbraco.Web/Trees/MemberTypeTreeController.cs @@ -5,8 +5,8 @@ using System.Net.Http.Formatting; using System.Text; using System.Threading.Tasks; using umbraco; -using umbraco.BusinessLogic.Actions; using Umbraco.Core; +using Umbraco.Web.LegacyActions; using Umbraco.Web.Models.Trees; using Umbraco.Web.WebApi.Filters; diff --git a/src/Umbraco.Web/Trees/PartialViewsTree.cs b/src/Umbraco.Web/Trees/PartialViewsTree.cs index ac937864ab..501aaf01ee 100644 --- a/src/Umbraco.Web/Trees/PartialViewsTree.cs +++ b/src/Umbraco.Web/Trees/PartialViewsTree.cs @@ -7,11 +7,11 @@ using System.Web; using Umbraco.Core; using Umbraco.Core.Configuration; using Umbraco.Core.IO; -using umbraco.BusinessLogic.Actions; using umbraco.businesslogic; using umbraco.cms.businesslogic.template; using umbraco.cms.presentation.Trees; using umbraco.interfaces; +using Umbraco.Web.LegacyActions; namespace Umbraco.Web.Trees { diff --git a/src/Umbraco.Web/Trees/TemplatesTreeController.cs b/src/Umbraco.Web/Trees/TemplatesTreeController.cs index 61cff8f862..dbd5eeab0d 100644 --- a/src/Umbraco.Web/Trees/TemplatesTreeController.cs +++ b/src/Umbraco.Web/Trees/TemplatesTreeController.cs @@ -7,11 +7,11 @@ using System.Linq; using System.Net.Http.Formatting; using System.Web.Services.Description; using umbraco; -using umbraco.BusinessLogic.Actions; using umbraco.cms.businesslogic.template; using Umbraco.Core; using Umbraco.Core.Configuration; using Umbraco.Core.Models; +using Umbraco.Web.LegacyActions; using Umbraco.Web.Models.Trees; using Umbraco.Web.Mvc; using Umbraco.Web.WebApi.Filters; diff --git a/src/Umbraco.Web/UI/Controls/UmbracoUserControl.cs b/src/Umbraco.Web/UI/Controls/UmbracoUserControl.cs index b60c519dd4..e82e9392d5 100644 --- a/src/Umbraco.Web/UI/Controls/UmbracoUserControl.cs +++ b/src/Umbraco.Web/UI/Controls/UmbracoUserControl.cs @@ -8,6 +8,7 @@ using Umbraco.Core.Logging; using Umbraco.Core.Services; using Umbraco.Web.Security; using umbraco.DataLayer; +using Umbraco.Web.UI.Pages; namespace Umbraco.Web.UI.Controls { @@ -37,6 +38,19 @@ namespace Umbraco.Web.UI.Controls { } + private ClientTools _clientTools; + /// + /// Returns a refernce of an instance of ClientTools for access to the pages client API + /// + public ClientTools ClientTools + { + get + { + var page = Page as BasePage; + return _clientTools ?? (_clientTools = (page != null) ? page.ClientTools : new ClientTools(Page)); + } + } + private readonly MembershipHelper _membershipHelper; /// diff --git a/src/Umbraco.Web/UI/LegacyDialogHandler.cs b/src/Umbraco.Web/UI/LegacyDialogHandler.cs index dfa7fbc153..29465aa95e 100644 --- a/src/Umbraco.Web/UI/LegacyDialogHandler.cs +++ b/src/Umbraco.Web/UI/LegacyDialogHandler.cs @@ -1,16 +1,12 @@ using System; using System.Collections.Generic; -using System.Linq; using System.Reflection; -using System.Text; using System.Web; using System.Xml; using Umbraco.Core; using Umbraco.Core.IO; -using umbraco.BasePages; using umbraco.BusinessLogic; using umbraco.interfaces; -using System.Linq; namespace Umbraco.Web.UI { diff --git a/src/Umbraco.Web/UI/Pages/ClientTools.cs b/src/Umbraco.Web/UI/Pages/ClientTools.cs index fe7205451f..215b4aeeb4 100644 --- a/src/Umbraco.Web/UI/Pages/ClientTools.cs +++ b/src/Umbraco.Web/UI/Pages/ClientTools.cs @@ -1,11 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Web; -using Umbraco.Core.IO; -using umbraco.BasePages; +using Umbraco.Core.IO; using System.Web.UI; -using umbraco.BusinessLogic; namespace Umbraco.Web.UI.Pages { @@ -229,17 +223,22 @@ namespace Umbraco.Web.UI.Pages return this; } - /// - /// Reloads only the last node that the user interacted with via the context menu. To reload a specify node, use SyncTree. - /// - /// - /// - /// - /// If for whatever reason the client side system cannot just refresh the one node, the system will use jsTree's built in - /// refresh tool, this however won't allow for reselect or reloadChildren. Most trees will work with the single node - /// refresh but 3rd party tools may have poorly built tree data models. - /// - public ClientTools ReloadActionNode(bool reselect, bool reloadChildren) + public string ReloadContentFrameUrlIfPathLoaded(string url) + { + return string.Format(ClientTools.Scripts.ClientMgrScript + ".reloadContentFrameUrlIfPathLoaded('{0}');", url); + } + + /// + /// Reloads only the last node that the user interacted with via the context menu. To reload a specify node, use SyncTree. + /// + /// + /// + /// + /// If for whatever reason the client side system cannot just refresh the one node, the system will use jsTree's built in + /// refresh tool, this however won't allow for reselect or reloadChildren. Most trees will work with the single node + /// refresh but 3rd party tools may have poorly built tree data models. + /// + public ClientTools ReloadActionNode(bool reselect, bool reloadChildren) { RegisterClientScript(string.Format(Scripts.ReloadActionNode, (!reselect).ToString().ToLower(), (!reloadChildren).ToString().ToLower())); return this; diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index a6dd129cd4..e740e62df8 100644 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -314,6 +314,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -857,9 +891,6 @@ ASPXCodeBehind - - ASPXCodeBehind - ASPXCodeBehind @@ -1031,9 +1062,6 @@ ASPXCodeBehind - - ASPXCodeBehind - @@ -1087,9 +1115,6 @@ - - ASPXCodeBehind - @@ -1119,7 +1144,6 @@ Code - Code @@ -1429,13 +1453,6 @@ viewAuditTrail.aspx - - language.aspx - ASPXCodeBehind - - - language.aspx - EditMemberGroup.aspx ASPXCodeBehind @@ -1535,9 +1552,6 @@ xml.aspx - - ASPXCodeBehind - @@ -1795,9 +1809,6 @@ - - ASPXCodeBehind - Form @@ -1853,10 +1864,6 @@ ResXFileCodeGenerator Strings.Designer.cs - - language.aspx.cs - Designer - ResXFileCodeGenerator Resources.Designer.cs diff --git a/src/Umbraco.Web/UmbracoContext.cs b/src/Umbraco.Web/UmbracoContext.cs index 3c2b7267a6..6804673484 100644 --- a/src/Umbraco.Web/UmbracoContext.cs +++ b/src/Umbraco.Web/UmbracoContext.cs @@ -10,7 +10,6 @@ using Umbraco.Web.Routing; using Umbraco.Web.Security; using umbraco.BusinessLogic; using umbraco.presentation.preview; -using GlobalSettings = umbraco.GlobalSettings; using IOHelper = Umbraco.Core.IO.IOHelper; using SystemDirectories = Umbraco.Core.IO.SystemDirectories; diff --git a/src/Umbraco.Web/UmbracoUserControl.cs b/src/Umbraco.Web/UmbracoUserControl.cs deleted file mode 100644 index 7b698139f4..0000000000 --- a/src/Umbraco.Web/UmbracoUserControl.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using System.Web; -using System.Web.Mvc; -using System.Web.Routing; -using System.Web.UI; -using Umbraco.Core; -using Umbraco.Core.Services; - -namespace Umbraco.Web -{ - /// - /// A base class for all Presentation UserControls to inherit from - /// - [Obsolete("Use the Umbraco.Web.UI.Controls.UmbracoUserControl instead")] - public abstract class UmbracoUserControl : Umbraco.Web.UI.Controls.UmbracoUserControl - { - /// - /// Default constructor - /// - /// - protected UmbracoUserControl(UmbracoContext umbracoContext) - : base(umbracoContext) - { - - } - - /// - /// Empty constructor, uses Singleton to resolve the UmbracoContext - /// - protected UmbracoUserControl() - : base() - { - } - - } -} \ No newline at end of file diff --git a/src/Umbraco.Web/UriUtility.cs b/src/Umbraco.Web/UriUtility.cs index 8a1c55e758..a562fe1bf5 100644 --- a/src/Umbraco.Web/UriUtility.cs +++ b/src/Umbraco.Web/UriUtility.cs @@ -3,7 +3,6 @@ using System.Text; using System.Web; using Umbraco.Core; using Umbraco.Core.Configuration; -using GlobalSettings = umbraco.GlobalSettings; namespace Umbraco.Web { diff --git a/src/Umbraco.Web/WebApi/Filters/EnsureUserPermissionForContentAttribute.cs b/src/Umbraco.Web/WebApi/Filters/EnsureUserPermissionForContentAttribute.cs index 2e3eea490e..66b96100c4 100644 --- a/src/Umbraco.Web/WebApi/Filters/EnsureUserPermissionForContentAttribute.cs +++ b/src/Umbraco.Web/WebApi/Filters/EnsureUserPermissionForContentAttribute.cs @@ -11,8 +11,8 @@ using Umbraco.Core.Models; using Umbraco.Core.Models.Membership; using Umbraco.Core.Services; using Umbraco.Web.Editors; +using Umbraco.Web.LegacyActions; using Umbraco.Web.Models.ContentEditing; -using umbraco.BusinessLogic.Actions; namespace Umbraco.Web.WebApi.Filters { diff --git a/src/Umbraco.Web/WebApi/Filters/EnsureUserPermissionForMediaAttribute.cs b/src/Umbraco.Web/WebApi/Filters/EnsureUserPermissionForMediaAttribute.cs index cb0f07f796..869fcb0af8 100644 --- a/src/Umbraco.Web/WebApi/Filters/EnsureUserPermissionForMediaAttribute.cs +++ b/src/Umbraco.Web/WebApi/Filters/EnsureUserPermissionForMediaAttribute.cs @@ -8,7 +8,6 @@ using Umbraco.Core.Models; using Umbraco.Core.Models.Membership; using Umbraco.Core.Services; using Umbraco.Web.Editors; -using umbraco.BusinessLogic.Actions; namespace Umbraco.Web.WebApi.Filters { diff --git a/src/Umbraco.Web/WebApi/Filters/FilterAllowedOutgoingContentAttribute.cs b/src/Umbraco.Web/WebApi/Filters/FilterAllowedOutgoingContentAttribute.cs index 3feb3b682a..cbddbb828b 100644 --- a/src/Umbraco.Web/WebApi/Filters/FilterAllowedOutgoingContentAttribute.cs +++ b/src/Umbraco.Web/WebApi/Filters/FilterAllowedOutgoingContentAttribute.cs @@ -6,8 +6,8 @@ using System.Linq; using System.Reflection; using Umbraco.Core.Models.Membership; using Umbraco.Core.Services; -using umbraco.BusinessLogic.Actions; using Umbraco.Core; +using Umbraco.Web.LegacyActions; namespace Umbraco.Web.WebApi.Filters { diff --git a/src/Umbraco.Web/WebServices/DomainsApiController.cs b/src/Umbraco.Web/WebServices/DomainsApiController.cs index 3ea24135a7..d3493aba9b 100644 --- a/src/Umbraco.Web/WebServices/DomainsApiController.cs +++ b/src/Umbraco.Web/WebServices/DomainsApiController.cs @@ -11,8 +11,8 @@ using Umbraco.Core.Models; using Umbraco.Web.Routing; using Umbraco.Web.WebApi; //using umbraco.cms.businesslogic.language; -using umbraco.BusinessLogic.Actions; using umbraco.cms.businesslogic.web; +using Umbraco.Web.LegacyActions; using Umbraco.Web.WebApi.Filters; namespace Umbraco.Web.WebServices diff --git a/src/Umbraco.Web/umbraco.presentation/BasePageExtensions.cs b/src/Umbraco.Web/umbraco.presentation/BasePageExtensions.cs deleted file mode 100644 index ff91659f33..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/BasePageExtensions.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using umbraco.BasePages; -using umbraco.uicontrols; -using System.Web.UI; -using System.Web.UI.WebControls; -using System.Web.UI.HtmlControls; -using ClientDependency.Core; - -namespace umbraco.presentation -{ - /// - /// Extension methods for the Umbraco BasePage - /// - public static class BasePageExtensions - { - - /// - /// Used to display an error message to the user and disable further execution. - /// This will remove all controls from being rendered and show a feedback control with an error - /// - /// - public static void DisplayFatalError(this BasePage page, string msg) - { - foreach (var ctl in page.Controls.Cast()) - { - if (!HideControls(ctl)) - { - var ctls = ctl.FlattenChildren(); - foreach (var c in ctls) - { - HideControls(c); - } - } - } - var feedback = new Feedback(); - feedback.type = Feedback.feedbacktype.error; - feedback.Text = string.Format("{0}

{1}", ui.GetText("error"), msg); - page.Controls.Add(feedback); - } - - private static bool HideControls(this Control c) - { - if (c is MasterPage) - { - return false; - } - else if (c is UserControl || c is WebControl || c is HtmlForm) - { - c.Visible = false; - return true; - } - return false; - - } - - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/helper.cs b/src/Umbraco.Web/umbraco.presentation/helper.cs index 1d02f0ddcc..d44b9e3dcf 100644 --- a/src/Umbraco.Web/umbraco.presentation/helper.cs +++ b/src/Umbraco.Web/umbraco.presentation/helper.cs @@ -10,6 +10,7 @@ using Umbraco.Core.Profiling; using umbraco.BusinessLogic; using System.Xml; using umbraco.presentation; +using Umbraco.Web.UI.Pages; namespace umbraco { @@ -23,12 +24,7 @@ namespace umbraco { int result; return int.TryParse(Number, out result); - } - - public static User GetCurrentUmbracoUser() - { - return umbraco.BasePages.UmbracoEnsuredPage.CurrentUser; - } + } public static String FindAttribute(IDictionary attributes, String key) { diff --git a/src/Umbraco.Web/umbraco.presentation/macro.cs b/src/Umbraco.Web/umbraco.presentation/macro.cs index c24455fa33..b1c002fe50 100644 --- a/src/Umbraco.Web/umbraco.presentation/macro.cs +++ b/src/Umbraco.Web/umbraco.presentation/macro.cs @@ -68,7 +68,7 @@ namespace umbraco static macro() { - _xsltSettings = GlobalSettings.ApplicationTrustLevel > AspNetHostingPermissionLevel.Medium + _xsltSettings = SystemUtilities.GetCurrentTrustLevel() > AspNetHostingPermissionLevel.Medium ? XsltSettings.TrustedXslt : XsltSettings.Default; } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/BaseTree.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/BaseTree.cs index 1f8eeafeeb..93bc1733bc 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/BaseTree.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/BaseTree.cs @@ -9,10 +9,10 @@ using Umbraco.Core.Models.EntityBase; using Umbraco.Core.Services; using Umbraco.Web.Trees; using umbraco.BusinessLogic; -using umbraco.BusinessLogic.Actions; using umbraco.cms.businesslogic.media; using umbraco.cms.businesslogic.web; using umbraco.interfaces; +using Umbraco.Web.LegacyActions; namespace umbraco.cms.presentation.Trees { diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/NullTree.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/NullTree.cs index 0186d8f0f8..8006cc4938 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/NullTree.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/NullTree.cs @@ -9,7 +9,7 @@ using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Collections.Generic; using umbraco.interfaces; -using umbraco.BusinessLogic.Actions; +using Umbraco.Web.LegacyActions; namespace umbraco.cms.presentation.Trees { diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/TreeDefinitionCollection.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/TreeDefinitionCollection.cs index 6f52b480a3..0c83b15767 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/TreeDefinitionCollection.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/TreeDefinitionCollection.cs @@ -1,21 +1,8 @@ -using System; -using System.Data; -using System.Configuration; -using System.Threading; -using System.Web; -using System.Web.Security; -using System.Web.UI; -using System.Web.UI.WebControls; -using System.Web.UI.WebControls.WebParts; -using System.Web.UI.HtmlControls; using System.Collections.Generic; using Umbraco.Core; -using Umbraco.Core.Logging; using Umbraco.Web; using umbraco.interfaces; -using umbraco.BusinessLogic.Utils; using umbraco.BusinessLogic; -using umbraco.BasePages; namespace umbraco.cms.presentation.Trees { diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/UserPermissions.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/UserPermissions.cs index 6a30bb64ec..babaa58a39 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/UserPermissions.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/UserPermissions.cs @@ -12,8 +12,8 @@ using umbraco.interfaces; using System.Xml; using System.Collections.Generic; using System.Text; -using umbraco.BusinessLogic.Actions; using Umbraco.Core; +using Umbraco.Web.LegacyActions; using Umbraco.Web.Trees; namespace umbraco.cms.presentation.Trees diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/XmlTree.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/XmlTree.cs index a224f1f048..8479e22ef7 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/XmlTree.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/XmlTree.cs @@ -6,10 +6,10 @@ using System.Xml.Schema; using umbraco.interfaces; using System.Collections.Generic; using System.Web.Script.Serialization; -using System.Text; using umbraco.businesslogic.Utils; -using umbraco.BasePages; using Umbraco.Core.IO; +using Umbraco.Web.UI.Pages; +using Action = Umbraco.Web.LegacyActions.Action; namespace umbraco.cms.presentation.Trees { @@ -475,7 +475,7 @@ namespace umbraco.cms.presentation.Trees this.m_action = reader.Value; break; case TreeAttributes.menu: - this.m_menu = (!string.IsNullOrEmpty(reader.Value) ? umbraco.BusinessLogic.Actions.Action.FromString(reader.Value) : null); + this.m_menu = (!string.IsNullOrEmpty(reader.Value) ? Umbraco.Web.LegacyActions.Action.FromString(reader.Value) : null); break; case TreeAttributes.rootSrc: this.m_rootSrc = reader.Value; @@ -520,7 +520,7 @@ namespace umbraco.cms.presentation.Trees writer.WriteAttributeString(TreeAttributes.text.ToString(), this.m_text); writer.WriteAttributeString(TreeAttributes.iconClass.ToString(), this.m_iconClass); writer.WriteAttributeString(TreeAttributes.action.ToString(), this.m_action); - writer.WriteAttributeString(TreeAttributes.menu.ToString(), (this.m_menu != null && this.m_menu.Count > 0 ? umbraco.BusinessLogic.Actions.Action.ToString(this.m_menu) : "")); + writer.WriteAttributeString(TreeAttributes.menu.ToString(), (this.m_menu != null && this.m_menu.Count > 0 ? Umbraco.Web.LegacyActions.Action.ToString(this.m_menu) : "")); writer.WriteAttributeString(TreeAttributes.rootSrc.ToString(), this.m_rootSrc); writer.WriteAttributeString(TreeAttributes.src.ToString(), this.m_src); writer.WriteAttributeString(TreeAttributes.icon.ToString(), this.m_icon); @@ -638,7 +638,7 @@ namespace umbraco.cms.presentation.Trees result.Add(XmlTreeNode.TreeAttributes.nodeID.ToString(), node.NodeID); //Add the menu as letters. - result.Add(XmlTreeNode.TreeAttributes.menu.ToString(), node.Menu != null && node.Menu.Count > 0 ? umbraco.BusinessLogic.Actions.Action.ToString(node.Menu) : ""); + result.Add(XmlTreeNode.TreeAttributes.menu.ToString(), node.Menu != null && node.Menu.Count > 0 ? Action.ToString(node.Menu) : ""); return result; } @@ -717,7 +717,7 @@ namespace umbraco.cms.presentation.Trees //This also needs to be stored in the attributes object with the class above. Dictionary metadata = new Dictionary(); //the menu: - metadata.Add("menu", node.Menu == null ? "" : umbraco.BusinessLogic.Actions.Action.ToString(node.Menu)); + metadata.Add("menu", node.Menu == null ? "" : Action.ToString(node.Menu)); //the tree type: metadata.Add("nodeType", node.NodeType); //the data url for child nodes: diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadDictionary.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadDictionary.cs index 3700ed216c..4b594a76fe 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadDictionary.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadDictionary.cs @@ -6,8 +6,8 @@ using umbraco.businesslogic; using umbraco.cms.businesslogic; using umbraco.interfaces; using umbraco.cms.presentation.Trees; -using umbraco.BusinessLogic.Actions; using Umbraco.Core; +using Umbraco.Web.LegacyActions; using Umbraco.Web.Trees; diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackager.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackager.cs index ae888c2f4c..deb5e439d4 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackager.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackager.cs @@ -5,6 +5,7 @@ using umbraco.businesslogic; using umbraco.interfaces; using Umbraco.Core; using umbraco.cms.presentation.Trees; +using Umbraco.Web.LegacyActions; using Umbraco.Web.Trees; namespace umbraco @@ -46,7 +47,7 @@ namespace umbraco protected override void CreateAllowedActions(ref List actions) { actions.Clear(); - actions.Add(umbraco.BusinessLogic.Actions.ActionRefresh.Instance); + actions.Add(ActionRefresh.Instance); } protected override void CreateRootNodeActions(ref List actions) @@ -144,8 +145,8 @@ namespace umbraco xNode.Source = "tree.aspx?app=" + this._app + "&id=" + this._id + "&treeType=packagerPackages&packageType=created" + "&rnd=" + Guid.NewGuid(); xNode.NodeType = "createdPackages"; xNode.Menu.Clear(); - xNode.Menu.Add(umbraco.BusinessLogic.Actions.ActionNew.Instance); - xNode.Menu.Add(umbraco.BusinessLogic.Actions.ActionRefresh.Instance); + xNode.Menu.Add(ActionNew.Instance); + xNode.Menu.Add(ActionRefresh.Instance); xNode.Text = ui.Text("treeHeaders", "createdPackages"); xNode.HasChildren = true; xNode.Action = "javascript:void(0);"; diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackages.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackages.cs index e9e1fc6f47..b50d1a3a7a 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackages.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackages.cs @@ -9,6 +9,7 @@ using umbraco.cms.businesslogic.packager; using umbraco.cms.presentation.Trees; using Umbraco.Core; using umbraco.interfaces; +using Umbraco.Web.LegacyActions; using Umbraco.Web.Trees; namespace umbraco @@ -87,7 +88,7 @@ namespace umbraco xNode.Icon = "icon-box"; xNode.OpenIcon = "icon-box"; xNode.NodeType = "createdPackageInstance"; - xNode.Menu.Add(umbraco.BusinessLogic.Actions.ActionDelete.Instance); + xNode.Menu.Add(ActionDelete.Instance); tree.Add(xNode); } break; @@ -103,7 +104,7 @@ namespace umbraco xNode.Icon = "icon-server-alt"; xNode.OpenIcon = "icon-server-alt"; xNode.NodeType = "packagesRepo" + repo.Guid; - xNode.Menu.Add( umbraco.BusinessLogic.Actions.ActionRefresh.Instance ); + xNode.Menu.Add( ActionRefresh.Instance ); xNode.Source = "tree.aspx?app=" + this._app + "&id=" + this._id + "&treeType=packagerPackages&packageType=repository&repoGuid=" + repo.Guid + "&rnd=" + Guid.NewGuid(); tree.Add(xNode); diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadRelationTypes.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadRelationTypes.cs index 92d79a3ab1..94d49730da 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadRelationTypes.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadRelationTypes.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Web; -using umbraco.BusinessLogic.Actions; using umbraco.cms.businesslogic.relation; using umbraco.cms.presentation.Trees; using umbraco.DataLayer; @@ -11,6 +10,7 @@ using umbraco.interfaces; using umbraco.cms.presentation.developer.RelationTypes.TreeMenu; using umbraco.businesslogic; using Umbraco.Core; +using Umbraco.Web.LegacyActions; using Umbraco.Web.Trees; namespace umbraco diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadScripts.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadScripts.cs index 07caa5dbbd..1e3f587c8e 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadScripts.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadScripts.cs @@ -5,8 +5,8 @@ using umbraco.businesslogic; using Umbraco.Core.Configuration; using umbraco.interfaces; using umbraco.cms.presentation.Trees; -using umbraco.BusinessLogic.Actions; using Umbraco.Core.IO; +using Umbraco.Web.LegacyActions; using Umbraco.Web.Trees; diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadStylesheets.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadStylesheets.cs index 7bec056e36..1bca231428 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadStylesheets.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadStylesheets.cs @@ -8,8 +8,8 @@ using umbraco.businesslogic; using umbraco.cms.businesslogic.web; using umbraco.interfaces; using umbraco.cms.presentation.Trees; -using umbraco.BusinessLogic.Actions; using Umbraco.Core; +using Umbraco.Web.LegacyActions; using Umbraco.Web.Trees; diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadTemplates.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadTemplates.cs index 560776181f..6e0bc0d485 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadTemplates.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadTemplates.cs @@ -11,7 +11,7 @@ using Umbraco.Core.Services; using umbraco.interfaces; using umbraco.cms.businesslogic.template; using umbraco.cms.presentation.Trees; -using umbraco.BusinessLogic.Actions; +using Umbraco.Web.LegacyActions; namespace umbraco diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadTranslationTasks.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadTranslationTasks.cs index 6a939ebdca..8f55ce419b 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadTranslationTasks.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadTranslationTasks.cs @@ -5,8 +5,8 @@ using umbraco.BusinessLogic; using umbraco.cms.businesslogic.task; using umbraco.interfaces; -using umbraco.BusinessLogic.Actions; using umbraco.cms.presentation.Trees; +using Umbraco.Web.LegacyActions; namespace umbraco { public class loadOpenTasks : BaseTree { diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadUsers.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadUsers.cs index b03c69d6df..cb153ae14d 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadUsers.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadUsers.cs @@ -2,14 +2,13 @@ using System.Collections.Generic; using System.Text; using Umbraco.Core.Configuration; -using umbraco.BasePages; using umbraco.BusinessLogic; -using umbraco.businesslogic; using umbraco.interfaces; using umbraco.cms.presentation.Trees; -using umbraco.BusinessLogic.Actions; using System.Linq; using Umbraco.Core; +using Umbraco.Web; +using Umbraco.Web.LegacyActions; using Umbraco.Web.Trees; @@ -51,7 +50,7 @@ function openUser(id) { { var users = new List(User.getAll()); - User currUser = UmbracoEnsuredPage.CurrentUser; + User currUser = UmbracoContext.Current.UmbracoUser; bool currUserIsAdmin = currUser.IsAdmin(); foreach (User u in users.OrderBy(x => x.Disabled)) diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadXslt.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadXslt.cs index 8acc8697f8..d33c961e10 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadXslt.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadXslt.cs @@ -3,9 +3,9 @@ using System.Text; using umbraco.businesslogic; using umbraco.interfaces; using umbraco.cms.presentation.Trees; -using umbraco.BusinessLogic.Actions; using Umbraco.Core.IO; using Umbraco.Core; +using Umbraco.Web.LegacyActions; using Umbraco.Web.Trees; namespace umbraco diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/actions/delete.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/actions/delete.aspx.cs index bf94fa8712..c98178237c 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/actions/delete.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/actions/delete.aspx.cs @@ -11,10 +11,11 @@ using System.Web.UI.HtmlControls; using umbraco.cms.businesslogic.web; using Umbraco.Core; using Umbraco.Web; +using Umbraco.Web.UI.Pages; namespace umbraco.presentation.actions { - public partial class delete : BasePages.UmbracoEnsuredPage + public partial class delete : UmbracoEnsuredPage { private Document d; @@ -22,9 +23,9 @@ namespace umbraco.presentation.actions { d = new Document(int.Parse(Request.GetItemAsString("id"))); - if (!base.ValidateUserApp(Constants.Applications.Content)) + if (Security.ValidateUserApp(Constants.Applications.Content) == false) throw new ArgumentException("The current user doesn't have access to this application. Please contact the system administrator."); - if (!base.ValidateUserNodeTreePermissions(d.Path, "D")) + if (Security.ValidateUserNodeTreePermissions(UmbracoUser, d.Path, "D") == false) throw new ArgumentException("The current user doesn't have permissions to delete this document. Please contact the system administrator."); pane_delete.Text = ui.Text("delete") + " '" + d.Text + "'"; diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/actions/editContent.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/actions/editContent.aspx.cs index 81f36f5f3a..46674c95ba 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/actions/editContent.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/actions/editContent.aspx.cs @@ -9,6 +9,7 @@ using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using Umbraco.Web; +using Umbraco.Web.UI.Pages; namespace umbraco.presentation.actions { @@ -16,7 +17,7 @@ namespace umbraco.presentation.actions /// /// This page is used only to deeplink to the edit content page with the tree /// - public partial class editContent : BasePages.UmbracoEnsuredPage + public partial class editContent : UmbracoEnsuredPage { protected void Page_Load(object sender, EventArgs e) { diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/actions/preview.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/actions/preview.aspx.cs index 52b4b51aff..6ac8c59d1d 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/actions/preview.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/actions/preview.aspx.cs @@ -11,10 +11,11 @@ using umbraco.cms.businesslogic.web; using Umbraco.Core; using Umbraco.Core.IO; using Umbraco.Web; +using Umbraco.Web.UI.Pages; namespace umbraco.presentation.actions { - public partial class preview : BasePages.UmbracoEnsuredPage + public partial class preview : UmbracoEnsuredPage { public preview() diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/actions/publish.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/actions/publish.aspx.cs index d3451ef4f4..675a7683a6 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/actions/publish.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/actions/publish.aspx.cs @@ -17,7 +17,7 @@ //namespace umbraco.presentation.actions //{ -// public partial class publish : BasePages.UmbracoEnsuredPage +// public partial class publish : Umbraco.Web.UI.Pages.UmbracoEnsuredPage // { // private Document d; diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentControl.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentControl.cs index 40f22d29df..2a1316041f 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentControl.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentControl.cs @@ -13,7 +13,7 @@ //using Umbraco.Core.Configuration; //using Umbraco.Core.IO; //using Umbraco.Core.Models; -//using umbraco.BasePages; +// //using umbraco.cms.businesslogic.web; //using umbraco.interfaces; //using umbraco.uicontrols; diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentTypeControl.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentTypeControl.cs index 65ef53c3d1..e1b8617c50 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentTypeControl.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentTypeControl.cs @@ -163,7 +163,7 @@ // SaveAllowedChildTypes(); // NodeTypeEditorCtrl.Save(); -// prnt.ClientTools.ShowSpeechBubble( BasePages.BasePage.speechBubbleIcon.save, ui.Text("speechBubbles", "contentTypeSavedHeader"),"" + xtra); +// prnt.ClientTools.ShowSpeechBubble( BasePages.BasePage.SpeechBubbleIcon.Save, ui.Text("speechBubbles", "contentTypeSavedHeader"),"" + xtra); // } // private void SaveAllowedChildTypes() { diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/SaveClickEventArgs.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/SaveClickEventArgs.cs index b318919a3f..239125f137 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/SaveClickEventArgs.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/SaveClickEventArgs.cs @@ -12,18 +12,19 @@ using Umbraco.Core.IO; using umbraco.presentation; using System.Collections.Generic; using System.Linq; +using Umbraco.Web.UI; namespace umbraco.controls { public class SaveClickEventArgs : EventArgs { public string Message { get; set; } - public BasePages.BasePage.speechBubbleIcon IconType { get; set; } + public SpeechBubbleIcon IconType { get; set; } public SaveClickEventArgs(string message) { Message = message; - IconType = umbraco.BasePages.BasePage.speechBubbleIcon.success; + IconType = SpeechBubbleIcon.Success; } } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/CustomTreeService.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/CustomTreeService.cs index dd6b49f65a..a47bf10759 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/CustomTreeService.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/CustomTreeService.cs @@ -1,8 +1,11 @@ using System; +using Umbraco.Core.Security; using System.Collections.Generic; using System.Linq; +using System.Web; using System.Web.Script.Services; using System.Web.Services; +using System.Web.UI; using umbraco; using umbraco.cms.businesslogic; using umbraco.cms.presentation.Trees; @@ -114,10 +117,32 @@ namespace umbraco.controls.Tree return returnVal; } - internal static void Authorize() + internal void Authorize() { - if (!umbraco.BasePages.BasePage.ValidateUserContextID(umbraco.BasePages.BasePage.umbracoUserContextID)) + if (ValidateCurrentUser() == false) throw new Exception("Client authorization failed. User is not logged in"); } + + + /// + /// Validates the currently logged in user and ensures they are not timed out + /// + /// + private bool ValidateCurrentUser() + { + var identity = Context.GetCurrentIdentity( + //DO NOT AUTO-AUTH UNLESS THE CURRENT HANDLER IS WEBFORMS! + // Without this check, anything that is using this legacy API, like ui.Text will + // automatically log the back office user in even if it is a front-end request (if there is + // a back office user logged in. This can cause problems becaues the identity is changing mid + // request. For example: http://issues.umbraco.org/issue/U4-4010 + HttpContext.Current.CurrentHandler is Page); + + if (identity != null) + { + return true; + } + return false; + } } } \ No newline at end of file diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/JTreeContextMenu.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/JTreeContextMenu.cs index 831d4f58de..d486a1791c 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/JTreeContextMenu.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/JTreeContextMenu.cs @@ -1,20 +1,12 @@ using System; using System.Collections.Generic; -using System.Web; -using System.Web.UI; -using System.Web.UI.WebControls; using System.Web.Script.Serialization; using Umbraco.Core.Logging; using umbraco.interfaces; -using System.Text.RegularExpressions; -using umbraco.BusinessLogic.Actions; using umbraco.businesslogic.Utils; -using System.Text; -using umbraco.cms.presentation.Trees; -using umbraco.BasePages; -using System.Web.Services; -using umbraco.BusinessLogic; using Umbraco.Core; +using Umbraco.Web.LegacyActions; +using Action = Umbraco.Web.LegacyActions.Action; namespace umbraco.controls.Tree { @@ -31,7 +23,7 @@ namespace umbraco.controls.Tree }); List allActions = new List(); - foreach (IAction a in global::umbraco.BusinessLogic.Actions.Action.GetAll()) + foreach (IAction a in global::Umbraco.Web.LegacyActions.Action.GetAll()) { // NH: Added a try/catch block to this as an error in a 3rd party action can crash the whole menu initialization try @@ -39,7 +31,7 @@ namespace umbraco.controls.Tree if (!string.IsNullOrEmpty(a.Alias) && (!string.IsNullOrEmpty(a.JsFunctionName) || !string.IsNullOrEmpty(a.JsSource))) { // if the action is using invalid javascript we need to do something about this - if (!umbraco.BusinessLogic.Actions.Action.ValidateActionJs(a)) + if (!Action.ValidateActionJs(a)) { // Make new Iaction PlaceboAction pa = new PlaceboAction(a); diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/JTreeContextMenuItem.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/JTreeContextMenuItem.cs index d97711a6d0..2c7a841891 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/JTreeContextMenuItem.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/JTreeContextMenuItem.cs @@ -1,17 +1,9 @@ using System; using System.Collections.Generic; -using System.Web; -using System.Web.UI; -using System.Web.UI.WebControls; using System.Web.Script.Serialization; using umbraco.interfaces; -using System.Text.RegularExpressions; -using umbraco.BusinessLogic.Actions; using umbraco.businesslogic.Utils; using System.Text; -using umbraco.cms.presentation.Trees; -using umbraco.BasePages; -using System.Web.Services; namespace umbraco.controls.Tree { @@ -80,7 +72,7 @@ namespace umbraco.controls.Tree get { List types = new List(); - foreach (IAction a in global::umbraco.BusinessLogic.Actions.Action.GetAll()) + foreach (IAction a in global::Umbraco.Web.LegacyActions.Action.GetAll()) { types.Add(a.GetType()); } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/TreeControl.ascx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/TreeControl.ascx.cs index ff16b6ef3a..0c58177223 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/TreeControl.ascx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/TreeControl.ascx.cs @@ -1,21 +1,14 @@ using System; +using Umbraco.Core.Security; using System.Collections.Generic; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; -using System.Web.Script.Serialization; -using Umbraco.Core.Logging; using Umbraco.Core.Models; using Umbraco.Web.Trees; using Umbraco.Web.UI.Controls; -using umbraco.interfaces; -using System.Text.RegularExpressions; -using umbraco.BusinessLogic.Actions; -using umbraco.businesslogic.Utils; using System.Text; using umbraco.cms.presentation.Trees; -using umbraco.BasePages; -using System.Web.Services; using System.Drawing; using System.Linq; using Umbraco.Core; @@ -226,10 +219,10 @@ namespace umbraco.controls.Tree m_TreeService.App = GetCurrentApp(); // Validate permissions - if (!BasePages.BasePage.ValidateUserContextID(BasePages.BasePage.umbracoUserContextID)) + if (ValidateCurrentUser() == false) return; - UmbracoEnsuredPage page = new UmbracoEnsuredPage(); - if (!page.ValidateUserApp(GetCurrentApp())) + + if (!Security.ValidateUserApp(GetCurrentApp())) throw new ArgumentException("The current user doesn't have access to this application. Please contact the system administrator."); //find all tree definitions that have the current application alias that are ACTIVE. @@ -265,6 +258,28 @@ namespace umbraco.controls.Tree m_IsInit = true; } + /// + /// Validates the currently logged in user and ensures they are not timed out + /// + /// + private bool ValidateCurrentUser() + { + var identity = Context.GetCurrentIdentity( + //DO NOT AUTO-AUTH UNLESS THE CURRENT HANDLER IS WEBFORMS! + // Without this check, anything that is using this legacy API, like ui.Text will + // automatically log the back office user in even if it is a front-end request (if there is + // a back office user logged in. This can cause problems becaues the identity is changing mid + // request. For example: http://issues.umbraco.org/issue/U4-4010 + HttpContext.Current.CurrentHandler is Page); + + if (identity != null) + { + return true; + } + return false; + } + + /// /// This calls the databind method to bind the data binding syntax on the front-end. /// @@ -391,9 +406,9 @@ namespace umbraco.controls.Tree //container node labelled with the current application. XmlTree xTree = new XmlTree(); XmlTreeNode xNode = XmlTreeNode.CreateRoot(new NullTree(GetCurrentApp())); - xNode.Text = ui.Text("sections", GetCurrentApp(), UmbracoEnsuredPage.CurrentUser); + xNode.Text = ui.Text("sections", GetCurrentApp(), Security.CurrentUser); xNode.Source = m_TreeService.GetServiceUrl(); - xNode.Action = "javascript:" + ClientTools.Scripts.OpenDashboard(GetCurrentApp()); + xNode.Action = "javascript:" + global::Umbraco.Web.UI.Pages.ClientTools.Scripts.OpenDashboard(GetCurrentApp()); xNode.NodeType = m_TreeService.App.ToLower(); xNode.NodeID = "-1"; xNode.Icon = ".sprTreeFolder"; diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/create.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/create.aspx.cs index 2be60fd598..8e356ec7b3 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/create.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/create.aspx.cs @@ -3,10 +3,11 @@ using System.Web.UI.WebControls; using System.Xml; using Umbraco.Core.IO; +using Umbraco.Web.UI.Pages; namespace umbraco.cms.presentation { - public class Create : BasePages.UmbracoEnsuredPage + public class Create : UmbracoEnsuredPage { protected Label helpText; protected TextBox rename; diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/create/CreatedPackageTasks.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/create/CreatedPackageTasks.cs index 381fe5559d..f8d31799da 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/create/CreatedPackageTasks.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/create/CreatedPackageTasks.cs @@ -1,13 +1,5 @@ -using System; -using System.Data; -using System.Web.Security; using Umbraco.Core.Logging; using Umbraco.Web.UI; -using umbraco.BusinessLogic; -using umbraco.DataLayer; -using umbraco.BasePages; -using Umbraco.Core.IO; -using umbraco.cms.businesslogic.member; using Umbraco.Core; namespace umbraco diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/create/MemberGroupTasks.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/create/MemberGroupTasks.cs index 7aa428066b..c1a3f0fc5c 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/create/MemberGroupTasks.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/create/MemberGroupTasks.cs @@ -1,11 +1,5 @@ -using System; -using System.Data; using System.Web.Security; using Umbraco.Web.UI; -using umbraco.BusinessLogic; -using umbraco.DataLayer; -using umbraco.BasePages; -using Umbraco.Core.IO; using umbraco.cms.businesslogic.member; using Umbraco.Core; diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/create/PartialViewTasksBase.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/create/PartialViewTasksBase.cs index 042bf312d1..6948605049 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/create/PartialViewTasksBase.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/create/PartialViewTasksBase.cs @@ -1,13 +1,9 @@ using System; -using System.IO; using Umbraco.Core.CodeAnnotations; -using Umbraco.Core.Configuration; using Umbraco.Core.IO; using Umbraco.Core.Models; using Umbraco.Core.Services; -using Umbraco.Web; using Umbraco.Web.UI; -using umbraco.BasePages; using Umbraco.Core; namespace umbraco diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/create/ScriptTasks.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/create/ScriptTasks.cs index ac9db2237e..5d7deb1e0f 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/create/ScriptTasks.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/create/ScriptTasks.cs @@ -1,10 +1,6 @@ -using Umbraco.Core.IO; using Umbraco.Web.UI; using Umbraco.Core; -using Umbraco.Core.Logging; using Umbraco.Core.Models; -using umbraco.BusinessLogic; -using umbraco.BasePages; namespace umbraco { diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/create/StylesheetTasks.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/create/StylesheetTasks.cs index b1820a409c..ebe3965d7d 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/create/StylesheetTasks.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/create/StylesheetTasks.cs @@ -1,15 +1,7 @@ -using System; -using System.Data; using System.Web; -using System.Web.Security; using Umbraco.Core; using Umbraco.Core.Models; using Umbraco.Web.UI; -using umbraco.BusinessLogic; -using umbraco.DataLayer; -using umbraco.BasePages; -using Umbraco.Core.IO; -using umbraco.cms.businesslogic.member; namespace umbraco { diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/create/XsltTasks.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/create/XsltTasks.cs index f3060c81cb..46435dfd24 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/create/XsltTasks.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/create/XsltTasks.cs @@ -1,16 +1,11 @@ using System; -using System.Data; using System.IO; -using System.Web.Security; using Umbraco.Core; using Umbraco.Core.IO; using Umbraco.Core.Logging; using Umbraco.Web.UI; -using umbraco.BusinessLogic; -using umbraco.DataLayer; -using umbraco.BasePages; -using umbraco.cms.businesslogic.member; using Umbraco.Core.FileResources; +using Umbraco.Web; namespace umbraco { @@ -95,7 +90,7 @@ namespace umbraco } catch (Exception ex) { - LogHelper.Error(string.Format("Could not remove XSLT file {0} - User {1}", Alias, UmbracoEnsuredPage.CurrentUser.Id), ex); + LogHelper.Error(string.Format("Could not remove XSLT file {0} - User {1}", Alias, UmbracoContext.Current.UmbracoUser.Id), ex); } return true; } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/create/dialogHandler_temp.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/create/dialogHandler_temp.cs index 8c0cb7334b..17adb83f83 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/create/dialogHandler_temp.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/create/dialogHandler_temp.cs @@ -1,12 +1,7 @@ using System; using System.Web; -using System.Xml; -using System.Xml.XPath; -using System.Reflection; -using Umbraco.Core.IO; using Umbraco.Web.UI; -using umbraco.BusinessLogic; -using umbraco.BasePages; +using Umbraco.Web; namespace umbraco.presentation.create { @@ -24,7 +19,7 @@ namespace umbraco.presentation.create { LegacyDialogHandler.Delete( new HttpContextWrapper(HttpContext.Current), - BasePage.Current.getUser(), + UmbracoContext.Current.UmbracoUser, NodeType, NodeId, Text); } @@ -37,7 +32,7 @@ namespace umbraco.presentation.create { return LegacyDialogHandler.Create( new HttpContextWrapper(HttpContext.Current), - BasePage.Current.getUser(), + UmbracoContext.Current.UmbracoUser, NodeType, NodeId, Text, TypeId); } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/create/dictionaryTasks.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/create/dictionaryTasks.cs index 5a6acbac27..0b2e047613 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/create/dictionaryTasks.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/create/dictionaryTasks.cs @@ -1,13 +1,5 @@ -using System; -using System.Data; -using System.Web.Security; using Umbraco.Core.Logging; using Umbraco.Web.UI; -using umbraco.BusinessLogic; -using umbraco.DataLayer; -using umbraco.BasePages; -using Umbraco.Core.IO; -using umbraco.cms.businesslogic.member; using Umbraco.Core; namespace umbraco diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/create/language.ascx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/create/language.ascx.cs index 66ea0361bc..c7b8fced80 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/create/language.ascx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/create/language.ascx.cs @@ -2,10 +2,8 @@ using System.Collections; using System.Globalization; using System.Web; -using System.Web.UI; using System.Web.UI.WebControls; using Umbraco.Web.UI; -using umbraco.BasePages; using Umbraco.Web; namespace umbraco.cms.presentation.create.controls @@ -13,7 +11,7 @@ namespace umbraco.cms.presentation.create.controls /// /// Summary description for language. /// - public partial class language : UserControl + public partial class language : global::Umbraco.Web.UI.Controls.UmbracoUserControl { protected void Page_Load(object sender, EventArgs e) { @@ -41,12 +39,12 @@ namespace umbraco.cms.presentation.create.controls { LegacyDialogHandler.Create( new HttpContextWrapper(Context), - BasePage.Current.getUser(), + UmbracoContext.UmbracoUser, Request.GetItemAsString("nodeType"), -1, Cultures.SelectedValue); - BasePage.Current.ClientTools + ClientTools .ChildNodeCreated() .CloseModalWindow(); } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/create/languageTasks.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/create/languageTasks.cs index 2d83009866..3133e5443b 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/create/languageTasks.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/create/languageTasks.cs @@ -1,13 +1,4 @@ -using System; -using System.Data; - -using System.Web.Security; using Umbraco.Web.UI; -using umbraco.BusinessLogic; -using umbraco.DataLayer; -using umbraco.BasePages; -using Umbraco.Core.IO; -using umbraco.cms.businesslogic.member; using Umbraco.Core; namespace umbraco diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/create/macroTasks.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/create/macroTasks.cs index 4fd5f4b45a..997c0b14b7 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/create/macroTasks.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/create/macroTasks.cs @@ -1,12 +1,6 @@ -using System; -using System.Data; -using System.Web.Security; using Umbraco.Web.UI; using umbraco.BusinessLogic; using umbraco.DataLayer; -using umbraco.BasePages; -using Umbraco.Core.IO; -using umbraco.cms.businesslogic.member; using Umbraco.Core; namespace umbraco diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/create/script.ascx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/create/script.ascx.cs index d7129040c6..c2afa06aef 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/create/script.ascx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/create/script.ascx.cs @@ -1,24 +1,16 @@ using System; -using System.Data; -using System.Configuration; -using System.Collections; using System.Linq; using System.Web; -using System.Web.Security; -using System.Web.UI; using System.Web.UI.WebControls; -using System.Web.UI.WebControls.WebParts; -using System.Web.UI.HtmlControls; using Umbraco.Core; using Umbraco.Core.Configuration; using Umbraco.Web.UI; -using umbraco.BasePages; -using Umbraco.Core.IO; using Umbraco.Web; +using Umbraco.Web.UI.Controls; namespace umbraco.presentation.umbraco.create { - public partial class script : System.Web.UI.UserControl + public partial class script : UmbracoUserControl { protected override void OnLoad(EventArgs e) { @@ -44,12 +36,12 @@ namespace umbraco.presentation.umbraco.create { string returnUrl = LegacyDialogHandler.Create( new HttpContextWrapper(Context), - BasePage.Current.getUser(), + UmbracoContext.UmbracoUser, Request.GetItemAsString("nodeType"), createFolder, rename.Text + '\u00A4' + scriptType.SelectedValue); - BasePage.Current.ClientTools + ClientTools .ChangeContentFrameUrl(returnUrl) .ReloadActionNode(false, true) .CloseModalWindow(); diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/create/simple.ascx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/create/simple.ascx.cs index 06606d7b19..45238d9b22 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/create/simple.ascx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/create/simple.ascx.cs @@ -1,16 +1,10 @@ using System.Web; -using System.Web.UI; -using ClientDependency.Core; using Umbraco.Core; -using Umbraco.Core.Logging; using Umbraco.Web.UI; using Umbraco.Web; using System; -using Umbraco.Web.UI.Controls; using System.Web.UI.WebControls; -using umbraco.BasePages; using umbraco.BusinessLogic; -using Umbraco.Web; using System.Linq; using UmbracoUserControl = Umbraco.Web.UI.Controls.UmbracoUserControl; @@ -49,7 +43,7 @@ namespace umbraco.cms.presentation.create.controls rename.Text.Trim(), Request.QueryString.AsEnumerable().ToDictionary(x => x.Key, x => (object)x.Value)); - BasePage.Current.ClientTools + ClientTools .ChangeContentFrameUrl(returnUrl) .ReloadActionNode(false, true) .CloseModalWindow(); diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/create/stylesheetPropertyTasks.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/create/stylesheetPropertyTasks.cs index 9bff76aa79..b028f4edc2 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/create/stylesheetPropertyTasks.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/create/stylesheetPropertyTasks.cs @@ -1,17 +1,9 @@ using System; -using System.Data; using System.Linq; using System.Web; -using System.Web.Security; -using System.Windows.Forms; using Umbraco.Core; using Umbraco.Core.Models; using Umbraco.Web.UI; -using umbraco.BusinessLogic; -using umbraco.DataLayer; -using umbraco.BasePages; -using Umbraco.Core.IO; -using umbraco.cms.businesslogic.member; namespace umbraco { diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/create/templateTasks.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/create/templateTasks.cs index f6aad2e05d..e78b10f5a6 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/create/templateTasks.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/create/templateTasks.cs @@ -1,14 +1,6 @@ -using System; -using System.Data; -using System.Web.Security; using Umbraco.Core; using Umbraco.Core.Configuration; using Umbraco.Web.UI; -using umbraco.BusinessLogic; -using umbraco.DataLayer; -using umbraco.BasePages; -using Umbraco.Core.IO; -using umbraco.cms.businesslogic.member; namespace umbraco { diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/create/userTasks.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/create/userTasks.cs index d5327590e9..088bb29163 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/create/userTasks.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/create/userTasks.cs @@ -1,15 +1,9 @@ using System; -using System.Data; using System.Web.Security; -using Umbraco.Core.Configuration; using Umbraco.Core.Logging; using Umbraco.Web.UI; using umbraco.BusinessLogic; using Umbraco.Core.Security; -using umbraco.DataLayer; -using umbraco.BasePages; -using Umbraco.Core.IO; -using umbraco.cms.businesslogic.member; using Umbraco.Core; namespace umbraco 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 2ed9850026..8f6aae71c2 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/create/xslt.ascx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/create/xslt.ascx.cs @@ -1,16 +1,11 @@ -using System; -using System.Data; -using System.Drawing; -using System.Web; +using System.Web; using System.Web.UI.WebControls; -using System.Web.UI.HtmlControls; using System.IO; using Umbraco.Core; -using Umbraco.Core.Configuration; using Umbraco.Web.UI; using Umbraco.Core.IO; -using umbraco.BasePages; using Umbraco.Web; +using Umbraco.Web.UI.Controls; namespace umbraco.presentation.create { @@ -19,7 +14,7 @@ namespace umbraco.presentation.create /// /// Summary description for xslt. /// - public partial class xslt : System.Web.UI.UserControl + public partial class xslt : UmbracoUserControl { protected System.Web.UI.WebControls.ListBox nodeType; @@ -56,12 +51,12 @@ namespace umbraco.presentation.create var returnUrl = LegacyDialogHandler.Create( new HttpContextWrapper(Context), - BasePage.Current.getUser(), + UmbracoContext.UmbracoUser, Request.GetItemAsString("nodeType"), createMacroVal, xsltName + "|||" + rename.Text); - BasePage.Current.ClientTools + ClientTools .ChangeContentFrameUrl(returnUrl) .ChildNodeCreated() .CloseModalWindow(); diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dashboard/FeedProxy.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dashboard/FeedProxy.aspx.cs index 5c0cb9ede0..eca79aa26c 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dashboard/FeedProxy.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dashboard/FeedProxy.aspx.cs @@ -1,17 +1,16 @@ using Umbraco.Core; using Umbraco.Core.Logging; using Umbraco.Web; +using Umbraco.Web.UI.Pages; +using System; +using System.Linq; +using System.Net; +using System.Net.Mime; +using Umbraco.Core.IO; namespace dashboardUtilities { - using System; - using System.Linq; - using System.Net; - using System.Net.Mime; - using umbraco; - using umbraco.BasePages; - using umbraco.BusinessLogic; - using Umbraco.Core.IO; + public partial class FeedProxy : UmbracoEnsuredPage { diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Macros/assemblyBrowser.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Macros/assemblyBrowser.aspx.cs index a51f49f7a2..c647938d4e 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Macros/assemblyBrowser.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Macros/assemblyBrowser.aspx.cs @@ -18,6 +18,7 @@ using Umbraco.Web; using Umbraco.Core.PropertyEditors; using umbraco.BusinessLogic; using System.Collections.Generic; +using Umbraco.Web.UI.Pages; using MacroProperty = umbraco.cms.businesslogic.macro.MacroProperty; namespace umbraco.developer @@ -25,7 +26,7 @@ namespace umbraco.developer /// /// Summary description for assemblyBrowser. /// - public partial class assemblyBrowser : BasePages.UmbracoEnsuredPage + public partial class assemblyBrowser : UmbracoEnsuredPage { public assemblyBrowser() { diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Macros/editMacro.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Macros/editMacro.aspx.cs index 04aca72d62..6bb619ec0f 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Macros/editMacro.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Macros/editMacro.aspx.cs @@ -9,11 +9,12 @@ using Umbraco.Core; using Umbraco.Core.IO; using Umbraco.Core.Models; using Umbraco.Core.PropertyEditors; -using umbraco.BasePages; using umbraco.uicontrols; using umbraco.DataLayer; using umbraco.cms.presentation.Trees; using System.Linq; +using Umbraco.Web.UI; +using Umbraco.Web.UI.Pages; namespace umbraco.cms.presentation.developer { @@ -326,7 +327,7 @@ namespace umbraco.cms.presentation.developer Services.MacroService.Save(_macro); - ClientTools.ShowSpeechBubble(speechBubbleIcon.save, "Macro saved", ""); + ClientTools.ShowSpeechBubble(SpeechBubbleIcon.Save, "Macro saved", ""); // Check for assemblyBrowser if (tempMacroType.IndexOf(".ascx", StringComparison.Ordinal) > 0) 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 b99ac3e091..318d3defd9 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 @@ -14,9 +14,10 @@ using Umbraco.Core; using Umbraco.Core.Configuration; using Umbraco.Core.IO; using Umbraco.Web; +using Umbraco.Web.UI.Pages; namespace umbraco.presentation.developer.packages { - public partial class BrowseRepository : BasePages.UmbracoEnsuredPage { + public partial class BrowseRepository : UmbracoEnsuredPage { public BrowseRepository() { diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/SubmitPackage.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/SubmitPackage.aspx.cs index 4908bee541..3e5bfaa247 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/SubmitPackage.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/SubmitPackage.aspx.cs @@ -12,9 +12,10 @@ using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using Umbraco.Core; using Umbraco.Web; +using Umbraco.Web.UI.Pages; namespace umbraco.presentation.developer.packages { - public partial class SubmitPackage : BasePages.UmbracoEnsuredPage { + public partial class SubmitPackage : UmbracoEnsuredPage { public SubmitPackage() { diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/directoryBrowser.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/directoryBrowser.aspx.cs deleted file mode 100644 index 9df34e9a23..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/directoryBrowser.aspx.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; -using System.Data; -using System.Configuration; -using System.Collections; -using System.Web; -using System.Web.Security; -using System.Web.UI; -using System.Web.UI.WebControls; -using System.Web.UI.WebControls.WebParts; -using System.Web.UI.HtmlControls; -using umbraco.BusinessLogic; -using Umbraco.Core; - -namespace umbraco.presentation.developer.packages -{ - [Obsolete("This class is no longer used and will be removed from the codebase in the future")] - public partial class directoryBrowser : BasePages.UmbracoEnsuredPage - { - public directoryBrowser() - { - CurrentApp = Constants.Applications.Developer.ToString(); - } - - /// - /// pane control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::umbraco.uicontrols.Pane pane; - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/editPackage.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/editPackage.aspx.cs index 5b954eaa4f..b0cc221a8d 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/editPackage.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/editPackage.aspx.cs @@ -14,10 +14,12 @@ using umbraco.cms.presentation.Trees; using umbraco.controls; using Umbraco.Core; using Umbraco.Core.IO; +using Umbraco.Web.UI; +using Umbraco.Web.UI.Pages; namespace umbraco.presentation.developer.packages { - public partial class _Default : BasePages.UmbracoEnsuredPage + public partial class _Default : UmbracoEnsuredPage { public _Default() @@ -212,7 +214,7 @@ namespace umbraco.presentation.developer.packages protected void saveOrPublish(object sender, CommandEventArgs e) { if (!Page.IsValid) { - this.ClientTools.ShowSpeechBubble(BasePages.BasePage.speechBubbleIcon.error, "Saved failed.", "Some fields have not been filled-out correctly"); + this.ClientTools.ShowSpeechBubble(SpeechBubbleIcon.Error, "Saved failed.", "Some fields have not been filled-out correctly"); } else { @@ -231,9 +233,9 @@ namespace umbraco.presentation.developer.packages packageUmbFile.Text = "   Download"; - this.ClientTools.ShowSpeechBubble(BasePages.BasePage.speechBubbleIcon.success, "Package saved and published", ""); + this.ClientTools.ShowSpeechBubble(SpeechBubbleIcon.Success, "Package saved and published", ""); } else { - this.ClientTools.ShowSpeechBubble(BasePages.BasePage.speechBubbleIcon.error, "Save failed", "check your umbraco log."); + this.ClientTools.ShowSpeechBubble(SpeechBubbleIcon.Error, "Save failed", "check your umbraco log."); } } } @@ -323,7 +325,7 @@ namespace umbraco.presentation.developer.packages createdPackage.Save(); if(showNotification) - this.ClientTools.ShowSpeechBubble(BasePages.BasePage.speechBubbleIcon.save, "Package Saved", ""); + this.ClientTools.ShowSpeechBubble(SpeechBubbleIcon.Save, "Package Saved", ""); } protected void addFileToPackage(object sender, EventArgs e) diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/installedPackage.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/installedPackage.aspx.cs index b6d273ab3a..8b6c4afc6a 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/installedPackage.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/installedPackage.aspx.cs @@ -20,13 +20,14 @@ using umbraco.cms.businesslogic.web; using runtimeMacro = umbraco.macro; using System.Xml; using umbraco.cms.presentation.Trees; -using BizLogicAction = umbraco.BusinessLogic.Actions.Action; +using Umbraco.Web.UI.Pages; +using BizLogicAction = Umbraco.Web.LegacyActions.Action; using Macro = umbraco.cms.businesslogic.macro.Macro; using Template = umbraco.cms.businesslogic.template.Template; namespace umbraco.presentation.developer.packages { - public partial class installedPackage : BasePages.UmbracoEnsuredPage + public partial class installedPackage : UmbracoEnsuredPage { public installedPackage() { diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/installer.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/installer.aspx.cs index 88349cf6dc..8ceee94122 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/installer.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/installer.aspx.cs @@ -15,11 +15,11 @@ using System.Xml.XPath; using Umbraco.Core.IO; using Umbraco.Core.Logging; using Umbraco.Web; -using umbraco.BasePages; using umbraco.BusinessLogic; using umbraco.cms.presentation.Trees; using Umbraco.Core; -using BizLogicAction = umbraco.BusinessLogic.Actions.Action; +using Umbraco.Web.UI.Pages; +using BizLogicAction = Umbraco.Web.LegacyActions.Action; namespace umbraco.presentation.developer.packages { diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/EditRelationType.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/EditRelationType.aspx.cs index 0fea78697d..1cb2de4986 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/EditRelationType.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/EditRelationType.aspx.cs @@ -4,7 +4,7 @@ //using System.Collections.Generic; //using System.Web.UI; //using System.Web.UI.WebControls; -//using umbraco.BasePages; +// //using umbraco.BusinessLogic; //using Umbraco.Core; //using Umbraco.Core.Models; @@ -276,7 +276,7 @@ // var relationService = Services.RelationService; // relationService.Save(this._relationType); -// ClientTools.ShowSpeechBubble(speechBubbleIcon.save, "Relation Type Updated", bubbleBody); +// ClientTools.ShowSpeechBubble(SpeechBubbleIcon.Save, "Relation Type Updated", bubbleBody); // } // } // } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/editXslt.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/editXslt.aspx.cs index 4e6c09e9b9..71043ac57a 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/editXslt.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/editXslt.aspx.cs @@ -9,10 +9,10 @@ using System.Xml; using System.Xml.Xsl; using Umbraco.Core; using Umbraco.Core.IO; -using umbraco.BasePages; using umbraco.uicontrols; using System.Net; using umbraco.cms.presentation.Trees; +using Umbraco.Web.UI.Pages; namespace umbraco.cms.presentation.developer { diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/getXsltStatus.asmx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/getXsltStatus.asmx.cs index 39a734a158..ae0b9f8166 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/getXsltStatus.asmx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/getXsltStatus.asmx.cs @@ -9,6 +9,7 @@ using System.Xml; using System.IO; using Umbraco.Core.IO; using umbraco.presentation.webservices; +using Umbraco.Web.WebServices; namespace umbraco.developer { @@ -16,8 +17,8 @@ namespace umbraco.developer /// Summary description for getXsltStatus. /// [WebService(Namespace="http://umbraco.org/webservices")] - public class getXsltStatus : System.Web.Services.WebService - { + public class getXsltStatus : UmbracoAuthorizedWebService + { public getXsltStatus() { //CODEGEN: This call is required by the ASP.NET Web Services Designer @@ -26,9 +27,9 @@ namespace umbraco.developer // TODO: Security-check [WebMethod] - public XmlDocument FilesFromDirectory(string dir) + public XmlDocument FilesFromDirectory(string dir) { - legacyAjaxCalls.Authorize(); + AuthorizeRequest(true); XmlDocument xd = new XmlDocument(); xd.LoadXml(""); diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/xsltChooseExtension.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/xsltChooseExtension.aspx.cs index 7ee4ca4733..474feaecb1 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/xsltChooseExtension.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/xsltChooseExtension.aspx.cs @@ -6,6 +6,7 @@ using System.Text; using System.Web.UI; using System.Web.UI.WebControls; using Umbraco.Core; +using Umbraco.Web.UI.Pages; namespace umbraco.developer { @@ -13,7 +14,7 @@ namespace umbraco.developer /// Summary description for xsltChooseExtension. ///
[WebformsPageTreeAuthorize(Constants.Trees.Xslt)] - public partial class xsltChooseExtension : BasePages.UmbracoEnsuredPage + public partial class xsltChooseExtension : UmbracoEnsuredPage { protected void Page_Load(object sender, System.EventArgs e) 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 d505b8a279..7fd89c94d8 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 @@ -12,6 +12,7 @@ using System.Web.UI.HtmlControls; using Umbraco.Core.Configuration; using umbraco.cms.businesslogic.propertytype; using Umbraco.Core; +using Umbraco.Web.UI.Pages; namespace umbraco.developer { @@ -19,7 +20,7 @@ namespace umbraco.developer /// Summary description for xsltInsertValueOf. ///
[WebformsPageTreeAuthorize(Constants.Trees.Xslt)] - public partial class xsltInsertValueOf : BasePages.UmbracoEnsuredPage + public partial class xsltInsertValueOf : UmbracoEnsuredPage { protected void Page_Load(object sender, System.EventArgs e) { diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/xsltVisualize.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/xsltVisualize.aspx.cs index cf904f0f74..ec8333e074 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/xsltVisualize.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Xslt/xsltVisualize.aspx.cs @@ -9,11 +9,12 @@ using System.Xml; using System.IO; using Umbraco.Core; using Umbraco.Core.IO; +using Umbraco.Web.UI.Pages; namespace umbraco.presentation.umbraco.developer.Xslt { [WebformsPageTreeAuthorize(Constants.Trees.Xslt)] - public partial class xsltVisualize : BasePages.UmbracoEnsuredPage + public partial class xsltVisualize : UmbracoEnsuredPage { // zb-00004 #29956 : refactor cookies names & handling diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/autoDoc.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/autoDoc.aspx.cs index 7c0e146680..fc3d32b58f 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/autoDoc.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/autoDoc.aspx.cs @@ -11,13 +11,14 @@ using System.Web.UI.HtmlControls; using System.Linq; using umbraco.BusinessLogic; using Umbraco.Core; +using Umbraco.Web.UI.Pages; namespace umbraco.developer { /// /// Summary description for autoDoc. /// - public partial class autoDoc : BasePages.UmbracoEnsuredPage + public partial class autoDoc : UmbracoEnsuredPage { public autoDoc() { diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/AssignDomain.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/AssignDomain.aspx.cs index 45c7ceefab..9d8c35681b 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/AssignDomain.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/AssignDomain.aspx.cs @@ -2,11 +2,10 @@ using System.Globalization; using System.Web.UI.WebControls; using Umbraco.Web; -using umbraco.BasePages; -using umbraco.BusinessLogic; using umbraco.cms.businesslogic.language; using umbraco.cms.businesslogic.web; using Umbraco.Core; +using Umbraco.Web.UI.Pages; namespace umbraco.dialogs { diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/AssignDomain2.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/AssignDomain2.aspx.cs index 4f71e20d08..4dcde7c512 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/AssignDomain2.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/AssignDomain2.aspx.cs @@ -2,11 +2,11 @@ using System; using System.Collections.Generic; using System.Text; using System.Linq; -using umbraco.BusinessLogic.Actions; using Umbraco.Core; using Umbraco.Core.Models; using Umbraco.Web.UI.Pages; using Umbraco.Web; +using Umbraco.Web.LegacyActions; using Umbraco.Web.Routing; using Umbraco.Web.WebServices; diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/Preview.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/Preview.aspx.cs index a0fbeb2a50..325bca27bb 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/Preview.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/Preview.aspx.cs @@ -19,7 +19,7 @@ using Umbraco.Core; namespace umbraco.presentation.dialogs { - public partial class Preview : BasePages.UmbracoEnsuredPage + public partial class Preview : Umbraco.Web.UI.Pages.UmbracoEnsuredPage { public Preview() { diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/RegexWs.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/RegexWs.aspx.cs index 96ce239ff3..d4a777df4c 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/RegexWs.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/RegexWs.aspx.cs @@ -11,7 +11,7 @@ using System.Web.UI.HtmlControls; using Umbraco.Core; namespace umbraco.presentation.dialogs { - public partial class RegexWs : BasePages.UmbracoEnsuredPage { + public partial class RegexWs : Umbraco.Web.UI.Pages.UmbracoEnsuredPage { private DataSet ds = new DataSet(); public RegexWs() diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/SendPublish.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/SendPublish.aspx.cs index 0f3f18494d..7a2b01e584 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/SendPublish.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/SendPublish.aspx.cs @@ -10,9 +10,9 @@ using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; using Umbraco.Web; using umbraco.BusinessLogic; -using umbraco.BusinessLogic.Actions; using umbraco.cms.businesslogic.web; using Umbraco.Core; +using Umbraco.Web.LegacyActions; namespace umbraco.dialogs { @@ -20,7 +20,7 @@ namespace umbraco.dialogs /// Runs all action handlers for the ActionToPublish action for the document with /// the corresponding document id passed in by query string /// - public partial class SendPublish : BasePages.UmbracoEnsuredPage + public partial class SendPublish : Umbraco.Web.UI.Pages.UmbracoEnsuredPage { public SendPublish() { diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/about.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/about.aspx.cs index a30cb1eb7b..59f8b5ec92 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/about.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/about.aspx.cs @@ -2,13 +2,14 @@ using System; using System.Globalization; using Umbraco.Core; using Umbraco.Core.Configuration; +using Umbraco.Web.UI.Pages; namespace umbraco.dialogs { /// /// Summary description for about. /// - public partial class about : BasePages.UmbracoEnsuredPage + public partial class about : UmbracoEnsuredPage { protected void Page_Load(object sender, EventArgs e) diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/create.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/create.aspx.cs index a3da4846b3..a3269ab0e1 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/create.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/create.aspx.cs @@ -1,26 +1,15 @@ using System; -using System.Collections; -using System.ComponentModel; -using System.Data; -using System.Drawing; using System.Globalization; using System.Linq; -using System.Web; -using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls; -using System.Web.UI.HtmlControls; using System.Xml; using Umbraco.Core.IO; -using Umbraco.Core.Logging; using Umbraco.Web; using umbraco.cms.businesslogic; -using umbraco.cms.presentation; -using umbraco.presentation; -using umbraco.BusinessLogic.Actions; -using umbraco.BasePages; -using umbraco.cms.businesslogic.web; using Umbraco.Core; +using Umbraco.Web.LegacyActions; +using Umbraco.Web.UI.Pages; namespace umbraco.dialogs { @@ -99,7 +88,7 @@ namespace umbraco.dialogs private bool CheckCreatePermissions(int nodeId) { - return CurrentUser.GetPermissions(new CMSNode(nodeId).Path) + return UmbracoContext.UmbracoUser.GetPermissions(new CMSNode(nodeId).Path) .Contains(ActionNew.Instance.Letter.ToString(CultureInfo.InvariantCulture)); } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/cruds.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/cruds.aspx.cs index a135386777..c130331345 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/cruds.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/cruds.aspx.cs @@ -13,13 +13,14 @@ using System.Collections.Generic; using Umbraco.Core; using Umbraco.Web; using umbraco.cms.businesslogic; +using Umbraco.Web.UI.Pages; namespace umbraco.dialogs { /// /// Summary description for cruds. /// - public partial class cruds : BasePages.UmbracoEnsuredPage + public partial class cruds : UmbracoEnsuredPage { public cruds() diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/editMacro.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/editMacro.aspx.cs index 79dd83c5f7..a1512671b6 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/editMacro.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/editMacro.aspx.cs @@ -1,5 +1,6 @@ using System; using System.Collections; +using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; @@ -15,6 +16,7 @@ using System.IO; using Umbraco.Core.IO; using Umbraco.Web; using umbraco.DataLayer; +using Umbraco.Web.UI.Pages; namespace umbraco.dialogs @@ -22,7 +24,7 @@ namespace umbraco.dialogs /// /// Summary description for insertMacro. /// - public partial class editMacro : BasePages.UmbracoEnsuredPage + public partial class editMacro : UmbracoEnsuredPage { protected Button Button1; @@ -125,17 +127,16 @@ namespace umbraco.dialogs } else { - IRecordsReader macroRenderings; + List macroRenderings; if (Request.GetItemAsString("editor") != "") - macroRenderings = SqlHelper.ExecuteReader("select macroAlias, macroName from cmsMacro where macroUseInEditor = 1 order by macroName"); + macroRenderings = DatabaseContext.Database.Fetch("select macroAlias, macroName from cmsMacro where macroUseInEditor = 1 order by macroName"); else - macroRenderings = SqlHelper.ExecuteReader("select macroAlias, macroName from cmsMacro order by macroName"); + macroRenderings = DatabaseContext.Database.Fetch("select macroAlias, macroName from cmsMacro order by macroName"); umb_macroAlias.DataSource = macroRenderings; umb_macroAlias.DataValueField = "macroAlias"; umb_macroAlias.DataTextField = "macroName"; umb_macroAlias.DataBind(); - macroRenderings.Close(); } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/emptyTrashcan.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/emptyTrashcan.aspx.cs index 8480e095e5..af547e2a86 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/emptyTrashcan.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/emptyTrashcan.aspx.cs @@ -2,8 +2,8 @@ using System.Web.UI; using Umbraco.Core; using Umbraco.Web; -using umbraco.BasePages; using umbraco.cms.businesslogic; +using Umbraco.Web.UI.Pages; namespace umbraco.presentation.dialogs { @@ -27,7 +27,7 @@ namespace umbraco.presentation.dialogs base.OnInit(e); var recycleBinType = Request.GetItemAsString("type"); - if (ValidateUserApp(recycleBinType) == false) + if (Security.ValidateUserApp(recycleBinType) == false) { throw new InvalidOperationException("The user does not have access to the requested app"); } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/exportDocumenttype.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/exportDocumenttype.aspx.cs index 49cb4c659c..cfcf41c9a8 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/exportDocumenttype.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/exportDocumenttype.aspx.cs @@ -19,7 +19,7 @@ namespace umbraco.presentation.dialogs /// /// Summary description for exportDocumenttype. /// - public class exportDocumenttype : BasePages.UmbracoEnsuredPage + public class exportDocumenttype : Umbraco.Web.UI.Pages.UmbracoEnsuredPage { public exportDocumenttype() { diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/importDocumenttype.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/importDocumenttype.aspx.cs index 100a103b5f..b65f905738 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/importDocumenttype.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/importDocumenttype.aspx.cs @@ -12,7 +12,7 @@ namespace umbraco.presentation.umbraco.dialogs /// /// Summary description for importDocumentType. /// - public class importDocumentType : BasePages.UmbracoEnsuredPage + public class importDocumentType : Umbraco.Web.UI.Pages.UmbracoEnsuredPage { public importDocumentType() { @@ -72,7 +72,7 @@ namespace umbraco.presentation.umbraco.dialogs var xd = new XmlDocument(); xd.Load(tempFile.Value); - var userId = base.getUser().Id; + var userId = Security.GetUserId(); var element = XElement.Parse(xd.InnerXml); var importContentTypes = ApplicationContext.Current.Services.PackagingService.ImportContentTypes(element, userId); diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/insertMacro.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/insertMacro.aspx.cs index f1a8191213..14d141ab82 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/insertMacro.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/insertMacro.aspx.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Web.UI; using System.Web.UI.WebControls; using System.Reflection; @@ -13,7 +14,7 @@ namespace umbraco.dialogs /// /// Summary description for insertMacro. /// - public partial class insertMacro : BasePages.UmbracoEnsuredPage + public partial class insertMacro : Umbraco.Web.UI.Pages.UmbracoEnsuredPage { protected Button Button1; @@ -22,14 +23,14 @@ namespace umbraco.dialogs base.OnInit(e); //this could be used for media or content so we need to at least validate that the user has access to one or the other - if (!ValidateUserApp(Constants.Applications.Content.ToString()) && !ValidateUserApp(Constants.Applications.Media.ToString())) + if (Security.ValidateUserApp(Constants.Applications.Content) == false && Security.ValidateUserApp(Constants.Applications.Media) == false) throw new SecurityException("The current user doesn't have access to the section/app"); } protected void Page_Load(object sender, EventArgs e) { - pane_edit.Text = ui.Text("general", "edit",this.getUser()) + " " + ui.Text("general", "macro",this.getUser()); - pane_insert.Text = ui.Text("general", "insert",this.getUser()) + " " + ui.Text("general", "macro",this.getUser()); + pane_edit.Text = ui.Text("general", "edit",Security.CurrentUser) + " " + ui.Text("general", "macro",Security.CurrentUser); + pane_insert.Text = ui.Text("general", "insert",Security.CurrentUser) + " " + ui.Text("general", "macro",Security.CurrentUser); if (Request["macroID"] != null || Request["macroAlias"] != null) { @@ -91,17 +92,16 @@ namespace umbraco.dialogs } else { - IRecordsReader macroRenderings; - if (Request.GetItemAsString("editor") != "") - macroRenderings = SqlHelper.ExecuteReader("select macroAlias, macroName from cmsMacro where macroUseInEditor = 1 order by macroName"); + List macroRenderings; + if (Request.GetItemAsString("editor") != "") + macroRenderings = DatabaseContext.Database.Fetch("select macroAlias, macroName from cmsMacro where macroUseInEditor = 1 order by macroName"); else - macroRenderings = SqlHelper.ExecuteReader("select macroAlias, macroName from cmsMacro order by macroName"); + macroRenderings = DatabaseContext.Database.Fetch("select macroAlias, macroName from cmsMacro order by macroName"); macroAlias.DataSource = macroRenderings; macroAlias.DataValueField = "macroAlias"; macroAlias.DataTextField = "macroName"; macroAlias.DataBind(); - macroRenderings.Close(); } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/insertMasterpageContent.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/insertMasterpageContent.aspx.cs index 2235e9776b..5c2399b105 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/insertMasterpageContent.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/insertMasterpageContent.aspx.cs @@ -10,7 +10,7 @@ using Umbraco.Core; namespace umbraco.presentation.umbraco.dialogs { - public partial class insertMasterpageContent : BasePages.UmbracoEnsuredPage + public partial class insertMasterpageContent : Umbraco.Web.UI.Pages.UmbracoEnsuredPage { public insertMasterpageContent() { diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/insertMasterpagePlaceholder.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/insertMasterpagePlaceholder.aspx.cs index fd936211a9..501b755d72 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/insertMasterpagePlaceholder.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/insertMasterpagePlaceholder.aspx.cs @@ -6,7 +6,7 @@ using System.Web.UI.WebControls; using Umbraco.Core; namespace umbraco.presentation.umbraco.dialogs { - public partial class insertMasterpagePlaceholder : BasePages.UmbracoEnsuredPage { + public partial class insertMasterpagePlaceholder : Umbraco.Web.UI.Pages.UmbracoEnsuredPage { public insertMasterpagePlaceholder() { diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/moveOrCopy.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/moveOrCopy.aspx.cs index c7ae70e246..50bc2e9b8f 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/moveOrCopy.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/moveOrCopy.aspx.cs @@ -7,12 +7,13 @@ using System.Xml; using Umbraco.Core; using Umbraco.Core.IO; using Umbraco.Core.Models; -using umbraco.BasePages; using System.Linq; using umbraco.cms.presentation.user; using umbraco.interfaces; using Umbraco.Web; using Umbraco.Core; +using Umbraco.Web.UI.Pages; +using Action = Umbraco.Web.LegacyActions.Action; namespace umbraco.dialogs { @@ -121,7 +122,7 @@ namespace umbraco.dialogs private bool ValidAction(IContentBase cmsNode, char actionLetter) { - var currentAction = BusinessLogic.Actions.Action.GetPermissionAssignable().First(a => a.Letter == actionLetter); + var currentAction = Action.GetPermissionAssignable().First(a => a.Letter == actionLetter); return CheckPermissions(cmsNode, currentAction); } @@ -137,7 +138,7 @@ namespace umbraco.dialogs /// private bool CheckPermissions(IContentBase node, IAction currentAction) { - var currUserPermissions = new UserPermissions(CurrentUser); + var currUserPermissions = new UserPermissions(UmbracoContext.UmbracoUser); var lstCurrUserActions = currUserPermissions.GetExistingNodePermission(node.Id); return lstCurrUserActions.Contains(currentAction); diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/notifications.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/notifications.aspx.cs index f77b635af4..95d495ae13 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/notifications.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/notifications.aspx.cs @@ -3,11 +3,12 @@ using System.Collections; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; -using umbraco.BasePages; using umbraco.cms.businesslogic; using umbraco.cms.businesslogic.workflow; using Umbraco.Core; using Umbraco.Web; +using Umbraco.Web.UI.Pages; +using Action = Umbraco.Web.LegacyActions.Action; namespace umbraco.dialogs { @@ -28,7 +29,7 @@ namespace umbraco.dialogs protected void Page_Load(object sender, EventArgs e) { Button1.Text = ui.Text("update"); - pane_form.Text = ui.Text("notifications", "editNotifications", node.Text, base.getUser()); + pane_form.Text = ui.Text("notifications", "editNotifications", node.Text, Security.CurrentUser); } #region Web Form Designer generated code @@ -43,7 +44,7 @@ namespace umbraco.dialogs node = new cms.businesslogic.CMSNode(int.Parse(Request.GetItemAsString("id"))); - ArrayList actionList = BusinessLogic.Actions.Action.GetAll(); + ArrayList actionList = Action.GetAll(); foreach (interfaces.IAction a in actionList) { @@ -53,7 +54,7 @@ namespace umbraco.dialogs CheckBox c = new CheckBox(); c.ID = a.Letter.ToString(); - if (base.getUser().GetNotifications(node.Path).IndexOf(a.Letter) > -1) + if (UmbracoContext.UmbracoUser.GetNotifications(node.Path).IndexOf(a.Letter) > -1) c.Checked = true; uicontrols.PropertyPanel pp = new umbraco.uicontrols.PropertyPanel(); @@ -91,9 +92,9 @@ namespace umbraco.dialogs if (c.Checked) notifications += c.ID; } - Notification.UpdateNotifications(base.getUser(), node, notifications); - getUser().resetNotificationCache(); - base.getUser().initNotifications(); + Notification.UpdateNotifications(UmbracoContext.UmbracoUser, node, notifications); + UmbracoContext.UmbracoUser.resetNotificationCache(); + UmbracoContext.UmbracoUser.initNotifications(); var feedback = new umbraco.uicontrols.Feedback(); feedback.Text = ui.Text("notifications") + " " + ui.Text("ok") + "

" + ui.Text("closeThisWindow") + ""; diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/protectPage.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/protectPage.aspx.cs index 421bdccdea..2298371f67 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/protectPage.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/protectPage.aspx.cs @@ -10,11 +10,11 @@ using Umbraco.Core; using Umbraco.Core.Logging; using umbraco.cms.businesslogic.web; using umbraco.controls; -using umbraco.BasePages; using Umbraco.Core.Models; using Umbraco.Core.Persistence; using Umbraco.Core.Security; using Umbraco.Web; +using Umbraco.Web.UI.Pages; using MembershipProviderExtensions = Umbraco.Core.Security.MembershipProviderExtensions; using MemberType = umbraco.cms.businesslogic.member.MemberType; diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/republish.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/republish.aspx.cs index 5ff42e069b..ee4100a346 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/republish.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/republish.aspx.cs @@ -17,7 +17,7 @@ // ///

// /// Summary description for republish. // /// -// public partial class republish : BasePages.UmbracoEnsuredPage +// public partial class republish : Umbraco.Web.UI.Pages.UmbracoEnsuredPage // { // public republish() // { diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/rollBack.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/rollBack.aspx.cs index bb634887cb..804bf908a6 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/rollBack.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/rollBack.aspx.cs @@ -10,7 +10,7 @@ //using System.Web.UI; //using System.Web.UI.WebControls; //using System.Web.UI.HtmlControls; -//using umbraco.BasePages; +// //using umbraco.cms.businesslogic.web; //using umbraco.cms.businesslogic.property; @@ -150,9 +150,9 @@ // { // if (allVersions.SelectedValue.Trim() != "") { // Document d = new Document(int.Parse(helper.Request("nodeId"))); -// d.RollBack(new Guid(allVersions.SelectedValue), base.getUser()); +// d.RollBack(new Guid(allVersions.SelectedValue), Security.CurrentUser); -// BusinessLogic.Log.Add(BusinessLogic.LogTypes.RollBack, base.getUser(), d.Id, "Version rolled back to revision '" + allVersions.SelectedValue + "'"); +// BusinessLogic.Log.Add(BusinessLogic.LogTypes.RollBack, Security.CurrentUser, d.Id, "Version rolled back to revision '" + allVersions.SelectedValue + "'"); // Document rollback = new Document(d.Id, new Guid(allVersions.SelectedValue)); // feedBackMsg.type = global::umbraco.uicontrols.Feedback.feedbacktype.success; diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/search.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/search.aspx.cs index 649e8b5fc0..0f365f49ad 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/search.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/search.aspx.cs @@ -15,7 +15,7 @@ using Umbraco.Core; namespace umbraco.presentation.dialogs { - public partial class search : BasePages.UmbracoEnsuredPage + public partial class search : Umbraco.Web.UI.Pages.UmbracoEnsuredPage { protected override void OnInit(EventArgs e) diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/sendToTranslation.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/sendToTranslation.aspx.cs index befc2e5cd0..ed26511e1a 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/sendToTranslation.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/sendToTranslation.aspx.cs @@ -12,9 +12,9 @@ using System.Web.UI.HtmlControls; using umbraco.cms.businesslogic.web; using umbraco.cms.businesslogic; using umbraco.BusinessLogic; -using umbraco.BasePages; using Umbraco.Core; using Umbraco.Web; +using Umbraco.Web.UI.Pages; namespace umbraco.presentation.dialogs { @@ -31,11 +31,11 @@ namespace umbraco.presentation.dialogs { _currentPage = new CMSNode(int.Parse(Request.GetItemAsString("id"))); - pp_translator.Text = ui.Text("translation","translator", this.getUser()); - pp_language.Text = ui.Text("translation", "translateTo", this.getUser()); - pp_includeSubs.Text = ui.Text("translation","includeSubpages", this.getUser()); - pp_comment.Text = ui.Text("comment", this.getUser()); - pane_form.Text = ui.Text("translation", "sendToTranslate", _currentPage.Text, base.getUser()); + pp_translator.Text = ui.Text("translation","translator", Security.CurrentUser); + pp_language.Text = ui.Text("translation", "translateTo", Security.CurrentUser); + pp_includeSubs.Text = ui.Text("translation","includeSubpages", Security.CurrentUser); + pp_comment.Text = ui.Text("comment", Security.CurrentUser); + pane_form.Text = ui.Text("translation", "sendToTranslate", _currentPage.Text, Security.CurrentUser); if (!IsPostBack) @@ -47,15 +47,15 @@ namespace umbraco.presentation.dialogs if (domains != null) { selectedLanguage = domains[0].Language.id; - defaultLanguage.Text = ui.Text("defaultLanguageIs", base.getUser()) + " " + domains[0].Language.FriendlyName; + defaultLanguage.Text = ui.Text("defaultLanguageIs", Security.CurrentUser) + " " + domains[0].Language.FriendlyName; } else { - defaultLanguage.Text = ui.Text("defaultLanguageIsNotAssigned", base.getUser()); + defaultLanguage.Text = ui.Text("defaultLanguageIsNotAssigned", Security.CurrentUser); } // languages - language.Items.Add(new ListItem(ui.Text("general", "choose", base.getUser()), "")); + language.Items.Add(new ListItem(ui.Text("general", "choose", Security.CurrentUser), "")); foreach (var l in cms.businesslogic.language.Language.getAll) { var li = new ListItem(); @@ -82,7 +82,7 @@ namespace umbraco.presentation.dialogs } // send button - doTranslation.Text = ui.Text("general", "ok", base.getUser()); + doTranslation.Text = ui.Text("general", "ok", Security.CurrentUser); } } @@ -97,7 +97,7 @@ namespace umbraco.presentation.dialogs // testing translate cms.businesslogic.translation.Translation.MakeNew( _currentPage, - getUser(), + UmbracoContext.UmbracoUser, BusinessLogic.User.GetUser(int.Parse(translator.SelectedValue)), new cms.businesslogic.language.Language(int.Parse(language.SelectedValue)), comment.Text, includeSubpages.Checked, @@ -106,7 +106,7 @@ namespace umbraco.presentation.dialogs pane_form.Visible = false; pl_buttons.Visible = false; - feedback.Text = ui.Text("translation","pageHasBeenSendToTranslation", _currentPage.Text, base.getUser()) + "

" + ui.Text("defaultdialogs", "closeThisWindow") + "

"; + feedback.Text = ui.Text("translation","pageHasBeenSendToTranslation", _currentPage.Text, Security.CurrentUser) + "

" + ui.Text("defaultdialogs", "closeThisWindow") + "

"; feedback.type = uicontrols.Feedback.feedbacktype.success; } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/sort.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/sort.aspx.cs index 1cf0a4e2bf..bf2c5a6242 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/sort.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/sort.aspx.cs @@ -1,18 +1,10 @@ using System; -using System.Collections; -using System.Globalization; using System.Linq; -using System.Web.UI.WebControls; -using System.Xml; using Umbraco.Core; using Umbraco.Web; -using umbraco.BasePages; -using umbraco.BusinessLogic.Actions; -using umbraco.cms.businesslogic; -using umbraco.cms.businesslogic.media; -using umbraco.cms.businesslogic.web; using System.Web.UI; using System.Collections.Generic; +using Umbraco.Web.UI.Pages; namespace umbraco.cms.presentation { diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/treePicker.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/treePicker.aspx.cs index 30f9fbb12d..5a98efdda0 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/treePicker.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/treePicker.aspx.cs @@ -13,7 +13,7 @@ using umbraco.cms.presentation.Trees; namespace umbraco.dialogs { [Obsolete("Use the TreeControl instead. This does however get used by the TreeService when requesting the tree init url.")] - public partial class treePicker : BasePages.UmbracoEnsuredPage + public partial class treePicker : Umbraco.Web.UI.Pages.UmbracoEnsuredPage { protected override void OnLoad(EventArgs e) { 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 8b61479375..3fd2144f56 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/umbracoField.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/umbracoField.aspx.cs @@ -20,7 +20,7 @@ namespace umbraco.dialogs /// /// Summary description for umbracoField. /// - public partial class umbracoField : BasePages.UmbracoEnsuredPage + public partial class umbracoField : Umbraco.Web.UI.Pages.UmbracoEnsuredPage { string[] preValuesSource = { "@createDate", "@creatorName", "@level", "@nodeType", "@nodeTypeAlias", "@pageID", "@pageName", "@parentID", "@path", "@template", "@updateDate", "@writerID", "@writerName" }; bool m_IsDictionaryMode = false; @@ -74,25 +74,23 @@ namespace umbraco.dialogs fieldPicker.StandardPropertiesLabel = ui.Text("templateEditor", "standardFields"); fieldPicker.CustomPropertiesLabel = ui.Text("templateEditor", "customFields"); - IRecordsReader dataTypes = SqlHelper.ExecuteReader(fieldSql); + var dataTypes = DatabaseContext.Database.Fetch(fieldSql); fieldPicker.DataTextField = "alias"; fieldPicker.DataValueField = "alias"; fieldPicker.DataSource = dataTypes; fieldPicker.DataBind(); fieldPicker.Attributes.Add("onChange", "document.forms[0].field.value = document.forms[0]." + fieldPicker.ClientID + "[document.forms[0]." + fieldPicker.ClientID + ".selectedIndex].value;"); - dataTypes.Close(); altFieldPicker.ChooseText = ui.Text("templateEditor", "chooseField"); altFieldPicker.StandardPropertiesLabel = ui.Text("templateEditor", "standardFields"); altFieldPicker.CustomPropertiesLabel = ui.Text("templateEditor", "customFields"); - IRecordsReader dataTypes2 = SqlHelper.ExecuteReader(fieldSql); + var dataTypes2 = DatabaseContext.Database.Fetch(fieldSql); altFieldPicker.DataTextField = "alias"; altFieldPicker.DataValueField = "alias"; altFieldPicker.DataSource = dataTypes2; altFieldPicker.DataBind(); altFieldPicker.Attributes.Add("onChange", "document.forms[0].useIfEmpty.value = document.forms[0]." + altFieldPicker.ClientID + "[document.forms[0]." + altFieldPicker.ClientID + ".selectedIndex].value;"); - dataTypes2.Close(); // Pre values if (!m_IsDictionaryMode) diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/viewAuditTrail.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/viewAuditTrail.aspx.cs index 65694366c8..205ef57f08 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/viewAuditTrail.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/viewAuditTrail.aspx.cs @@ -9,13 +9,14 @@ using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; using Umbraco.Core; +using Action = Umbraco.Web.LegacyActions.Action; namespace umbraco.presentation.umbraco.dialogs { /// /// Summary description for viewAuditTrail. /// - public partial class viewAuditTrail : BasePages.UmbracoEnsuredPage + public partial class viewAuditTrail : Umbraco.Web.UI.Pages.UmbracoEnsuredPage { public viewAuditTrail() { @@ -38,7 +39,7 @@ namespace umbraco.presentation.umbraco.dialogs action = action.ToLower(); if (action == "new") action = "create"; - ArrayList actions = BusinessLogic.Actions.Action.GetAll(); + ArrayList actions = Action.GetAll(); foreach (interfaces.IAction a in actions) { return ui.Text(action); diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/js/language.aspx b/src/Umbraco.Web/umbraco.presentation/umbraco/js/language.aspx deleted file mode 100644 index ce4cc6ede9..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/js/language.aspx +++ /dev/null @@ -1 +0,0 @@ -<%@ Page language="c#" Codebehind="language.aspx.cs" AutoEventWireup="True" Inherits="umbraco.js.language" %> diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/js/language.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/js/language.aspx.cs deleted file mode 100644 index 3d38d897d3..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/js/language.aspx.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System; -using System.Text; -using System.Xml; -using umbraco.BasePages; -using umbraco.BusinessLogic; - -namespace umbraco.js -{ - [Obsolete("This is no longer used and will be removed from the codebase in future versions")] - public partial class language : BasePage - { - protected void Page_Load(object sender, EventArgs e) - { - Response.ContentType = "application/json"; - string lang = "en"; - if(ValidateCurrentUser()){ - lang = UmbracoUser.Language; - } - - XmlDocument all = ui.getLanguageFile(lang); - - if(all == null) - return; - - StringBuilder sb = new StringBuilder(); - - foreach(XmlNode x in all.DocumentElement.ChildNodes) - { - if(x == null) - continue; - - for (int i = 0; i < x.ChildNodes.Count; i++) - { - sb.Append("\n"); - - XmlNode key = x.ChildNodes[i]; - if (key.FirstChild == null || string.IsNullOrEmpty(key.FirstChild.Value)) - continue; - - XmlNode n1 = x.Attributes.GetNamedItem("alias"); - if (n1 == null) - continue; - XmlNode n2 = key.Attributes.GetNamedItem("alias"); - if (n2 == null) - continue; - string _tempKey = string.Format("{0}_{1}", n1.Value, n2.Value); - - // we need to remove linie breaks as they can't break js - string tmpStr = key.FirstChild.Value.Replace("\\", "\\\\").Replace("\"", "'").Replace("\t", "").Replace("\r", "").Replace("\n", ""); - - sb.Append("\"" + _tempKey + "\": \"" + tmpStr + "\","); - - } - } - var f = "{" + sb.ToString().Trim().Trim(',').Trim() + "}"; - Response.Write(f); - } - - } -} \ No newline at end of file diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/js/language.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/js/language.aspx.designer.cs deleted file mode 100644 index 41417754ea..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/js/language.aspx.designer.cs +++ /dev/null @@ -1,15 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:2.0.50727.42 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace umbraco.js { - - public partial class language { - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/js/language.aspx.resx b/src/Umbraco.Web/umbraco.presentation/umbraco/js/language.aspx.resx deleted file mode 100644 index dd0ea4d8e3..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/js/language.aspx.resx +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.0.0.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/masterpages/umbracoPage.Master.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/masterpages/umbracoPage.Master.cs index 54d74bdbb0..9808326d84 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/masterpages/umbracoPage.Master.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/masterpages/umbracoPage.Master.cs @@ -9,6 +9,7 @@ using System.Web.UI.WebControls; //This is only in case an upgrade goes wrong and the the /masterpages/ files are not copied over //which would result in an error. so we have kept the old namespaces intact with references to new ones using StackExchange.Profiling; +using Umbraco.Core.Configuration; using Umbraco.Core.Profiling; using Umbraco.Web; using Umbraco.Web.UI.JavaScript; diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/members/EditMemberGroup.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/members/EditMemberGroup.aspx.cs index 860a71de33..ae547b5a93 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/members/EditMemberGroup.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/members/EditMemberGroup.aspx.cs @@ -14,13 +14,14 @@ using umbraco.cms.businesslogic.member; using umbraco.cms.presentation.Trees; using umbraco.uicontrols; using Umbraco.Core; +using Umbraco.Web.UI; namespace umbraco.presentation.members { /// /// Summary description for EditMemberGroup. /// - public partial class EditMemberGroup : BasePages.UmbracoEnsuredPage + public partial class EditMemberGroup : Umbraco.Web.UI.Pages.UmbracoEnsuredPage { public EditMemberGroup() { @@ -68,7 +69,7 @@ namespace umbraco.presentation.members _memberGroup.Text = NameTxt.Text; memberGroupName.Value = NameTxt.Text; _memberGroup.Save(); - this.ClientTools.ShowSpeechBubble(speechBubbleIcon.save, ui.Text("speechBubbles", "editMemberGroupSaved", base.getUser()),""); + this.ClientTools.ShowSpeechBubble(SpeechBubbleIcon.Save, ui.Text("speechBubbles", "editMemberGroupSaved", Security.CurrentUser),""); ClientTools .RefreshTree(TreeDefinitionCollection.Instance.FindTree().Tree.Alias); diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/members/ViewMembers.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/members/ViewMembers.aspx.cs index d48273247a..dfb993d724 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/members/ViewMembers.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/members/ViewMembers.aspx.cs @@ -9,7 +9,7 @@ using Umbraco.Core.Security; namespace umbraco.presentation.members { - public partial class ViewMembers : BasePages.UmbracoEnsuredPage + public partial class ViewMembers : Umbraco.Web.UI.Pages.UmbracoEnsuredPage { public ViewMembers() diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/members/search.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/members/search.aspx.cs index 70d85354b3..ccd096aea3 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/members/search.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/members/search.aspx.cs @@ -15,7 +15,7 @@ namespace umbraco.presentation.members { - public partial class search : BasePages.UmbracoEnsuredPage + public partial class search : Umbraco.Web.UI.Pages.UmbracoEnsuredPage { public search() { diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/publishStatus.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/publishStatus.aspx.cs index dcd6cdbd21..26cdd17453 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/publishStatus.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/publishStatus.aspx.cs @@ -16,7 +16,7 @@ namespace umbraco.cms.presentation /// Summary description for publishStatus. /// [Obsolete("This class is no longer used and will be removed from the codebase in future versions")] - public partial class publishStatus : BasePages.UmbracoEnsuredPage + public partial class publishStatus : Umbraco.Web.UI.Pages.UmbracoEnsuredPage { public publishStatus() { @@ -31,7 +31,7 @@ namespace umbraco.cms.presentation if (library.IsPublishing) { Panel1.Controls.Add(new LiteralControl("Der er nu publiseret " + library.NodesPublished.ToString() + " ud af " + totalNodes.ToString() + " noder...")); - base.RefreshPage(2); + ClientTools.RefreshAdmin(2); } else Panel1.Controls.Add(new LiteralControl("Færdig. Der er ialt publiseret " + library.NodesPublished.ToString() + " noder og det tog " + ((long)((System.DateTime.Now.Ticks - library.PublishStart.Ticks) / 10000000)).ToString() + " sekunder...")); diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/DictionaryItemList.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/DictionaryItemList.aspx.cs index 55fb6c417f..027ed98024 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/DictionaryItemList.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/DictionaryItemList.aspx.cs @@ -6,7 +6,7 @@ using Umbraco.Core; namespace umbraco.presentation.settings { [WebformsPageTreeAuthorize(Constants.Trees.Dictionary)] - public partial class DictionaryItemList : BasePages.UmbracoEnsuredPage { + public partial class DictionaryItemList : Umbraco.Web.UI.Pages.UmbracoEnsuredPage { private readonly cms.businesslogic.language.Language[] _languages = cms.businesslogic.language.Language.getAll; diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/EditDictionaryItem.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/EditDictionaryItem.aspx.cs index 6b9680864a..84d99d42ff 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/EditDictionaryItem.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/EditDictionaryItem.aspx.cs @@ -11,6 +11,7 @@ using System.Web.UI.HtmlControls; using umbraco.cms.presentation.Trees; using Umbraco.Core; using Umbraco.Core.IO; +using Umbraco.Web.UI; namespace umbraco.settings { @@ -18,7 +19,7 @@ namespace umbraco.settings /// Summary description for EditDictionaryItem. /// [WebformsPageTreeAuthorize(Constants.Trees.Dictionary)] - public partial class EditDictionaryItem : BasePages.UmbracoEnsuredPage + public partial class EditDictionaryItem : Umbraco.Web.UI.Pages.UmbracoEnsuredPage { protected LiteralControl keyTxt = new LiteralControl(); @@ -44,7 +45,7 @@ namespace umbraco.settings save.ButtonType = uicontrols.MenuButtonType.Primary; Literal txt = new Literal(); - txt.Text = "

" + ui.Text("dictionaryItem", "description", currentItem.key, base.getUser()) + "


"; + txt.Text = "

" + ui.Text("dictionaryItem", "description", currentItem.key, Security.CurrentUser) + "


"; p.addProperty(txt); foreach (cms.businesslogic.language.Language l in cms.businesslogic.language.Language.getAll) @@ -92,7 +93,7 @@ namespace umbraco.settings currentItem.setValue(int.Parse(t.ID),t.Text); } } - ClientTools.ShowSpeechBubble(speechBubbleIcon.save, ui.Text("speechBubbles", "dictionaryItemSaved"), ""); + ClientTools.ShowSpeechBubble(SpeechBubbleIcon.Save, ui.Text("speechBubbles", "dictionaryItemSaved"), ""); } #region Web Form Designer generated code override protected void OnInit(EventArgs e) diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/editLanguage.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/editLanguage.aspx.cs index 73c11643a9..175eacbbab 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/editLanguage.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/editLanguage.aspx.cs @@ -13,6 +13,7 @@ using umbraco.cms.presentation.Trees; using Umbraco.Core; using Umbraco.Web; using Umbraco.Web.Trees; +using Umbraco.Web.UI; namespace umbraco.settings { @@ -20,7 +21,7 @@ namespace umbraco.settings /// Summary description for editLanguage. /// [WebformsPageTreeAuthorize(Constants.Trees.Languages)] - public partial class editLanguage : BasePages.UmbracoEnsuredPage + public partial class editLanguage : Umbraco.Web.UI.Pages.UmbracoEnsuredPage { public editLanguage() { @@ -38,7 +39,7 @@ namespace umbraco.settings // Put user code to initialize the page here Panel1.Text = ui.Text("editlanguage"); - pp_language.Text = ui.Text("language", "displayName", base.getUser()); + pp_language.Text = ui.Text("language", "displayName", Security.CurrentUser); if (!IsPostBack) { updateCultureList(); @@ -75,7 +76,7 @@ namespace umbraco.settings currentLanguage.Save(); updateCultureList(); - ClientTools.ShowSpeechBubble(speechBubbleIcon.save, ui.Text("speechBubbles", "languageSaved"), ""); + ClientTools.ShowSpeechBubble(SpeechBubbleIcon.Save, ui.Text("speechBubbles", "languageSaved"), ""); } #region Web Form Designer generated code 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 d8b56c94b3..a4692f57e4 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/editTemplate.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/editTemplate.aspx.cs @@ -6,7 +6,6 @@ using System.Web.UI.WebControls; using Umbraco.Core; using Umbraco.Core.Configuration; using Umbraco.Core.IO; -using umbraco.BasePages; using umbraco.BusinessLogic; using umbraco.cms.businesslogic.template; @@ -14,6 +13,7 @@ using umbraco.cms.presentation.Trees; using umbraco.DataLayer; using umbraco.uicontrols; using System.Linq; +using Umbraco.Web.UI.Pages; namespace umbraco.cms.presentation.settings { @@ -112,7 +112,7 @@ namespace umbraco.cms.presentation.settings // Editing buttons MenuIconI umbField = editorSource.Menu.NewIcon(); - umbField.ImageURL = UmbracoPath + "/images/editor/insField.gif"; + umbField.ImageURL = SystemDirectories.Umbraco + "/images/editor/insField.gif"; umbField.OnClickCommand = ClientTools.Scripts.OpenModalWindow( IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/dialogs/umbracoField.aspx?objectId=" + @@ -135,7 +135,7 @@ namespace umbraco.cms.presentation.settings if (UmbracoConfig.For.UmbracoSettings().Templates.UseAspNetMasterPages) { MenuIconI umbContainer = editorSource.Menu.NewIcon(); - umbContainer.ImageURL = UmbracoPath + "/images/editor/masterpagePlaceHolder.gif"; + umbContainer.ImageURL = SystemDirectories.Umbraco + "/images/editor/masterpagePlaceHolder.gif"; umbContainer.AltText = ui.Text("template", "insertContentAreaPlaceHolder"); umbContainer.OnClickCommand = ClientTools.Scripts.OpenModalWindow( @@ -144,7 +144,7 @@ namespace umbraco.cms.presentation.settings ui.Text("template", "insertContentAreaPlaceHolder"), 470, 320); MenuIconI umbContent = editorSource.Menu.NewIcon(); - umbContent.ImageURL = UmbracoPath + "/images/editor/masterpageContent.gif"; + umbContent.ImageURL = SystemDirectories.Umbraco + "/images/editor/masterpageContent.gif"; umbContent.AltText = ui.Text("template", "insertContentArea"); umbContent.OnClickCommand = ClientTools.Scripts.OpenModalWindow( @@ -165,7 +165,7 @@ namespace umbraco.cms.presentation.settings ClientTools.Scripts.OpenModalWindow( IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/settings/modals/showumbracotags.aspx?alias=" + _template.Alias, ui.Text("template", "quickGuide"), 600, 580); - helpIcon.ImageURL = UmbracoPath + "/images/editor/help.png"; + helpIcon.ImageURL = SystemDirectories.Umbraco + "/images/editor/help.png"; helpIcon.AltText = ui.Text("template", "quickGuide"); } @@ -198,19 +198,17 @@ namespace umbraco.cms.presentation.settings private void LoadMacros() { - IRecordsReader macroRenderings = - SqlHelper.ExecuteReader("select id, macroAlias, macroName from cmsMacro order by macroName"); + var macroRenderings = + DatabaseContext.Database.Fetch("select id, macroAlias, macroName from cmsMacro order by macroName"); rpt_macros.DataSource = macroRenderings; rpt_macros.DataBind(); - - macroRenderings.Close(); } public string DoesMacroHaveSettings(string macroId) { if ( - SqlHelper.ExecuteScalar(string.Format("select 1 from cmsMacroProperty where macro = {0}", macroId)) == + DatabaseContext.Database.ExecuteScalar(string.Format("select 1 from cmsMacroProperty where macro = {0}", macroId)) == 1) return "1"; else diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/modals/ShowUmbracoTags.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/modals/ShowUmbracoTags.aspx.cs index d69e97d939..0938a1a377 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/modals/ShowUmbracoTags.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/modals/ShowUmbracoTags.aspx.cs @@ -16,7 +16,7 @@ namespace umbraco.cms.presentation.settings.modal /// /// Summary description for ShowUmbracoTags. /// - public partial class ShowUmbracoTags : BasePages.UmbracoEnsuredPage + public partial class ShowUmbracoTags : Umbraco.Web.UI.Pages.UmbracoEnsuredPage { public ShowUmbracoTags() 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 12f9eee317..4432223561 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 @@ -19,7 +19,7 @@ using umbraco.uicontrols; namespace umbraco.cms.presentation.settings.scripts { - public partial class editScript : BasePages.UmbracoEnsuredPage + public partial class editScript : Umbraco.Web.UI.Pages.UmbracoEnsuredPage { public editScript() { @@ -67,9 +67,9 @@ namespace umbraco.cms.presentation.settings.scripts // name derives from filename, clean for xss NameTxt.Text = filename.CleanForXss('\\', '/'); - Panel1.Text = ui.Text("editscript", base.getUser()); - pp_name.Text = ui.Text("name", base.getUser()); - pp_path.Text = ui.Text("path", base.getUser()); + Panel1.Text = ui.Text("editscript", Security.CurrentUser); + pp_name.Text = ui.Text("name", Security.CurrentUser); + pp_path.Text = ui.Text("path", Security.CurrentUser); if (IsPostBack == false) { @@ -110,27 +110,27 @@ namespace umbraco.cms.presentation.settings.scripts // Editing buttons Panel1.Menu.InsertSplitter(); uicontrols.MenuIconI umbField = Panel1.Menu.NewIcon(); - umbField.ImageURL = UmbracoPath + "/images/editor/insField.gif"; - umbField.OnClickCommand = BasePages.ClientTools.Scripts.OpenModalWindow(IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/dialogs/umbracoField.aspx?objectId=" + editorSource.ClientID + "&tagName=UMBRACOGETDATA", ui.Text("template", "insertPageField"), 640, 550); + umbField.ImageURL = SystemDirectories.Umbraco + "/images/editor/insField.gif"; + umbField.OnClickCommand = Umbraco.Web.UI.Pages.ClientTools.Scripts.OpenModalWindow(IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/dialogs/umbracoField.aspx?objectId=" + editorSource.ClientID + "&tagName=UMBRACOGETDATA", ui.Text("template", "insertPageField"), 640, 550); umbField.AltText = ui.Text("template", "insertPageField"); // TODO: Update icon uicontrols.MenuIconI umbDictionary = Panel1.Menu.NewIcon(); umbDictionary.ImageURL = GlobalSettings.Path + "/images/editor/dictionaryItem.gif"; - umbDictionary.OnClickCommand = BasePages.ClientTools.Scripts.OpenModalWindow(IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/dialogs/umbracoField.aspx?objectId=" + editorSource.ClientID + "&tagName=UMBRACOGETDICTIONARY", ui.Text("template", "insertDictionaryItem"), 640, 550); + umbDictionary.OnClickCommand = Umbraco.Web.UI.Pages.ClientTools.Scripts.OpenModalWindow(IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/dialogs/umbracoField.aspx?objectId=" + editorSource.ClientID + "&tagName=UMBRACOGETDICTIONARY", ui.Text("template", "insertDictionaryItem"), 640, 550); umbDictionary.AltText = "Insert umbraco dictionary item"; uicontrols.MenuIconI umbMacro = Panel1.Menu.NewIcon(); - umbMacro.ImageURL = UmbracoPath + "/images/editor/insMacro.gif"; + umbMacro.ImageURL = SystemDirectories.Umbraco + "/images/editor/insMacro.gif"; umbMacro.AltText = ui.Text("template", "insertMacro"); - umbMacro.OnClickCommand = BasePages.ClientTools.Scripts.OpenModalWindow(IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/dialogs/editMacro.aspx?objectId=" + editorSource.ClientID, ui.Text("template", "insertMacro"), 470, 530); + umbMacro.OnClickCommand = Umbraco.Web.UI.Pages.ClientTools.Scripts.OpenModalWindow(IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/dialogs/editMacro.aspx?objectId=" + editorSource.ClientID, ui.Text("template", "insertMacro"), 470, 530); // Help Panel1.Menu.InsertSplitter(); uicontrols.MenuIconI helpIcon = Panel1.Menu.NewIcon(); - helpIcon.OnClickCommand = umbraco.BasePages.ClientTools.Scripts.OpenModalWindow(Umbraco.Core.IO.IOHelper.ResolveUrl(Umbraco.Core.IO.SystemDirectories.Umbraco) + "/settings/modals/showumbracotags.aspx?alias=", ui.Text("template", "quickGuide"), 600, 580); - helpIcon.ImageURL = UmbracoPath + "/images/editor/help.png"; + helpIcon.OnClickCommand = Umbraco.Web.UI.Pages.ClientTools.Scripts.OpenModalWindow(Umbraco.Core.IO.IOHelper.ResolveUrl(Umbraco.Core.IO.SystemDirectories.Umbraco) + "/settings/modals/showumbracotags.aspx?alias=", ui.Text("template", "quickGuide"), 600, 580); + helpIcon.ImageURL = SystemDirectories.Umbraco + "/images/editor/help.png"; helpIcon.AltText = ui.Text("template", "quickGuide"); } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/stylesheet/editstylesheet.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/stylesheet/editstylesheet.aspx.cs index 4cb321ae0a..dcc2409e61 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/stylesheet/editstylesheet.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/stylesheet/editstylesheet.aspx.cs @@ -4,12 +4,12 @@ using System.Linq; using System.Web.UI; using Umbraco.Core.IO; using Umbraco.Web; -using umbraco.BasePages; using umbraco.BusinessLogic; using umbraco.cms.businesslogic.web; using umbraco.cms.presentation.Trees; using umbraco.uicontrols; using Umbraco.Core; +using Umbraco.Web.UI.Pages; namespace umbraco.cms.presentation.settings.stylesheet { diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/stylesheet/property/EditStyleSheetProperty.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/stylesheet/property/EditStyleSheetProperty.aspx.cs index 6836376837..a44ddf466f 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/settings/stylesheet/property/EditStyleSheetProperty.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/settings/stylesheet/property/EditStyleSheetProperty.aspx.cs @@ -15,13 +15,14 @@ using Umbraco.Core; using Umbraco.Web; using umbraco.cms.presentation.Trees; using Umbraco.Core; +using Umbraco.Web.UI; namespace umbraco.cms.presentation.settings.stylesheet { /// /// Summary description for EditStyleSheetProperty. /// - public partial class EditStyleSheetProperty : BasePages.UmbracoEnsuredPage + public partial class EditStyleSheetProperty : Umbraco.Web.UI.Pages.UmbracoEnsuredPage { public EditStyleSheetProperty() { @@ -97,7 +98,7 @@ namespace umbraco.cms.presentation.settings.stylesheet Services.FileService.SaveStylesheet(_sheet); - ClientTools.ShowSpeechBubble(speechBubbleIcon.save, ui.Text("speechBubbles", "editStylesheetPropertySaved", UmbracoUser), ""); + ClientTools.ShowSpeechBubble(SpeechBubbleIcon.Save, ui.Text("speechBubbles", "editStylesheetPropertySaved", UmbracoUser), ""); } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Item.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Item.cs index 6d0465f693..fa76f9aa17 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Item.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Item.cs @@ -5,7 +5,8 @@ using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Umbraco.Core.Models; -using umbraco.BusinessLogic.Actions; +using Umbraco.Web; +using Umbraco.Web.LegacyActions; namespace umbraco.presentation.templateControls { @@ -302,8 +303,8 @@ namespace umbraco.presentation.templateControls /// /// true if the current item is editable by the current user; otherwise, false. protected virtual bool FieldEditableWithUserPermissions() - { - BusinessLogic.User u = helper.GetCurrentUmbracoUser(); + { + BusinessLogic.User u = UmbracoContext.Current.UmbracoUser; return u != null && u.GetPermissions(PageElements["path"].ToString()).Contains(ActionUpdate.Instance.Letter.ToString()); } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Macro.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Macro.cs index 5c86c3a4da..ad9cc6bed3 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Macro.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Macro.cs @@ -6,6 +6,7 @@ using System.Web.UI.WebControls; using System.Collections; using umbraco.cms.businesslogic.macro; using System.Web; +using Umbraco.Core.Configuration; using Umbraco.Core.Models; using Umbraco.Web; 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 9dff5305b4..62e2a91593 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/default.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/translation/default.aspx.cs @@ -1,29 +1,14 @@ using System; using System.Data; -using System.Globalization; using System.IO; using System.Text; using System.Xml; using Umbraco.Core; -using Umbraco.Core.Configuration; -using Umbraco.Core.Models.EntityBase; -using Umbraco.Web; -using umbraco.BasePages; -using umbraco.BusinessLogic; -using umbraco.BusinessLogic.Actions; -using umbraco.cms.businesslogic.propertytype; using umbraco.cms.businesslogic.task; -using umbraco.cms.businesslogic.translation; //using umbraco.cms.businesslogic.utilities; -using umbraco.cms.businesslogic.web; - -using ICSharpCode.SharpZipLib.BZip2; -using ICSharpCode.SharpZipLib.Zip; -using ICSharpCode.SharpZipLib.Zip.Compression; -using ICSharpCode.SharpZipLib.Zip.Compression.Streams; -using ICSharpCode.SharpZipLib.GZip; using Umbraco.Core.IO; using System.Collections.Generic; +using Umbraco.Web.UI.Pages; namespace umbraco.presentation.translation { @@ -54,13 +39,13 @@ namespace umbraco.presentation.translation Tasks ts = new Tasks(); if (Request["mode"] == "owned") { - ts = Task.GetOwnedTasks(base.getUser(), false); + ts = Task.GetOwnedTasks(UmbracoContext.UmbracoUser, false); pane_tasks.Text = ui.Text("translation", "ownedTasks"); Panel2.Text = ui.Text("translation", "ownedTasks"); } else { - ts = Task.GetTasks(base.getUser(), false); + ts = Task.GetTasks(UmbracoContext.UmbracoUser, false); pane_tasks.Text = ui.Text("translation", "assignedTasks"); Panel2.Text = ui.Text("translation", "assignedTasks"); } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/details.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/translation/details.aspx.cs index ee3df0cc43..ff27556053 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/details.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/translation/details.aspx.cs @@ -1,28 +1,12 @@ using System; using System.Data; -using System.IO; -using System.Text; -using System.Xml; -using System.Web; -using System.Web.UI; using System.Web.UI.WebControls; - -using umbraco.BasePages; -using umbraco.BusinessLogic; -using umbraco.cms.businesslogic.propertytype; using umbraco.cms.businesslogic.task; -using umbraco.cms.businesslogic.translation; using umbraco.cms.businesslogic.web; - -using ICSharpCode.SharpZipLib.BZip2; -using ICSharpCode.SharpZipLib.Zip; -using ICSharpCode.SharpZipLib.Zip.Compression; -using ICSharpCode.SharpZipLib.Zip.Compression.Streams; -using ICSharpCode.SharpZipLib.GZip; using Umbraco.Core; namespace umbraco.presentation.umbraco.translation { - public partial class details : BasePages.UmbracoEnsuredPage { + public partial class details : Umbraco.Web.UI.Pages.UmbracoEnsuredPage { public details() { @@ -33,7 +17,7 @@ namespace umbraco.presentation.umbraco.translation { int translationId = int.Parse(Request["id"]); Task t = new Task(translationId); - if (t != null && (t.ParentUser.Id == base.getUser().Id || t.User.Id == base.getUser().Id)) { + if (t != null && (t.ParentUser.Id == Security.CurrentUser.Id || t.User.Id == Security.CurrentUser.Id)) { t.Closed = true; t.Save(); Response.Redirect("default.aspx"); diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/preview.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/translation/preview.aspx.cs index 25808f1814..457e2eb5f9 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/preview.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/translation/preview.aspx.cs @@ -17,7 +17,7 @@ using Umbraco.Web; namespace umbraco.presentation.translation { - public partial class preview : BasePages.UmbracoEnsuredPage + public partial class preview : Umbraco.Web.UI.Pages.UmbracoEnsuredPage { public string originalUrl = ""; public string translatedUrl = ""; 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 5ebdd61861..d59c634006 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/translation/xml.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/translation/xml.aspx.cs @@ -20,7 +20,7 @@ using Umbraco.Core.IO; namespace umbraco.presentation.translation { - public partial class xml : BasePages.UmbracoEnsuredPage + public partial class xml : Umbraco.Web.UI.Pages.UmbracoEnsuredPage { private readonly XmlDocument _xd = new XmlDocument(); @@ -39,7 +39,7 @@ namespace umbraco.presentation.translation if (int.TryParse(Request["id"], out pageId)) { var t = new Task(pageId); - if (t.User.Id == base.getUser().Id || t.ParentUser.Id == base.getUser().Id) + if (t.User.Id == Security.CurrentUser.Id || t.ParentUser.Id == Security.CurrentUser.Id) { XmlNode x = CreateTaskNode(t, _xd); root.AppendChild(x); @@ -54,7 +54,7 @@ namespace umbraco.presentation.translation var nodes = new SortedList(); int totalWords = 0; - foreach (Task t in Task.GetTasks(base.getUser(), false)) + foreach (Task t in Task.GetTasks(UmbracoContext.UmbracoUser, false)) { if (!nodes.ContainsKey(t.Node.Path)) { diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/tree.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/tree.aspx.cs deleted file mode 100644 index 9a620dbba6..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/tree.aspx.cs +++ /dev/null @@ -1,127 +0,0 @@ -using System; -using System.Collections; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Web; -using System.Web.SessionState; -using System.Web.UI; -using System.Web.UI.WebControls; -using System.Web.UI.HtmlControls; -using System.Xml; - -using System.Reflection; -using umbraco.DataLayer; -using umbraco.cms.presentation.Trees; -using umbraco.BusinessLogic.Utils; -using umbraco.interfaces; -using umbraco.BusinessLogic; - -using System.Collections.Generic; - -namespace umbraco.cms.presentation -{ - - /// - /// This still outputs the xml format of the tree in case developers are using it. - /// - [Obsolete("this is no longer used for the client side tree")] - public partial class tree : umbraco.BasePages.UmbracoEnsuredPage - { - - private XmlTree m_xTree = new XmlTree(); - TreeRequestParams m_treeParams = TreeRequestParams.FromQueryStrings(); - - /// - /// This checks to see which request parameters have been set for the Tree xml service - /// to run. If there is no Tree Type specified, then this will return the xml structure - /// of the initial tree nodes for all trees required for the current application. Otherwise - /// this will return thre required tree xml based on the request parameters specified. - /// - /// - /// - protected void Page_Load(object sender, System.EventArgs e) - { - - if (string.IsNullOrEmpty(m_treeParams.TreeType)) - if (!string.IsNullOrEmpty(m_treeParams.Application)) - LoadAppTrees(m_treeParams.Application); - else - LoadNullTree(); - else - LoadTree(m_treeParams.TreeType); - - Response.Write(m_xTree.ToString(SerializedTreeType.XmlTree)); - } - - /// - /// If the application supports multiple trees, then this function iterates over all of the trees assigned to it - /// and creates their top level nodes and context menus. - /// - /// - private void LoadAppTrees(string appAlias) - { - //find all tree definitions that have the current application alias - List treeDefs = TreeDefinitionCollection.Instance.FindActiveTrees(appAlias); - - foreach (TreeDefinition treeDef in treeDefs) - { - BaseTree bTree = treeDef.CreateInstance(); - bTree.SetTreeParameters(m_treeParams); - m_xTree.Add(bTree.RootNode); - } - } - - /// - /// This will load the particular ITree object and call it's render method to get the nodes that need to be rendered. - /// - /// - /// - private void LoadTree(string treeAlias) - { - - TreeDefinition treeDef = TreeDefinitionCollection.Instance.FindTree(treeAlias); - - if (treeDef != null) - { - BaseTree bTree = treeDef.CreateInstance(); - bTree.SetTreeParameters(m_treeParams); - bTree.Render(ref m_xTree); - } - else - LoadNullTree(); - } - - /// - /// Load an empty tree structure to show the end user that there was a problem loading the tree. - /// - private void LoadNullTree() - { - BaseTree nullTree = new NullTree(m_treeParams.Application); - nullTree.SetTreeParameters(m_treeParams); - nullTree.Render(ref m_xTree); - } - - #region Web Form Designer generated code - override protected void OnInit(EventArgs e) - { - // - // CODEGEN: This call is required by the ASP.NET Web Form Designer. - // - InitializeComponent(); - base.OnInit(e); - } - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - - } - #endregion - } - - -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/treeInit.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/treeInit.aspx.cs deleted file mode 100644 index a8921f2394..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/treeInit.aspx.cs +++ /dev/null @@ -1,87 +0,0 @@ -using System; -using System.Data; -using System.Reflection; -using System.Text; -using System.Web.UI; -using System.Web.UI.WebControls; -using umbraco.BasePages; -using umbraco.cms.businesslogic; -using umbraco.interfaces; -using umbraco.DataLayer; -using umbraco.cms.presentation.Trees; -using System.Collections.Generic; -using System.Web; -using umbraco.BusinessLogic.Actions; -using System.Web.Services; -using Umbraco.Web.UI.JavaScript; - -namespace umbraco.cms.presentation -{ - [Obsolete("This class is no longer used and will be removed in future versions. The page that supercedes this is Umbraco.Web.UI.Umbraco.TreeInit")] - public partial class TreeInit : UmbracoEnsuredPage - { - - protected override void OnLoad(EventArgs e) - { - base.OnLoad(e); - TreeParams = TreeRequestParams.FromQueryStrings().CreateTreeService(); - DataBind(); - } - - protected TreeService TreeParams { get; private set; } - - /// - /// Head1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.HtmlControls.HtmlHead Head1; - - /// - /// ClientLoader control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected 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; - - /// - /// 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; - - /// - /// ScriptManager1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.ScriptManager ScriptManager1; - - /// - /// JTree control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::umbraco.controls.Tree.TreeControl JTree; - } -} \ No newline at end of file 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 c0e20cd99a..481e0705cd 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/users/EditUser.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/users/EditUser.aspx.cs @@ -1,29 +1,24 @@ using System; -using System.Collections; using System.Configuration.Provider; using System.Globalization; -using System.IO; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; -using System.Xml; using Umbraco.Core.Configuration; using Umbraco.Core.Logging; using Umbraco.Web; using Umbraco.Web.Security; -using umbraco.BasePages; using umbraco.BusinessLogic; -using umbraco.cms.businesslogic.web; using umbraco.controls; using umbraco.uicontrols; using umbraco.cms.presentation.Trees; using Umbraco.Core.IO; using Umbraco.Core; using Umbraco.Core.Models; -using Umbraco.Core.Services; -using PropertyType = umbraco.cms.businesslogic.propertytype.PropertyType; +using Umbraco.Web.UI; +using Umbraco.Web.UI.Pages; namespace umbraco.cms.presentation.user { @@ -78,13 +73,13 @@ namespace umbraco.cms.presentation.user u = BusinessLogic.User.GetUser(UID); //the true admin can only edit the true admin - if (u.Id == 0 && CurrentUser.Id != 0) + if (u.Id == 0 && Security.CurrentUser.Id != 0) { throw new Exception("Only the root user can edit the 'root' user (id:0)"); } //only another admin can edit another admin (who is not the true admin) - if (u.IsAdmin() && CurrentUser.IsAdmin() == false) + if (u.IsAdmin() && UmbracoContext.UmbracoUser.IsAdmin() == false) { throw new Exception("Admin users can only be edited by admins"); } @@ -92,7 +87,7 @@ namespace umbraco.cms.presentation.user // Populate usertype list foreach (UserType ut in UserType.getAll) { - if (CurrentUser.IsAdmin() || ut.Alias != "admin") + if (UmbracoContext.UmbracoUser.IsAdmin() || ut.Alias != "admin") { ListItem li = new ListItem(ui.Text("user", ut.Name.ToLower(), UmbracoUser), ut.Id.ToString()); if (ut.Id == u.UserType.Id) @@ -245,13 +240,13 @@ namespace umbraco.cms.presentation.user // get the current users applications string currentUserApps = ";"; - foreach (Application a in CurrentUser.Applications) - currentUserApps += a.alias + ";"; + foreach (var a in Security.CurrentUser.AllowedSections) + currentUserApps += a + ";"; Application[] uapps = u.Applications; foreach (Application app in BusinessLogic.Application.getAll()) { - if (CurrentUser.IsAdmin() || currentUserApps.Contains(";" + app.alias + ";")) + if (UmbracoContext.UmbracoUser.IsAdmin() || currentUserApps.Contains(";" + app.alias + ";")) { ListItem li = new ListItem(ui.Text("sections", app.alias), app.alias); if (!IsPostBack) foreach (Application tmp in uapps) if (app.alias == tmp.alias) li.Selected = true; @@ -386,17 +381,17 @@ namespace umbraco.cms.presentation.user u.Save(); - ClientTools.ShowSpeechBubble(speechBubbleIcon.save, ui.Text("speechBubbles", "editUserSaved", UmbracoUser), ""); + ClientTools.ShowSpeechBubble(SpeechBubbleIcon.Save, ui.Text("speechBubbles", "editUserSaved", UmbracoUser), ""); } catch (Exception ex) { - ClientTools.ShowSpeechBubble(speechBubbleIcon.error, ui.Text("speechBubbles", "editUserError", UmbracoUser), ""); + ClientTools.ShowSpeechBubble(SpeechBubbleIcon.Error, ui.Text("speechBubbles", "editUserError", UmbracoUser), ""); LogHelper.Error("Exception", ex); } } else { - ClientTools.ShowSpeechBubble(speechBubbleIcon.error, ui.Text("speechBubbles", "editUserError", UmbracoUser), ""); + ClientTools.ShowSpeechBubble(SpeechBubbleIcon.Error, ui.Text("speechBubbles", "editUserError", UmbracoUser), ""); } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/users/EditUserType.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/users/EditUserType.aspx.cs index 8b90630f48..3bb71b88cb 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/users/EditUserType.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/users/EditUserType.aspx.cs @@ -1,22 +1,13 @@ using System; -using System.Data; -using System.Configuration; -using System.Collections; -using System.Web; -using System.Web.Security; -using System.Web.UI; using System.Web.UI.WebControls; -using System.Web.UI.WebControls.WebParts; -using System.Web.UI.HtmlControls; -using umbraco.BasePages; using System.Collections.Generic; using umbraco.interfaces; -using umbraco.BusinessLogic.Actions; using umbraco.BusinessLogic; -using umbraco.uicontrols; using umbraco.cms.presentation.Trees; using Umbraco.Core; -using Umbraco.Core.IO; +using Umbraco.Web.UI; +using Umbraco.Web.UI.Pages; +using Action = Umbraco.Web.LegacyActions.Action; namespace umbraco.cms.presentation.user { @@ -28,7 +19,7 @@ namespace umbraco.cms.presentation.user } protected void Page_Load(object sender, EventArgs e) { - pnlUmbraco.Text = umbraco.ui.Text("usertype", base.getUser()); + pnlUmbraco.Text = umbraco.ui.Text("usertype", Security.CurrentUser); var save = pnlUmbraco.Menu.NewButton(); save.Click += save_Click; @@ -36,10 +27,10 @@ namespace umbraco.cms.presentation.user save.ToolTip = ui.Text("save"); save.Text = ui.Text("save"); - pp_alias.Text = umbraco.ui.Text("usertype", base.getUser()) + " " + umbraco.ui.Text("alias", base.getUser()); - pp_name.Text = umbraco.ui.Text("usertype", base.getUser()) + " " + umbraco.ui.Text("name", base.getUser()); + pp_alias.Text = umbraco.ui.Text("usertype", Security.CurrentUser) + " " + umbraco.ui.Text("alias", Security.CurrentUser); + pp_name.Text = umbraco.ui.Text("usertype", Security.CurrentUser) + " " + umbraco.ui.Text("name", Security.CurrentUser); - pp_rights.Text = umbraco.ui.Text("default", base.getUser()) + " " + umbraco.ui.Text("rights", base.getUser()); + pp_rights.Text = umbraco.ui.Text("default", Security.CurrentUser) + " " + umbraco.ui.Text("rights", Security.CurrentUser); //ensure we have a query string if (string.IsNullOrEmpty(Request.QueryString["id"])) @@ -73,7 +64,7 @@ namespace umbraco.cms.presentation.user userType.DefaultPermissions = actions; userType.Save(); - ClientTools.ShowSpeechBubble(speechBubbleIcon.save, ui.Text("speechBubbles", "editUserTypeSaved", base.getUser()), ""); + ClientTools.ShowSpeechBubble(SpeechBubbleIcon.Save, ui.Text("speechBubbles", "editUserTypeSaved", Security.CurrentUser), ""); } protected List CurrentUserTypeActions @@ -81,7 +72,7 @@ namespace umbraco.cms.presentation.user get { if (m_userTypeActions == null) - m_userTypeActions = umbraco.BusinessLogic.Actions.Action.FromString(CurrentUserType.DefaultPermissions); + m_userTypeActions = Action.FromString(CurrentUserType.DefaultPermissions); return m_userTypeActions; } } @@ -105,9 +96,9 @@ namespace umbraco.cms.presentation.user txtUserTypeName.Text = CurrentUserType.Name; hidUserTypeID.Value = CurrentUserType.Id.ToString(); - foreach (IAction ai in global::umbraco.BusinessLogic.Actions.Action.GetPermissionAssignable()) { + foreach (IAction ai in Action.GetPermissionAssignable()) { - ListItem li = new ListItem(umbraco.ui.Text(ai.Alias, base.getUser()), ai.Letter.ToString()); + ListItem li = new ListItem(umbraco.ui.Text(ai.Alias, Security.CurrentUser), ai.Letter.ToString()); if(CurrentUserTypeActions.Contains(ai)) li.Selected = true; diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/users/NodePermissions.ascx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/users/NodePermissions.ascx.cs index 26a601a9ac..68ca5f1440 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/users/NodePermissions.ascx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/users/NodePermissions.ascx.cs @@ -1,19 +1,10 @@ using System; -using System.Data; -using System.Configuration; -using System.Collections; -using System.Web; -using System.Web.Security; -using System.Web.UI; -using System.Web.UI.WebControls; -using System.Web.UI.WebControls.WebParts; -using System.Web.UI.HtmlControls; -using umbraco.BusinessLogic.Actions; using System.Collections.Generic; using umbraco.interfaces; -using System.Drawing; using umbraco.BusinessLogic; -using umbraco.BasePages; +using Umbraco.Web; +using Umbraco.Web.LegacyActions; +using Action = Umbraco.Web.LegacyActions.Action; namespace umbraco.cms.presentation.user { @@ -78,7 +69,7 @@ namespace umbraco.cms.presentation.user throw new ArgumentNullException("No User specified"); //get the logged in user's permissions - UserPermissions currUserPermissions = new UserPermissions(UmbracoEnsuredPage.CurrentUser); + UserPermissions currUserPermissions = new UserPermissions(UmbracoContext.Current.UmbracoUser); //lookup permissions for last node selected int selectedNodeId = m_nodeID[m_nodeID.Length - 1]; @@ -86,7 +77,7 @@ namespace umbraco.cms.presentation.user List lstCurrUserActions = currUserPermissions.GetExistingNodePermission(selectedNodeId); List lstLookupUserActions = m_userPermissions.GetExistingNodePermission(selectedNodeId); - List lstAllActions = umbraco.BusinessLogic.Actions.Action.GetPermissionAssignable(); + List lstAllActions = Action.GetPermissionAssignable(); //no node is selected, disable the check boxes if (m_nodeID[0] == -1) diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/users/PermissionEditor.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/users/PermissionEditor.aspx.cs index 27157f38d6..b4e49308f5 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/users/PermissionEditor.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/users/PermissionEditor.aspx.cs @@ -1,25 +1,10 @@ using System; -using System.Data; -using System.Configuration; -using System.Collections; -using System.Web; -using System.Web.Security; using System.Web.UI; -using System.Web.UI.WebControls; -using System.Web.UI.WebControls.WebParts; -using System.Web.UI.HtmlControls; -using System.Xml; -using System.IO; using Umbraco.Core; -using umbraco; using umbraco.BusinessLogic; -using System.Collections.Generic; -using umbraco.BasePages; -using umbraco.BusinessLogic.Actions; -using umbraco.interfaces; using umbraco.cms.presentation.Trees; -using System.Xml.XPath; using Umbraco.Core.IO; +using Umbraco.Web.UI.Pages; namespace umbraco.cms.presentation.user { @@ -74,7 +59,7 @@ namespace umbraco.cms.presentation.user /// /// Since Umbraco stores users in cache, we'll use this method to retrieve our user object by the selected id /// - public override User UmbracoUser + public User UmbracoUser { get { diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/users/PermissionsHandler.asmx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/users/PermissionsHandler.asmx.cs index 7813e7e5cb..00371aa8bd 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/users/PermissionsHandler.asmx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/users/PermissionsHandler.asmx.cs @@ -1,20 +1,14 @@ -using System; -using System.Data; using System.Web; -using System.Collections; using System.Web.Services; -using System.Web.Services.Protocols; using System.ComponentModel; using System.Web.Script.Services; using System.Web.UI; using System.IO; -using System.Reflection; -using System.Web.UI.HtmlControls; -using umbraco.BasePages; using System.Collections.Generic; using umbraco.interfaces; -using umbraco.BusinessLogic.Actions; using Umbraco.Core.IO; +using Umbraco.Web.LegacyActions; +using Umbraco.Web.WebServices; namespace umbraco.cms.presentation.user { @@ -25,7 +19,7 @@ namespace umbraco.cms.presentation.user [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [ToolboxItem(false)] [ScriptService] - public class PermissionsHandler : System.Web.Services.WebService + public class PermissionsHandler : UmbracoAuthorizedWebService { /// @@ -37,7 +31,7 @@ namespace umbraco.cms.presentation.user [WebMethod] public string GetNodePermissions(int userID, string nodes) { - Authorize(); + AuthorizeRequest(true); Page page = new Page(); @@ -60,21 +54,15 @@ namespace umbraco.cms.presentation.user [WebMethod] public string SaveNodePermissions(int userID, string nodes, string permissions, bool replaceChild) { - Authorize(); + AuthorizeRequest(true); UserPermissions uPermissions = new UserPermissions(BusinessLogic.User.GetUser(userID)); - List actions = umbraco.BusinessLogic.Actions.Action.FromString(permissions); + List actions = Action.FromString(permissions); uPermissions.SaveNewPermissions(toIntArray(nodes), actions, replaceChild); return GetNodePermissions(userID, nodes); } - - private void Authorize() - { - if (!BasePage.ValidateUserContextID(BasePage.umbracoUserContextID)) - throw new Exception("Client authorization failed. User is not logged in"); - - } + private int[] toIntArray(string nodeIds) { diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/users/UserPermissions.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/users/UserPermissions.cs index 33818d43df..1b6350d80c 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/users/UserPermissions.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/users/UserPermissions.cs @@ -1,25 +1,11 @@ -using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Xml; -using System.IO; -using System.Collections; -using System.Web.UI.WebControls; -using System.Data.SqlClient; -using System.Data; using Umbraco.Core; using Umbraco.Web; -using Umbraco.Web.Security; -using umbraco; using umbraco.BusinessLogic; -using System.Web; -using umbraco.BusinessLogic.Actions; -using umbraco.DataLayer; -using umbraco.cms.businesslogic; using umbraco.interfaces; -using umbraco.BasePages; using umbraco.cms.businesslogic.web; +using Umbraco.Web.LegacyActions; namespace umbraco.cms.presentation.user { @@ -51,7 +37,7 @@ namespace umbraco.cms.presentation.user foreach (var nodeId in nodeIDs) { var nodeActions = UmbracoContext.Current.UmbracoUser.GetPermissions(GetNodePath(nodeId)); - var lstActions = BusinessLogic.Actions.Action.FromString(nodeActions); + var lstActions = Action.FromString(nodeActions); if (lstActions == null || !lstActions.Contains(ActionRights.Instance)) lstNoPermissions.Add(nodeId); } @@ -105,7 +91,7 @@ namespace umbraco.cms.presentation.user { //get the user and their permissions string permissions = _user.GetPermissions(path); - return umbraco.BusinessLogic.Actions.Action.FromString(permissions); + return Action.FromString(permissions); } return null; } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/CheckForUpgrade.asmx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/CheckForUpgrade.asmx.cs index 909b89b96b..eb9ce84a6c 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/CheckForUpgrade.asmx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/CheckForUpgrade.asmx.cs @@ -40,12 +40,12 @@ namespace umbraco.presentation.webservices { bool isUpgrade = false; // if it's an upgrade, you'll need to be logged in before we allow this call - if (!String.IsNullOrEmpty(global::Umbraco.Core.Configuration.GlobalSettings.ConfigurationStatus)) + if (string.IsNullOrEmpty(GlobalSettings.ConfigurationStatus) == false) { isUpgrade = true; try { - legacyAjaxCalls.Authorize(); + AuthorizeRequest(true); } catch (Exception) { diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/TreeClientService.asmx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/TreeClientService.asmx.cs index 8f71d235c0..e231627002 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/TreeClientService.asmx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/TreeClientService.asmx.cs @@ -92,12 +92,6 @@ namespace umbraco.presentation.webservices return returnVal; } - [Obsolete("Use the AuthorizeRequest methods on the base class UmbracoAuthorizedWebService instead")] - public static void Authorize() - { - if (!BasePages.BasePage.ValidateUserContextID(BasePages.BasePage.umbracoUserContextID)) - throw new Exception("Client authorization failed. User is not logged in"); - } } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/TreeDataService.ashx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/TreeDataService.ashx.cs index d4de749989..f283ab7f0e 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/TreeDataService.ashx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/TreeDataService.ashx.cs @@ -40,15 +40,7 @@ namespace umbraco.presentation.webservices return false; } } - - [Obsolete("Use the base class AuthorizeRequest methods in UmbracoAuthorizedHttpHandler")] - public static void Authorize() - { - if (!BasePages.BasePage.ValidateUserContextID(BasePages.BasePage.umbracoUserContextID)) - throw new Exception("Client authorization failed. User is not logged in"); - - } - + /// /// Returns the an XmlTree based on the current http request /// 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 3b20ac1fdf..ac681391f4 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/codeEditorSave.asmx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/codeEditorSave.asmx.cs @@ -126,7 +126,7 @@ namespace umbraco.presentation.webservices { //errorMessage = ui.Text("developer", "xsltErrorNoNodesPublished"); File.Delete(tempFileName); - //base.speechBubble(speechBubbleIcon.info, ui.Text("errors", "xsltErrorHeader", base.getUser()), "Unable to validate xslt as no published content nodes exist."); + //base.speechBubble(speechBubbleIcon.info, ui.Text("errors", "xsltErrorHeader", Security.CurrentUser), "Unable to validate xslt as no published content nodes exist."); } } catch (Exception errorXslt) diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/legacyAjaxCalls.asmx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/legacyAjaxCalls.asmx.cs index e4e292e53f..aa7a0c0fef 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/legacyAjaxCalls.asmx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/legacyAjaxCalls.asmx.cs @@ -8,7 +8,6 @@ using System.Xml.Xsl; using System.IO; using System.Text.RegularExpressions; using System.Net; -using System.Security; using System.Web.UI; using Umbraco.Core; using Umbraco.Core.IO; @@ -19,7 +18,6 @@ using Umbraco.Web.WebServices; using umbraco.BusinessLogic; using umbraco.cms.businesslogic.web; using umbraco.cms.businesslogic.media; -using umbraco.BasePages; namespace umbraco.presentation.webservices @@ -34,19 +32,7 @@ namespace umbraco.presentation.webservices public class legacyAjaxCalls : UmbracoAuthorizedWebService { private User _currentUser; - - [WebMethod] - public bool ValidateUser(string username, string password) - { - if (ValidateCredentials(username, password)) - { - var u = new BusinessLogic.User(username); - BasePage.doLogin(u); - return true; - } - return false; - } - + /// /// method to accept a string value for the node id. Used for tree's such as python /// and xslt since the file names are the node IDs @@ -182,34 +168,7 @@ namespace umbraco.presentation.webservices return Application[Context.Request.GetItemAsString("key")].ToString(); } - - [Obsolete("This is no longer used and will be removed in future versions")] - [WebMethod] - [ScriptMethod] - public void RenewUmbracoSession() - { - AuthorizeRequest(true); - - BasePage.RenewLoginTimeout(); - - } - - [Obsolete("This is no longer used and will be removed in future versions")] - [WebMethod] - [ScriptMethod] - public int GetSecondsBeforeUserLogout() - { - //TODO: Change this to not throw an exception otherwise we end up with JS errors all the time when recompiling!! - - AuthorizeRequest(true); - var timeout = BasePage.GetTimeout(true); - var timeoutDate = new DateTime(timeout); - var currentDate = DateTime.Now; - - return (int) timeoutDate.Subtract(currentDate).TotalSeconds; - - } - + [WebMethod] [ScriptMethod] public string TemplateMasterPageContentContainer(int templateId, int masterTemplateId) @@ -448,16 +407,5 @@ namespace umbraco.presentation.webservices return retVal; } - [Obsolete("You should use the AuthorizeRequest methods on the base class of UmbracoAuthorizedWebService and ensure you inherit from that class for umbraco asmx web services")] - public static void Authorize() - { - // check for secure connection - if (GlobalSettings.UseSSL && !HttpContext.Current.Request.IsSecureConnection) - throw new SecurityException("This installation requires a secure connection (via SSL). Please update the URL to include https://"); - - if (!BasePage.ValidateUserContextID(BasePages.BasePage.umbracoUserContextID)) - throw new Exception("Client authorization failed. User is not logged in"); - - } } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/nodeSorter.asmx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/nodeSorter.asmx.cs index eb73d78b5b..aacd162f47 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/nodeSorter.asmx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/nodeSorter.asmx.cs @@ -1,23 +1,15 @@ using System; -using System.Collections; using System.Collections.Generic; using System.ComponentModel; -using System.Globalization; using System.Linq; using System.Web.Script.Services; using System.Web.Services; -using System.Xml; using Umbraco.Core; -using Umbraco.Core.Configuration; using Umbraco.Core.Logging; using Umbraco.Core.Models; -using Umbraco.Core.Models.EntityBase; using Umbraco.Web; +using Umbraco.Web.LegacyActions; using Umbraco.Web.WebServices; -using umbraco.BasePages; -using umbraco.BusinessLogic; -using umbraco.BusinessLogic.Actions; -using umbraco.cms.businesslogic.web; namespace umbraco.presentation.webservices { @@ -33,7 +25,7 @@ namespace umbraco.presentation.webservices [WebMethod] public SortNode GetNodes(string ParentId, string App) { - if (BasePage.ValidateUserContextID(BasePage.umbracoUserContextID)) + if (AuthorizeRequest()) { var nodes = new List(); diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/trashcan.asmx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/trashcan.asmx.cs index 85b8f383f6..baa692ef34 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/trashcan.asmx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/trashcan.asmx.cs @@ -3,8 +3,6 @@ using System.Web.Script.Services; using System.Web.Services; using System.ComponentModel; using Umbraco.Web.WebServices; -using umbraco.BasePages; -using umbraco.BusinessLogic; using umbraco.cms.businesslogic; using Umbraco.Core; diff --git a/src/UmbracoExamine/BaseUmbracoIndexer.cs b/src/UmbracoExamine/BaseUmbracoIndexer.cs index ee77f5d05c..ca0d3063d0 100644 --- a/src/UmbracoExamine/BaseUmbracoIndexer.cs +++ b/src/UmbracoExamine/BaseUmbracoIndexer.cs @@ -1,20 +1,13 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Net; -using System.Security; using System.Text; -using System.Threading; -using System.Web; using Examine.LuceneEngine.Config; using Examine.LuceneEngine.Providers; using Examine.Providers; using Lucene.Net.Analysis; -using Lucene.Net.Documents; using Lucene.Net.Index; using Umbraco.Core; -using umbraco.BasePages; -using umbraco.BusinessLogic; using UmbracoExamine.DataServices; using Examine; using System.IO; diff --git a/src/UmbracoExamine/UmbracoContentIndexer.cs b/src/UmbracoExamine/UmbracoContentIndexer.cs index 5f168f3237..86f8487a56 100644 --- a/src/UmbracoExamine/UmbracoContentIndexer.cs +++ b/src/UmbracoExamine/UmbracoContentIndexer.cs @@ -1,33 +1,20 @@ using System; -using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; -using System.IO; using System.Linq; -using System.Security; -using System.Text; -using System.Web; using System.Xml.Linq; using Examine; -using Examine.Config; -using Examine.Providers; using Lucene.Net.Documents; -using Lucene.Net.Index; using Umbraco.Core; -using umbraco.cms.businesslogic; using Umbraco.Core.Models; -using Umbraco.Core.Persistence.DatabaseModelDefinitions; using Umbraco.Core.Services; using Umbraco.Core.Strings; using UmbracoExamine.DataServices; using Examine.LuceneEngine; using Examine.LuceneEngine.Config; using UmbracoExamine.Config; -using Examine.LuceneEngine.Providers; using Lucene.Net.Analysis; -using umbraco.BasePages; using IContentService = Umbraco.Core.Services.IContentService; -using UmbracoExamine.LocalStorage; using IMediaService = Umbraco.Core.Services.IMediaService; diff --git a/src/umbraco.businesslogic/BasePages/BasePage.cs b/src/umbraco.businesslogic/BasePages/BasePage.cs deleted file mode 100644 index d78bc7d2dd..0000000000 --- a/src/umbraco.businesslogic/BasePages/BasePage.cs +++ /dev/null @@ -1,411 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Data; -using System.Web; -using System.Linq; -using System.Web.Mvc; -using System.Web.Routing; -using System.Web.Security; -using System.Web.UI; -using Umbraco.Core; -using Umbraco.Core.Configuration; -using Umbraco.Core.IO; -using Umbraco.Core.Cache; -using Umbraco.Core.Logging; -using Umbraco.Core.Services; -using umbraco.BusinessLogic; -using umbraco.DataLayer; -using Umbraco.Core; -using Umbraco.Core.Security; - -namespace umbraco.BasePages -{ - /// - /// umbraco.BasePages.BasePage is the default page type for the umbraco backend. - /// The basepage keeps track of the current user and the page context. But does not - /// Restrict access to the page itself. - /// The keep the page secure, the umbracoEnsuredPage class should be used instead - /// - [Obsolete("This class has been superceded by Umbraco.Web.UI.Pages.BasePage")] - public class BasePage : System.Web.UI.Page - { - private User _user; - private bool _userisValidated = false; - private ClientTools _clientTools; - - /// - /// The path to the umbraco root folder - /// - protected string UmbracoPath = SystemDirectories.Umbraco; - - /// - /// The current user ID - /// - protected int uid = 0; - - /// - /// The page timeout in seconds. - /// - protected long timeout = 0; - - /// - /// Gets the SQL helper. - /// - /// The SQL helper. - protected static ISqlHelper SqlHelper - { - get { return BusinessLogic.Application.SqlHelper; } - } - - /// - /// Returns the current ApplicationContext - /// - public ApplicationContext ApplicationContext - { - get { return ApplicationContext.Current; } - } - - /// - /// Returns a ServiceContext - /// - public ServiceContext Services - { - get { return ApplicationContext.Services; } - } - - /// - /// Returns a DatabaseContext - /// - public DatabaseContext DatabaseContext - { - get { return ApplicationContext.DatabaseContext; } - } - - /// - /// Returns the current BasePage for the current request. - /// This assumes that the current page is a BasePage, otherwise, returns null; - /// - [Obsolete("Should use the Umbraco.Web.UmbracoContext.Current singleton instead to access common methods and properties")] - public static BasePage Current - { - get - { - var page = HttpContext.Current.CurrentHandler as BasePage; - if (page != null) return page; - //the current handler is not BasePage but people might be expecting this to be the case if they - // are using this singleton accesor... which is legacy code now and shouldn't be used. When people - // start using Umbraco.Web.UI.Pages.BasePage then this will not be the case! So, we'll just return a - // new instance of BasePage as a hack to make it work. - if (HttpContext.Current.Items["umbraco.BasePages.BasePage"] == null) - { - HttpContext.Current.Items["umbraco.BasePages.BasePage"] = new BasePage(); - } - return (BasePage)HttpContext.Current.Items["umbraco.BasePages.BasePage"]; - } - } - - private UrlHelper _url; - /// - /// Returns a UrlHelper - /// - /// - /// This URL helper is created without any route data and an empty request context - /// - public UrlHelper Url - { - get { return _url ?? (_url = new UrlHelper(new RequestContext(new HttpContextWrapper(Context), new RouteData()))); } - } - - /// - /// Returns a refernce of an instance of ClientTools for access to the pages client API - /// - public ClientTools ClientTools - { - get - { - if (_clientTools == null) - _clientTools = new ClientTools(this); - return _clientTools; - } - } - - [Obsolete("Use ClientTools instead")] - public void RefreshPage(int Seconds) - { - ClientTools.RefreshAdmin(Seconds); - } - - //NOTE: This is basically replicated in WebSecurity because this class exists in a poorly placed assembly. - also why it is obsolete. - private void ValidateUser() - { - var ticket = Context.GetUmbracoAuthTicket(); - - if (ticket != null) - { - if (ticket.Expired == false) - { - _user = BusinessLogic.User.GetUser(GetUserId("")); - - // Check for console access - if (_user.Disabled || (_user.NoConsole && GlobalSettings.RequestIsInUmbracoApplication(Context))) - { - throw new ArgumentException("You have no priviledges to the umbraco console. Please contact your administrator"); - } - _userisValidated = true; - UpdateLogin(); - } - else - { - throw new ArgumentException("User has timed out!!"); - } - } - else - { - throw new InvalidOperationException("The user has no umbraco contextid - try logging in"); - } - } - - /// - /// Gets the user id. - /// - /// This is not used - /// - [Obsolete("This method is no longer used, use the GetUserId() method without parameters instead")] - public static int GetUserId(string umbracoUserContextID) - { - return GetUserId(); - } - - /// - /// Gets the currnet user's id. - /// - /// - public static int GetUserId() - { - var identity = HttpContext.Current.GetCurrentIdentity( - //DO NOT AUTO-AUTH UNLESS THE CURRENT HANDLER IS WEBFORMS! - // Without this check, anything that is using this legacy API, like ui.Text will - // automatically log the back office user in even if it is a front-end request (if there is - // a back office user logged in. This can cause problems becaues the identity is changing mid - // request. For example: http://issues.umbraco.org/issue/U4-4010 - HttpContext.Current.CurrentHandler is Page); - - if (identity == null) - return -1; - return Convert.ToInt32(identity.Id); - } - - // Added by NH to use with webservices authentications - /// - /// Validates the user context ID. - /// - /// This doesn't do anything - /// - [Obsolete("This method is no longer used, use the ValidateCurrentUser() method instead")] - public static bool ValidateUserContextID(string currentUmbracoUserContextID) - { - return ValidateCurrentUser(); - } - - /// - /// Validates the currently logged in user and ensures they are not timed out - /// - /// - public static bool ValidateCurrentUser() - { - var identity = HttpContext.Current.GetCurrentIdentity( - //DO NOT AUTO-AUTH UNLESS THE CURRENT HANDLER IS WEBFORMS! - // Without this check, anything that is using this legacy API, like ui.Text will - // automatically log the back office user in even if it is a front-end request (if there is - // a back office user logged in. This can cause problems becaues the identity is changing mid - // request. For example: http://issues.umbraco.org/issue/U4-4010 - HttpContext.Current.CurrentHandler is Page); - - if (identity != null) - { - return true; - } - return false; - } - - //[Obsolete("Use Umbraco.Web.Security.WebSecurity.GetTimeout instead")] - public static long GetTimeout(bool bypassCache) - { - var ticket = HttpContext.Current.GetUmbracoAuthTicket(); - if (ticket.Expired) return 0; - var ticks = ticket.Expiration.Ticks - DateTime.Now.Ticks; - return ticks; - } - - // Changed to public by NH to help with webservice authentication - /// - /// Gets or sets the umbraco user context ID. - /// - /// The umbraco user context ID. - [Obsolete("Returns the current user's unique umbraco sesion id - this cannot be set and isn't intended to be used in your code")] - public static string umbracoUserContextID - { - get - { - var identity = HttpContext.Current.GetCurrentIdentity( - //DO NOT AUTO-AUTH UNLESS THE CURRENT HANDLER IS WEBFORMS! - // Without this check, anything that is using this legacy API, like ui.Text will - // automatically log the back office user in even if it is a front-end request (if there is - // a back office user logged in. This can cause problems becaues the identity is changing mid - // request. For example: http://issues.umbraco.org/issue/U4-4010 - HttpContext.Current.CurrentHandler is Page); - - return identity == null ? "" : identity.SessionId; - } - set - { - } - } - - - /// - /// Clears the login. - /// - public void ClearLogin() - { - Context.UmbracoLogout(); - } - - private void UpdateLogin() - { - Context.RenewUmbracoAuthTicket(); - } - - public static void RenewLoginTimeout() - { - HttpContext.Current.RenewUmbracoAuthTicket(); - } - - /// - /// Logs a user in. - /// - /// The user - public static void doLogin(User u) - { - HttpContext.Current.CreateUmbracoAuthTicket(new UserData(Guid.NewGuid().ToString("N")) - { - Id = u.Id, - AllowedApplications = u.GetApplications().Select(x => x.alias).ToArray(), - RealName = u.Name, - //currently we only have one user type! - Roles = new[] { u.UserType.Alias }, - StartContentNode = u.StartNodeId, - StartMediaNode = u.StartMediaId, - Username = u.LoginName, - Culture = ui.Culture(u) - - }); - LogHelper.Info("User {0} (Id: {1}) logged in", () => u.Name, () => u.Id); - } - - - /// - /// Gets the user. - /// - /// - [Obsolete("Use UmbracoUser property instead.")] - public User getUser() - { - return UmbracoUser; - } - - /// - /// Gets the user. - /// - /// - public virtual User UmbracoUser - { - get - { - if (!_userisValidated) ValidateUser(); - return _user; - } - } - - /// - /// Ensures the page context. - /// - public void ensureContext() - { - ValidateUser(); - } - - [Obsolete("Use ClientTools instead")] - public void speechBubble(speechBubbleIcon i, string header, string body) - { - ClientTools.ShowSpeechBubble(i, header, body); - } - - //[Obsolete("Use ClientTools instead")] - //public void reloadParentNode() - //{ - // ClientTools.ReloadParentNode(true); - //} - - /// - /// a collection of available speechbubble icons - /// - [Obsolete("This has been superceded by Umbraco.Web.UI.SpeechBubbleIcon but that requires the use of the Umbraco.Web.UI.Pages.BasePage or Umbraco.Web.UI.Pages.EnsuredPage objects")] - public enum speechBubbleIcon - { - /// - /// Save icon - /// - save, - /// - /// Info icon - /// - info, - /// - /// Error icon - /// - error, - /// - /// Success icon - /// - success, - /// - /// Warning icon - /// - warning - } - - protected override void OnInit(EventArgs e) - { - base.OnInit(e); - - //This must be set on each page to mitigate CSRF attacks which ensures that this unique token - // is added to the viewstate of each request - if (umbracoUserContextID.IsNullOrWhiteSpace() == false) - { - ViewStateUserKey = umbracoUserContextID; - } - } - - /// - /// Raises the event. - /// - /// The object that contains the event data. - protected override void OnLoad(EventArgs e) - { - base.OnLoad(e); - - if (!Request.IsSecureConnection && GlobalSettings.UseSSL) - { - string serverName = HttpUtility.UrlEncode(Request.ServerVariables["SERVER_NAME"]); - Response.Redirect(string.Format("https://{0}{1}", serverName, Request.FilePath)); - } - } - - /// - /// Override client target. - /// - [Obsolete("This is no longer supported")] - public bool OverrideClientTarget = false; - } -} diff --git a/src/umbraco.businesslogic/BasePages/ClientTools.cs b/src/umbraco.businesslogic/BasePages/ClientTools.cs deleted file mode 100644 index 0f5aab184b..0000000000 --- a/src/umbraco.businesslogic/BasePages/ClientTools.cs +++ /dev/null @@ -1,351 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using umbraco.BasePages; -using System.Web.UI; -using Umbraco.Core.IO; -using umbraco.BusinessLogic; - -namespace umbraco.BasePages -{ - - /// - /// Renders the client side code necessary to interact with the Umbraco client side API. - /// Each method returns an instance of this class so you can chain calls together. - /// - [Obsolete("This class has been superceded by Umbraco.Web.UI.Pages.ClientTools but requires the use of Umbraco.Web.UI.Pages.BasePage")] - public sealed class ClientTools - { - - public ClientTools(Page page) - { - m_page = page; - } - - /// - /// Returns the string markup for the JavaScript that is rendered. - /// If referencing JavaScript scripts in the backend, this class should be used - /// in case future changes to the client code is change, this will remain intact. - /// - public static class Scripts - { - internal const string ClientMgrScript = "UmbClientMgr"; - public static string GetAppActions { get { return string.Format("{0}.appActions()", ClientMgrScript); } } - public static string GetMainWindow { get { return string.Format("{0}.mainWindow()", ClientMgrScript); } } - public static string GetMainTree { get { return string.Format("{0}.mainTree()", ClientMgrScript); } } - public static string GetContentFrame() { return string.Format("{0}.contentFrame()", ClientMgrScript); } - public static string ShiftApp(string appAlias) - { - return string.Format(ClientMgrScript + ".historyManager().addHistory('{0}')", appAlias); - } - public static string OpenDashboard(string app) - { - return string.Format(GetAppActions + ".openDashboard('{0}');", app); - } - public static string RefreshAdmin { get { return "setTimeout('" + GetMainWindow + ".location.reload()', {0});"; } } - public static string ShowSpeechBubble { get { return GetMainWindow + ".UmbSpeechBubble.ShowMessage('{0}','{1}', '{2}');"; } } - public static string ChangeContentFrameUrl(string url) { - return string.Format(ClientMgrScript + ".contentFrame('{0}');", url); - } - public static string ReloadContentFrameUrlIfPathLoaded(string url) { - return string.Format(ClientMgrScript + ".reloadContentFrameUrlIfPathLoaded('{0}');", url); - } - - public static string ChildNodeCreated = GetMainTree + ".childNodeCreated();"; - public static string SyncTree { get { return GetMainTree + ".syncTree('{0}', {1});"; } } - public static string ClearTreeCache { get { return GetMainTree + ".clearTreeCache();"; } } - public static string CopyNode { get { return GetMainTree + ".copyNode('{0}', '{1}');"; } } - public static string MoveNode { get { return GetMainTree + ".moveNode('{0}', '{1}');"; } } - public static string ReloadActionNode { get { return GetMainTree + ".reloadActionNode({0}, {1}, null);"; } } - public static string SetActiveTreeType { get { return GetMainTree + ".setActiveTreeType('{0}');"; } } - public static string RefreshTree { get { return GetMainTree + ".refreshTree();"; } } - public static string RefreshTreeType { get { return GetMainTree + ".refreshTree('{0}');"; } } - public static string CloseModalWindow() - { - return string.Format("{0}.closeModalWindow();", ClientMgrScript); - } - public static string CloseModalWindow(string rVal) - { - return string.Format("{0}.closeModalWindow('{1}');", ClientMgrScript, rVal); - } - public static string OpenModalWindow(string url, string name, int width, int height) - { - return OpenModalWindow(url, name, true, width, height, 0, 0, "", ""); - } - public static string OpenModalWindow(string url, string name, bool showHeader, int width, int height, int top, int leftOffset, string closeTriggers, string onCloseCallback) - { - return string.Format("{0}.openModalWindow('{1}', '{2}', {3}, {4}, {5}, {6}, {7}, '{8}', '{9}');", - new object[] { ClientMgrScript, url, name, showHeader.ToString().ToLower(), width, height, top, leftOffset, closeTriggers, onCloseCallback }); - } - } - - private Page m_page; - - /// - /// This removes all tree JSON data cached in the client browser. - /// Useful when you want to ensure that the tree is reloaded from live data. - /// - /// - public ClientTools ClearClientTreeCache() - { - RegisterClientScript(Scripts.ClearTreeCache); - return this; - } - - /// - /// Change applications - /// - /// - public ClientTools ShiftApp(string appAlias) - { - RegisterClientScript(Scripts.ShiftApp(appAlias)); - return this; - } - - /// - /// Refresh the entire administration console after a specified amount of time. - /// - /// - /// - public ClientTools RefreshAdmin(int seconds) - { - RegisterClientScript(string.Format(Scripts.RefreshAdmin, seconds * 1000)); - return this; - } - - /// - /// Refreshes the entire current tree - /// - /// - public ClientTools RefreshTree() - { - RegisterClientScript(Scripts.RefreshTree); - return this; - } - - public ClientTools RefreshTree(string treeType) - { - RegisterClientScript(string.Format(Scripts.RefreshTreeType, treeType)); - return this; - } - - /// - /// A reference to the umbraco UI component "speechbubble". The speechbubble appears in the lower right corner of the screen, notifying users of events - /// - /// The speechbubble icon. - /// The speechbubble header. - /// The body text - public ClientTools ShowSpeechBubble(BasePage.speechBubbleIcon i, string header, string body) - { - RegisterClientScript(string.Format(Scripts.ShowSpeechBubble, i.ToString(), header.Replace("'", "\\'"), body.Replace("'", "\\'"))); - return this; - } - - /// - /// Changes the content in the content frame to the specified URL - /// - /// - public ClientTools ChangeContentFrameUrl(string url) - { - //don't load if there is no url - if (string.IsNullOrEmpty(url)) return this; - - url = EnsureUmbracoUrl(url); - - if (url.Trim().StartsWith("~")) - url = IOHelper.ResolveUrl(url); - - RegisterClientScript(Scripts.ChangeContentFrameUrl(url)); - - return this; - } - - /// - /// Reloads the content in the content frame if the specified URL is currently loaded - /// - /// - public ClientTools ReloadContentFrameUrlIfPathLoaded(string url) - { - if (string.IsNullOrEmpty(url)) return this; - - url = EnsureUmbracoUrl(url); - - RegisterClientScript(Scripts.ReloadContentFrameUrlIfPathLoaded(url)); - - return this; - } - - private string EnsureUmbracoUrl(string url) - { - if (url.StartsWith("/") && !url.StartsWith(IOHelper.ResolveUrl(SystemDirectories.Umbraco))) - { - url = IOHelper.ResolveUrl(SystemDirectories.Umbraco) + url; - } - return url; - } - - /// - /// Shows the dashboard for the given application - /// - /// - /// - public ClientTools ShowDashboard(string app) - { - return ChangeContentFrameUrl(SystemDirectories.Umbraco + string.Format("/dashboard.aspx?app={0}", app)); - } - - /// - /// Reloads the children of the current action node and selects the node that didn't exist there before. - /// If the client side system cannot determine which node is new, then no node is selected. - /// - /// - /// This is used by many create dialogs, however the sync method should be used based on the full path of the - /// node but because the current Umbraco implementation of ITask only returns a url to load, there's no way - /// to determine what the full path of the new child is. - /// - /// - public ClientTools ChildNodeCreated() - { - //RegisterClientScript(Scripts.ChildNodeCreated); - return this; - } - - /// - /// Synchronizes the tree to the path specified. - /// - /// - /// - /// If set to true, will ensure that the node to be synced has it's data - /// reloaded from the server. Otherwise, if the node already exists, the tree will simply sync to the node - /// that is already there. - /// - /// - /// This will work for any tree, however you would need to know the path of the node. Currently, media and content - /// are the only trees that store a path, however, if you were working in the template tree for example, a path to a - /// node could be "init,1090" and this method would still work. - /// - /// Sync tree will works by syncing the active tree type. This can be specified explicitly by calling SetActiveTreeType. - /// This will allow developers to sync many trees in one application at one time if needed. - /// - /// - /// - /// - public ClientTools SyncTree(string path, bool forceReload) - { - RegisterClientScript(string.Format(Scripts.SyncTree, path, forceReload.ToString().ToLower())); - return this; - } - - public ClientTools CopyNode(string currNodeId, string newParentPath) - { - RegisterClientScript(string.Format(Scripts.CopyNode, currNodeId, newParentPath)); - return this; - } - - public ClientTools MoveNode(string currNodeId, string newParentPath) - { - RegisterClientScript(string.Format(Scripts.MoveNode, currNodeId, newParentPath)); - return this; - } - - /// - /// Reloads only the last node that the user interacted with via the context menu. To reload a specify node, use SyncTree. - /// - /// - /// - /// - /// If for whatever reason the client side system cannot just refresh the one node, the system will use jsTree's built in - /// refresh tool, this however won't allow for reselect or reloadChildren. Most trees will work with the single node - /// refresh but 3rd party tools may have poorly built tree data models. - /// - public ClientTools ReloadActionNode(bool reselect, bool reloadChildren) - { - RegisterClientScript(string.Format(Scripts.ReloadActionNode, (!reselect).ToString().ToLower(), (!reloadChildren).ToString().ToLower())); - return this; - } - - /// - /// When the application searches for a node, it searches for nodes in specific tree types. - /// If SyncTree is used, it will sync the tree nodes with the active tree type, therefore if - /// a developer wants to sync a specific tree, they can call this method to set the type to sync. - /// - /// - /// Each branch of a particular tree should theoretically be the same type, however, developers can - /// override the type of each branch in their BaseTree's but this is not standard practice. If there - /// are multiple types of branches in one tree, then only those branches that have the Active tree type - /// will be searched for syncing. - /// - /// - /// - public ClientTools SetActiveTreeType(string treeType) - { - RegisterClientScript(string.Format(Scripts.SetActiveTreeType, treeType)); - return this; - } - - /// - /// Closes the Umbraco dialog window if it is open - /// - /// specify a value to return to add to the onCloseCallback method if one was specified in the OpenModalWindow method - /// - public ClientTools CloseModalWindow(string returnVal) - { - RegisterClientScript(Scripts.CloseModalWindow(returnVal)); - return this; - } - /// - /// Closes the umbraco dialog window if it is open - /// - /// - public ClientTools CloseModalWindow() - { - return CloseModalWindow(""); - } - - - /// - /// Opens a modal window - /// - /// - /// - /// - /// - /// - public ClientTools OpenModalWindow(string url, string name, bool showHeader, int width, int height, int top, int leftOffset, string closeTriggers, string onCloseCallback) - { - RegisterClientScript(Scripts.OpenModalWindow(url, name, showHeader, width, height, top, leftOffset, closeTriggers, onCloseCallback)); - return this; - } - - /// - /// This will use the ScriptManager to register the script if one is available, otherwise will default to the ClientScript - /// class of the page. - /// - /// - private void RegisterClientScript(string script) - { - //use the hash code of the script to generate the key, this way, the exact same script won't be - //inserted more than once. - if (ScriptManager.GetCurrent(m_page) != null) - { - ScriptManager.RegisterStartupScript(m_page, m_page.GetType(), script.GetHashCode().ToString(), script, true); - } - else - { - m_page.ClientScript.RegisterStartupScript(m_page.GetType(), script.GetHashCode().ToString(), script, true); - } - } - - - - - } -} diff --git a/src/umbraco.businesslogic/BasePages/DialogPage.cs b/src/umbraco.businesslogic/BasePages/DialogPage.cs deleted file mode 100644 index 8c7e5c5d87..0000000000 --- a/src/umbraco.businesslogic/BasePages/DialogPage.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; - -namespace umbraco.BasePages -{ - /// - /// Summary description for DialogPage. - /// - public class DialogPage - { - public DialogPage() - { - // - // TODO: Add constructor logic here - // - } - } -} diff --git a/src/umbraco.businesslogic/BasePages/UmbracoEnsuredPage.cs b/src/umbraco.businesslogic/BasePages/UmbracoEnsuredPage.cs deleted file mode 100644 index f7bf1f7a28..0000000000 --- a/src/umbraco.businesslogic/BasePages/UmbracoEnsuredPage.cs +++ /dev/null @@ -1,159 +0,0 @@ -using System; -using Umbraco.Core.Logging; -using System.Linq; -using System.Security; -using System.Web; -using Umbraco.Core; -using Umbraco.Core.IO; -using umbraco.BusinessLogic; -using Umbraco.Core.Security; - -namespace umbraco.BasePages -{ - /// - /// UmbracoEnsuredPage is the standard protected page in the umbraco backend, and forces authentication. - /// - [Obsolete("This class has been superceded by Umbraco.Web.UI.Pages.UmbracoEnsuredPage")] - public class UmbracoEnsuredPage : BasePage - { - /// - /// Checks if the page exists outside of the /umbraco route, in which case the request will not have been authenticated for the back office - /// so we'll force authentication. - /// - /// - protected override void OnPreInit(EventArgs e) - { - base.OnPreInit(e); - - //If this is not a back office request, then the module won't have authenticated it, in this case we - // need to do the auth manually and since this is an UmbracoEnsuredPage, this is the anticipated behavior - // TODO: When we implement Identity, this process might not work anymore, will be an interesting challenge - if (Context.Request.Url.IsBackOfficeRequest(HttpRuntime.AppDomainAppVirtualPath) == false) - { - var http = new HttpContextWrapper(Context); - var ticket = http.GetUmbracoAuthTicket(); - http.AuthenticateCurrentRequest(ticket, true); - } - } - - /// - /// Gets/sets the app for which this page belongs to so that we can validate the current user's security against it - /// - /// - /// If no app is specified then all logged in users will have access to the page - /// - public string CurrentApp { get; set; } - - /// - /// Initializes a new instance of the class. - /// - public UmbracoEnsuredPage() - { - //Assign security automatically if the attribute is found - var treeAuth = this.GetType().GetCustomAttribute(true); - if (treeAuth != null) - { - var treeByAlias = ApplicationContext.Current.Services.ApplicationTreeService - .GetByAlias(treeAuth.TreeAlias); - if (treeByAlias != null) - { - CurrentApp = treeByAlias.ApplicationAlias; - } - } - } - - /// - /// If true then umbraco will force any window/frame to reload umbraco in the main window - /// - public bool RedirectToUmbraco { get; set; } - - /// - /// Validates the user for access to a certain application - /// - /// The application alias. - /// - public bool ValidateUserApp(string app) - { - return getUser().Applications.Any(uApp => uApp.alias.InvariantEquals(app)); - } - - /// - /// Validates the user node tree permissions. - /// - /// The path. - /// The action. - /// - public bool ValidateUserNodeTreePermissions(string Path, string Action) - { - string permissions = getUser().GetPermissions(Path); - if (permissions.IndexOf(Action) > -1 && (Path.Contains("-20") || ("," + Path + ",").Contains("," + getUser().StartNodeId.ToString() + ","))) - return true; - - var user = getUser(); - LogHelper.Info("User {0} has insufficient permissions in UmbracoEnsuredPage: '{1}', '{2}', '{3}'", () => user.Name, () => Path, () => permissions, () => Action); - return false; - } - - /// - /// Gets the current user. - /// - /// The current user. - public static User CurrentUser - { - get - { - return BusinessLogic.User.GetCurrent(); - } - } - - /// - /// Raises the event to initialize the page. - /// - /// An that contains the event data. - protected override void OnInit(EventArgs e) - { - base.OnInit(e); - try - { - ensureContext(); - - if (!string.IsNullOrEmpty(CurrentApp)) - { - if (!ValidateUserApp(CurrentApp)) - throw new SecurityException(string.Format("The current user doesn't have access to the section/app '{0}'", CurrentApp)); - } - } - catch (SecurityException ex) - { - LogHelper.Warn(string.Format("{0} tried to access '{1}'", CurrentUser.Id, CurrentApp)); - throw; - } - catch - { - // Clear content as .NET transfers rendered content. - Response.Clear(); - - // Some umbraco pages should not be loaded on timeout, but instead reload the main application in the top window. Like the treeview for instance - if (RedirectToUmbraco) - Response.Redirect(SystemDirectories.Umbraco + "/logout.aspx?t=" + umbracoUserContextID, true); - else - Response.Redirect(SystemDirectories.Umbraco + "/logout.aspx?redir=" + Server.UrlEncode(Request.RawUrl) + "&t=" + umbracoUserContextID, true); - } - } - - /// - /// Used to assign a webforms page's security to a specific tree which will in turn check to see - /// if the current user has access to the specified tree's registered section - /// - [AttributeUsage(AttributeTargets.Class)] - public sealed class WebformsPageTreeAuthorizeAttribute : Attribute - { - public string TreeAlias { get; private set; } - - public WebformsPageTreeAuthorizeAttribute(string treeAlias) - { - TreeAlias = treeAlias; - } - } - } -} \ No newline at end of file diff --git a/src/umbraco.businesslogic/GlobalSettings.cs b/src/umbraco.businesslogic/GlobalSettings.cs deleted file mode 100644 index 3d3721f783..0000000000 --- a/src/umbraco.businesslogic/GlobalSettings.cs +++ /dev/null @@ -1,492 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Configuration; -using System.Web; -using System.Web.Hosting; -using System.Web.Configuration; -using System.Xml; -using Umbraco.Core; -using Umbraco.Core.Configuration; -using umbraco.BusinessLogic; -using umbraco.DataLayer; -using Umbraco.Core.IO; - -namespace umbraco -{ - /// - /// The GlobalSettings Class contains general settings information for the entire Umbraco instance based on information from web.config appsettings - /// - public class GlobalSettings - { - - /// - /// Gets the reserved urls from web.config. - /// - /// The reserved urls. - public static string ReservedUrls - { - get { return Umbraco.Core.Configuration.GlobalSettings.ReservedUrls; } - } - - /// - /// Gets the reserved paths from web.config - /// - /// The reserved paths. - public static string ReservedPaths - { - get { return Umbraco.Core.Configuration.GlobalSettings.ReservedPaths; } - } - - /// - /// Gets the name of the content XML file. - /// - /// The content XML. - public static string ContentXML - { - get { return Umbraco.Core.Configuration.GlobalSettings.ContentXmlFile; } - } - - /// - /// Gets the path to the storage directory (/data by default). - /// - /// The storage directory. - public static string StorageDirectory - { - get { return Umbraco.Core.Configuration.GlobalSettings.StorageDirectory; } - } - - /// - /// Gets the path to umbraco's root directory (/umbraco by default). - /// - /// The path. - public static string Path - { - get { return Umbraco.Core.Configuration.GlobalSettings.Path; } - } - - /// - /// Gets the path to umbraco's client directory (/umbraco_client by default). - /// This is a relative path to the Umbraco Path as it always must exist beside the 'umbraco' - /// folder since the CSS paths to images depend on it. - /// - /// The path. - public static string ClientPath - { - get { return Umbraco.Core.Configuration.GlobalSettings.ClientPath; } - } - - /// - /// Gets the database connection string - /// - /// The database connection string. - [Obsolete("Use System.ConfigurationManager.ConnectionStrings to get the connection with the key Umbraco.Core.Configuration.GlobalSettings.UmbracoConnectionName instead")] - public static string DbDSN - { - get { return Umbraco.Core.Configuration.GlobalSettings.DbDsn; } - set { Umbraco.Core.Configuration.GlobalSettings.DbDsn = value; } - } - - /// - /// Gets or sets the configuration status. This will return the version number of the currently installed umbraco instance. - /// - /// The configuration status. - public static string ConfigurationStatus - { - get { return Umbraco.Core.Configuration.GlobalSettings.ConfigurationStatus; } - set { Umbraco.Core.Configuration.GlobalSettings.ConfigurationStatus = value; } - } - - public static AspNetHostingPermissionLevel ApplicationTrustLevel - { - get { return Umbraco.Core.SystemUtilities.GetCurrentTrustLevel(); } - } - - /// - /// Saves a setting into the configuration file. - /// - /// Key of the setting to be saved. - /// Value of the setting to be saved. - protected static void SaveSetting(string key, string value) - { - Umbraco.Core.Configuration.GlobalSettings.SaveSetting(key, value); - } - - /// - /// Gets the full path to root. - /// - /// The fullpath to root. - public static string FullpathToRoot - { - get { return Umbraco.Core.Configuration.GlobalSettings.FullpathToRoot; } - } - - /// - /// Gets a value indicating whether umbraco is running in [debug mode]. - /// - /// true if [debug mode]; otherwise, false. - public static bool DebugMode - { - get { return Umbraco.Core.Configuration.GlobalSettings.DebugMode; } - } - - /// - /// Gets a value indicating whether the current version of umbraco is configured. - /// - /// true if configured; otherwise, false. - [Obsolete("Do not use this, it is no longer in use and will be removed from the codebase in future versions")] - public static bool Configured - { - get { return Umbraco.Core.Configuration.GlobalSettings.Configured; } - } - - /// - /// Gets the time out in minutes. - /// - /// The time out in minutes. - public static int TimeOutInMinutes - { - get { return Umbraco.Core.Configuration.GlobalSettings.TimeOutInMinutes; } - } - - /// - /// Gets a value indicating whether umbraco uses directory urls. - /// - /// true if umbraco uses directory urls; otherwise, false. - public static bool UseDirectoryUrls - { - get { return Umbraco.Core.Configuration.GlobalSettings.UseDirectoryUrls; } - } - - /// - /// Returns a string value to determine if umbraco should skip version-checking. - /// - /// The version check period in days (0 = never). - public static int VersionCheckPeriod - { - get { return Umbraco.Core.Configuration.GlobalSettings.VersionCheckPeriod; } - } - - /// - /// Gets the URL forbitten characters. - /// - /// The URL forbitten characters. - [Obsolete("This property is no longer used and will be removed in future versions")] - public static string UrlForbittenCharacters - { - get - { - return ConfigurationManager.AppSettings.ContainsKey("umbracoUrlForbittenCharacters") - ? ConfigurationManager.AppSettings["umbracoUrlForbittenCharacters"] - : string.Empty; - } - } - - /// - /// Gets the URL space character. - /// - /// The URL space character. - [Obsolete("This property is no longer used and will be removed in future versions")] - public static string UrlSpaceCharacter - { - get - { - return ConfigurationManager.AppSettings.ContainsKey("umbracoUrlSpaceCharacter") - ? ConfigurationManager.AppSettings["umbracoUrlSpaceCharacter"] - : string.Empty; - } - } - - /// - /// Gets the SMTP server IP-address or hostname. - /// - /// The SMTP server. - [Obsolete("This property is no longer used and will be removed in future versions")] - public static string SmtpServer - { - get - { - try - { - var mailSettings = ConfigurationManager.GetSection("system.net/mailSettings") as System.Net.Configuration.MailSettingsSectionGroup; - - if (mailSettings != null) - return mailSettings.Smtp.Network.Host; - else - return ConfigurationManager.AppSettings["umbracoSmtpServer"]; - } - catch - { - return ""; - } - } - } - - /// - /// Returns a string value to determine if umbraco should disbable xslt extensions - /// - /// "true" if version xslt extensions are disabled, otherwise, "false" - [Obsolete("This is no longer used and will be removed from the codebase in future releases")] - public static string DisableXsltExtensions - { - get { return Umbraco.Core.Configuration.GlobalSettings.DisableXsltExtensions; } - } - - /// - /// Returns a string value to determine if umbraco should use Xhtml editing mode in the wysiwyg editor - /// - /// "true" if Xhtml mode is enable, otherwise, "false" - [Obsolete("This is no longer used and will be removed from the codebase in future releases")] - public static string EditXhtmlMode - { - get { return Umbraco.Core.Configuration.GlobalSettings.EditXhtmlMode; } - } - - /// - /// Gets the default UI language. - /// - /// The default UI language. - public static string DefaultUILanguage - { - get { return Umbraco.Core.Configuration.GlobalSettings.DefaultUILanguage; } - } - - /// - /// Gets the profile URL. - /// - /// The profile URL. - public static string ProfileUrl - { - get { return Umbraco.Core.Configuration.GlobalSettings.ProfileUrl; } - } - - /// - /// Gets a value indicating whether umbraco should hide top level nodes from generated urls. - /// - /// - /// true if umbraco hides top level nodes from urls; otherwise, false. - /// - public static bool HideTopLevelNodeFromPath - { - get { return Umbraco.Core.Configuration.GlobalSettings.HideTopLevelNodeFromPath; } - } - - /// - /// Gets the current version. - /// - /// The current version. - [Obsolete("Use Umbraco.Core.Configuration.UmbracoVersion.Current instead", false)] - public static string CurrentVersion - { - get { return UmbracoVersion.Current.ToString(3); } - } - - /// - /// Gets the major version number. - /// - /// The major version number. - [Obsolete("Use Umbraco.Core.Configuration.UmbracoVersion.Current instead", false)] - public static int VersionMajor - { - get { return UmbracoVersion.Current.Major; } - } - - /// - /// Gets the minor version number. - /// - /// The minor version number. - [Obsolete("Use Umbraco.Core.Configuration.UmbracoVersion.Current instead", false)] - public static int VersionMinor - { - get { return UmbracoVersion.Current.Minor; } - } - - /// - /// Gets the patch version number. - /// - /// The patch version number. - [Obsolete("Use Umbraco.Core.Configuration.UmbracoVersion.Current instead", false)] - public static int VersionPatch - { - get { return UmbracoVersion.Current.Build; } - } - - /// - /// Gets the version comment (like beta or RC). - /// - /// The version comment. - [Obsolete("Use Umbraco.Core.Configuration.UmbracoVersion.Current instead", false)] - public static string VersionComment - { - get { return UmbracoVersion.CurrentComment; } - } - - - /// - /// Requests the is in umbraco application directory structure. - /// - /// The context. - /// - public static bool RequestIsInUmbracoApplication(HttpContext context) - { - return Umbraco.Core.Configuration.GlobalSettings.RequestIsInUmbracoApplication(context); - } - - /// - /// Gets a value indicating whether umbraco should force a secure (https) connection to the backoffice. - /// - /// true if [use SSL]; otherwise, false. - public static bool UseSSL - { - get { return Umbraco.Core.Configuration.GlobalSettings.UseSSL; } - } - - /// - /// Gets the umbraco license. - /// - /// The license. - public static string License - { - get { return Umbraco.Core.Configuration.GlobalSettings.License; } - } - - - /// - /// Developer method to test if configuration settings are loaded properly. - /// - /// true if succesfull; otherwise, false. - [Obsolete("This method is no longer used and will be removed in future versions")] - public static bool test - { - get - { - var databaseSettings = ConfigurationManager.ConnectionStrings[Umbraco.Core.Configuration.GlobalSettings.UmbracoConnectionName]; - var dataHelper = DataLayerHelper.CreateSqlHelper(databaseSettings.ConnectionString, false); - - if (HttpContext.Current != null) - { - HttpContext.Current.Response.Write("ContentXML :" + ContentXML + "\n"); - HttpContext.Current.Response.Write("DbDSN :" + dataHelper.ConnectionString + "\n"); - HttpContext.Current.Response.Write("DebugMode :" + DebugMode + "\n"); - HttpContext.Current.Response.Write("DefaultUILanguage :" + DefaultUILanguage + "\n"); - HttpContext.Current.Response.Write("VersionCheckPeriod :" + VersionCheckPeriod + "\n"); - HttpContext.Current.Response.Write("DisableXsltExtensions :" + DisableXsltExtensions + "\n"); - HttpContext.Current.Response.Write("EditXhtmlMode :" + EditXhtmlMode + "\n"); - HttpContext.Current.Response.Write("HideTopLevelNodeFromPath :" + HideTopLevelNodeFromPath + "\n"); - HttpContext.Current.Response.Write("Path :" + Path + "\n"); - HttpContext.Current.Response.Write("ProfileUrl :" + ProfileUrl + "\n"); - HttpContext.Current.Response.Write("ReservedPaths :" + ReservedPaths + "\n"); - HttpContext.Current.Response.Write("ReservedUrls :" + ReservedUrls + "\n"); - HttpContext.Current.Response.Write("StorageDirectory :" + StorageDirectory + "\n"); - HttpContext.Current.Response.Write("TimeOutInMinutes :" + TimeOutInMinutes + "\n"); - //HttpContext.Current.Response.Write("UrlForbittenCharacters :" + UrlForbittenCharacters + "\n"); - //HttpContext.Current.Response.Write("UrlSpaceCharacter :" + UrlSpaceCharacter + "\n"); - HttpContext.Current.Response.Write("UseDirectoryUrls :" + UseDirectoryUrls + "\n"); - return true; - } - return false; - } - } - - - /// - /// Determines whether the specified URL is reserved or is inside a reserved path. - /// - /// The URL to check. - /// - /// true if the specified URL is reserved; otherwise, false. - /// - public static bool IsReservedPathOrUrl(string url) - { - return Umbraco.Core.Configuration.GlobalSettings.IsReservedPathOrUrl(url); - } - } - - - - /// - /// Structure that checks in logarithmic time - /// if a given string starts with one of the added keys. - /// - [Obsolete("Use Umbraco.Core.Configuration.GlobalSettings.StartsWithContainer container instead")] - public class StartsWithContainer - { - /// Internal sorted list of keys. - public SortedList _list - = new SortedList(StartsWithComparator.Instance); - - /// - /// Adds the specified new key. - /// - /// The new key. - public void Add(string newKey) - { - // if the list already contains an element that begins with newKey, return - if (String.IsNullOrEmpty(newKey) || StartsWith(newKey)) - return; - - // create a new collection, so the old one can still be accessed - SortedList newList - = new SortedList(_list.Count + 1, StartsWithComparator.Instance); - - // add only keys that don't already start with newKey, others are unnecessary - foreach (string key in _list.Keys) - if (!key.StartsWith(newKey)) - newList.Add(key, null); - // add the new key - newList.Add(newKey, null); - - // update the list (thread safe, _list was never in incomplete state) - _list = newList; - } - - /// - /// Checks if the given string starts with any of the added keys. - /// - /// The target. - /// true if a key is found that matches the start of target - /// - /// Runs in O(s*log(n)), with n the number of keys and s the length of target. - /// - public bool StartsWith(string target) - { - return _list.ContainsKey(target); - } - - /// Comparator that tests if a string starts with another. - /// Not a real comparator, since it is not reflexive. (x==y does not imply y==x) - private sealed class StartsWithComparator : IComparer - { - /// Default string comparer. - private readonly static Comparer _stringComparer = Comparer.Default; - - /// Gets an instance of the StartsWithComparator. - public static readonly StartsWithComparator Instance = new StartsWithComparator(); - - /// - /// Tests if whole begins with all characters of part. - /// - /// The part. - /// The whole. - /// - /// Returns 0 if whole starts with part, otherwise performs standard string comparison. - /// - public int Compare(string part, string whole) - { - // let the default string comparer deal with null or when part is not smaller then whole - if (part == null || whole == null || part.Length >= whole.Length) - return _stringComparer.Compare(part, whole); - - // loop through all characters that part and whole have in common - int pos = 0; - bool match; - do - { - match = (part[pos] == whole[pos]); - } while (match && ++pos < part.Length); - - // return result of last comparison - return match ? 0 : (part[pos] < whole[pos] ? -1 : 1); - } - } - } -} diff --git a/src/umbraco.businesslogic/User.cs b/src/umbraco.businesslogic/User.cs index 475a2614dd..90ed9065cc 100644 --- a/src/umbraco.businesslogic/User.cs +++ b/src/umbraco.businesslogic/User.cs @@ -358,17 +358,7 @@ namespace umbraco.BusinessLogic /// A user or null public static User GetCurrent() { - try - { - if (BasePages.BasePage.umbracoUserContextID != "") - return GetUser(BasePages.BasePage.GetUserId(BasePages.BasePage.umbracoUserContextID)); - else - return null; - } - catch (Exception) - { - return null; - } + throw new NotImplementedException("NOTHING USING THIS WILL WORK UNTIL THIS USER CLASS IS REMOVED AND ALL CODE REFERENCING IT IS MIGRATED"); } /// diff --git a/src/umbraco.businesslogic/ui.cs b/src/umbraco.businesslogic/ui.cs index b289b6d6c5..ff24ceb0b4 100644 --- a/src/umbraco.businesslogic/ui.cs +++ b/src/umbraco.businesslogic/ui.cs @@ -1,12 +1,9 @@ using System; -using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Globalization; using System.Linq; -using System.Text.RegularExpressions; using System.Threading; -using System.Web; using System.Web.Caching; using System.Xml; using Umbraco.Core; @@ -14,8 +11,6 @@ using Umbraco.Core.IO; using Umbraco.Core.Logging; using Umbraco.Core.Models; using Umbraco.Core.Models.Membership; -using umbraco.BasePages; -using Umbraco.Core.Services; using File = System.IO.File; using User = umbraco.BusinessLogic.User; @@ -31,7 +26,7 @@ namespace umbraco [Obsolete("Use the ILocalizedTextService instead which is on the ApplicationContext.Services.TextService")] public class ui { - private static readonly string UmbracoDefaultUiLanguage = GlobalSettings.DefaultUILanguage; + private static readonly string UmbracoDefaultUiLanguage = Umbraco.Core.Configuration.GlobalSettings.DefaultUILanguage; private static readonly string UmbracoPath = SystemDirectories.Umbraco; [EditorBrowsable(EditorBrowsableState.Never)] @@ -54,10 +49,10 @@ namespace umbraco return found == null ? string.Empty : found.Name; } + private static string GetLanguage() { - var user = UmbracoEnsuredPage.CurrentUser; - return GetLanguage(user); + throw new NotImplementedException("NOTHING WILL WORK UNTIL WE REPLACE ALL USAGES OF THE ui CLASS"); } private static string GetLanguage(User u) diff --git a/src/umbraco.businesslogic/umbraco.businesslogic.csproj b/src/umbraco.businesslogic/umbraco.businesslogic.csproj index daffbe8601..2f32fb3204 100644 --- a/src/umbraco.businesslogic/umbraco.businesslogic.csproj +++ b/src/umbraco.businesslogic/umbraco.businesslogic.csproj @@ -195,16 +195,6 @@ Code - - ASPXCodeBehind - - - - ASPXCodeBehind - - - Code - Code diff --git a/src/umbraco.cms/PluginManagerExtensions.cs b/src/umbraco.cms/PluginManagerExtensions.cs index 86605a356d..63702a2ead 100644 --- a/src/umbraco.cms/PluginManagerExtensions.cs +++ b/src/umbraco.cms/PluginManagerExtensions.cs @@ -1,8 +1,6 @@ using System; using System.Collections.Generic; using Umbraco.Core; -using umbraco.BusinessLogic.Actions; -using umbraco.businesslogic; using umbraco.cms.businesslogic.macro; using umbraco.cms.businesslogic.media; using umbraco.interfaces; diff --git a/src/umbraco.cms/businesslogic/Packager/Installer.cs b/src/umbraco.cms/businesslogic/Packager/Installer.cs index 0b28c434c0..fdbe26cecf 100644 --- a/src/umbraco.cms/businesslogic/Packager/Installer.cs +++ b/src/umbraco.cms/businesslogic/Packager/Installer.cs @@ -299,13 +299,16 @@ namespace umbraco.cms.businesslogic.packager // Get current user, with a fallback var currentUser = new User(0); - if (string.IsNullOrEmpty(BasePages.UmbracoEnsuredPage.umbracoUserContextID) == false) - { - if (BasePages.UmbracoEnsuredPage.ValidateUserContextID(BasePages.UmbracoEnsuredPage.umbracoUserContextID)) - { - currentUser = User.GetCurrent(); - } - } + + //TODO: Need to migrate this class/code/logic so that we can replicate this functionality, until then everything will be installed by ADMIN + + //if (string.IsNullOrEmpty(Umbraco.Web.UI.Pages.UmbracoEnsuredPage.umbracoUserContextID) == false) + //{ + // if (Umbraco.Web.UI.Pages.UmbracoEnsuredPage.ValidateUserContextID(Umbraco.Web.UI.Pages.UmbracoEnsuredPage.umbracoUserContextID)) + // { + // currentUser = User.GetCurrent(); + // } + //} //Xml as XElement which is used with the new PackagingService var rootElement = Config.DocumentElement.GetXElement(); diff --git a/src/umbraco.cms/businesslogic/Packager/PackageInstance/PackageActions.cs b/src/umbraco.cms/businesslogic/Packager/PackageInstance/PackageActions.cs index bd312343e4..eaba8f8f0a 100644 --- a/src/umbraco.cms/businesslogic/Packager/PackageInstance/PackageActions.cs +++ b/src/umbraco.cms/businesslogic/Packager/PackageInstance/PackageActions.cs @@ -5,7 +5,7 @@ using System.Web; using System.Xml; using Umbraco.Core; using Umbraco.Core.Logging; -using umbraco.BasePages; + using umbraco.BusinessLogic.Utils; using umbraco.cms.businesslogic.web; using umbraco.cms.businesslogic.workflow; diff --git a/src/umbraco.cms/businesslogic/web/Document.cs b/src/umbraco.cms/businesslogic/web/Document.cs index e0039e9d09..5d2b417428 100644 --- a/src/umbraco.cms/businesslogic/web/Document.cs +++ b/src/umbraco.cms/businesslogic/web/Document.cs @@ -1,23 +1,12 @@ using System; -using System.Collections; using System.Collections.Generic; using System.Linq; -using System.Runtime.CompilerServices; -using System.Threading; using System.Xml; using Umbraco.Core; -using Umbraco.Core.Configuration; using Umbraco.Core.Models; -using Umbraco.Core.Logging; using Umbraco.Core.Models.EntityBase; - -using Umbraco.Core.Publishing; -using Umbraco.Core.Services; using umbraco.BusinessLogic; -using umbraco.BusinessLogic.Actions; using umbraco.DataLayer; -using Umbraco.Core.Events; -using Umbraco.Core.Strings; namespace umbraco.cms.businesslogic.web { diff --git a/src/umbraco.cms/umbraco.cms.csproj b/src/umbraco.cms/umbraco.cms.csproj index 662b732773..b01b098a90 100644 --- a/src/umbraco.cms/umbraco.cms.csproj +++ b/src/umbraco.cms/umbraco.cms.csproj @@ -172,44 +172,6 @@ Properties\SolutionInfo.cs - - Code - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Code - - -