mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-07 16:13:58 +08:00
Compare commits
23 Commits
issue/8786
...
BenedekFar
Author | SHA1 | Date | |
---|---|---|---|
![]() |
7329240c65 | ||
![]() |
26f6dcaf9c | ||
![]() |
0063c18f7f | ||
![]() |
0de919d36f | ||
![]() |
b14c29503b | ||
![]() |
d310fb56e1 | ||
![]() |
4c463287ca | ||
![]() |
3561be6e37 | ||
![]() |
5c3d045aa1 | ||
![]() |
32c5f1e821 | ||
![]() |
d26e8e47f1 | ||
![]() |
1c40b8ba93 | ||
![]() |
c3b98ba3c4 | ||
![]() |
ebae790f15 | ||
![]() |
79f66cebf6 | ||
![]() |
0d93cb1d8d | ||
![]() |
8425b4ad76 | ||
![]() |
81570fab35 | ||
![]() |
0d9fccb624 | ||
![]() |
fdbb06ba8d | ||
![]() |
15cad85d1e | ||
![]() |
0b86413e60 | ||
![]() |
3a6810ec67 |
70
.github/workflows/compile.yml
vendored
70
.github/workflows/compile.yml
vendored
@@ -13,53 +13,89 @@ jobs:
|
||||
name: Compile .NET solution
|
||||
defaults:
|
||||
run:
|
||||
shell: pwsh
|
||||
runs-on: windows-latest
|
||||
shell: cmd
|
||||
runs-on: windows-2025
|
||||
steps:
|
||||
- name: Clone repository
|
||||
- name: Clone Repository
|
||||
uses: actions/checkout@v4.1.1
|
||||
|
||||
- name: Restore NuGet packages
|
||||
- name: Restore NuGet Packages
|
||||
run: nuget restore src/Orchard.sln
|
||||
|
||||
- name: Add msbuild to PATH
|
||||
- name: Add MSBuild to PATH
|
||||
uses: microsoft/setup-msbuild@v2
|
||||
|
||||
- name: Compile
|
||||
run: msbuild Orchard.proj /m /v:minimal /t:Compile /p:MvcBuildViews=true /p:TreatWarningsAsErrors=true -WarnAsError
|
||||
run: msbuild Orchard.proj /m /v:minimal /t:Compile /p:TreatWarningsAsErrors=true -WarnAsError /p:MvcBuildViews=true
|
||||
|
||||
- name: Test
|
||||
run: msbuild Orchard.proj /m /v:minimal /t:Test
|
||||
|
||||
- name: Test Setup with SpecFlow
|
||||
shell: pwsh
|
||||
run: |
|
||||
$nunitConsole = (Get-ChildItem -Path 'src/packages' -Recurse -Filter 'nunit-console.exe' | Select-Object -Last 1).FullName
|
||||
& $nunitConsole 'build/Compile/Orchard.Specs.dll' /xml='build/Orchard.Specs.xml' /run=Orchard.Specs.SetupFeature.RootAndSetupFolderShowsSetupScreenAndFormValuesAreValidated
|
||||
|
||||
- name: Run Orchard Setup with Orchard.exe
|
||||
shell: pwsh
|
||||
run: |
|
||||
$commandFile = 'src/Orchard.Web/bin/setup-commands.txt'
|
||||
New-Item -Path $commandFile -ItemType File -Force
|
||||
Set-Content -Path $commandFile -Value 'setup /SiteName:Orchard /AdminUsername:admin /AdminPassword:Password1! /DatabaseProvider:SqlCe /Recipe:Default'
|
||||
& 'src/Orchard.Web/bin/Orchard.exe' @$commandFile
|
||||
|
||||
- name: Run Code Generation
|
||||
shell: pwsh
|
||||
run: |
|
||||
$commandFile = 'src/Orchard.Web/bin/codegen-commands.txt'
|
||||
New-Item -Path $commandFile -ItemType File -Force
|
||||
Set-Content -Path $commandFile -Value @'
|
||||
feature enable Orchard.CodeGeneration
|
||||
codegen module Orchard.CodeGeneration.TestModule
|
||||
codegen theme Orchard.CodeGeneration.TestTheme /CreateProject:true
|
||||
codegen moduletests Orchard.CodeGeneration.TestModule
|
||||
'@
|
||||
& 'src/Orchard.Web/bin/Orchard.exe' @$commandFile
|
||||
|
||||
- name: Compile Again with Generated Projects
|
||||
run: msbuild Orchard.proj /m /v:minimal /t:Compile /p:TreatWarningsAsErrors=true -WarnAsError /NoWarn:CS2008
|
||||
|
||||
compile-node:
|
||||
name: Compile client-side assets
|
||||
name: Compile Client-side Assets
|
||||
defaults:
|
||||
run:
|
||||
shell: pwsh
|
||||
runs-on: windows-latest
|
||||
shell: cmd
|
||||
runs-on: windows-2025
|
||||
steps:
|
||||
- name: Clone repository
|
||||
- name: Clone Repository
|
||||
uses: actions/checkout@v4.1.1
|
||||
|
||||
- name: Setup NodeJS
|
||||
uses: actions/setup-node@v4.0.2
|
||||
with:
|
||||
node-version: '7'
|
||||
node-version: 7
|
||||
|
||||
- name: Setup NPM packages
|
||||
- name: Install Gulp Globally
|
||||
working-directory: ./src
|
||||
shell: pwsh
|
||||
run: |
|
||||
npm install --loglevel warn
|
||||
|
||||
# Install gulp globally to be able to run the rebuild task, using the same version as in the project.
|
||||
$gulpVersion = (Get-Content Package.json -Raw | ConvertFrom-Json).devDependencies.gulp
|
||||
Start-Process npm -NoNewWindow -Wait -ArgumentList "install gulp@$gulpVersion -g --loglevel warn"
|
||||
|
||||
- name: Rebuild client-side assets
|
||||
- name: Install NPM Packages
|
||||
working-directory: ./src
|
||||
run: |
|
||||
gulp rebuild
|
||||
run: npm install --loglevel warn
|
||||
|
||||
- name: Rebuild Client-side Assets
|
||||
working-directory: ./src
|
||||
run: gulp rebuild
|
||||
|
||||
- name: Check Client-side Assets
|
||||
working-directory: ./src
|
||||
shell: pwsh
|
||||
run: |
|
||||
git add . # To make line ending changes "disappear".
|
||||
$gitStatus = (git status --porcelain)
|
||||
if ($gitStatus)
|
||||
|
@@ -52,12 +52,6 @@ Website: http://dlr.codeplex.com
|
||||
Copyright: Copyright (c) Microsoft Corporation
|
||||
License: Apache Software Foundation License 2.0
|
||||
|
||||
DotNetZip
|
||||
-----
|
||||
Website: http://dotnetzip.codeplex.com/
|
||||
Copyright:
|
||||
License: MS-PL
|
||||
|
||||
Eric Meyer's Reset CSS
|
||||
-----
|
||||
Website: http://meyerweb.com/eric/tools/css/reset/
|
||||
|
26
README.md
26
README.md
@@ -1,16 +1,14 @@
|
||||
# Orchard
|
||||
|
||||
Orchard is a free, open source, community-focused Content Management System built on the ASP.NET MVC platform.
|
||||
Orchard is a free, open source, community-focused Content Management System built on the ASP.NET MVC platform. You are looking at Orchard 1, the older, .NET Framework-based version that has been in development since 2009.
|
||||
|
||||
[](https://gitter.im/OrchardCMS/Orchard?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
If you're starting a new project (or maintaining a project built on Orchard 1), you should check out [Orchard Core](https://github.com/OrchardCMS/OrchardCore), the new generation of Orchard built on ASP.NET Core. You can also try it for free on [DotNest.com](https://dotnest.com)!
|
||||
|
||||
You can try it for free on [DotNest.com](https://dotnest.com) or on Microsoft Azure by clicking on this button.
|
||||
|
||||
[](https://portal.azure.com/#create/OutercurveFoundation.OrchardCMS)
|
||||
Join the community discussion on [Discord](https://orchardcore.net/discord), where we also have a [channel dedicated to Orchard 1](https://discord.com/channels/551136772243980291/551137194689953848).
|
||||
|
||||
## About The Orchard Project
|
||||
|
||||
#### Please visit our website at https://orchardproject.net for the most current information about this project.
|
||||
#### Please visit our website at https://orchardcore.net for the most current information about this project.
|
||||
|
||||
Orchard is a free, open source, community-focused **Content Management System** built on the ASP.NET MVC platform.
|
||||
|
||||
@@ -24,12 +22,12 @@ Our mission is to empower our users and foster a dedicated and diverse community
|
||||
|
||||
Orchard is currently in version **[1.10.3](https://github.com/OrchardCMS/Orchard/releases/tag/1.10.3)**: It contains bugfixes and the more impactful changes and new features added in the latest major version (*1.10*).
|
||||
|
||||
We invite participation by the developer community in shaping the project’s direction, so that we can publicly validate our designs and development approach.
|
||||
We invite participation by the developer community in shaping the project's direction, so that we can publicly validate our designs and development approach.
|
||||
All our releases are available on our [Releases](https://github.com/OrchardCMS/Orchard/releases) page, and 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](https://docs.orchardproject.net/en/latest/Documentation/Feature-roadmap/)
|
||||
* [Docs and designs/specs](https://docs.orchardproject.net)
|
||||
* [Feature roadmap](https://docs.orchardcore.net/projects/O1/en/latest/Documentation/Feature-roadmap/)
|
||||
* [Docs and designs/specs](https://docs.orchardcore.net/projects/O1/en/latest/)
|
||||
|
||||
## How To Get Involved
|
||||
|
||||
@@ -42,11 +40,7 @@ There are many ways you can contribute to Orchard:
|
||||
* [Find and file a bug](https://github.com/OrchardCMS/Orchard/issues)
|
||||
* [Propose a feature idea](https://github.com/OrchardCMS/Orchard/issues/new)
|
||||
* [Ask and answer questions on Stack Overflow](https://stackoverflow.com/questions/tagged/orchardcms)
|
||||
* [Participate in our gitter.im chatroom](https://gitter.im/OrchardCMS/Orchard)
|
||||
* [Submit a pull request](https://docs.orchardproject.net/en/latest/Documentation/Contributing-patches/)
|
||||
* [Join us on Discord](https://orchardcore.net/discord)
|
||||
* [Submit a pull request](https://docs.orchardcore.net/projects/O1/en/latest/Documentation/Contributing-patches/)
|
||||
* [Translate Orchard](https://crowdin.com/project/orchard-cms)
|
||||
* [Contribute modules and themes to our gallery](https://gallery.orchardproject.net/)
|
||||
|
||||
## The Future Of Orchard CMS: Orchard Core
|
||||
|
||||
As the underlying frameworks (.NET, ASP.NET and ASP.NET MVC) are constantly evolving, Orchard of course keeps track of the changes and improvements of these: Orchard Core is the next generation of Orchard releases that is based on [ASP.NET Core](https://www.asp.net/core). Just like the current Orchard project, it's fully [open-source and is publicly available on GitHub](https://github.com/OrchardCMS/OrchardCore). Orchard Core (as a framework) is being built from scratch: it's still in development and does not share any of its code base (at least directly) with the current versions (1.x) of Orchard.
|
||||
* [Contribute modules and themes to our gallery](https://gallery.orchardproject.net)
|
||||
|
@@ -16,7 +16,7 @@
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
@@ -26,6 +26,22 @@
|
||||
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.4.0" newVersion="4.0.4.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.5.0" newVersion="4.1.5.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
|
@@ -24,7 +24,7 @@
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
@@ -38,6 +38,26 @@
|
||||
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.2.0" newVersion="4.2.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.4.0" newVersion="4.0.4.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.1.0" newVersion="4.2.1.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.1.0" newVersion="6.0.1.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.5.0" newVersion="4.1.5.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<specFlow>
|
||||
|
@@ -151,7 +151,7 @@
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="NHibernate" publicKeyToken="aa95f207798dfdb4" culture="neutral" />
|
||||
|
@@ -24,7 +24,7 @@
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Autofac" publicKeyToken="17863af14b0044da" />
|
||||
@@ -42,6 +42,22 @@
|
||||
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.4.0" newVersion="4.0.4.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.5.0" newVersion="4.1.5.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
|
@@ -1,8 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Linq;
|
||||
using Ionic.Zip;
|
||||
using NUnit.Framework;
|
||||
using Orchard.Environment.Configuration;
|
||||
using Orchard.FileSystems.Media;
|
||||
@@ -53,10 +53,10 @@ namespace Orchard.Tests.Modules.Media.Services {
|
||||
[Test]
|
||||
public void GetMediaFoldersTest() {
|
||||
StorageProvider.ListFoldersPredicate = path => {
|
||||
return string.IsNullOrEmpty(path) ? new[] {new StubStorageFolder(FolderName1)}
|
||||
: string.Equals(path, FolderName1) ? new[] {new StubStorageFolder(FolderName2), new StubStorageFolder(FolderName3)}
|
||||
return string.IsNullOrEmpty(path) ? new[] { new StubStorageFolder(FolderName1) }
|
||||
: string.Equals(path, FolderName1) ? new[] { new StubStorageFolder(FolderName2), new StubStorageFolder(FolderName3) }
|
||||
: new StubStorageFolder[] { };
|
||||
};
|
||||
};
|
||||
|
||||
IEnumerable<MediaFolder> mediaFolders = MediaService.GetMediaFolders(null);
|
||||
Assert.That(mediaFolders.Count(), Is.EqualTo(1), "Root path only has 1 sub directory");
|
||||
@@ -94,7 +94,7 @@ namespace Orchard.Tests.Modules.Media.Services {
|
||||
Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, FinalDottedWebconfigFileName)), Is.False, "no extension files are never allowed");
|
||||
Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, PaddedWebconfigFileName)), Is.False, "no extension files are never allowed");
|
||||
Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, FinalDottedTextFileName)), Is.False, "no extension files are never allowed");
|
||||
|
||||
|
||||
Assert.That(StorageProvider.SavedStreams.Count, Is.EqualTo(3));
|
||||
}
|
||||
|
||||
@@ -160,29 +160,30 @@ namespace Orchard.Tests.Modules.Media.Services {
|
||||
}
|
||||
|
||||
private MemoryStream CreateZipMemoryStream() {
|
||||
var entries = new List<string> {
|
||||
TextFileName, WebconfigFileName, DllFileName, ZipFileName, NoExtensionFileName, PaddedWebconfigFileName,
|
||||
FinalDottedWebconfigFileName, PaddedTextFileName, FinalDottedTextFileName
|
||||
};
|
||||
|
||||
// Setup memory stream with zip archive for more complex scenarios
|
||||
MemoryStream memoryStream = new MemoryStream();
|
||||
using (ZipFile zipOut = new ZipFile()) {
|
||||
|
||||
zipOut.AddEntry(TextFileName, new byte[] { 0x01 });
|
||||
zipOut.AddEntry(WebconfigFileName, new byte[] { 0x02 });
|
||||
zipOut.AddEntry(DllFileName, new byte[] { 0x03 });
|
||||
zipOut.AddEntry(ZipFileName, new byte[] { 0x04 });
|
||||
zipOut.AddEntry(NoExtensionFileName, new byte[] { 0x05 });
|
||||
zipOut.AddEntry(PaddedWebconfigFileName, new byte[] { 0x06 });
|
||||
zipOut.AddEntry(FinalDottedWebconfigFileName, new byte[] { 0x07 });
|
||||
zipOut.AddEntry(PaddedTextFileName, new byte[] { 0x08 });
|
||||
zipOut.AddEntry(FinalDottedTextFileName, new byte[] { 0x09 });
|
||||
|
||||
zipOut.Save(memoryStream);
|
||||
using (var archive = new ZipArchive(memoryStream, ZipArchiveMode.Create, leaveOpen: true)) {
|
||||
var content = new byte[] { 0x01 };
|
||||
foreach (var entry in entries) {
|
||||
var zipEntry = archive.CreateEntry(entry);
|
||||
using (var zipStream = zipEntry.Open()) {
|
||||
zipStream.Write(content, 0, 1);
|
||||
}
|
||||
++content[0];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return new MemoryStream(memoryStream.ToArray());
|
||||
}
|
||||
|
||||
private class MediaServiceAccessor : MediaService {
|
||||
public MediaServiceAccessor(IStorageProvider storageProvider, IOrchardServices orchardServices)
|
||||
: base (storageProvider, orchardServices) {}
|
||||
: base(storageProvider, orchardServices) { }
|
||||
|
||||
public void UnzipMediaFileArchiveAccessor(string targetFolder, Stream zipStream) {
|
||||
UnzipMediaFileArchive(targetFolder, zipStream);
|
||||
|
@@ -64,9 +64,6 @@
|
||||
<Reference Include="Castle.Core, Version=3.3.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Castle.Core.3.3.1\lib\net45\Castle.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DotNetZip, Version=1.12.0.0, Culture=neutral, PublicKeyToken=6583c7c814667745, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\DotNetZip.1.12.0\lib\net20\DotNetZip.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="FluentNHibernate, Version=2.0.3.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\FluentNHibernate.2.0.3.0\lib\net40\FluentNHibernate.dll</HintPath>
|
||||
</Reference>
|
||||
@@ -107,8 +104,8 @@
|
||||
<Reference Include="Moq, Version=4.2.1510.2205, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Moq.4.2.1510.2205\lib\net40\Moq.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NHibernate, Version=4.1.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NHibernate.4.1.2.4000\lib\net40\NHibernate.dll</HintPath>
|
||||
@@ -134,6 +131,7 @@
|
||||
<HintPath>..\..\lib\sqlce\System.Data.SqlServerCe.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.IO.Compression" />
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Web.Abstractions">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
|
@@ -1,4 +1,5 @@
|
||||
using System.Net;
|
||||
using System;
|
||||
using System.Net;
|
||||
using NUnit.Framework;
|
||||
using Orchard.Warmup.Services;
|
||||
|
||||
@@ -20,7 +21,7 @@ namespace Orchard.Tests.Modules.Warmup {
|
||||
|
||||
[Test]
|
||||
public void StatusCodeShouldBe404ForUnexistingResources() {
|
||||
var download = _webDownloader.Download("http://orchardproject.net/yepyep");
|
||||
var download = _webDownloader.Download("https://orchardcore.net/" + Guid.NewGuid());
|
||||
Assert.That(download, Is.Not.Null);
|
||||
Assert.That(download.StatusCode, Is.EqualTo(HttpStatusCode.NotFound));
|
||||
Assert.That(download.Content, Is.Null);
|
||||
@@ -28,7 +29,7 @@ namespace Orchard.Tests.Modules.Warmup {
|
||||
|
||||
[Test]
|
||||
public void StatusCodeShouldBe200ForValidRequests() {
|
||||
var download = _webDownloader.Download("http://orchardproject.net/");
|
||||
var download = _webDownloader.Download("https://orchardcore.net/");
|
||||
Assert.That(download, Is.Not.Null);
|
||||
Assert.That(download.StatusCode, Is.EqualTo(HttpStatusCode.OK));
|
||||
Assert.That(download.Content, Is.Not.Empty);
|
||||
|
@@ -2,7 +2,6 @@
|
||||
<packages>
|
||||
<package id="Autofac" version="3.5.2" targetFramework="net48" />
|
||||
<package id="Castle.Core" version="3.3.1" targetFramework="net48" />
|
||||
<package id="DotNetZip" version="1.12.0" targetFramework="net48" />
|
||||
<package id="FluentNHibernate" version="2.0.3.0" targetFramework="net48" />
|
||||
<package id="Iesi.Collections" version="4.0.1.4000" targetFramework="net48" />
|
||||
<package id="IronRuby" version="1.1.3" targetFramework="net48" />
|
||||
@@ -12,7 +11,7 @@
|
||||
<package id="Microsoft.AspNet.WebPages" version="3.2.7" targetFramework="net48" />
|
||||
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net48" />
|
||||
<package id="Moq" version="4.2.1510.2205" targetFramework="net48" />
|
||||
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net48" />
|
||||
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net48" />
|
||||
<package id="NHibernate" version="4.1.2.4000" targetFramework="net48" />
|
||||
<package id="NUnit" version="2.5.10.11092" targetFramework="net48" />
|
||||
<package id="Orchard.FluentPath" version="1.0.0.1" targetFramework="net48" />
|
||||
|
@@ -24,7 +24,7 @@
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Autofac" publicKeyToken="17863af14b0044da" />
|
||||
|
@@ -104,8 +104,8 @@
|
||||
<Reference Include="Moq, Version=4.2.1510.2205, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Moq.4.2.1510.2205\lib\net40\Moq.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NHibernate, Version=4.1.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NHibernate.4.1.2.4000\lib\net40\NHibernate.dll</HintPath>
|
||||
|
@@ -14,7 +14,7 @@
|
||||
<package id="Microsoft.AspNet.WebPages" version="3.2.7" targetFramework="net48" />
|
||||
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net48" />
|
||||
<package id="Moq" version="4.2.1510.2205" targetFramework="net48" />
|
||||
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net48" />
|
||||
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net48" />
|
||||
<package id="NHibernate" version="4.1.2.4000" targetFramework="net48" />
|
||||
<package id="NUnit" version="2.5.10.11092" targetFramework="net48" />
|
||||
<package id="NUnitTestAdapter" version="2.3.0" targetFramework="net48" />
|
||||
|
@@ -16,7 +16,7 @@
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
@@ -30,6 +30,26 @@
|
||||
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.2.0" newVersion="4.2.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.4.0" newVersion="4.0.4.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.1.0" newVersion="4.2.1.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.1.0" newVersion="6.0.1.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.5.0" newVersion="4.1.5.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
|
93
src/Orchard.Web/Core/Containers/AdminMenu.cs
Normal file
93
src/Orchard.Web/Core/Containers/AdminMenu.cs
Normal file
@@ -0,0 +1,93 @@
|
||||
using System.Linq;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.Core.Containers.Models;
|
||||
using Orchard.Core.Containers.Services;
|
||||
using Orchard.Localization;
|
||||
using Orchard.Security;
|
||||
using Orchard.UI.Navigation;
|
||||
using Orchard.Utility.Extensions;
|
||||
|
||||
namespace Orchard.Core.Containers {
|
||||
public class AdminMenu : INavigationProvider {
|
||||
private readonly IContainerService _containerService;
|
||||
private readonly IContentManager _contentManager;
|
||||
private readonly IAuthorizationService _authorizationService;
|
||||
private readonly IWorkContextAccessor _workContextAccessor;
|
||||
|
||||
public AdminMenu(
|
||||
IContainerService containerService,
|
||||
IContentManager contentManager,
|
||||
IAuthorizationService authorizationService,
|
||||
IWorkContextAccessor workContextAccessor) {
|
||||
_containerService = containerService;
|
||||
_contentManager = contentManager;
|
||||
_authorizationService = authorizationService;
|
||||
_workContextAccessor = workContextAccessor;
|
||||
}
|
||||
|
||||
public Localizer T { get; set; }
|
||||
public string MenuName { get { return "admin"; } }
|
||||
|
||||
public void GetNavigation(NavigationBuilder builder) {
|
||||
builder.AddImageSet("container");
|
||||
|
||||
var containers = _containerService
|
||||
.GetContainersQuery(VersionOptions.Latest)
|
||||
.Where<ContainerPartRecord>(x => x.ShowOnAdminMenu)
|
||||
.List()
|
||||
.Where(content => _authorizationService.TryCheckAccess(
|
||||
Contents.Permissions.EditContent,
|
||||
_workContextAccessor.GetContext().CurrentUser,
|
||||
content))
|
||||
.ToList();
|
||||
|
||||
foreach (var container in containers) {
|
||||
var closureContainer = container;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(container.AdminMenuImageSet)) {
|
||||
builder.AddImageSet(container.AdminMenuImageSet.Trim());
|
||||
}
|
||||
|
||||
builder.Add(T(container.AdminMenuText), container.AdminMenuPosition, item => {
|
||||
var containedItems = _containerService.GetContentItems(closureContainer.Id, VersionOptions.Latest).ToList();
|
||||
var actualContainer = closureContainer;
|
||||
var position = 0;
|
||||
|
||||
// If the list has just a single item that happens to be a container itself,
|
||||
// we will treat that one as the actual container to provide a nice & quick way to manage that list.
|
||||
if (containedItems.Count == 1) {
|
||||
var containedItem = containedItems.First().As<ContainerPart>();
|
||||
|
||||
if (containedItem != null) {
|
||||
actualContainer = containedItem;
|
||||
foreach (var itemContentType in containedItem.ItemContentTypes) {
|
||||
var closureItemContentType = itemContentType;
|
||||
item.Add(T("New {0}", itemContentType.DisplayName), string.Format("1.{0}", position++), subItem => subItem
|
||||
.Action("Create", "Admin", new {
|
||||
id = closureItemContentType.Name,
|
||||
containerid = containedItem.Id,
|
||||
area = "Contents"
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
item.Action(_contentManager.GetItemMetadata(actualContainer).AdminRouteValues)
|
||||
.AddClass("section-container")
|
||||
.AddClass(closureContainer.AdminMenuText.HtmlClassify())
|
||||
.LinkToFirstChild(false);
|
||||
|
||||
foreach (var itemContentType in closureContainer.ItemContentTypes) {
|
||||
var closureItemContentType = itemContentType;
|
||||
item.Add(T("New {0}", itemContentType.DisplayName), string.Format("1.{0}", position++), subItem => subItem
|
||||
.Action("Create", "Admin", new {
|
||||
id = closureItemContentType.Name,
|
||||
containerid = container.Id,
|
||||
area = "Contents"
|
||||
}));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
12
src/Orchard.Web/Core/Containers/Styles/Web.config
Normal file
12
src/Orchard.Web/Core/Containers/Styles/Web.config
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<system.webServer>
|
||||
<staticContent>
|
||||
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="7.00:00:00" />
|
||||
</staticContent>
|
||||
<handlers accessPolicy="Script,Read">
|
||||
<!-- For any request to a file exists on disk, return it via native http module. AccessPolicy="Script" above is to allow for a managed 404 page. -->
|
||||
<add name="StaticFile" path="*" verb="*" modules="StaticFileModule" preCondition="integratedMode" resourceType="File" requireAccess="Read" />
|
||||
</handlers>
|
||||
</system.webServer>
|
||||
</configuration>
|
Before Width: | Height: | Size: 998 B After Width: | Height: | Size: 998 B |
@@ -0,0 +1,7 @@
|
||||
.menu-admin > .section-container > h3 > a {
|
||||
background-image: url(images/menu.container.png) !important;
|
||||
}
|
||||
|
||||
.menu-admin > .section-container > h3 > a:hover {
|
||||
background-position: 0 -30px !important;
|
||||
}
|
@@ -352,6 +352,32 @@ namespace Orchard.Core.Contents.Controllers {
|
||||
return EditPOST(id, returnUrl, contentItem => _contentManager.Publish(contentItem));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This action is specific to the submit button of the edit form.
|
||||
/// Unpublish logic is the same of the Unpublish action, which is called by the content list.
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="returnUrl"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost, ActionName("Edit")]
|
||||
[Mvc.FormValueRequired("submit.Unpublish")]
|
||||
public ActionResult EditUnpublishPOST(int id, string returnUrl) {
|
||||
return Unpublish(id, returnUrl);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This action is specific to the submit button of the edit form.
|
||||
/// Delete logic is the same of the Remove action, which is called by the content list.
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="returnUrl"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost, ActionName("Edit")]
|
||||
[Mvc.FormValueRequired("submit.Delete")]
|
||||
public ActionResult EditDeletePOST(int id, string returnUrl) {
|
||||
return Remove(id, returnUrl);
|
||||
}
|
||||
|
||||
private ActionResult EditPOST(int id, string returnUrl, Action<ContentItem> conditionallyPublish) {
|
||||
var contentItem = _contentManager.Get(id, VersionOptions.DraftRequired);
|
||||
|
||||
|
@@ -21,8 +21,14 @@ namespace Orchard.Core.Contents.Drivers {
|
||||
protected override DriverResult Editor(ContentPart part, dynamic shapeHelper) {
|
||||
var results = new List<DriverResult> { ContentShape("Content_SaveButton", saveButton => saveButton) };
|
||||
|
||||
if (part.TypeDefinition.Settings.GetModel<ContentTypeSettings>().Draftable)
|
||||
if (part.TypeDefinition.Settings.GetModel<ContentTypeSettings>().Draftable) {
|
||||
results.Add(ContentShape("Content_PublishButton", publishButton => publishButton));
|
||||
results.Add(ContentShape("Content_UnpublishButton", unpublishButton => unpublishButton));
|
||||
}
|
||||
|
||||
if (part.Id > 0) {
|
||||
results.Add(ContentShape("Content_DeleteButton", deleteButton => deleteButton));
|
||||
}
|
||||
|
||||
return Combined(results.ToArray());
|
||||
}
|
||||
|
@@ -6,8 +6,10 @@
|
||||
Parts_Contents_Publish_SummaryAdmin
|
||||
-->
|
||||
<!-- edit "shape" -->
|
||||
<Place Content_PublishButton="Sidebar:24"/>
|
||||
<Place Content_SaveButton="Sidebar:23"/>
|
||||
<Place Content_PublishButton="Sidebar:24"/>
|
||||
<Place Content_UnpublishButton="Sidebar:25"/>
|
||||
<Place Content_DeleteButton="Sidebar:26"/>
|
||||
<Match DisplayType="Detail">
|
||||
<Place Parts_Contents_Publish="Content:5"/>
|
||||
</Match>
|
||||
|
@@ -0,0 +1,8 @@
|
||||
@using Orchard.ContentManagement;
|
||||
@using Orchard.Core.Contents;
|
||||
|
||||
@if (Authorizer.Authorize(Permissions.DeleteContent, (IContent)Model.ContentItem)) {
|
||||
<fieldset class="delete-button">
|
||||
<button type="submit" name="submit.Delete" value="submit.Delete" itemprop="RemoveUrl">@T("Delete")</button>
|
||||
</fieldset>
|
||||
}
|
@@ -0,0 +1,12 @@
|
||||
@using Orchard.ContentManagement;
|
||||
@using Orchard.Core.Contents;
|
||||
|
||||
@{
|
||||
var contentItem = Model.ContentItem as IContent;
|
||||
}
|
||||
|
||||
@if (Authorizer.Authorize(Permissions.PublishContent, contentItem) && contentItem.IsPublished()) {
|
||||
<fieldset class="unpublish-button">
|
||||
<button type="submit" name="submit.Unpublish" value="submit.Unpublish">@T("Unpublish")</button>
|
||||
</fieldset>
|
||||
}
|
@@ -1,74 +1,75 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Routing;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.Aspects;
|
||||
using Orchard.ContentManagement.Handlers;
|
||||
using Orchard.Core.Contents.Settings;
|
||||
using Orchard.Core.Navigation.Models;
|
||||
using Orchard.Core.Navigation.Services;
|
||||
using Orchard.Core.Navigation.ViewModels;
|
||||
using Orchard.Localization;
|
||||
using Orchard.Mvc.Extensions;
|
||||
using Orchard.UI;
|
||||
using Orchard.UI.Notify;
|
||||
using Orchard.UI.Navigation;
|
||||
using Orchard.Utility;
|
||||
using System;
|
||||
using Orchard.ContentManagement.Handlers;
|
||||
using Orchard.Logging;
|
||||
using Orchard.Exceptions;
|
||||
using Orchard.ContentManagement.Aspects;
|
||||
using Orchard.Utility.Extensions;
|
||||
using Orchard.Mvc.Html;
|
||||
using Orchard.Core.Contents.Settings;
|
||||
using Orchard.Data;
|
||||
using System.Web.Routing;
|
||||
using Orchard.Exceptions;
|
||||
using Orchard.Localization;
|
||||
using Orchard.Logging;
|
||||
using Orchard.Mvc.Extensions;
|
||||
using Orchard.Mvc.Html;
|
||||
using Orchard.Security;
|
||||
using Orchard.UI;
|
||||
using Orchard.UI.Navigation;
|
||||
using Orchard.UI.Notify;
|
||||
using Orchard.Utility;
|
||||
using Orchard.Utility.Extensions;
|
||||
|
||||
namespace Orchard.Core.Navigation.Controllers {
|
||||
[ValidateInput(false)]
|
||||
public class AdminController : Controller, IUpdateModel {
|
||||
private readonly IContentManager _contentManager;
|
||||
private readonly ITransactionManager _transactionManager;
|
||||
private readonly IAuthorizer _authorizer;
|
||||
private readonly INotifier _notifier;
|
||||
private readonly IMenuService _menuService;
|
||||
private readonly INavigationManager _navigationManager;
|
||||
private readonly IEnumerable<IContentHandler> _handlers;
|
||||
private readonly IMenuManager _menuManager;
|
||||
private readonly IContentManager _contentManager;
|
||||
private readonly ITransactionManager _transactionManager;
|
||||
|
||||
public AdminController(
|
||||
IOrchardServices orchardServices,
|
||||
IContentManager contentManager,
|
||||
ITransactionManager transactionManager,
|
||||
IMenuService menuService,
|
||||
IMenuManager menuManager,
|
||||
INavigationManager navigationManager,
|
||||
IEnumerable<IContentHandler> handlers) {
|
||||
_contentManager = contentManager;
|
||||
_transactionManager = transactionManager;
|
||||
_contentManager = orchardServices.ContentManager;
|
||||
_transactionManager = orchardServices.TransactionManager;
|
||||
_authorizer = orchardServices.Authorizer;
|
||||
_notifier = orchardServices.Notifier;
|
||||
_menuService = menuService;
|
||||
_menuManager = menuManager;
|
||||
_navigationManager = navigationManager;
|
||||
_handlers = handlers;
|
||||
|
||||
Services = orchardServices;
|
||||
T = NullLocalizer.Instance;
|
||||
Logger = NullLogger.Instance;
|
||||
}
|
||||
|
||||
public Localizer T { get; set; }
|
||||
public ILogger Logger { get; set; }
|
||||
public IOrchardServices Services { get; set; }
|
||||
|
||||
public ActionResult Index(NavigationManagementViewModel model, int? menuId) {
|
||||
var menus = Services.ContentManager.Query("Menu").List().ToList()
|
||||
var menus = _contentManager.Query("Menu").List().ToList()
|
||||
.OrderBy(x => x.ContentManager.GetItemMetadata(x).DisplayText);
|
||||
|
||||
if (!menus.Any()) {
|
||||
if (!Services.Authorizer.Authorize(Permissions.ManageMenus, T("Not allowed to manage menus"))) {
|
||||
if (!_authorizer.Authorize(Permissions.ManageMenus, T("Not allowed to manage menus"))) {
|
||||
return new HttpUnauthorizedResult();
|
||||
}
|
||||
|
||||
return RedirectToAction("Create", "Admin", new { area = "Contents", id = "Menu", returnUrl = Request.RawUrl });
|
||||
}
|
||||
|
||||
var allowedMenus = menus.Where(menu => Services.Authorizer.Authorize(Permissions.ManageMenus, menu)).ToList();
|
||||
var allowedMenus = menus.Where(menu => _authorizer.Authorize(Permissions.ManageMenus, menu)).ToList();
|
||||
|
||||
if (!allowedMenus.Any()) {
|
||||
return new HttpUnauthorizedResult();
|
||||
@@ -87,7 +88,11 @@ namespace Orchard.Core.Navigation.Controllers {
|
||||
}
|
||||
|
||||
if (model.MenuItemEntries == null || !model.MenuItemEntries.Any()) {
|
||||
model.MenuItemEntries = _menuService.GetMenuParts(currentMenu.Id).Select(CreateMenuItemEntries).OrderBy(menuPartEntry => menuPartEntry.Position, new FlatPositionComparer()).ToList();
|
||||
model.MenuItemEntries = _menuService
|
||||
.GetMenuParts(currentMenu.Id)
|
||||
.Select(CreateMenuItemEntries)
|
||||
.OrderBy(menuPartEntry => menuPartEntry.Position, new FlatPositionComparer())
|
||||
.ToList();
|
||||
}
|
||||
|
||||
model.MenuItemDescriptors = _menuManager.GetMenuItemTypes();
|
||||
@@ -100,7 +105,10 @@ namespace Orchard.Core.Navigation.Controllers {
|
||||
|
||||
[HttpPost, ActionName("Index")]
|
||||
public ActionResult IndexPOST(IList<MenuItemEntry> menuItemEntries, int? menuId) {
|
||||
if (!Services.Authorizer.Authorize(Permissions.ManageMenus, (menuId.HasValue) ? _menuService.GetMenu(menuId.Value) : null, T("Couldn't manage the main menu")))
|
||||
if (!_authorizer.Authorize(
|
||||
Permissions.ManageMenus,
|
||||
menuId.HasValue ? _menuService.GetMenu(menuId.Value) : null,
|
||||
T("Couldn't manage the menu")))
|
||||
return new HttpUnauthorizedResult();
|
||||
|
||||
// See https://github.com/OrchardCMS/Orchard/issues/948
|
||||
@@ -123,25 +131,15 @@ namespace Orchard.Core.Navigation.Controllers {
|
||||
return RedirectToAction("Index", new { menuId });
|
||||
}
|
||||
|
||||
private MenuItemEntry CreateMenuItemEntries(MenuPart menuPart) {
|
||||
return new MenuItemEntry {
|
||||
MenuItemId = menuPart.Id,
|
||||
IsMenuItem = menuPart.Is<MenuItemPart>(),
|
||||
Text = menuPart.MenuText,
|
||||
Position = menuPart.MenuPosition,
|
||||
Url = menuPart.Is<MenuItemPart>()
|
||||
? menuPart.As<MenuItemPart>().Url
|
||||
: _navigationManager.GetUrl(null, Services.ContentManager.GetItemMetadata(menuPart).DisplayRouteValues),
|
||||
ContentItem = menuPart.ContentItem,
|
||||
};
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public ActionResult Delete(int id) {
|
||||
|
||||
MenuPart menuPart = _menuService.Get(id);
|
||||
int? menuId = null;
|
||||
if (!Services.Authorizer.Authorize(Permissions.ManageMenus, (menuPart != null) ? _menuService.GetMenu(menuPart.Menu.Id) : null, T("Couldn't manage the main menu")))
|
||||
if (!_authorizer.Authorize(
|
||||
Permissions.ManageMenus,
|
||||
menuPart == null ? null : _menuService.GetMenu(menuPart.Menu.Id),
|
||||
T("Couldn't manage the menu")))
|
||||
return new HttpUnauthorizedResult();
|
||||
|
||||
if (menuPart != null) {
|
||||
@@ -155,7 +153,8 @@ namespace Orchard.Core.Navigation.Controllers {
|
||||
|
||||
foreach (var menuItem in menuItems.Concat(new[] { menuPart })) {
|
||||
// if the menu item is a concrete content item, don't delete it, just unreference the menu
|
||||
if (!menuPart.ContentItem.TypeDefinition.Settings.ContainsKey("Stereotype") || menuPart.ContentItem.TypeDefinition.Settings["Stereotype"] != "MenuItem") {
|
||||
if (!menuPart.ContentItem.TypeDefinition.Settings.ContainsKey("Stereotype")
|
||||
|| menuPart.ContentItem.TypeDefinition.Settings["Stereotype"] != "MenuItem") {
|
||||
menuPart.Menu = null;
|
||||
}
|
||||
else {
|
||||
@@ -168,26 +167,18 @@ namespace Orchard.Core.Navigation.Controllers {
|
||||
return RedirectToAction("Index", new { menuId });
|
||||
}
|
||||
|
||||
bool IUpdateModel.TryUpdateModel<TModel>(TModel model, string prefix, string[] includeProperties, string[] excludeProperties) {
|
||||
return TryUpdateModel(model, prefix, includeProperties, excludeProperties);
|
||||
}
|
||||
|
||||
void IUpdateModel.AddModelError(string key, LocalizedString errorMessage) {
|
||||
ModelState.AddModelError(key, errorMessage.ToString());
|
||||
}
|
||||
|
||||
public ActionResult CreateMenuItem(string id, int menuId, string returnUrl) {
|
||||
if (!Services.Authorizer.Authorize(Permissions.ManageMenus, _menuService.GetMenu(menuId), T("Couldn't manage the main menu")))
|
||||
if (!_authorizer.Authorize(Permissions.ManageMenus, _menuService.GetMenu(menuId), T("Couldn't manage the menu")))
|
||||
return new HttpUnauthorizedResult();
|
||||
|
||||
// create a new temporary menu item
|
||||
var menuPart = Services.ContentManager.New<MenuPart>(id);
|
||||
var menuPart = _contentManager.New<MenuPart>(id);
|
||||
|
||||
if (menuPart == null)
|
||||
return HttpNotFound();
|
||||
|
||||
// load the menu
|
||||
var menu = Services.ContentManager.Get(menuId);
|
||||
var menu = _contentManager.Get(menuId);
|
||||
|
||||
if (menu == null)
|
||||
return HttpNotFound();
|
||||
@@ -196,7 +187,7 @@ namespace Orchard.Core.Navigation.Controllers {
|
||||
// filter the content items for this specific menu
|
||||
menuPart.MenuPosition = Position.GetNext(_navigationManager.BuildMenu(menu));
|
||||
menuPart.Menu = menu;
|
||||
var model = Services.ContentManager.BuildEditor(menuPart);
|
||||
var model = _contentManager.BuildEditor(menuPart);
|
||||
|
||||
return View(model);
|
||||
}
|
||||
@@ -206,32 +197,32 @@ namespace Orchard.Core.Navigation.Controllers {
|
||||
}
|
||||
|
||||
Logger.Error(T("Creating menu item failed: {0}", exception.Message).Text);
|
||||
Services.Notifier.Error(T("Creating menu item failed: {0}", exception.Message));
|
||||
_notifier.Error(T("Creating menu item failed: {0}", exception.Message));
|
||||
return this.RedirectLocal(returnUrl, () => RedirectToAction("Index"));
|
||||
}
|
||||
}
|
||||
|
||||
[HttpPost, ActionName("CreateMenuItem")]
|
||||
public ActionResult CreateMenuItemPost(string id, int menuId, string returnUrl) {
|
||||
if (!Services.Authorizer.Authorize(Permissions.ManageMenus, _menuService.GetMenu(menuId), T("Couldn't manage the main menu")))
|
||||
if (!_authorizer.Authorize(Permissions.ManageMenus, _menuService.GetMenu(menuId), T("Couldn't manage the menu")))
|
||||
return new HttpUnauthorizedResult();
|
||||
var menuPart = Services.ContentManager.New<MenuPart>(id);
|
||||
var menuPart = _contentManager.New<MenuPart>(id);
|
||||
if (menuPart == null)
|
||||
return HttpNotFound();
|
||||
// load the menu
|
||||
var menu = Services.ContentManager.Get(menuId);
|
||||
var menu = _contentManager.Get(menuId);
|
||||
if (menu == null)
|
||||
return HttpNotFound();
|
||||
|
||||
menuPart.Menu = menu;
|
||||
var model = Services.ContentManager.UpdateEditor(menuPart, this);
|
||||
var model = _contentManager.UpdateEditor(menuPart, this);
|
||||
menuPart.MenuPosition = Position.GetNext(_navigationManager.BuildMenu(menu));
|
||||
Services.ContentManager.Create(menuPart);
|
||||
_contentManager.Create(menuPart);
|
||||
if (!ModelState.IsValid) {
|
||||
Services.TransactionManager.Cancel();
|
||||
_transactionManager.Cancel();
|
||||
return View(model);
|
||||
}
|
||||
Services.Notifier.Information(T("Your {0} has been added.", menuPart.TypeDefinition.DisplayName));
|
||||
_notifier.Information(T("Your {0} has been added.", menuPart.TypeDefinition.DisplayName));
|
||||
return this.RedirectLocal(returnUrl, () => RedirectToAction("Index"));
|
||||
}
|
||||
|
||||
@@ -241,7 +232,7 @@ namespace Orchard.Core.Navigation.Controllers {
|
||||
if (contentItem == null)
|
||||
return HttpNotFound();
|
||||
|
||||
if (!Services.Authorizer.Authorize(Permissions.ManageMenus, contentItem.Content.MenuPart.Menu, T("Couldn't manage the main menu")))
|
||||
if (!_authorizer.Authorize(Permissions.ManageMenus, contentItem.Content.MenuPart.Menu, T("Couldn't manage the menu")))
|
||||
return new HttpUnauthorizedResult();
|
||||
|
||||
var model = _contentManager.BuildEditor(contentItem);
|
||||
@@ -252,19 +243,81 @@ namespace Orchard.Core.Navigation.Controllers {
|
||||
[Mvc.FormValueRequired("submit.Save")]
|
||||
public ActionResult EditPOST(int id, string returnUrl) {
|
||||
return EditPOST(id, returnUrl, contentItem => {
|
||||
if (!contentItem.Has<IPublishingControlAspect>() && !contentItem.TypeDefinition.Settings.GetModel<ContentTypeSettings>().Draftable)
|
||||
if (!contentItem.Has<IPublishingControlAspect>()
|
||||
&& !contentItem.TypeDefinition.Settings.GetModel<ContentTypeSettings>().Draftable
|
||||
&& contentItem.IsPublished())
|
||||
_contentManager.Publish(contentItem);
|
||||
});
|
||||
}
|
||||
private ActionResult EditPOST(int id, string returnUrl, Action<ContentItem> conditionallyPublish) {
|
||||
var contentItem = _contentManager.Get(id, VersionOptions.DraftRequired);
|
||||
|
||||
if (contentItem == null)
|
||||
[HttpPost]
|
||||
// Copy of Contents/AdminController/Publish, but with different permission check and redirect.
|
||||
public ActionResult Publish(int id) {
|
||||
var menuPart = _contentManager.GetLatest<MenuPart>(id);
|
||||
if (menuPart == null)
|
||||
return HttpNotFound();
|
||||
|
||||
if (!Services.Authorizer.Authorize(Permissions.ManageMenus, contentItem.Content.MenuPart.Menu, T("Couldn't manage the main menu")))
|
||||
if (!_authorizer.Authorize(Permissions.ManageMenus, menuPart.Menu, T("Couldn't manage the menu")))
|
||||
return new HttpUnauthorizedResult();
|
||||
|
||||
_contentManager.Publish(menuPart.ContentItem);
|
||||
|
||||
_notifier.Information(
|
||||
string.IsNullOrWhiteSpace(menuPart.MenuText)
|
||||
? string.IsNullOrWhiteSpace(menuPart.TypeDefinition.DisplayName)
|
||||
? T("Your content has been published.")
|
||||
: T("Your {0} has been published.", menuPart.TypeDefinition.DisplayName)
|
||||
: T("'{0}' has been published.", menuPart.MenuText));
|
||||
|
||||
return RedirectToAction("Index", new { menuId = menuPart.Menu.Id });
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
// Copy of Contents/AdminController/Unpublish, but with different permission check and redirect.
|
||||
public ActionResult Unpublish(int id) {
|
||||
var menuPart = _contentManager.GetLatest<MenuPart>(id);
|
||||
if (menuPart == null)
|
||||
return HttpNotFound();
|
||||
|
||||
if (!_authorizer.Authorize(Permissions.ManageMenus, menuPart.Menu, T("Couldn't manage the menu")))
|
||||
return new HttpUnauthorizedResult();
|
||||
|
||||
_contentManager.Unpublish(menuPart.ContentItem);
|
||||
|
||||
_notifier.Information(
|
||||
string.IsNullOrWhiteSpace(menuPart.MenuText)
|
||||
? string.IsNullOrWhiteSpace(menuPart.TypeDefinition.DisplayName)
|
||||
? T("Your content has been unpublished.")
|
||||
: T("Your {0} has been unpublished.", menuPart.TypeDefinition.DisplayName)
|
||||
: T("'{0}' has been unpublished.", menuPart.MenuText));
|
||||
|
||||
return RedirectToAction("Index", new { menuId = menuPart.Menu.Id });
|
||||
}
|
||||
|
||||
private MenuItemEntry CreateMenuItemEntries(MenuPart menuPart) {
|
||||
return new MenuItemEntry {
|
||||
MenuItemId = menuPart.Id,
|
||||
IsMenuItem = menuPart.Is<MenuItemPart>(),
|
||||
Text = menuPart.MenuText,
|
||||
Position = menuPart.MenuPosition,
|
||||
Url = menuPart.Is<MenuItemPart>()
|
||||
? menuPart.As<MenuItemPart>().Url
|
||||
: _navigationManager.GetUrl(null, _contentManager.GetItemMetadata(menuPart).DisplayRouteValues),
|
||||
ContentItem = menuPart.ContentItem,
|
||||
};
|
||||
}
|
||||
|
||||
private ActionResult EditPOST(int id, string returnUrl, Action<ContentItem> conditionallyPublish) {
|
||||
var menuPart = _contentManager.GetDraftRequired<MenuPart>(id);
|
||||
|
||||
if (menuPart == null)
|
||||
return HttpNotFound();
|
||||
|
||||
if (!_authorizer.Authorize(Permissions.ManageMenus, menuPart.Menu, T("Couldn't manage the menu")))
|
||||
return new HttpUnauthorizedResult();
|
||||
|
||||
var contentItem = menuPart.ContentItem;
|
||||
|
||||
string previousRoute = null;
|
||||
if (contentItem.Has<IAliasAspect>()
|
||||
&& !string.IsNullOrWhiteSpace(returnUrl)
|
||||
@@ -289,11 +342,22 @@ namespace Orchard.Core.Navigation.Controllers {
|
||||
returnUrl = Url.ItemDisplayUrl(contentItem);
|
||||
}
|
||||
|
||||
Services.Notifier.Information(string.IsNullOrWhiteSpace(contentItem.TypeDefinition.DisplayName)
|
||||
? T("Your content has been saved.")
|
||||
: T("Your {0} has been saved.", contentItem.TypeDefinition.DisplayName));
|
||||
_notifier.Information(
|
||||
string.IsNullOrWhiteSpace(menuPart.MenuText)
|
||||
? string.IsNullOrWhiteSpace(contentItem.TypeDefinition.DisplayName)
|
||||
? T("Your content has been saved.")
|
||||
: T("Your {0} has been saved.", contentItem.TypeDefinition.DisplayName)
|
||||
: T("'{0}' has been saved.", menuPart.MenuText));
|
||||
|
||||
return this.RedirectLocal(returnUrl, () => RedirectToAction("Edit", new RouteValueDictionary { { "Id", contentItem.Id } }));
|
||||
return RedirectToAction("Index", new { menuId = menuPart.Menu.Id });
|
||||
}
|
||||
|
||||
bool IUpdateModel.TryUpdateModel<TModel>(TModel model, string prefix, string[] includeProperties, string[] excludeProperties) {
|
||||
return TryUpdateModel(model, prefix, includeProperties, excludeProperties);
|
||||
}
|
||||
|
||||
void IUpdateModel.AddModelError(string key, LocalizedString errorMessage) {
|
||||
ModelState.AddModelError(key, errorMessage.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -19,8 +19,8 @@ namespace Orchard.Core.Navigation.Services {
|
||||
|
||||
public IEnumerable<MenuPart> GetMenuParts(int menuId) {
|
||||
return _contentManager
|
||||
.Query<MenuPart, MenuPartRecord>()
|
||||
.Where( x => x.MenuId == menuId)
|
||||
.Query<MenuPart, MenuPartRecord>(VersionOptions.Latest)
|
||||
.Where(x => x.MenuId == menuId)
|
||||
.List();
|
||||
}
|
||||
|
||||
|
@@ -1,4 +1,6 @@
|
||||
@model NavigationManagementViewModel
|
||||
|
||||
@using Orchard.ContentManagement;
|
||||
@using Orchard.Core.Navigation.ViewModels;
|
||||
@using Orchard.Utility.Extensions;
|
||||
|
||||
@@ -115,8 +117,21 @@
|
||||
<span class="navigation-position"><input type="text" class="text" name="@Html.NameOf(m => m.MenuItemEntries[i].Position)" value="@menuPartEntry.Position" /></span>
|
||||
<span class="navigation-actions">
|
||||
<input type="hidden" name="@Html.NameOf(m => m.MenuItemEntries[i].MenuItemId)" value="@menuPartEntry.MenuItemId" />
|
||||
@Html.ItemEditLink(T("Edit").Text, menuPartEntry.ContentItem, new { returnUrl = Request.RawUrl })@T(" | ")
|
||||
@Html.Link(T("Delete").Text, Url.ItemRemoveUrl(menuPartEntry.ContentItem,null), new { itemprop = "RemoveUrl UnsafeUrl" })
|
||||
@{
|
||||
var menuItemHasPublished = menuPartEntry.ContentItem.HasPublished();
|
||||
}
|
||||
|
||||
@Html.Link(
|
||||
menuItemHasPublished ? T("Unpublish").Text : T("Publish").Text,
|
||||
Url.Action(
|
||||
menuItemHasPublished ? "Unpublish": "Publish",
|
||||
"Admin",
|
||||
new { area = "Navigation", id = menuPartEntry.ContentItem.Id }),
|
||||
new { itemprop = "UnsafeUrl" })
|
||||
@T(" | ")
|
||||
@Html.ItemEditLink(T("Edit").Text, menuPartEntry.ContentItem, new { returnUrl = Request.RawUrl })
|
||||
@T(" | ")
|
||||
@Html.Link(T("Delete").Text, Url.ItemRemoveUrl(menuPartEntry.ContentItem, null), new { itemprop = "RemoveUrl UnsafeUrl" })
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
@@ -119,6 +119,7 @@
|
||||
<Compile Include="Common\ViewModels\DateTimeEditor.cs" />
|
||||
<Compile Include="Common\ViewModels\TextFieldDriverViewModel.cs" />
|
||||
<Compile Include="Common\ViewModels\TextFieldSettingsEventsViewModel.cs" />
|
||||
<Compile Include="Containers\AdminMenu.cs" />
|
||||
<Compile Include="Containers\Controllers\ItemController.cs" />
|
||||
<Compile Include="Containers\Drivers\ContainablePartDriver.cs" />
|
||||
<Compile Include="Containers\Drivers\ContainerPartDriver.cs" />
|
||||
@@ -318,6 +319,8 @@
|
||||
<Content Include="Common\Views\Parts.Common.Metadata.cshtml" />
|
||||
<Content Include="Common\Views\CommonMetadataLastModified.cshtml" />
|
||||
<Content Include="Containers\Module.txt" />
|
||||
<Content Include="Containers\Styles\images\menu.container.png" />
|
||||
<Content Include="Containers\Styles\menu.container-admin.css" />
|
||||
<Content Include="Shapes\Scripts\admin-localnavigation.js" />
|
||||
<Content Include="Contents\Styles\images\menu.content.png" />
|
||||
<Content Include="Contents\Styles\menu.content-admin.css" />
|
||||
@@ -610,9 +613,16 @@
|
||||
<Content Include="Navigation\Views\Admin\Edit.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Contents\Views\Content.UnpublishButton.cshtml" />
|
||||
<Content Include="Contents\Views\Content.DeleteButton.cshtml" />
|
||||
<None Include="packages.config" />
|
||||
<Content Include="Title\Views\DefinitionTemplates\TitlePartSettings.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Containers\Styles\Web.config">
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
|
@@ -54,7 +54,7 @@
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
|
||||
|
@@ -53,7 +53,7 @@
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
|
||||
|
@@ -62,20 +62,20 @@
|
||||
<HintPath>..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
|
||||
<Reference Include="System.Buffers, Version=4.0.4.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\System.Buffers.4.6.0\lib\net462\System.Buffers.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath>
|
||||
<Reference Include="System.Memory, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\System.Memory.4.6.0\lib\net462\System.Memory.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Numerics" />
|
||||
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
|
||||
<Reference Include="System.Numerics.Vectors, Version=4.1.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\System.Numerics.Vectors.4.6.0\lib\net462\System.Numerics.Vectors.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\System.Runtime.CompilerServices.Unsafe.6.1.0\lib\net462\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Web.ApplicationServices" />
|
||||
@@ -231,4 +231,4 @@
|
||||
</FlavorProperties>
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
</Project>
|
||||
</Project>
|
@@ -54,7 +54,7 @@
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
|
||||
@@ -68,6 +68,22 @@
|
||||
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
|
||||
<bindingRedirect oldVersion="1.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.5.0" newVersion="4.1.5.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.4.0" newVersion="4.0.4.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<system.codedom>
|
||||
|
@@ -6,8 +6,8 @@
|
||||
<package id="Microsoft.AspNet.WebPages" version="3.2.7" targetFramework="net48" />
|
||||
<package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="4.1.0" targetFramework="net48" />
|
||||
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net48" />
|
||||
<package id="System.Buffers" version="4.5.1" targetFramework="net48" />
|
||||
<package id="System.Memory" version="4.5.4" targetFramework="net48" />
|
||||
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net48" />
|
||||
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.3" targetFramework="net48" />
|
||||
</packages>
|
||||
<package id="System.Buffers" version="4.6.0" targetFramework="net48" />
|
||||
<package id="System.Memory" version="4.6.0" targetFramework="net48" />
|
||||
<package id="System.Numerics.Vectors" version="4.6.0" targetFramework="net48" />
|
||||
<package id="System.Runtime.CompilerServices.Unsafe" version="6.1.0" targetFramework="net48" />
|
||||
</packages>
|
@@ -54,7 +54,7 @@
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
|
||||
|
@@ -59,8 +59,8 @@
|
||||
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
@@ -250,4 +250,4 @@
|
||||
</FlavorProperties>
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
</Project>
|
||||
</Project>
|
@@ -54,7 +54,7 @@
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
|
||||
|
@@ -5,5 +5,5 @@
|
||||
<package id="Microsoft.AspNet.WebPages" version="3.2.7" targetFramework="net48" />
|
||||
<package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="4.1.0" targetFramework="net48" />
|
||||
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net48" />
|
||||
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net48" />
|
||||
</packages>
|
||||
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net48" />
|
||||
</packages>
|
@@ -54,7 +54,7 @@
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
|
||||
|
@@ -61,8 +61,8 @@
|
||||
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NHibernate, Version=4.1.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\NHibernate.4.1.2.4000\lib\net40\NHibernate.dll</HintPath>
|
||||
|
@@ -56,7 +56,7 @@
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
|
||||
|
@@ -6,7 +6,7 @@
|
||||
<package id="Microsoft.AspNet.WebPages" version="3.2.7" targetFramework="net48" />
|
||||
<package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="4.1.0" targetFramework="net48" />
|
||||
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net48" />
|
||||
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net48" />
|
||||
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net48" />
|
||||
<package id="NHibernate" version="4.1.2.4000" targetFramework="net48" />
|
||||
<package id="XMLDiffPatch" version="1.0.8.28" targetFramework="net48" />
|
||||
</packages>
|
||||
</packages>
|
@@ -53,7 +53,7 @@
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
|
||||
|
@@ -76,14 +76,14 @@
|
||||
<Reference Include="Microsoft.Data.Services.Client, Version=5.8.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Microsoft.Data.Services.Client.5.8.4\lib\net40\Microsoft.Data.Services.Client.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.IdentityModel.JsonWebTokens, Version=5.2.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Microsoft.IdentityModel.JsonWebTokens.5.2.4\lib\net451\Microsoft.IdentityModel.JsonWebTokens.dll</HintPath>
|
||||
<Reference Include="Microsoft.IdentityModel.JsonWebTokens, Version=5.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Microsoft.IdentityModel.JsonWebTokens.5.7.0\lib\net461\Microsoft.IdentityModel.JsonWebTokens.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.IdentityModel.Logging, Version=5.2.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Microsoft.IdentityModel.Logging.5.2.4\lib\net451\Microsoft.IdentityModel.Logging.dll</HintPath>
|
||||
<Reference Include="Microsoft.IdentityModel.Logging, Version=5.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Microsoft.IdentityModel.Logging.5.7.0\lib\net461\Microsoft.IdentityModel.Logging.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.IdentityModel.Tokens, Version=5.2.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Microsoft.IdentityModel.Tokens.5.2.4\lib\net451\Microsoft.IdentityModel.Tokens.dll</HintPath>
|
||||
<Reference Include="Microsoft.IdentityModel.Tokens, Version=5.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Microsoft.IdentityModel.Tokens.5.7.0\lib\net461\Microsoft.IdentityModel.Tokens.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Practices.TransientFaultHandling.Core, Version=5.1.1209.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\TransientFaultHandling.Core.5.1.1209.1\lib\NET4\Microsoft.Practices.TransientFaultHandling.Core.dll</HintPath>
|
||||
@@ -109,8 +109,8 @@
|
||||
<Reference Include="Microsoft.WindowsAzure.Storage, Version=5.0.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\WindowsAzure.Storage.5.0.2\lib\net40\Microsoft.WindowsAzure.Storage.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NHibernate, Version=4.1.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\NHibernate.4.1.2.4000\lib\net40\NHibernate.dll</HintPath>
|
||||
@@ -121,8 +121,8 @@
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.IdentityModel.Tokens.Jwt, Version=5.2.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\System.IdentityModel.Tokens.Jwt.5.2.4\lib\net451\System.IdentityModel.Tokens.Jwt.dll</HintPath>
|
||||
<Reference Include="System.IdentityModel.Tokens.Jwt, Version=5.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\System.IdentityModel.Tokens.Jwt.5.7.0\lib\net461\System.IdentityModel.Tokens.Jwt.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.Spatial, Version=5.8.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
|
@@ -51,7 +51,7 @@
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Data.OData" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
|
@@ -11,15 +11,15 @@
|
||||
<package id="Microsoft.Data.Edm" version="5.8.4" targetFramework="net48" />
|
||||
<package id="Microsoft.Data.OData" version="5.8.4" targetFramework="net48" />
|
||||
<package id="Microsoft.Data.Services.Client" version="5.8.4" targetFramework="net48" />
|
||||
<package id="Microsoft.IdentityModel.JsonWebTokens" version="5.2.4" targetFramework="net48" />
|
||||
<package id="Microsoft.IdentityModel.Logging" version="5.2.4" targetFramework="net48" />
|
||||
<package id="Microsoft.IdentityModel.Tokens" version="5.2.4" targetFramework="net48" />
|
||||
<package id="Microsoft.IdentityModel.JsonWebTokens" version="5.7.0" targetFramework="net48" />
|
||||
<package id="Microsoft.IdentityModel.Logging" version="5.7.0" targetFramework="net48" />
|
||||
<package id="Microsoft.IdentityModel.Tokens" version="5.7.0" targetFramework="net48" />
|
||||
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net48" />
|
||||
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="3.1.0" targetFramework="net48" />
|
||||
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net48" />
|
||||
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net48" />
|
||||
<package id="NHibernate" version="4.1.2.4000" targetFramework="net48" />
|
||||
<package id="Orchard.WindowsAzure.Diagnostics" version="2.7.0.0" targetFramework="net48" />
|
||||
<package id="System.IdentityModel.Tokens.Jwt" version="5.2.4" targetFramework="net48" />
|
||||
<package id="System.IdentityModel.Tokens.Jwt" version="5.7.0" targetFramework="net48" />
|
||||
<package id="System.Spatial" version="5.8.4" targetFramework="net48" />
|
||||
<package id="TransientFaultHandling.Core" version="5.1.1209.1" targetFramework="net48" />
|
||||
<package id="windowsazure.mediaservices" version="3.4.0.0" targetFramework="net48" />
|
||||
|
@@ -100,8 +100,8 @@
|
||||
<Reference Include="Microsoft.WindowsFabric.Data.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Caching.2.4.0.0\lib\net40-full\Microsoft.WindowsFabric.Data.Common.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NHibernate, Version=4.1.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\NHibernate.4.1.2.4000\lib\net40\NHibernate.dll</HintPath>
|
||||
@@ -218,4 +218,4 @@
|
||||
</FlavorProperties>
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
</Project>
|
||||
</Project>
|
@@ -89,6 +89,8 @@ namespace Orchard.Azure.Services.FileSystems {
|
||||
return newPath;
|
||||
}
|
||||
|
||||
private static string GetFolderName(string path) => path.Substring(path.LastIndexOf('/') + 1);
|
||||
|
||||
public string Combine(string path1, string path2) {
|
||||
if (path1 == null) {
|
||||
throw new ArgumentNullException("path1");
|
||||
@@ -141,10 +143,10 @@ namespace Orchard.Azure.Services.FileSystems {
|
||||
}
|
||||
|
||||
return BlobClient.ListBlobs(prefix)
|
||||
.OfType<CloudBlockBlob>()
|
||||
.Where(blobItem => !blobItem.Uri.AbsoluteUri.EndsWith(FolderEntry))
|
||||
.Select(blobItem => new AzureBlobFileStorage(blobItem, _absoluteRoot))
|
||||
.ToArray();
|
||||
.OfType<CloudBlockBlob>()
|
||||
.Where(blobItem => !blobItem.Uri.AbsoluteUri.EndsWith(FolderEntry))
|
||||
.Select(blobItem => new AzureBlobFileStorage(blobItem, _absoluteRoot))
|
||||
.ToArray();
|
||||
}
|
||||
|
||||
public IEnumerable<IStorageFolder> ListFolders(string path) {
|
||||
@@ -194,6 +196,11 @@ namespace Orchard.Azure.Services.FileSystems {
|
||||
|
||||
public void CreateFolder(string path) {
|
||||
path = ConvertToRelativeUriPath(path);
|
||||
|
||||
if (FileSystemStorageProvider.FolderNameContainsInvalidCharacters(GetFolderName(path))) {
|
||||
throw new InvalidNameCharacterException("The directory name contains invalid character(s)");
|
||||
}
|
||||
|
||||
Container.EnsureDirectoryDoesNotExist(String.Concat(_root, path));
|
||||
|
||||
// Creating a virtually hidden file to make the directory an existing concept
|
||||
@@ -225,6 +232,10 @@ namespace Orchard.Azure.Services.FileSystems {
|
||||
path = ConvertToRelativeUriPath(path);
|
||||
newPath = ConvertToRelativeUriPath(newPath);
|
||||
|
||||
if (FileSystemStorageProvider.FolderNameContainsInvalidCharacters(GetFolderName(newPath))) {
|
||||
throw new InvalidNameCharacterException("The new directory name contains invalid character(s)");
|
||||
}
|
||||
|
||||
if (!path.EndsWith("/"))
|
||||
path += "/";
|
||||
|
||||
@@ -260,6 +271,10 @@ namespace Orchard.Azure.Services.FileSystems {
|
||||
path = ConvertToRelativeUriPath(path);
|
||||
newPath = ConvertToRelativeUriPath(newPath);
|
||||
|
||||
if (FileSystemStorageProvider.FileNameContainsInvalidCharacters(Path.GetFileName(newPath))) {
|
||||
throw new InvalidNameCharacterException("The new file name contains invalid character(s)");
|
||||
}
|
||||
|
||||
Container.EnsureBlobExists(String.Concat(_root, path));
|
||||
Container.EnsureBlobDoesNotExist(String.Concat(_root, newPath));
|
||||
|
||||
@@ -284,6 +299,10 @@ namespace Orchard.Azure.Services.FileSystems {
|
||||
public IStorageFile CreateFile(string path) {
|
||||
path = ConvertToRelativeUriPath(path);
|
||||
|
||||
if (FileSystemStorageProvider.FileNameContainsInvalidCharacters(Path.GetFileName(path))) {
|
||||
throw new InvalidNameCharacterException("The file name contains invalid character(s)");
|
||||
}
|
||||
|
||||
if (Container.BlobExists(String.Concat(_root, path))) {
|
||||
throw new ArgumentException("File " + path + " already exists");
|
||||
}
|
||||
@@ -371,10 +390,7 @@ namespace Orchard.Azure.Services.FileSystems {
|
||||
_rootPath = rootPath;
|
||||
}
|
||||
|
||||
public string GetName() {
|
||||
var path = GetPath();
|
||||
return path.Substring(path.LastIndexOf('/') + 1);
|
||||
}
|
||||
public string GetName() => GetFolderName(GetPath());
|
||||
|
||||
public string GetPath() {
|
||||
return _blob.Uri.ToString().Substring(_rootPath.Length).Trim('/');
|
||||
@@ -399,11 +415,12 @@ namespace Orchard.Azure.Services.FileSystems {
|
||||
long size = 0;
|
||||
|
||||
foreach (var blobItem in directoryBlob.ListBlobs()) {
|
||||
if (blobItem is CloudBlockBlob)
|
||||
size += ((CloudBlockBlob)blobItem).Properties.Length;
|
||||
|
||||
if (blobItem is CloudBlobDirectory)
|
||||
size += GetDirectorySize((CloudBlobDirectory)blobItem);
|
||||
if (blobItem is CloudBlockBlob blob) {
|
||||
size += blob.Properties.Length;
|
||||
}
|
||||
else if (blobItem is CloudBlobDirectory directory) {
|
||||
size += GetDirectorySize(directory);
|
||||
}
|
||||
}
|
||||
|
||||
return size;
|
||||
|
@@ -63,7 +63,7 @@
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Autofac" publicKeyToken="17863af14b0044da" culture="neutral" />
|
||||
|
@@ -12,9 +12,9 @@
|
||||
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net48" />
|
||||
<package id="Microsoft.WindowsAzure.Caching" version="2.4.0.0" targetFramework="net48" />
|
||||
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="3.1.0" targetFramework="net48" />
|
||||
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net48" />
|
||||
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net48" />
|
||||
<package id="NHibernate" version="4.1.2.4000" targetFramework="net48" />
|
||||
<package id="Orchard.WindowsAzure.ServiceRuntime" version="2.7.0.0" targetFramework="net48" />
|
||||
<package id="System.Spatial" version="5.8.4" targetFramework="net48" />
|
||||
<package id="WindowsAzure.Storage" version="5.0.2" targetFramework="net48" />
|
||||
</packages>
|
||||
</packages>
|
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Web.Mvc;
|
||||
using Orchard.Blogs.Extensions;
|
||||
using Orchard.Blogs.Models;
|
||||
@@ -138,6 +137,12 @@ namespace Orchard.Blogs.Controllers {
|
||||
});
|
||||
}
|
||||
|
||||
[HttpPost, ActionName("Edit")]
|
||||
[Mvc.FormValueRequired("submit.Delete")]
|
||||
public ActionResult EditDeletePOST(int blogId, int postId, string returnUrl) {
|
||||
return Delete(blogId, postId);
|
||||
}
|
||||
|
||||
[HttpPost, ActionName("Edit")]
|
||||
[FormValueRequired("submit.Publish")]
|
||||
public ActionResult EditAndPublishPOST(int blogId, int postId, string returnUrl) {
|
||||
@@ -156,6 +161,12 @@ namespace Orchard.Blogs.Controllers {
|
||||
return EditPOST(blogId, postId, returnUrl, contentItem => Services.ContentManager.Publish(contentItem));
|
||||
}
|
||||
|
||||
[HttpPost, ActionName("Edit")]
|
||||
[Mvc.FormValueRequired("submit.Unpublish")]
|
||||
public ActionResult EditUnpublishPOST(int blogId, int postId, string returnUrl) {
|
||||
return Unpublish(blogId, postId);
|
||||
}
|
||||
|
||||
public ActionResult EditPOST(int blogId, int postId, string returnUrl, Action<ContentItem> conditionallyPublish) {
|
||||
var blog = _blogService.Get(blogId, VersionOptions.Latest);
|
||||
if (blog == null)
|
||||
|
@@ -54,7 +54,7 @@
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
|
||||
@@ -68,6 +68,22 @@
|
||||
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
|
||||
<bindingRedirect oldVersion="1.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.5.0" newVersion="4.1.5.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.4.0" newVersion="4.0.4.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<system.codedom>
|
||||
|
@@ -8,4 +8,8 @@ namespace Orchard.Caching.Services {
|
||||
void Remove(string key);
|
||||
void Clear();
|
||||
}
|
||||
|
||||
public interface ICacheStorageProviderWithKeyPrefix : ICacheStorageProvider {
|
||||
void Clear(string key);
|
||||
}
|
||||
}
|
@@ -49,7 +49,7 @@
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
|
||||
|
@@ -47,7 +47,7 @@
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30AD4FE6B2A6AEED" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="NHibernate" publicKeyToken="AA95F207798DFDB4" culture="neutral"/>
|
||||
|
@@ -21,7 +21,7 @@
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodeAnalysisRuleSet>..\..\..\OrchardBasicCorrectness.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRuleSet>..\..\..\..\OrchardBasicCorrectness.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
@@ -35,16 +35,16 @@
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Autofac">
|
||||
<Reference Include="Autofac, Version=3.5.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\..\packages\Autofac.3.5.2\lib\net40\Autofac.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Moq, Version=4.2.1510.2205, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\..\packages\Moq.4.2.1510.2205\lib\net40\Moq.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NHibernate">
|
||||
<HintPath>..\..\..\..\packages\NHibernate.4.0.1.4000\lib\net40\NHibernate.dll</HintPath>
|
||||
<Reference Include="NHibernate, Version=4.1.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\..\packages\NHibernate.4.1.2.4000\lib\net40\NHibernate.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="nunit.framework">
|
||||
<Reference Include="nunit.framework, Version=2.5.10.11092, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\..\packages\NUnit.2.5.10.11092\lib\nunit.framework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
|
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Autofac" version="3.5.2" targetFramework="net48" />
|
||||
<package id="Moq" version="4.2.1510.2205" targetFramework="net48" />
|
||||
<package id="NHibernate" version="4.1.2.4000" targetFramework="net48" />
|
||||
<package id="NUnit" version="2.5.10.11092" targetFramework="net48" />
|
||||
</packages>
|
@@ -161,6 +161,8 @@ namespace Orchard.CodeGeneration.Commands {
|
||||
templateText = templateText.Replace("$$ModuleTypeLibGuid$$", Guid.NewGuid().ToString());
|
||||
File.WriteAllText(propertiesPath + "\\AssemblyInfo.cs", templateText);
|
||||
content.Add(propertiesPath + "\\AssemblyInfo.cs");
|
||||
File.WriteAllText(testsPath + "packages.config", File.ReadAllText(_codeGenTemplatePath + "ModuleTestsPackagesConfig.txt"));
|
||||
content.Add(testsPath + "packages.config");
|
||||
|
||||
var itemGroup = CreateProjectItemGroup(testsPath, content, folders);
|
||||
|
||||
@@ -168,7 +170,7 @@ namespace Orchard.CodeGeneration.Commands {
|
||||
csprojText = csprojText.Replace("$$ProjectName$$", projectName);
|
||||
csprojText = csprojText.Replace("$$TestsProjectGuid$$", projectGuid);
|
||||
csprojText = csprojText.Replace("$$FileIncludes$$", itemGroup ?? "");
|
||||
csprojText = csprojText.Replace("$$OrchardReferences$$", GetOrchardReferences());
|
||||
csprojText = csprojText.Replace("$$OrchardReferences$$", GetOrchardReferences(modulesFolderRelativeDepth: 3));
|
||||
|
||||
File.WriteAllText(testsPath + projectName + ".csproj", csprojText);
|
||||
|
||||
@@ -327,15 +329,17 @@ namespace Orchard.CodeGeneration.Commands {
|
||||
return text;
|
||||
}
|
||||
|
||||
private static string GetOrchardReferences() {
|
||||
private static string GetOrchardReferences(int modulesFolderRelativeDepth = 2) {
|
||||
var frameworkRelativeDepth = string.Join("\\", Enumerable.Repeat("..", modulesFolderRelativeDepth + 1));
|
||||
var coreRelativeDepth = string.Join("\\", Enumerable.Repeat("..", modulesFolderRelativeDepth));
|
||||
return IsSourceEnlistment() ?
|
||||
@"<ProjectReference Include=""..\..\..\Orchard\Orchard.Framework.csproj"">
|
||||
<Project>{2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}</Project>
|
||||
$@"<ProjectReference Include=""{frameworkRelativeDepth}\Orchard\Orchard.Framework.csproj"">
|
||||
<Project>{{2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}}</Project>
|
||||
<Name>Orchard.Framework</Name>
|
||||
<Private>$(MvcBuildViews)</Private>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include=""..\..\Core\Orchard.Core.csproj"">
|
||||
<Project>{9916839C-39FC-4CEB-A5AF-89CA7E87119F}</Project>
|
||||
<ProjectReference Include=""{coreRelativeDepth}\Core\Orchard.Core.csproj"">
|
||||
<Project>{{9916839C-39FC-4CEB-A5AF-89CA7E87119F}}</Project>
|
||||
<Name>Orchard.Core</Name>
|
||||
<Private>$(MvcBuildViews)</Private>
|
||||
</ProjectReference>" :
|
||||
|
@@ -88,6 +88,7 @@
|
||||
<Compile Include="Services\CodeGenerationCommandInterpreter.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="CodeGenerationTemplates\ModuleTestsPackagesConfig.txt" />
|
||||
<Content Include="CodeGenerationTemplates\ModuleStylesMinCss.txt" />
|
||||
<Content Include="CodeGenerationTemplates\ModuleStylesCss.txt" />
|
||||
<Content Include="CodeGenerationTemplates\ModuleStylesLess.txt" />
|
||||
@@ -158,4 +159,4 @@
|
||||
</FlavorProperties>
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
</Project>
|
||||
</Project>
|
@@ -49,7 +49,7 @@
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
|
||||
|
@@ -54,7 +54,7 @@
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
|
||||
|
@@ -52,7 +52,7 @@
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
|
||||
|
@@ -54,7 +54,7 @@
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
|
||||
|
@@ -54,7 +54,7 @@
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
|
||||
|
@@ -54,7 +54,7 @@
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
|
||||
|
@@ -54,7 +54,7 @@
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
|
||||
|
@@ -55,7 +55,7 @@
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
|
||||
@@ -69,6 +69,22 @@
|
||||
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
|
||||
<bindingRedirect oldVersion="1.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.5.0" newVersion="4.1.5.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.4.0" newVersion="4.0.4.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<system.codedom>
|
||||
|
@@ -55,7 +55,7 @@
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
|
||||
@@ -69,6 +69,22 @@
|
||||
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
|
||||
<bindingRedirect oldVersion="1.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.5.0" newVersion="4.1.5.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.4.0" newVersion="4.0.4.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<system.codedom>
|
||||
|
@@ -1,12 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Specialized;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace Orchard.DynamicForms.Helpers {
|
||||
public static class NameValueCollectionExtensions {
|
||||
public static string ToQueryString(this NameValueCollection nameValues) {
|
||||
return String.Join("&", (from string name in nameValues select String.Concat(name, "=", HttpUtility.UrlEncode(nameValues[name]))).ToArray());
|
||||
}
|
||||
}
|
||||
}
|
@@ -65,8 +65,8 @@
|
||||
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
@@ -340,7 +340,6 @@
|
||||
<Compile Include="Migrations.cs" />
|
||||
<Compile Include="Handlers\ReadFormValuesHandler.cs" />
|
||||
<Compile Include="Services\FormElementEventHandlerBase.cs" />
|
||||
<Compile Include="Helpers\NameValueCollectionExtensions.cs" />
|
||||
<Compile Include="Models\Submission.cs" />
|
||||
<Compile Include="Permissions.cs" />
|
||||
<Compile Include="Services\FormService.cs" />
|
||||
|
@@ -467,4 +467,4 @@ namespace Orchard.DynamicForms.Services {
|
||||
return validatorElementType == elementType || validatorElementType.IsAssignableFrom(elementType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -57,7 +57,7 @@
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
|
||||
@@ -71,6 +71,22 @@
|
||||
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
|
||||
<bindingRedirect oldVersion="1.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.5.0" newVersion="4.1.5.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.4.0" newVersion="4.0.4.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<system.codedom>
|
||||
|
@@ -7,5 +7,5 @@
|
||||
<package id="Microsoft.AspNet.WebPages" version="3.2.7" targetFramework="net48" />
|
||||
<package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="4.1.0" targetFramework="net48" />
|
||||
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net48" />
|
||||
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net48" />
|
||||
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net48" />
|
||||
</packages>
|
@@ -55,8 +55,11 @@
|
||||
<Reference Include="BouncyCastle.Crypto, Version=1.9.0.0, Culture=neutral, PublicKeyToken=0e99375e54769942, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Portable.BouncyCastle.1.9.0\lib\net40\BouncyCastle.Crypto.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MailKit, Version=3.1.0.0, Culture=neutral, PublicKeyToken=4e064fe7c44a8f1b, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\MailKit.3.1.1\lib\net48\MailKit.dll</HintPath>
|
||||
<Reference Include="BouncyCastle.Cryptography, Version=2.0.0.0, Culture=neutral, PublicKeyToken=072edcf4a5328938, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\BouncyCastle.Cryptography.2.5.0\lib\net461\BouncyCastle.Cryptography.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MailKit, Version=4.9.0.0, Culture=neutral, PublicKeyToken=4e064fe7c44a8f1b, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\MailKit.4.9.0\lib\net48\MailKit.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.4.1.0\lib\net472\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll</HintPath>
|
||||
@@ -65,23 +68,42 @@
|
||||
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MimeKit, Version=3.1.0.0, Culture=neutral, PublicKeyToken=bede1c8a46c66814, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\MimeKit.3.1.1\lib\net48\MimeKit.dll</HintPath>
|
||||
<Reference Include="MimeKit, Version=4.9.0.0, Culture=neutral, PublicKeyToken=bede1c8a46c66814, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\MimeKit.4.9.0\lib\net48\MimeKit.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
|
||||
<Reference Include="System.Buffers, Version=4.0.4.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\System.Buffers.4.6.0\lib\net462\System.Buffers.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Configuration">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Formats.Asn1, Version=8.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\System.Formats.Asn1.8.0.1\lib\net462\System.Formats.Asn1.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Memory, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\System.Memory.4.6.0\lib\net462\System.Memory.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<Reference Include="System.Numerics" />
|
||||
<Reference Include="System.Numerics.Vectors, Version=4.1.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\System.Numerics.Vectors.4.6.0\lib\net462\System.Numerics.Vectors.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\System.Runtime.CompilerServices.Unsafe.6.1.0\lib\net462\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Security" />
|
||||
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\System.Threading.Tasks.Extensions.4.6.0\lib\net462\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.ApplicationServices" />
|
||||
<Reference Include="System.Web.DynamicData" />
|
||||
<Reference Include="System.Web.Entity" />
|
||||
|
@@ -55,7 +55,7 @@
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
|
||||
@@ -69,6 +69,18 @@
|
||||
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
|
||||
<bindingRedirect oldVersion="1.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.4.0" newVersion="4.0.4.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<system.codedom>
|
||||
|
@@ -1,13 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="MailKit" version="3.1.1" targetFramework="net48" />
|
||||
<package id="BouncyCastle.Cryptography" version="2.5.0" targetFramework="net48" />
|
||||
<package id="MailKit" version="4.9.0" targetFramework="net48" />
|
||||
<package id="Microsoft.AspNet.Mvc" version="5.2.7" targetFramework="net48" />
|
||||
<package id="Microsoft.AspNet.Razor" version="3.2.7" targetFramework="net48" />
|
||||
<package id="Microsoft.AspNet.WebPages" version="3.2.7" targetFramework="net48" />
|
||||
<package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="4.1.0" targetFramework="net48" />
|
||||
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net48" />
|
||||
<package id="MimeKit" version="3.1.1" targetFramework="net48" />
|
||||
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net48" />
|
||||
<package id="MimeKit" version="4.9.0" targetFramework="net48" />
|
||||
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net48" />
|
||||
<package id="Portable.BouncyCastle" version="1.9.0" targetFramework="net48" />
|
||||
<package id="System.Buffers" version="4.5.1" targetFramework="net48" />
|
||||
<package id="System.Buffers" version="4.6.0" targetFramework="net48" />
|
||||
<package id="System.Formats.Asn1" version="8.0.1" targetFramework="net48" />
|
||||
<package id="System.Memory" version="4.6.0" targetFramework="net48" />
|
||||
<package id="System.Numerics.Vectors" version="4.6.0" targetFramework="net48" />
|
||||
<package id="System.Runtime.CompilerServices.Unsafe" version="6.1.0" targetFramework="net48" />
|
||||
<package id="System.Threading.Tasks.Extensions" version="4.6.0" targetFramework="net48" />
|
||||
<package id="System.ValueTuple" version="4.5.0" targetFramework="net48" />
|
||||
</packages>
|
@@ -6,6 +6,7 @@ using Orchard.Fields.Settings;
|
||||
using Orchard.Localization;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Policy;
|
||||
|
||||
namespace Orchard.Fields.Drivers {
|
||||
public class LinkFieldDriver : ContentFieldDriver<LinkField> {
|
||||
@@ -57,11 +58,33 @@ namespace Orchard.Fields.Drivers {
|
||||
if (settings.Required && String.IsNullOrWhiteSpace(field.Value)) {
|
||||
updater.AddModelError(GetPrefix(field, part), T("Url is required for {0}", T(field.DisplayName)));
|
||||
}
|
||||
else if (!String.IsNullOrWhiteSpace(field.Value) && !Uri.IsWellFormedUriString(field.Value, UriKind.RelativeOrAbsolute)) {
|
||||
updater.AddModelError(GetPrefix(field, part), T("{0} is an invalid url.", field.Value));
|
||||
}
|
||||
else if (settings.LinkTextMode == LinkTextMode.Required && String.IsNullOrWhiteSpace(field.Text)) {
|
||||
updater.AddModelError(GetPrefix(field, part), T("Text is required for {0}.", T(field.DisplayName)));
|
||||
} else if (!String.IsNullOrWhiteSpace(field.Value)) {
|
||||
// Check if it's a valid uri, considering that there may be the link to an anchor only
|
||||
// e.g.: field.Value = "#divId"
|
||||
// Take everything before the first "#" character and check if it's a valid uri.
|
||||
// If there is no character before the first "#", consider the value as a valid one (because it is a reference to a div inside the same page)
|
||||
if (field.Value.StartsWith("#")) {
|
||||
// The field value is a tag id reference
|
||||
// For html 5, a tag id is valid as long as it doesn't contain white spaces
|
||||
if (field.Value.IndexOf(' ') >= 0) {
|
||||
updater.AddModelError(GetPrefix(field, part), T("{0} is an invalid url.", field.Value));
|
||||
}
|
||||
} else {
|
||||
var urlAndRef = field.Value.Split(new char[] { '#' }, 2);
|
||||
|
||||
// Since field value is a proper url and not a tag id only, assume the first part of the array is the actual url to link to
|
||||
if (!String.IsNullOrWhiteSpace(urlAndRef[0]) && !Uri.IsWellFormedUriString(urlAndRef[0], UriKind.RelativeOrAbsolute)) {
|
||||
updater.AddModelError(GetPrefix(field, part), T("{0} is an invalid url.", field.Value));
|
||||
} else if (urlAndRef.Length > 1) {
|
||||
// The second part of the url is the id reference
|
||||
// For html 5, a tag id is valid as long as it doesn't contain white spaces
|
||||
if (urlAndRef[1].IndexOf(' ') >= 0) {
|
||||
updater.AddModelError(GetPrefix(field, part), T("{0} is an invalid url.", field.Value));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -169,10 +169,6 @@
|
||||
<Compile Include="ViewModels\NumericFieldViewModel.cs" />
|
||||
<Compile Include="ViewModels\DateTimeFieldViewModel.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Controllers\" />
|
||||
<Folder Include="Models\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\Fields\Input.cshtml" />
|
||||
</ItemGroup>
|
||||
@@ -223,4 +219,4 @@
|
||||
</FlavorProperties>
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
</Project>
|
||||
</Project>
|
@@ -1,28 +1,51 @@
|
||||
@model Orchard.Fields.Fields.EnumerationField
|
||||
|
||||
@using Orchard.Fields.Settings;
|
||||
|
||||
@{
|
||||
var settings = Model.PartFieldDefinition.Settings.GetModel<EnumerationFieldSettings>();
|
||||
string[] options = (!String.IsNullOrWhiteSpace(settings.Options)) ? settings.Options.Split(new string[] { System.Environment.NewLine }, StringSplitOptions.None) : new string[] { T("Select an option").ToString() };
|
||||
string[] options = (!String.IsNullOrWhiteSpace(settings.Options)) ?
|
||||
settings.Options.Split(new string[] { System.Environment.NewLine }, StringSplitOptions.None)
|
||||
: new string[] { T("Select an option").ToString() };
|
||||
}
|
||||
|
||||
<fieldset>
|
||||
<label for="@Html.FieldIdFor(m => m.Value)" @if (settings.Required) { <text> class="required" </text> }>@Model.DisplayName</label>
|
||||
<label for="@Html.FieldIdFor(m => m.Value)" @if (settings.Required) { <text> class="required" </text> }>@Model.DisplayName</label>
|
||||
@switch (settings.ListMode) {
|
||||
case ListMode.Dropdown:
|
||||
@Html.DropDownListFor(m => m.Value, new SelectList(options, Model.Value), settings.Required ? new { required = "required" } : null)
|
||||
@Html.DropDownListFor(
|
||||
m => m.Value,
|
||||
new SelectList(options, Model.SelectedValues.FirstOrDefault()),
|
||||
settings.Required ? new { required = "required" } : null)
|
||||
break;
|
||||
|
||||
case ListMode.Radiobutton:
|
||||
foreach (var option in options) {
|
||||
if (string.IsNullOrWhiteSpace(option)) {
|
||||
<label>@Html.RadioButton("Value", "", string.IsNullOrWhiteSpace(Model.Value), settings.Required ? new { required = "required" } : null)<i>@T("unset")</i></label> }
|
||||
<label>@Html.RadioButton(
|
||||
"Value",
|
||||
"",
|
||||
string.IsNullOrWhiteSpace(Model.SelectedValues.FirstOrDefault()),
|
||||
settings.Required ? new { required = "required" } : null)<i>@T("unset")</i>
|
||||
</label>
|
||||
}
|
||||
else {
|
||||
<label>@Html.RadioButton("Value", option, (option == Model.Value), settings.Required ? new { required = "required" } : null)@option</label> }
|
||||
<label>@Html.RadioButton(
|
||||
"Value",
|
||||
option,
|
||||
option == Model.SelectedValues.FirstOrDefault(),
|
||||
settings.Required ? new { required = "required" } : null)@option
|
||||
</label>
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case ListMode.Listbox:
|
||||
<input name="@Html.FieldNameFor(m => m.SelectedValues)" type="hidden" />
|
||||
@Html.ListBoxFor(m => m.SelectedValues, new MultiSelectList(options, Model.SelectedValues), settings.Required ? new { required = "required" } : null)
|
||||
@Html.ListBoxFor(
|
||||
m => m.SelectedValues,
|
||||
new MultiSelectList(options, Model.SelectedValues),
|
||||
settings.Required ? new { required = "required" } : null)
|
||||
break;
|
||||
|
||||
case ListMode.Checkbox:
|
||||
@@ -32,7 +55,9 @@
|
||||
index++;
|
||||
if (!string.IsNullOrWhiteSpace(option)) {
|
||||
<div>
|
||||
<input type="checkbox" name="@Html.FieldNameFor(m => m.SelectedValues)" value="@option" @((Model.SelectedValues != null && Model.SelectedValues.Contains(option)) ? "checked=\"checked\"" : "") class="check-box" id="@Html.FieldIdFor(m => m.SelectedValues)-@index" />
|
||||
<input type="checkbox" name="@Html.FieldNameFor(m => m.SelectedValues)" value="@option"
|
||||
@((Model.SelectedValues != null && Model.SelectedValues.Contains(option)) ? "checked=\"checked\"" : "")
|
||||
class="check-box" id="@Html.FieldIdFor(m => m.SelectedValues)-@index" />
|
||||
<label class="forcheckbox" for="@Html.FieldIdFor(m => m.SelectedValues)-@index">@option</label>
|
||||
</div>
|
||||
}
|
||||
|
@@ -25,7 +25,7 @@
|
||||
</div>
|
||||
<div class="editor-field">
|
||||
@(settings.Required ? Html.TextBoxFor(m => m.Value, new { @class = "text large", required = "required" }) : Html.TextBoxFor(m => m.Value, new { @class = "text large" }))
|
||||
<span class="hint">@T("A valid url, i.e. http://orchardproject.net, /content/file.pdf, ...")</span>
|
||||
<span class="hint">@T("A valid url, i.e. http://orchardproject.net, /content/file.pdf, #some_id, ...")</span>
|
||||
</div>
|
||||
@if (settings.LinkTextMode == LinkTextMode.Optional || settings.LinkTextMode == LinkTextMode.Required) {
|
||||
<div class="editor-label">
|
||||
|
@@ -54,7 +54,7 @@
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
|
||||
|
@@ -54,8 +54,8 @@
|
||||
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
@@ -172,4 +172,4 @@
|
||||
</FlavorProperties>
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
</Project>
|
||||
</Project>
|
@@ -51,7 +51,7 @@
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
|
||||
|
@@ -4,5 +4,5 @@
|
||||
<package id="Microsoft.AspNet.Razor" version="3.2.7" targetFramework="net48" />
|
||||
<package id="Microsoft.AspNet.WebPages" version="3.2.7" targetFramework="net48" />
|
||||
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net48" />
|
||||
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net48" />
|
||||
</packages>
|
||||
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net48" />
|
||||
</packages>
|
@@ -55,7 +55,7 @@
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
|
||||
|
@@ -54,7 +54,7 @@
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
|
||||
|
@@ -4,7 +4,7 @@ using Orchard.Commands;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.Indexing.Services;
|
||||
using Orchard.Tasks.Indexing;
|
||||
using Orchard.Utility.Extensions;
|
||||
using static Orchard.Indexing.Helpers.IndexingHelpers;
|
||||
|
||||
namespace Orchard.Indexing.Commands {
|
||||
public class IndexingCommands : DefaultOrchardCommandHandler {
|
||||
@@ -38,27 +38,22 @@ namespace Orchard.Indexing.Commands {
|
||||
return;
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(index)) {
|
||||
if (!IsValidIndexName(index)) {
|
||||
Context.Output.WriteLine(T("Invalid index name."));
|
||||
return;
|
||||
}
|
||||
|
||||
if (index.ToSafeName() != index) {
|
||||
Context.Output.WriteLine(T("Invalid index name."));
|
||||
var indexProvider = _indexManager.GetSearchIndexProvider();
|
||||
if (indexProvider == null) {
|
||||
Context.Output.WriteLine(T("No indexing service was found. Please enable a module like Lucene."));
|
||||
}
|
||||
else {
|
||||
var indexProvider = _indexManager.GetSearchIndexProvider();
|
||||
if(indexProvider == null) {
|
||||
Context.Output.WriteLine(T("No indexing service was found. Please enable a module like Lucene."));
|
||||
if (indexProvider.Exists(index)) {
|
||||
Context.Output.WriteLine(T("The specified index already exists."));
|
||||
}
|
||||
else {
|
||||
if (indexProvider.Exists(index)) {
|
||||
Context.Output.WriteLine(T("The specified index already exists."));
|
||||
}
|
||||
else {
|
||||
_indexManager.GetSearchIndexProvider().CreateIndex(index);
|
||||
Context.Output.WriteLine(T("New index has been created successfully."));
|
||||
}
|
||||
_indexManager.GetSearchIndexProvider().CreateIndex(index);
|
||||
Context.Output.WriteLine(T("New index has been created successfully."));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -66,7 +61,7 @@ namespace Orchard.Indexing.Commands {
|
||||
[CommandName("index update")]
|
||||
[CommandHelp("index update <index>\r\n\t" + "Updates the specified index")]
|
||||
public void Update(string index) {
|
||||
if (string.IsNullOrWhiteSpace(index)) {
|
||||
if (!IsValidIndexName(index)) {
|
||||
Context.Output.WriteLine(T("Invalid index name."));
|
||||
return;
|
||||
}
|
||||
@@ -78,7 +73,7 @@ namespace Orchard.Indexing.Commands {
|
||||
[CommandName("index rebuild")]
|
||||
[CommandHelp("index rebuild <index> \r\n\t" + "Rebuilds the specified index")]
|
||||
public void Rebuild(string index) {
|
||||
if (string.IsNullOrWhiteSpace(index)) {
|
||||
if (!IsValidIndexName(index)) {
|
||||
Context.Output.WriteLine(T("Invalid index name."));
|
||||
return;
|
||||
}
|
||||
@@ -91,24 +86,24 @@ namespace Orchard.Indexing.Commands {
|
||||
[CommandHelp("index query <index> /Query:<query>\r\n\t" + "Searches the specified <query> terms in the specified index")]
|
||||
[OrchardSwitches("Query")]
|
||||
public void Search(string index) {
|
||||
if (string.IsNullOrWhiteSpace(index)) {
|
||||
if (!IsValidIndexName(index)) {
|
||||
Context.Output.WriteLine(T("Invalid index name."));
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !_indexManager.HasIndexProvider() ) {
|
||||
if (!_indexManager.HasIndexProvider()) {
|
||||
Context.Output.WriteLine(T("No index available"));
|
||||
return;
|
||||
}
|
||||
var searchBuilder = _indexManager.GetSearchIndexProvider().CreateSearchBuilder(index);
|
||||
var results = searchBuilder.Parse( new [] {"body", "title"}, Query).Search();
|
||||
var results = searchBuilder.Parse(new[] { "body", "title" }, Query).Search();
|
||||
|
||||
Context.Output.WriteLine("{0} result{1}\r\n-----------------\r\n", results.Count(), results.Count() > 0 ? "s" : "");
|
||||
|
||||
Context.Output.WriteLine("┌──────────────────────────────────────────────────────────────┬────────┐");
|
||||
Context.Output.WriteLine("│ {0} │ {1,6} │", "Title" + new string(' ', 60 - "Title".Length), "Score");
|
||||
Context.Output.WriteLine("├──────────────────────────────────────────────────────────────┼────────┤");
|
||||
foreach ( var searchHit in results ) {
|
||||
foreach (var searchHit in results) {
|
||||
var contentItem = _contentManager.Get(searchHit.ContentItemId);
|
||||
var metadata = _contentManager.GetItemMetadata(contentItem);
|
||||
var title = String.IsNullOrWhiteSpace(metadata.DisplayText) ? "- no title -" : metadata.DisplayText;
|
||||
@@ -126,12 +121,12 @@ namespace Orchard.Indexing.Commands {
|
||||
[CommandHelp("index stats <index>\r\n\t" + "Displays some statistics about the search index")]
|
||||
[OrchardSwitches("IndexName")]
|
||||
public void Stats(string index) {
|
||||
if (string.IsNullOrWhiteSpace(index)) {
|
||||
if (!IsValidIndexName(index)) {
|
||||
Context.Output.WriteLine(T("Invalid index name."));
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !_indexManager.HasIndexProvider() ) {
|
||||
if (!_indexManager.HasIndexProvider()) {
|
||||
Context.Output.WriteLine(T("No index available"));
|
||||
return;
|
||||
}
|
||||
@@ -140,11 +135,10 @@ namespace Orchard.Indexing.Commands {
|
||||
}
|
||||
|
||||
[CommandName("index refresh")]
|
||||
[CommandHelp("index refresh /ContentItem:<content item id> \r\n\t" + "Refreshes the index for the specifed <content item id>")]
|
||||
[CommandHelp("index refresh /ContentItem:<content item id> \r\n\t" + "Refreshes the index for the specified <content item id>")]
|
||||
[OrchardSwitches("ContentItem")]
|
||||
public void Refresh() {
|
||||
int contentItemId;
|
||||
if ( !int.TryParse(ContentItem, out contentItemId) ) {
|
||||
if (!int.TryParse(ContentItem, out int contentItemId)) {
|
||||
Context.Output.WriteLine(T("Invalid content item id. Not an integer."));
|
||||
return;
|
||||
}
|
||||
@@ -152,19 +146,18 @@ namespace Orchard.Indexing.Commands {
|
||||
var contentItem = _contentManager.Get(contentItemId);
|
||||
_indexingTaskManager.CreateUpdateIndexTask(contentItem);
|
||||
|
||||
Context.Output.WriteLine(T("Content Item marked for reindexing"));
|
||||
Context.Output.WriteLine(T("Content Item marked for re-indexing"));
|
||||
}
|
||||
|
||||
[CommandName("index delete")]
|
||||
[CommandHelp("index delete /ContentItem:<content item id>\r\n\t" + "Deletes the specifed <content item id> from the index")]
|
||||
[CommandHelp("index delete /ContentItem:<content item id>\r\n\t" + "Deletes the specified <content item id> from the index")]
|
||||
[OrchardSwitches("ContentItem")]
|
||||
public void Delete() {
|
||||
int contentItemId;
|
||||
if(!int.TryParse(ContentItem, out contentItemId)) {
|
||||
if (!int.TryParse(ContentItem, out int contentItemId)) {
|
||||
Context.Output.WriteLine(T("Invalid content item id. Not an integer."));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var contentItem = _contentManager.Get(contentItemId);
|
||||
_indexingTaskManager.CreateDeleteIndexTask(contentItem);
|
||||
|
||||
|
@@ -2,12 +2,12 @@
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using Orchard.Indexing.Services;
|
||||
using Orchard.Indexing.ViewModels;
|
||||
using Orchard.Localization;
|
||||
using Orchard.Logging;
|
||||
using Orchard.Security;
|
||||
using Orchard.Indexing.ViewModels;
|
||||
using Orchard.UI.Notify;
|
||||
using Orchard.Utility.Extensions;
|
||||
using static Orchard.Indexing.Helpers.IndexingHelpers;
|
||||
|
||||
namespace Orchard.Indexing.Controllers {
|
||||
public class AdminController : Controller {
|
||||
@@ -15,7 +15,7 @@ namespace Orchard.Indexing.Controllers {
|
||||
private readonly IIndexManager _indexManager;
|
||||
|
||||
public AdminController(
|
||||
IIndexingService indexingService,
|
||||
IIndexingService indexingService,
|
||||
IOrchardServices services,
|
||||
IIndexManager indexManager) {
|
||||
_indexingService = indexingService;
|
||||
@@ -34,23 +34,21 @@ namespace Orchard.Indexing.Controllers {
|
||||
IndexEntries = Enumerable.Empty<IndexEntry>(),
|
||||
IndexProvider = _indexManager.GetSearchIndexProvider()
|
||||
};
|
||||
|
||||
|
||||
if (_indexManager.HasIndexProvider()) {
|
||||
viewModel.IndexEntries = _indexManager.GetSearchIndexProvider().List().Select(x => {
|
||||
try {
|
||||
return _indexingService.GetIndexEntry(x);
|
||||
}
|
||||
catch(Exception e) {
|
||||
catch (Exception e) {
|
||||
Logger.Error(e, "Index couldn't be read: " + x);
|
||||
return new IndexEntry {
|
||||
return new IndexEntry {
|
||||
IndexName = x,
|
||||
IndexingStatus = IndexingStatus.Unavailable
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Services.Notifier.Information(T("The index might be corrupted. If you can't recover click on Rebuild."));
|
||||
|
||||
return View(viewModel);
|
||||
}
|
||||
@@ -59,7 +57,7 @@ namespace Orchard.Indexing.Controllers {
|
||||
if (!Services.Authorizer.Authorize(StandardPermissions.SiteOwner, T("Not allowed to manage the search index.")))
|
||||
return new HttpUnauthorizedResult();
|
||||
|
||||
return View("Create", String.Empty);
|
||||
return View("Create");
|
||||
}
|
||||
|
||||
[HttpPost, ActionName("Create")]
|
||||
@@ -68,7 +66,7 @@ namespace Orchard.Indexing.Controllers {
|
||||
return new HttpUnauthorizedResult();
|
||||
|
||||
var provider = _indexManager.GetSearchIndexProvider();
|
||||
if (String.IsNullOrWhiteSpace(id) || id.ToSafeName() != id) {
|
||||
if (!IsValidIndexName(id)) {
|
||||
Services.Notifier.Error(T("Invalid index name."));
|
||||
return View("Create", id);
|
||||
}
|
||||
@@ -82,9 +80,9 @@ namespace Orchard.Indexing.Controllers {
|
||||
provider.CreateIndex(id);
|
||||
Services.Notifier.Information(T("Index named {0} created successfully", id));
|
||||
}
|
||||
catch(Exception e) {
|
||||
catch (Exception e) {
|
||||
Services.Notifier.Error(T("An error occurred while creating the index: {0}", id));
|
||||
Logger.Error("An error occurred while creatign the index " + id, e);
|
||||
Logger.Error("An error occurred while creating the index " + id, e);
|
||||
return View("Create", id);
|
||||
}
|
||||
|
||||
@@ -96,7 +94,12 @@ namespace Orchard.Indexing.Controllers {
|
||||
if (!Services.Authorizer.Authorize(StandardPermissions.SiteOwner, T("Not allowed to manage the search index.")))
|
||||
return new HttpUnauthorizedResult();
|
||||
|
||||
_indexingService.UpdateIndex(id);
|
||||
if (IsValidIndexName(id)) {
|
||||
_indexingService.UpdateIndex(id);
|
||||
}
|
||||
else {
|
||||
Services.Notifier.Error(T("Invalid index name."));
|
||||
}
|
||||
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
@@ -106,7 +109,12 @@ namespace Orchard.Indexing.Controllers {
|
||||
if (!Services.Authorizer.Authorize(StandardPermissions.SiteOwner, T("Not allowed to manage the search index.")))
|
||||
return new HttpUnauthorizedResult();
|
||||
|
||||
_indexingService.RebuildIndex(id);
|
||||
if (IsValidIndexName(id)) {
|
||||
_indexingService.RebuildIndex(id);
|
||||
}
|
||||
else {
|
||||
Services.Notifier.Error(T("Invalid index name."));
|
||||
}
|
||||
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
@@ -116,7 +124,12 @@ namespace Orchard.Indexing.Controllers {
|
||||
if (!Services.Authorizer.Authorize(StandardPermissions.SiteOwner, T("Not allowed to manage the search index.")))
|
||||
return new HttpUnauthorizedResult();
|
||||
|
||||
_indexingService.DeleteIndex(id);
|
||||
if (IsValidIndexName(id)) {
|
||||
_indexingService.DeleteIndex(id);
|
||||
}
|
||||
else {
|
||||
Services.Notifier.Error(T("Invalid index name."));
|
||||
}
|
||||
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
|
@@ -0,0 +1,8 @@
|
||||
using Orchard.Utility.Extensions;
|
||||
|
||||
namespace Orchard.Indexing.Helpers {
|
||||
public static class IndexingHelpers {
|
||||
public static bool IsValidIndexName(string name) =>
|
||||
!string.IsNullOrWhiteSpace(name) && name.ToSafeName() == name;
|
||||
}
|
||||
}
|
@@ -95,6 +95,7 @@
|
||||
<Compile Include="AdminMenu.cs" />
|
||||
<Compile Include="Commands\IndexingCommands.cs" />
|
||||
<Compile Include="Controllers\AdminController.cs" />
|
||||
<Compile Include="Helpers\IndexingHelpers.cs" />
|
||||
<Compile Include="Migrations.cs" />
|
||||
<Compile Include="Handlers\CreateIndexingTaskHandler.cs" />
|
||||
<Compile Include="Handlers\InfosetFieldIndexingHandler.cs" />
|
||||
@@ -180,4 +181,4 @@
|
||||
</FlavorProperties>
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
</Project>
|
||||
</Project>
|
@@ -54,7 +54,7 @@
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
|
||||
|
@@ -60,8 +60,8 @@
|
||||
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
@@ -196,4 +196,4 @@
|
||||
</FlavorProperties>
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
</Project>
|
||||
</Project>
|
@@ -55,7 +55,7 @@
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
|
||||
|
@@ -5,5 +5,5 @@
|
||||
<package id="Microsoft.AspNet.WebPages" version="3.2.7" targetFramework="net48" />
|
||||
<package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="4.1.0" targetFramework="net48" />
|
||||
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net48" />
|
||||
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net48" />
|
||||
</packages>
|
||||
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net48" />
|
||||
</packages>
|
@@ -58,8 +58,8 @@
|
||||
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
|
@@ -1101,17 +1101,17 @@ html.dyn #submit-pager, html.dyn .apply-bulk-actions-auto { display:none; }
|
||||
padding:0;
|
||||
}
|
||||
|
||||
fieldset.publish-button, fieldset.delete-button, fieldset.save-button {
|
||||
fieldset.publish-button, fieldset.delete-button, fieldset.save-button, fieldset.unpublish-button {
|
||||
clear:none;
|
||||
float:left;
|
||||
}
|
||||
fieldset.save-button {
|
||||
clear:left;
|
||||
}
|
||||
fieldset.publish-button {
|
||||
fieldset.publish-button, fieldset.unpublish-button {
|
||||
margin: 0 12px 0 0;
|
||||
padding: 0 12px;
|
||||
border-right:1px solid #ccc;
|
||||
border-right: 1px solid #ccc;
|
||||
}
|
||||
fieldset.delete-button {
|
||||
margin: 0 0 0 12px;
|
||||
|
@@ -43,7 +43,7 @@
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Autofac" publicKeyToken="17863af14b0044da" culture="neutral" />
|
||||
@@ -69,6 +69,22 @@
|
||||
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
|
||||
<bindingRedirect oldVersion="1.0.0.0-5.2.7.0" newVersion="5.2.7.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.5.0" newVersion="4.1.5.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.4.0" newVersion="4.0.4.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<system.codedom>
|
||||
|
@@ -7,6 +7,6 @@
|
||||
<package id="Microsoft.AspNet.WebPages" version="3.2.7" targetFramework="net48" />
|
||||
<package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="4.1.0" targetFramework="net48" />
|
||||
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net48" />
|
||||
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net48" />
|
||||
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net48" />
|
||||
<package id="YamlDotNet" version="11.1.1" targetFramework="net48" />
|
||||
</packages>
|
@@ -1,98 +1,15 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.Core.Containers.Models;
|
||||
using Orchard.Core.Containers.Services;
|
||||
using Orchard.Localization;
|
||||
using Orchard.Security;
|
||||
using Orchard.Localization;
|
||||
using Orchard.UI.Navigation;
|
||||
using Orchard.Utility.Extensions;
|
||||
|
||||
namespace Orchard.Lists {
|
||||
public class AdminMenu : INavigationProvider {
|
||||
private readonly IContainerService _containerService;
|
||||
private readonly IContentManager _contentManager;
|
||||
private readonly IAuthorizationService _authorizationService;
|
||||
private readonly IWorkContextAccessor _workContextAccessor;
|
||||
|
||||
public AdminMenu(
|
||||
IContainerService containerService,
|
||||
IContentManager contentManager,
|
||||
IAuthorizationService authorizationService,
|
||||
IWorkContextAccessor workContextAccessor
|
||||
) {
|
||||
_containerService = containerService;
|
||||
_contentManager = contentManager;
|
||||
_authorizationService = authorizationService;
|
||||
_workContextAccessor = workContextAccessor;
|
||||
}
|
||||
|
||||
public Localizer T { get; set; }
|
||||
public string MenuName { get { return "admin"; } }
|
||||
|
||||
public void GetNavigation(NavigationBuilder builder) {
|
||||
builder.AddImageSet("list");
|
||||
|
||||
CreateListManagementMenuItem(builder);
|
||||
CreateListMenuItems(builder);
|
||||
}
|
||||
|
||||
private void CreateListManagementMenuItem(NavigationBuilder builder) {
|
||||
builder.Add(T("Lists"), "11", item => item
|
||||
.Action("Index", "Admin", new {area = "Orchard.Lists"}).Permission(Permissions.ManageLists)
|
||||
);
|
||||
}
|
||||
|
||||
private void CreateListMenuItems(NavigationBuilder builder) {
|
||||
var containers = _containerService
|
||||
.GetContainersQuery(VersionOptions.Latest)
|
||||
.Where<ContainerPartRecord>(x => x.ShowOnAdminMenu)
|
||||
.List()
|
||||
.Where(x => _authorizationService.TryCheckAccess(Orchard.Core.Contents.Permissions.EditContent, _workContextAccessor.GetContext().CurrentUser, x))
|
||||
.ToList();
|
||||
|
||||
foreach (var container in containers) {
|
||||
var closureContainer = container;
|
||||
|
||||
if (!String.IsNullOrWhiteSpace(container.AdminMenuImageSet)) {
|
||||
builder.AddImageSet(container.AdminMenuImageSet.Trim());
|
||||
}
|
||||
|
||||
builder.Add(T(container.AdminMenuText), container.AdminMenuPosition, item => {
|
||||
var containedItems = _containerService.GetContentItems(closureContainer.Id, VersionOptions.Latest).ToList();
|
||||
var actualContainer = closureContainer;
|
||||
var position = 0;
|
||||
|
||||
// If the list has just a single item that happens to be a container itself,
|
||||
// we will treat that one as the actual container to provide a nice & quick way to manage that list.
|
||||
if (containedItems.Count == 1) {
|
||||
var containedItem = containedItems.First().As<ContainerPart>();
|
||||
|
||||
if (containedItem != null) {
|
||||
actualContainer = containedItem;
|
||||
foreach (var itemContentType in containedItem.ItemContentTypes) {
|
||||
var closureItemContentType = itemContentType;
|
||||
item.Add(T("New {0}", itemContentType.DisplayName), String.Format("1.{0}", position++), subItem => subItem
|
||||
.Action("Create", "Admin", new { id = closureItemContentType.Name, containerid = containedItem.Id, area = "Contents" }));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var containerMetadata = _contentManager.GetItemMetadata(actualContainer);
|
||||
item.Action(containerMetadata.AdminRouteValues);
|
||||
|
||||
item.Action(containerMetadata.AdminRouteValues);
|
||||
item.AddClass("nav-list");
|
||||
item.AddClass(closureContainer.AdminMenuText.HtmlClassify());
|
||||
item.LinkToFirstChild(false);
|
||||
|
||||
foreach (var itemContentType in closureContainer.ItemContentTypes) {
|
||||
var closureItemContentType = itemContentType;
|
||||
item.Add(T("New {0}", itemContentType.DisplayName), String.Format("1.{0}", position++), subItem => subItem
|
||||
.Action("Create", "Admin", new { id = closureItemContentType.Name, containerid = container.Id, area = "Contents" }));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
public void GetNavigation(NavigationBuilder builder) =>
|
||||
builder
|
||||
.AddImageSet("lists")
|
||||
.Add(T("Lists"), "11", item => item
|
||||
.Action("Index", "Admin", new { area = "Orchard.Lists" }).Permission(Permissions.ManageLists));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -115,6 +115,7 @@
|
||||
<Content Include="Styles\images\icons.png" />
|
||||
<Content Include="Styles\images\view.default.png" />
|
||||
<Content Include="Styles\images\view.condensed.png" />
|
||||
<Content Include="Styles\menu.lists-admin.css" />
|
||||
<Content Include="Styles\nprogress.css" />
|
||||
<Content Include="Scripts\nprogress.js" />
|
||||
<Content Include="Scripts\orchard-lists-admin.js" />
|
||||
@@ -143,16 +144,14 @@
|
||||
<Content Include="Scripts\orchard-lists-admin.min.js">
|
||||
<DependentUpon>orchard-lists-admin.js</DependentUpon>
|
||||
</Content>
|
||||
<Content Include="Styles\images\menu.list-definition.png" />
|
||||
<Content Include="Styles\images\menu.lists.png" />
|
||||
<Content Include="Styles\images\move.gif" />
|
||||
<Content Include="Styles\images\offline.gif" />
|
||||
<Content Include="Styles\images\online.gif" />
|
||||
<Content Include="Styles\list-admin.css" />
|
||||
<Content Include="Styles\images\menu.list.png" />
|
||||
<Content Include="Styles\list-admin.min.css">
|
||||
<DependentUpon>list-admin.css</DependentUpon>
|
||||
</Content>
|
||||
<Content Include="Styles\menu.list-admin.css" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Web.config">
|
||||
@@ -272,4 +271,4 @@
|
||||
</FlavorProperties>
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
</Project>
|
||||
</Project>
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user