mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +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 Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.MetaData;
|
||||
using Orchard.Core.Contents.Settings;
|
||||
using Orchard.Localization;
|
||||
using Orchard.UI.Navigation;
|
||||
|
||||
@@ -22,7 +23,7 @@ namespace Orchard.Core.Contents {
|
||||
|
||||
builder.Add(T("Content"), "2", menu => {
|
||||
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 cim = _contentManager.GetItemMetadata(ci);
|
||||
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\Permissions.cs" />
|
||||
<Compile Include="Contents\Routes.cs" />
|
||||
<Compile Include="Contents\Settings\ContentTypeSettings.cs" />
|
||||
<Compile Include="Contents\ViewModels\PublishContentViewModel.cs" />
|
||||
<Compile Include="Localization\ViewModels\EditLocalizationViewModel.cs" />
|
||||
<Compile Include="PublishLater\DataMigrations\PublishLaterDataMigration.cs" />
|
||||
|
@@ -9,7 +9,7 @@ using System.Runtime.InteropServices;
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyProduct("Orchard")]
|
||||
[assembly: AssemblyCopyright("Copyright © CodePlex Foundation 2009")]
|
||||
[assembly: AssemblyCopyright("")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
|
@@ -16,5 +16,15 @@ namespace Orchard.Pages.DataMigrations {
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
public int UpdateFrom1() {
|
||||
ContentDefinitionManager.AlterTypeDefinition("Page",
|
||||
cfg => cfg
|
||||
.WithSetting("ContentTypeSettings.Creatable", "true")
|
||||
);
|
||||
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user