mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Moving default patterns to migrations. Custom patterns can still be defined
in recipes. --HG-- branch : 1.x
This commit is contained in:
@@ -11,11 +11,11 @@ namespace Orchard.Pages {
|
||||
.WithSetting("DateEditorSettings.ShowDateEditor", "true"))
|
||||
.WithPart("PublishLaterPart")
|
||||
.WithPart("TitlePart")
|
||||
.WithPart("AutoroutePart", builder => builder
|
||||
.WithSetting("AutorouteSettings.AllowCustomPattern", "true")
|
||||
.WithSetting("AutorouteSettings.AutomaticAdjustmentOnEdit", "false")
|
||||
.WithSetting("AutorouteSettings.PatternDefinitions", "[{Name:'Title', Pattern: '{Content.Slug}', Description: 'my-page'}]")
|
||||
.WithSetting("AutorouteSettings.DefaultPatternIndex", "0"))
|
||||
.WithPart("AutoroutePart", builder => builder
|
||||
.WithSetting("AutorouteSettings.AllowCustomPattern", "true")
|
||||
.WithSetting("AutorouteSettings.AutomaticAdjustmentOnEdit", "false")
|
||||
.WithSetting("AutorouteSettings.PatternDefinitions", "[{Name:'Title', Pattern: '{Content.Slug}', Description: 'my-page'}]")
|
||||
.WithSetting("AutorouteSettings.DefaultPatternIndex", "0"))
|
||||
.WithPart("BodyPart")
|
||||
.Creatable());
|
||||
|
||||
|
||||
@@ -147,7 +147,7 @@ namespace Orchard.Roles.Services {
|
||||
public IEnumerable<string> GetPermissionsForRoleByName(string name) {
|
||||
return _cacheManager.Get(name, ctx => {
|
||||
MonitorSignal(ctx);
|
||||
return GetPermissionsForRoleByNameInner(name);
|
||||
return GetPermissionsForRoleByNameInner(name).ToList();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ using Orchard.Environment.Extensions;
|
||||
using Orchard.Environment.Extensions.Models;
|
||||
using Orchard.Logging;
|
||||
using Orchard.Utility;
|
||||
using Orchard.Utility.Extensions;
|
||||
|
||||
namespace Orchard.DisplayManagement.Descriptors {
|
||||
|
||||
@@ -41,7 +42,7 @@ namespace Orchard.DisplayManagement.Descriptors {
|
||||
|
||||
var builder = new ShapeTableBuilder(strategyDefaultFeature);
|
||||
bindingStrategy.Value.Discover(builder);
|
||||
return builder.BuildAlterations().ToList();
|
||||
return builder.BuildAlterations().ToReadOnlyCollection();
|
||||
});
|
||||
|
||||
var alterations = alterationSets
|
||||
|
||||
+2
-1
@@ -13,6 +13,7 @@ using Orchard.Environment.Extensions;
|
||||
using Orchard.Environment.Extensions.Models;
|
||||
using Orchard.FileSystems.VirtualPath;
|
||||
using Orchard.Logging;
|
||||
using Orchard.Utility.Extensions;
|
||||
|
||||
namespace Orchard.DisplayManagement.Descriptors.ShapeTemplateStrategy {
|
||||
public class ShapeTemplateBindingStrategy : IShapeTableProvider {
|
||||
@@ -70,7 +71,7 @@ namespace Orchard.DisplayManagement.Descriptors.ShapeTemplateStrategy {
|
||||
var virtualPath = Path.Combine(basePath, subPath).Replace(Path.DirectorySeparatorChar, '/');
|
||||
var fileNames = _cacheManager.Get(virtualPath, ctx => {
|
||||
ctx.Monitor(_virtualPathMonitor.WhenPathChanges(virtualPath));
|
||||
return _virtualPathProvider.ListFiles(virtualPath).Select(Path.GetFileName);
|
||||
return _virtualPathProvider.ListFiles(virtualPath).Select(Path.GetFileName).ToReadOnlyCollection();
|
||||
});
|
||||
return new { harvesterInfo.harvester, basePath, subPath, virtualPath, fileNames };
|
||||
})).ToList();
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace Orchard.Environment.Extensions.Folders {
|
||||
|
||||
return _cacheManager.Get(key, ctx => {
|
||||
ctx.Monitor(_webSiteFolder.WhenPathChanges(path));
|
||||
return AvailableExtensionsInFolder(path, extensionType, manifestName, manifestIsOptional);
|
||||
return AvailableExtensionsInFolder(path, extensionType, manifestName, manifestIsOptional).ToReadOnlyCollection();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ using System.Xml.Linq;
|
||||
using Orchard.Caching;
|
||||
using Orchard.FileSystems.AppData;
|
||||
using Orchard.Localization;
|
||||
using Orchard.Utility.Extensions;
|
||||
|
||||
namespace Orchard.FileSystems.Dependencies {
|
||||
public class DefaultDependenciesFolder : IDependenciesFolder {
|
||||
@@ -40,7 +41,7 @@ namespace Orchard.FileSystems.Dependencies {
|
||||
_writeThroughToken.IsCurrent = true;
|
||||
ctx.Monitor(_writeThroughToken);
|
||||
|
||||
return ReadDependencies(ctx.Key).ToList();
|
||||
return ReadDependencies(ctx.Key).ToReadOnlyCollection();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user