mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-07-31 20:18:40 +08:00
Merge with 1.5.x
This commit is contained in:
commit
ab1d97616c
@ -1,7 +1,7 @@
|
||||
c47525e90819321d37962a11313006a4ccfc8362 src/Orchard.Web/Modules/Orchard.AntiSpam
|
||||
03306c0dad118c03c4ee21ce274a5f9c5855aec3 src/Orchard.Web/Modules/Orchard.Autoroute
|
||||
5eb5861244852a382332abfbfe2d28ac1b9bd419 src/Orchard.Web/Modules/Orchard.ContentPermissions
|
||||
799cc531071f48e4b2aed07188685f9c5918f24e src/Orchard.Web/Modules/Orchard.ContentPicker
|
||||
e402ad87a17019d745d692f4d5e29f8174868764 src/Orchard.Web/Modules/Orchard.ContentPicker
|
||||
4b72948eaa72b8726fa0e000dffc9db8c440903d src/Orchard.Web/Modules/Orchard.CustomForms
|
||||
b639cb33d2ba038de6048350400b664399608996 src/Orchard.Web/Modules/Orchard.Forms
|
||||
b748de63e3cf8debfc3eba77f26089705147047d src/Orchard.Web/Modules/Orchard.Rules
|
||||
|
@ -2,8 +2,8 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.5
|
||||
OrchardVersion: 1.5
|
||||
Version: 1.5.1
|
||||
OrchardVersion: 1.5.1
|
||||
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
|
||||
|
@ -2,8 +2,8 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.4.2
|
||||
OrchardVersion: 1.4.2
|
||||
Version: 1.5.1
|
||||
OrchardVersion: 1.5.1
|
||||
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
|
||||
|
@ -2,8 +2,8 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.5
|
||||
OrchardVersion: 1.5
|
||||
Version: 1.5.1
|
||||
OrchardVersion: 1.5.1
|
||||
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.5
|
||||
OrchardVersion: 1.5
|
||||
Version: 1.5.1
|
||||
OrchardVersion: 1.5.1
|
||||
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.5
|
||||
OrchardVersion: 1.5
|
||||
Version: 1.5.1
|
||||
OrchardVersion: 1.5.1
|
||||
Description: The Feeds module is providing RSS feeds to content items.
|
||||
FeatureDescription: RSS feeds for content items.
|
||||
Category: Syndication
|
||||
|
@ -1,6 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Routing;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.Core.Common.Models;
|
||||
using Orchard.Core.Navigation.Models;
|
||||
@ -78,7 +79,7 @@ namespace Orchard.Core.Navigation.Controllers {
|
||||
}
|
||||
|
||||
[HttpPost, ActionName("Index")]
|
||||
public ActionResult IndexPOST(IList<MenuItemEntry> menuItemEntries) {
|
||||
public ActionResult IndexPOST(IList<MenuItemEntry> menuItemEntries, int? menuId) {
|
||||
if (!Services.Authorizer.Authorize(Permissions.ManageMainMenu, T("Couldn't manage the main menu")))
|
||||
return new HttpUnauthorizedResult();
|
||||
|
||||
@ -90,7 +91,7 @@ namespace Orchard.Core.Navigation.Controllers {
|
||||
}
|
||||
}
|
||||
|
||||
return RedirectToAction("Index");
|
||||
return RedirectToAction("Index", new { menuId });
|
||||
}
|
||||
|
||||
private MenuItemEntry CreateMenuItemEntries(MenuPart menuPart) {
|
||||
@ -112,8 +113,11 @@ namespace Orchard.Core.Navigation.Controllers {
|
||||
return new HttpUnauthorizedResult();
|
||||
|
||||
MenuPart menuPart = _menuService.Get(id);
|
||||
int? menuId = null;
|
||||
|
||||
if (menuPart != null) {
|
||||
menuId = menuPart.Menu.Id;
|
||||
|
||||
// if the menu item is a concrete content item, don't delete it, just unreference the menu
|
||||
if (!menuPart.ContentItem.TypeDefinition.Settings.ContainsKey("Stereotype") || menuPart.ContentItem.TypeDefinition.Settings["Stereotype"] != "MenuItem") {
|
||||
menuPart.Menu = null;
|
||||
@ -123,7 +127,7 @@ namespace Orchard.Core.Navigation.Controllers {
|
||||
}
|
||||
}
|
||||
|
||||
return RedirectToAction("Index");
|
||||
return RedirectToAction("Index", new { menuId });
|
||||
}
|
||||
|
||||
bool IUpdateModel.TryUpdateModel<TModel>(TModel model, string prefix, string[] includeProperties, string[] excludeProperties) {
|
||||
|
@ -43,6 +43,10 @@ namespace Orchard.Core.Navigation.Drivers {
|
||||
}
|
||||
protected override DriverResult Display(MenuWidgetPart part, string displayType, dynamic shapeHelper) {
|
||||
return ContentShape( "Parts_MenuWidget", () => {
|
||||
if(part.Menu == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var menu = _menuService.GetMenu(part.Menu.Id);
|
||||
|
||||
if(menu == null) {
|
||||
|
@ -2,8 +2,8 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.5
|
||||
OrchardVersion: 1.5
|
||||
Version: 1.5.1
|
||||
OrchardVersion: 1.5.1
|
||||
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
|
||||
|
@ -24,7 +24,7 @@
|
||||
}
|
||||
</select>
|
||||
<button type="submit" class="apply-bulk-actions-auto">@T("Show")</button>
|
||||
@Html.ActionLink(T("Edit").Text, "Edit", "Admin", new { area = "Contents", id = Model.CurrentMenu.Id, returnUrl = Url.Action("Index", "Admin", new { area = "Navigation" }) }, new { @class = "button" })
|
||||
@Html.ActionLink(T("Edit").Text, "Edit", "Admin", new { area = "Contents", id = Model.CurrentMenu.Id, returnUrl = Url.Action("Index", "Admin", new { area = "Navigation", menuId = Model.CurrentMenu.Id }) }, new { @class = "button" })
|
||||
</fieldset>
|
||||
}
|
||||
}
|
||||
@ -35,6 +35,7 @@
|
||||
|
||||
|
||||
@using (Html.BeginFormAntiForgeryPost()) {
|
||||
@Html.Hidden("menuId", Model.CurrentMenu.Id)
|
||||
<div class="sections">
|
||||
<div class="primary">
|
||||
<div class="container">
|
||||
|
@ -24,7 +24,7 @@
|
||||
jQuery('#title-@Html.FieldIdFor(m => m.ContentItemId)').text(data.displayText);
|
||||
|
||||
// define the menu text if it's empty
|
||||
var menuText = jQuery('#MenuText');
|
||||
var menuText = jQuery('#MenuPart_MenuText');
|
||||
if (menuText.val().length == 0) {
|
||||
menuText.val(data.displayText);
|
||||
}
|
||||
|
@ -2,8 +2,8 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.5
|
||||
OrchardVersion: 1.5
|
||||
Version: 1.5.1
|
||||
OrchardVersion: 1.5.1
|
||||
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.5
|
||||
OrchardVersion: 1.5
|
||||
Version: 1.5.1
|
||||
OrchardVersion: 1.5.1
|
||||
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.5
|
||||
OrchardVersion: 1.5
|
||||
Version: 1.5.1
|
||||
OrchardVersion: 1.5.1
|
||||
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.5
|
||||
OrchardVersion: 1.5
|
||||
Version: 1.5.1
|
||||
OrchardVersion: 1.5.1
|
||||
Description: The shapes module contains core shape templates and display hooks.
|
||||
FeatureDescription: Core shape templates and display hooks.
|
||||
Category: Core
|
||||
|
@ -2,8 +2,8 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.5
|
||||
OrchardVersion: 1.5
|
||||
Version: 1.5.1
|
||||
OrchardVersion: 1.5.1
|
||||
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.5
|
||||
OrchardVersion: 1.5
|
||||
Version: 1.5.1
|
||||
OrchardVersion: 1.5.1
|
||||
Description: The XmlRpc module enables creation of contents from client applications such as LiveWriter.
|
||||
FeatureDescription: XML-RPC opt-in implementation.
|
||||
Category: Content Publishing
|
||||
|
@ -1,6 +1,5 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
@ -34,6 +33,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.5")]
|
||||
[assembly: AssemblyFileVersion("1.5")]
|
||||
[assembly: AssemblyVersion("1.5.1")]
|
||||
[assembly: AssemblyFileVersion("1.5.1")]
|
||||
|
||||
|
@ -35,6 +35,6 @@ using System.Security;
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
|
||||
[assembly: AssemblyVersion("1.5")]
|
||||
[assembly: AssemblyFileVersion("1.5")]
|
||||
[assembly: AssemblyVersion("1.5.1")]
|
||||
[assembly: AssemblyFileVersion("1.5.1")]
|
||||
|
||||
|
@ -196,27 +196,24 @@ namespace Orchard.UI.Navigation {
|
||||
|
||||
foreach (var item in items) {
|
||||
MenuItem parent = null;
|
||||
var position = item.Position;
|
||||
|
||||
var parentPosition = String.Empty;
|
||||
|
||||
while (parent == null && !String.IsNullOrEmpty(position)) {
|
||||
if (index.TryGetValue(position, out parent)) {
|
||||
parent.Items = parent.Items.Concat(new [] { item });
|
||||
}
|
||||
var lastSegment = item.Position.LastIndexOf('.');
|
||||
if (lastSegment != -1) {
|
||||
parentPosition = item.Position.Substring(0, lastSegment);
|
||||
}
|
||||
|
||||
position = position.Substring(0, position.Length - 1);
|
||||
};
|
||||
if (index.TryGetValue(parentPosition, out parent)) {
|
||||
parent.Items = parent.Items.Concat(new [] { item });
|
||||
}
|
||||
else {
|
||||
result.Add(item);
|
||||
}
|
||||
|
||||
if (!index.ContainsKey(item.Position)) {
|
||||
// prevent invalid positions
|
||||
index.Add(item.Position, item);
|
||||
}
|
||||
|
||||
|
||||
// if the current element has no parent, it's a top level item
|
||||
if (parent == null) {
|
||||
result.Add(item);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
|
Loading…
Reference in New Issue
Block a user