Merge with 1.5.x

This commit is contained in:
Sebastien Ros
2012-07-20 11:35:48 -07:00
20 changed files with 54 additions and 49 deletions

View File

@@ -1,7 +1,7 @@
c47525e90819321d37962a11313006a4ccfc8362 src/Orchard.Web/Modules/Orchard.AntiSpam c47525e90819321d37962a11313006a4ccfc8362 src/Orchard.Web/Modules/Orchard.AntiSpam
03306c0dad118c03c4ee21ce274a5f9c5855aec3 src/Orchard.Web/Modules/Orchard.Autoroute 03306c0dad118c03c4ee21ce274a5f9c5855aec3 src/Orchard.Web/Modules/Orchard.Autoroute
5eb5861244852a382332abfbfe2d28ac1b9bd419 src/Orchard.Web/Modules/Orchard.ContentPermissions 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 4b72948eaa72b8726fa0e000dffc9db8c440903d src/Orchard.Web/Modules/Orchard.CustomForms
b639cb33d2ba038de6048350400b664399608996 src/Orchard.Web/Modules/Orchard.Forms b639cb33d2ba038de6048350400b664399608996 src/Orchard.Web/Modules/Orchard.Forms
b748de63e3cf8debfc3eba77f26089705147047d src/Orchard.Web/Modules/Orchard.Rules b748de63e3cf8debfc3eba77f26089705147047d src/Orchard.Web/Modules/Orchard.Rules

View File

@@ -2,8 +2,8 @@
AntiForgery: enabled AntiForgery: enabled
Author: The Orchard Team Author: The Orchard Team
Website: http://orchardproject.net Website: http://orchardproject.net
Version: 1.5 Version: 1.5.1
OrchardVersion: 1.5 OrchardVersion: 1.5.1
Description: The common module introduces content parts that are going to be used by most content types (common, body, identity). Description: The common module introduces content parts that are going to be used by most content types (common, body, identity).
FeatureDescription: Core content parts. FeatureDescription: Core content parts.
Dependencies: Settings Dependencies: Settings

View File

@@ -2,8 +2,8 @@
AntiForgery: enabled AntiForgery: enabled
Author: The Orchard Team Author: The Orchard Team
Website: http://orchardproject.net Website: http://orchardproject.net
Version: 1.4.2 Version: 1.5.1
OrchardVersion: 1.4.2 OrchardVersion: 1.5.1
Description: The containers module introduces container and containable behaviors for content items. 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. FeatureDescription: Container and containable parts to enable parent-child relationships between content items.
Dependencies: Contents, Feeds Dependencies: Contents, Feeds

View File

@@ -2,8 +2,8 @@
AntiForgery: enabled AntiForgery: enabled
Author: The Orchard Team Author: The Orchard Team
Website: http://orchardproject.net Website: http://orchardproject.net
Version: 1.5 Version: 1.5.1
OrchardVersion: 1.5 OrchardVersion: 1.5.1
Description: The contents module enables the creation of custom content types. Description: The contents module enables the creation of custom content types.
Features: Features:
Contents Contents

View File

@@ -2,8 +2,8 @@
AntiForgery: enabled AntiForgery: enabled
Author: The Orchard Team Author: The Orchard Team
Website: http://orchardproject.net Website: http://orchardproject.net
Version: 1.5 Version: 1.5.1
OrchardVersion: 1.5 OrchardVersion: 1.5.1
Description: The dashboard module is providing the dashboard screen of the admininstration UI of the application. Description: The dashboard module is providing the dashboard screen of the admininstration UI of the application.
FeatureDescription: Standard admin dashboard. FeatureDescription: Standard admin dashboard.
Category: Core Category: Core

View File

@@ -2,8 +2,8 @@
AntiForgery: enabled AntiForgery: enabled
Author: The Orchard Team Author: The Orchard Team
Website: http://orchardproject.net Website: http://orchardproject.net
Version: 1.5 Version: 1.5.1
OrchardVersion: 1.5 OrchardVersion: 1.5.1
Description: The Feeds module is providing RSS feeds to content items. Description: The Feeds module is providing RSS feeds to content items.
FeatureDescription: RSS feeds for content items. FeatureDescription: RSS feeds for content items.
Category: Syndication Category: Syndication

View File

@@ -1,6 +1,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Web.Mvc; using System.Web.Mvc;
using System.Web.Routing;
using Orchard.ContentManagement; using Orchard.ContentManagement;
using Orchard.Core.Common.Models; using Orchard.Core.Common.Models;
using Orchard.Core.Navigation.Models; using Orchard.Core.Navigation.Models;
@@ -78,7 +79,7 @@ namespace Orchard.Core.Navigation.Controllers {
} }
[HttpPost, ActionName("Index")] [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"))) if (!Services.Authorizer.Authorize(Permissions.ManageMainMenu, T("Couldn't manage the main menu")))
return new HttpUnauthorizedResult(); 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) { private MenuItemEntry CreateMenuItemEntries(MenuPart menuPart) {
@@ -112,8 +113,11 @@ namespace Orchard.Core.Navigation.Controllers {
return new HttpUnauthorizedResult(); return new HttpUnauthorizedResult();
MenuPart menuPart = _menuService.Get(id); MenuPart menuPart = _menuService.Get(id);
int? menuId = null;
if (menuPart != 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 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") { if (!menuPart.ContentItem.TypeDefinition.Settings.ContainsKey("Stereotype") || menuPart.ContentItem.TypeDefinition.Settings["Stereotype"] != "MenuItem") {
menuPart.Menu = null; 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) { bool IUpdateModel.TryUpdateModel<TModel>(TModel model, string prefix, string[] includeProperties, string[] excludeProperties) {

View File

@@ -43,6 +43,10 @@ namespace Orchard.Core.Navigation.Drivers {
} }
protected override DriverResult Display(MenuWidgetPart part, string displayType, dynamic shapeHelper) { protected override DriverResult Display(MenuWidgetPart part, string displayType, dynamic shapeHelper) {
return ContentShape( "Parts_MenuWidget", () => { return ContentShape( "Parts_MenuWidget", () => {
if(part.Menu == null) {
return null;
}
var menu = _menuService.GetMenu(part.Menu.Id); var menu = _menuService.GetMenu(part.Menu.Id);
if(menu == null) { if(menu == null) {

View File

@@ -2,8 +2,8 @@
AntiForgery: enabled AntiForgery: enabled
Author: The Orchard Team Author: The Orchard Team
Website: http://orchardproject.net Website: http://orchardproject.net
Version: 1.5 Version: 1.5.1
OrchardVersion: 1.5 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. 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. FeatureDescription: Menu management.
Category: Core Category: Core

View File

@@ -24,7 +24,7 @@
} }
</select> </select>
<button type="submit" class="apply-bulk-actions-auto">@T("Show")</button> <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> </fieldset>
} }
} }
@@ -35,6 +35,7 @@
@using (Html.BeginFormAntiForgeryPost()) { @using (Html.BeginFormAntiForgeryPost()) {
@Html.Hidden("menuId", Model.CurrentMenu.Id)
<div class="sections"> <div class="sections">
<div class="primary"> <div class="primary">
<div class="container"> <div class="container">

View File

@@ -24,7 +24,7 @@
jQuery('#title-@Html.FieldIdFor(m => m.ContentItemId)').text(data.displayText); jQuery('#title-@Html.FieldIdFor(m => m.ContentItemId)').text(data.displayText);
// define the menu text if it's empty // define the menu text if it's empty
var menuText = jQuery('#MenuText'); var menuText = jQuery('#MenuPart_MenuText');
if (menuText.val().length == 0) { if (menuText.val().length == 0) {
menuText.val(data.displayText); menuText.val(data.displayText);
} }

View File

@@ -2,8 +2,8 @@
AntiForgery: enabled AntiForgery: enabled
Author: The Orchard Team Author: The Orchard Team
Website: http://orchardproject.net Website: http://orchardproject.net
Version: 1.5 Version: 1.5.1
OrchardVersion: 1.5 OrchardVersion: 1.5.1
Description: The dashboard module is providing the reports screen of the application. Description: The dashboard module is providing the reports screen of the application.
FeatureDescription: Reports management. FeatureDescription: Reports management.
Category: Core Category: Core

View File

@@ -2,8 +2,8 @@
AntiForgery: enabled AntiForgery: enabled
Author: The Orchard Team Author: The Orchard Team
Website: http://orchardproject.net Website: http://orchardproject.net
Version: 1.5 Version: 1.5.1
OrchardVersion: 1.5 OrchardVersion: 1.5.1
Description: The scheduling module enables background task scheduling. Description: The scheduling module enables background task scheduling.
FeatureDescription: Scheduled background tasks. FeatureDescription: Scheduled background tasks.
Category: Core Category: Core

View File

@@ -2,8 +2,8 @@
AntiForgery: enabled AntiForgery: enabled
Author: The Orchard Team Author: The Orchard Team
Website: http://orchardproject.net Website: http://orchardproject.net
Version: 1.5 Version: 1.5.1
OrchardVersion: 1.5 OrchardVersion: 1.5.1
Description: The settings module creates site settings that other modules can contribute to. Description: The settings module creates site settings that other modules can contribute to.
FeatureDescription: Site settings. FeatureDescription: Site settings.
Category: Core Category: Core

View File

@@ -2,8 +2,8 @@
AntiForgery: enabled AntiForgery: enabled
Author: The Orchard Team Author: The Orchard Team
Website: http://orchardproject.net Website: http://orchardproject.net
Version: 1.5 Version: 1.5.1
OrchardVersion: 1.5 OrchardVersion: 1.5.1
Description: The shapes module contains core shape templates and display hooks. Description: The shapes module contains core shape templates and display hooks.
FeatureDescription: Core shape templates and display hooks. FeatureDescription: Core shape templates and display hooks.
Category: Core Category: Core

View File

@@ -2,8 +2,8 @@
AntiForgery: enabled AntiForgery: enabled
Author: The Orchard Team Author: The Orchard Team
Website: http://orchardproject.net Website: http://orchardproject.net
Version: 1.5 Version: 1.5.1
OrchardVersion: 1.5 OrchardVersion: 1.5.1
Description: The title module enables content items to have titles. Description: The title module enables content items to have titles.
FeatureDescription: Title content part. FeatureDescription: Title content part.
Category: Core Category: Core

View File

@@ -2,8 +2,8 @@
AntiForgery: enabled AntiForgery: enabled
Author: The Orchard Team Author: The Orchard Team
Website: http://orchardproject.net Website: http://orchardproject.net
Version: 1.5 Version: 1.5.1
OrchardVersion: 1.5 OrchardVersion: 1.5.1
Description: The XmlRpc module enables creation of contents from client applications such as LiveWriter. Description: The XmlRpc module enables creation of contents from client applications such as LiveWriter.
FeatureDescription: XML-RPC opt-in implementation. FeatureDescription: XML-RPC opt-in implementation.
Category: Content Publishing Category: Content Publishing

View File

@@ -1,6 +1,5 @@
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Security;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information // 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 // You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
[assembly: AssemblyVersion("1.5")] [assembly: AssemblyVersion("1.5.1")]
[assembly: AssemblyFileVersion("1.5")] [assembly: AssemblyFileVersion("1.5.1")]

View File

@@ -35,6 +35,6 @@ using System.Security;
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.5")] [assembly: AssemblyVersion("1.5.1")]
[assembly: AssemblyFileVersion("1.5")] [assembly: AssemblyFileVersion("1.5.1")]

View File

@@ -196,27 +196,24 @@ namespace Orchard.UI.Navigation {
foreach (var item in items) { foreach (var item in items) {
MenuItem parent = null; MenuItem parent = null;
var position = item.Position; var parentPosition = String.Empty;
while (parent == null && !String.IsNullOrEmpty(position)) { var lastSegment = item.Position.LastIndexOf('.');
if (index.TryGetValue(position, out parent)) { if (lastSegment != -1) {
parent.Items = parent.Items.Concat(new [] { item }); 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)) { if (!index.ContainsKey(item.Position)) {
// prevent invalid positions // prevent invalid positions
index.Add(item.Position, item); 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; return result;