mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-27 04:19:04 +08:00
Merge branch 'dev' into feature/dashboard
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -184,6 +184,9 @@ src/TestResults/*
|
||||
src/Orchard.Web/Properties/PublishProfiles
|
||||
src/Orchard.Azure/Orchard.Azure.CloudService/Staging/
|
||||
src/Orchard.Web/Modules/Orchard.Azure.MediaServices/node_modules
|
||||
src/Orchard.Web/Modules/Orchard.Layouts/node_modules
|
||||
src/Orchard.Web/Modules/Orchard.DynamicForms/node_modules
|
||||
|
||||
#enable all /lib artifacts
|
||||
!lib/*/*.*
|
||||
*/.vs/*
|
||||
|
||||
27
README.md
27
README.md
@@ -1,29 +1,26 @@
|
||||
# Orchard
|
||||
|
||||
[](https://gitter.im/OrchardCMS/Orchard?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
Orchard is a free, open source, community-focused Content Management System built on the ASP.NET MVC platform.
|
||||
|
||||
[](https://gitter.im/OrchardCMS/Orchard?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
|
||||
## About The Orchard Project
|
||||
|
||||
#### Please visit our website at http://orchardproject.net for the most current information about this project.
|
||||
|
||||
Orchard is a free, open source, community-focused project aimed at delivering applications and reusable components
|
||||
on the ASP.NET platform. It will create shared components for building ASP.NET applications and extensions, and
|
||||
specific applications that leverage these components to meet the needs of end-users, scripters, and developers.
|
||||
Additionally, we seek to create partnerships with existing application authors to help them achieve their goals.
|
||||
Orchard is delivered under the [.NET Foundation](http://www.dotnetfoundation.org/). It is licensed under a
|
||||
[New BSD license](http://www.opensource.org/licenses/bsd-license.php), which is approved by the OSI. The intended
|
||||
output of the Orchard project is three-fold:
|
||||
Orchard is a free, open source, community-focused Content Management System built on the ASP.NET MVC platform.
|
||||
|
||||
* Individual .NET-based applications that appeal to end-users, scripters, and developers
|
||||
* A set of re-usable components that makes it easy to build such applications
|
||||
* A vibrant community to help define these applications and extensions
|
||||
In the near term, the Orchard project is focused on delivering a .NET-based CMS application that will allow users
|
||||
to rapidly create content-driven Websites, and an extensibility framework that will allow developers and customizers to provide additional functionality through modules and themes. You can learn more about the project on the [Orchard Project Website](http://www.orchardproject.net).
|
||||
Orchard is built on a modern architecture that puts extensibility up-front, as its number one concern. All components in Orchard can be replaced or extended. Content is built from easily composable building blocks. Modules extend the system in a very decoupled fashion, where a commenting module for example can as easily apply to pages, blog posts, photos or products. A rich UI composition system completes the picture and ensures that you can get the exact presentation that you need for your content.
|
||||
|
||||
Orchard is delivered under the .NET Foundation. It is licensed under a New BSD license, which is approved by the OSI.
|
||||
|
||||
Our mission is to empower our users and foster a dedicated and diverse community that builds the CMS that we all want to use.
|
||||
|
||||
There are many ways you can contribute to Orchard: you can fix bugs, contribute modules and themes to our gallery, write documentation, translate Orchard, or answer questions on our forums and on Stack Overflow.
|
||||
|
||||
## Project Status
|
||||
Orchard is currently in version 1.8.1. We invite participation by the developer community in shaping the project’s direction, so that we can publicly validate our designs and development approach.
|
||||
Our 1.8.1 release is available from our Downloads page, and is easy to [Install Orchard using the Web Platform Installer](http://www.orchardproject.net/docs/Installing-Orchard.ashx). We encourage interested developers to check out the source code on the Orchard Github site and get involved with the project.
|
||||
Orchard is currently in version 1.9. We invite participation by the developer community in shaping the project’s direction, so that we can publicly validate our designs and development approach.
|
||||
Our 1.9 release is available from [our Downloads page](https://github.com/OrchardCMS/Orchard/releases), and is easy to [Install Orchard using the Web Platform Installer](http://www.orchardproject.net/docs/Installing-Orchard.ashx). We encourage interested developers to check out the source code on the Orchard Github site and get involved with the project.
|
||||
|
||||
* [Download the latest release](https://github.com/OrchardCMS/Orchard/releases)
|
||||
* [Feature roadmap](http://www.orchardproject.net/docs/feature-roadmap.ashx)
|
||||
|
||||
BIN
lib/aspnetmvc/Microsoft.Web.Infrastructure.dll
Normal file
BIN
lib/aspnetmvc/Microsoft.Web.Infrastructure.dll
Normal file
Binary file not shown.
19
lib/aspnetmvc/Microsoft.Web.Infrastructure.xml
Normal file
19
lib/aspnetmvc/Microsoft.Web.Infrastructure.xml
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<doc>
|
||||
<assembly>
|
||||
<name>Microsoft.Web.Infrastructure</name>
|
||||
</assembly>
|
||||
<members>
|
||||
<member name="T:Microsoft.Web.Infrastructure.HttpContextHelper"></member>
|
||||
<member name="M:Microsoft.Web.Infrastructure.HttpContextHelper.ExecuteInNullContext(System.Action)"></member>
|
||||
<member name="T:Microsoft.Web.Infrastructure.InfrastructureHelper"></member>
|
||||
<member name="M:Microsoft.Web.Infrastructure.InfrastructureHelper.IsCodeDomDefinedExtension(System.String)"></member>
|
||||
<member name="M:Microsoft.Web.Infrastructure.InfrastructureHelper.UnloadAppDomain"></member>
|
||||
<member name="T:Microsoft.Web.Infrastructure.DynamicModuleHelper.DynamicModuleUtility"></member>
|
||||
<member name="M:Microsoft.Web.Infrastructure.DynamicModuleHelper.DynamicModuleUtility.RegisterModule(System.Type)"></member>
|
||||
<member name="T:Microsoft.Web.Infrastructure.DynamicValidationHelper.ValidationUtility"></member>
|
||||
<member name="M:Microsoft.Web.Infrastructure.DynamicValidationHelper.ValidationUtility.EnableDynamicValidation(System.Web.HttpContext)"></member>
|
||||
<member name="M:Microsoft.Web.Infrastructure.DynamicValidationHelper.ValidationUtility.GetUnvalidatedCollections(System.Web.HttpContext,System.Func`1@,System.Void)"></member>
|
||||
<member name="M:Microsoft.Web.Infrastructure.DynamicValidationHelper.ValidationUtility.IsValidationEnabled(System.Web.HttpContext)"></member>
|
||||
</members>
|
||||
</doc>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
7
lib/npgsql/LICENSE.txt
Normal file
7
lib/npgsql/LICENSE.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
Copyright (c) 2002-2013, The Npgsql Development Team
|
||||
|
||||
Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies.
|
||||
|
||||
IN NO EVENT SHALL THE NPGSQL DEVELOPMENT TEAM BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE NPGSQL DEVELOPMENT TEAM HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
THE NPGSQL DEVELOPMENT TEAM SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE NPGSQL DEVELOPMENT TEAM HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
|
||||
BIN
lib/npgsql/Mono.Security.dll
Normal file
BIN
lib/npgsql/Mono.Security.dll
Normal file
Binary file not shown.
6502
lib/npgsql/Npgsql.XML
Normal file
6502
lib/npgsql/Npgsql.XML
Normal file
File diff suppressed because it is too large
Load Diff
BIN
lib/npgsql/Npgsql.dll
Normal file
BIN
lib/npgsql/Npgsql.dll
Normal file
Binary file not shown.
BIN
lib/npgsql/Npgsql.pdb
Normal file
BIN
lib/npgsql/Npgsql.pdb
Normal file
Binary file not shown.
52
lib/npgsql/README.md
Normal file
52
lib/npgsql/README.md
Normal file
@@ -0,0 +1,52 @@
|
||||
Npgsql - .NET Data Provider for PostgreSQL
|
||||
=============
|
||||
|
||||
###What Is Npgsql?
|
||||
|
||||
Npgsql is a .Net Data Provider for PostgreSQL. It allows you to connect and interact with PostgreSQL server using .NET.
|
||||
|
||||
|
||||
###Project Information
|
||||
|
||||
+ [Offical Site][1]
|
||||
+ [Npgsql source code @ GitHub][2]
|
||||
+ [Available on NuGet Gallery][3]
|
||||
+ [Wiki - Usage and other information][4]
|
||||
|
||||
|
||||
###Developers
|
||||
|
||||
Developers who contributes to Npgsql currently or in past, in no particular order:
|
||||
|
||||
+ Brar Piening
|
||||
+ Francisco Figueiredo Jr.
|
||||
+ Ben Clewett
|
||||
+ Daniel Morgan
|
||||
+ Dave Page
|
||||
+ Ulrich Sprick
|
||||
+ Glen Parker
|
||||
+ Josh Cooley
|
||||
+ Jon Asher
|
||||
+ Chris Morgan
|
||||
+ Thilo Utke
|
||||
+ Hiroshi Saito
|
||||
+ Shay Rojansky
|
||||
|
||||
###License
|
||||
|
||||
Refer LICENSE.txt for more information on license terms.
|
||||
|
||||
###Code history
|
||||
|
||||
On December 2nd, [we committed a change][5] to restructure Npgsql code. This change modified file locations and unfortunately made the complete modification history of those files to not be available anymore through GitHub interface directly. [This stackoverflow post][6] documents a way to access the history before the rename: You just need to access the object tree **before** the rename and then you can see the rest of the file history.
|
||||
In the case of this rename, this is the tree: https://github.com/npgsql/Npgsql/tree/2f8928e4dee59275767de0df2ec41a654744a3bc
|
||||
|
||||
This will help future searches for the history of the files. Note that you stil can access the complete history of the file through command line: `git log --follow ./newflodername/file`
|
||||
|
||||
|
||||
[1]: http://www.npgsql.org/ "Official site"
|
||||
[2]: https://github.com/npgsql/Npgsql/ "Npgsql source code @ GitHub"
|
||||
[3]: http://www.nuget.org/packages/Npgsql/ "Npgsql @ Nuget Gallery"
|
||||
[4]: https://github.com/npgsql/Npgsql/wiki/ "Wiki"
|
||||
[5]: https://github.com/npgsql/Npgsql/commit/d7beea23f3407b38747cde05568a59ac87cdd121#diff-3b02da674650ba0f31603c365249f34f
|
||||
[6]: http://stackoverflow.com/questions/17213046/see-history-in-github-after-folder-rename
|
||||
BIN
lib/npgsql/de/Npgsql.resources.dll
Normal file
BIN
lib/npgsql/de/Npgsql.resources.dll
Normal file
Binary file not shown.
BIN
lib/npgsql/es/Npgsql.resources.dll
Normal file
BIN
lib/npgsql/es/Npgsql.resources.dll
Normal file
Binary file not shown.
BIN
lib/npgsql/fi/Npgsql.resources.dll
Normal file
BIN
lib/npgsql/fi/Npgsql.resources.dll
Normal file
Binary file not shown.
BIN
lib/npgsql/fr/Npgsql.resources.dll
Normal file
BIN
lib/npgsql/fr/Npgsql.resources.dll
Normal file
Binary file not shown.
BIN
lib/npgsql/ja/Npgsql.resources.dll
Normal file
BIN
lib/npgsql/ja/Npgsql.resources.dll
Normal file
Binary file not shown.
BIN
lib/npgsql/zh-CN/Npgsql.resources.dll
Normal file
BIN
lib/npgsql/zh-CN/Npgsql.resources.dll
Normal file
Binary file not shown.
@@ -7,7 +7,7 @@
|
||||
<system.web>
|
||||
<compilation targetFramework="4.5">
|
||||
<assemblies>
|
||||
<add assembly="System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"/>
|
||||
<add assembly="System.Web.Mvc, Version=5.2.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"/>
|
||||
</assemblies>
|
||||
</compilation>
|
||||
<pages>
|
||||
|
||||
@@ -10,11 +10,11 @@
|
||||
-->
|
||||
<pages
|
||||
validateRequest="false"
|
||||
pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"
|
||||
pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"
|
||||
userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=5.2.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"
|
||||
pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=5.2.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"
|
||||
userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=5.2.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<controls>
|
||||
<add assembly="System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" namespace="System.Web.Mvc" tagPrefix="mvc" />
|
||||
<add assembly="System.Web.Mvc, Version=5.2.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" namespace="System.Web.Mvc" tagPrefix="mvc" />
|
||||
</controls>
|
||||
</pages>
|
||||
</system.web>
|
||||
|
||||
@@ -21,13 +21,13 @@
|
||||
|
||||
<appSettings>
|
||||
<add key="webpages:Enabled" value="false" />
|
||||
<add key="webpages:Version" value="3.0.0.0"/>
|
||||
<add key="webpages:Version" value="3.0.0"/>
|
||||
<add key="log4net.Config" value="Config\log4net.config" />
|
||||
<add key="owin:AutomaticAppStartup" value="false" />
|
||||
</appSettings>
|
||||
|
||||
<system.web.webPages.razor>
|
||||
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
|
||||
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
|
||||
<pages pageBaseType="Orchard.Mvc.ViewEngines.Razor.WebViewPage">
|
||||
<namespaces>
|
||||
<add namespace="System.Web.Mvc" />
|
||||
@@ -62,7 +62,7 @@
|
||||
<add extension=".csproj" type="Orchard.Environment.Extensions.Compilers.CSharpExtensionBuildProviderShim"/>
|
||||
</buildProviders>
|
||||
<assemblies>
|
||||
<add assembly="System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"/>
|
||||
<add assembly="System.Web.Mvc, Version=5.2.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"/>
|
||||
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"/>
|
||||
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"/>
|
||||
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
|
||||
@@ -150,63 +150,74 @@
|
||||
<httpErrors existingResponse="PassThrough" />
|
||||
</system.webServer>
|
||||
<runtime>
|
||||
<gcServer enabled="true"/>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<probing privatePath="App_Data/Dependencies"/>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.2.0.0" newVersion="5.2.0.0"/>
|
||||
<assemblyIdentity name="Iesi.Collections" publicKeyToken="AA95F207798DFDB4" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0"/>
|
||||
</dependentAssembly>
|
||||
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
|
||||
</dependentAssembly>
|
||||
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Razor" publicKeyToken="31bf3856ad364e35"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
|
||||
</dependentAssembly>
|
||||
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
|
||||
</dependentAssembly>
|
||||
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.WebPages.Deployment" publicKeyToken="31bf3856ad364e35"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
|
||||
</dependentAssembly>
|
||||
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.WebPages.Razor" publicKeyToken="31bf3856ad364e35"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
|
||||
</dependentAssembly>
|
||||
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.1.0.0" newVersion="5.1.0.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0"/>
|
||||
</dependentAssembly>
|
||||
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.1.0.0" newVersion="5.1.0.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0"/>
|
||||
</dependentAssembly>
|
||||
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="NHibernate" publicKeyToken="aa95f207798dfdb4" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.0.4000" newVersion="4.0.0.4000"/>
|
||||
</dependentAssembly>
|
||||
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Autofac" publicKeyToken="17863af14b0044da"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-3.5.0.0" newVersion="3.5.0.0"/>
|
||||
</dependentAssembly>
|
||||
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0"/>
|
||||
</dependentAssembly>
|
||||
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.WindowsAzure.Storage" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.3.0.0" newVersion="4.3.0.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Data.Edm" publicKeyToken="31BF3856AD364E35" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.6.3.0" newVersion="5.6.3.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Data.OData" publicKeyToken="31BF3856AD364E35" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.6.3.0" newVersion="5.6.3.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Data.Services.Client" publicKeyToken="31BF3856AD364E35" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.6.3.0" newVersion="5.6.3.0"/>
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
|
||||
</configuration>
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"/>
|
||||
<add assembly="System.Web.Abstractions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"/>
|
||||
<add assembly="System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"/>
|
||||
<add assembly="System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"/>
|
||||
<add assembly="System.Web.Mvc, Version=5.2.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"/>
|
||||
<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
|
||||
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
|
||||
<add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
|
||||
@@ -140,48 +140,81 @@
|
||||
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode"
|
||||
type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"/>
|
||||
<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
|
||||
<add name="MvcHttpHandler" preCondition="integratedMode" verb="*" path="*.mvc" type="System.Web.Mvc.MvcHttpHandler, System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"/>
|
||||
<add name="MvcHttpHandler" preCondition="integratedMode" verb="*" path="*.mvc" type="System.Web.Mvc.MvcHttpHandler, System.Web.Mvc, Version=5.2.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"/>
|
||||
<add name="UrlRoutingHandler" preCondition="integratedMode" verb="*" path="UrlRouting.axd" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
</handlers>
|
||||
</system.webServer>
|
||||
|
||||
<runtime>
|
||||
<gcServer enabled="true"/>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<probing privatePath="App_Data/Dependencies"/>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Iesi.Collections" publicKeyToken="AA95F207798DFDB4" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.2.0.0" newVersion="5.2.0.0"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0"/>
|
||||
</dependentAssembly>
|
||||
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
|
||||
</dependentAssembly>
|
||||
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Razor" publicKeyToken="31bf3856ad364e35"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
|
||||
</dependentAssembly>
|
||||
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
|
||||
</dependentAssembly>
|
||||
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.WebPages.Deployment" publicKeyToken="31bf3856ad364e35"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
|
||||
</dependentAssembly>
|
||||
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.WebPages.Razor" publicKeyToken="31bf3856ad364e35"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
|
||||
</dependentAssembly>
|
||||
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="NHibernate" publicKeyToken="aa95f207798dfdb4" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.0.4000" newVersion="4.0.0.4000"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Autofac" publicKeyToken="17863af14b0044da"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-3.5.0.0" newVersion="3.5.0.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.WindowsAzure.Storage" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.3.0.0" newVersion="4.3.0.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Data.Edm" publicKeyToken="31BF3856AD364E35" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.6.3.0" newVersion="5.6.3.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Data.OData" publicKeyToken="31BF3856AD364E35" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.6.3.0" newVersion="5.6.3.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Data.Services.Client" publicKeyToken="31BF3856AD364E35" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.6.3.0" newVersion="5.6.3.0"/>
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
|
||||
|
||||
</configuration>
|
||||
@@ -16,7 +16,7 @@
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.2.0.0" newVersion="5.2.0.0"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="NHibernate" publicKeyToken="aa95f207798dfdb4" culture="neutral"/>
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
<Reference Include="System.Data.DataSetExtensions">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Reference Include="System.Web.Mvc, Version=5.2.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\lib\aspnetmvc\System.Web.Mvc.dll</HintPath>
|
||||
</Reference>
|
||||
|
||||
@@ -29,6 +29,7 @@ using Orchard.Tests.Environment.Extensions;
|
||||
using Orchard.Tests.Environment.Features;
|
||||
using Orchard.Tests.Stubs;
|
||||
using IPackageManager = Orchard.Packaging.Services.IPackageManager;
|
||||
using Orchard.Tests.Modules.Recipes.Services;
|
||||
|
||||
namespace Orchard.Tests.Modules.Recipes.RecipeHandlers {
|
||||
[TestFixture]
|
||||
@@ -66,6 +67,7 @@ namespace Orchard.Tests.Modules.Recipes.RecipeHandlers {
|
||||
builder.RegisterType<ShellStateManager>().As<IShellStateManager>().SingleInstance();
|
||||
builder.RegisterType<StubEventBus>().As<IEventBus>().SingleInstance();
|
||||
builder.RegisterType<ModuleRecipeHandler>();
|
||||
builder.RegisterType<StubRecipeJournal>().As<IRecipeJournal>();
|
||||
builder.RegisterSource(new EventsRegistrationSource());
|
||||
}
|
||||
|
||||
|
||||
@@ -30,15 +30,17 @@ using Orchard.UI.PageClass;
|
||||
using Orchard.Users.Handlers;
|
||||
using Orchard.Users.Models;
|
||||
using Orchard.Users.Services;
|
||||
using Orchard.Services;
|
||||
|
||||
namespace Orchard.Tests.Modules.Users.Services {
|
||||
[TestFixture]
|
||||
public class MembershipServiceTests {
|
||||
private IMembershipValidationService _membershipValidationService;
|
||||
private IMembershipService _membershipService;
|
||||
private ISessionFactory _sessionFactory;
|
||||
private ISession _session;
|
||||
private IContainer _container;
|
||||
|
||||
private StubClock _clock;
|
||||
|
||||
public class TestSessionLocator : ISessionLocator {
|
||||
private readonly ISession _session;
|
||||
@@ -72,6 +74,7 @@ namespace Orchard.Tests.Modules.Users.Services {
|
||||
public void Init() {
|
||||
var builder = new ContainerBuilder();
|
||||
//builder.RegisterModule(new ImplicitCollectionSupportModule());
|
||||
builder.RegisterType<MembershipValidationService>().As<IMembershipValidationService>();
|
||||
builder.RegisterType<MembershipService>().As<IMembershipService>();
|
||||
builder.RegisterType<DefaultContentQuery>().As<IContentQuery>();
|
||||
builder.RegisterType<DefaultContentManager>().As<IContentManager>();
|
||||
@@ -88,6 +91,7 @@ namespace Orchard.Tests.Modules.Users.Services {
|
||||
builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>));
|
||||
builder.RegisterType<DefaultShapeTableManager>().As<IShapeTableManager>();
|
||||
builder.RegisterType<DefaultShapeFactory>().As<IShapeFactory>();
|
||||
builder.RegisterInstance(_clock = new StubClock()).As<IClock>();
|
||||
builder.RegisterType<StubExtensionManager>().As<IExtensionManager>();
|
||||
builder.RegisterInstance(new Mock<IPageClassBuilder>().Object);
|
||||
builder.RegisterType<DefaultContentDisplay>().As<IContentDisplay>();
|
||||
@@ -96,6 +100,7 @@ namespace Orchard.Tests.Modules.Users.Services {
|
||||
_session = _sessionFactory.OpenSession();
|
||||
builder.RegisterInstance(new TestSessionLocator(_session)).As<ISessionLocator>();
|
||||
_container = builder.Build();
|
||||
_membershipValidationService = _container.Resolve<IMembershipValidationService>();
|
||||
_membershipService = _container.Resolve<IMembershipService>();
|
||||
}
|
||||
|
||||
@@ -152,5 +157,64 @@ namespace Orchard.Tests.Modules.Users.Services {
|
||||
Assert.That(validate2, Is.Null);
|
||||
Assert.That(validate3, Is.Not.Null);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void UsersWhoHaveNeverLoggedInCanBeAuthenticated() {
|
||||
var user = (UserPart)_membershipService.CreateUser(new CreateUserParams("a", "b", "c", null, null, true));
|
||||
|
||||
Assert.That(_membershipValidationService.CanAuthenticateWithCookie(user), Is.True);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void UsersWhoHaveNeverLoggedOutCanBeAuthenticated() {
|
||||
var user = (UserPart)_membershipService.CreateUser(new CreateUserParams("a", "b", "c", null, null, true));
|
||||
|
||||
user.LastLoginUtc = _clock.UtcNow;
|
||||
_clock.Advance(TimeSpan.FromMinutes(1));
|
||||
|
||||
Assert.That(_membershipValidationService.CanAuthenticateWithCookie(user), Is.True);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void UsersWhoHaveLoggedOutCantBeAuthenticated() {
|
||||
var user = (UserPart)_membershipService.CreateUser(new CreateUserParams("a", "b", "c", null, null, true));
|
||||
|
||||
user.LastLoginUtc = _clock.UtcNow;
|
||||
_clock.Advance(TimeSpan.FromMinutes(1));
|
||||
user.LastLogoutUtc = _clock.UtcNow;
|
||||
_clock.Advance(TimeSpan.FromMinutes(1));
|
||||
|
||||
Assert.That(_membershipValidationService.CanAuthenticateWithCookie(user), Is.False);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void UsersWhoHaveLoggedInCanBeAuthenticated() {
|
||||
var user = (UserPart)_membershipService.CreateUser(new CreateUserParams("a", "b", "c", null, null, true));
|
||||
|
||||
user.LastLogoutUtc = _clock.UtcNow;
|
||||
_clock.Advance(TimeSpan.FromMinutes(1));
|
||||
user.LastLoginUtc = _clock.UtcNow;
|
||||
_clock.Advance(TimeSpan.FromMinutes(1));
|
||||
|
||||
Assert.That(_membershipValidationService.CanAuthenticateWithCookie(user), Is.True);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void PendingUsersCantBeAuthenticated() {
|
||||
var user = (UserPart)_membershipService.CreateUser(new CreateUserParams("a", "b", "c", null, null, true));
|
||||
|
||||
user.RegistrationStatus = UserStatus.Pending;
|
||||
|
||||
Assert.That(_membershipValidationService.CanAuthenticateWithCookie(user), Is.False);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ApprovedUsersCanBeAuthenticated() {
|
||||
var user = (UserPart)_membershipService.CreateUser(new CreateUserParams("a", "b", "c", null, null, true));
|
||||
|
||||
user.RegistrationStatus = UserStatus.Approved;
|
||||
|
||||
Assert.That(_membershipValidationService.CanAuthenticateWithCookie(user), Is.True);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.2.0.0" newVersion="5.2.0.0"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="NHibernate" publicKeyToken="aa95f207798dfdb4" culture="neutral"/>
|
||||
|
||||
@@ -59,6 +59,7 @@ namespace Orchard.Tests.ContentManagement {
|
||||
builder.RegisterInstance(new ShellSettings { Name = ShellSettings.DefaultName, DataProvider = "SqlCe" });
|
||||
builder.RegisterType<SqlCeStatementProvider>().As<ISqlStatementProvider>();
|
||||
builder.RegisterType<MySqlStatementProvider>().As<ISqlStatementProvider>();
|
||||
builder.RegisterType<PostgreSqlStatementProvider>().As<ISqlStatementProvider>();
|
||||
|
||||
builder.RegisterType<AlphaPartHandler>().As<IContentHandler>();
|
||||
builder.RegisterType<BetaPartHandler>().As<IContentHandler>();
|
||||
|
||||
@@ -24,5 +24,10 @@ namespace Orchard.Tests.DataMigration.Utilities {
|
||||
|
||||
public void Visit(DropForeignKeyCommand command) {
|
||||
}
|
||||
|
||||
public string PrefixTableName(string tableName) {
|
||||
return tableName;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Web;
|
||||
using Autofac;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using Orchard.Environment;
|
||||
using Orchard.Mvc;
|
||||
@@ -27,6 +28,13 @@ namespace Orchard.Tests.Environment {
|
||||
container.Mock<IHttpContextAccessor>()
|
||||
.Setup(x => x.Current())
|
||||
.Returns(() => _httpContextCurrent);
|
||||
|
||||
container.Mock<IHttpContextAccessor>()
|
||||
.Setup(x => x.CreateContext(It.IsAny<ILifetimeScope>()))
|
||||
.Returns(() => new StubHttpContext());
|
||||
|
||||
container.Mock<IWorkContextEvents>()
|
||||
.Setup(x => x.Started());
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
@@ -9,6 +9,7 @@ using Orchard.Environment.Descriptor;
|
||||
using Orchard.Environment.Descriptor.Models;
|
||||
using Orchard.Environment.ShellBuilders.Models;
|
||||
using Orchard.Mvc;
|
||||
using Orchard.Tests.Stubs;
|
||||
using Orchard.Tests.Utility;
|
||||
|
||||
namespace Orchard.Tests.Environment.ShellBuilders {
|
||||
@@ -32,6 +33,7 @@ namespace Orchard.Tests.Environment.ShellBuilders {
|
||||
var descriptor = new ShellDescriptor { SerialNumber = 6655321 };
|
||||
var blueprint = new ShellBlueprint();
|
||||
var shellLifetimeScope = _container.BeginLifetimeScope("shell");
|
||||
var httpContext = new StubHttpContext();
|
||||
|
||||
_container.Mock<IShellDescriptorCache>()
|
||||
.Setup(x => x.Fetch(ShellSettings.DefaultName))
|
||||
@@ -49,9 +51,16 @@ namespace Orchard.Tests.Environment.ShellBuilders {
|
||||
.Setup(x => x.GetShellDescriptor())
|
||||
.Returns(descriptor);
|
||||
|
||||
_container.Mock<IWorkContextEvents>()
|
||||
.Setup(x => x.Started());
|
||||
|
||||
_container.Mock<IHttpContextAccessor>()
|
||||
.Setup(x => x.Current())
|
||||
.Returns(default(HttpContextBase));
|
||||
.Returns(httpContext);
|
||||
|
||||
_container.Mock<IHttpContextAccessor>()
|
||||
.Setup(x => x.CreateContext(It.IsAny<ILifetimeScope>()))
|
||||
.Returns(httpContext);
|
||||
|
||||
var factory = _container.Resolve<IShellContextFactory>();
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ using Orchard.Environment.State;
|
||||
using Orchard.Environment.Descriptor.Models;
|
||||
using Orchard.Events;
|
||||
using Orchard.Mvc;
|
||||
using Orchard.Tests.Stubs;
|
||||
using Orchard.Tests.Utility;
|
||||
|
||||
namespace Orchard.Tests.Environment.State {
|
||||
@@ -34,12 +35,17 @@ namespace Orchard.Tests.Environment.State {
|
||||
LifetimeScope = _container.BeginLifetimeScope(),
|
||||
};
|
||||
|
||||
var httpContext = new StubHttpContext();
|
||||
|
||||
_container.Mock<IShellContextFactory>()
|
||||
.Setup(x => x.CreateDescribedContext(_shellContext.Settings, _shellContext.Descriptor))
|
||||
.Returns(_shellContext);
|
||||
_container.Mock<IHttpContextAccessor>()
|
||||
.Setup(x=>x.Current())
|
||||
.Returns(default(HttpContextBase));
|
||||
.Returns(httpContext);
|
||||
_container.Mock<IHttpContextAccessor>()
|
||||
.Setup(x => x.CreateContext(It.IsAny<ILifetimeScope>()))
|
||||
.Returns(httpContext);
|
||||
|
||||
}
|
||||
|
||||
|
||||
46
src/Orchard.Tests/Localization/TextTests.cs
Normal file
46
src/Orchard.Tests/Localization/TextTests.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using Autofac;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using Orchard.Localization;
|
||||
using Orchard.Localization.Services;
|
||||
using Orchard.Mvc;
|
||||
using Orchard.Tests.Stubs;
|
||||
using System.Web;
|
||||
|
||||
namespace Orchard.Tests.Localization {
|
||||
[TestFixture]
|
||||
public class TextTests {
|
||||
private IContainer _container;
|
||||
private IText _text;
|
||||
|
||||
[SetUp]
|
||||
public void Init() {
|
||||
var mockLocalizedManager = new Mock<ILocalizedStringManager>();
|
||||
mockLocalizedManager
|
||||
.Setup(x => x.GetLocalizedString(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>()))
|
||||
.Returns("foo {0}");
|
||||
|
||||
var builder = new ContainerBuilder();
|
||||
builder.RegisterInstance(new StubCultureSelector("fr-CA")).As<ICultureSelector>();
|
||||
builder.RegisterInstance(new StubWorkContext()).As<WorkContext>();
|
||||
builder.RegisterType<StubWorkContextAccessor>().As<IWorkContextAccessor>();
|
||||
builder.RegisterInstance(mockLocalizedManager.Object);
|
||||
builder.RegisterType<Orchard.Localization.Text>().As<IText>().WithParameter(new NamedParameter("scope", "scope"));
|
||||
_container = builder.Build();
|
||||
_text = _container.Resolve<IText>();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TextHtmlEncodeAllArguments() {
|
||||
Assert.That(_text.Get("foo {0}", "bar").Text, Is.EqualTo("foo bar"));
|
||||
Assert.That(_text.Get("foo {0}", "<bar>").Text, Is.EqualTo("foo <bar>"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TextDoesEncodeHtmlEncodedArguments()
|
||||
{
|
||||
Assert.That(_text.Get("foo {0}", new HtmlString("bar")).Text, Is.EqualTo("foo bar"));
|
||||
Assert.That(_text.Get("foo {0}", new HtmlString("<bar>")).Text, Is.EqualTo("foo <bar>"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -259,6 +259,7 @@
|
||||
<Compile Include="FileSystems\Dependencies\AssemblyProbingFolderTests.cs" />
|
||||
<Compile Include="FileSystems\Dependencies\DependenciesFolderTests.cs" />
|
||||
<Compile Include="FileSystems\VirtualPath\DefaultVirtualPathProviderTests.cs" />
|
||||
<Compile Include="Localization\TextTests.cs" />
|
||||
<Compile Include="Localization\CurrentCultureWorkContextTests.cs" />
|
||||
<Compile Include="Localization\CultureManagerTests.cs" />
|
||||
<Compile Include="Localization\DateTimePartsTests.cs" />
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Web;
|
||||
using Autofac;
|
||||
using Orchard.Mvc;
|
||||
|
||||
namespace Orchard.Tests.Stubs {
|
||||
@@ -16,6 +17,10 @@ namespace Orchard.Tests.Stubs {
|
||||
return _httpContext;
|
||||
}
|
||||
|
||||
public HttpContextBase CreateContext(ILifetimeScope lifetimeScope) {
|
||||
return _httpContext;
|
||||
}
|
||||
|
||||
public void Set(HttpContextBase httpContext) {
|
||||
_httpContext = httpContext;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,9 @@ using Autofac;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using Orchard.Environment;
|
||||
using Orchard.Mvc;
|
||||
using Orchard.Tasks;
|
||||
using Orchard.Tests.Stubs;
|
||||
using Orchard.Tests.Utility;
|
||||
|
||||
namespace Orchard.Tests.Tasks {
|
||||
@@ -16,6 +18,19 @@ namespace Orchard.Tests.Tasks {
|
||||
builder.RegisterType<SweepGenerator>();
|
||||
}
|
||||
|
||||
protected override void Resolve(ILifetimeScope container) {
|
||||
container.Mock<IHttpContextAccessor>()
|
||||
.Setup(x => x.Current())
|
||||
.Returns(() => null);
|
||||
|
||||
container.Mock<IHttpContextAccessor>()
|
||||
.Setup(x => x.CreateContext(It.IsAny<ILifetimeScope>()))
|
||||
.Returns(() => new StubHttpContext());
|
||||
|
||||
container.Mock<IWorkContextEvents>()
|
||||
.Setup(x => x.Started());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void DoWorkShouldSendHeartbeatToTaskManager() {
|
||||
var heartbeatSource = _container.Resolve<SweepGenerator>();
|
||||
|
||||
@@ -282,5 +282,21 @@ namespace Orchard.Tests.Utility.Extensions {
|
||||
Assert.That("abc".Translate("d".ToCharArray(), "d".ToCharArray()), Is.StringMatching("abc"));
|
||||
Assert.That("abc".Translate("abc".ToCharArray(), "def".ToCharArray()), Is.StringMatching("def"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ShouldEncodeToBase64() {
|
||||
Assert.That("abc".ToBase64(), Is.EqualTo("YWJj"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ShouldDecodeFromBase64() {
|
||||
Assert.That("YWJj".FromBase64(), Is.EqualTo("abc"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ShouldRoundtripBase64() {
|
||||
Assert.That("abc".ToBase64().FromBase64(), Is.EqualTo("abc"));
|
||||
Assert.That("YWJj".FromBase64().ToBase64(), Is.EqualTo("YWJj"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<CodeAnalysisRuleSet>..\OrchardBasicCorrectness.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace Orchard.Core.Containers.Models {
|
||||
public enum OrderByDirection {
|
||||
Ascending,
|
||||
Descending
|
||||
}
|
||||
}
|
||||
@@ -26,8 +26,6 @@ namespace Orchard.Core.Containers.ViewModels {
|
||||
|
||||
public enum SortDirection {
|
||||
Ascending,
|
||||
Descending,
|
||||
Created,
|
||||
DisplayText
|
||||
Descending
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
@model Orchard.Core.Containers.ViewModels.ContainerWidgetViewModel
|
||||
@using Orchard.Core.Containers.Models;
|
||||
@{
|
||||
Script.Require("ShapesBase");
|
||||
}
|
||||
@@ -25,8 +24,8 @@
|
||||
@Html.SelectOption(Model.Part.Record.OrderByProperty, "CustomPropertiesPart.CustomThree", T("Custom 3").Text)
|
||||
</select>
|
||||
<select title="@T("Order direction")" id="@Html.FieldIdFor(m => m.Part.Record.OrderByDirection)" name="@Html.FieldNameFor(m => m.Part.Record.OrderByDirection)">
|
||||
@Html.SelectOption(Model.Part.Record.OrderByDirection, (int)OrderByDirection.Ascending, T("Ascending").Text)
|
||||
@Html.SelectOption(Model.Part.Record.OrderByDirection, (int)OrderByDirection.Descending, T("Descending").Text)
|
||||
@Html.SelectOption(Model.Part.Record.OrderByDirection, (int)SortDirection.Ascending, T("Ascending").Text)
|
||||
@Html.SelectOption(Model.Part.Record.OrderByDirection, (int)SortDirection.Descending, T("Descending").Text)
|
||||
</select>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
|
||||
// display a message on leave if changes have been made
|
||||
window.onbeforeunload = function (e) {
|
||||
return leaveConfirmation;
|
||||
return $("<div/>").html(leaveConfirmation).text();
|
||||
};
|
||||
|
||||
// cancel leaving message on save
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<label for="menuId">@T("Current Menu:")</label>
|
||||
<select id="menuId" name="menuId">
|
||||
@foreach (var menu in Model.Menus) {
|
||||
@Html.SelectOption(Model.CurrentMenu.Id, menu.Id, Convert.ToString(Html.ItemDisplayText(menu)))
|
||||
@Html.SelectOption(Model.CurrentMenu.Id, menu.Id, Convert.ToString(Html.ItemDisplayText(menu, false)))
|
||||
}
|
||||
</select>
|
||||
@if (hasPermission) {
|
||||
@@ -135,7 +135,7 @@
|
||||
@using (Script.Foot()) {
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
var leaveConfirmation = '@T("Some items where not saved.")';
|
||||
var leaveConfirmation = '@HttpUtility.JavaScriptStringEncode(T("Some items where not saved.").Text)';
|
||||
|
||||
$('#menuId').change(function () {
|
||||
$(this).parents('form').submit();
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
@Html.LabelFor(m => m.CurrentMenuId, T("For Menu"))
|
||||
<select id="@Html.FieldIdFor(m => m.CurrentMenuId)" name="@Html.FieldNameFor(m => m.CurrentMenuId)">
|
||||
@foreach(ContentItem menu in Model.Menus) {
|
||||
@Html.SelectOption(Model.CurrentMenuId, menu.Id, Html.ItemDisplayText(menu).ToString())
|
||||
@Html.SelectOption(Model.CurrentMenuId, menu.Id, Html.ItemDisplayText(menu, false).ToString())
|
||||
}
|
||||
</select>
|
||||
<span class="hint">@T("Select which menu you want to display")</span>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<div data-controllerid="@Html.FieldIdFor(m => m.OnMenu)" class="">
|
||||
<select id="@Html.FieldIdFor(m => m.CurrentMenuId)" name="@Html.FieldNameFor(m => m.CurrentMenuId)">
|
||||
@foreach (ContentItem menu in Model.Menus) {
|
||||
@Html.SelectOption(Model.CurrentMenuId, menu.Id, Html.ItemDisplayText(menu).ToString())
|
||||
@Html.SelectOption(Model.CurrentMenuId, menu.Id, Html.ItemDisplayText(menu, false).ToString())
|
||||
}
|
||||
</select>
|
||||
<span class="hint">@T("Select which menu you want the content item to be displayed on.")</span>
|
||||
|
||||
@@ -117,7 +117,6 @@
|
||||
<Compile Include="Containers\ListViews\DefaultListView.cs" />
|
||||
<Compile Include="Containers\Migrations.cs" />
|
||||
<Compile Include="Containers\Models\ContainablePart.cs" />
|
||||
<Compile Include="Containers\Models\OrderByDirection.cs" />
|
||||
<Compile Include="Containers\Models\ContainerPart.cs" />
|
||||
<Compile Include="Common\Shapes.cs" />
|
||||
<Compile Include="Common\Fields\TextField.cs" />
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.Core.Settings.Models;
|
||||
using Orchard.Mvc;
|
||||
using Orchard.Mvc.Extensions;
|
||||
using Orchard.Settings;
|
||||
using Orchard.Utility.Extensions;
|
||||
|
||||
@@ -38,7 +39,7 @@ namespace Orchard.Core.Settings.Commands {
|
||||
|
||||
// Retrieve request URL if BaseUrl not provided as a switch value
|
||||
if (string.IsNullOrEmpty(BaseUrl)) {
|
||||
if (_httpContextAccessor.Current() == null) {
|
||||
if (_httpContextAccessor.Current().IsBackgroundContext()) {
|
||||
Context.Output.WriteLine(T("No HTTP request available to determine the base url of the site"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@
|
||||
if (controller.is(":checkbox")) {
|
||||
controller.click($(this).toggleWhatYouControl).each($(this).toggleWhatYouControl);
|
||||
} else if (controller.is(":radio")) {
|
||||
$("[name=" + controller.attr("name") + "]").click(function () { $("[name=" + $(this).attr("name") + "]").each($(this).toggleWhatYouControl); });
|
||||
$("[name='" + controller.attr("name") + "']").click(function () { $("[name='" + $(this).attr("name") + "']").each($(this).toggleWhatYouControl); });
|
||||
}
|
||||
else if (controller.is("option")) {
|
||||
controller.parent().change(function() {
|
||||
|
||||
@@ -1 +1,6 @@
|
||||
<div class="message message-@Model.Type">@Html.Raw(Html.Encode(Model.Message).Replace("\n", "<br />"))</div>
|
||||
@*
|
||||
Model.Message can either be:
|
||||
- an IHtmlString and won't be re-encoded
|
||||
- a string and will be encoded
|
||||
*@
|
||||
<div class="message message-@Model.Type">@Html.Raw(Html.Encode(Model.Message).Replace("\n", "<br />"))</div>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="user-display">
|
||||
@if (WorkContext.CurrentUser != null) {
|
||||
<span class="user-actions welcome">
|
||||
@T("Welcome, <strong>{0}</strong>!", "<a href=\"" + @Url.Action("ChangePassword", new { Controller = "Account", Area = "Orchard.Users" }) + "\">" + @Html.ItemDisplayText(WorkContext.CurrentUser) + "</a>")
|
||||
@T("Welcome, <strong>{0}</strong>!", Html.Raw("<a href=\"" + @Url.Action("ChangePassword", new { Controller = "Account", Area = "Orchard.Users" }) + "\">" + Html.ItemDisplayText(WorkContext.CurrentUser) + "</a>"))
|
||||
</span>
|
||||
<span class="user-actions">
|
||||
@Html.ActionLink(T("Sign Out").ToString(), "LogOff", new { Controller = "Account", Area = "Orchard.Users", ReturnUrl = Context.Request.RawUrl }, new { rel = "nofollow" })
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<system.web.webPages.razor>
|
||||
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<pages pageBaseType="Orchard.Mvc.ViewEngines.Razor.WebViewPage">
|
||||
<namespaces>
|
||||
<add namespace="System.Web.Mvc"/>
|
||||
@@ -29,7 +29,7 @@
|
||||
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
|
||||
<add assembly="System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Web.Mvc, Version=5.2.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="Orchard.Framework"/>
|
||||
<add assembly="Orchard.Core"/>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<system.web.webPages.razor>
|
||||
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<pages pageBaseType="Orchard.Mvc.ViewEngines.Razor.WebViewPage">
|
||||
<namespaces>
|
||||
<add namespace="System.Web.Mvc"/>
|
||||
@@ -29,7 +29,7 @@
|
||||
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
|
||||
<add assembly="System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Web.Mvc, Version=5.2.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
</assemblies>
|
||||
</compilation>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<system.web.webPages.razor>
|
||||
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<pages pageBaseType="Orchard.Mvc.ViewEngines.Razor.WebViewPage">
|
||||
<namespaces>
|
||||
<add namespace="System.Web.Mvc"/>
|
||||
@@ -29,7 +29,7 @@
|
||||
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
|
||||
<add assembly="System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Web.Mvc, Version=5.2.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="Orchard.Framework"/>
|
||||
<add assembly="Orchard.Core"/>
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
<IISExpressAnonymousAuthentication />
|
||||
<IISExpressWindowsAuthentication />
|
||||
<IISExpressUseClassicPipelineMode />
|
||||
<UseGlobalApplicationHostFile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
@@ -34,7 +35,7 @@
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRuleSet>..\..\..\OrchardBasicCorrectness.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<system.web.webPages.razor>
|
||||
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<pages pageBaseType="Orchard.Mvc.ViewEngines.Razor.WebViewPage">
|
||||
<namespaces>
|
||||
<add namespace="System.Web.Mvc"/>
|
||||
@@ -29,7 +29,7 @@
|
||||
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
|
||||
<add assembly="System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Web.Mvc, Version=5.2.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="Orchard.Framework"/>
|
||||
<add assembly="Orchard.Core"/>
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
<IISExpressAnonymousAuthentication />
|
||||
<IISExpressWindowsAuthentication />
|
||||
<IISExpressUseClassicPipelineMode />
|
||||
<UseGlobalApplicationHostFile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
@@ -34,7 +35,7 @@
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRuleSet>..\..\..\OrchardBasicCorrectness.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<system.web.webPages.razor>
|
||||
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<pages pageBaseType="Orchard.Mvc.ViewEngines.Razor.WebViewPage">
|
||||
<namespaces>
|
||||
<add namespace="System.Web.Mvc"/>
|
||||
@@ -29,7 +29,7 @@
|
||||
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
|
||||
<add assembly="System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Web.Mvc, Version=5.2.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="Orchard.Framework"/>
|
||||
<add assembly="Orchard.Core"/>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<system.web.webPages.razor>
|
||||
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<pages pageBaseType="Orchard.Mvc.ViewEngines.Razor.WebViewPage">
|
||||
<namespaces>
|
||||
<add namespace="System.Web.Mvc"/>
|
||||
@@ -29,7 +29,7 @@
|
||||
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
|
||||
<add assembly="System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Web.Mvc, Version=5.2.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="Orchard.Framework"/>
|
||||
<add assembly="Orchard.Core"/>
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
<IISExpressAnonymousAuthentication />
|
||||
<IISExpressWindowsAuthentication />
|
||||
<IISExpressUseClassicPipelineMode />
|
||||
<UseGlobalApplicationHostFile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
@@ -33,7 +34,7 @@
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRuleSet>..\..\..\OrchardBasicCorrectness.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
using Orchard.ContentManagement;
|
||||
|
||||
@@ -15,8 +16,10 @@ namespace Orchard.AuditTrail.Services.Models {
|
||||
var filters = new Filters(updateModel);
|
||||
|
||||
foreach (string nameValue in nameValues) {
|
||||
if (!String.IsNullOrEmpty(nameValue)) {
|
||||
filters.Add(nameValue, nameValues[nameValue]);
|
||||
}
|
||||
}
|
||||
|
||||
return filters;
|
||||
}
|
||||
|
||||
@@ -17,6 +17,6 @@
|
||||
<div>
|
||||
@Html.CheckBoxFor(m => m.ShowAuditTrailCommentInput)
|
||||
@Html.LabelFor(m => m.ShowAuditTrailCommentInput, T("Show comment input").Text, new { @class = "forcheckbox" })
|
||||
<span class="hint">@T("Renders a text field to allow the user to enter a comment about the changes she made.")</span>
|
||||
<span class="hint">@T("Renders a text field to allow the user to enter a comment about the changes they made.")</span>
|
||||
</div>
|
||||
</fieldset>
|
||||
@@ -48,7 +48,8 @@
|
||||
var isSelected = Model.SelectedContentItems.Where(x => x.Id == contentItem.Id && x.Selected).Select(x => x.Id).Any();
|
||||
var commonPart = contentItem.As<CommonPart>();
|
||||
var removedText = commonPart != null ? dateLocalizationServices.ConvertToLocalizedString(commonPart.VersionModifiedUtc) : T("-").Text;
|
||||
var contentDisplayText = Html.ItemDisplayText(contentItem).ToString();
|
||||
var contentDisplayTextHtmlString = Html.ItemDisplayText(contentItem);
|
||||
var contentDisplayText = contentDisplayTextHtmlString != null ? contentDisplayTextHtmlString.ToString() : contentItem.ContentType;
|
||||
var contentDisplayUrl = Url.Action("Detail", "Content", new {id = contentItem.Id, version = contentItem.Version, area = "Orchard.AuditTrail"});
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<system.web.webPages.razor>
|
||||
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<pages pageBaseType="Orchard.Mvc.ViewEngines.Razor.WebViewPage">
|
||||
<namespaces>
|
||||
<add namespace="System.Web.Mvc"/>
|
||||
@@ -29,7 +29,7 @@
|
||||
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
|
||||
<add assembly="System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Web.Mvc, Version=5.2.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
|
||||
<add assembly="Orchard.Framework"/>
|
||||
|
||||
@@ -12,6 +12,11 @@ using Orchard.Localization;
|
||||
using Orchard.Security;
|
||||
using Orchard.UI.Notify;
|
||||
using Orchard.Utility.Extensions;
|
||||
using Orchard.Localization.Services;
|
||||
using Orchard.Localization.Models;
|
||||
using Orchard.Mvc;
|
||||
using System.Web;
|
||||
using Orchard.ContentManagement.Aspects;
|
||||
|
||||
namespace Orchard.Autoroute.Drivers {
|
||||
public class AutoroutePartDriver : ContentPartDriver<AutoroutePart> {
|
||||
@@ -20,47 +25,92 @@ namespace Orchard.Autoroute.Drivers {
|
||||
private readonly IAutorouteService _autorouteService;
|
||||
private readonly IAuthorizer _authorizer;
|
||||
private readonly INotifier _notifier;
|
||||
private readonly ICultureManager _cultureManager;
|
||||
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||
|
||||
public AutoroutePartDriver(
|
||||
IAliasService aliasService,
|
||||
IContentManager contentManager,
|
||||
IAutorouteService autorouteService,
|
||||
IAuthorizer authorizer,
|
||||
INotifier notifier) {
|
||||
INotifier notifier,
|
||||
ICultureManager cultureManager,
|
||||
IHttpContextAccessor httpContextAccessor) {
|
||||
_aliasService = aliasService;
|
||||
_contentManager = contentManager;
|
||||
_autorouteService = autorouteService;
|
||||
_authorizer = authorizer;
|
||||
_notifier = notifier;
|
||||
_cultureManager = cultureManager;
|
||||
_httpContextAccessor = httpContextAccessor;
|
||||
|
||||
T = NullLocalizer.Instance;
|
||||
}
|
||||
|
||||
public Localizer T { get; set; }
|
||||
|
||||
protected override string Prefix { get { return "Autoroute"; }}
|
||||
|
||||
protected override DriverResult Editor(AutoroutePart part, dynamic shapeHelper) {
|
||||
return Editor(part, null, shapeHelper);
|
||||
}
|
||||
|
||||
protected override DriverResult Editor(AutoroutePart part, IUpdateModel updater, dynamic shapeHelper) {
|
||||
|
||||
var settings = part.TypePartDefinition.Settings.GetModel<AutorouteSettings>();
|
||||
var itemCulture = _cultureManager.GetSiteCulture();
|
||||
|
||||
//if we are editing an existing content item
|
||||
if (part.Record.Id != 0) {
|
||||
ContentItem contentItem = _contentManager.Get(part.Record.ContentItemRecord.Id);
|
||||
var aspect = contentItem.As<ILocalizableAspect>();
|
||||
|
||||
if (aspect != null) {
|
||||
itemCulture = aspect.Culture;
|
||||
}
|
||||
}
|
||||
|
||||
if (settings.UseCulturePattern) {
|
||||
//if we are creating from a form post we use the form value for culture
|
||||
HttpContextBase context = _httpContextAccessor.Current();
|
||||
if (!String.IsNullOrEmpty(context.Request.Form["Localization.SelectedCulture"])) {
|
||||
itemCulture = context.Request.Form["Localization.SelectedCulture"].ToString();
|
||||
}
|
||||
}
|
||||
|
||||
//we update the settings assuming that when
|
||||
//pattern culture = null or "" it means culture = default website culture
|
||||
//for patterns that we migrated
|
||||
foreach (RoutePattern pattern in settings.Patterns.Where(x => String.IsNullOrWhiteSpace(x.Culture))) {
|
||||
pattern.Culture = _cultureManager.GetSiteCulture(); ;
|
||||
}
|
||||
|
||||
//we do the same for default patterns
|
||||
foreach (DefaultPattern pattern in settings.DefaultPatterns.Where(x => String.IsNullOrWhiteSpace(x.Culture))) {
|
||||
pattern.Culture = _cultureManager.GetSiteCulture();
|
||||
}
|
||||
|
||||
// if the content type has no pattern for autoroute, then use a default one
|
||||
if(!settings.Patterns.Any()) {
|
||||
settings.AllowCustomPattern = true;
|
||||
settings.AutomaticAdjustmentOnEdit = false;
|
||||
settings.DefaultPatternIndex = 0;
|
||||
settings.Patterns = new List<RoutePattern> {new RoutePattern {Name = "Title", Description = "my-title", Pattern = "{Content.Slug}"}};
|
||||
if (!settings.Patterns.Any(x => String.Equals(x.Culture, itemCulture, StringComparison.OrdinalIgnoreCase))) {
|
||||
settings.Patterns = new List<RoutePattern> { new RoutePattern { Name = "Title", Description = "my-title", Pattern = "{Content.Slug}", Culture = itemCulture } };
|
||||
}
|
||||
|
||||
_notifier.Warning(T("No route patterns are currently defined for this Content Type. If you don't set one in the settings, a default one will be used."));
|
||||
// if the content type has no defaultPattern for autoroute, then use a default one
|
||||
if (!settings.DefaultPatterns.Any(x => String.Equals(x.Culture, itemCulture, StringComparison.OrdinalIgnoreCase))) {
|
||||
//if we are in the default culture check the old setting
|
||||
if (String.Equals(itemCulture, _cultureManager.GetSiteCulture(), StringComparison.OrdinalIgnoreCase)) {
|
||||
if (!String.IsNullOrEmpty(part.TypePartDefinition.Settings["AutorouteSettings.DefaultPatternIndex"])) {
|
||||
string patternIndex = part.TypePartDefinition.Settings["AutorouteSettings.DefaultPatternIndex"];
|
||||
settings.DefaultPatterns.Add(new DefaultPattern { PatternIndex = patternIndex, Culture = itemCulture });
|
||||
} else {
|
||||
settings.DefaultPatterns.Add(new DefaultPattern { PatternIndex = "0", Culture = itemCulture });
|
||||
}
|
||||
} else {
|
||||
settings.DefaultPatterns.Add(new DefaultPattern { PatternIndex = "0", Culture = itemCulture });
|
||||
}
|
||||
}
|
||||
|
||||
var viewModel = new AutoroutePartEditViewModel {
|
||||
CurrentUrl = part.DisplayAlias,
|
||||
Settings = settings
|
||||
Settings = settings,
|
||||
CurrentCulture = itemCulture
|
||||
};
|
||||
|
||||
// retrieve home page
|
||||
@@ -125,12 +175,18 @@ namespace Orchard.Autoroute.Drivers {
|
||||
if (useCustomPattern != null) {
|
||||
part.UseCustomPattern = bool.Parse(useCustomPattern);
|
||||
}
|
||||
|
||||
var useCulturePattern = context.Attribute(part.PartDefinition.Name, "UseCulturePattern");
|
||||
if (useCulturePattern != null) {
|
||||
part.UseCulturePattern = bool.Parse(useCulturePattern);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void Exporting(AutoroutePart part, ContentManagement.Handlers.ExportContentContext context) {
|
||||
context.Element(part.PartDefinition.Name).SetAttributeValue("Alias", String.IsNullOrEmpty(part.Record.DisplayAlias) ? "/" : part.Record.DisplayAlias);
|
||||
context.Element(part.PartDefinition.Name).SetAttributeValue("CustomPattern", part.Record.CustomPattern);
|
||||
context.Element(part.PartDefinition.Name).SetAttributeValue("UseCustomPattern", part.Record.UseCustomPattern);
|
||||
context.Element(part.PartDefinition.Name).SetAttributeValue("UseCulturePattern", part.Record.UseCulturePattern);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,23 +7,27 @@ using Orchard.Data;
|
||||
using Orchard.Autoroute.Services;
|
||||
using Orchard.Localization;
|
||||
using Orchard.UI.Notify;
|
||||
using Orchard.Alias;
|
||||
|
||||
namespace Orchard.Autoroute.Handlers {
|
||||
public class AutoroutePartHandler : ContentHandler {
|
||||
|
||||
private readonly Lazy<IAutorouteService> _autorouteService;
|
||||
private readonly IOrchardServices _orchardServices;
|
||||
private readonly IAliasService _aliasService;
|
||||
|
||||
public Localizer T { get; set; }
|
||||
|
||||
public AutoroutePartHandler(
|
||||
IRepository<AutoroutePartRecord> autoroutePartRepository,
|
||||
Lazy<IAutorouteService> autorouteService,
|
||||
IOrchardServices orchardServices) {
|
||||
IOrchardServices orchardServices,
|
||||
IAliasService aliasService) {
|
||||
|
||||
Filters.Add(StorageFilter.For(autoroutePartRepository));
|
||||
_autorouteService = autorouteService;
|
||||
_orchardServices = orchardServices;
|
||||
_aliasService = aliasService;
|
||||
|
||||
OnUpdated<AutoroutePart>((ctx, part) => CreateAlias(part));
|
||||
|
||||
@@ -97,6 +101,13 @@ namespace Orchard.Autoroute.Handlers {
|
||||
}
|
||||
|
||||
void RemoveAlias(AutoroutePart part) {
|
||||
// Is this the current home page?
|
||||
var homePageRoute = _aliasService.Get("");
|
||||
var homePageId = homePageRoute.ContainsKey("id") ? int.Parse(homePageRoute["id"].ToString()) : default(int);
|
||||
|
||||
if (part.ContentItem.Id == homePageId) {
|
||||
_orchardServices.Notifier.Warning(T("You removed the content item that served as the site\'s home page. \nMost possibly this means that instead of the home page a \"404 Not Found\" error page will be displayed without a link to log in or access the dashboard. \n\nTo prevent this you can e.g. publish a content item that has the \"Set as home page\" checkbox ticked."));
|
||||
}
|
||||
_autorouteService.Value.RemoveAliases(part);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,24 @@
|
||||
using Orchard.ContentManagement.MetaData;
|
||||
using Orchard.Autoroute.Models;
|
||||
using Orchard.Autoroute.Services;
|
||||
using Orchard.Autoroute.Settings;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.MetaData;
|
||||
using Orchard.ContentManagement.MetaData.Models;
|
||||
using Orchard.Core.Contents.Extensions;
|
||||
using Orchard.Data.Migration;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Orchard.Autoroute {
|
||||
public class Migrations : DataMigrationImpl {
|
||||
|
||||
public int Create() {
|
||||
SchemaBuilder.CreateTable("AutoroutePartRecord",
|
||||
table => table
|
||||
.ContentPartVersionRecord()
|
||||
.Column<string>("CustomPattern", c => c.WithLength(2048))
|
||||
.Column<bool>("UseCustomPattern", c => c.WithDefault(false))
|
||||
.Column<bool>("UseCulturePattern", c => c.WithDefault(false))
|
||||
.Column<string>("DisplayAlias", c => c.WithLength(2048)));
|
||||
|
||||
ContentDefinitionManager.AlterPartDefinition("AutoroutePart", part => part
|
||||
@@ -20,7 +29,7 @@ namespace Orchard.Autoroute {
|
||||
.CreateIndex("IDX_AutoroutePartRecord_DisplayAlias", "DisplayAlias")
|
||||
);
|
||||
|
||||
return 3;
|
||||
return 4;
|
||||
}
|
||||
|
||||
public int UpdateFrom1() {
|
||||
@@ -37,5 +46,14 @@ namespace Orchard.Autoroute {
|
||||
|
||||
return 3;
|
||||
}
|
||||
|
||||
public int UpdateFrom3() {
|
||||
|
||||
SchemaBuilder.AlterTable("AutoroutePartRecord", table => table
|
||||
.AddColumn<bool>("UseCulturePattern", c => c.WithDefault(false))
|
||||
);
|
||||
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,10 @@ namespace Orchard.Autoroute.Models {
|
||||
get { return Retrieve(x => x.UseCustomPattern); }
|
||||
set { Store(x => x.UseCustomPattern, value); }
|
||||
}
|
||||
public bool UseCulturePattern {
|
||||
get { return Retrieve(x => x.UseCulturePattern); }
|
||||
set { Store(x => x.UseCulturePattern, value); }
|
||||
}
|
||||
public string DisplayAlias {
|
||||
get { return Retrieve(x => x.DisplayAlias); }
|
||||
set { Store(x => x.DisplayAlias, value); }
|
||||
|
||||
@@ -6,6 +6,8 @@ namespace Orchard.Autoroute.Models {
|
||||
|
||||
public virtual bool UseCustomPattern { get; set; }
|
||||
|
||||
public virtual bool UseCulturePattern { get; set; }
|
||||
|
||||
[StringLength(2048)]
|
||||
public virtual string CustomPattern { get; set; }
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
<IISExpressAnonymousAuthentication />
|
||||
<IISExpressWindowsAuthentication />
|
||||
<IISExpressUseClassicPipelineMode />
|
||||
<UseGlobalApplicationHostFile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
@@ -34,7 +35,7 @@
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRuleSet>..\..\..\OrchardBasicCorrectness.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
@@ -71,6 +72,7 @@
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Scripts\autoroute-browser.js" />
|
||||
<Content Include="Styles\orchard-autoroute-settings.css" />
|
||||
<Content Include="Web.config" />
|
||||
<Content Include="Scripts\Web.config" />
|
||||
@@ -94,6 +96,10 @@
|
||||
<Project>{475B6C45-B27C-438B-8966-908B9D6D1077}</Project>
|
||||
<Name>Orchard.Alias</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Orchard.ContentTypes\Orchard.ContentTypes.csproj">
|
||||
<Project>{0e7646e8-fe8f-43c1-8799-d97860925ec4}</Project>
|
||||
<Name>Orchard.ContentTypes</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Orchard.Tokens\Orchard.Tokens.csproj">
|
||||
<Project>{6F759635-13D7-4E94-BCC9-80445D63F117}</Project>
|
||||
<Name>Orchard.Tokens</Name>
|
||||
@@ -101,12 +107,14 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Commands\AutorouteCommands.cs" />
|
||||
<Compile Include="Providers\ContentDefinition\ContentDefinitionEventHandler.cs" />
|
||||
<Compile Include="ResourceManifest.cs" />
|
||||
<Compile Include="Services\AliasResolverSelector.cs" />
|
||||
<Compile Include="Services\PathResolutionService.cs" />
|
||||
<Compile Include="Services\IPathResolutionService.cs" />
|
||||
<Compile Include="Services\IRouteEvents.cs" />
|
||||
<Compile Include="Settings\AutorouteSettingsEvents.cs" />
|
||||
<Compile Include="Settings\DefaultPattern.cs" />
|
||||
<Compile Include="Settings\RoutePattern.cs" />
|
||||
<Compile Include="Drivers\AutoroutePartDriver.cs" />
|
||||
<Compile Include="Handlers\AutoroutePartHandler.cs" />
|
||||
@@ -122,9 +130,7 @@
|
||||
<Compile Include="Settings\AutorouteSettings.cs" />
|
||||
<Compile Include="ViewModels\AutoroutePartEditViewModel.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Controllers\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<ItemGroup>
|
||||
<Content Include="Placement.info">
|
||||
<SubType>Designer</SubType>
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
using Orchard.Autoroute.Models;
|
||||
using Orchard.Autoroute.Services;
|
||||
using Orchard.Autoroute.Settings;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.MetaData;
|
||||
using Orchard.ContentTypes.Events;
|
||||
using Orchard.Localization.Services;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Orchard.Autoroute.Providers.ContentDefinition {
|
||||
public class ContentDefinitionEventHandler : IContentDefinitionEventHandler {
|
||||
private readonly ICultureManager _cultureManager;
|
||||
private readonly IContentDefinitionManager _contentDefinitionManager;
|
||||
private readonly IOrchardServices _orchardServices;
|
||||
private readonly Lazy<IAutorouteService> _autorouteService;
|
||||
private readonly IContentManager _contentManager;
|
||||
|
||||
public ContentDefinitionEventHandler(
|
||||
IContentManager contentManager,
|
||||
Lazy<IAutorouteService> autorouteService,
|
||||
IOrchardServices orchardServices,
|
||||
IContentDefinitionManager contentDefinitionManager,
|
||||
ICultureManager cultureManager) {
|
||||
_cultureManager = cultureManager;
|
||||
_contentDefinitionManager = contentDefinitionManager;
|
||||
_orchardServices = orchardServices;
|
||||
_autorouteService = autorouteService;
|
||||
_contentManager = contentManager;
|
||||
}
|
||||
|
||||
public void ContentTypeCreated(ContentTypeCreatedContext context) {
|
||||
}
|
||||
|
||||
public void ContentTypeRemoved(ContentTypeRemovedContext context) {
|
||||
}
|
||||
|
||||
public void ContentTypeImporting(ContentTypeImportingContext context) {
|
||||
}
|
||||
|
||||
public void ContentTypeImported(ContentTypeImportedContext context) {
|
||||
}
|
||||
|
||||
public void ContentPartCreated(ContentPartCreatedContext context) {
|
||||
}
|
||||
|
||||
public void ContentPartRemoved(ContentPartRemovedContext context) {
|
||||
}
|
||||
|
||||
public void ContentPartAttached(ContentPartAttachedContext context) {
|
||||
if (context.ContentPartName == "AutoroutePart") {
|
||||
//Create pattern and default pattern for each culture installed
|
||||
|
||||
//get cultures
|
||||
var SiteCultures = _cultureManager.ListCultures().ToList();
|
||||
|
||||
//Create Patterns and DefaultPatterns
|
||||
var settings = new AutorouteSettings {
|
||||
Patterns = new List<RoutePattern>()
|
||||
};
|
||||
|
||||
List<RoutePattern> newPatterns = new List<RoutePattern>();
|
||||
List<DefaultPattern> newDefaultPatterns = new List<DefaultPattern>();
|
||||
foreach (string culture in SiteCultures) {
|
||||
newPatterns.Add(new RoutePattern {
|
||||
Name = "Title",
|
||||
Description = "my-title",
|
||||
Pattern = "{Content.Slug}",
|
||||
Culture = culture
|
||||
});
|
||||
newDefaultPatterns.Add(new DefaultPattern {
|
||||
Culture = culture,
|
||||
PatternIndex = "0"
|
||||
});
|
||||
}
|
||||
|
||||
settings.Patterns = newPatterns;
|
||||
settings.DefaultPatterns = newDefaultPatterns;
|
||||
|
||||
//Update Settings
|
||||
_contentDefinitionManager.AlterTypeDefinition(context.ContentTypeName, builder => builder.WithPart("AutoroutePart", settings.Build));
|
||||
|
||||
//TODO Generate URL's for existing content items
|
||||
//We should provide a global setting to enable/disable this feature
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void ContentPartDetached(ContentPartDetachedContext context) {
|
||||
}
|
||||
|
||||
public void ContentPartImporting(ContentPartImportingContext context) {
|
||||
}
|
||||
|
||||
public void ContentPartImported(ContentPartImportedContext context) {
|
||||
}
|
||||
|
||||
public void ContentFieldAttached(ContentFieldAttachedContext context) {
|
||||
}
|
||||
|
||||
public void ContentFieldDetached(ContentFieldDetachedContext context) {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ namespace Orchard.Autoroute {
|
||||
public void BuildManifests(ResourceManifestBuilder builder) {
|
||||
var manifest = builder.Add();
|
||||
manifest.DefineStyle("AutorouteSettings").SetUrl("orchard-autoroute-settings.css");
|
||||
manifest.DefineScript("AutorouteBrowser").SetUrl("autoroute-browser.js").SetDependencies("jQuery");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
(function ($) {
|
||||
var AutorouteCultureBrowser = function (culture) {
|
||||
var self = this;
|
||||
this.culture = culture;
|
||||
|
||||
this.initialize = function () {
|
||||
self.culture.find(".autoroute-cultures").on("click", "a.culture", function (e) {
|
||||
var categoryLink = $(this);
|
||||
var href = categoryLink.attr("href");
|
||||
|
||||
self.culture.find(".autoroute-cultures li").removeClass("selected");
|
||||
categoryLink.closest("li").addClass("selected");
|
||||
self.culture.find(".items").hide();
|
||||
self.culture.find(href).show();
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
self.culture.find(".autoroute-cultures a").first().click();
|
||||
}
|
||||
};
|
||||
|
||||
$(".use-culture-pattern[type=checkbox]").click(function () {
|
||||
if ($(this).attr("checked") == "checked") {
|
||||
$(".autoroute-cultures li:not(:first)").hide();
|
||||
$(".autoroute-cultures li").removeClass("selected");
|
||||
$(".autoroute-cultures li:first").addClass("selected");
|
||||
$("#content .items").hide();
|
||||
$("#content .items.default").show();
|
||||
$(this).removeAttr('checked');
|
||||
} else {
|
||||
$(".autoroute-cultures li:not(:first)").show();
|
||||
$("#content .items.default").show();
|
||||
$(this).attr('checked', 'checked');
|
||||
}
|
||||
});
|
||||
|
||||
$(function () {
|
||||
var browser = new AutorouteCultureBrowser($("#main"));
|
||||
browser.initialize();
|
||||
|
||||
});
|
||||
})(jQuery);
|
||||
@@ -10,6 +10,10 @@ using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.MetaData;
|
||||
using Orchard.ContentManagement.MetaData.Models;
|
||||
using Orchard.Tokens;
|
||||
using Orchard.Localization.Services;
|
||||
using Orchard.Mvc;
|
||||
using System.Web;
|
||||
using Orchard.ContentManagement.Aspects;
|
||||
|
||||
namespace Orchard.Autoroute.Services {
|
||||
public class AutorouteService : Component, IAutorouteService {
|
||||
@@ -19,7 +23,9 @@ namespace Orchard.Autoroute.Services {
|
||||
private readonly IContentDefinitionManager _contentDefinitionManager;
|
||||
private readonly IContentManager _contentManager;
|
||||
private readonly IRouteEvents _routeEvents;
|
||||
private readonly ICultureManager _cultureManager;
|
||||
private readonly IAliasStorage _aliasStorage;
|
||||
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||
private const string AliasSource = "Autoroute:View";
|
||||
|
||||
public AutorouteService(
|
||||
@@ -28,6 +34,8 @@ namespace Orchard.Autoroute.Services {
|
||||
IContentDefinitionManager contentDefinitionManager,
|
||||
IContentManager contentManager,
|
||||
IRouteEvents routeEvents,
|
||||
ICultureManager cultureManager,
|
||||
IHttpContextAccessor httpContextAccessor,
|
||||
IAliasStorage aliasStorage) {
|
||||
|
||||
_aliasService = aliasService;
|
||||
@@ -36,6 +44,8 @@ namespace Orchard.Autoroute.Services {
|
||||
_contentManager = contentManager;
|
||||
_routeEvents = routeEvents;
|
||||
_aliasStorage = aliasStorage;
|
||||
_cultureManager = cultureManager;
|
||||
_httpContextAccessor = httpContextAccessor;
|
||||
}
|
||||
|
||||
public string GenerateAlias(AutoroutePart part) {
|
||||
@@ -43,8 +53,28 @@ namespace Orchard.Autoroute.Services {
|
||||
if (part == null) {
|
||||
throw new ArgumentNullException("part");
|
||||
}
|
||||
var settings = part.TypePartDefinition.Settings.GetModel<AutorouteSettings>();
|
||||
var itemCulture = _cultureManager.GetSiteCulture();
|
||||
|
||||
var pattern = GetDefaultPattern(part.ContentItem.ContentType).Pattern;
|
||||
//if we are editing an existing content item
|
||||
if (part.Record.Id != 0) {
|
||||
ContentItem contentItem = _contentManager.Get(part.Record.ContentItemRecord.Id);
|
||||
var aspect = contentItem.As<ILocalizableAspect>();
|
||||
|
||||
if (aspect != null) {
|
||||
itemCulture = aspect.Culture;
|
||||
}
|
||||
}
|
||||
|
||||
if (settings.UseCulturePattern) {
|
||||
//if we are creating from a form post we use the form value for culture
|
||||
HttpContextBase context = _httpContextAccessor.Current();
|
||||
if (!String.IsNullOrEmpty(context.Request.Form["Localization.SelectedCulture"])) {
|
||||
itemCulture = context.Request.Form["Localization.SelectedCulture"].ToString();
|
||||
}
|
||||
}
|
||||
|
||||
string pattern = GetDefaultPattern(part.ContentItem.ContentType, itemCulture).Pattern;
|
||||
|
||||
// String.Empty forces pattern based generation. "/" forces homepage.
|
||||
if (part.UseCustomPattern
|
||||
@@ -85,7 +115,8 @@ namespace Orchard.Autoroute.Services {
|
||||
var routePattern = new RoutePattern {
|
||||
Description = description,
|
||||
Name = name,
|
||||
Pattern = pattern
|
||||
Pattern = pattern,
|
||||
Culture = _cultureManager.GetSiteCulture()
|
||||
};
|
||||
|
||||
var patterns = settings.Patterns;
|
||||
@@ -94,7 +125,7 @@ namespace Orchard.Autoroute.Services {
|
||||
|
||||
// Define which pattern is the default.
|
||||
if (makeDefault || settings.Patterns.Count == 1) {
|
||||
settings.DefaultPatternIndex = settings.Patterns.IndexOf(routePattern);
|
||||
settings.DefaultPatterns = new List<DefaultPattern> { new DefaultPattern { PatternIndex = "0", Culture = settings.Patterns[0].Culture } };
|
||||
}
|
||||
|
||||
_contentDefinitionManager.AlterTypeDefinition(contentType, builder => builder.WithPart("AutoroutePart", settings.Build));
|
||||
@@ -105,15 +136,34 @@ namespace Orchard.Autoroute.Services {
|
||||
return settings.Patterns;
|
||||
}
|
||||
|
||||
public RoutePattern GetDefaultPattern(string contentType) {
|
||||
public RoutePattern GetDefaultPattern(string contentType, string culture) {
|
||||
var settings = GetTypePartSettings(contentType).GetModel<AutorouteSettings>();
|
||||
|
||||
// Return a default pattern if none is defined.
|
||||
if (settings.DefaultPatternIndex < settings.Patterns.Count) {
|
||||
return settings.Patterns.ElementAt(settings.DefaultPatternIndex);
|
||||
if (!settings.DefaultPatterns.Any(x => String.Equals(x.Culture, culture, StringComparison.OrdinalIgnoreCase))) {
|
||||
ContentTypeDefinition definition = _contentDefinitionManager.GetTypeDefinition(contentType);
|
||||
var patternIndex = definition.Parts.Where(x => x.PartDefinition.Name == "AutoroutePart").FirstOrDefault().Settings["AutorouteSettings.DefaultPatternIndex"];
|
||||
//lazy updating from old setting
|
||||
if (String.Equals(culture, _cultureManager.GetSiteCulture(), StringComparison.OrdinalIgnoreCase) && !String.IsNullOrWhiteSpace(patternIndex)) {
|
||||
settings.DefaultPatterns.Add(new DefaultPattern { PatternIndex = patternIndex, Culture = culture });
|
||||
return settings.Patterns.Where(x => x.Culture == null).ElementAt(Convert.ToInt32(settings.DefaultPatterns.Where(x => x.Culture == culture).FirstOrDefault().PatternIndex));
|
||||
} else {
|
||||
settings.DefaultPatterns.Add(new DefaultPattern { PatternIndex = "0", Culture = culture });
|
||||
return new RoutePattern { Name = "Title", Description = "my-title", Pattern = "{Content.Slug}", Culture = culture };
|
||||
}
|
||||
}
|
||||
|
||||
return new RoutePattern { Name = "Title", Description = "my-title", Pattern = "{Content.Slug}" };
|
||||
// return a default pattern if set
|
||||
var patternCultureSearch = settings.Patterns.Any(x => String.Equals(x.Culture, culture, StringComparison.OrdinalIgnoreCase)) ? culture : null;
|
||||
var defaultPatternCultureSearch = settings.DefaultPatterns.Any(x => String.Equals(x.Culture, culture, StringComparison.OrdinalIgnoreCase)) ? culture : null;
|
||||
|
||||
if (settings.Patterns.Any()) {
|
||||
if (settings.Patterns.Where(x => x.Culture == patternCultureSearch).ElementAt(Convert.ToInt32(settings.DefaultPatterns.Where(x => x.Culture == defaultPatternCultureSearch).FirstOrDefault().PatternIndex)) != null) {
|
||||
return settings.Patterns.Where(x => x.Culture == patternCultureSearch).ElementAt(Convert.ToInt32(settings.DefaultPatterns.Where(x => x.Culture == defaultPatternCultureSearch).FirstOrDefault().PatternIndex));
|
||||
};
|
||||
}
|
||||
|
||||
// return a default pattern if none is defined
|
||||
return new RoutePattern { Name = "Title", Description = "my-title", Pattern = "{Content.Slug}", Culture = culture };
|
||||
}
|
||||
|
||||
public void RemoveAliases(AutoroutePart part) {
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Orchard.Autoroute.Services {
|
||||
void PublishAlias(AutoroutePart part);
|
||||
void RemoveAliases(AutoroutePart part);
|
||||
void CreatePattern(string contentType, string name, string pattern, string description, bool makeDefault);
|
||||
RoutePattern GetDefaultPattern(string contentType);
|
||||
RoutePattern GetDefaultPattern(string contentType, string culture);
|
||||
IEnumerable<RoutePattern> GetPatterns(string contentType);
|
||||
bool ProcessPath(AutoroutePart part);
|
||||
bool IsPathValid(string slug);
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Web.Script.Serialization;
|
||||
using Orchard.ContentManagement.MetaData.Builders;
|
||||
using Orchard.Services;
|
||||
using System;
|
||||
|
||||
namespace Orchard.Autoroute.Settings {
|
||||
|
||||
@@ -12,18 +13,24 @@ namespace Orchard.Autoroute.Settings {
|
||||
public class AutorouteSettings {
|
||||
|
||||
private List<RoutePattern> _patterns;
|
||||
private List<DefaultPattern> _defaultPatterns;
|
||||
|
||||
public AutorouteSettings() {
|
||||
PerItemConfiguration = false;
|
||||
AllowCustomPattern = true;
|
||||
UseCulturePattern = false;
|
||||
AutomaticAdjustmentOnEdit = false;
|
||||
PatternDefinitions = "[]";
|
||||
DefaultPatternDefinitions = "[]";
|
||||
}
|
||||
|
||||
public bool PerItemConfiguration { get; set; }
|
||||
public bool AllowCustomPattern { get; set; }
|
||||
public bool UseCulturePattern { get; set; }
|
||||
public bool AutomaticAdjustmentOnEdit { get; set; }
|
||||
public int DefaultPatternIndex { get; set; }
|
||||
public bool? IsDefault { get; set; }
|
||||
public List<string> SiteCultures { get; set; }
|
||||
public string DefaultSiteCulture { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A serialized Json array of <see cref="RoutePattern"/> objects
|
||||
@@ -33,7 +40,7 @@ namespace Orchard.Autoroute.Settings {
|
||||
public List<RoutePattern> Patterns {
|
||||
get {
|
||||
if (_patterns == null) {
|
||||
_patterns = new JavaScriptSerializer().Deserialize<RoutePattern[]>(PatternDefinitions).ToList();
|
||||
_patterns = new DefaultJsonConverter().Deserialize<RoutePattern[]>(PatternDefinitions).ToList();
|
||||
}
|
||||
|
||||
return _patterns;
|
||||
@@ -41,16 +48,60 @@ namespace Orchard.Autoroute.Settings {
|
||||
|
||||
set {
|
||||
_patterns = value;
|
||||
PatternDefinitions = new JavaScriptSerializer().Serialize(_patterns.ToArray());
|
||||
PatternDefinitions = new DefaultJsonConverter().Serialize(_patterns.ToArray());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A serialized Json array of <see cref="DefaultPattern"/> objects
|
||||
/// </summary>
|
||||
public string DefaultPatternDefinitions { get; set; }
|
||||
|
||||
public List<DefaultPattern> DefaultPatterns {
|
||||
get {
|
||||
if (_defaultPatterns == null) {
|
||||
_defaultPatterns = new DefaultJsonConverter().Deserialize<DefaultPattern[]>(DefaultPatternDefinitions).ToList();
|
||||
}
|
||||
|
||||
//We split the values from the radio button returned values
|
||||
int i = 0;
|
||||
foreach (DefaultPattern defaultPattern in _defaultPatterns) {
|
||||
if (!String.IsNullOrWhiteSpace(defaultPattern.Culture)) {
|
||||
if (defaultPattern.Culture.Split('|').Count() > 1) {
|
||||
_defaultPatterns[i].PatternIndex = defaultPattern.Culture.Split('|').Last();
|
||||
_defaultPatterns[i].Culture = defaultPattern.Culture.Split('|').First();
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return _defaultPatterns;
|
||||
}
|
||||
|
||||
set {
|
||||
_defaultPatterns = value;
|
||||
|
||||
//We split the values from the radio button returned values
|
||||
int i = 0;
|
||||
foreach (DefaultPattern defaultPattern in _defaultPatterns) {
|
||||
if (!String.IsNullOrWhiteSpace(defaultPattern.Culture)) {
|
||||
if (defaultPattern.Culture.Split('|').Count() > 1) {
|
||||
_defaultPatterns[i].PatternIndex = defaultPattern.Culture.Split('|').Last();
|
||||
_defaultPatterns[i].Culture = defaultPattern.Culture.Split('|').First();
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
DefaultPatternDefinitions = new DefaultJsonConverter().Serialize(_defaultPatterns.ToArray());
|
||||
}
|
||||
}
|
||||
|
||||
public void Build(ContentTypePartDefinitionBuilder builder) {
|
||||
builder.WithSetting("AutorouteSettings.PerItemConfiguration", PerItemConfiguration.ToString(CultureInfo.InvariantCulture));
|
||||
builder.WithSetting("AutorouteSettings.AllowCustomPattern", AllowCustomPattern.ToString(CultureInfo.InvariantCulture));
|
||||
builder.WithSetting("AutorouteSettings.UseCulturePattern", UseCulturePattern.ToString(CultureInfo.InvariantCulture));
|
||||
builder.WithSetting("AutorouteSettings.AutomaticAdjustmentOnEdit", AutomaticAdjustmentOnEdit.ToString(CultureInfo.InvariantCulture));
|
||||
builder.WithSetting("AutorouteSettings.PatternDefinitions", PatternDefinitions);
|
||||
builder.WithSetting("AutorouteSettings.DefaultPatternIndex", DefaultPatternIndex.ToString(CultureInfo.InvariantCulture));
|
||||
builder.WithSetting("AutorouteSettings.DefaultPatternDefinitions", DefaultPatternDefinitions);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,13 +8,16 @@ using Orchard.ContentManagement.MetaData.Models;
|
||||
using Orchard.ContentManagement.ViewModels;
|
||||
using Orchard.Localization;
|
||||
using Orchard.UI.Notify;
|
||||
using Orchard.Localization.Services;
|
||||
|
||||
namespace Orchard.Autoroute.Settings {
|
||||
public class AutorouteSettingsHooks : ContentDefinitionEditorEventsBase {
|
||||
private readonly INotifier _notifier;
|
||||
private readonly ICultureManager _cultureManager;
|
||||
|
||||
public AutorouteSettingsHooks(INotifier notifier) {
|
||||
public AutorouteSettingsHooks(INotifier notifier, ICultureManager cultureManager) {
|
||||
_notifier = notifier;
|
||||
_cultureManager = cultureManager;
|
||||
}
|
||||
|
||||
public Localizer T { get; set; }
|
||||
@@ -25,8 +28,61 @@ namespace Orchard.Autoroute.Settings {
|
||||
|
||||
var settings = definition.Settings.GetModel<AutorouteSettings>();
|
||||
|
||||
// add an empty pattern for the editor
|
||||
settings.Patterns.Add(new RoutePattern());
|
||||
//get cultures
|
||||
settings.SiteCultures = _cultureManager.ListCultures().ToList();
|
||||
//get default site culture
|
||||
settings.DefaultSiteCulture = _cultureManager.GetSiteCulture();
|
||||
|
||||
//if a culture is not set on the pattern we set it to the default site culture for backward compatibility
|
||||
if (!settings.Patterns.Any(x => String.Equals(x.Culture, settings.DefaultSiteCulture, StringComparison.OrdinalIgnoreCase))) {
|
||||
foreach (RoutePattern pattern in settings.Patterns.Where(x => String.IsNullOrWhiteSpace(x.Culture))) {
|
||||
settings.Patterns.Where(x => x.GetHashCode() == pattern.GetHashCode()).FirstOrDefault().Culture = settings.DefaultSiteCulture;
|
||||
}
|
||||
}
|
||||
|
||||
//Adding Patterns for the UI
|
||||
List<RoutePattern> newPatterns = new List<RoutePattern>();
|
||||
int current = 0;
|
||||
foreach (string culture in settings.SiteCultures) {
|
||||
foreach (RoutePattern routePattern in settings.Patterns.Where(x => String.Equals(x.Culture, culture, StringComparison.OrdinalIgnoreCase))) {
|
||||
if (settings.Patterns.Any(x => String.Equals(x.Culture, culture, StringComparison.OrdinalIgnoreCase))) {
|
||||
newPatterns.Add(settings.Patterns[current]);
|
||||
} else {
|
||||
newPatterns.Add(new RoutePattern {
|
||||
Name = "Title",
|
||||
Description = "my-title",
|
||||
Pattern = "{Content.Slug}",
|
||||
Culture = settings.DefaultSiteCulture
|
||||
});
|
||||
}
|
||||
current++;
|
||||
}
|
||||
|
||||
//We add a pattern for each culture if there is none
|
||||
if (!settings.Patterns.Where(x => String.Equals(x.Culture, culture, StringComparison.OrdinalIgnoreCase)).Any()) {
|
||||
newPatterns.Add(new RoutePattern { Culture = culture, Name = "Title", Description = "my-title", Pattern = "{Content.Slug}" });
|
||||
}
|
||||
|
||||
//we add a new empty line for each culture
|
||||
newPatterns.Add(new RoutePattern { Culture = culture, Name = null, Description = null, Pattern = null });
|
||||
|
||||
// if the content type has no defaultPattern for autoroute, then assign one
|
||||
if (!settings.DefaultPatterns.Any(x => String.Equals(x.Culture, culture, StringComparison.OrdinalIgnoreCase))) {
|
||||
//if we are in the default culture check the old setting
|
||||
if (String.Equals(culture, _cultureManager.GetSiteCulture(), StringComparison.OrdinalIgnoreCase)) {
|
||||
if (!String.IsNullOrEmpty(definition.Settings["AutorouteSettings.DefaultPatternIndex"])) {
|
||||
string patternIndex = definition.Settings["AutorouteSettings.DefaultPatternIndex"];
|
||||
settings.DefaultPatterns.Add(new DefaultPattern { Culture = settings.DefaultSiteCulture, PatternIndex = patternIndex });
|
||||
} else {
|
||||
settings.DefaultPatterns.Add(new DefaultPattern { PatternIndex = "0", Culture = culture });
|
||||
}
|
||||
} else {
|
||||
settings.DefaultPatterns.Add(new DefaultPattern { PatternIndex = "0", Culture = culture });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
settings.Patterns = newPatterns;
|
||||
|
||||
yield return DefinitionTemplate(settings);
|
||||
}
|
||||
@@ -39,32 +95,38 @@ namespace Orchard.Autoroute.Settings {
|
||||
Patterns = new List<RoutePattern>()
|
||||
};
|
||||
|
||||
if (updateModel.TryUpdateModel(settings, "AutorouteSettings", null, null)) {
|
||||
//get cultures
|
||||
settings.SiteCultures = _cultureManager.ListCultures().ToList();
|
||||
|
||||
var defaultPattern = settings.Patterns[settings.DefaultPatternIndex];
|
||||
if (updateModel.TryUpdateModel(settings, "AutorouteSettings", null, null)) {
|
||||
//TODO need to add validations client and/or server side here
|
||||
// remove empty patterns
|
||||
var patterns = settings.Patterns;
|
||||
patterns.RemoveAll(p => String.IsNullOrWhiteSpace(p.Name) && String.IsNullOrWhiteSpace(p.Pattern) && String.IsNullOrWhiteSpace(p.Description));
|
||||
|
||||
if (patterns.Count == 0) {
|
||||
patterns.Add(new RoutePattern {
|
||||
//If there is no default pattern for each culture we set default ones
|
||||
List<RoutePattern> newPatterns = new List<RoutePattern>();
|
||||
int current = 0;
|
||||
foreach (string culture in settings.SiteCultures) {
|
||||
if (settings.Patterns.Any(x => String.Equals(x.Culture, culture, StringComparison.OrdinalIgnoreCase))) {
|
||||
foreach (RoutePattern routePattern in settings.Patterns.Where(x => String.Equals(x.Culture, culture, StringComparison.OrdinalIgnoreCase))) {
|
||||
newPatterns.Add(settings.Patterns[current]);
|
||||
current++;
|
||||
}
|
||||
} else {
|
||||
newPatterns.Add(new RoutePattern {
|
||||
Name = "Title",
|
||||
Description = "my-title",
|
||||
Pattern = "{Content.Slug}"
|
||||
Pattern = "{Content.Slug}",
|
||||
Culture = culture
|
||||
});
|
||||
|
||||
_notifier.Warning(T("A default pattern has been added to AutoroutePart"));
|
||||
}
|
||||
|
||||
settings.Patterns = patterns;
|
||||
// search for the pattern which was marked as default, and update its index
|
||||
settings.DefaultPatternIndex = patterns.IndexOf(defaultPattern);
|
||||
|
||||
// if a wrong pattern was selected and there is at least one pattern, default to first
|
||||
if (settings.DefaultPatternIndex == -1 && settings.Patterns.Any()) {
|
||||
settings.DefaultPatternIndex = 0;
|
||||
}
|
||||
|
||||
settings.Patterns = newPatterns;
|
||||
|
||||
// update the settings builder
|
||||
settings.Build(builder);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace Orchard.Autoroute.Settings {
|
||||
|
||||
/// <summary>
|
||||
/// Models the Default Patterns you can choose from
|
||||
/// </summary>
|
||||
public class DefaultPattern {
|
||||
public string Culture { get; set; }
|
||||
public string PatternIndex { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -7,5 +7,6 @@
|
||||
public string Name { get; set; }
|
||||
public string Pattern { get; set; }
|
||||
public string Description { get; set; }
|
||||
public string Culture { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,10 @@
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.autoroute-settings-patterns tr td input {
|
||||
.autoroute-settings-patterns, .autoroute-settings-patterns tr td input {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.autoroute-settings-patterns td, .autoroute-settings-patterns th {
|
||||
padding:10px;
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using Orchard.Autoroute.Settings;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Orchard.Autoroute.ViewModels {
|
||||
|
||||
@@ -7,5 +8,7 @@ namespace Orchard.Autoroute.ViewModels {
|
||||
public bool PromoteToHomePage { get; set; }
|
||||
public string CurrentUrl { get; set; }
|
||||
public string CustomPattern { get; set; }
|
||||
public string CurrentCulture { get; set; }
|
||||
public IEnumerable<string> SiteCultures { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,16 +2,12 @@
|
||||
@using Orchard.Utility.Extensions;
|
||||
|
||||
@{
|
||||
Script.Require("AutorouteBrowser");
|
||||
Style.Require("AutorouteSettings");
|
||||
int patternCount = 0;
|
||||
int patternCultureCount = 0;
|
||||
}
|
||||
@*<fieldset>
|
||||
<div>
|
||||
@Html.CheckBoxFor(m => m.PerItemConfiguration)
|
||||
<label class="forcheckbox" for="@Html.FieldIdFor(m => m.PerItemConfiguration)">@T("Per item configuration")</label>
|
||||
<span class="hint">@T("Allow the user to change the pattern on each item")</span>
|
||||
</div>
|
||||
</fieldset>
|
||||
*@<fieldset>
|
||||
<fieldset>
|
||||
<div>
|
||||
@Html.CheckBoxFor(m => m.AllowCustomPattern)
|
||||
<label class="forcheckbox" for="@Html.FieldIdFor(m => m.AllowCustomPattern)">@T("Allow custom patterns")</label>
|
||||
@@ -25,9 +21,39 @@
|
||||
<span class="hint">@T("This option will cause the Url to automatically be regenerated when you edit existing content and publish it again, otherwise it will always keep the old route, or you have to perform bulk update in the Autoroute admin.")</span>
|
||||
</div>
|
||||
</fieldset>
|
||||
@if (Model.SiteCultures.Count > 1) {
|
||||
<fieldset>
|
||||
<label>@T("Patterns:")</label>
|
||||
<table class="items autoroute-settings-patterns">
|
||||
<div>
|
||||
@Html.CheckBoxFor(m => m.UseCulturePattern, new { @class = "use-culture-pattern" })
|
||||
<label class="forcheckbox" for="@Html.FieldIdFor(m => m.UseCulturePattern)">@T("Use culture pattern(s)")</label>
|
||||
<span class="hint">@T("Allow to set pattern(s) for each culture. If left unchecked this means it will use the default website culture pattern(s).")</span>
|
||||
</div>
|
||||
</fieldset>
|
||||
}
|
||||
<fieldset>
|
||||
<h4>@T("Patterns") :</h4>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<div id="local-navigation">
|
||||
<ul class="autoroute-cultures localmenu group">
|
||||
@{
|
||||
int i = 1;
|
||||
string cssClass = "";
|
||||
}
|
||||
<li class="first selected"><a class="culture" href="#cat-@Model.DefaultSiteCulture">@Model.DefaultSiteCulture</a></li>
|
||||
@foreach (var culture in Model.SiteCultures) {
|
||||
if (culture != Model.DefaultSiteCulture) {
|
||||
cssClass = i == Model.SiteCultures.Count - 1 ? "last" : "middle";
|
||||
<li class="@cssClass" style="@(Model.UseCulturePattern == false ? "display:none;" : "")"><a class="culture" href="#cat-@culture">@culture</a></li>
|
||||
i++;
|
||||
}
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
<div id="content">
|
||||
@foreach (var culture in Model.SiteCultures) {
|
||||
<fieldset id="cat-@culture" class="items @(culture == Model.DefaultSiteCulture ? "default" : "")" style="@(culture == Model.DefaultSiteCulture ? "display:block;" : "display:none;")">
|
||||
<table class="autoroute-settings-patterns">
|
||||
<tr>
|
||||
<th class="autoroute-settings-default">@T("Default")</th>
|
||||
<th class="autoroute-settings-name">@T("Name")<span class="hint">@T("Name of the pattern")</span></th>
|
||||
@@ -35,20 +61,22 @@
|
||||
<th class="autoroute-settings-desc">@T("Description")<span class="hint">@T("The description of the pattern, displayed in the editor")</span></th>
|
||||
<th class="autoroute-settings-actions"> </th>
|
||||
</tr>
|
||||
|
||||
@for (int index = 0; index < Model.Patterns.Count; index++) {
|
||||
@for (int index = 0; index < Model.Patterns.Where(x => x.Culture == culture).Count(); index++) {
|
||||
<tr>
|
||||
<td>@Html.RadioButtonFor(m => m.DefaultPatternIndex, index, new { @class = "radio" })</td>
|
||||
<td>@Html.TextBoxFor(m => m.Patterns[index].Name, new { @class = "text"})</td>
|
||||
<td>@Html.TextBoxFor(m => m.Patterns[index].Pattern, new { @class = "tokenized text" })</td>
|
||||
<td>@Html.TextBoxFor(m => m.Patterns[index].Description, new { @class = "text" })</td>
|
||||
<td> </td>
|
||||
<td>@Html.RadioButtonFor(m => m.DefaultPatterns[Model.SiteCultures.IndexOf(culture)].Culture, culture + "|" + patternCultureCount, patternCultureCount.ToString() == Model.DefaultPatterns[Model.SiteCultures.IndexOf(culture)].PatternIndex ? new { @checked = "checked" } : null)</td>
|
||||
<td>@Html.TextBoxFor(m => m.Patterns[patternCount].Name, new { @class = "text" })</td>
|
||||
<td>@Html.TextBoxFor(m => m.Patterns[patternCount].Pattern, new { @class = "tokenized text" })</td>
|
||||
<td>@Html.TextBoxFor(m => m.Patterns[patternCount].Description, new { @class = "text" })</td>
|
||||
<td>@Html.HiddenFor(m => m.Patterns[patternCount].Culture) </td>
|
||||
</tr>
|
||||
if (Model.Patterns[patternCount].Pattern != null) { patternCultureCount++; } else { patternCultureCount = 0; }
|
||||
patternCount++;
|
||||
}
|
||||
|
||||
<tr>
|
||||
</tr>
|
||||
<tr></tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
}
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
@Display.TokenHint()
|
||||
@@ -3,13 +3,15 @@
|
||||
@using Orchard.Mvc.Extensions
|
||||
@model Orchard.Autoroute.ViewModels.AutoroutePartEditViewModel
|
||||
|
||||
@if(Model.Settings.DefaultPatternIndex == -1) {
|
||||
@if (Model.Settings.Patterns.Where(x => x.Culture == Model.CurrentCulture).Count() == 0) {
|
||||
<div class="message message-Error">@T("The current Content Type does not have a default Autoroute Pattern. Please edit the settings first.")</div>
|
||||
return;
|
||||
}
|
||||
|
||||
@{
|
||||
var defaultPattern = Model.Settings.Patterns[Model.Settings.DefaultPatternIndex];
|
||||
var defaultPattern = Model.Settings.DefaultPatterns.Where(x => x.Culture == Model.CurrentCulture).FirstOrDefault();
|
||||
var pattern = Model.Settings.Patterns.Where(x => x.Culture == Model.CurrentCulture);
|
||||
|
||||
var urlPrefix = WorkContext.Resolve<ShellSettings>().RequestUrlPrefix;
|
||||
if (!String.IsNullOrWhiteSpace(urlPrefix)) {
|
||||
urlPrefix += "/";
|
||||
@@ -24,9 +26,8 @@
|
||||
<span>@Url.MakeAbsolute("/")@urlPrefix</span>
|
||||
<span>@Html.TextBoxFor(m => m.CurrentUrl, new { @class = "text is-url" })</span>
|
||||
</span>
|
||||
<span class="hint">@T("Save the current item and leave the input empty to have it automatically generated using the pattern {0} e.g., {1}", defaultPattern.Name, defaultPattern.Description)</span>
|
||||
}
|
||||
else {
|
||||
<span class="hint">@T("Save the current item and leave the input empty to have it automatically generated using the pattern {0} e.g., {1}", pattern.ElementAtOrDefault(Convert.ToInt32(defaultPattern.PatternIndex)).Name, pattern.ElementAtOrDefault(Convert.ToInt32(defaultPattern.PatternIndex)).Description)</span>
|
||||
} else {
|
||||
var hintClass = string.Empty;
|
||||
if (!string.IsNullOrEmpty(Model.CurrentUrl)) {
|
||||
hintClass = "hint";
|
||||
@@ -35,7 +36,7 @@
|
||||
|
||||
if (string.IsNullOrEmpty(Model.CurrentUrl)
|
||||
|| (!string.IsNullOrEmpty(Model.CurrentUrl) && Model.Settings.AutomaticAdjustmentOnEdit)) {
|
||||
<span class="@hintClass">@T("Save the current item and the url will be generated using the pattern {0} e.g., {1}", defaultPattern.Name, defaultPattern.Description)</span>
|
||||
<span class="@hintClass">@T("Save the current item and the url will be generated using the pattern {0} e.g., {1}", pattern.ElementAtOrDefault(Convert.ToInt32(defaultPattern.PatternIndex)).Name, pattern.ElementAtOrDefault(Convert.ToInt32(defaultPattern.PatternIndex)).Description)</span>
|
||||
}
|
||||
}
|
||||
@if (!String.IsNullOrEmpty(Model.CurrentUrl)) {
|
||||
@@ -57,7 +58,6 @@
|
||||
<span class="hint">@T("Check to promote this content as the home page")</span>
|
||||
</fieldset>
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
<span>@T("This content is the current home page")</span>
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<system.web.webPages.razor>
|
||||
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<pages pageBaseType="Orchard.Mvc.ViewEngines.Razor.WebViewPage">
|
||||
<namespaces>
|
||||
<add namespace="System.Web.Mvc"/>
|
||||
@@ -28,7 +28,7 @@
|
||||
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
|
||||
<add assembly="System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Web.Mvc, Version=5.2.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="Orchard.Framework"/>
|
||||
<add assembly="Orchard.Core"/>
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
<IISExpressAnonymousAuthentication />
|
||||
<IISExpressWindowsAuthentication />
|
||||
<IISExpressUseClassicPipelineMode />
|
||||
<UseGlobalApplicationHostFile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
@@ -33,7 +34,7 @@
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRuleSet>..\..\..\OrchardBasicCorrectness.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<system.web.webPages.razor>
|
||||
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<pages pageBaseType="Orchard.Mvc.ViewEngines.Razor.WebViewPage">
|
||||
<namespaces>
|
||||
<add namespace="System.Collections.Generic"/>
|
||||
@@ -31,7 +31,7 @@
|
||||
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
|
||||
<add assembly="System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
|
||||
<add assembly="System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Web.Mvc, Version=5.2.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="Orchard.Framework"/>
|
||||
<add assembly="Orchard.Core"/>
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
<IISExpressAnonymousAuthentication />
|
||||
<IISExpressWindowsAuthentication />
|
||||
<IISExpressUseClassicPipelineMode />
|
||||
<UseGlobalApplicationHostFile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
@@ -33,7 +34,7 @@
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRuleSet>..\..\..\OrchardBasicCorrectness.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<system.web.webPages.razor>
|
||||
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<pages pageBaseType="Orchard.Mvc.ViewEngines.Razor.WebViewPage">
|
||||
<namespaces>
|
||||
<add namespace="System.Web.Mvc"/>
|
||||
@@ -29,7 +29,7 @@
|
||||
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
|
||||
<add assembly="System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Web.Mvc, Version=5.2.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
</assemblies>
|
||||
</compilation>
|
||||
|
||||
@@ -39,8 +39,7 @@ namespace Orchard.Blogs {
|
||||
.WithPart("AutoroutePart", builder => builder
|
||||
.WithSetting("AutorouteSettings.AllowCustomPattern", "True")
|
||||
.WithSetting("AutorouteSettings.AutomaticAdjustmentOnEdit", "False")
|
||||
.WithSetting("AutorouteSettings.PatternDefinitions", "[{\"Name\":\"Title\",\"Pattern\":\"{Content.Slug}\",\"Description\":\"my-blog\"}]")
|
||||
.WithSetting("AutorouteSettings.DefaultPatternIndex", "0"))
|
||||
.WithSetting("AutorouteSettings.PatternDefinitions", "[{\"Name\":\"Title\",\"Pattern\":\"{Content.Slug}\",\"Description\":\"my-blog\"}]"))
|
||||
.WithPart("MenuPart")
|
||||
.WithPart("AdminMenuPart", p => p.WithSetting("AdminMenuPartTypeSettings.DefaultPosition", "2"))
|
||||
);
|
||||
@@ -58,8 +57,7 @@ namespace Orchard.Blogs {
|
||||
.WithPart("AutoroutePart", builder => builder
|
||||
.WithSetting("AutorouteSettings.AllowCustomPattern", "True")
|
||||
.WithSetting("AutorouteSettings.AutomaticAdjustmentOnEdit", "False")
|
||||
.WithSetting("AutorouteSettings.PatternDefinitions", "[{\"Name\":\"Blog and Title\",\"Pattern\":\"{Content.Container.Path}/{Content.Slug}\",\"Description\":\"my-blog/my-post\"}]")
|
||||
.WithSetting("AutorouteSettings.DefaultPatternIndex", "0"))
|
||||
.WithSetting("AutorouteSettings.PatternDefinitions", "[{\"Name\":\"Blog and Title\",\"Pattern\":\"{Content.Container.Path}/{Content.Slug}\",\"Description\":\"my-blog/my-post\"}]"))
|
||||
.WithPart("BodyPart")
|
||||
.Draftable()
|
||||
);
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<system.web.webPages.razor>
|
||||
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<pages pageBaseType="Orchard.Mvc.ViewEngines.Razor.WebViewPage">
|
||||
<namespaces>
|
||||
<add namespace="System.Web.Mvc"/>
|
||||
@@ -29,7 +29,7 @@
|
||||
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
|
||||
<add assembly="System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Web.Mvc, Version=5.2.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="Orchard.Framework"/>
|
||||
<add assembly="Orchard.Core"/>
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
<IISExpressAnonymousAuthentication />
|
||||
<IISExpressWindowsAuthentication />
|
||||
<IISExpressUseClassicPipelineMode />
|
||||
<UseGlobalApplicationHostFile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
@@ -33,7 +34,7 @@
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRuleSet>..\..\..\OrchardBasicCorrectness.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<system.web.webPages.razor>
|
||||
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<pages pageBaseType="Orchard.Mvc.ViewEngines.Razor.WebViewPage">
|
||||
<namespaces>
|
||||
<add namespace="System.Web.Mvc"/>
|
||||
@@ -29,7 +29,7 @@
|
||||
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
|
||||
<add assembly="System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Web.Mvc, Version=5.2.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
</assemblies>
|
||||
</compilation>
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRuleSet>..\..\..\OrchardBasicCorrectness.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
@@ -54,7 +54,7 @@
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.DynamicData" />
|
||||
<Reference Include="System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Reference Include="System.Web.Mvc, Version=5.2.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\lib\aspnetmvc\System.Web.Mvc.dll</HintPath>
|
||||
</Reference>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
</configSections>
|
||||
|
||||
<system.web.webPages.razor>
|
||||
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
|
||||
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
|
||||
<pages pageBaseType="Orchard.Mvc.ViewEngines.Razor.WebViewPage">
|
||||
<namespaces>
|
||||
<add namespace="System.Web.Mvc" />
|
||||
@@ -32,7 +32,7 @@
|
||||
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
|
||||
<add assembly="System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
|
||||
<add assembly="System.Web.Mvc, Version=5.2.3, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
|
||||
<add assembly="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="Orchard.Framework,Culture=neutral, PublicKeyToken=null"/>
|
||||
<add assembly="Orchard.Core,Culture=neutral, PublicKeyToken=null"/>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user