mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Merge branch 'master' into 1.x
Conflicts: ClickToBuildAzurePackage.cmd src/Orchard.Azure/Orchard.Azure.Web/Web.config src/Orchard.Web/Modules/Orchard.CustomForms/Controllers/ItemController.cs src/Orchard.Web/Modules/SysCache/Web.config src/Orchard.Web/Orchard.Web.csproj
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>2.1</ProductVersion>
|
||||
<ProductVersion>2.2</ProductVersion>
|
||||
<ProjectGuid>{03c5327d-4e8e-45a7-acd1-e18e7caa3c4a}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
@@ -63,7 +63,7 @@
|
||||
<!-- Import the target files for this project template -->
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
||||
<CloudExtensionsDir Condition=" '$(CloudExtensionsDir)' == '' ">$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Windows Azure Tools\2.1\</CloudExtensionsDir>
|
||||
<CloudExtensionsDir Condition=" '$(CloudExtensionsDir)' == '' ">$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Windows Azure Tools\2.2\</CloudExtensionsDir>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(CloudExtensionsDir)Microsoft.WindowsAzure.targets" />
|
||||
<!-- The BeforeAddRoleContent override ensures that content in themes and modules get added
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ServiceConfiguration serviceName="OrchardCloudService" osFamily="3" osVersion="*" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" schemaVersion="2013-03.2.0">
|
||||
<ServiceConfiguration serviceName="OrchardCloudService" osFamily="3" osVersion="*" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" schemaVersion="2013-10.2.2">
|
||||
<Role name="Orchard.Azure.Web">
|
||||
<Instances count="1" />
|
||||
<ConfigurationSettings>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ServiceDefinition name="OrchardCloudService" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2013-03.2.0">
|
||||
<ServiceDefinition name="OrchardCloudService" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2013-10.2.2">
|
||||
<WebRole name="Orchard.Azure.Web">
|
||||
<Sites>
|
||||
<Site name="Web">
|
||||
|
||||
@@ -89,13 +89,11 @@
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\lib\windowsazure\Microsoft.WindowsAzure.Configuration.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsAzure.Diagnostics, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\lib\windowsazure\Microsoft.WindowsAzure.Diagnostics.dll</HintPath>
|
||||
<Reference Include="Microsoft.WindowsAzure.Diagnostics, Version=2.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsAzure.ServiceRuntime, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\lib\windowsazure\Microsoft.WindowsAzure.ServiceRuntime.dll</HintPath>
|
||||
<Reference Include="Microsoft.WindowsAzure.ServiceRuntime, Version=2.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsAzure.Storage, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
<system.diagnostics>
|
||||
<trace>
|
||||
<listeners>
|
||||
<add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics">
|
||||
<add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=2.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics">
|
||||
<filter type=""/>
|
||||
</add>
|
||||
</listeners>
|
||||
|
||||
@@ -30,5 +30,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.7.1")]
|
||||
[assembly: AssemblyFileVersion("1.7.1")]
|
||||
[assembly: AssemblyVersion("1.7.2")]
|
||||
[assembly: AssemblyFileVersion("1.7.2")]
|
||||
|
||||
@@ -30,5 +30,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.7.1")]
|
||||
[assembly: AssemblyFileVersion("1.7.1")]
|
||||
[assembly: AssemblyVersion("1.7.2")]
|
||||
[assembly: AssemblyFileVersion("1.7.2")]
|
||||
|
||||
@@ -30,5 +30,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.7.1")]
|
||||
[assembly: AssemblyFileVersion("1.7.1")]
|
||||
[assembly: AssemblyVersion("1.7.2")]
|
||||
[assembly: AssemblyFileVersion("1.7.2")]
|
||||
|
||||
@@ -483,6 +483,22 @@ namespace Orchard.Tests.Modules.Indexing {
|
||||
Assert.That(SearchBuilder.Parse("body", "*@!woo*@!").Count(), Is.EqualTo(0));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ShouldSearchFolderStructure() {
|
||||
_provider.CreateIndex("default");
|
||||
_provider.Store("default", _provider.New(1).Add("media-path", "images").Store());
|
||||
_provider.Store("default", _provider.New(2).Add("media-path", "images/pets/puppies").Store());
|
||||
_provider.Store("default", _provider.New(3).Add("media-path", "images/pets/kitties").Store());
|
||||
|
||||
// Assert.That(SearchBuilder.WithField("media-path", "Pets").Mandatory().Count(), Is.EqualTo(0));
|
||||
Assert.That(SearchBuilder.WithField("media-path", "Images").Mandatory().Count(), Is.EqualTo(3));
|
||||
Assert.That(SearchBuilder.WithField("media-path", "Images").ExactMatch().Mandatory().Count(), Is.EqualTo(1));
|
||||
Assert.That(SearchBuilder.WithField("media-path", "Images/Pets").Mandatory().Count(), Is.EqualTo(2));
|
||||
Assert.That(SearchBuilder.WithField("media-path", "Images/Pets").ExactMatch().Mandatory().Count(), Is.EqualTo(0));
|
||||
Assert.That(SearchBuilder.WithField("media-path", "Images/Pets/Puppies").ExactMatch().Mandatory().Count(), Is.EqualTo(1));
|
||||
Assert.That(SearchBuilder.WithField("media-path", "Images/Pets/Puppies").Mandatory().Count(), Is.EqualTo(1));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void FieldsCanContainMultipleValue() {
|
||||
_provider.CreateIndex("default");
|
||||
@@ -658,5 +674,75 @@ namespace Orchard.Tests.Modules.Indexing {
|
||||
Assert.That(speak.Or(michael).Count(), Is.EqualTo(4));
|
||||
Assert.That(speak.Xor(michael).Count(), Is.EqualTo(3));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ShouldAcceptNoMin() {
|
||||
_provider.CreateIndex("default");
|
||||
_provider.Store("default", _provider.New(1).Add("string", "foo"));
|
||||
_provider.Store("default", _provider.New(2).Add("date", new DateTime(2010, 05, 28, 12, 30, 30)));
|
||||
_provider.Store("default", _provider.New(3).Add("number", 123.456));
|
||||
_provider.Store("default", _provider.New(4).Add("integer", 123));
|
||||
|
||||
Assert.That(SearchBuilder.WithinRange("string", null, "foobar").Count(), Is.EqualTo(1));
|
||||
Assert.That(SearchBuilder.WithinRange("date", null, new DateTime(2010, 05, 29, 12, 30, 30)).Count(), Is.EqualTo(1));
|
||||
Assert.That(SearchBuilder.WithinRange("number", null, 123.4567).Count(), Is.EqualTo(1));
|
||||
Assert.That(SearchBuilder.WithinRange("integer", null, 124).Count(), Is.EqualTo(1));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ShouldAcceptNoMax() {
|
||||
_provider.CreateIndex("default");
|
||||
_provider.Store("default", _provider.New(1).Add("string", "foo"));
|
||||
_provider.Store("default", _provider.New(2).Add("date", new DateTime(2010, 05, 28, 12, 30, 30)));
|
||||
_provider.Store("default", _provider.New(3).Add("number", 123.456));
|
||||
_provider.Store("default", _provider.New(4).Add("integer", 123));
|
||||
|
||||
Assert.That(SearchBuilder.WithinRange("string", "fo", null).Count(), Is.EqualTo(1));
|
||||
Assert.That(SearchBuilder.WithinRange("date", new DateTime(2010, 05, 27, 12, 30, 30), null).Count(), Is.EqualTo(1));
|
||||
Assert.That(SearchBuilder.WithinRange("number", 123.45, null).Count(), Is.EqualTo(1));
|
||||
Assert.That(SearchBuilder.WithinRange("integer", 122, null).Count(), Is.EqualTo(1));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ShouldIncludeBoudaries() {
|
||||
_provider.CreateIndex("default");
|
||||
_provider.Store("default", _provider.New(1).Add("string", "foo"));
|
||||
_provider.Store("default", _provider.New(2).Add("date", new DateTime(2010, 05, 28, 12, 30, 30)));
|
||||
_provider.Store("default", _provider.New(3).Add("number", 123.456));
|
||||
_provider.Store("default", _provider.New(4).Add("integer", 123));
|
||||
|
||||
Assert.That(SearchBuilder.WithinRange("string", "foo", null).Count(), Is.EqualTo(1));
|
||||
Assert.That(SearchBuilder.WithinRange("date", new DateTime(2010, 05, 28, 12, 30, 30), null).Count(), Is.EqualTo(1));
|
||||
Assert.That(SearchBuilder.WithinRange("number", 123.456, null).Count(), Is.EqualTo(1));
|
||||
Assert.That(SearchBuilder.WithinRange("integer", 123, null).Count(), Is.EqualTo(1));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ShouldNotIncludeLowerBoudary() {
|
||||
_provider.CreateIndex("default");
|
||||
_provider.Store("default", _provider.New(1).Add("string", "foo"));
|
||||
_provider.Store("default", _provider.New(2).Add("date", new DateTime(2010, 05, 28, 12, 30, 30)));
|
||||
_provider.Store("default", _provider.New(3).Add("number", 123.456));
|
||||
_provider.Store("default", _provider.New(4).Add("integer", 123));
|
||||
|
||||
Assert.That(SearchBuilder.WithinRange("string", "foo", null, false).Count(), Is.EqualTo(0));
|
||||
Assert.That(SearchBuilder.WithinRange("date", new DateTime(2010, 05, 28, 12, 30, 30), null, false).Count(), Is.EqualTo(0));
|
||||
Assert.That(SearchBuilder.WithinRange("number", 123.456, null, false).Count(), Is.EqualTo(0));
|
||||
Assert.That(SearchBuilder.WithinRange("integer", 123, null, false).Count(), Is.EqualTo(0));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ShouldNotIncludeUpperBoudary() {
|
||||
_provider.CreateIndex("default");
|
||||
_provider.Store("default", _provider.New(1).Add("string", "foo"));
|
||||
_provider.Store("default", _provider.New(2).Add("date", new DateTime(2010, 05, 28, 12, 30, 30)));
|
||||
_provider.Store("default", _provider.New(3).Add("number", 123.456));
|
||||
_provider.Store("default", _provider.New(4).Add("integer", 123));
|
||||
|
||||
Assert.That(SearchBuilder.WithinRange("string", null, "foo", true, false).Count(), Is.EqualTo(0));
|
||||
Assert.That(SearchBuilder.WithinRange("date", null, new DateTime(2010, 05, 28, 12, 30, 30), true, false).Count(), Is.EqualTo(0));
|
||||
Assert.That(SearchBuilder.WithinRange("number", null, 123.456, true, false).Count(), Is.EqualTo(0));
|
||||
Assert.That(SearchBuilder.WithinRange("integer", null, 123, true, false).Count(), Is.EqualTo(0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,5 +30,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.7.1")]
|
||||
[assembly: AssemblyFileVersion("1.7.1")]
|
||||
[assembly: AssemblyVersion("1.7.2")]
|
||||
[assembly: AssemblyFileVersion("1.7.2")]
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
using NUnit.Framework;
|
||||
using Orchard.DisplayManagement.Descriptors;
|
||||
|
||||
namespace Orchard.Tests.DisplayManagement.Descriptors {
|
||||
[TestFixture]
|
||||
public class LocationParserTests : ContainerTestBase {
|
||||
|
||||
[Test]
|
||||
public void ZoneShouldBeParsed() {
|
||||
Assert.That(new PlacementInfo { Location = "/Content" }.GetZone(), Is.EqualTo("Content"));
|
||||
Assert.That(new PlacementInfo { Location = "Content" }.GetZone(), Is.EqualTo("Content"));
|
||||
Assert.That(new PlacementInfo { Location = "Content:5" }.GetZone(), Is.EqualTo("Content"));
|
||||
Assert.That(new PlacementInfo { Location = "Content:5#Tab1" }.GetZone(), Is.EqualTo("Content"));
|
||||
Assert.That(new PlacementInfo { Location = "Content:5@Group1" }.GetZone(), Is.EqualTo("Content"));
|
||||
Assert.That(new PlacementInfo { Location = "Content:5@Group1#Tab1" }.GetZone(), Is.EqualTo("Content"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void PositionShouldBeParsed() {
|
||||
Assert.That(new PlacementInfo { Location = "Content" }.GetPosition(), Is.EqualTo(""));
|
||||
Assert.That(new PlacementInfo { Location = "Content:5" }.GetPosition(), Is.EqualTo("5"));
|
||||
Assert.That(new PlacementInfo { Location = "Content:5#Tab1" }.GetPosition(), Is.EqualTo("5"));
|
||||
Assert.That(new PlacementInfo { Location = "Content:5.1#Tab1" }.GetPosition(), Is.EqualTo("5.1"));
|
||||
Assert.That(new PlacementInfo { Location = "Content:5@Group1" }.GetPosition(), Is.EqualTo("5"));
|
||||
Assert.That(new PlacementInfo { Location = "Content:5@Group1#Tab1" }.GetPosition(), Is.EqualTo("5"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void LayoutZoneShouldBeParsed() {
|
||||
Assert.That(new PlacementInfo { Location = "/Content" }.IsLayoutZone(), Is.EqualTo(true));
|
||||
Assert.That(new PlacementInfo { Location = "/Content:5" }.IsLayoutZone(), Is.EqualTo(true));
|
||||
Assert.That(new PlacementInfo { Location = "Content:5#Tab1" }.IsLayoutZone(), Is.EqualTo(false));
|
||||
Assert.That(new PlacementInfo { Location = "Content:5.1#Tab1" }.IsLayoutZone(), Is.EqualTo(false));
|
||||
Assert.That(new PlacementInfo { Location = "Content:5@Group1" }.IsLayoutZone(), Is.EqualTo(false));
|
||||
Assert.That(new PlacementInfo { Location = "Content:5@Group1#Tab1" }.IsLayoutZone(), Is.EqualTo(false));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TabShouldBeParsed() {
|
||||
Assert.That(new PlacementInfo { Location = "Content" }.GetTab(), Is.EqualTo(""));
|
||||
Assert.That(new PlacementInfo { Location = "Content:5" }.GetTab(), Is.EqualTo(""));
|
||||
Assert.That(new PlacementInfo { Location = "Content:5#Tab1" }.GetTab(), Is.EqualTo("Tab1"));
|
||||
Assert.That(new PlacementInfo { Location = "Content:5.1#Tab1" }.GetTab(), Is.EqualTo("Tab1"));
|
||||
Assert.That(new PlacementInfo { Location = "Content:5@Group1" }.GetTab(), Is.EqualTo(""));
|
||||
Assert.That(new PlacementInfo { Location = "Content:5@Group1#Tab1" }.GetTab(), Is.EqualTo("Tab1"));
|
||||
Assert.That(new PlacementInfo { Location = "Content:5#Tab1@Group1" }.GetTab(), Is.EqualTo("Tab1"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void GroupShouldBeParsed() {
|
||||
Assert.That(new PlacementInfo { Location = "Content" }.GetGroup(), Is.EqualTo(""));
|
||||
Assert.That(new PlacementInfo { Location = "Content:5" }.GetGroup(), Is.EqualTo(""));
|
||||
Assert.That(new PlacementInfo { Location = "Content:5#Tab1" }.GetGroup(), Is.EqualTo(""));
|
||||
Assert.That(new PlacementInfo { Location = "Content:5.1#Tab1" }.GetGroup(), Is.EqualTo(""));
|
||||
Assert.That(new PlacementInfo { Location = "Content:5@Group1" }.GetGroup(), Is.EqualTo("Group1"));
|
||||
Assert.That(new PlacementInfo { Location = "Content:5@Group1#Tab1" }.GetGroup(), Is.EqualTo("Group1"));
|
||||
Assert.That(new PlacementInfo { Location = "Content:5#Tab1@Group1" }.GetGroup(), Is.EqualTo("Group1"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -182,6 +182,19 @@ namespace Orchard.Tests.Environment {
|
||||
var settingsA = new ShellSettings { Name = "Alpha", RequestUrlHost = "example.com" };
|
||||
table.Add(settings);
|
||||
table.Add(settingsA);
|
||||
Assert.That(table.Match(new StubHttpContext("~/foo/bar", "www.example.com")), Is.EqualTo(settings).Using(new ShellComparer()));
|
||||
Assert.That(table.Match(new StubHttpContext("~/foo/bar", "wiki.example.com")), Is.EqualTo(settings).Using(new ShellComparer()));
|
||||
Assert.That(table.Match(new StubHttpContext("~/foo/bar", "example.com")), Is.EqualTo(settingsA).Using(new ShellComparer()));
|
||||
Assert.That(table.Match(new StubHttpContext("~/foo/bar", "localhost")), Is.EqualTo(settings).Using(new ShellComparer()));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void HostNameMatchesRightmostIfStar() {
|
||||
var table = (IRunningShellTable)new RunningShellTable();
|
||||
var settings = new ShellSettings { Name = ShellSettings.DefaultName };
|
||||
var settingsA = new ShellSettings { Name = "Alpha", RequestUrlHost = "*.example.com" };
|
||||
table.Add(settings);
|
||||
table.Add(settingsA);
|
||||
Assert.That(table.Match(new StubHttpContext("~/foo/bar", "www.example.com")), Is.EqualTo(settingsA).Using(new ShellComparer()));
|
||||
Assert.That(table.Match(new StubHttpContext("~/foo/bar", "wiki.example.com")), Is.EqualTo(settingsA).Using(new ShellComparer()));
|
||||
Assert.That(table.Match(new StubHttpContext("~/foo/bar", "example.com")), Is.EqualTo(settingsA).Using(new ShellComparer()));
|
||||
@@ -193,7 +206,7 @@ namespace Orchard.Tests.Environment {
|
||||
var table = (IRunningShellTable) new RunningShellTable();
|
||||
var settings = new ShellSettings { Name = ShellSettings.DefaultName };
|
||||
var settingsA = new ShellSettings { Name = "Alpha", RequestUrlHost = "www.example.com" };
|
||||
var settingsB = new ShellSettings { Name = "Beta", RequestUrlHost = "example.com" };
|
||||
var settingsB = new ShellSettings { Name = "Beta", RequestUrlHost = "*.example.com" };
|
||||
var settingsG = new ShellSettings { Name = "Gamma", RequestUrlHost = "wiki.example.com" };
|
||||
table.Add(settings);
|
||||
table.Add(settingsA);
|
||||
|
||||
@@ -220,6 +220,7 @@
|
||||
<Compile Include="Data\StubLocator.cs" />
|
||||
<Compile Include="DisplayManagement\ArgsUtility.cs" />
|
||||
<Compile Include="DisplayManagement\CompositeTests.cs" />
|
||||
<Compile Include="DisplayManagement\Descriptors\LocationParserTests.cs" />
|
||||
<Compile Include="DisplayManagement\NilTests.cs" />
|
||||
<Compile Include="DisplayManagement\ZoneHoldingTests.cs" />
|
||||
<Compile Include="DisplayManagement\DefaultDisplayManagerTests.cs" />
|
||||
|
||||
@@ -34,5 +34,5 @@ using System.Runtime.InteropServices;
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
|
||||
[assembly: AssemblyVersion("1.7.1")]
|
||||
[assembly: AssemblyFileVersion("1.7.1")]
|
||||
[assembly: AssemblyVersion("1.7.2")]
|
||||
[assembly: AssemblyFileVersion("1.7.2")]
|
||||
|
||||
@@ -32,8 +32,8 @@ using System.Security;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.7.1")]
|
||||
[assembly: AssemblyFileVersion("1.7.1")]
|
||||
[assembly: AssemblyVersion("1.7.2")]
|
||||
[assembly: AssemblyFileVersion("1.7.2")]
|
||||
|
||||
// Enable web application to call this assembly in Full Trust
|
||||
[assembly: AllowPartiallyTrustedCallers]
|
||||
|
||||
@@ -33,5 +33,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly: AssemblyVersion("1.7.1")]
|
||||
[assembly: AssemblyFileVersion("1.7.1")]
|
||||
[assembly: AssemblyVersion("1.7.2")]
|
||||
[assembly: AssemblyFileVersion("1.7.2")]
|
||||
|
||||
@@ -38,11 +38,6 @@
|
||||
<priority value="OFF" />
|
||||
</logger>
|
||||
|
||||
<logger name="NHibernate.AdoNet.AbstractBatcher">
|
||||
<!-- Displays failed table statements that are otherwise intercepted and rendered when unexpected. -->
|
||||
<priority value="OFF" />
|
||||
</logger>
|
||||
|
||||
<logger name="NHibernate.Util.ADOExceptionReporter">
|
||||
<!-- Displays failed table statements that are otherwise intercepted and rendered when unexpected. -->
|
||||
<priority value="OFF" />
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace Orchard.Core.Common.Handlers {
|
||||
|
||||
OnIndexing<CommonPart>((context, commonPart) => {
|
||||
context.DocumentIndex
|
||||
.Add("type", commonPart.ContentItem.ContentType).Analyze().Store()
|
||||
.Add("type", commonPart.ContentItem.ContentType).Store()
|
||||
.Add("created", commonPart.CreatedUtc ?? _clock.UtcNow).Store()
|
||||
.Add("published", commonPart.PublishedUtc ?? _clock.UtcNow).Store()
|
||||
.Add("modified", commonPart.ModifiedUtc ?? _clock.UtcNow).Store();
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.7.1
|
||||
OrchardVersion: 1.7.1
|
||||
Version: 1.7.2
|
||||
OrchardVersion: 1.7.2
|
||||
Description: The common module introduces content parts that are going to be used by most content types (common, body, identity).
|
||||
FeatureDescription: Core content parts.
|
||||
Dependencies: Settings
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
@Html.TextBox("Text", (string)Model.Text, new { @class = "text large" })
|
||||
@(Model.Required != null && Model.Required
|
||||
? Html.TextBox("Text", (string)Model.Text, new { @class = "text large", required = "required" })
|
||||
: Html.TextBox("Text", (string)Model.Text, new { @class = "text large" }))
|
||||
@@ -1 +1,3 @@
|
||||
@Html.TextBox("Text", (string)Model.Text, new { @class = "text small" })
|
||||
@(Model.Required != null && Model.Required
|
||||
? Html.TextBox("Text", (string)Model.Text, new { @class = "text small", required = "required" })
|
||||
: Html.TextBox("Text", (string)Model.Text, new { @class = "text small" }))
|
||||
@@ -1 +1,3 @@
|
||||
@Html.TextArea("Text", (string)Model.Text, 10, 80, new {})
|
||||
@(Model.Required != null && Model.Required
|
||||
? Html.TextArea("Text", (string)Model.Text, 10, 80, new { required = "required" })
|
||||
: Html.TextArea("Text", (string)Model.Text, 10, 80, new { }))
|
||||
@@ -1 +1,3 @@
|
||||
@Html.TextBox("Text", (string)Model.Text, new { @class = "text medium" })
|
||||
@(Model.Required != null && Model.Required
|
||||
? Html.TextBox("Text", (string)Model.Text, new { @class = "text medium", required = "required" })
|
||||
: Html.TextBox("Text", (string)Model.Text, new { @class = "text medium" }))
|
||||
@@ -2,4 +2,6 @@
|
||||
@{
|
||||
string editorFlavor = Model.EditorFlavor;
|
||||
}
|
||||
@Html.TextArea("Text", (string)Model.Text, 25, 80, new { @class = editorFlavor.HtmlClassify() })
|
||||
@(Model.Required != null && Model.Required
|
||||
? Html.TextArea("Text", (string)Model.Text, 25, 80, new { @class = editorFlavor.HtmlClassify(), required = "required" })
|
||||
: Html.TextArea("Text", (string)Model.Text, 25, 80, new { @class = editorFlavor.HtmlClassify() }))
|
||||
@@ -3,11 +3,11 @@
|
||||
<fieldset>
|
||||
<label for="@Html.FieldIdFor(m => m.Text)" @if(Model.Settings.Required) { <text>class="required"</text> }>@Model.Field.DisplayName</label>
|
||||
@if (String.IsNullOrWhiteSpace(Model.Settings.Flavor)) {
|
||||
@Html.TextBoxFor(m => m.Text, new { @class = "text" })
|
||||
@(Model.Settings.Required ? Html.TextBoxFor(m => m.Text, new {@class = "text", required = "required"}) : Html.TextBoxFor(m => m.Text, new {@class = "text"}))
|
||||
@Html.ValidationMessageFor(m => m.Text)
|
||||
}
|
||||
else {
|
||||
@Display.Body_Editor(Text: Model.Text, EditorFlavor: Model.Settings.Flavor)
|
||||
@Display.Body_Editor(Text: Model.Text, EditorFlavor: Model.Settings.Flavor, Required: Model.Settings.Required)
|
||||
}
|
||||
@if (HasText(Model.Settings.Hint)) {
|
||||
<span class="hint">@Model.Settings.Hint</span>
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.7.1
|
||||
OrchardVersion: 1.7.1
|
||||
Version: 1.7.2
|
||||
OrchardVersion: 1.7.2
|
||||
Description: The containers module introduces container and containable behaviors for content items.
|
||||
FeatureDescription: Container and containable parts to enable parent-child relationships between content items.
|
||||
Dependencies: Contents, Feeds
|
||||
|
||||
@@ -11,11 +11,11 @@ namespace Orchard.Core.Contents {
|
||||
public class DynamicPermissions : IPermissionProvider {
|
||||
private static readonly Permission PublishContent = new Permission { Description = "Publish or unpublish {0} for others", Name = "Publish_{0}", ImpliedBy = new[] { Permissions.PublishContent } };
|
||||
private static readonly Permission PublishOwnContent = new Permission { Description = "Publish or unpublish {0}", Name = "PublishOwn_{0}", ImpliedBy = new[] { PublishContent, Permissions.PublishOwnContent } };
|
||||
private static readonly Permission EditContent = new Permission { Description = "Edit {0} for others", Name = "Edit_{0}", ImpliedBy = new[] { PublishContent, Permissions.PublishContent } };
|
||||
private static readonly Permission EditContent = new Permission { Description = "Edit {0} for others", Name = "Edit_{0}", ImpliedBy = new[] { PublishContent, Permissions.EditContent } };
|
||||
private static readonly Permission EditOwnContent = new Permission { Description = "Edit {0}", Name = "EditOwn_{0}", ImpliedBy = new[] { EditContent, PublishOwnContent, Permissions.EditOwnContent } };
|
||||
private static readonly Permission DeleteContent = new Permission { Description = "Delete {0} for others", Name = "Delete_{0}", ImpliedBy = new[] { Permissions.DeleteContent } };
|
||||
private static readonly Permission DeleteOwnContent = new Permission { Description = "Delete {0}", Name = "DeleteOwn_{0}", ImpliedBy = new[] { DeleteContent, Permissions.DeleteOwnContent } };
|
||||
private static readonly Permission ViewContent = new Permission { Description = "View {0} by others", Name = "View_{0}", ImpliedBy = new[] { Permissions.EditContent } };
|
||||
private static readonly Permission ViewContent = new Permission { Description = "View {0} by others", Name = "View_{0}", ImpliedBy = new[] { EditContent, Permissions.ViewContent } };
|
||||
private static readonly Permission ViewOwnContent = new Permission { Description = "View own {0}", Name = "ViewOwn_{0}", ImpliedBy = new[] { ViewContent, Permissions.ViewOwnContent } };
|
||||
|
||||
public static readonly Dictionary<string, Permission> PermissionTemplates = new Dictionary<string, Permission> {
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.7.1
|
||||
OrchardVersion: 1.7.1
|
||||
Version: 1.7.2
|
||||
OrchardVersion: 1.7.2
|
||||
Description: The contents module enables the creation of custom content types.
|
||||
Features:
|
||||
Contents
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.7.1
|
||||
OrchardVersion: 1.7.1
|
||||
Version: 1.7.2
|
||||
OrchardVersion: 1.7.2
|
||||
Description: The dashboard module is providing the dashboard screen of the admininstration UI of the application.
|
||||
FeatureDescription: Standard admin dashboard.
|
||||
Category: Core
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.7.1
|
||||
OrchardVersion: 1.7.1
|
||||
Version: 1.7.2
|
||||
OrchardVersion: 1.7.2
|
||||
Description: The Feeds module is providing RSS feeds to content items.
|
||||
FeatureDescription: RSS feeds for content items.
|
||||
Category: Syndication
|
||||
|
||||
@@ -120,13 +120,19 @@ namespace Orchard.Core.Navigation.Drivers {
|
||||
// will be displayed.
|
||||
for (var i = 0; topLevelItems.Any() && i < part.StartLevel - 1; i++) {
|
||||
var temp = new List<MenuItem>();
|
||||
if (selectedPath != null) {
|
||||
// should the menu be filtered on the currently displayed page ?
|
||||
if (part.ShowFullMenu) {
|
||||
foreach (var menuItem in topLevelItems) {
|
||||
temp.AddRange(menuItem.Items);
|
||||
}
|
||||
}
|
||||
else if (selectedPath != null) {
|
||||
topLevelItems = topLevelItems.Intersect(selectedPath.Where(x => x.Selected)).ToList();
|
||||
foreach (var menuItem in topLevelItems) {
|
||||
temp.AddRange(menuItem.Items);
|
||||
}
|
||||
}
|
||||
topLevelItems = temp;
|
||||
topLevelItems = temp;
|
||||
}
|
||||
|
||||
// limit the number of levels to display (down from and including the start level)
|
||||
@@ -165,6 +171,7 @@ namespace Orchard.Core.Navigation.Drivers {
|
||||
Breadcrumb = part.Breadcrumb,
|
||||
AddCurrentPage = part.AddCurrentPage,
|
||||
AddHomePage = part.AddHomePage,
|
||||
ShowFullMenu = part.ShowFullMenu,
|
||||
Menus = _menuService.GetMenus(),
|
||||
};
|
||||
|
||||
@@ -181,6 +188,7 @@ namespace Orchard.Core.Navigation.Drivers {
|
||||
part.Breadcrumb = model.Breadcrumb;
|
||||
part.AddHomePage = model.AddHomePage;
|
||||
part.AddCurrentPage = model.AddCurrentPage;
|
||||
part.ShowFullMenu = model.ShowFullMenu;
|
||||
part.Menu = _contentManager.Get(model.CurrentMenuId).Record;
|
||||
}
|
||||
|
||||
@@ -193,6 +201,7 @@ namespace Orchard.Core.Navigation.Drivers {
|
||||
context.ImportAttribute(part.PartDefinition.Name, "Breadcrumb", x => part.Breadcrumb = Convert.ToBoolean(x));
|
||||
context.ImportAttribute(part.PartDefinition.Name, "AddCurrentPage", x => part.AddCurrentPage = Convert.ToBoolean(x));
|
||||
context.ImportAttribute(part.PartDefinition.Name, "AddHomePage", x => part.AddHomePage = Convert.ToBoolean(x));
|
||||
context.ImportAttribute(part.PartDefinition.Name, "ShowFullMenu", x => part.ShowFullMenu = Convert.ToBoolean(x));
|
||||
|
||||
context.ImportAttribute(part.PartDefinition.Name, "Menu", x => part.Menu = context.GetItemFromSession(x).Record);
|
||||
}
|
||||
@@ -206,6 +215,7 @@ namespace Orchard.Core.Navigation.Drivers {
|
||||
context.Element(part.PartDefinition.Name).SetAttributeValue("Breadcrumb", part.Breadcrumb);
|
||||
context.Element(part.PartDefinition.Name).SetAttributeValue("AddCurrentPage", part.AddCurrentPage);
|
||||
context.Element(part.PartDefinition.Name).SetAttributeValue("AddHomePage", part.AddHomePage);
|
||||
context.Element(part.PartDefinition.Name).SetAttributeValue("ShowFullMenu", part.ShowFullMenu);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -15,14 +15,6 @@ namespace Orchard.Core.Navigation.Handlers {
|
||||
_contentManager = contentManager;
|
||||
}
|
||||
|
||||
protected override void GetItemMetadata(GetContentItemMetadataContext context) {
|
||||
if(context.ContentItem.ContentType != "Menu") {
|
||||
return;
|
||||
}
|
||||
|
||||
context.Metadata.Identity.Add("name", context.ContentItem.As<TitlePart>().Title);
|
||||
}
|
||||
|
||||
protected override void Removing(RemoveContentContext context) {
|
||||
if (context.ContentItem.ContentType != "Menu") {
|
||||
return;
|
||||
|
||||
@@ -190,5 +190,13 @@ namespace Orchard.Core.Navigation {
|
||||
|
||||
return 5;
|
||||
}
|
||||
|
||||
public int UpdateFrom5() {
|
||||
ContentDefinitionManager.AlterTypeDefinition("Menu", cfg => cfg
|
||||
.WithPart("IdentityPart")
|
||||
);
|
||||
|
||||
return 6;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.FieldStorage.InfosetStorage;
|
||||
using Orchard.ContentManagement.Records;
|
||||
|
||||
namespace Orchard.Core.Navigation.Models {
|
||||
@@ -32,5 +33,10 @@ namespace Orchard.Core.Navigation.Models {
|
||||
get { return Record.Menu; }
|
||||
set { Record.Menu = value; }
|
||||
}
|
||||
|
||||
public bool ShowFullMenu {
|
||||
get { return bool.Parse(this.As<InfosetPart>().Get<MenuWidgetPart>("ShowFullMenu") ?? "false"); }
|
||||
set { this.As<InfosetPart>().Set<MenuWidgetPart>("ShowFullMenu", value.ToString()); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,8 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.7.1
|
||||
OrchardVersion: 1.7.1
|
||||
Version: 1.7.2
|
||||
OrchardVersion: 1.7.2
|
||||
Description: The navigation module creates and manages a simple navigation menu for the front-end of the application and allows you to add content items to the admin menu.
|
||||
FeatureDescription: Menu management.
|
||||
Category: Core
|
||||
|
||||
@@ -11,5 +11,6 @@ namespace Orchard.Core.Navigation.ViewModels {
|
||||
public bool Breadcrumb { get; set; }
|
||||
public bool AddHomePage { get; set; }
|
||||
public bool AddCurrentPage { get; set; }
|
||||
public bool ShowFullMenu { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -42,4 +42,10 @@
|
||||
<label class="forcheckbox" for="@Html.FieldIdFor(m => m.AddCurrentPage)">@T("Add the current content item as the last element")</label>
|
||||
<span class="hint">@T("Check to render the current content item as the last element.")</span>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<fieldset>
|
||||
@Html.EditorFor(m => m.ShowFullMenu)
|
||||
<label class="forcheckbox" for="@Html.FieldIdFor(m => m.ShowFullMenu)">@T("No filter on selected page")</label>
|
||||
<span class="hint">@T("Check for the menu to be display without filtering the selected current page.")</span>
|
||||
</fieldset>
|
||||
@@ -30,6 +30,6 @@ using System.Security;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.7.1")]
|
||||
[assembly: AssemblyFileVersion("1.7.1")]
|
||||
[assembly: AssemblyVersion("1.7.2")]
|
||||
[assembly: AssemblyFileVersion("1.7.2")]
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.7.1
|
||||
OrchardVersion: 1.7.1
|
||||
Version: 1.7.2
|
||||
OrchardVersion: 1.7.2
|
||||
Description: The dashboard module is providing the reports screen of the application.
|
||||
FeatureDescription: Reports management.
|
||||
Category: Core
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.7.1
|
||||
OrchardVersion: 1.7.1
|
||||
Version: 1.7.2
|
||||
OrchardVersion: 1.7.2
|
||||
Description: The scheduling module enables background task scheduling.
|
||||
FeatureDescription: Scheduled background tasks.
|
||||
Category: Core
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.7.1
|
||||
OrchardVersion: 1.7.1
|
||||
Version: 1.7.2
|
||||
OrchardVersion: 1.7.2
|
||||
Description: The settings module creates site settings that other modules can contribute to.
|
||||
FeatureDescription: Site settings.
|
||||
Category: Core
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.7.1
|
||||
OrchardVersion: 1.7.1
|
||||
Version: 1.7.2
|
||||
OrchardVersion: 1.7.2
|
||||
Description: The shapes module contains core shape templates and display hooks.
|
||||
FeatureDescription: Core shape templates and display hooks.
|
||||
Category: Core
|
||||
|
||||
@@ -223,7 +223,7 @@
|
||||
$(function () {
|
||||
var magicToken = $("input[name=__RequestVerificationToken]").first();
|
||||
if (!magicToken) { return; } // no sense in continuing if form POSTS will fail
|
||||
$("a[itemprop~=UnsafeUrl]").on("click", function() {
|
||||
$("body").on("click", "a[itemprop~=UnsafeUrl]", function() {
|
||||
var _this = $(this);
|
||||
var hrefParts = _this.attr("href").split("?");
|
||||
var form = $("<form action=\"" + hrefParts[0] + "\" method=\"POST\" />");
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.7.1
|
||||
OrchardVersion: 1.7.1
|
||||
Version: 1.7.2
|
||||
OrchardVersion: 1.7.2
|
||||
Description: The title module enables content items to have titles.
|
||||
FeatureDescription: Title content part.
|
||||
Category: Core
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.7.1
|
||||
OrchardVersion: 1.7.1
|
||||
Version: 1.7.2
|
||||
OrchardVersion: 1.7.2
|
||||
Description: The XmlRpc module enables creation of contents from client applications such as LiveWriter.
|
||||
FeatureDescription: XML-RPC opt-in implementation.
|
||||
Category: Content Publishing
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.7.1
|
||||
OrchardVersion: 1.7.1
|
||||
Version: 1.7.2
|
||||
OrchardVersion: 1.7.2
|
||||
Description: The Lucene module enables the site to be indexed using Lucene.NET. The index generated by this module can then be used by the search module to provide an integrated full-text search experience to a web site.
|
||||
FeatureDescription: Lucene indexing services.
|
||||
Dependencies: Orchard.Indexing
|
||||
|
||||
@@ -30,6 +30,6 @@ using System.Security;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.7.1")]
|
||||
[assembly: AssemblyFileVersion("1.7.1")]
|
||||
[assembly: AssemblyVersion("1.7.2")]
|
||||
[assembly: AssemblyFileVersion("1.7.2")]
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Lucene.Models;
|
||||
@@ -23,7 +24,6 @@ namespace Lucene.Services {
|
||||
/// </summary>
|
||||
public class LuceneIndexProvider : IIndexProvider {
|
||||
private readonly IAppDataFolder _appDataFolder;
|
||||
private readonly ShellSettings _shellSettings;
|
||||
public static readonly Version LuceneVersion = Version.LUCENE_29;
|
||||
private readonly Analyzer _analyzer ;
|
||||
private readonly string _basePath;
|
||||
@@ -31,11 +31,10 @@ namespace Lucene.Services {
|
||||
|
||||
public LuceneIndexProvider(IAppDataFolder appDataFolder, ShellSettings shellSettings) {
|
||||
_appDataFolder = appDataFolder;
|
||||
_shellSettings = shellSettings;
|
||||
_analyzer = CreateAnalyzer();
|
||||
|
||||
// TODO: (sebros) Find a common way to get where tenant's specific files should go. "Sites/Tenant" is hard coded in multiple places
|
||||
_basePath = _appDataFolder.Combine("Sites", _shellSettings.Name, "Indexes");
|
||||
_basePath = _appDataFolder.Combine("Sites", shellSettings.Name, "Indexes");
|
||||
|
||||
Logger = NullLogger.Instance;
|
||||
|
||||
@@ -152,13 +151,13 @@ namespace Lucene.Services {
|
||||
if (!documentIds.Any()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
using(var writer = new IndexWriter(GetDirectory(indexName), _analyzer, false, IndexWriter.MaxFieldLength.UNLIMITED)) {
|
||||
var query = new BooleanQuery();
|
||||
|
||||
try {
|
||||
foreach (var id in documentIds) {
|
||||
query.Add(new BooleanClause(new TermQuery(new Term("id", id.ToString())), Occur.SHOULD));
|
||||
query.Add(new BooleanClause(new TermQuery(new Term("id", id.ToString(CultureInfo.InvariantCulture))), Occur.SHOULD));
|
||||
}
|
||||
|
||||
writer.DeleteDocuments(query);
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using Lucene.Models;
|
||||
using Lucene.Net.Analysis;
|
||||
using Lucene.Net.Index;
|
||||
using Lucene.Net.Search;
|
||||
using Lucene.Net.Store;
|
||||
@@ -33,6 +34,7 @@ namespace Lucene.Services {
|
||||
private bool _exactMatch;
|
||||
private float _boost;
|
||||
private Query _query;
|
||||
private readonly Analyzer _analyzer = LuceneIndexProvider.CreateAnalyzer();
|
||||
|
||||
public ILogger Logger { get; set; }
|
||||
|
||||
@@ -68,10 +70,9 @@ namespace Lucene.Services {
|
||||
query = QueryParser.Escape(query);
|
||||
}
|
||||
|
||||
var analyzer = LuceneIndexProvider.CreateAnalyzer();
|
||||
foreach (var defaultField in defaultFields) {
|
||||
CreatePendingClause();
|
||||
_query = new QueryParser(LuceneIndexProvider.LuceneVersion, defaultField, analyzer).Parse(query);
|
||||
_query = new QueryParser(LuceneIndexProvider.LuceneVersion, defaultField, _analyzer).Parse(query);
|
||||
}
|
||||
|
||||
return this;
|
||||
@@ -83,9 +84,9 @@ namespace Lucene.Services {
|
||||
return this;
|
||||
}
|
||||
|
||||
public ISearchBuilder WithinRange(string field, int min, int max) {
|
||||
public ISearchBuilder WithinRange(string field, int? min, int? max, bool includeMin = true, bool includeMax = true) {
|
||||
CreatePendingClause();
|
||||
_query = NumericRangeQuery.NewIntRange(field, min, max, true, true);
|
||||
_query = NumericRangeQuery.NewIntRange(field, min, max, includeMin, includeMax);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -95,9 +96,9 @@ namespace Lucene.Services {
|
||||
return this;
|
||||
}
|
||||
|
||||
public ISearchBuilder WithinRange(string field, double min, double max) {
|
||||
public ISearchBuilder WithinRange(string field, double? min, double? max, bool includeMin = true, bool includeMax = true) {
|
||||
CreatePendingClause();
|
||||
_query = NumericRangeQuery.NewDoubleRange(field, min, max, true, true);
|
||||
_query = NumericRangeQuery.NewDoubleRange(field, min, max, includeMin, includeMax);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -111,15 +112,15 @@ namespace Lucene.Services {
|
||||
return this;
|
||||
}
|
||||
|
||||
public ISearchBuilder WithinRange(string field, DateTime min, DateTime max) {
|
||||
public ISearchBuilder WithinRange(string field, DateTime? min, DateTime? max, bool includeMin = true, bool includeMax = true) {
|
||||
CreatePendingClause();
|
||||
_query = new TermRangeQuery(field, DateTools.DateToString(min, DateTools.Resolution.MILLISECOND), DateTools.DateToString(max, DateTools.Resolution.MILLISECOND), true, true);
|
||||
_query = new TermRangeQuery(field, min.HasValue ? DateTools.DateToString(min.Value, DateTools.Resolution.MILLISECOND) : null, max.HasValue ? DateTools.DateToString(max.Value, DateTools.Resolution.MILLISECOND) : null, includeMin, includeMax);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ISearchBuilder WithinRange(string field, string min, string max) {
|
||||
public ISearchBuilder WithinRange(string field, string min, string max, bool includeMin = true, bool includeMax = true) {
|
||||
CreatePendingClause();
|
||||
_query = new TermRangeQuery(field, QueryParser.Escape(min.ToLower()), QueryParser.Escape(max.ToLower()), true, true);
|
||||
_query = new TermRangeQuery(field, min != null ? QueryParser.Escape(min.ToLower()) : null, max != null ? QueryParser.Escape(max.ToLower()) : null, includeMin, includeMax);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -159,8 +160,6 @@ namespace Lucene.Services {
|
||||
_query = null;
|
||||
_boost = 0;
|
||||
_asFilter = false;
|
||||
_sort = String.Empty;
|
||||
_comparer = 0;
|
||||
}
|
||||
|
||||
private void CreatePendingClause() {
|
||||
@@ -189,7 +188,7 @@ namespace Lucene.Services {
|
||||
_clauses.Add(new BooleanClause(_query, _occur));
|
||||
}
|
||||
|
||||
_query = null;
|
||||
InitPendingClause();
|
||||
}
|
||||
|
||||
public ISearchBuilder SortBy(string name) {
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.7.1
|
||||
OrchardVersion: 1.7.1
|
||||
Version: 1.7.2
|
||||
OrchardVersion: 1.7.2
|
||||
Description: The Markdown module enables rich text contents to be created using the Markdown syntax.
|
||||
FeatureDescription: Markdown editor.
|
||||
Category: Input Editor
|
||||
|
||||
@@ -26,6 +26,6 @@ using System.Runtime.InteropServices;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.7.1")]
|
||||
[assembly: AssemblyFileVersion("1.7.1")]
|
||||
[assembly: AssemblyVersion("1.7.2")]
|
||||
[assembly: AssemblyFileVersion("1.7.2")]
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Xml.Linq;
|
||||
using Orchard.Alias.Records;
|
||||
using Orchard.Data;
|
||||
@@ -13,8 +14,9 @@ namespace Orchard.Alias.Implementation.Storage {
|
||||
void Remove(string path);
|
||||
void Remove(string path, string aliasSource);
|
||||
void RemoveBySource(string aliasSource);
|
||||
IEnumerable<Tuple<string, string, IDictionary<string, string>, string>> List();
|
||||
IEnumerable<Tuple<string, string, IDictionary<string, string>, string>> List(string sourceStartsWith);
|
||||
IEnumerable<Tuple<string, string, IDictionary<string, string>, string, int>> List(Expression<Func<AliasRecord, bool>> predicate);
|
||||
IEnumerable<Tuple<string, string, IDictionary<string, string>, string, int>> List();
|
||||
IEnumerable<Tuple<string, string, IDictionary<string, string>, string, int>> List(string sourceStartsWith);
|
||||
}
|
||||
|
||||
public class AliasStorage : IAliasStorage {
|
||||
@@ -124,15 +126,25 @@ namespace Orchard.Alias.Implementation.Storage {
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<Tuple<string, string, IDictionary<string, string>, string>> List() {
|
||||
return _aliasRepository.Table.OrderBy(a => a.Id).Select(ToDictionary).ToList();
|
||||
public IEnumerable<Tuple<string, string, IDictionary<string, string>, string, int>> List() {
|
||||
return List((Expression<Func<AliasRecord, bool>>) null);
|
||||
}
|
||||
|
||||
public IEnumerable<Tuple<string, string, IDictionary<string, string>, string>> List(string sourceStartsWith) {
|
||||
return _aliasRepository.Table.Where(a => a.Source.StartsWith(sourceStartsWith)).OrderBy(a => a.Id).Select(ToDictionary).ToList();
|
||||
public IEnumerable<Tuple<string, string, IDictionary<string, string>, string, int>> List(Expression<Func<AliasRecord, bool>> predicate) {
|
||||
var table = _aliasRepository.Table;
|
||||
|
||||
if (predicate != null) {
|
||||
table = table.Where(predicate);
|
||||
}
|
||||
|
||||
return table.OrderBy(a => a.Id).Select(ToDictionary).ToList();
|
||||
}
|
||||
|
||||
private static Tuple<string, string, IDictionary<string, string>, string> ToDictionary(AliasRecord aliasRecord) {
|
||||
public IEnumerable<Tuple<string, string, IDictionary<string, string>, string, int>> List(string sourceStartsWith) {
|
||||
return List(a => a.Source.StartsWith(sourceStartsWith));
|
||||
}
|
||||
|
||||
private static Tuple<string, string, IDictionary<string, string>, string, int> ToDictionary(AliasRecord aliasRecord) {
|
||||
IDictionary<string, string> routeValues = new Dictionary<string, string>();
|
||||
if (aliasRecord.Action.Area != null) {
|
||||
routeValues.Add("area", aliasRecord.Action.Area);
|
||||
@@ -148,7 +160,7 @@ namespace Orchard.Alias.Implementation.Storage {
|
||||
routeValues.Add(attr.Name.LocalName, attr.Value);
|
||||
}
|
||||
}
|
||||
return Tuple.Create(aliasRecord.Path, aliasRecord.Action.Area, routeValues, aliasRecord.Source);
|
||||
return Tuple.Create(aliasRecord.Path, aliasRecord.Action.Area, routeValues, aliasRecord.Source, aliasRecord.Id);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
namespace Orchard.Alias.Implementation.Updater {
|
||||
public class AliasUpdateCursor : IAliasUpdateCursor {
|
||||
public int Cursor { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using Orchard.Alias.Implementation.Holder;
|
||||
using Orchard.Alias.Implementation.Storage;
|
||||
using Orchard.Data;
|
||||
using Orchard.Environment;
|
||||
using Orchard.Tasks;
|
||||
using Orchard.Logging;
|
||||
@@ -13,12 +10,14 @@ namespace Orchard.Alias.Implementation.Updater {
|
||||
public class AliasHolderUpdater : IOrchardShellEvents, IBackgroundTask {
|
||||
private readonly IAliasHolder _aliasHolder;
|
||||
private readonly IAliasStorage _storage;
|
||||
private readonly IAliasUpdateCursor _cursor;
|
||||
|
||||
public ILogger Logger { get; set; }
|
||||
|
||||
public AliasHolderUpdater(IAliasHolder aliasHolder, IAliasStorage storage) {
|
||||
public AliasHolderUpdater(IAliasHolder aliasHolder, IAliasStorage storage, IAliasUpdateCursor cursor) {
|
||||
_aliasHolder = aliasHolder;
|
||||
_storage = storage;
|
||||
_cursor = cursor;
|
||||
Logger = NullLogger.Instance;
|
||||
}
|
||||
|
||||
@@ -31,7 +30,14 @@ namespace Orchard.Alias.Implementation.Updater {
|
||||
|
||||
private void Refresh() {
|
||||
try {
|
||||
var aliases = _storage.List();
|
||||
// only retreive aliases which have not been processed yet
|
||||
var aliases = _storage.List(x => x.Id > _cursor.Cursor).ToArray();
|
||||
|
||||
// update the last processed id
|
||||
if (aliases.Any()) {
|
||||
_cursor.Cursor = aliases.Last().Item5;
|
||||
}
|
||||
|
||||
_aliasHolder.SetAliases(aliases.Select(alias => new AliasInfo { Path = alias.Item1, Area = alias.Item2, RouteValues = alias.Item3 }));
|
||||
}
|
||||
catch (Exception ex) {
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
namespace Orchard.Alias.Implementation.Updater {
|
||||
public interface IAliasUpdateCursor : ISingletonDependency {
|
||||
int Cursor { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,8 @@ Name: Alias
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.7.1
|
||||
OrchardVersion: 1.7.1
|
||||
Version: 1.7.2
|
||||
OrchardVersion: 1.7.2
|
||||
Description: Maps friendly urls to specific module actions.
|
||||
FeatureDescription: Maps friendly urls to specific module actions.
|
||||
Category: Content
|
||||
|
||||
@@ -77,6 +77,8 @@
|
||||
<Content Include="Views\Admin\Index.cshtml" />
|
||||
<Content Include="Web.config" />
|
||||
<Content Include="Views\Web.config" />
|
||||
<Compile Include="Implementation\Updater\AliasUpdateCursor.cs" />
|
||||
<Compile Include="Implementation\Updater\IAliasUpdateCursor.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Content Include="Module.txt" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -30,6 +30,6 @@ using System.Security;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.7.1")]
|
||||
[assembly: AssemblyFileVersion("1.7.1")]
|
||||
[assembly: AssemblyVersion("1.7.2")]
|
||||
[assembly: AssemblyFileVersion("1.7.2")]
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ Name: AntiSpam
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.7.1
|
||||
OrchardVersion: 1.7.1
|
||||
Version: 1.7.2
|
||||
OrchardVersion: 1.7.2
|
||||
Description: Provides anti-spam services to protect your content from malicious submissions.
|
||||
Features:
|
||||
Orchard.AntiSpam:
|
||||
|
||||
@@ -29,6 +29,6 @@ using System.Runtime.InteropServices;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.7.1")]
|
||||
[assembly: AssemblyFileVersion("1.7.1")]
|
||||
[assembly: AssemblyVersion("1.7.2")]
|
||||
[assembly: AssemblyFileVersion("1.7.2")]
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@ Path: ArchiveLater
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.7.1
|
||||
OrchardVersion: 1.7.1
|
||||
Version: 1.7.2
|
||||
OrchardVersion: 1.7.2
|
||||
Description: The ArchiveLater module introduces scheduled archiving functionality.
|
||||
FeatureDescription: Scheduled archiving.
|
||||
Category: Content
|
||||
|
||||
@@ -30,6 +30,6 @@ using System.Security;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.7.1")]
|
||||
[assembly: AssemblyFileVersion("1.7.1")]
|
||||
[assembly: AssemblyVersion("1.7.2")]
|
||||
[assembly: AssemblyFileVersion("1.7.2")]
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ Name: Autoroute
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.7.1
|
||||
OrchardVersion: 1.7.1
|
||||
Version: 1.7.2
|
||||
OrchardVersion: 1.7.2
|
||||
Description: Description for the module
|
||||
Features:
|
||||
Orchard.Autoroute:
|
||||
|
||||
@@ -101,6 +101,8 @@
|
||||
<Compile Include="Commands\AutorouteCommands.cs" />
|
||||
<Compile Include="ResourceManifest.cs" />
|
||||
<Compile Include="Services\AliasResolverSelector.cs" />
|
||||
<Compile Include="Services\PathResolutionService.cs" />
|
||||
<Compile Include="Services\IPathResolutionService.cs" />
|
||||
<Compile Include="Services\IRouteEvents.cs" />
|
||||
<Compile Include="Settings\AutorouteSettingsEvents.cs" />
|
||||
<Compile Include="Settings\RoutePattern.cs" />
|
||||
|
||||
@@ -30,6 +30,6 @@ using System.Security;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.7.1")]
|
||||
[assembly: AssemblyFileVersion("1.7.1")]
|
||||
[assembly: AssemblyVersion("1.7.2")]
|
||||
[assembly: AssemblyFileVersion("1.7.2")]
|
||||
|
||||
|
||||
@@ -11,9 +11,7 @@ namespace Orchard.Autoroute.Services {
|
||||
|
||||
string GenerateAlias(AutoroutePart part);
|
||||
void PublishAlias(AutoroutePart part);
|
||||
|
||||
void RemoveAliases(AutoroutePart part);
|
||||
|
||||
void CreatePattern(string contentType, string name, string pattern, string description, bool makeDefault);
|
||||
RoutePattern GetDefaultPattern(string contentType);
|
||||
IEnumerable<RoutePattern> GetPatterns(string contentType);
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
using Orchard.Autoroute.Models;
|
||||
|
||||
namespace Orchard.Autoroute.Services {
|
||||
|
||||
public interface IPathResolutionService : IDependency {
|
||||
AutoroutePart GetPath(string path);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System.Linq;
|
||||
using Orchard.Autoroute.Models;
|
||||
using Orchard.ContentManagement;
|
||||
|
||||
namespace Orchard.Autoroute.Services {
|
||||
public class PathResolutionService : IPathResolutionService {
|
||||
private readonly IContentManager _contentManager;
|
||||
|
||||
public PathResolutionService(IContentManager contentManager) {
|
||||
_contentManager = contentManager;
|
||||
}
|
||||
|
||||
public AutoroutePart GetPath(string path) {
|
||||
return _contentManager.Query<AutoroutePart, AutoroutePartRecord>()
|
||||
.Where(part => part.DisplayAlias == path)
|
||||
.Slice(0, 1)
|
||||
.FirstOrDefault();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@ AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.0
|
||||
OrchardVersion: 1.7.1
|
||||
OrchardVersion: 1.7.2
|
||||
Description: Provides a set of Orchard service implementations targeting Windows Azure services.
|
||||
Features:
|
||||
Orchard.Azure:
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Web.config" />
|
||||
<Content Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Content Include="Module.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -31,6 +31,6 @@ using System.Security;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.7.1")]
|
||||
[assembly: AssemblyFileVersion("1.7.1")]
|
||||
[assembly: AssemblyVersion("1.7.2")]
|
||||
[assembly: AssemblyFileVersion("1.7.2")]
|
||||
|
||||
|
||||
@@ -1,28 +1,21 @@
|
||||
using System.Web.Routing;
|
||||
using JetBrains.Annotations;
|
||||
using Orchard.Blogs.Models;
|
||||
using Orchard.Blogs.Routing;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.Aspects;
|
||||
using Orchard.ContentManagement.Handlers;
|
||||
using Orchard.Data;
|
||||
|
||||
namespace Orchard.Blogs.Handlers {
|
||||
[UsedImplicitly]
|
||||
public class BlogPartHandler : ContentHandler {
|
||||
private readonly IBlogPathConstraint _blogPathConstraint;
|
||||
|
||||
public BlogPartHandler(IRepository<BlogPartRecord> repository, IBlogPathConstraint blogPathConstraint) {
|
||||
_blogPathConstraint = blogPathConstraint;
|
||||
public BlogPartHandler(IRepository<BlogPartRecord> repository) {
|
||||
Filters.Add(StorageFilter.For(repository));
|
||||
|
||||
OnGetDisplayShape<BlogPart>((context, blog) => {
|
||||
context.Shape.Description = blog.Description;
|
||||
context.Shape.PostCount = blog.PostCount;
|
||||
});
|
||||
|
||||
OnPublished<BlogPart>((context, blog) => _blogPathConstraint.AddPath(blog.As<IAliasAspect>().Path));
|
||||
OnUnpublished<BlogPart>((context, blog) => _blogPathConstraint.RemovePath(blog.As<IAliasAspect>().Path));
|
||||
}
|
||||
|
||||
protected override void GetItemMetadata(GetContentItemMetadataContext context) {
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.7.1
|
||||
OrchardVersion: 1.7.1
|
||||
Version: 1.7.2
|
||||
OrchardVersion: 1.7.2
|
||||
Description: The Orchard Blogs module is implementing basic blogging features.
|
||||
FeatureDescription: A simple web log.
|
||||
Dependencies: Shapes, Common, Feeds, Navigation, Orchard.Widgets, Orchard.jQuery, Orchard.PublishLater
|
||||
|
||||
@@ -92,13 +92,10 @@
|
||||
<Compile Include="Handlers\BlogPartArchiveHandler.cs" />
|
||||
<Compile Include="Models\BlogPartArchiveRecord.cs" />
|
||||
<Compile Include="Permissions.cs" />
|
||||
<Compile Include="Routing\BlogPathConstraint.cs" />
|
||||
<Compile Include="Routing\BlogPathConstraintUpdator.cs" />
|
||||
<Compile Include="Routing\ArchiveConstraint.cs" />
|
||||
<Compile Include="Routing\IArchiveConstraint.cs" />
|
||||
<Compile Include="Routing\RsdConstraint.cs" />
|
||||
<Compile Include="Routing\IRsdConstraint.cs" />
|
||||
<Compile Include="Routing\IBlogPathConstraint.cs" />
|
||||
<Compile Include="Security\BlogAuthorizationEventHandler.cs" />
|
||||
<Compile Include="Services\ArchiveService.cs" />
|
||||
<Compile Include="Services\BlogService.cs" />
|
||||
@@ -155,6 +152,10 @@
|
||||
<Project>{9916839C-39FC-4CEB-A5AF-89CA7E87119F}</Project>
|
||||
<Name>Orchard.Core</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Orchard.Autoroute\Orchard.Autoroute.csproj">
|
||||
<Project>{66fccd76-2761-47e3-8d11-b45d0001ddaa}</Project>
|
||||
<Name>Orchard.Autoroute</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Orchard.ContentPicker\Orchard.ContentPicker.csproj">
|
||||
<Project>{f301ef7d-f19c-4d83-aa94-cb64f29c037d}</Project>
|
||||
<Name>Orchard.ContentPicker</Name>
|
||||
|
||||
@@ -29,6 +29,6 @@ using System.Runtime.InteropServices;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.7.1")]
|
||||
[assembly: AssemblyFileVersion("1.7.1")]
|
||||
[assembly: AssemblyVersion("1.7.2")]
|
||||
[assembly: AssemblyFileVersion("1.7.2")]
|
||||
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
using System;
|
||||
using System.Web;
|
||||
using System.Web.Routing;
|
||||
using Orchard.Autoroute.Services;
|
||||
using Orchard.Blogs.Models;
|
||||
using Orchard.ContentManagement;
|
||||
|
||||
namespace Orchard.Blogs.Routing {
|
||||
public class ArchiveConstraint : IArchiveConstraint {
|
||||
private readonly IBlogPathConstraint _blogPathConstraint;
|
||||
private readonly IPathResolutionService _pathResolutionService;
|
||||
|
||||
public ArchiveConstraint(IBlogPathConstraint blogPathConstraint) {
|
||||
_blogPathConstraint = blogPathConstraint;
|
||||
public ArchiveConstraint(IPathResolutionService pathResolutionService) {
|
||||
_pathResolutionService = pathResolutionService;
|
||||
}
|
||||
|
||||
public bool Match(HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection) {
|
||||
@@ -27,7 +29,17 @@ namespace Orchard.Blogs.Routing {
|
||||
return false;
|
||||
}
|
||||
|
||||
return _blogPathConstraint.FindPath(path) != null;
|
||||
try {
|
||||
// is this a valid date ?
|
||||
archiveData.ToDateTime();
|
||||
}
|
||||
catch {
|
||||
return false;
|
||||
}
|
||||
|
||||
var autoroute = _pathResolutionService.GetPath(path);
|
||||
|
||||
return autoroute != null && autoroute.Is<BlogPart>();
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Routing;
|
||||
using JetBrains.Annotations;
|
||||
using Orchard.Logging;
|
||||
|
||||
namespace Orchard.Blogs.Routing {
|
||||
[UsedImplicitly]
|
||||
public class BlogPathConstraint : IBlogPathConstraint {
|
||||
private readonly ConcurrentDictionary<string, string> _paths = new ConcurrentDictionary<string, string>(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
public BlogPathConstraint() {
|
||||
Logger = NullLogger.Instance;
|
||||
}
|
||||
|
||||
public ILogger Logger { get; set; }
|
||||
|
||||
public void SetPaths(IEnumerable<string> paths) {
|
||||
_paths.Clear();
|
||||
foreach(var path in paths) {
|
||||
AddPath(path);
|
||||
}
|
||||
|
||||
Logger.Debug("Blog paths: {0}", string.Join(", ", paths.ToArray()));
|
||||
}
|
||||
|
||||
public string FindPath(string path) {
|
||||
string actual;
|
||||
// path can be null for homepage
|
||||
path = path ?? String.Empty;
|
||||
|
||||
return _paths.TryGetValue(path, out actual) ? actual : path;
|
||||
}
|
||||
|
||||
public void AddPath(string path) {
|
||||
// path can be null for homepage
|
||||
path = path ?? String.Empty;
|
||||
|
||||
_paths[path] = path;
|
||||
}
|
||||
|
||||
public void RemovePath(string path) {
|
||||
// path can be null for homepage
|
||||
path = path ?? String.Empty;
|
||||
|
||||
_paths.TryRemove(path, out path);
|
||||
}
|
||||
|
||||
public bool Match(HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection) {
|
||||
if (routeDirection == RouteDirection.UrlGeneration)
|
||||
return true;
|
||||
|
||||
object value;
|
||||
if (values.TryGetValue(parameterName, out value)) {
|
||||
var parameterValue = Convert.ToString(value);
|
||||
|
||||
return _paths.ContainsKey(parameterValue);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
using System.Linq;
|
||||
using JetBrains.Annotations;
|
||||
using Orchard.Blogs.Services;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.Aspects;
|
||||
using Orchard.Environment;
|
||||
using Orchard.Tasks;
|
||||
|
||||
namespace Orchard.Blogs.Routing {
|
||||
[UsedImplicitly]
|
||||
public class BlogPathConstraintUpdator : IOrchardShellEvents, IBackgroundTask {
|
||||
private readonly IBlogPathConstraint _blogPathConstraint;
|
||||
private readonly IBlogService _blogService;
|
||||
|
||||
public BlogPathConstraintUpdator(IBlogPathConstraint blogPathConstraint, IBlogService blogService) {
|
||||
_blogPathConstraint = blogPathConstraint;
|
||||
_blogService = blogService;
|
||||
}
|
||||
|
||||
void IOrchardShellEvents.Activated() {
|
||||
Refresh();
|
||||
}
|
||||
|
||||
void IOrchardShellEvents.Terminating() {
|
||||
}
|
||||
|
||||
void IBackgroundTask.Sweep() {
|
||||
Refresh();
|
||||
}
|
||||
|
||||
private void Refresh() {
|
||||
_blogPathConstraint.SetPaths(_blogService.Get().Select(b => b.As<IAliasAspect>().Path).ToList());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Web.Routing;
|
||||
|
||||
namespace Orchard.Blogs.Routing {
|
||||
public interface IBlogPathConstraint : IRouteConstraint, ISingletonDependency {
|
||||
void SetPaths(IEnumerable<string> paths);
|
||||
string FindPath(string path);
|
||||
void AddPath(string path);
|
||||
void RemovePath(string path);
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,16 @@
|
||||
using System;
|
||||
using System.Web;
|
||||
using System.Web.Routing;
|
||||
using Orchard.Autoroute.Services;
|
||||
using Orchard.Blogs.Models;
|
||||
using Orchard.ContentManagement;
|
||||
|
||||
namespace Orchard.Blogs.Routing {
|
||||
public class RsdConstraint : IRsdConstraint {
|
||||
private readonly IBlogPathConstraint _blogPathConstraint;
|
||||
private readonly IPathResolutionService _pathResolutionService;
|
||||
|
||||
public RsdConstraint(IBlogPathConstraint blogPathConstraint) {
|
||||
_blogPathConstraint = blogPathConstraint;
|
||||
public RsdConstraint(IPathResolutionService pathResolutionService) {
|
||||
_pathResolutionService = pathResolutionService;
|
||||
}
|
||||
|
||||
public bool Match(HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection) {
|
||||
@@ -23,7 +26,9 @@ namespace Orchard.Blogs.Routing {
|
||||
return false;
|
||||
}
|
||||
|
||||
return _blogPathConstraint.FindPath(path) != null;
|
||||
var autoroute = _pathResolutionService.GetPath(path);
|
||||
|
||||
return autoroute != null && autoroute.Is<BlogPart>();
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using JetBrains.Annotations;
|
||||
using Orchard.Blogs.Models;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.Aspects;
|
||||
using Orchard.ContentManagement.MetaData;
|
||||
using Orchard.Core.Common.Models;
|
||||
using Orchard.Data;
|
||||
using Orchard.Data.Conventions;
|
||||
using Orchard.Tasks.Scheduling;
|
||||
|
||||
namespace Orchard.Blogs.Services {
|
||||
|
||||
@@ -1,25 +1,22 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using JetBrains.Annotations;
|
||||
using Orchard.Autoroute.Models;
|
||||
using Orchard.Blogs.Models;
|
||||
using Orchard.Blogs.Routing;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.Aspects;
|
||||
using Orchard.Core.Title.Models;
|
||||
|
||||
namespace Orchard.Blogs.Services {
|
||||
[UsedImplicitly]
|
||||
public class BlogService : IBlogService {
|
||||
private readonly IContentManager _contentManager;
|
||||
private readonly IBlogPathConstraint _blogPathConstraint;
|
||||
|
||||
public BlogService(IContentManager contentManager, IBlogPathConstraint blogPathConstraint) {
|
||||
public BlogService(IContentManager contentManager) {
|
||||
_contentManager = contentManager;
|
||||
_blogPathConstraint = blogPathConstraint;
|
||||
}
|
||||
|
||||
public BlogPart Get(string path) {
|
||||
return _contentManager.Query<BlogPart>().List().FirstOrDefault(rr => rr.As<IAliasAspect>().Path == path);
|
||||
return _contentManager.Query<AutoroutePart, AutoroutePartRecord>().Where(r => r.DisplayAlias == path).ForPart<BlogPart>().Slice(0, 1).FirstOrDefault();
|
||||
}
|
||||
|
||||
public ContentItem Get(int id, VersionOptions versionOptions) {
|
||||
@@ -40,7 +37,6 @@ namespace Orchard.Blogs.Services {
|
||||
|
||||
public void Delete(ContentItem blog) {
|
||||
_contentManager.Remove(blog);
|
||||
_blogPathConstraint.RemovePath(blog.As<IAliasAspect>().Path);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,8 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.7.1
|
||||
OrchardVersion: 1.7.1
|
||||
Version: 1.7.2
|
||||
OrchardVersion: 1.7.2
|
||||
Description: Tools to create Orchard components.
|
||||
FeatureDescription: Tools to create Orchard components.
|
||||
Category: Developer
|
||||
|
||||
@@ -30,6 +30,6 @@ using System.Security;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.7.1")]
|
||||
[assembly: AssemblyFileVersion("1.7.1")]
|
||||
[assembly: AssemblyVersion("1.7.2")]
|
||||
[assembly: AssemblyFileVersion("1.7.2")]
|
||||
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
using System.Collections.Generic;
|
||||
using Orchard.Comments.Models;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.Environment.Extensions;
|
||||
using Orchard.Localization;
|
||||
using Orchard.Logging;
|
||||
using Orchard.Workflows.Models;
|
||||
using Orchard.Workflows.Services;
|
||||
|
||||
namespace Orchard.Comments.Activities {
|
||||
[OrchardFeature("Orchard.Comments.Workflows")]
|
||||
public class CloseCommentsActivity : Task {
|
||||
|
||||
public CloseCommentsActivity() {
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace Orchard.Comments.Controllers {
|
||||
return this.RedirectLocal(returnUrl, "~/");
|
||||
|
||||
var comment = Services.ContentManager.New<CommentPart>("Comment");
|
||||
Services.ContentManager.Create(comment);
|
||||
Services.ContentManager.Create(comment, VersionOptions.Draft);
|
||||
|
||||
var editorShape = Services.ContentManager.UpdateEditor(comment, this);
|
||||
|
||||
|
||||
@@ -186,8 +186,6 @@ namespace Orchard.Comments.Drivers {
|
||||
if (contentItem != null) {
|
||||
part.Record.RepliedOn = contentItem.Id;
|
||||
}
|
||||
|
||||
contentItem.As<CommentsPart>().Record.CommentPartRecords.Add(part.Record);
|
||||
}
|
||||
|
||||
var commentedOnContainer = context.Attribute(part.PartDefinition.Name, "CommentedOnContainer");
|
||||
|
||||
@@ -22,20 +22,24 @@ namespace Orchard.Comments.Drivers {
|
||||
}
|
||||
|
||||
protected override DriverResult Display(CommentsPart part, string displayType, dynamic shapeHelper) {
|
||||
if (part.CommentsShown == false)
|
||||
return null;
|
||||
|
||||
var commentsForCommentedContent = _commentService.GetCommentsForCommentedContent(part.ContentItem.Id);
|
||||
var pendingCount = new Lazy<int>(() => commentsForCommentedContent.Where(x => x.Status == CommentStatus.Pending).Count());
|
||||
var approvedCount = new Lazy<int>(() => commentsForCommentedContent.Where(x => x.Status == CommentStatus.Approved).Count());
|
||||
|
||||
return Combined(
|
||||
ContentShape("Parts_ListOfComments",
|
||||
() => {
|
||||
if (part.CommentsShown == false)
|
||||
return null;
|
||||
|
||||
// create a hierarchy of shapes
|
||||
var firstLevelShapes = new List<dynamic>();
|
||||
var allShapes = new Dictionary<int, dynamic>();
|
||||
var comments = commentsForCommentedContent.Where(x => x.Status == CommentStatus.Approved).OrderBy(x => x.Position).List().ToList();
|
||||
var comments = _commentService
|
||||
.GetCommentsForCommentedContent(part.ContentItem.Id)
|
||||
.Where(x => x.Status == CommentStatus.Approved)
|
||||
.OrderBy(x => x.Position)
|
||||
.List()
|
||||
.ToList();
|
||||
|
||||
var approvedCount = comments.Count();
|
||||
|
||||
foreach (var item in comments) {
|
||||
var shape = shapeHelper.Parts_Comment(ContentPart: item, ContentItem: item.ContentItem);
|
||||
@@ -54,10 +58,14 @@ namespace Orchard.Comments.Drivers {
|
||||
|
||||
var list = shapeHelper.List(Items: firstLevelShapes);
|
||||
|
||||
return shapeHelper.Parts_ListOfComments(List: list, CommentCount: approvedCount.Value);
|
||||
return shapeHelper.Parts_ListOfComments(
|
||||
List: list,
|
||||
CommentCount: approvedCount);
|
||||
}),
|
||||
ContentShape("Parts_CommentForm",
|
||||
() => {
|
||||
if (part.CommentsShown == false)
|
||||
return null;
|
||||
|
||||
var newComment = _contentManager.New("Comment");
|
||||
if (newComment.Has<CommentPart>()) newComment.As<CommentPart>().CommentedOn = part.Id;
|
||||
@@ -66,9 +74,39 @@ namespace Orchard.Comments.Drivers {
|
||||
return shapeHelper.Parts_CommentForm(EditorShape: editorShape);
|
||||
}),
|
||||
ContentShape("Parts_Comments_Count",
|
||||
() => shapeHelper.Parts_Comments_Count(CommentCount: approvedCount.Value, PendingCount: pendingCount.Value)),
|
||||
() => {
|
||||
if (part.CommentsShown == false)
|
||||
return null;
|
||||
|
||||
var comments = _commentService
|
||||
.GetCommentsForCommentedContent(part.ContentItem.Id);
|
||||
var approvedCount = comments
|
||||
.Where(x => x.Status == CommentStatus.Approved)
|
||||
.Count();
|
||||
var pendingCount = comments
|
||||
.Where(x => x.Status == CommentStatus.Pending)
|
||||
.Count();
|
||||
|
||||
return shapeHelper.Parts_Comments_Count(
|
||||
CommentCount: approvedCount,
|
||||
PendingCount: pendingCount);
|
||||
}),
|
||||
ContentShape("Parts_Comments_Count_SummaryAdmin",
|
||||
() => shapeHelper.Parts_Comments_Count_SummaryAdmin(CommentCount: approvedCount.Value, PendingCount: pendingCount.Value))
|
||||
() => {
|
||||
|
||||
var comments = _commentService
|
||||
.GetCommentsForCommentedContent(part.ContentItem.Id);
|
||||
var approvedCount = comments
|
||||
.Where(x => x.Status == CommentStatus.Approved)
|
||||
.Count();
|
||||
var pendingCount = comments
|
||||
.Where(x => x.Status == CommentStatus.Pending)
|
||||
.Count();
|
||||
|
||||
return shapeHelper.Parts_Comments_Count_SummaryAdmin(
|
||||
CommentCount: approvedCount,
|
||||
PendingCount: pendingCount);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,12 +2,17 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.7.1
|
||||
OrchardVersion: 1.7.1
|
||||
Version: 1.7.2
|
||||
OrchardVersion: 1.7.2
|
||||
Description: The comments system implemented by this module can be applied to arbitrary Orchard content types, such as blogs and pages. It includes comment validation and spam protection through the Akismet service.
|
||||
Features:
|
||||
Orchard.Comments:
|
||||
Name: Comments
|
||||
Description: Standard content item comments.
|
||||
Dependencies: Settings, Orchard.Tokens, Orchard.Workflows
|
||||
Dependencies: Settings, Orchard.Tokens
|
||||
Category: Social
|
||||
Orchard.Comments.Workflows:
|
||||
Name: Comments Workflows Activities
|
||||
Description: Provides workflow activities for comments management.
|
||||
Category: Workflows
|
||||
Dependencies: Orchard.Workflows
|
||||
@@ -109,7 +109,6 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Module.txt" />
|
||||
<Content Include="Release notes.txt" />
|
||||
<Content Include="Styles\images\menu.comments.png" />
|
||||
<Content Include="Styles\menu.comments-admin.css" />
|
||||
<Content Include="Styles\orchard-comments-admin.css" />
|
||||
|
||||
@@ -30,5 +30,5 @@ using System.Security;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.7.1")]
|
||||
[assembly: AssemblyFileVersion("1.7.1")]
|
||||
[assembly: AssemblyVersion("1.7.2")]
|
||||
[assembly: AssemblyFileVersion("1.7.2")]
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
==== RELEASE NOTES ====
|
||||
|
||||
|
||||
== New features ==
|
||||
- Comment display and edit shapes are dynamically built, so parts can be attached to comments and placement can be configured (also for admin)
|
||||
|
||||
== Breaking changes ==
|
||||
- Css ids of the comment form's fields have changed
|
||||
TODO: list old ids and new one for migration steps. Changed because of usage of Html.FieldIdFor(...)
|
||||
|
||||
- CommentService (and ICommentService) has multiple breaking changes: CreateComment and UpdateComment was removed, use ContentManager methods instead
|
||||
- Comments used plenty of static viewmodels; some very completely removed, some changed adapting to comment shape building; if you've overridden any comment
|
||||
shapes, check them
|
||||
@@ -2,8 +2,8 @@ Name: Orchard.ContentPermissions
|
||||
AntiForgery: enabled
|
||||
Author: Chris Pyle, S<>bastien Ros
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.7.1
|
||||
OrchardVersion: 1.7.1
|
||||
Version: 1.7.2
|
||||
OrchardVersion: 1.7.2
|
||||
Description: Allows item-level front end view permissions.
|
||||
Features:
|
||||
Orchard.ContentPermissions:
|
||||
|
||||
@@ -31,5 +31,5 @@ using System.Security;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.7.1")]
|
||||
[assembly: AssemblyFileVersion("1.7.1")]
|
||||
[assembly: AssemblyVersion("1.7.2")]
|
||||
[assembly: AssemblyFileVersion("1.7.2")]
|
||||
|
||||
@@ -6,6 +6,7 @@ using Orchard.ContentManagement.Aspects;
|
||||
using Orchard.Roles.Models;
|
||||
using Orchard.Security;
|
||||
using Orchard.ContentPermissions.Models;
|
||||
using Orchard.Security.Permissions;
|
||||
|
||||
namespace Orchard.ContentPermissions.Security {
|
||||
public class AuthorizationEventHandler : IAuthorizationServiceEventHandler {
|
||||
@@ -51,19 +52,26 @@ namespace Orchard.ContentPermissions.Security {
|
||||
|
||||
IEnumerable<string> authorizedRoles;
|
||||
|
||||
if (context.Permission == Core.Contents.Permissions.ViewContent) {
|
||||
var grantingPermissions = PermissionNames(context.Permission, Enumerable.Empty<string>()).Distinct().ToArray();
|
||||
|
||||
if (grantingPermissions.Any(grantingPermission => String.Equals(Core.Contents.Permissions.ViewContent.Name, grantingPermission, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
authorizedRoles = (hasOwnership ? part.ViewOwnContent : part.ViewContent).Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
}
|
||||
else if (context.Permission == Core.Contents.Permissions.PublishContent) {
|
||||
authorizedRoles = (hasOwnership ? part.PublishOwnContent : part.PublishContent).Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
}
|
||||
else if (context.Permission == Core.Contents.Permissions.EditContent) {
|
||||
else if (grantingPermissions.Any(grantingPermission => String.Equals(Core.Contents.Permissions.EditContent.Name, grantingPermission, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
authorizedRoles = (hasOwnership ? part.EditOwnContent : part.EditContent).Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
}
|
||||
else if (context.Permission == Core.Contents.Permissions.DeleteContent) {
|
||||
else if (grantingPermissions.Any(grantingPermission => String.Equals(Core.Contents.Permissions.PublishContent.Name, grantingPermission, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
authorizedRoles = (hasOwnership ? part.PublishOwnContent : part.PublishContent).Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
}
|
||||
else if (grantingPermissions.Any(grantingPermission => String.Equals(Core.Contents.Permissions.DeleteContent.Name, grantingPermission, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
authorizedRoles = (hasOwnership ? part.DeleteOwnContent : part.DeleteContent).Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -100,5 +108,30 @@ namespace Orchard.ContentPermissions.Security {
|
||||
|
||||
return user.Id == common.Owner.Id;
|
||||
}
|
||||
|
||||
private static IEnumerable<string> PermissionNames(Permission permission, IEnumerable<string> stack)
|
||||
{
|
||||
// the given name is tested
|
||||
yield return permission.Name;
|
||||
|
||||
// iterate implied permissions to grant, it present
|
||||
if (permission.ImpliedBy != null && permission.ImpliedBy.Any())
|
||||
{
|
||||
foreach (var impliedBy in permission.ImpliedBy)
|
||||
{
|
||||
// avoid potential recursion
|
||||
if (stack.Contains(impliedBy.Name))
|
||||
continue;
|
||||
|
||||
// otherwise accumulate the implied permission names recursively
|
||||
foreach (var impliedName in PermissionNames(impliedBy, stack.Concat(new[] { permission.Name })))
|
||||
{
|
||||
yield return impliedName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
yield return StandardPermissions.SiteOwner.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -34,13 +34,6 @@
|
||||
</label>
|
||||
@Html.HiddenFor(m => m.ViewRoles[role.Index].Role)
|
||||
</td>
|
||||
<td>
|
||||
<label>
|
||||
<input type="checkbox" disabled="disabled" @if (Model.PublishRoles.Any(x => x.Role == role.Name && x.Default)) { <text>checked="checked"</text> } title="Current value"/>
|
||||
<input type="checkbox" value="true" @if (Model.PublishRoles.Any(x => x.Role == role.Name && x.Checked)) { <text>checked="checked"</text> } name="@Html.FieldNameFor(m => m.PublishRoles[role.Index].Checked)" id="@Html.FieldIdFor(m => m.PublishRoles[role.Index].Checked)" @if (!Model.PublishRoles[role.Index].Enabled) { <text>disabled="disabled"</text> }/>
|
||||
</label>
|
||||
@Html.HiddenFor(m => m.PublishRoles[role.Index].Role)
|
||||
</td>
|
||||
<td>
|
||||
<label>
|
||||
<input type="checkbox" disabled="disabled" @if (Model.EditRoles.Any(x => x.Role == role.Name && x.Default)) { <text>checked="checked"</text> } title="Current value"/>
|
||||
@@ -48,6 +41,13 @@
|
||||
</label>
|
||||
@Html.HiddenFor(m => m.EditRoles[role.Index].Role)
|
||||
</td>
|
||||
<td>
|
||||
<label>
|
||||
<input type="checkbox" disabled="disabled" @if (Model.PublishRoles.Any(x => x.Role == role.Name && x.Default)) { <text>checked="checked"</text> } title="Current value"/>
|
||||
<input type="checkbox" value="true" @if (Model.PublishRoles.Any(x => x.Role == role.Name && x.Checked)) { <text>checked="checked"</text> } name="@Html.FieldNameFor(m => m.PublishRoles[role.Index].Checked)" id="@Html.FieldIdFor(m => m.PublishRoles[role.Index].Checked)" @if (!Model.PublishRoles[role.Index].Enabled) { <text>disabled="disabled"</text> }/>
|
||||
</label>
|
||||
@Html.HiddenFor(m => m.PublishRoles[role.Index].Role)
|
||||
</td>
|
||||
<td>
|
||||
<label>
|
||||
<input type="checkbox" disabled="disabled" @if (Model.DeleteRoles.Any(x => x.Role == role.Name && x.Default)) { <text>checked="checked"</text> } title="Current value"/>
|
||||
@@ -78,13 +78,6 @@
|
||||
</label>
|
||||
@Html.HiddenFor(m => m.ViewOwnRoles[role.Index].Role)
|
||||
</td>
|
||||
<td>
|
||||
<label>
|
||||
<input type="checkbox" disabled="disabled" @if (Model.PublishOwnRoles.Any(x => x.Role == role.Name && x.Default)) { <text>checked="checked"</text> } title="Current value"/>
|
||||
<input type="checkbox" value="true" @if (Model.PublishOwnRoles.Any(x => x.Role == role.Name && x.Checked)) { <text>checked="checked"</text> } name="@Html.FieldNameFor(m => m.PublishOwnRoles[role.Index].Checked)" id="@Html.FieldIdFor(m => m.PublishOwnRoles[role.Index].Checked)" @if (!Model.PublishOwnRoles[role.Index].Enabled) { <text>disabled="disabled"</text> }/>
|
||||
</label>
|
||||
@Html.HiddenFor(m => m.PublishOwnRoles[role.Index].Role)
|
||||
</td>
|
||||
<td>
|
||||
<label>
|
||||
<input type="checkbox" disabled="disabled" @if (Model.EditOwnRoles.Any(x => x.Role == role.Name && x.Default)) { <text>checked="checked"</text> } title="Current value"/>
|
||||
@@ -92,6 +85,13 @@
|
||||
</label>
|
||||
@Html.HiddenFor(m => m.EditOwnRoles[role.Index].Role)
|
||||
</td>
|
||||
<td>
|
||||
<label>
|
||||
<input type="checkbox" disabled="disabled" @if (Model.PublishOwnRoles.Any(x => x.Role == role.Name && x.Default)) { <text>checked="checked"</text> } title="Current value"/>
|
||||
<input type="checkbox" value="true" @if (Model.PublishOwnRoles.Any(x => x.Role == role.Name && x.Checked)) { <text>checked="checked"</text> } name="@Html.FieldNameFor(m => m.PublishOwnRoles[role.Index].Checked)" id="@Html.FieldIdFor(m => m.PublishOwnRoles[role.Index].Checked)" @if (!Model.PublishOwnRoles[role.Index].Enabled) { <text>disabled="disabled"</text> }/>
|
||||
</label>
|
||||
@Html.HiddenFor(m => m.PublishOwnRoles[role.Index].Role)
|
||||
</td>
|
||||
<td>
|
||||
<label>
|
||||
<input type="checkbox" disabled="disabled" @if (Model.DeleteOwnRoles.Any(x => x.Role == role.Name && x.Default)) { <text>checked="checked"</text> } title="Current value"/>
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace Orchard.ContentPicker.Controllers {
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
if (contentPickerMenuItem.Items.All(x => x.Text.ToString() != T("Recent Content").Text)) {
|
||||
if (contentPickerMenuItem.Items.All(x => x.Text.TextHint != "Recent Content")) {
|
||||
// the default tab should not be displayed, redirect to the next one
|
||||
var root = menuItems.FirstOrDefault();
|
||||
if (root == null) {
|
||||
|
||||
@@ -2,8 +2,8 @@ Name: Orchard.ContentPicker
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardcontentpicker.codeplex.com
|
||||
Version: 1.7.1
|
||||
OrchardVersion: 1.7.1
|
||||
Version: 1.7.2
|
||||
OrchardVersion: 1.7.2
|
||||
Description: UI for selecting Content Items.
|
||||
Features:
|
||||
Orchard.ContentPicker:
|
||||
|
||||
@@ -31,6 +31,6 @@ using System.Security;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.7.1")]
|
||||
[assembly: AssemblyFileVersion("1.7.1")]
|
||||
[assembly: AssemblyVersion("1.7.2")]
|
||||
[assembly: AssemblyFileVersion("1.7.2")]
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.7.1
|
||||
OrchardVersion: 1.7.1
|
||||
Version: 1.7.2
|
||||
OrchardVersion: 1.7.2
|
||||
Description: ContentTypes modules enables the creation and alteration of content types not based on code.
|
||||
Dependencies: Contents
|
||||
Category: Content
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user