Merge branch 'master' into 1.x

Conflicts:
	ClickToBuildAzurePackage.cmd
	src/Orchard.Azure/Orchard.Azure.Web/Web.config
	src/Orchard.Web/Modules/Orchard.CustomForms/Controllers/ItemController.cs
	src/Orchard.Web/Modules/SysCache/Web.config
	src/Orchard.Web/Orchard.Web.csproj
This commit is contained in:
Sebastien Ros
2013-11-11 18:11:53 -08:00
375 changed files with 30813 additions and 2017 deletions

View File

@@ -120,13 +120,19 @@ namespace Orchard.Core.Navigation.Drivers {
// will be displayed.
for (var i = 0; topLevelItems.Any() && i < part.StartLevel - 1; i++) {
var temp = new List<MenuItem>();
if (selectedPath != null) {
// should the menu be filtered on the currently displayed page ?
if (part.ShowFullMenu) {
foreach (var menuItem in topLevelItems) {
temp.AddRange(menuItem.Items);
}
}
else if (selectedPath != null) {
topLevelItems = topLevelItems.Intersect(selectedPath.Where(x => x.Selected)).ToList();
foreach (var menuItem in topLevelItems) {
temp.AddRange(menuItem.Items);
}
}
topLevelItems = temp;
topLevelItems = temp;
}
// limit the number of levels to display (down from and including the start level)
@@ -165,6 +171,7 @@ namespace Orchard.Core.Navigation.Drivers {
Breadcrumb = part.Breadcrumb,
AddCurrentPage = part.AddCurrentPage,
AddHomePage = part.AddHomePage,
ShowFullMenu = part.ShowFullMenu,
Menus = _menuService.GetMenus(),
};
@@ -181,6 +188,7 @@ namespace Orchard.Core.Navigation.Drivers {
part.Breadcrumb = model.Breadcrumb;
part.AddHomePage = model.AddHomePage;
part.AddCurrentPage = model.AddCurrentPage;
part.ShowFullMenu = model.ShowFullMenu;
part.Menu = _contentManager.Get(model.CurrentMenuId).Record;
}
@@ -193,6 +201,7 @@ namespace Orchard.Core.Navigation.Drivers {
context.ImportAttribute(part.PartDefinition.Name, "Breadcrumb", x => part.Breadcrumb = Convert.ToBoolean(x));
context.ImportAttribute(part.PartDefinition.Name, "AddCurrentPage", x => part.AddCurrentPage = Convert.ToBoolean(x));
context.ImportAttribute(part.PartDefinition.Name, "AddHomePage", x => part.AddHomePage = Convert.ToBoolean(x));
context.ImportAttribute(part.PartDefinition.Name, "ShowFullMenu", x => part.ShowFullMenu = Convert.ToBoolean(x));
context.ImportAttribute(part.PartDefinition.Name, "Menu", x => part.Menu = context.GetItemFromSession(x).Record);
}
@@ -206,6 +215,7 @@ namespace Orchard.Core.Navigation.Drivers {
context.Element(part.PartDefinition.Name).SetAttributeValue("Breadcrumb", part.Breadcrumb);
context.Element(part.PartDefinition.Name).SetAttributeValue("AddCurrentPage", part.AddCurrentPage);
context.Element(part.PartDefinition.Name).SetAttributeValue("AddHomePage", part.AddHomePage);
context.Element(part.PartDefinition.Name).SetAttributeValue("ShowFullMenu", part.ShowFullMenu);
}
}

View File

@@ -15,14 +15,6 @@ namespace Orchard.Core.Navigation.Handlers {
_contentManager = contentManager;
}
protected override void GetItemMetadata(GetContentItemMetadataContext context) {
if(context.ContentItem.ContentType != "Menu") {
return;
}
context.Metadata.Identity.Add("name", context.ContentItem.As<TitlePart>().Title);
}
protected override void Removing(RemoveContentContext context) {
if (context.ContentItem.ContentType != "Menu") {
return;

View File

@@ -190,5 +190,13 @@ namespace Orchard.Core.Navigation {
return 5;
}
public int UpdateFrom5() {
ContentDefinitionManager.AlterTypeDefinition("Menu", cfg => cfg
.WithPart("IdentityPart")
);
return 6;
}
}
}

View File

@@ -1,4 +1,5 @@
using Orchard.ContentManagement;
using Orchard.ContentManagement.FieldStorage.InfosetStorage;
using Orchard.ContentManagement.Records;
namespace Orchard.Core.Navigation.Models {
@@ -32,5 +33,10 @@ namespace Orchard.Core.Navigation.Models {
get { return Record.Menu; }
set { Record.Menu = value; }
}
public bool ShowFullMenu {
get { return bool.Parse(this.As<InfosetPart>().Get<MenuWidgetPart>("ShowFullMenu") ?? "false"); }
set { this.As<InfosetPart>().Set<MenuWidgetPart>("ShowFullMenu", value.ToString()); }
}
}
}

View File

@@ -2,8 +2,8 @@
AntiForgery: enabled
Author: The Orchard Team
Website: http://orchardproject.net
Version: 1.7.1
OrchardVersion: 1.7.1
Version: 1.7.2
OrchardVersion: 1.7.2
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

View File

@@ -11,5 +11,6 @@ namespace Orchard.Core.Navigation.ViewModels {
public bool Breadcrumb { get; set; }
public bool AddHomePage { get; set; }
public bool AddCurrentPage { get; set; }
public bool ShowFullMenu { get; set; }
}
}

View File

@@ -42,4 +42,10 @@
<label class="forcheckbox" for="@Html.FieldIdFor(m => m.AddCurrentPage)">@T("Add the current content item as the last element")</label>
<span class="hint">@T("Check to render the current content item as the last element.")</span>
</fieldset>
</div>
</div>
<fieldset>
@Html.EditorFor(m => m.ShowFullMenu)
<label class="forcheckbox" for="@Html.FieldIdFor(m => m.ShowFullMenu)">@T("No filter on selected page")</label>
<span class="hint">@T("Check for the menu to be display without filtering the selected current page.")</span>
</fieldset>