mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Merge
--HG-- branch : dev
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,7 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Orchard.ContentManagement;
|
using Orchard.ContentManagement;
|
||||||
using Orchard.ContentManagement.MetaData;
|
using Orchard.ContentManagement.MetaData;
|
||||||
|
using Orchard.Core.Contents.Settings;
|
||||||
using Orchard.Localization;
|
using Orchard.Localization;
|
||||||
using Orchard.UI.Navigation;
|
using Orchard.UI.Navigation;
|
||||||
|
|
||||||
@@ -22,7 +23,7 @@ namespace Orchard.Core.Contents {
|
|||||||
|
|
||||||
builder.Add(T("Content"), "2", menu => {
|
builder.Add(T("Content"), "2", menu => {
|
||||||
menu.Add(T("Manage Content"), "1", item => item.Action("List", "Admin", new { area = "Contents", id = "" }));
|
menu.Add(T("Manage Content"), "1", item => item.Action("List", "Admin", new { area = "Contents", id = "" }));
|
||||||
foreach (var contentTypeDefinition in contentTypeDefinitions) {
|
foreach (var contentTypeDefinition in contentTypeDefinitions.Where(ctd => ctd.Settings.GetModel<ContentTypeSettings>().Creatable)) {
|
||||||
var ci = _contentManager.New(contentTypeDefinition.Name);
|
var ci = _contentManager.New(contentTypeDefinition.Name);
|
||||||
var cim = _contentManager.GetItemMetadata(ci);
|
var cim = _contentManager.GetItemMetadata(ci);
|
||||||
var createRouteValues = cim.CreateRouteValues;
|
var createRouteValues = cim.CreateRouteValues;
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
namespace Orchard.Core.Contents.Settings {
|
||||||
|
public class ContentTypeSettings {
|
||||||
|
/// <summary>
|
||||||
|
/// This setting is used to display a Content Type in Content Mamagement menu like
|
||||||
|
/// </summary>
|
||||||
|
public bool Creatable { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -84,6 +84,7 @@
|
|||||||
<Compile Include="Contents\Handlers\ContentsHandler.cs" />
|
<Compile Include="Contents\Handlers\ContentsHandler.cs" />
|
||||||
<Compile Include="Contents\Permissions.cs" />
|
<Compile Include="Contents\Permissions.cs" />
|
||||||
<Compile Include="Contents\Routes.cs" />
|
<Compile Include="Contents\Routes.cs" />
|
||||||
|
<Compile Include="Contents\Settings\ContentTypeSettings.cs" />
|
||||||
<Compile Include="Contents\ViewModels\PublishContentViewModel.cs" />
|
<Compile Include="Contents\ViewModels\PublishContentViewModel.cs" />
|
||||||
<Compile Include="Localization\ViewModels\EditLocalizationViewModel.cs" />
|
<Compile Include="Localization\ViewModels\EditLocalizationViewModel.cs" />
|
||||||
<Compile Include="PublishLater\DataMigrations\PublishLaterDataMigration.cs" />
|
<Compile Include="PublishLater\DataMigrations\PublishLaterDataMigration.cs" />
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ using System.Runtime.InteropServices;
|
|||||||
[assembly: AssemblyDescription("")]
|
[assembly: AssemblyDescription("")]
|
||||||
[assembly: AssemblyConfiguration("")]
|
[assembly: AssemblyConfiguration("")]
|
||||||
[assembly: AssemblyProduct("Orchard")]
|
[assembly: AssemblyProduct("Orchard")]
|
||||||
[assembly: AssemblyCopyright("Copyright © CodePlex Foundation 2009")]
|
[assembly: AssemblyCopyright("")]
|
||||||
[assembly: AssemblyTrademark("")]
|
[assembly: AssemblyTrademark("")]
|
||||||
[assembly: AssemblyCulture("")]
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
|||||||
@@ -16,5 +16,15 @@ namespace Orchard.Pages.DataMigrations {
|
|||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public int UpdateFrom1() {
|
||||||
|
ContentDefinitionManager.AlterTypeDefinition("Page",
|
||||||
|
cfg => cfg
|
||||||
|
.WithSetting("ContentTypeSettings.Creatable", "true")
|
||||||
|
);
|
||||||
|
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user