From 91a82535a24c8e13d1c16d078051e4b16ca98735 Mon Sep 17 00:00:00 2001 From: Matteo Piovanelli Date: Fri, 14 Jan 2022 09:11:12 +0100 Subject: [PATCH] 1.10.x into dev (#8521) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Added tokenizable default value to ContentPickerFields (#8351) * Fixes errors during Indexing (#8349) * Added admin search permissions (#8346) * Reuse Settings_ShellDescriptorRecord during an http request (#8355) * Added a new index to CommonPartRecord (#8362) * Attempted AutoroutePart improvement (#8360) This should ease Database issues, because it short circuits some code paths through aliases. * Save MemberBindingRecords in memory (#8371) Prevent fetching the same table from the database 5+ times per request by loading it and saving it in a private property for a request. * Cache list of configured layers (#8373) On every page load on frontend we were querying for all existing layers to test for the ones that are currently active. Since that information is not bound to change often, we added a cache layer to prevent querying every time. The cache is evicted whenever a Layer gets updated. * Memorize query results in blog service (#8374) The query for all published blogs is being called twice while building the admin menu, so we are memorizing its results. * Updated UI for projections (#8380) Some textboxes were too small for the actual text users would generally write in them. Those meant to hold HTML have been converted to textareas. * Process ignored paths while being aware of RequestUrlPrefix (#8384) * Process ignored paths while being aware of RequestUrlPrefix * Fix: I had moved a Trim to the wrong place * Fixed issue with empty/uninitialized null set of ignored urls * tokens sort criteria (#8382) * Tokenized state for sort criteria * Tokenized state also in the other place where sort criteria are used * Remove lock from the dictionary when the task has completed. (#8395) Fixes #8391 * Update DistributedLockService.cs (#8398) * fix for CPF when other scripts are also adding to sessionStorage (#8404) * Fixes Boolean Conversion error (#8393) * Fix/8392 remeber me model state exception (#8410) @sebastienros this fixes the possible NRE that would happen for absent models from merged #8393 (see your comment there https://github.com/OrchardCMS/Orchard/pull/8393#issuecomment-686630198) * Removed changes to model bindings (#8412) This is the same as reverting 1.10.x to commit 868ce12ad63de121703222ad86afdb739d3e864c * New version of Boolean Binder Provider (#8413) * New version of Boolean Binder Provider * Use Convert.ToBoolean(string) rather than ValueProviderResult.ConvertTo(bool) * Upgrade host resolution (#8387) * Reverted changes to RunningShellTable and then changed the way shells are sorted, so we can correctly give "priority" to tenants based on their prefix. Added test adapter reference to Orchard.Framework.Tests so tests can be run in the latest VS 2017. Fixed a test that was failing to account for the order the shells were being processed. * Removed some stuff from csproj that vs had added * Handle the case where a form sends more than one attempted value for a boolean (#8416) * fix record mapping nhibernate (#8415) * Allow downstream methods to set default value (#8419) Moreover, this won't try to set a default value to the bool when it's not sent. This will allow calls with missing required parameters to fail as they should. * Fixed Media Library Picker Style (#8433) * Removed check preventing reassignment of loader delegates (#8436) * Added an event activity for workflows that activates on the first Upd… (#8438) * target framework 4.8 to all projects (#8444) * Feature/8445 libraries update (#8446) * Fixed conflict with style for layouts (#8456) the .overlay is used for different things in MediaLibraryPickerField and Layouts, and as it was the styles would conflict. This should fix it. * Feature/upgradable libraries (#8457) * Updated Migration for CommonPartRecord and IdentityPartRecord (#8459) This orders the operations differently than what is in dev for retrocompatibility in both environments. * Prevents throwing exception when Href is null (#8461) * added culture in widgets page (#8466) * added culture in widgets page Co-authored-by: elena.lampugnani Co-authored-by: Hermes Sbicego * Show disable action for deprecated features even if they are categorized as "Core" (#8468) * Upgrades YamlDotNet from 9.1.3 to 11.1.1 because 9.1.3 is not more available as nuget package (#8472) * Bypass cache for XSRF Tokens (#8470) Fixes #8469 * flag exclude children for taxonomies (#8481) * Remove cache by tag on Unpublished (#8483) As it was, cached lists/projections would not be evicted when a ContentItem they contained was unpublished. * Cloning doesn't overwrite identity (#8487) Fixes #8486 * Update nhibernate (#8488) * Update nHibernate to version 4.1.2.4000 # Conflicts: # src/Orchard.Web/Modules/Orchard.ContentPicker/packages.config # src/Orchard.Web/Modules/Orchard.ImportExport/packages.config # src/Orchard.Web/Modules/Orchard.MessageBus/packages.config # src/Orchard.Web/Modules/Orchard.MultiTenancy/packages.config # src/Orchard.Web/Modules/Orchard.Projections/packages.config # src/Orchard.Web/Modules/Orchard.Tags/packages.config # src/Orchard.Web/Modules/Upgrade/packages.config # src/Orchard.Web/Web.config * Update AssemblyBindings for NHibernate * Fixes disposed LifetimeScope issue (#8490) * fixed scope in in recomputing the context to figure out whether an antiforgery token needs replacing * Revert "Cloning doesn't overwrite identity (#8487)" (#8495) This reverts commit af42947c9cfc8ef95a39e7ff672ae8fc0ecf629c. * Remove whitespace when importing list of permissions (#8499) Similarly to what's already being done when we import features. this allows to go to a new line in the xml that we import, and even tabulate for readability and maintenance. * Force enumeration of list of permissions. Without this, imported permissions (#8492) would always replace existing ones: i.e. if an existing permission is not in the list being imported it would be removed for the role. * Projection default settings (#8497) * added settings in projection part * read settings into driver * commit files setting * add logic of filter query * added logic of filter query setting * managed import/export * fixed migration * added message information Co-authored-by: elena.lampugnani * HtmlDecode token (#8501) Added HtmlDecode token management. Needed for #8500 * Sets SSL redirection as permanent for SEO reasons (#8503) Fixes #8502 * Added null checks (#8511) The added null checks manage properly importing definitions that do not contain the properties. * Fix/editmenulink (#8515) * Removed useless spaces * Corrections on ProjectionPart query link (it didn't update the link when changing the selected query). Added edit link for menu in MenuWidget. * Added menuId parameter to menu edit link * Fixed various typos: (#8512) * Added descriptor to audit trail context (#8517) Co-authored-by: Hermes Sbicego Co-authored-by: Imran Azad Co-authored-by: LorenzoFrediani-Laser Co-authored-by: ElenaRepository <50620495+ElenaRepository@users.noreply.github.com> Co-authored-by: Andrea Piovanelli <83577153+AndreaPiovanelliLaser@users.noreply.github.com> --- src/Orchard.Azure.Tests/App.config | 2 +- src/Orchard.Core.Tests/App.config | 2 +- .../Orchard.Core.Tests.csproj | 4 +- src/Orchard.Core.Tests/packages.config | 2 +- src/Orchard.Specs/App.Config | 2 +- .../Hosting/Orchard.Web/Web.config | 4 +- src/Orchard.Specs/Orchard.Specs.csproj | 4 +- src/Orchard.Specs/packages.config | 2 +- src/Orchard.Tests.Modules/App.config | 2 +- .../Orchard.Tests.Modules.csproj | 4 +- src/Orchard.Tests.Modules/packages.config | 2 +- src/Orchard.Tests/App.config | 2 +- .../Orchard.Framework.Tests.csproj | 4 +- src/Orchard.Tests/packages.config | 2 +- src/Orchard.Web.Tests/app.config | 2 +- .../ContainerTypePartSettingsViewModel.cshtml | 2 +- .../Parts.MenuWidget.Edit.cshtml | 27 ++ .../Descriptor/ShellDescriptorManager.cs | 1 - src/Orchard.Web/Core/Web.config | 2 +- src/Orchard.Web/Modules/Lucene/Web.config | 2 +- src/Orchard.Web/Modules/Markdown/Web.config | 2 +- .../Modules/Orchard.Alias/Web.config | 2 +- .../Modules/Orchard.AntiSpam/Web.config | 2 +- .../Modules/Orchard.ArchiveLater/Web.config | 2 +- .../Orchard.AuditTrail.csproj | 6 +- .../Services/AuditTrailManager.cs | 3 +- .../Services/Models/AuditTrailContext.cs | 1 + .../Modules/Orchard.AuditTrail/Web.config | 2 +- .../Orchard.AuditTrail/packages.config | 2 +- .../Modules/Orchard.Autoroute/Web.config | 2 +- .../Controllers/MediaController.cs | 2 +- .../Orchard.Azure.MediaServices.csproj | 5 +- .../Orchard.Azure.MediaServices/Web.config | 2 +- .../packages.config | 4 +- .../Orchard.Azure/Orchard.Azure.csproj | 25 +- .../Modules/Orchard.Azure/Web.config | 2 +- .../Modules/Orchard.Azure/packages.config | 2 +- .../Modules/Orchard.Blogs/Web.config | 2 +- .../Modules/Orchard.Caching/Web.config | 2 +- .../ModuleRootWebConfig.txt | 2 +- .../Modules/Orchard.CodeGeneration/Web.config | 2 +- .../Modules/Orchard.Comments/Web.config | 2 +- .../Modules/Orchard.Conditions/Web.config | 2 +- .../Orchard.ContentPermissions/Web.config | 2 +- .../Orchard.ContentPicker.csproj | 6 +- .../Modules/Orchard.ContentPicker/Web.config | 2 +- .../Orchard.ContentPicker/packages.config | 2 +- .../Modules/Orchard.ContentPreview/Web.config | 6 +- .../Modules/Orchard.ContentTypes/Web.config | 2 +- .../Orchard.CustomForms.csproj | 3 + .../Modules/Orchard.CustomForms/Web.config | 2 +- .../Modules/Orchard.Dashboards/Web.config | 2 +- .../Modules/Orchard.DesignerTools/Web.config | 2 +- .../Modules/Orchard.DynamicForms/Web.config | 2 +- .../Orchard.Email/Orchard.Email.csproj | 4 +- .../Modules/Orchard.Email/Web.config | 2 +- .../Modules/Orchard.Fields/Web.config | 2 +- .../Orchard.Forms/Orchard.Forms.csproj | 3 + .../Modules/Orchard.Forms/Web.config | 2 +- .../Orchard.Glimpse/Orchard.Glimpse.csproj | 4 +- .../Modules/Orchard.Glimpse/Web.config | 2 +- .../Modules/Orchard.Glimpse/packages.config | 2 +- .../Modules/Orchard.ImageEditor/Web.config | 2 +- .../Orchard.ImportExport.csproj | 6 +- .../Modules/Orchard.ImportExport/Web.config | 2 +- .../Orchard.ImportExport/packages.config | 2 +- .../Modules/Orchard.Indexing/Web.config | 2 +- .../Modules/Orchard.JobsQueue/Web.config | 2 +- .../Orchard.Layouts/Orchard.Layouts.csproj | 6 +- .../Modules/Orchard.Layouts/Web.config | 2 +- .../Modules/Orchard.Layouts/packages.config | 4 +- .../Modules/Orchard.Lists/Web.config | 2 +- .../Modules/Orchard.Localization/Web.config | 2 +- .../Modules/Orchard.Media/Web.config | 2 +- .../Orchard.MediaLibrary.WebSearch/Web.config | 6 +- .../Styles/media-library-picker-admin.css | 4 + .../Modules/Orchard.MediaLibrary/Web.config | 2 +- .../Modules/Orchard.MediaPicker/Web.config | 2 +- .../Orchard.MediaProcessing/Web.config | 2 +- .../Orchard.MessageBus.csproj | 4 +- .../Modules/Orchard.MessageBus/Web.config | 2 +- .../Orchard.MessageBus/packages.config | 2 +- .../Modules/Orchard.Migrations/Web.config | 2 +- .../Views/Admin/Features.cshtml | 3 +- .../Modules/Orchard.Modules/Web.config | 2 +- .../Orchard.MultiTenancy.csproj | 6 +- .../Modules/Orchard.MultiTenancy/Web.config | 2 +- .../Orchard.MultiTenancy/packages.config | 2 +- .../Orchard.OpenId/Orchard.OpenId.csproj | 5 +- .../Modules/Orchard.OpenId/Web.config | 6 +- .../Modules/Orchard.OpenId/packages.config | 2 +- .../Filters/OutputCacheFilter.cs | 85 ++++- .../Handlers/CacheItemInvalidationHandler.cs | 3 +- .../Orchard.OutputCache.csproj | 2 +- .../Modules/Orchard.OutputCache/Web.config | 2 +- .../Modules/Orchard.Packaging/Web.config | 2 +- .../Modules/Orchard.Pages/Web.config | 2 +- .../Drivers/ProjectionPartDriver.cs | 147 +++++--- .../Drivers/QueryPartDriver.cs | 2 + .../Modules/Orchard.Projections/Migrations.cs | 45 ++- .../Models/LayoutRecord.cs | 1 + .../Orchard.Projections.csproj | 13 +- .../Settings/ProjectionPartEditorEvents.cs | 269 +++++++++++++++ .../Settings/ProjectionPartSettings.cs | 31 ++ .../Tests/Orchard.Projections.Tests.csproj | 4 +- .../Orchard.Projections/Tests/app.config | 2 +- .../Orchard.Projections/Tests/packages.config | 2 +- .../ViewModels/ProjectionPartEditViewModel.cs | 18 +- .../ProjectionPartSettings.cshtml | 112 ++++++ .../Parts/ProjectionPart.cshtml | 165 ++++++--- .../Modules/Orchard.Projections/Web.config | 2 +- .../Orchard.Projections/packages.config | 2 +- .../Modules/Orchard.PublishLater/Web.config | 2 +- .../Modules/Orchard.Recipes/Web.config | 2 +- .../Orchard.Redis/Orchard.Redis.csproj | 4 +- .../Modules/Orchard.Redis/Web.config | 2 +- .../Modules/Orchard.Redis/packages.config | 2 +- .../Modules/Orchard.Resources/Web.config | 6 +- .../Recipes/Executors/RolesStep.cs | 6 +- .../Modules/Orchard.Roles/Web.config | 2 +- .../Modules/Orchard.Rules/Web.config | 2 +- .../Orchard.Scripting.CSharp/Web.config | 2 +- .../Modules/Orchard.Scripting.Dlr/Web.config | 2 +- .../Modules/Orchard.Scripting/Web.config | 2 +- .../Modules/Orchard.Search/Web.config | 2 +- .../Filters/SecureSocketsLayersFilter.cs | 8 +- .../Models/SslSettingsPart.cs | 9 + .../Services/SecureSocketsLayerService.cs | 3 +- .../Parts/SecureSocketsLayer.Settings.cshtml | 5 + .../Orchard.SecureSocketsLayer/Web.config | 2 +- .../Modules/Orchard.Setup/Web.config | 2 +- .../Modules/Orchard.Tags/Orchard.Tags.csproj | 6 +- .../Modules/Orchard.Tags/Web.config | 2 +- .../Modules/Orchard.Tags/packages.config | 2 +- .../Modules/Orchard.TaskLease/Web.config | 2 +- .../Orchard.Taxonomies.csproj | 7 +- .../Projections/TermsFilter.cs | 7 +- .../Projections/TermsFilterForms.cs | 9 +- .../Modules/Orchard.Taxonomies/Web.config | 2 +- .../Orchard.Taxonomies/packages.config | 4 +- .../Modules/Orchard.Templates/Web.config | 2 +- .../Modules/Orchard.Themes/Web.config | 2 +- .../Orchard.Tokens/Providers/TextTokens.cs | 5 +- .../Modules/Orchard.Tokens/Tests/app.config | 2 +- .../Modules/Orchard.Tokens/Web.config | 2 +- .../Orchard.Users/Activities/UserActivity.cs | 2 +- .../Modules/Orchard.Users/Web.config | 2 +- .../Modules/Orchard.Warmup/Web.config | 2 +- .../Orchard.Widgets/Orchard.Widgets.csproj | 4 + .../Views/WidgetPlacement.Zones.cshtml | 4 +- .../Modules/Orchard.Widgets/Web.config | 2 +- .../Modules/Orchard.Workflows/Web.config | 2 +- .../Modules/Orchard.jQuery/Web.config | 2 +- .../Modules/SysCache/SysCache.csproj | 4 +- src/Orchard.Web/Modules/SysCache/Web.config | 2 +- .../Modules/SysCache/packages.config | 2 +- src/Orchard.Web/Modules/TinyMce/Web.config | 2 +- .../Modules/Upgrade/Upgrade.csproj | 6 +- src/Orchard.Web/Modules/Upgrade/Web.config | 2 +- .../Modules/Upgrade/packages.config | 2 +- src/Orchard.Web/Orchard.Web.csproj | 2 +- src/Orchard.Web/Themes/Web.config | 6 +- src/Orchard.Web/Web.config | 326 +++++++++--------- src/Orchard/Orchard.Framework.csproj | 4 +- src/Orchard/UI/Navigation/NavigationHelper.cs | 2 +- src/Orchard/app.config | 2 +- src/Orchard/packages.config | 2 +- 167 files changed, 1246 insertions(+), 460 deletions(-) create mode 100644 src/Orchard.Web/Modules/Orchard.Projections/Settings/ProjectionPartEditorEvents.cs create mode 100644 src/Orchard.Web/Modules/Orchard.Projections/Settings/ProjectionPartSettings.cs create mode 100644 src/Orchard.Web/Modules/Orchard.Projections/Views/DefinitionTemplates/ProjectionPartSettings.cshtml diff --git a/src/Orchard.Azure.Tests/App.config b/src/Orchard.Azure.Tests/App.config index 0c21c1d2b..87a215974 100644 --- a/src/Orchard.Azure.Tests/App.config +++ b/src/Orchard.Azure.Tests/App.config @@ -21,7 +21,7 @@ - + diff --git a/src/Orchard.Core.Tests/App.config b/src/Orchard.Core.Tests/App.config index 1d39b06b2..9493cfeea 100644 --- a/src/Orchard.Core.Tests/App.config +++ b/src/Orchard.Core.Tests/App.config @@ -4,7 +4,7 @@ - + diff --git a/src/Orchard.Core.Tests/Orchard.Core.Tests.csproj b/src/Orchard.Core.Tests/Orchard.Core.Tests.csproj index 2d681498d..5975afdfc 100644 --- a/src/Orchard.Core.Tests/Orchard.Core.Tests.csproj +++ b/src/Orchard.Core.Tests/Orchard.Core.Tests.csproj @@ -74,8 +74,8 @@ ..\packages\Moq.4.2.1510.2205\lib\net40\Moq.dll - - ..\packages\NHibernate.4.0.1.4000\lib\net40\NHibernate.dll + + ..\packages\NHibernate.4.1.2.4000\lib\net40\NHibernate.dll ..\packages\NUnit.2.5.10.11092\lib\nunit.framework.dll diff --git a/src/Orchard.Core.Tests/packages.config b/src/Orchard.Core.Tests/packages.config index 281af0b9a..5dfae4e76 100644 --- a/src/Orchard.Core.Tests/packages.config +++ b/src/Orchard.Core.Tests/packages.config @@ -8,6 +8,6 @@ - + \ No newline at end of file diff --git a/src/Orchard.Specs/App.Config b/src/Orchard.Specs/App.Config index d13741e46..1301cf635 100644 --- a/src/Orchard.Specs/App.Config +++ b/src/Orchard.Specs/App.Config @@ -12,7 +12,7 @@ - + diff --git a/src/Orchard.Specs/Hosting/Orchard.Web/Web.config b/src/Orchard.Specs/Hosting/Orchard.Web/Web.config index 0f21714a7..2d7f75727 100644 --- a/src/Orchard.Specs/Hosting/Orchard.Web/Web.config +++ b/src/Orchard.Specs/Hosting/Orchard.Web/Web.config @@ -53,9 +53,9 @@ - + - + diff --git a/src/Orchard.Specs/Orchard.Specs.csproj b/src/Orchard.Specs/Orchard.Specs.csproj index db93ea19a..787f44c65 100644 --- a/src/Orchard.Specs/Orchard.Specs.csproj +++ b/src/Orchard.Specs/Orchard.Specs.csproj @@ -83,8 +83,8 @@ ..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - - ..\packages\NHibernate.4.0.1.4000\lib\net40\NHibernate.dll + + ..\packages\NHibernate.4.1.2.4000\lib\net40\NHibernate.dll ..\packages\NUnit.2.5.10.11092\lib\nunit.framework.dll diff --git a/src/Orchard.Specs/packages.config b/src/Orchard.Specs/packages.config index 4e36423e3..840821420 100644 --- a/src/Orchard.Specs/packages.config +++ b/src/Orchard.Specs/packages.config @@ -10,7 +10,7 @@ - + diff --git a/src/Orchard.Tests.Modules/App.config b/src/Orchard.Tests.Modules/App.config index a9ecc2457..a5baeb2d4 100644 --- a/src/Orchard.Tests.Modules/App.config +++ b/src/Orchard.Tests.Modules/App.config @@ -20,7 +20,7 @@ - + diff --git a/src/Orchard.Tests.Modules/Orchard.Tests.Modules.csproj b/src/Orchard.Tests.Modules/Orchard.Tests.Modules.csproj index e2c999fb2..0c143f833 100644 --- a/src/Orchard.Tests.Modules/Orchard.Tests.Modules.csproj +++ b/src/Orchard.Tests.Modules/Orchard.Tests.Modules.csproj @@ -111,8 +111,8 @@ ..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll - - ..\packages\NHibernate.4.0.1.4000\lib\net40\NHibernate.dll + + ..\packages\NHibernate.4.1.2.4000\lib\net40\NHibernate.dll ..\packages\Orchard.NuGet.Core.1.1.0.0\lib\NuGet.Core.dll diff --git a/src/Orchard.Tests.Modules/packages.config b/src/Orchard.Tests.Modules/packages.config index 5b87e0145..c66e5ff69 100644 --- a/src/Orchard.Tests.Modules/packages.config +++ b/src/Orchard.Tests.Modules/packages.config @@ -13,7 +13,7 @@ - + diff --git a/src/Orchard.Tests/App.config b/src/Orchard.Tests/App.config index a9ecc2457..a5baeb2d4 100644 --- a/src/Orchard.Tests/App.config +++ b/src/Orchard.Tests/App.config @@ -20,7 +20,7 @@ - + diff --git a/src/Orchard.Tests/Orchard.Framework.Tests.csproj b/src/Orchard.Tests/Orchard.Framework.Tests.csproj index 7d971ba4c..1449ee13c 100644 --- a/src/Orchard.Tests/Orchard.Framework.Tests.csproj +++ b/src/Orchard.Tests/Orchard.Framework.Tests.csproj @@ -108,8 +108,8 @@ ..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll - - ..\packages\NHibernate.4.0.1.4000\lib\net40\NHibernate.dll + + ..\packages\NHibernate.4.1.2.4000\lib\net40\NHibernate.dll ..\packages\NUnit.2.5.10.11092\lib\nunit.framework.dll diff --git a/src/Orchard.Tests/packages.config b/src/Orchard.Tests/packages.config index f55f8de5b..56276c608 100644 --- a/src/Orchard.Tests/packages.config +++ b/src/Orchard.Tests/packages.config @@ -15,7 +15,7 @@ - + \ No newline at end of file diff --git a/src/Orchard.Web.Tests/app.config b/src/Orchard.Web.Tests/app.config index 70bcde886..40946b381 100644 --- a/src/Orchard.Web.Tests/app.config +++ b/src/Orchard.Web.Tests/app.config @@ -8,7 +8,7 @@ - + diff --git a/src/Orchard.Web/Core/Containers/Views/DefinitionTemplates/ContainerTypePartSettingsViewModel.cshtml b/src/Orchard.Web/Core/Containers/Views/DefinitionTemplates/ContainerTypePartSettingsViewModel.cshtml index c5bffa52f..ca3283415 100644 --- a/src/Orchard.Web/Core/Containers/Views/DefinitionTemplates/ContainerTypePartSettingsViewModel.cshtml +++ b/src/Orchard.Web/Core/Containers/Views/DefinitionTemplates/ContainerTypePartSettingsViewModel.cshtml @@ -22,7 +22,7 @@
@Html.LabelFor(m => m.EnablePositioning, @T("Enable drag and drop")) @Html.EditorFor(m => m.EnablePositioning) - @T("Check this option to enable manual repositioning of items using drag and drop. If not set, this option will be configurable on the list content item itself.") + @T("Check this option to enable manual repositioning of items using drag and drop. If not set, this option will be configurable on the content item itself.")
@Html.LabelFor(m => m.AdminListViewName, @T("List View")) diff --git a/src/Orchard.Web/Core/Navigation/Views/EditorTemplates/Parts.MenuWidget.Edit.cshtml b/src/Orchard.Web/Core/Navigation/Views/EditorTemplates/Parts.MenuWidget.Edit.cshtml index 8e49145e9..048775c9e 100644 --- a/src/Orchard.Web/Core/Navigation/Views/EditorTemplates/Parts.MenuWidget.Edit.cshtml +++ b/src/Orchard.Web/Core/Navigation/Views/EditorTemplates/Parts.MenuWidget.Edit.cshtml @@ -2,13 +2,23 @@ @using Orchard.ContentManagement +@{ + var selectedMenuId = -1; +} +
@Html.LabelFor(m => m.CurrentMenuId, T("For Menu")) + @if (selectedMenuId != -1) { + @Html.ActionLink(T("Edit Menu").Text, "Index", new { area = "Navigation", menuId = selectedMenuId }, new { id = "editMenuLink" }) + } @T("Select which menu you want to display")
@@ -49,3 +59,20 @@ @T("Check for the menu to be displayed without filtering the selected current page.")
+ +@using (Script.Foot()) { + +} \ No newline at end of file diff --git a/src/Orchard.Web/Core/Settings/Descriptor/ShellDescriptorManager.cs b/src/Orchard.Web/Core/Settings/Descriptor/ShellDescriptorManager.cs index 4ffd7846e..d21134c2a 100644 --- a/src/Orchard.Web/Core/Settings/Descriptor/ShellDescriptorManager.cs +++ b/src/Orchard.Web/Core/Settings/Descriptor/ShellDescriptorManager.cs @@ -18,7 +18,6 @@ namespace Orchard.Core.Settings.Descriptor { private readonly ILockingProvider _lockingProvider; private readonly ICacheManager _cacheManager; private readonly ISignals _signals; - public ShellDescriptorManager( IRepository shellDescriptorRepository, IShellDescriptorManagerEventHandler events, diff --git a/src/Orchard.Web/Core/Web.config b/src/Orchard.Web/Core/Web.config index e7ff32b0a..f1d1c37b1 100644 --- a/src/Orchard.Web/Core/Web.config +++ b/src/Orchard.Web/Core/Web.config @@ -47,7 +47,7 @@
- + diff --git a/src/Orchard.Web/Modules/Lucene/Web.config b/src/Orchard.Web/Modules/Lucene/Web.config index a15b1d53f..838f7a02b 100644 --- a/src/Orchard.Web/Modules/Lucene/Web.config +++ b/src/Orchard.Web/Modules/Lucene/Web.config @@ -46,7 +46,7 @@ - + diff --git a/src/Orchard.Web/Modules/Markdown/Web.config b/src/Orchard.Web/Modules/Markdown/Web.config index 2744c49fc..4f8a57128 100644 --- a/src/Orchard.Web/Modules/Markdown/Web.config +++ b/src/Orchard.Web/Modules/Markdown/Web.config @@ -47,7 +47,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Alias/Web.config b/src/Orchard.Web/Modules/Orchard.Alias/Web.config index 2744c49fc..4f8a57128 100644 --- a/src/Orchard.Web/Modules/Orchard.Alias/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Alias/Web.config @@ -47,7 +47,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.AntiSpam/Web.config b/src/Orchard.Web/Modules/Orchard.AntiSpam/Web.config index 2744c49fc..4f8a57128 100644 --- a/src/Orchard.Web/Modules/Orchard.AntiSpam/Web.config +++ b/src/Orchard.Web/Modules/Orchard.AntiSpam/Web.config @@ -47,7 +47,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.ArchiveLater/Web.config b/src/Orchard.Web/Modules/Orchard.ArchiveLater/Web.config index 2744c49fc..4f8a57128 100644 --- a/src/Orchard.Web/Modules/Orchard.ArchiveLater/Web.config +++ b/src/Orchard.Web/Modules/Orchard.ArchiveLater/Web.config @@ -47,7 +47,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.AuditTrail/Orchard.AuditTrail.csproj b/src/Orchard.Web/Modules/Orchard.AuditTrail/Orchard.AuditTrail.csproj index 0c8bb6ef3..8a5a77d4a 100644 --- a/src/Orchard.Web/Modules/Orchard.AuditTrail/Orchard.AuditTrail.csproj +++ b/src/Orchard.Web/Modules/Orchard.AuditTrail/Orchard.AuditTrail.csproj @@ -67,8 +67,8 @@ ..\..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll - - ..\..\..\packages\NHibernate.4.0.1.4000\lib\net40\NHibernate.dll + + ..\..\..\packages\NHibernate.4.1.2.4000\lib\net40\NHibernate.dll @@ -407,4 +407,4 @@ - + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.AuditTrail/Services/AuditTrailManager.cs b/src/Orchard.Web/Modules/Orchard.AuditTrail/Services/AuditTrailManager.cs index 63b692bc3..0eb23b92a 100644 --- a/src/Orchard.Web/Modules/Orchard.AuditTrail/Services/AuditTrailManager.cs +++ b/src/Orchard.Web/Modules/Orchard.AuditTrail/Services/AuditTrailManager.cs @@ -176,7 +176,8 @@ namespace Orchard.AuditTrail.Services { Properties = properties, EventData = eventData, EventFilterKey = eventFilterKey, - EventFilterData = eventFilterData + EventFilterData = eventFilterData, + EventDescriptor = eventDescriptor }; _auditTrailEventHandlers.Create(context); diff --git a/src/Orchard.Web/Modules/Orchard.AuditTrail/Services/Models/AuditTrailContext.cs b/src/Orchard.Web/Modules/Orchard.AuditTrail/Services/Models/AuditTrailContext.cs index 30b1303c4..9e65e1289 100644 --- a/src/Orchard.Web/Modules/Orchard.AuditTrail/Services/Models/AuditTrailContext.cs +++ b/src/Orchard.Web/Modules/Orchard.AuditTrail/Services/Models/AuditTrailContext.cs @@ -13,5 +13,6 @@ namespace Orchard.AuditTrail.Services.Models { public IDictionary EventData { get; set; } public string EventFilterKey { get; set; } public string EventFilterData { get; set; } + public AuditTrailEventDescriptor EventDescriptor { get; set; } } } \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.AuditTrail/Web.config b/src/Orchard.Web/Modules/Orchard.AuditTrail/Web.config index 5d9ad0c4b..fd3b84728 100644 --- a/src/Orchard.Web/Modules/Orchard.AuditTrail/Web.config +++ b/src/Orchard.Web/Modules/Orchard.AuditTrail/Web.config @@ -48,7 +48,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.AuditTrail/packages.config b/src/Orchard.Web/Modules/Orchard.AuditTrail/packages.config index b422b9627..09d7889ca 100644 --- a/src/Orchard.Web/Modules/Orchard.AuditTrail/packages.config +++ b/src/Orchard.Web/Modules/Orchard.AuditTrail/packages.config @@ -7,6 +7,6 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Autoroute/Web.config b/src/Orchard.Web/Modules/Orchard.Autoroute/Web.config index 08efe11cd..ed280e499 100644 --- a/src/Orchard.Web/Modules/Orchard.Autoroute/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Autoroute/Web.config @@ -46,7 +46,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Controllers/MediaController.cs b/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Controllers/MediaController.cs index 68c65ed27..796e9ec0d 100644 --- a/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Controllers/MediaController.cs +++ b/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Controllers/MediaController.cs @@ -154,7 +154,7 @@ namespace Orchard.Azure.MediaServices.Controllers { _transactionManager.Cancel(); Logger.Error(ex, "Error while saving cloud video item with ID {0}.", part.Id); - _notifier.Error(T("An error occurred while saving the cloud video item:\n{1}", ex.Message)); + _notifier.Error(T("An error occurred while saving the cloud video item:\n{0}", ex.Message)); } return RedirectToAction("Edit", new { id = part.Id }); diff --git a/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Orchard.Azure.MediaServices.csproj b/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Orchard.Azure.MediaServices.csproj index a6448592a..bb3d4b30b 100644 --- a/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Orchard.Azure.MediaServices.csproj +++ b/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Orchard.Azure.MediaServices.csproj @@ -115,8 +115,8 @@ ..\..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll - - ..\..\..\packages\NHibernate.4.0.1.4000\lib\net40\NHibernate.dll + + ..\..\..\packages\NHibernate.4.1.2.4000\lib\net40\NHibernate.dll @@ -533,6 +533,7 @@ + diff --git a/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Web.config b/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Web.config index b750a7c2d..c45888281 100644 --- a/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Web.config @@ -68,7 +68,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/packages.config b/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/packages.config index 80338ec52..37fac939c 100644 --- a/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/packages.config +++ b/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/packages.config @@ -17,11 +17,11 @@ - + - + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Azure/Orchard.Azure.csproj b/src/Orchard.Web/Modules/Orchard.Azure/Orchard.Azure.csproj index 7bc8917a1..63b0a0d7b 100644 --- a/src/Orchard.Web/Modules/Orchard.Azure/Orchard.Azure.csproj +++ b/src/Orchard.Web/Modules/Orchard.Azure/Orchard.Azure.csproj @@ -57,6 +57,18 @@ ..\..\..\packages\log4net.2.0.12\lib\net45\log4net.dll + + ..\..\..\packages\Microsoft.WindowsAzure.Caching.2.4.0.0\lib\net40-full\Microsoft.ApplicationServer.Caching.AzureClientHelper.dll + + + ..\..\..\packages\Microsoft.WindowsAzure.Caching.2.4.0.0\lib\net40-full\Microsoft.ApplicationServer.Caching.AzureCommon.dll + + + ..\..\..\packages\Microsoft.WindowsAzure.Caching.2.4.0.0\lib\net40-full\Microsoft.ApplicationServer.Caching.Client.dll + + + ..\..\..\packages\Microsoft.WindowsAzure.Caching.2.4.0.0\lib\net40-full\Microsoft.ApplicationServer.Caching.Core.dll + ..\..\..\packages\Microsoft.Azure.KeyVault.Core.1.0.0\lib\net40\Microsoft.Azure.KeyVault.Core.dll @@ -69,6 +81,9 @@ ..\..\..\packages\Microsoft.Data.Services.Client.5.8.4\lib\net40\Microsoft.Data.Services.Client.dll + + ..\..\..\packages\Microsoft.WindowsAzure.Caching.2.4.0.0\lib\net40-full\Microsoft.Web.DistributedCache.dll + ..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll @@ -81,11 +96,17 @@ ..\..\..\packages\WindowsAzure.Storage.5.0.2\lib\net40\Microsoft.WindowsAzure.Storage.dll + + ..\..\..\packages\Microsoft.WindowsAzure.Caching.2.4.0.0\lib\net40-full\Microsoft.WindowsFabric.Common.dll + + + ..\..\..\packages\Microsoft.WindowsAzure.Caching.2.4.0.0\lib\net40-full\Microsoft.WindowsFabric.Data.Common.dll + ..\..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll - - ..\..\..\packages\NHibernate.4.0.1.4000\lib\net40\NHibernate.dll + + ..\..\..\packages\NHibernate.4.1.2.4000\lib\net40\NHibernate.dll diff --git a/src/Orchard.Web/Modules/Orchard.Azure/Web.config b/src/Orchard.Web/Modules/Orchard.Azure/Web.config index 0a9ea2b0c..8329e0fe5 100644 --- a/src/Orchard.Web/Modules/Orchard.Azure/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Azure/Web.config @@ -71,7 +71,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Azure/packages.config b/src/Orchard.Web/Modules/Orchard.Azure/packages.config index 5ce36dd18..1caf16749 100644 --- a/src/Orchard.Web/Modules/Orchard.Azure/packages.config +++ b/src/Orchard.Web/Modules/Orchard.Azure/packages.config @@ -13,7 +13,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Web.config b/src/Orchard.Web/Modules/Orchard.Blogs/Web.config index 2744c49fc..4f8a57128 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Web.config @@ -47,7 +47,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Caching/Web.config b/src/Orchard.Web/Modules/Orchard.Caching/Web.config index ea7b33d10..55f6ea000 100644 --- a/src/Orchard.Web/Modules/Orchard.Caching/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Caching/Web.config @@ -41,7 +41,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.CodeGeneration/CodeGenerationTemplates/ModuleRootWebConfig.txt b/src/Orchard.Web/Modules/Orchard.CodeGeneration/CodeGenerationTemplates/ModuleRootWebConfig.txt index 5a21d7120..8ac009d41 100644 --- a/src/Orchard.Web/Modules/Orchard.CodeGeneration/CodeGenerationTemplates/ModuleRootWebConfig.txt +++ b/src/Orchard.Web/Modules/Orchard.CodeGeneration/CodeGenerationTemplates/ModuleRootWebConfig.txt @@ -52,7 +52,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.CodeGeneration/Web.config b/src/Orchard.Web/Modules/Orchard.CodeGeneration/Web.config index ea7b33d10..55f6ea000 100644 --- a/src/Orchard.Web/Modules/Orchard.CodeGeneration/Web.config +++ b/src/Orchard.Web/Modules/Orchard.CodeGeneration/Web.config @@ -41,7 +41,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Comments/Web.config b/src/Orchard.Web/Modules/Orchard.Comments/Web.config index d7111e65a..deb3bcc9f 100644 --- a/src/Orchard.Web/Modules/Orchard.Comments/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Comments/Web.config @@ -47,7 +47,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Conditions/Web.config b/src/Orchard.Web/Modules/Orchard.Conditions/Web.config index 6f602be1e..b53ff8a57 100644 --- a/src/Orchard.Web/Modules/Orchard.Conditions/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Conditions/Web.config @@ -44,7 +44,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.ContentPermissions/Web.config b/src/Orchard.Web/Modules/Orchard.ContentPermissions/Web.config index 2744c49fc..4f8a57128 100644 --- a/src/Orchard.Web/Modules/Orchard.ContentPermissions/Web.config +++ b/src/Orchard.Web/Modules/Orchard.ContentPermissions/Web.config @@ -47,7 +47,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.ContentPicker/Orchard.ContentPicker.csproj b/src/Orchard.Web/Modules/Orchard.ContentPicker/Orchard.ContentPicker.csproj index b96837b3a..495e27d9c 100644 --- a/src/Orchard.Web/Modules/Orchard.ContentPicker/Orchard.ContentPicker.csproj +++ b/src/Orchard.Web/Modules/Orchard.ContentPicker/Orchard.ContentPicker.csproj @@ -65,8 +65,8 @@ ..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - - ..\..\..\packages\NHibernate.4.0.1.4000\lib\net40\NHibernate.dll + + ..\..\..\packages\NHibernate.4.1.2.4000\lib\net40\NHibernate.dll @@ -255,4 +255,4 @@ - + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.ContentPicker/Web.config b/src/Orchard.Web/Modules/Orchard.ContentPicker/Web.config index 2744c49fc..4f8a57128 100644 --- a/src/Orchard.Web/Modules/Orchard.ContentPicker/Web.config +++ b/src/Orchard.Web/Modules/Orchard.ContentPicker/Web.config @@ -47,7 +47,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.ContentPicker/packages.config b/src/Orchard.Web/Modules/Orchard.ContentPicker/packages.config index 128126181..178fa800f 100644 --- a/src/Orchard.Web/Modules/Orchard.ContentPicker/packages.config +++ b/src/Orchard.Web/Modules/Orchard.ContentPicker/packages.config @@ -6,5 +6,5 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.ContentPreview/Web.config b/src/Orchard.Web/Modules/Orchard.ContentPreview/Web.config index b469dc604..6516cd899 100644 --- a/src/Orchard.Web/Modules/Orchard.ContentPreview/Web.config +++ b/src/Orchard.Web/Modules/Orchard.ContentPreview/Web.config @@ -52,7 +52,7 @@ - + @@ -78,10 +78,6 @@ - - - - diff --git a/src/Orchard.Web/Modules/Orchard.ContentTypes/Web.config b/src/Orchard.Web/Modules/Orchard.ContentTypes/Web.config index 2744c49fc..4f8a57128 100644 --- a/src/Orchard.Web/Modules/Orchard.ContentTypes/Web.config +++ b/src/Orchard.Web/Modules/Orchard.ContentTypes/Web.config @@ -47,7 +47,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.CustomForms/Orchard.CustomForms.csproj b/src/Orchard.Web/Modules/Orchard.CustomForms/Orchard.CustomForms.csproj index c6d9354c2..3f38e0295 100644 --- a/src/Orchard.Web/Modules/Orchard.CustomForms/Orchard.CustomForms.csproj +++ b/src/Orchard.Web/Modules/Orchard.CustomForms/Orchard.CustomForms.csproj @@ -178,6 +178,9 @@ + + + 10.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) diff --git a/src/Orchard.Web/Modules/Orchard.CustomForms/Web.config b/src/Orchard.Web/Modules/Orchard.CustomForms/Web.config index 2744c49fc..4f8a57128 100644 --- a/src/Orchard.Web/Modules/Orchard.CustomForms/Web.config +++ b/src/Orchard.Web/Modules/Orchard.CustomForms/Web.config @@ -47,7 +47,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Dashboards/Web.config b/src/Orchard.Web/Modules/Orchard.Dashboards/Web.config index 90bb5aef6..d1893d102 100644 --- a/src/Orchard.Web/Modules/Orchard.Dashboards/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Dashboards/Web.config @@ -48,7 +48,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.DesignerTools/Web.config b/src/Orchard.Web/Modules/Orchard.DesignerTools/Web.config index 55aaeee51..900c0ead8 100644 --- a/src/Orchard.Web/Modules/Orchard.DesignerTools/Web.config +++ b/src/Orchard.Web/Modules/Orchard.DesignerTools/Web.config @@ -48,7 +48,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.DynamicForms/Web.config b/src/Orchard.Web/Modules/Orchard.DynamicForms/Web.config index 32432f7cc..b5c1243b7 100644 --- a/src/Orchard.Web/Modules/Orchard.DynamicForms/Web.config +++ b/src/Orchard.Web/Modules/Orchard.DynamicForms/Web.config @@ -50,7 +50,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Email/Orchard.Email.csproj b/src/Orchard.Web/Modules/Orchard.Email/Orchard.Email.csproj index b0de9f776..86c5ec201 100644 --- a/src/Orchard.Web/Modules/Orchard.Email/Orchard.Email.csproj +++ b/src/Orchard.Web/Modules/Orchard.Email/Orchard.Email.csproj @@ -100,7 +100,9 @@ - + + Component + diff --git a/src/Orchard.Web/Modules/Orchard.Email/Web.config b/src/Orchard.Web/Modules/Orchard.Email/Web.config index 2744c49fc..4f8a57128 100644 --- a/src/Orchard.Web/Modules/Orchard.Email/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Email/Web.config @@ -47,7 +47,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Fields/Web.config b/src/Orchard.Web/Modules/Orchard.Fields/Web.config index 7840817a4..42ae549ee 100644 --- a/src/Orchard.Web/Modules/Orchard.Fields/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Fields/Web.config @@ -47,7 +47,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Forms/Orchard.Forms.csproj b/src/Orchard.Web/Modules/Orchard.Forms/Orchard.Forms.csproj index c1bd2353f..8d8ca42a5 100644 --- a/src/Orchard.Web/Modules/Orchard.Forms/Orchard.Forms.csproj +++ b/src/Orchard.Web/Modules/Orchard.Forms/Orchard.Forms.csproj @@ -128,6 +128,9 @@ + + + 10.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) diff --git a/src/Orchard.Web/Modules/Orchard.Forms/Web.config b/src/Orchard.Web/Modules/Orchard.Forms/Web.config index b3f79bcdd..b0877d554 100644 --- a/src/Orchard.Web/Modules/Orchard.Forms/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Forms/Web.config @@ -43,7 +43,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Glimpse/Orchard.Glimpse.csproj b/src/Orchard.Web/Modules/Orchard.Glimpse/Orchard.Glimpse.csproj index 9cf1f39bf..288e5b1db 100644 --- a/src/Orchard.Web/Modules/Orchard.Glimpse/Orchard.Glimpse.csproj +++ b/src/Orchard.Web/Modules/Orchard.Glimpse/Orchard.Glimpse.csproj @@ -95,8 +95,8 @@ ..\..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll - - ..\..\..\packages\NHibernate.4.0.1.4000\lib\net40\NHibernate.dll + + ..\..\..\packages\NHibernate.4.1.2.4000\lib\net40\NHibernate.dll ..\..\..\packages\Owin.1.0\lib\net40\Owin.dll diff --git a/src/Orchard.Web/Modules/Orchard.Glimpse/Web.config b/src/Orchard.Web/Modules/Orchard.Glimpse/Web.config index 7449a9105..548704ab2 100644 --- a/src/Orchard.Web/Modules/Orchard.Glimpse/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Glimpse/Web.config @@ -76,7 +76,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Glimpse/packages.config b/src/Orchard.Web/Modules/Orchard.Glimpse/packages.config index a85557e27..290b6fb1c 100644 --- a/src/Orchard.Web/Modules/Orchard.Glimpse/packages.config +++ b/src/Orchard.Web/Modules/Orchard.Glimpse/packages.config @@ -17,6 +17,6 @@ - + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.ImageEditor/Web.config b/src/Orchard.Web/Modules/Orchard.ImageEditor/Web.config index cacc9dc55..ae23703ef 100644 --- a/src/Orchard.Web/Modules/Orchard.ImageEditor/Web.config +++ b/src/Orchard.Web/Modules/Orchard.ImageEditor/Web.config @@ -48,7 +48,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.ImportExport/Orchard.ImportExport.csproj b/src/Orchard.Web/Modules/Orchard.ImportExport/Orchard.ImportExport.csproj index fc2546940..245fefdb7 100644 --- a/src/Orchard.Web/Modules/Orchard.ImportExport/Orchard.ImportExport.csproj +++ b/src/Orchard.Web/Modules/Orchard.ImportExport/Orchard.ImportExport.csproj @@ -67,8 +67,8 @@ ..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - - ..\..\..\packages\NHibernate.4.0.1.4000\lib\net40\NHibernate.dll + + ..\..\..\packages\NHibernate.4.1.2.4000\lib\net40\NHibernate.dll @@ -231,4 +231,4 @@ - + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.ImportExport/Web.config b/src/Orchard.Web/Modules/Orchard.ImportExport/Web.config index 2744c49fc..4f8a57128 100644 --- a/src/Orchard.Web/Modules/Orchard.ImportExport/Web.config +++ b/src/Orchard.Web/Modules/Orchard.ImportExport/Web.config @@ -47,7 +47,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.ImportExport/packages.config b/src/Orchard.Web/Modules/Orchard.ImportExport/packages.config index cb7b9c751..16effe48d 100644 --- a/src/Orchard.Web/Modules/Orchard.ImportExport/packages.config +++ b/src/Orchard.Web/Modules/Orchard.ImportExport/packages.config @@ -7,5 +7,5 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Indexing/Web.config b/src/Orchard.Web/Modules/Orchard.Indexing/Web.config index 2744c49fc..4f8a57128 100644 --- a/src/Orchard.Web/Modules/Orchard.Indexing/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Indexing/Web.config @@ -47,7 +47,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.JobsQueue/Web.config b/src/Orchard.Web/Modules/Orchard.JobsQueue/Web.config index 2744c49fc..4f8a57128 100644 --- a/src/Orchard.Web/Modules/Orchard.JobsQueue/Web.config +++ b/src/Orchard.Web/Modules/Orchard.JobsQueue/Web.config @@ -47,7 +47,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Orchard.Layouts.csproj b/src/Orchard.Web/Modules/Orchard.Layouts/Orchard.Layouts.csproj index 6e739b2d0..e3cdf72a5 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Orchard.Layouts.csproj +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Orchard.Layouts.csproj @@ -101,8 +101,8 @@ - - ..\..\..\packages\YamlDotNet.9.1.3\lib\net45\YamlDotNet.dll + + ..\..\..\packages\YamlDotNet.11.1.1\lib\net45\YamlDotNet.dll @@ -639,4 +639,4 @@ - + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Web.config b/src/Orchard.Web/Modules/Orchard.Layouts/Web.config index 082d5aa44..562a440fe 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Web.config @@ -52,7 +52,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/packages.config b/src/Orchard.Web/Modules/Orchard.Layouts/packages.config index c75dbd3d5..3352b0062 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/packages.config +++ b/src/Orchard.Web/Modules/Orchard.Layouts/packages.config @@ -8,5 +8,5 @@ - - + + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Lists/Web.config b/src/Orchard.Web/Modules/Orchard.Lists/Web.config index 2744c49fc..4f8a57128 100644 --- a/src/Orchard.Web/Modules/Orchard.Lists/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Lists/Web.config @@ -47,7 +47,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Localization/Web.config b/src/Orchard.Web/Modules/Orchard.Localization/Web.config index 2744c49fc..4f8a57128 100644 --- a/src/Orchard.Web/Modules/Orchard.Localization/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Localization/Web.config @@ -47,7 +47,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Media/Web.config b/src/Orchard.Web/Modules/Orchard.Media/Web.config index 2744c49fc..4f8a57128 100644 --- a/src/Orchard.Web/Modules/Orchard.Media/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Media/Web.config @@ -47,7 +47,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.MediaLibrary.WebSearch/Web.config b/src/Orchard.Web/Modules/Orchard.MediaLibrary.WebSearch/Web.config index 4527fa5cd..edf8714bd 100644 --- a/src/Orchard.Web/Modules/Orchard.MediaLibrary.WebSearch/Web.config +++ b/src/Orchard.Web/Modules/Orchard.MediaLibrary.WebSearch/Web.config @@ -52,7 +52,7 @@ - + @@ -78,10 +78,6 @@ - - - - diff --git a/src/Orchard.Web/Modules/Orchard.MediaLibrary/Styles/media-library-picker-admin.css b/src/Orchard.Web/Modules/Orchard.MediaLibrary/Styles/media-library-picker-admin.css index a568fde81..4824a1f0a 100644 --- a/src/Orchard.Web/Modules/Orchard.MediaLibrary/Styles/media-library-picker-admin.css +++ b/src/Orchard.Web/Modules/Orchard.MediaLibrary/Styles/media-library-picker-admin.css @@ -54,6 +54,10 @@ height: 40px; overflow: hidden; } +.thumbnail .overlay { + height: 40px; + overflow: hidden; +} .overlay h3 { padding-right:5px; diff --git a/src/Orchard.Web/Modules/Orchard.MediaLibrary/Web.config b/src/Orchard.Web/Modules/Orchard.MediaLibrary/Web.config index 55aaeee51..900c0ead8 100644 --- a/src/Orchard.Web/Modules/Orchard.MediaLibrary/Web.config +++ b/src/Orchard.Web/Modules/Orchard.MediaLibrary/Web.config @@ -48,7 +48,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.MediaPicker/Web.config b/src/Orchard.Web/Modules/Orchard.MediaPicker/Web.config index 2744c49fc..4f8a57128 100644 --- a/src/Orchard.Web/Modules/Orchard.MediaPicker/Web.config +++ b/src/Orchard.Web/Modules/Orchard.MediaPicker/Web.config @@ -47,7 +47,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.MediaProcessing/Web.config b/src/Orchard.Web/Modules/Orchard.MediaProcessing/Web.config index 2744c49fc..4f8a57128 100644 --- a/src/Orchard.Web/Modules/Orchard.MediaProcessing/Web.config +++ b/src/Orchard.Web/Modules/Orchard.MediaProcessing/Web.config @@ -47,7 +47,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.MessageBus/Orchard.MessageBus.csproj b/src/Orchard.Web/Modules/Orchard.MessageBus/Orchard.MessageBus.csproj index 09ba9a65c..1c1638884 100644 --- a/src/Orchard.Web/Modules/Orchard.MessageBus/Orchard.MessageBus.csproj +++ b/src/Orchard.Web/Modules/Orchard.MessageBus/Orchard.MessageBus.csproj @@ -58,8 +58,8 @@ ..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - - ..\..\..\packages\NHibernate.4.0.1.4000\lib\net40\NHibernate.dll + + ..\..\..\packages\NHibernate.4.1.2.4000\lib\net40\NHibernate.dll diff --git a/src/Orchard.Web/Modules/Orchard.MessageBus/Web.config b/src/Orchard.Web/Modules/Orchard.MessageBus/Web.config index ea7b33d10..55f6ea000 100644 --- a/src/Orchard.Web/Modules/Orchard.MessageBus/Web.config +++ b/src/Orchard.Web/Modules/Orchard.MessageBus/Web.config @@ -41,7 +41,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.MessageBus/packages.config b/src/Orchard.Web/Modules/Orchard.MessageBus/packages.config index 825ae1bbd..5d8a49534 100644 --- a/src/Orchard.Web/Modules/Orchard.MessageBus/packages.config +++ b/src/Orchard.Web/Modules/Orchard.MessageBus/packages.config @@ -5,5 +5,5 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Migrations/Web.config b/src/Orchard.Web/Modules/Orchard.Migrations/Web.config index ea7b33d10..55f6ea000 100644 --- a/src/Orchard.Web/Modules/Orchard.Migrations/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Migrations/Web.config @@ -41,7 +41,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Modules/Views/Admin/Features.cshtml b/src/Orchard.Web/Modules/Orchard.Modules/Views/Admin/Features.cshtml index 8c9db9489..3e4740b9b 100644 --- a/src/Orchard.Web/Modules/Orchard.Modules/Views/Admin/Features.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Modules/Views/Admin/Features.cshtml @@ -91,7 +91,8 @@ select (from f in Model.Features where f.Descriptor.Id.Equals(d, StringComparison.OrdinalIgnoreCase) select f).SingleOrDefault()).Where(f => f != null).OrderBy(f => f.Descriptor.Name); var missingDependencies = feature.Descriptor.Dependencies .Where(d => !Model.Features.Any(f => f.Descriptor.Id.Equals(d, StringComparison.OrdinalIgnoreCase))); - var showDisable = categoryName.ToString() != "Core"; + var showDisable = categoryName.ToString() != "Core" + || lifecycleStatus == LifecycleStatus.Deprecated; // we should always be able to disable deprecated features even if they are categorized as "Core" var showEnable = Model.IsAllowed(feature.Descriptor.Extension) && !missingDependencies.Any() && feature.Descriptor.Id != "Orchard.Setup"; if (missingDependencies.Any()) { diff --git a/src/Orchard.Web/Modules/Orchard.Modules/Web.config b/src/Orchard.Web/Modules/Orchard.Modules/Web.config index a15b1d53f..838f7a02b 100644 --- a/src/Orchard.Web/Modules/Orchard.Modules/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Modules/Web.config @@ -46,7 +46,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.MultiTenancy/Orchard.MultiTenancy.csproj b/src/Orchard.Web/Modules/Orchard.MultiTenancy/Orchard.MultiTenancy.csproj index 180cd8f72..d2d17ae6d 100644 --- a/src/Orchard.Web/Modules/Orchard.MultiTenancy/Orchard.MultiTenancy.csproj +++ b/src/Orchard.Web/Modules/Orchard.MultiTenancy/Orchard.MultiTenancy.csproj @@ -67,8 +67,8 @@ ..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - - ..\..\..\packages\NHibernate.4.0.1.4000\lib\net40\NHibernate.dll + + ..\..\..\packages\NHibernate.4.1.2.4000\lib\net40\NHibernate.dll @@ -205,4 +205,4 @@ - + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.MultiTenancy/Web.config b/src/Orchard.Web/Modules/Orchard.MultiTenancy/Web.config index a15b1d53f..838f7a02b 100644 --- a/src/Orchard.Web/Modules/Orchard.MultiTenancy/Web.config +++ b/src/Orchard.Web/Modules/Orchard.MultiTenancy/Web.config @@ -46,7 +46,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.MultiTenancy/packages.config b/src/Orchard.Web/Modules/Orchard.MultiTenancy/packages.config index cb7b9c751..16effe48d 100644 --- a/src/Orchard.Web/Modules/Orchard.MultiTenancy/packages.config +++ b/src/Orchard.Web/Modules/Orchard.MultiTenancy/packages.config @@ -7,5 +7,5 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.OpenId/Orchard.OpenId.csproj b/src/Orchard.Web/Modules/Orchard.OpenId/Orchard.OpenId.csproj index 2912bacd2..2e16de39f 100644 --- a/src/Orchard.Web/Modules/Orchard.OpenId/Orchard.OpenId.csproj +++ b/src/Orchard.Web/Modules/Orchard.OpenId/Orchard.OpenId.csproj @@ -143,9 +143,8 @@ ..\..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll - - ..\..\..\packages\NHibernate.4.0.1.4000\lib\net40\NHibernate.dll - True + + ..\..\..\packages\NHibernate.4.1.2.4000\lib\net40\NHibernate.dll ..\..\..\packages\Owin.1.0\lib\net40\Owin.dll diff --git a/src/Orchard.Web/Modules/Orchard.OpenId/Web.config b/src/Orchard.Web/Modules/Orchard.OpenId/Web.config index 130d7b2ed..53ebd1549 100644 --- a/src/Orchard.Web/Modules/Orchard.OpenId/Web.config +++ b/src/Orchard.Web/Modules/Orchard.OpenId/Web.config @@ -51,7 +51,7 @@ - + @@ -65,10 +65,6 @@ - - - - diff --git a/src/Orchard.Web/Modules/Orchard.OpenId/packages.config b/src/Orchard.Web/Modules/Orchard.OpenId/packages.config index 604cef741..f64591a01 100644 --- a/src/Orchard.Web/Modules/Orchard.OpenId/packages.config +++ b/src/Orchard.Web/Modules/Orchard.OpenId/packages.config @@ -30,7 +30,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.OutputCache/Filters/OutputCacheFilter.cs b/src/Orchard.Web/Modules/Orchard.OutputCache/Filters/OutputCacheFilter.cs index 312c43a96..b37825b3c 100644 --- a/src/Orchard.Web/Modules/Orchard.OutputCache/Filters/OutputCacheFilter.cs +++ b/src/Orchard.Web/Modules/Orchard.OutputCache/Filters/OutputCacheFilter.cs @@ -5,6 +5,7 @@ using System.Globalization; using System.Linq; using System.Net; using System.Text; +using System.Text.RegularExpressions; using System.Threading; using System.Web; using System.Web.Mvc; @@ -16,6 +17,7 @@ using Orchard.Environment.Configuration; using Orchard.Logging; using Orchard.Mvc.Extensions; using Orchard.Mvc.Filters; +using Orchard.Mvc.Html; using Orchard.OutputCache.Helpers; using Orchard.OutputCache.Models; using Orchard.OutputCache.Services; @@ -25,7 +27,8 @@ using Orchard.Utility.Extensions; namespace Orchard.OutputCache.Filters { public class OutputCacheFilter : FilterProvider, IActionFilter, IResultFilter, IDisposable { - + private const string REQUEST_VERIFICATION_TOKEN_BEACON_TAG = "<$request-verification-token-beacon-for-hidden-field />"; + private const string REQUEST_VERIFICATION_TOKEN_INVARIANT_TAG = " _ignoredRelativePaths; public void OnActionExecuting(ActionExecutingContext filterContext) { @@ -237,13 +241,16 @@ namespace Orchard.OutputCache.Filters { Logger.Debug("Response for item '{0}' will not be cached because status code was set to {1} during rendering.", _cacheKey, response.StatusCode); return; } - using (var scope = _workContextAccessor.CreateWorkContextScope()) { + // ask for the WorkContext again so it refreshes in case the scope has been disposed + _workContext = _workContextAccessor.GetContext(filterContext.HttpContext); + var cachedOutput = ReplaceRequestVerificationTokenWithBeaconTag(output, response.ContentEncoding); + var cacheItem = new CacheItem() { CachedOnUtc = _now, Duration = cacheDuration, GraceTime = cacheGraceTime, - Output = output, + Output = cachedOutput, ContentType = response.ContentType, QueryString = filterContext.HttpContext.Request.Url.Query, CacheKey = _cacheKey, @@ -532,25 +539,40 @@ namespace Orchard.OutputCache.Filters { } // Shorcut action execution. - filterContext.Result = new FileContentResult(cacheItem.Output, cacheItem.ContentType); + filterContext.Result = new FileContentResult( + ReplaceBeaconTagWithFreshRequestVerificationToken(cacheItem.Output, response.ContentEncoding), // replace the beacon created by the ReplaceRequestVerificationTokenWithBeacon method witha fresh new one + cacheItem.ContentType); response.StatusCode = cacheItem.StatusCode; // Add ETag header + var itemETag = cacheItem.ETag; if (HttpRuntime.UsingIntegratedPipeline && response.Headers.Get("ETag") == null && cacheItem.ETag != null) { - response.Headers["ETag"] = cacheItem.ETag; + if (_etagNeedsRefresh) { + // Add ETag header for the newly created item + var newEtag = Guid.NewGuid().ToString("n"); + itemETag = ""; + if (HttpRuntime.UsingIntegratedPipeline) { + if (response.Headers.Get("ETag") == null) { + response.Headers["ETag"] = newEtag; + itemETag = newEtag; + } + } + } + else { + response.Headers["ETag"] = itemETag; + } } // Check ETag in request // https://www.w3.org/2005/MWI/BPWG/techs/CachingWithETag.html var etag = request.Headers["If-None-Match"]; - if (!String.IsNullOrEmpty(etag)) { - if (String.Equals(etag, cacheItem.ETag, StringComparison.Ordinal)) { + if (!String.IsNullOrEmpty(etag) && !_etagNeedsRefresh) { + if (String.Equals(etag, itemETag, StringComparison.Ordinal)) { // ETag matches the cached item, we return a 304 filterContext.Result = new HttpStatusCodeResult(HttpStatusCode.NotModified); return; } } - ApplyCacheControl(response); } @@ -602,6 +624,50 @@ namespace Orchard.OutputCache.Filters { } } + private byte[] ReplaceRequestVerificationTokenWithBeaconTag(byte[] source, Encoding encoding) { + // Because of the __RequestVerificationToken hidden field vary by the user, before caching the output, we need to replace the + // __RequestVerificationToken hidden field with a "beacon" text that will be replaced before rendering the page + // with a fresh new __RequestVerificationToken hidden field. + // What we do is to replace every with + // <$request-verification-token-beacon-for-hidden-field /> + if (PreventCachingRequestVerificationToken()) { + var outputString = encoding.GetString(source); + var resultString = new StringBuilder(); + var startIndex = 0; + var verificationTokenTagStartIndex = outputString.IndexOf(REQUEST_VERIFICATION_TOKEN_INVARIANT_TAG, startIndex); //searches in the outputString first byte of RequestVerificationToken input tag + while (verificationTokenTagStartIndex >= 0) { + resultString.Append(outputString.Substring(startIndex, verificationTokenTagStartIndex - startIndex)); //appends to resultString the text before RequestVerificationToken input tag + resultString.Append(REQUEST_VERIFICATION_TOKEN_BEACON_TAG); //appends the beacon placeholder tag + startIndex = outputString.IndexOf("/>", verificationTokenTagStartIndex) + 2; // set the new starting index after the replaced RequestVerificationToken input tag + verificationTokenTagStartIndex = outputString.IndexOf(REQUEST_VERIFICATION_TOKEN_INVARIANT_TAG, startIndex);// searches in the outputString next first byte of RequestVerificationToken input tag + } + resultString.Append(outputString.Substring(startIndex)); // completes the resultString appending the remaining characters + return encoding.GetBytes(resultString.ToString()); + } + return source; + } + + private byte[] ReplaceBeaconTagWithFreshRequestVerificationToken(byte[] source, Encoding encoding) { + // Because of the __RequestVerificationToken hidden field vary by the user, we replace the beacon generated by the ReplaceRequestVerificationTokenWithBeacon method + // with a fresh new __RequestVerificationToken hidden field. + // What we do is to replace every <$request-verification-token-beacon-for-hidden-field /> with + // + if (PreventCachingRequestVerificationToken()) { + var outputString = encoding.GetString(source); + var antiForgeyToken = new HtmlHelper(new ViewContext(), new ViewDataContainer()).AntiForgeryTokenOrchard(); + var resultString = outputString.Replace(REQUEST_VERIFICATION_TOKEN_BEACON_TAG, antiForgeyToken.ToString()); + _etagNeedsRefresh = outputString != resultString; + return encoding.GetBytes(resultString); + } + return source; + } + + private bool PreventCachingRequestVerificationToken() { + return _cacheSettings.CacheAuthenticatedRequests + && (!_cacheSettings.VaryByAuthenticationState + || _workContext.CurrentUser != null); + } + protected virtual bool IsIgnoredUrl(string url) { if (IgnoredRelativePaths == null || !IgnoredRelativePaths.Any()) { return false; @@ -615,7 +681,8 @@ namespace Orchard.OutputCache.Filters { return true; } } - } else { + } + else { // if there is a RequestUrlPrefix, we want to check by also removing it from the // url we are verifying, because the configuration might have been done without it var tmp = url.TrimStart(new[] { '/' }); diff --git a/src/Orchard.Web/Modules/Orchard.OutputCache/Handlers/CacheItemInvalidationHandler.cs b/src/Orchard.Web/Modules/Orchard.OutputCache/Handlers/CacheItemInvalidationHandler.cs index 0850dd716..1661883e0 100644 --- a/src/Orchard.Web/Modules/Orchard.OutputCache/Handlers/CacheItemInvalidationHandler.cs +++ b/src/Orchard.Web/Modules/Orchard.OutputCache/Handlers/CacheItemInvalidationHandler.cs @@ -13,6 +13,7 @@ namespace Orchard.OutputCache.Handlers { // Evict cached content when updated, removed or destroyed. OnPublished((context, part) => Invalidate(part)); + OnUnpublished((context, part) => Invalidate(part)); OnRemoved((context, part) => Invalidate(part)); OnDestroyed((context, part) => Invalidate(part)); } @@ -30,4 +31,4 @@ namespace Orchard.OutputCache.Handlers { } } } -} \ No newline at end of file +} diff --git a/src/Orchard.Web/Modules/Orchard.OutputCache/Orchard.OutputCache.csproj b/src/Orchard.Web/Modules/Orchard.OutputCache/Orchard.OutputCache.csproj index a9882d1ef..40c4b7a19 100644 --- a/src/Orchard.Web/Modules/Orchard.OutputCache/Orchard.OutputCache.csproj +++ b/src/Orchard.Web/Modules/Orchard.OutputCache/Orchard.OutputCache.csproj @@ -218,4 +218,4 @@ - \ No newline at end of file + diff --git a/src/Orchard.Web/Modules/Orchard.OutputCache/Web.config b/src/Orchard.Web/Modules/Orchard.OutputCache/Web.config index 633071ce3..8a0c62fc5 100644 --- a/src/Orchard.Web/Modules/Orchard.OutputCache/Web.config +++ b/src/Orchard.Web/Modules/Orchard.OutputCache/Web.config @@ -47,7 +47,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Packaging/Web.config b/src/Orchard.Web/Modules/Orchard.Packaging/Web.config index d936e11f3..5881dbf28 100644 --- a/src/Orchard.Web/Modules/Orchard.Packaging/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Packaging/Web.config @@ -48,7 +48,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Pages/Web.config b/src/Orchard.Web/Modules/Orchard.Pages/Web.config index eb0b8ea26..a7f7ea8ea 100644 --- a/src/Orchard.Web/Modules/Orchard.Pages/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Pages/Web.config @@ -43,7 +43,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Projections/Drivers/ProjectionPartDriver.cs b/src/Orchard.Web/Modules/Orchard.Projections/Drivers/ProjectionPartDriver.cs index f29097b8d..e23f08f22 100644 --- a/src/Orchard.Web/Modules/Orchard.Projections/Drivers/ProjectionPartDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.Projections/Drivers/ProjectionPartDriver.cs @@ -16,6 +16,7 @@ using Orchard.Projections.Descriptors.Layout; using Orchard.Projections.Descriptors.Property; using Orchard.Projections.Models; using Orchard.Projections.Services; +using Orchard.Projections.Settings; using Orchard.Projections.ViewModels; using Orchard.Tokens; using Orchard.UI.Navigation; @@ -59,7 +60,7 @@ namespace Orchard.Projections.Drivers { // retrieving paging parameters var queryString = Services.WorkContext.HttpContext.Request.QueryString; - + var pageKey = String.IsNullOrWhiteSpace(part.Record.PagerSuffix) ? "page" : "page-" + part.Record.PagerSuffix; var page = 0; @@ -97,7 +98,7 @@ namespace Orchard.Projections.Drivers { return Combined( ContentShape("Parts_ProjectionPart_Pager", shape => { - if(!part.Record.DisplayPager) { + if (!part.Record.DisplayPager) { return null; } @@ -189,7 +190,7 @@ namespace Orchard.Projections.Drivers { var groups = layoutComponents.GroupBy( x => { var propertyShape = ((IEnumerable)x.Properties.Items).First(p => ((PropertyRecord)p.Property).Id == groupPropertyId); - + // clear the wrappers, as they shouldn't be needed to generate the grouping key itself // otherwise the DisplayContext.View is null, and throws an exception if a wrapper is rendered (#18558) ((IShape)propertyShape).Metadata.Wrappers.Clear(); @@ -224,41 +225,76 @@ namespace Orchard.Projections.Drivers { protected override DriverResult Editor(ProjectionPart part, dynamic shapeHelper) { return ContentShape("Parts_ProjectionPart_Edit", () => { + var model = new ProjectionPartEditViewModel(); - var model = new ProjectionPartEditViewModel { - DisplayPager = part.Record.DisplayPager, - Items = part.Record.Items, - ItemsPerPage = part.Record.ItemsPerPage, - Skip = part.Record.Skip, - PagerSuffix = part.Record.PagerSuffix, - MaxItems = part.Record.MaxItems, - QueryLayoutRecordId = "-1", - }; - - // concatenated Query and Layout ids for the view - if (part.Record.QueryPartRecord != null) { - model.QueryLayoutRecordId = part.Record.QueryPartRecord.Id + ";"; - } - - if (part.Record.LayoutRecord != null) { - model.QueryLayoutRecordId += part.Record.LayoutRecord.Id.ToString(); + // for create read the setting values + var settings = part.TypePartDefinition.Settings.GetModel(); + if (part.Id == 0) { + model = new ProjectionPartEditViewModel { + DisplayPager = settings.DisplayPager, + Items = settings.Items, + Skip = settings.Skip, + PagerSuffix = settings.PagerSuffix, + MaxItems = settings.MaxItems, + QueryLayoutRecordId = settings.QueryLayoutRecordId + }; } else { - model.QueryLayoutRecordId += "-1"; + model = new ProjectionPartEditViewModel { + DisplayPager = part.Record.DisplayPager, + Items = part.Record.Items, + ItemsPerPage = part.Record.ItemsPerPage, + Skip = part.Record.Skip, + PagerSuffix = part.Record.PagerSuffix, + MaxItems = part.Record.MaxItems, + QueryLayoutRecordId = "-1" + }; + // concatenated Query and Layout ids for the view + if (part.Record.QueryPartRecord != null) { + model.QueryLayoutRecordId = part.Record.QueryPartRecord.Id + ";"; + } + + if (part.Record.LayoutRecord != null) { + model.QueryLayoutRecordId += part.Record.LayoutRecord.Id.ToString(); + } + else { + model.QueryLayoutRecordId += "-1"; + } } + model.PartId = part.Id; + + // lock fields + model.LockEditingItems = settings.LockEditingItems; + model.LockEditingSkip = settings.LockEditingSkip; + model.LockEditingMaxItems = settings.LockEditingMaxItems; + model.LockEditingPagerSuffix = settings.LockEditingPagerSuffix; + model.LockEditingDisplayPager = settings.LockEditingDisplayPager; + // populating the list of queries and layouts var layouts = _projectionManager.DescribeLayouts().SelectMany(x => x.Descriptors).ToList(); model.QueryRecordEntries = Services.ContentManager.Query().Join().OrderBy(x => x.Title).List() - .Select(x => new QueryRecordEntry { - Id = x.Id, - Name = x.Name, - LayoutRecordEntries = x.Layouts.Select( l => new LayoutRecordEntry { - Id = l.Id, - Description = GetLayoutDescription(layouts, l) - }) - }); + .Select(x => new QueryRecordEntry { + Id = x.Id, + Name = x.Name, + LayoutRecordEntries = x.Layouts.Select(l => new LayoutRecordEntry { + Id = l.Id, + Description = GetLayoutDescription(layouts, l) + }) + }); + // if any values, use default list of the settings + if (!string.IsNullOrWhiteSpace(settings.FilterQueryRecordId)) { + var filterQueryRecordId = settings.FilterQueryRecordId.Split('&'); + model.QueryRecordIdFilterEntries = filterQueryRecordId + .Select(x => new QueryRecordFilterEntry { + Id = x.Split(';')[0], + LayoutId = x.Split(';')[1] + }); + } + else { + model.QueryRecordIdFilterEntries = new List(); + } return shapeHelper.EditorTemplate(TemplateName: TemplateName, Model: model, Prefix: Prefix); }); @@ -266,28 +302,58 @@ namespace Orchard.Projections.Drivers { private static string GetLayoutDescription(IEnumerable layouts, LayoutRecord l) { var descriptor = layouts.FirstOrDefault(x => l.Category == x.Category && l.Type == x.Type); - return String.IsNullOrWhiteSpace(l.Description) ? descriptor.Display(new LayoutContext {State = FormParametersHelper.ToDynamic(l.State)}).Text : l.Description; + return String.IsNullOrWhiteSpace(l.Description) ? descriptor.Display(new LayoutContext { State = FormParametersHelper.ToDynamic(l.State) }).Text : l.Description; } protected override DriverResult Editor(ProjectionPart part, IUpdateModel updater, dynamic shapeHelper) { + var settings = part.TypePartDefinition.Settings.GetModel(); + var model = new ProjectionPartEditViewModel(); - if (updater.TryUpdateModel(model, Prefix, null, null)) { - - var queryLayoutIds = model.QueryLayoutRecordId.Split(new[] {';'}); + updater.TryUpdateModel(model, Prefix, null, null); + model.PartId = part.Id; + + // check the setting, if it is unlocked, assign the setting value + if (settings.LockEditingDisplayPager) { + part.Record.DisplayPager = settings.DisplayPager; + } + else { part.Record.DisplayPager = model.DisplayPager; + } + if (settings.LockEditingItems) { + part.Record.Items = settings.Items; + } + else { part.Record.Items = model.Items; - part.Record.ItemsPerPage = model.ItemsPerPage; + } + part.Record.ItemsPerPage = model.ItemsPerPage; + if (settings.LockEditingSkip) { + part.Record.Skip = settings.Skip; + } + else { part.Record.Skip = model.Skip; + } + if (settings.LockEditingMaxItems) { + part.Record.MaxItems = settings.MaxItems; + } + else { part.Record.MaxItems = model.MaxItems; + } + if (settings.LockEditingPagerSuffix) { + part.Record.PagerSuffix = (settings.PagerSuffix ?? String.Empty).Trim(); + } + else { part.Record.PagerSuffix = (model.PagerSuffix ?? String.Empty).Trim(); - part.Record.QueryPartRecord = _queryRepository.Get(Int32.Parse(queryLayoutIds[0])); - part.Record.LayoutRecord = part.Record.QueryPartRecord.Layouts.FirstOrDefault(x => x.Id == Int32.Parse(queryLayoutIds[1])); + } - if(!String.IsNullOrWhiteSpace(part.Record.PagerSuffix) && !String.Equals(part.Record.PagerSuffix.ToSafeName(), part.Record.PagerSuffix, StringComparison.OrdinalIgnoreCase)) { - updater.AddModelError("PagerSuffix", T("Suffix should not contain special characters.")); - } + var queryLayoutIds = model.QueryLayoutRecordId.Split(new[] { ';' }); + + part.Record.QueryPartRecord = _queryRepository.Get(Int32.Parse(queryLayoutIds[0])); + part.Record.LayoutRecord = part.Record.QueryPartRecord.Layouts.FirstOrDefault(x => x.Id == Int32.Parse(queryLayoutIds[1])); + + if (!String.IsNullOrWhiteSpace(part.Record.PagerSuffix) && !String.Equals(part.Record.PagerSuffix.ToSafeName(), part.Record.PagerSuffix, StringComparison.OrdinalIgnoreCase)) { + updater.AddModelError("PagerSuffix", T("Suffix should not contain special characters.")); } return Editor(part, shapeHelper); @@ -310,7 +376,7 @@ namespace Orchard.Projections.Drivers { protected override void ImportCompleted(ProjectionPart part, ImportContentContext context) { // Assign the query only when everything is imported. var query = context.Attribute(part.PartDefinition.Name, "Query"); - if (query != null) { + if (query != null && context.GetItemFromSession(query).As()!=null) { part.Record.QueryPartRecord = context.GetItemFromSession(query).As().Record; var layoutIndex = context.Attribute(part.PartDefinition.Name, "LayoutIndex"); int layoutIndexValue; @@ -357,3 +423,4 @@ namespace Orchard.Projections.Drivers { } } } + diff --git a/src/Orchard.Web/Modules/Orchard.Projections/Drivers/QueryPartDriver.cs b/src/Orchard.Web/Modules/Orchard.Projections/Drivers/QueryPartDriver.cs index bfc244039..907ea083c 100644 --- a/src/Orchard.Web/Modules/Orchard.Projections/Drivers/QueryPartDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.Projections/Drivers/QueryPartDriver.cs @@ -105,6 +105,7 @@ namespace Orchard.Projections.Drivers { new XAttribute("Display", layout.Display), new XAttribute("DisplayType", layout.DisplayType ?? ""), new XAttribute("Type", layout.Type ?? ""), + new XAttribute("GUIdentifier", layout.GUIdentifier ?? ""), // Properties new XElement("Properties", layout.Properties.Select(GetPropertyXml)), @@ -194,6 +195,7 @@ namespace Orchard.Projections.Drivers { DisplayType = layout.Attribute("DisplayType").Value, State = state, Type = type, + GUIdentifier = string.IsNullOrWhiteSpace(layout.Attribute("GUIdentifier").Value) ? Guid.NewGuid().ToString() : layout.Attribute("GUIdentifier").Value, Properties = layout.Element("Properties").Elements("Property").Select(GetProperty).ToList(), GroupProperty = GetProperty(layout.Element("Group").Element("Property")) }; diff --git a/src/Orchard.Web/Modules/Orchard.Projections/Migrations.cs b/src/Orchard.Web/Modules/Orchard.Projections/Migrations.cs index 36513f028..fb0b4d90a 100644 --- a/src/Orchard.Web/Modules/Orchard.Projections/Migrations.cs +++ b/src/Orchard.Web/Modules/Orchard.Projections/Migrations.cs @@ -1,4 +1,7 @@ -using System.Data; +using System; +using System.Data; +using System.Linq; +using Orchard.ContentManagement; using Orchard.ContentManagement.MetaData; using Orchard.Core.Common.Models; using Orchard.Core.Contents.Extensions; @@ -11,12 +14,16 @@ using Orchard.Projections.Models; namespace Orchard.Projections { public class Migrations : DataMigrationImpl { private readonly IRepository _memberBindingRepository; + private readonly IRepository _layoutRepository; private readonly IRepository _propertyRecordRepository; - + public Migrations( IRepository memberBindingRepository, + IRepository layoutRepository, IRepository propertyRecordRepository) { + _memberBindingRepository = memberBindingRepository; + _layoutRepository = layoutRepository; _propertyRecordRepository = propertyRecordRepository; T = NullLocalizer.Instance; @@ -200,6 +207,7 @@ namespace Orchard.Projections { .WithPart("ProjectionPart") .WithPart("AdminMenuPart", p => p.WithSetting("AdminMenuPartTypeSettings.DefaultPosition", "5")) .Creatable() + .Listable() .DisplayedAs("Projection") ); @@ -257,7 +265,25 @@ namespace Orchard.Projections { .CreateIndex("IDX_Orchard_Projections_DecimalFieldIndexRecords", "FieldIndexPartRecord_Id") ); - return 1; + SchemaBuilder.CreateTable("NavigationQueryPartRecord", + table => table.ContentPartRecord() + .Column("Items") + .Column("Skip") + .Column("QueryPartRecord_id") + ); + + ContentDefinitionManager.AlterTypeDefinition("NavigationQueryMenuItem", + cfg => cfg + .WithPart("NavigationQueryPart") + .WithPart("MenuPart") + .WithPart("CommonPart") + .DisplayedAs("Query Link") + .WithSetting("Description", "Injects menu items from a Query") + .WithSetting("Stereotype", "MenuItem") + .WithIdentity() + ); + + return 4; } public int UpdateFrom1() { @@ -346,5 +372,18 @@ namespace Orchard.Projections { return 6; } #pragma warning restore CS0618 + + public int UpdateFrom6() { + SchemaBuilder.AlterTable("LayoutRecord", t => t.AddColumn("GUIdentifier", + column => column.WithLength(68))); + + var layoutRecords = _layoutRepository.Table.Where(l => l.GUIdentifier == null || l.GUIdentifier == "").ToList(); + foreach (var layout in layoutRecords) { + layout.GUIdentifier = Guid.NewGuid().ToString(); + } + + return 7; + } + } } diff --git a/src/Orchard.Web/Modules/Orchard.Projections/Models/LayoutRecord.cs b/src/Orchard.Web/Modules/Orchard.Projections/Models/LayoutRecord.cs index be8bd03d8..9a249b41e 100644 --- a/src/Orchard.Web/Modules/Orchard.Projections/Models/LayoutRecord.cs +++ b/src/Orchard.Web/Modules/Orchard.Projections/Models/LayoutRecord.cs @@ -9,6 +9,7 @@ namespace Orchard.Projections.Models { } public virtual int Id { get; set; } + public virtual string GUIdentifier { get; set; } public virtual string Description { get; set; } public virtual string Category { get; set; } public virtual string Type { get; set; } diff --git a/src/Orchard.Web/Modules/Orchard.Projections/Orchard.Projections.csproj b/src/Orchard.Web/Modules/Orchard.Projections/Orchard.Projections.csproj index 277bf24ca..3cc9be7c1 100644 --- a/src/Orchard.Web/Modules/Orchard.Projections/Orchard.Projections.csproj +++ b/src/Orchard.Web/Modules/Orchard.Projections/Orchard.Projections.csproj @@ -65,8 +65,8 @@ ..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - - ..\..\..\packages\NHibernate.4.0.1.4000\lib\net40\NHibernate.dll + + ..\..\..\packages\NHibernate.4.1.2.4000\lib\net40\NHibernate.dll @@ -141,6 +141,10 @@ Orchard.Core $(MvcBuildViews) + + {0E7646E8-FE8F-43C1-8799-D97860925EC4} + Orchard.ContentTypes + {98251EAE-A41B-47B2-AA91-E28B8482DA70} Orchard.Conditions @@ -184,6 +188,8 @@ + + @@ -332,6 +338,7 @@ + 10.0 @@ -383,4 +390,4 @@ - + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Projections/Settings/ProjectionPartEditorEvents.cs b/src/Orchard.Web/Modules/Orchard.Projections/Settings/ProjectionPartEditorEvents.cs new file mode 100644 index 000000000..f66f00596 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Projections/Settings/ProjectionPartEditorEvents.cs @@ -0,0 +1,269 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Orchard.ContentManagement; +using Orchard.ContentManagement.MetaData; +using Orchard.ContentManagement.MetaData.Builders; +using Orchard.ContentManagement.MetaData.Models; +using Orchard.ContentManagement.ViewModels; +using Orchard.ContentTypes.Events; +using Orchard.Core.Title.Models; +using Orchard.Data; +using Orchard.Forms.Services; +using Orchard.Localization; +using Orchard.Projections.Descriptors.Layout; +using Orchard.Projections.Models; +using Orchard.Projections.Services; +using Orchard.Projections.ViewModels; +using Orchard.UI.Notify; + +namespace Orchard.Projections.Settings { + public class ProjectionPartEditorEvents : ContentDefinitionEditorEventsBase, IContentDefinitionEventHandler { + private readonly IProjectionManager _projectionManager; + private readonly IContentManager _contentManager; + private readonly IRepository _layoutRepository; + private readonly IContentDefinitionManager _contentDefinitionManager; + + public ProjectionPartEditorEvents( + IOrchardServices services, + IProjectionManager projectionManager, + IContentManager contentManager, + IRepository layoutRepository, + IContentDefinitionManager contentDefinitionManager) { + + _projectionManager = projectionManager; + _contentManager = contentManager; + _layoutRepository = layoutRepository; + _contentDefinitionManager = contentDefinitionManager; + Services = services; + T = NullLocalizer.Instance; + } + public Localizer T { get; set; } + + public IOrchardServices Services { get; set; } + + public override IEnumerable TypePartEditor(ContentTypePartDefinition definition) { + if (definition.PartDefinition.Name == "ProjectionPart") { + var model = definition.Settings.GetModel(); + model.QueryRecordEntries = GetQueriesRecordEntry(); + if (!string.IsNullOrWhiteSpace(model.FilterQueryRecordId)) { + model.FilterQueryRecordsId = model.FilterQueryRecordId.Split('&'); + } + yield return DefinitionTemplate(model); + } + } + + public override IEnumerable TypePartEditorUpdate(ContentTypePartDefinitionBuilder builder, IUpdateModel updateModel) { + if (builder.Name != "ProjectionPart") { + yield break; + } + + var model = new ProjectionPartSettings(); + model.QueryRecordEntries = GetQueriesRecordEntry(); + + + if(updateModel.TryUpdateModel(model, "ProjectionPartSettings", null, null)) { + if (model.FilterQueryRecordsId != null && model.FilterQueryRecordsId.Count()>0) { + // check if default query selected is in filter queries list + if (!model.FilterQueryRecordsId.Contains(model.QueryLayoutRecordId) && model.QueryLayoutRecordId!="-1") { + updateModel.AddModelError("ProjectionPart", T("The default query must be one of the selected queries")); + } + + // also save the identity part of the query and guid of the layout to be used in the import + model.IdentityQueryLayoutRecord = GetIdentityQueryLayout(model.QueryLayoutRecordId); + + model.FilterQueryRecordId = string.Join("&", model.FilterQueryRecordsId); + + List identityForFilterQuery = new List(); + foreach (var record in model.FilterQueryRecordsId) { + identityForFilterQuery.Add(GetIdentityQueryLayout(record)); + } + model.IdentityFilterQueryRecord = string.Join("&", identityForFilterQuery); + } + + builder + .WithSetting("ProjectionPartSettings.QueryLayoutRecordId", model.QueryLayoutRecordId) + .WithSetting("ProjectionPartSettings.IdentityQueryLayoutRecord", model.IdentityQueryLayoutRecord) + .WithSetting("ProjectionPartSettings.FilterQueryRecordId", model.FilterQueryRecordId) + .WithSetting("ProjectionPartSettings.IdentityFilterQueryRecord", model.IdentityFilterQueryRecord) + .WithSetting("ProjectionPartSettings.Items", model.Items.ToString()) + .WithSetting("ProjectionPartSettings.LockEditingItems", model.LockEditingItems.ToString()) + .WithSetting("ProjectionPartSettings.Skip", model.Skip.ToString()) + .WithSetting("ProjectionPartSettings.LockEditingSkip", model.LockEditingSkip.ToString()) + .WithSetting("ProjectionPartSettings.MaxItems", model.MaxItems.ToString()) + .WithSetting("ProjectionPartSettings.LockEditingMaxItems", model.LockEditingMaxItems.ToString()) + .WithSetting("ProjectionPartSettings.PagerSuffix", model.PagerSuffix) + .WithSetting("ProjectionPartSettings.LockEditingPagerSuffix", model.LockEditingPagerSuffix.ToString()) + .WithSetting("ProjectionPartSettings.DisplayPager", model.DisplayPager.ToString()) + .WithSetting("ProjectionPartSettings.LockEditingDisplayPager", model.LockEditingDisplayPager.ToString()); + } + yield return DefinitionTemplate(model); + } + + #region Implementation interface + public void ContentFieldAttached(ContentFieldAttachedContext context) { + } + + public void ContentFieldDetached(ContentFieldDetachedContext context) { + } + + public void ContentPartAttached(ContentPartAttachedContext context) { + } + + public void ContentPartCreated(ContentPartCreatedContext context) { + } + + public void ContentPartDetached(ContentPartDetachedContext context) { + } + + public void ContentPartImported(ContentPartImportedContext context) { + } + + public void ContentPartImporting(ContentPartImportingContext context) { + } + + public void ContentPartRemoved(ContentPartRemovedContext context) { + } + + public void ContentTypeCreated(ContentTypeCreatedContext context) { + } + + public void ContentTypeImported(ContentTypeImportedContext context) { + var part = context.ContentTypeDefinition.Parts + .ToList() + .Where(p => p.PartDefinition.Name == "ProjectionPart") + .FirstOrDefault(); + if (part != null) { + var settings = part.Settings.GetModel(); + + // from identity part of the query and guid of the layout find reference + settings.QueryLayoutRecordId = string.IsNullOrWhiteSpace(settings.IdentityQueryLayoutRecord) + ? "-1" : GetQueryLayoutRecord(settings.IdentityQueryLayoutRecord); + + if (!string.IsNullOrWhiteSpace(settings.IdentityFilterQueryRecord)) { + List identityForFilterQuery = new List(); + foreach (var record in settings.IdentityFilterQueryRecord.Split('&').ToList()) { + var correctId = GetQueryLayoutRecord(record); + if (!string.IsNullOrEmpty(correctId)) { + identityForFilterQuery.Add(correctId); + } + } + settings.FilterQueryRecordId = string.Join("&", identityForFilterQuery); + } else { + settings.FilterQueryRecordId = string.Empty; + } + + _contentDefinitionManager.AlterTypeDefinition(context.ContentTypeDefinition.Name, cfg => cfg + .WithPart(part.PartDefinition.Name, + pb => pb + .WithSetting("ProjectionPartSettings.QueryLayoutRecordId", settings.QueryLayoutRecordId) + .WithSetting("ProjectionPartSettings.FilterQueryRecordId", settings.FilterQueryRecordId)) + ); + } + } + + public void ContentTypeImporting(ContentTypeImportingContext context) { + } + + public void ContentTypeRemoved(ContentTypeRemovedContext context) { + } + #endregion + + private string GetQueryLayoutRecord(string record) { + var ids = record.Split(';'); + if (ids.Count() == 1) { + // if is present only -1, the default query has not been selected + return ids[0]; + } + else { + string stringIds = string.Empty; + + var ciIdentity = _contentManager.ResolveIdentity(new ContentIdentity(ids[0])); + if (ciIdentity != null) { + stringIds = ciIdentity.Id.ToString() + ";"; + + if (ids[1] == "-1") { + // default layout + stringIds += "-1"; + } + else { + var recordLayout = _layoutRepository.Fetch(l => l.GUIdentifier == ids[1]).FirstOrDefault(); + if (recordLayout != null) { + stringIds += recordLayout.Id.ToString(); + } + } + } + return stringIds; + } + } + private string GetIdentityQueryLayout(string record) { + + var ids = record.Split(';'); + if (ids.Count() == 1) { + // if is present only -1, the default query has not been selected + return ids[0]; + } + else { + // ids[0] is id of query + // ids[1] is record id of layout + var identityQueryLayout = string.Empty; + // identity part to identify the query + var content = _contentManager.Get(int.Parse(ids[0])); + if (content != null) { + var identity = _contentManager.GetItemMetadata(content).Identity; + if (identity != null) { + identityQueryLayout = identity.ToString() + ";"; + } + else { + Services.Notifier.Error(T("ProjectionPart - Query - The loaded id {0} does not exist", ids[0])); + } + } + // guid id to identify the layout + if (ids[1] == "-1") { + // default layout + identityQueryLayout += ids[1]; + } + else { + var layoutRecord = _layoutRepository.Get(int.Parse(ids[1])); + if (layoutRecord != null) { + identityQueryLayout += layoutRecord.GUIdentifier; + } + else { + Services.Notifier.Error(T("ProjectionPart - Layout of query - The loaded id {0} does not exist", ids[1])); + } + } + return identityQueryLayout; + } + } + + private IEnumerable GetQueriesRecordEntry() { + // populating the list of queries and layouts + var layouts = _projectionManager.DescribeLayouts().SelectMany(x => x.Descriptors).ToList(); + + List records = new List(); + records.Add(new QueryRecordEntry { + Id = -1, + Name = T("No default").Text, + LayoutRecordEntries = new List() + }); + + records.AddRange(Services.ContentManager.Query().Join().OrderBy(x => x.Title).List() + .Select(x => new QueryRecordEntry { + Id = x.Id, + Name = x.Name, + LayoutRecordEntries = x.Layouts + .Select(l => new LayoutRecordEntry { + Id = l.Id, + Description = GetLayoutDescription(layouts, l) + }) + .ToList() + })); + return records; + } + + private string GetLayoutDescription(IEnumerable layouts, LayoutRecord l) { + var descriptor = layouts.FirstOrDefault(x => l.Category == x.Category && l.Type == x.Type); + return String.IsNullOrWhiteSpace(l.Description) ? descriptor.Display(new LayoutContext { State = FormParametersHelper.ToDynamic(l.State) }).Text : l.Description; + } + } +} diff --git a/src/Orchard.Web/Modules/Orchard.Projections/Settings/ProjectionPartSettings.cs b/src/Orchard.Web/Modules/Orchard.Projections/Settings/ProjectionPartSettings.cs new file mode 100644 index 000000000..e86184a29 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Projections/Settings/ProjectionPartSettings.cs @@ -0,0 +1,31 @@ +using System.Collections.Generic; +using System.ComponentModel; +using Orchard.Projections.ViewModels; + +namespace Orchard.Projections.Settings { + public class ProjectionPartSettings { + public ProjectionPartSettings() { + FilterQueryRecordsId = new List(); + } + + public string QueryLayoutRecordId { get; set; } + // saved identity part for import + public string IdentityQueryLayoutRecord { get; set; } + public IEnumerable QueryRecordEntries { get; set; } + public IEnumerable FilterQueryRecordsId { get; set; } + public string FilterQueryRecordId { get; set; } + // saved identity part for import + public string IdentityFilterQueryRecord { get; set; } + public int Items { get; set; } + public bool LockEditingItems { get; set; } + [DisplayName("Offset")] + public int Skip { get; set; } + public bool LockEditingSkip { get; set; } + public int MaxItems { get; set; } + public bool LockEditingMaxItems { get; set; } + public string PagerSuffix { get; set; } + public bool LockEditingPagerSuffix { get; set; } + public bool DisplayPager { get; set; } + public bool LockEditingDisplayPager { get; set; } + } +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Projections/Tests/Orchard.Projections.Tests.csproj b/src/Orchard.Web/Modules/Orchard.Projections/Tests/Orchard.Projections.Tests.csproj index 85b440be2..a1817948d 100644 --- a/src/Orchard.Web/Modules/Orchard.Projections/Tests/Orchard.Projections.Tests.csproj +++ b/src/Orchard.Web/Modules/Orchard.Projections/Tests/Orchard.Projections.Tests.csproj @@ -49,8 +49,8 @@ ..\..\..\..\packages\Moq.4.2.1510.2205\lib\net40\Moq.dll - - ..\..\..\..\packages\NHibernate.4.0.1.4000\lib\net40\NHibernate.dll + + ..\..\..\..\packages\NHibernate.4.1.2.4000\lib\net40\NHibernate.dll ..\..\..\..\packages\NUnit.2.5.10.11092\lib\nunit.framework.dll diff --git a/src/Orchard.Web/Modules/Orchard.Projections/Tests/app.config b/src/Orchard.Web/Modules/Orchard.Projections/Tests/app.config index 1d39b06b2..9493cfeea 100644 --- a/src/Orchard.Web/Modules/Orchard.Projections/Tests/app.config +++ b/src/Orchard.Web/Modules/Orchard.Projections/Tests/app.config @@ -4,7 +4,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Projections/Tests/packages.config b/src/Orchard.Web/Modules/Orchard.Projections/Tests/packages.config index 71bda6817..1646f9355 100644 --- a/src/Orchard.Web/Modules/Orchard.Projections/Tests/packages.config +++ b/src/Orchard.Web/Modules/Orchard.Projections/Tests/packages.config @@ -4,6 +4,6 @@ - + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Projections/ViewModels/ProjectionPartEditViewModel.cs b/src/Orchard.Web/Modules/Orchard.Projections/ViewModels/ProjectionPartEditViewModel.cs index 8a707e1e0..8ae4fbad8 100644 --- a/src/Orchard.Web/Modules/Orchard.Projections/ViewModels/ProjectionPartEditViewModel.cs +++ b/src/Orchard.Web/Modules/Orchard.Projections/ViewModels/ProjectionPartEditViewModel.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.ComponentModel; using System.ComponentModel.DataAnnotations; namespace Orchard.Projections.ViewModels { @@ -10,7 +11,7 @@ namespace Orchard.Projections.ViewModels { [Required, Range(0, int.MaxValue)] public int ItemsPerPage { get; set; } - [Required, Range(0, int.MaxValue)] + [Required, Range(0, int.MaxValue),DisplayName("Offset")] public int Skip { get; set; } public string PagerSuffix { get; set; } @@ -24,6 +25,17 @@ namespace Orchard.Projections.ViewModels { public string QueryLayoutRecordId { get; set; } public IEnumerable QueryRecordEntries { get; set; } + public IEnumerable QueryRecordIdFilterEntries { get; set; } + + public int PartId { get; set; } + + // manage Lock items + public bool LockEditingItems { get; set; } + public bool LockEditingSkip { get; set; } + public bool LockEditingMaxItems { get; set; } + public bool LockEditingPagerSuffix { get; set; } + public bool LockEditingDisplayPager { get; set; } + } public class QueryRecordEntry { @@ -36,4 +48,8 @@ namespace Orchard.Projections.ViewModels { public int Id { get; set; } public string Description { get; set; } } + public class QueryRecordFilterEntry { + public string Id { get; set; } + public string LayoutId { get; set; } + } } \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Projections/Views/DefinitionTemplates/ProjectionPartSettings.cshtml b/src/Orchard.Web/Modules/Orchard.Projections/Views/DefinitionTemplates/ProjectionPartSettings.cshtml new file mode 100644 index 000000000..c1d210a6e --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Projections/Views/DefinitionTemplates/ProjectionPartSettings.cshtml @@ -0,0 +1,112 @@ +@model Orchard.Projections.Settings.ProjectionPartSettings +@using Orchard.Projections.Models; +@using Orchard.Projections.ViewModels; + +
+ @Html.LabelFor(m => m.QueryLayoutRecordId, T("Default Query")) + + @T("The query to display.") +
+
+ @T("Select lock editing to prevent the user from editing the default choice") + +
+
+
+ @Html.LabelFor(m => m.Items, T("Items to display")) + @Html.TextBoxFor(m => m.Items, new { @class = "text small" }) +
+
+ @Html.CheckBoxFor(m => m.LockEditingItems) + +
+
+ @T("The number of items to display. Enter 0 for no limit. When using pagination, this is the number of items per page.") +
+ +
+
+
+ @Html.LabelFor(m => m.Skip, T("Offset")) + @Html.TextBoxFor(m => m.Skip, new { @class = "text small" }) +
+
+ @Html.CheckBoxFor(m => m.LockEditingSkip) + +
+
+ @T("The number of items to skip (e.g., if 2 is entered, the first 2 items won't be diplayed).") +
+ +
+
+
+ @Html.LabelFor(m => m.MaxItems, T("Maximum items")) + @Html.TextBoxFor(m => m.MaxItems, new { @class = "text small" }) +
+
+ @Html.CheckBoxFor(m => m.LockEditingMaxItems) + +
+
+ @T("Maximum number of items which can be queried at once. Use 0 for unlimited. This is only used as a failsafe when the number of items comes from a user-provided source such as the query string.") +
+ +
+
+
+ @Html.LabelFor(m => m.PagerSuffix, T("Suffix")) + @Html.TextBoxFor(m => m.PagerSuffix, new { @class = "text" }) +
+
+ @Html.CheckBoxFor(m => m.LockEditingPagerSuffix) + +
+
+ @T("Optional. Provide a suffix to use when multiple pagers are displayed on the same page, e.g., when using multiple Projection Widgets, or to define alternates.") +
+ +
+
+
+ @Html.CheckBoxFor(m => m.DisplayPager) + +
+
+ @Html.CheckBoxFor(m => m.LockEditingDisplayPager) + +
+
+ @T("Check to add a pager to the list.") +
+
+
+ @Html.LabelFor(m => m.FilterQueryRecordId, T("Filter Queries")) + + @T("Select which queries to display to the user. If there are no selections, all queries will be used.") +
\ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Projections/Views/EditorTemplates/Parts/ProjectionPart.cshtml b/src/Orchard.Web/Modules/Orchard.Projections/Views/EditorTemplates/Parts/ProjectionPart.cshtml index 78610823b..de113faba 100644 --- a/src/Orchard.Web/Modules/Orchard.Projections/Views/EditorTemplates/Parts/ProjectionPart.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Projections/Views/EditorTemplates/Parts/ProjectionPart.cshtml @@ -4,71 +4,154 @@ @{ var selectedQueryRecordId = -1; + + var filterQuery = Model.QueryRecordIdFilterEntries.Any(); + var checkQuery = false; } -
- @Html.LabelFor(m => m.QueryLayoutRecordId, T("For Query")) - + @foreach (QueryRecordEntry queryRecord in Model.QueryRecordEntries.OrderBy(x => x.Name)) { + // check condition for design option group + bool designDefaultQuery = Model.QueryRecordIdFilterEntries.Any(x => x.Id == queryRecord.Id.ToString() && x.LayoutId == "-1"); + bool designAnotherLayout = Model.QueryRecordIdFilterEntries.Any(x => queryRecord.LayoutRecordEntries.Select(q => q.Id.ToString()).Contains(x.LayoutId)); + + + if (!filterQuery || designDefaultQuery || designAnotherLayout) { + + @if (!filterQuery || designDefaultQuery) { + @Html.SelectOption(Model.QueryLayoutRecordId, queryRecord.Id + ";-1", queryRecord.Name + " " + T("(Default Layout)").Text) + if (Model.QueryLayoutRecordId == queryRecord.Id + ";-1") { + selectedQueryRecordId = queryRecord.Id; + checkQuery = true; + } + } + @foreach (LayoutRecordEntry layoutRecord in queryRecord.LayoutRecordEntries.OrderBy(x => x.Description)) { + if (!filterQuery || Model.QueryRecordIdFilterEntries.Any(x => x.Id == queryRecord.Id.ToString() && x.LayoutId == layoutRecord.Id.ToString())) { + @Html.SelectOption(Model.QueryLayoutRecordId, queryRecord.Id + ";" + layoutRecord.Id, queryRecord.Name + " " + T("({0})", layoutRecord.Description).Text) + if (Model.QueryLayoutRecordId == queryRecord.Id + ";" + layoutRecord.Id) { + selectedQueryRecordId = queryRecord.Id; + checkQuery = true; + } + } + } + } } - + + if (!checkQuery && Model.PartId != 0) { + + } } - - @if (selectedQueryRecordId != -1) { - @Html.ActionLink(T("Edit Query").Text, "Edit", new { area = "Orchard.Projections", id = selectedQueryRecordId }, new { }) - } - @T("The query to display.") -
+ @if (selectedQueryRecordId != -1) { + @Html.ActionLink(T("Edit Query").Text, "Edit", new { area = "Orchard.Projections", id = selectedQueryRecordId }, new { id = "editQueryLink-" + Model.PartId.ToString() }) + } + @T("The query to display.") +
- @Html.LabelFor(m => m.Items, T("Items to display")) - @Html.TextBoxFor(m => m.Items, new { @class = "text small" }) - @T("The number of items to display. Enter 0 for no limit. When using pagination, this is the number of items per page.") + @if (Model.LockEditingItems) { + @Model.Items + @Html.HiddenFor(m => m.Items) + @HintFromLockedField(T("The number of items to display. If equals 0 no limit. When using pagination, this is the number of items per page.").Text) + } + else { + @Html.LabelFor(m => m.Items, T("Items to display")) + @Html.TextBoxFor(m => m.Items, new { @class = "text small" }) + @T("The number of items to display. Enter 0 for no limit. When using pagination, this is the number of items per page.") + }
- @Html.LabelFor(m => m.Skip, T("Offset")) - @Html.TextBoxFor(m => m.Skip, new { @class = "text small" }) - @T("The number of items to skip (e.g., if 2 is entered, the first 2 items won't be diplayed).") + @if (Model.LockEditingSkip) { + @Model.Skip + @Html.HiddenFor(m => m.Skip) + @HintFromLockedField(T("The number of items to skip (e.g., if 2 is entered, the first 2 items won't be diplayed).").Text) + } + else { + @Html.LabelFor(m => m.Skip, T("Offset")) + @Html.TextBoxFor(m => m.Skip, new { @class = "text small" }) + @T("The number of items to skip (e.g., if 2 is entered, the first 2 items won't be diplayed).") + }
- @Html.LabelFor(m => m.MaxItems, T("Maximum items")) - @Html.TextBoxFor(m => m.MaxItems, new { @class = "text small" }) - @T("Maximum number of items which can be queried at once. Use 0 for unlimited. This is only used as a failsafe when the number of items comes from a user-provided source such as the query string.") + @if (Model.LockEditingMaxItems) { + @Model.MaxItems + @Html.HiddenFor(m => m.MaxItems) + @HintFromLockedField(T("Maximum number of items which can be queried at once. Use 0 for unlimited. This is only used as a failsafe when the number of items comes from a user-provided source such as the query string.").Text) + } + else { + @Html.LabelFor(m => m.MaxItems, T("Maximum items")) + @Html.TextBoxFor(m => m.MaxItems, new { @class = "text small" }) + @T("Maximum number of items which can be queried at once. Use 0 for unlimited. This is only used as a failsafe when the number of items comes from a user-provided source such as the query string.") + }
- @Html.LabelFor(m => m.PagerSuffix, T("Suffix")) - @Html.TextBoxFor(m => m.PagerSuffix, new { @class = "text" }) - @T("Optional. Provide a suffix to use when multiple pagers are displayed on the same page, e.g., when using multiple Projection Widgets, or to define alternates.") + @if (Model.LockEditingPagerSuffix) { + if (!string.IsNullOrEmpty(Model.PagerSuffix)) { + @Model.PagerSuffix + @HintFromLockedField(T("Optional. Provide a suffix to use when multiple pagers are displayed on the same page, e.g., when using multiple Projection Widgets, or to define alternates.").Text) + } + @Html.HiddenFor(m => m.PagerSuffix) + } + else { + @Html.LabelFor(m => m.PagerSuffix, T("Suffix")) + @Html.TextBoxFor(m => m.PagerSuffix, new { @class = "text small" }) + @T("Optional. Provide a suffix to use when multiple pagers are displayed on the same page, e.g., when using multiple Projection Widgets, or to define alternates.") + }
- @Html.CheckBoxFor(m => m.DisplayPager) - - @T("Check to add a pager to the list.") + @if (Model.LockEditingDisplayPager) { + + if (Model.DisplayPager) { + @T("True") + } + else { + @T("False") + } + @Html.HiddenFor(m => m.DisplayPager) + @HintFromLockedField(T("Flag used to add a pager to the list.").Text) + } + else { + @Html.CheckBoxFor(m => m.DisplayPager) + + @T("Check to add a pager to the list.") + }
@using (Script.Foot()) { - + } \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Projections/Web.config b/src/Orchard.Web/Modules/Orchard.Projections/Web.config index 2744c49fc..4f8a57128 100644 --- a/src/Orchard.Web/Modules/Orchard.Projections/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Projections/Web.config @@ -47,7 +47,7 @@
- + diff --git a/src/Orchard.Web/Modules/Orchard.Projections/packages.config b/src/Orchard.Web/Modules/Orchard.Projections/packages.config index 128126181..178fa800f 100644 --- a/src/Orchard.Web/Modules/Orchard.Projections/packages.config +++ b/src/Orchard.Web/Modules/Orchard.Projections/packages.config @@ -6,5 +6,5 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.PublishLater/Web.config b/src/Orchard.Web/Modules/Orchard.PublishLater/Web.config index 2089fbcf5..5b04d36af 100644 --- a/src/Orchard.Web/Modules/Orchard.PublishLater/Web.config +++ b/src/Orchard.Web/Modules/Orchard.PublishLater/Web.config @@ -47,7 +47,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Recipes/Web.config b/src/Orchard.Web/Modules/Orchard.Recipes/Web.config index 32ddbd7be..51077afbc 100644 --- a/src/Orchard.Web/Modules/Orchard.Recipes/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Recipes/Web.config @@ -45,7 +45,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Redis/Orchard.Redis.csproj b/src/Orchard.Web/Modules/Orchard.Redis/Orchard.Redis.csproj index 12fc7ba8d..d118f4f9d 100644 --- a/src/Orchard.Web/Modules/Orchard.Redis/Orchard.Redis.csproj +++ b/src/Orchard.Web/Modules/Orchard.Redis/Orchard.Redis.csproj @@ -58,8 +58,8 @@ ..\..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll - - ..\..\..\packages\NHibernate.4.0.1.4000\lib\net40\NHibernate.dll + + ..\..\..\packages\NHibernate.4.1.2.4000\lib\net40\NHibernate.dll ..\..\..\packages\StackExchange.Redis.1.0.481\lib\net45\StackExchange.Redis.dll diff --git a/src/Orchard.Web/Modules/Orchard.Redis/Web.config b/src/Orchard.Web/Modules/Orchard.Redis/Web.config index e198d83fe..833edb41d 100644 --- a/src/Orchard.Web/Modules/Orchard.Redis/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Redis/Web.config @@ -41,7 +41,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Redis/packages.config b/src/Orchard.Web/Modules/Orchard.Redis/packages.config index 29f4bb8d8..9e7bf972f 100644 --- a/src/Orchard.Web/Modules/Orchard.Redis/packages.config +++ b/src/Orchard.Web/Modules/Orchard.Redis/packages.config @@ -2,6 +2,6 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Resources/Web.config b/src/Orchard.Web/Modules/Orchard.Resources/Web.config index cf8edb40d..2ef2a4d13 100644 --- a/src/Orchard.Web/Modules/Orchard.Resources/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Resources/Web.config @@ -48,7 +48,7 @@ - + @@ -70,6 +70,10 @@ + + + +
diff --git a/src/Orchard.Web/Modules/Orchard.Roles/Recipes/Executors/RolesStep.cs b/src/Orchard.Web/Modules/Orchard.Roles/Recipes/Executors/RolesStep.cs index 6c2a00adb..42ac238b5 100644 --- a/src/Orchard.Web/Modules/Orchard.Roles/Recipes/Executors/RolesStep.cs +++ b/src/Orchard.Web/Modules/Orchard.Roles/Recipes/Executors/RolesStep.cs @@ -35,12 +35,12 @@ namespace Orchard.Roles.Recipes.Executors { role = _roleService.GetRoleByName(roleName); } - var permissions = roleElement.Attribute("Permissions").Value.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries); + var permissions = roleElement.Attribute("Permissions").Value.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries).Select(value => value.Trim()); // Only import permissions for currenlty installed modules. var permissionsValid = permissions.Where(permission => installedPermissions.Any(x => x.Name == permission)).ToList(); // Union to keep existing permissions. - _roleService.UpdateRole(role.Id, role.Name, permissionsValid.Union(role.RolesPermissions.Select(p => p.Permission.Name))); + _roleService.UpdateRole(role.Id, role.Name, permissionsValid.Union(role.RolesPermissions.Select(p => p.Permission.Name)).ToList()); } catch (Exception ex) { Logger.Error(ex, "Error while importing role '{0}'.", roleName); @@ -49,4 +49,4 @@ namespace Orchard.Roles.Recipes.Executors { } } } -} \ No newline at end of file +} diff --git a/src/Orchard.Web/Modules/Orchard.Roles/Web.config b/src/Orchard.Web/Modules/Orchard.Roles/Web.config index 2744c49fc..4f8a57128 100644 --- a/src/Orchard.Web/Modules/Orchard.Roles/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Roles/Web.config @@ -47,7 +47,7 @@
- + diff --git a/src/Orchard.Web/Modules/Orchard.Rules/Web.config b/src/Orchard.Web/Modules/Orchard.Rules/Web.config index 7cec0917a..407656b79 100644 --- a/src/Orchard.Web/Modules/Orchard.Rules/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Rules/Web.config @@ -50,7 +50,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Scripting.CSharp/Web.config b/src/Orchard.Web/Modules/Orchard.Scripting.CSharp/Web.config index 2744c49fc..4f8a57128 100644 --- a/src/Orchard.Web/Modules/Orchard.Scripting.CSharp/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Scripting.CSharp/Web.config @@ -47,7 +47,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Scripting.Dlr/Web.config b/src/Orchard.Web/Modules/Orchard.Scripting.Dlr/Web.config index e198d83fe..833edb41d 100644 --- a/src/Orchard.Web/Modules/Orchard.Scripting.Dlr/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Scripting.Dlr/Web.config @@ -41,7 +41,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Scripting/Web.config b/src/Orchard.Web/Modules/Orchard.Scripting/Web.config index e198d83fe..833edb41d 100644 --- a/src/Orchard.Web/Modules/Orchard.Scripting/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Scripting/Web.config @@ -41,7 +41,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Search/Web.config b/src/Orchard.Web/Modules/Orchard.Search/Web.config index 2744c49fc..4f8a57128 100644 --- a/src/Orchard.Web/Modules/Orchard.Search/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Search/Web.config @@ -47,7 +47,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.SecureSocketsLayer/Filters/SecureSocketsLayersFilter.cs b/src/Orchard.Web/Modules/Orchard.SecureSocketsLayer/Filters/SecureSocketsLayersFilter.cs index 6c51f60d3..317c491d0 100644 --- a/src/Orchard.Web/Modules/Orchard.SecureSocketsLayer/Filters/SecureSocketsLayersFilter.cs +++ b/src/Orchard.Web/Modules/Orchard.SecureSocketsLayer/Filters/SecureSocketsLayersFilter.cs @@ -29,7 +29,7 @@ namespace Orchard.SecureSocketsLayer.Filters { var secure = (user != null && user.Identity.IsAuthenticated) || _sslService.ShouldBeSecure(filterContext); - + var usePermanentRedirect = settings.UsePermanentRedirect; var request = filterContext.HttpContext.Request; // redirect to a secured connection ? @@ -41,7 +41,7 @@ namespace Orchard.SecureSocketsLayer.Filters { filterContext.ActionDescriptor.ControllerDescriptor.ControllerName, filterContext.RequestContext.RouteData.Values)); - filterContext.Result = new RedirectResult(secureActionUrl); + filterContext.Result = new RedirectResult(secureActionUrl, usePermanentRedirect); return; } @@ -56,7 +56,7 @@ namespace Orchard.SecureSocketsLayer.Filters { filterContext.ActionDescriptor.ControllerDescriptor.ControllerName, filterContext.RequestContext.RouteData.Values)); - filterContext.Result = new RedirectResult(insecureActionUrl); + filterContext.Result = new RedirectResult(insecureActionUrl, usePermanentRedirect); } } @@ -67,4 +67,4 @@ namespace Orchard.SecureSocketsLayer.Filters { return url; } } -} \ No newline at end of file +} diff --git a/src/Orchard.Web/Modules/Orchard.SecureSocketsLayer/Models/SslSettingsPart.cs b/src/Orchard.Web/Modules/Orchard.SecureSocketsLayer/Models/SslSettingsPart.cs index 4d1f1b445..f377e8b7b 100644 --- a/src/Orchard.Web/Modules/Orchard.SecureSocketsLayer/Models/SslSettingsPart.cs +++ b/src/Orchard.Web/Modules/Orchard.SecureSocketsLayer/Models/SslSettingsPart.cs @@ -6,6 +6,7 @@ using Orchard.ContentManagement.FieldStorage.InfosetStorage; namespace Orchard.SecureSocketsLayer.Models { public class SslSettings { public bool Enabled { get; set; } + public bool UsePermanentRedirect { get; set; } public string Urls { get; set; } public bool SecureEverything { get; set; } public bool CustomEnabled { get; set; } @@ -37,6 +38,14 @@ namespace Orchard.SecureSocketsLayer.Models { set { this.As().Set("Enabled", value.ToString()); } } + public bool UsePermanentRedirect { + get { + var attributeValue = this.As().Get("UsePermanentRedirect"); + return !String.IsNullOrWhiteSpace(attributeValue) && Convert.ToBoolean(attributeValue); + } + set { this.As().Set("UsePermanentRedirect", value.ToString()); } + } + public bool CustomEnabled { get { var attributeValue = this.As().Get("CustomEnabled"); diff --git a/src/Orchard.Web/Modules/Orchard.SecureSocketsLayer/Services/SecureSocketsLayerService.cs b/src/Orchard.Web/Modules/Orchard.SecureSocketsLayer/Services/SecureSocketsLayerService.cs index a3e3ced50..6c94f9a1f 100644 --- a/src/Orchard.Web/Modules/Orchard.SecureSocketsLayer/Services/SecureSocketsLayerService.cs +++ b/src/Orchard.Web/Modules/Orchard.SecureSocketsLayer/Services/SecureSocketsLayerService.cs @@ -205,7 +205,8 @@ namespace Orchard.SecureSocketsLayer.Services { SecureEverything = settingsPart.SecureEverything, SecureHostName = settingsPart.SecureHostName, InsecureHostName = settingsPart.InsecureHostName, - Enabled = settingsPart.Enabled + Enabled = settingsPart.Enabled, + UsePermanentRedirect = settingsPart.UsePermanentRedirect }; }); } diff --git a/src/Orchard.Web/Modules/Orchard.SecureSocketsLayer/Views/EditorTemplates/Parts/SecureSocketsLayer.Settings.cshtml b/src/Orchard.Web/Modules/Orchard.SecureSocketsLayer/Views/EditorTemplates/Parts/SecureSocketsLayer.Settings.cshtml index c7aad106e..0a864e961 100644 --- a/src/Orchard.Web/Modules/Orchard.SecureSocketsLayer/Views/EditorTemplates/Parts/SecureSocketsLayer.Settings.cshtml +++ b/src/Orchard.Web/Modules/Orchard.SecureSocketsLayer/Views/EditorTemplates/Parts/SecureSocketsLayer.Settings.cshtml @@ -18,6 +18,11 @@ @Html.TextBoxFor(m => m.InsecureHostName, new { @class = "textMedium" }) @Html.Hint(T("(Mandatory) The host name non-secured traffic should be redirected to (e.g. localhost:30321, mydomain.com). Don't include the protocol or anything else than the host name. A port can be specified after a colon if necessary (e.g. dev.127-0-0-1.org.uk:4333).")) +
+ @Html.EditorFor(m => m.UsePermanentRedirect) + + @Html.ValidationMessage("UsePermanentRedirect", "*") +
@Html.EditorFor(m => m.SecureEverything) diff --git a/src/Orchard.Web/Modules/Orchard.SecureSocketsLayer/Web.config b/src/Orchard.Web/Modules/Orchard.SecureSocketsLayer/Web.config index 2744c49fc..4f8a57128 100644 --- a/src/Orchard.Web/Modules/Orchard.SecureSocketsLayer/Web.config +++ b/src/Orchard.Web/Modules/Orchard.SecureSocketsLayer/Web.config @@ -47,7 +47,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Setup/Web.config b/src/Orchard.Web/Modules/Orchard.Setup/Web.config index 2744c49fc..4f8a57128 100644 --- a/src/Orchard.Web/Modules/Orchard.Setup/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Setup/Web.config @@ -47,7 +47,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Tags/Orchard.Tags.csproj b/src/Orchard.Web/Modules/Orchard.Tags/Orchard.Tags.csproj index 3b7520287..af5f2ab45 100644 --- a/src/Orchard.Web/Modules/Orchard.Tags/Orchard.Tags.csproj +++ b/src/Orchard.Web/Modules/Orchard.Tags/Orchard.Tags.csproj @@ -65,8 +65,8 @@ ..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - - ..\..\..\packages\NHibernate.4.0.1.4000\lib\net40\NHibernate.dll + + ..\..\..\packages\NHibernate.4.1.2.4000\lib\net40\NHibernate.dll @@ -246,4 +246,4 @@ - + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Tags/Web.config b/src/Orchard.Web/Modules/Orchard.Tags/Web.config index 2744c49fc..4f8a57128 100644 --- a/src/Orchard.Web/Modules/Orchard.Tags/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Tags/Web.config @@ -47,7 +47,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Tags/packages.config b/src/Orchard.Web/Modules/Orchard.Tags/packages.config index 128126181..178fa800f 100644 --- a/src/Orchard.Web/Modules/Orchard.Tags/packages.config +++ b/src/Orchard.Web/Modules/Orchard.Tags/packages.config @@ -6,5 +6,5 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.TaskLease/Web.config b/src/Orchard.Web/Modules/Orchard.TaskLease/Web.config index e198d83fe..833edb41d 100644 --- a/src/Orchard.Web/Modules/Orchard.TaskLease/Web.config +++ b/src/Orchard.Web/Modules/Orchard.TaskLease/Web.config @@ -41,7 +41,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Taxonomies/Orchard.Taxonomies.csproj b/src/Orchard.Web/Modules/Orchard.Taxonomies/Orchard.Taxonomies.csproj index b8b1cc4e6..772812937 100644 --- a/src/Orchard.Web/Modules/Orchard.Taxonomies/Orchard.Taxonomies.csproj +++ b/src/Orchard.Web/Modules/Orchard.Taxonomies/Orchard.Taxonomies.csproj @@ -55,6 +55,9 @@ false + + ..\..\..\packages\Iesi.Collections.4.0.0.4000\lib\net40\Iesi.Collections.dll + ..\..\..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll @@ -65,8 +68,8 @@ ..\..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll - - ..\..\..\packages\NHibernate.4.0.1.4000\lib\net40\NHibernate.dll + + ..\..\..\packages\NHibernate.4.1.2.4000\lib\net40\NHibernate.dll diff --git a/src/Orchard.Web/Modules/Orchard.Taxonomies/Projections/TermsFilter.cs b/src/Orchard.Web/Modules/Orchard.Taxonomies/Projections/TermsFilter.cs index d9eca7382..f07415f8b 100644 --- a/src/Orchard.Web/Modules/Orchard.Taxonomies/Projections/TermsFilter.cs +++ b/src/Orchard.Web/Modules/Orchard.Taxonomies/Projections/TermsFilter.cs @@ -47,8 +47,11 @@ namespace Orchard.Taxonomies.Projections { var terms = ids.Select(_taxonomyService.GetTerm).ToList(); var allChildren = new List(); foreach (var term in terms) { - allChildren.AddRange(_taxonomyService.GetChildren(term)); - allChildren.Add(term); + bool.TryParse(context.State.ExcludeChildren?.Value, out bool excludeChildren); + if (!excludeChildren) + allChildren.AddRange(_taxonomyService.GetChildren(term)); + if (term != null) + allChildren.Add(term); } allChildren = allChildren.Distinct().ToList(); diff --git a/src/Orchard.Web/Modules/Orchard.Taxonomies/Projections/TermsFilterForms.cs b/src/Orchard.Web/Modules/Orchard.Taxonomies/Projections/TermsFilterForms.cs index 297b93b6c..c6cc27a4b 100644 --- a/src/Orchard.Web/Modules/Orchard.Taxonomies/Projections/TermsFilterForms.cs +++ b/src/Orchard.Web/Modules/Orchard.Taxonomies/Projections/TermsFilterForms.cs @@ -48,8 +48,13 @@ namespace Orchard.Taxonomies.Projections { Id: "operator-is-all-of", Name: "Operator", Title: T("Is all of"), Value: "1" ) - ) - ); + ), + _ExcludeChildren: Shape.Checkbox( + Id: "ExcludeChildren", Name: "ExcludeChildren", + Title: T("Automatically exclude children terms in filtering"), + Value: "true" + ) + ); foreach (var taxonomy in _taxonomyService.GetTaxonomies()) { f._Terms.Add(new SelectListItem { Value = String.Empty, Text = taxonomy.Name }); diff --git a/src/Orchard.Web/Modules/Orchard.Taxonomies/Web.config b/src/Orchard.Web/Modules/Orchard.Taxonomies/Web.config index 1da8bd063..527253c9a 100644 --- a/src/Orchard.Web/Modules/Orchard.Taxonomies/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Taxonomies/Web.config @@ -50,7 +50,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Taxonomies/packages.config b/src/Orchard.Web/Modules/Orchard.Taxonomies/packages.config index e7f80fae2..6144c9982 100644 --- a/src/Orchard.Web/Modules/Orchard.Taxonomies/packages.config +++ b/src/Orchard.Web/Modules/Orchard.Taxonomies/packages.config @@ -1,5 +1,6 @@  + @@ -8,4 +9,5 @@ - + + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Templates/Web.config b/src/Orchard.Web/Modules/Orchard.Templates/Web.config index 2744c49fc..4f8a57128 100644 --- a/src/Orchard.Web/Modules/Orchard.Templates/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Templates/Web.config @@ -47,7 +47,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Themes/Web.config b/src/Orchard.Web/Modules/Orchard.Themes/Web.config index 2744c49fc..4f8a57128 100644 --- a/src/Orchard.Web/Modules/Orchard.Themes/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Themes/Web.config @@ -47,7 +47,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Tokens/Providers/TextTokens.cs b/src/Orchard.Web/Modules/Orchard.Tokens/Providers/TextTokens.cs index c19752c57..357ebc3d3 100644 --- a/src/Orchard.Web/Modules/Orchard.Tokens/Providers/TextTokens.cs +++ b/src/Orchard.Web/Modules/Orchard.Tokens/Providers/TextTokens.cs @@ -22,6 +22,7 @@ namespace Orchard.Tokens.Providers { .Token("TrimStart:*", T("TrimStart:"), T("Trims the specified characters or number of them from the beginning of the string.")) .Token("UrlEncode", T("Url Encode"), T("Encodes a URL string."), "Text") .Token("HtmlEncode", T("Html Encode"), T("Encodes an HTML string."), "Text") + .Token("HtmlDecode", T("HtmlDecode"), T("Decodes an HTML string."), "Text") .Token("JavaScriptEncode", T("JavaScript Encode"), T("Encodes a JavaScript string."), "Text") .Token("LineEncode", T("Line Encode"), T("Replaces new lines with
tags."), "Text") ; @@ -53,6 +54,8 @@ namespace Orchard.Tokens.Providers { .Chain("UrlEncode", "Text", HttpUtility.UrlEncode) .Token("HtmlEncode", HttpUtility.HtmlEncode) .Chain("HtmlEncode", "Text", HttpUtility.HtmlEncode) + .Token("HtmlDecode", HttpUtility.HtmlDecode) + .Chain("HtmlDecode", "Text", HttpUtility.HtmlDecode) .Token("JavaScriptEncode", HttpUtility.JavaScriptStringEncode) .Chain("JavaScriptEncode", "Text", HttpUtility.JavaScriptStringEncode) .Token("LineEncode", text => ReplaceNewLineCharacters(text)) @@ -195,4 +198,4 @@ namespace Orchard.Tokens.Providers { } } -} \ No newline at end of file +} diff --git a/src/Orchard.Web/Modules/Orchard.Tokens/Tests/app.config b/src/Orchard.Web/Modules/Orchard.Tokens/Tests/app.config index d8c287814..cda2fe9df 100644 --- a/src/Orchard.Web/Modules/Orchard.Tokens/Tests/app.config +++ b/src/Orchard.Web/Modules/Orchard.Tokens/Tests/app.config @@ -8,7 +8,7 @@
- + diff --git a/src/Orchard.Web/Modules/Orchard.Tokens/Web.config b/src/Orchard.Web/Modules/Orchard.Tokens/Web.config index 2744c49fc..4f8a57128 100644 --- a/src/Orchard.Web/Modules/Orchard.Tokens/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Tokens/Web.config @@ -47,7 +47,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Users/Activities/UserActivity.cs b/src/Orchard.Web/Modules/Orchard.Users/Activities/UserActivity.cs index cf60efcfa..17adb7f95 100644 --- a/src/Orchard.Web/Modules/Orchard.Users/Activities/UserActivity.cs +++ b/src/Orchard.Web/Modules/Orchard.Users/Activities/UserActivity.cs @@ -128,7 +128,7 @@ namespace Orchard.Users.Activities { } public override LocalizedString Description { - get { return T("User send challenge email."); } + get { return T("User sent challenge email."); } } } diff --git a/src/Orchard.Web/Modules/Orchard.Users/Web.config b/src/Orchard.Web/Modules/Orchard.Users/Web.config index 4f2330459..c695cf4d7 100644 --- a/src/Orchard.Web/Modules/Orchard.Users/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Users/Web.config @@ -48,7 +48,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Warmup/Web.config b/src/Orchard.Web/Modules/Orchard.Warmup/Web.config index 2744c49fc..4f8a57128 100644 --- a/src/Orchard.Web/Modules/Orchard.Warmup/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Warmup/Web.config @@ -47,7 +47,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Widgets/Orchard.Widgets.csproj b/src/Orchard.Web/Modules/Orchard.Widgets/Orchard.Widgets.csproj index 3e6fdda00..b17390c28 100644 --- a/src/Orchard.Web/Modules/Orchard.Widgets/Orchard.Widgets.csproj +++ b/src/Orchard.Web/Modules/Orchard.Widgets/Orchard.Widgets.csproj @@ -173,6 +173,10 @@ {6bd8b2fa-f2e3-4ac8-a4c3-2925a653889a} Orchard.Layouts + + {fbc8b571-ed50-49d8-8d9d-64ab7454a0d6} + Orchard.Localization + {99002B65-86F7-415E-BF4A-381AA8AB9CCC} Orchard.Scripting diff --git a/src/Orchard.Web/Modules/Orchard.Widgets/Views/WidgetPlacement.Zones.cshtml b/src/Orchard.Web/Modules/Orchard.Widgets/Views/WidgetPlacement.Zones.cshtml index 415044bca..295638649 100644 --- a/src/Orchard.Web/Modules/Orchard.Widgets/Views/WidgetPlacement.Zones.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Widgets/Views/WidgetPlacement.Zones.cshtml @@ -2,6 +2,7 @@ @using Orchard.Core.Contents; @using Orchard.Utility.Extensions; @using Orchard.Widgets.Models; +@using Orchard.Localization.Models; @{ Style.Require("WidgetsAdmin"); IEnumerable widgets = Model.Widgets; @@ -26,7 +27,8 @@ foreach (WidgetPart widget in widgets.Where(w => w.Zone == zone).OrderBy(w => w.Position, new Orchard.UI.FlatPositionComparer())) {
  • @using (Html.BeginFormAntiForgeryPost()) { -

    @Html.ActionLink(HasText(widget.Title) ? widget.Title : widget.TypeDefinition.DisplayName, "EditWidget", new { @widget.Id, returnUrl })

    - @widget.TypeDefinition.DisplayName
    + var contentLocalization = (widget.ContentItem.As() != null && widget.ContentItem.As().Culture != null) ? " (" + widget.ContentItem.As().Culture.Culture + ")" : string.Empty; +

    @Html.ActionLink((HasText(widget.Title) ? widget.Title : widget.TypeDefinition.DisplayName) + contentLocalization, "EditWidget", new { @widget.Id, returnUrl })

    - @widget.TypeDefinition.DisplayName