diff --git a/.hgsubstate b/.hgsubstate index cdc00c6ef..c19347982 100644 --- a/.hgsubstate +++ b/.hgsubstate @@ -1,8 +1,8 @@ c47525e90819321d37962a11313006a4ccfc8362 src/Orchard.Web/Modules/Orchard.AntiSpam f41ead8138ef8eaec32e2c2826100ca175c15730 src/Orchard.Web/Modules/Orchard.Autoroute -a8cd78f4730747bf592935aaa605874938a9c89f src/Orchard.Web/Modules/Orchard.ContentPermissions +5eb5861244852a382332abfbfe2d28ac1b9bd419 src/Orchard.Web/Modules/Orchard.ContentPermissions d466369118538a8ca77754d047ee841d016ea9c2 src/Orchard.Web/Modules/Orchard.ContentPicker -3ad1bdc80b8374433d98469e8740bc48ef114be2 src/Orchard.Web/Modules/Orchard.CustomForms +8ac5b68b6ad42cfce6be53e6bd776a35ac14c6e7 src/Orchard.Web/Modules/Orchard.CustomForms b639cb33d2ba038de6048350400b664399608996 src/Orchard.Web/Modules/Orchard.Forms b748de63e3cf8debfc3eba77f26089705147047d src/Orchard.Web/Modules/Orchard.Rules 419399ef2e37122a000e6cc8674148d3183d7032 src/Orchard.Web/Modules/Orchard.TaskLease diff --git a/src/Orchard.Web/Core/Navigation/Drivers/MenuPartDriver.cs b/src/Orchard.Web/Core/Navigation/Drivers/MenuPartDriver.cs index f07a9d085..b72c64d25 100644 --- a/src/Orchard.Web/Core/Navigation/Drivers/MenuPartDriver.cs +++ b/src/Orchard.Web/Core/Navigation/Drivers/MenuPartDriver.cs @@ -1,5 +1,4 @@ -using System; -using JetBrains.Annotations; +using JetBrains.Annotations; using Orchard.ContentManagement; using Orchard.ContentManagement.Drivers; using Orchard.Core.Navigation.Models; @@ -32,6 +31,12 @@ namespace Orchard.Core.Navigation.Drivers { public Localizer T { get; set; } + protected override string Prefix { + get { + return "MenuPart"; + } + } + protected override DriverResult Editor(MenuPart part, dynamic shapeHelper) { if (!_authorizationService.TryCheckAccess(Permissions.ManageMainMenu, _orchardServices.WorkContext.CurrentUser, part)) return null; diff --git a/src/Orchard.Web/Core/Navigation/Drivers/NavigationPartDriver.cs b/src/Orchard.Web/Core/Navigation/Drivers/NavigationPartDriver.cs index 8fd9850df..92e305b67 100644 --- a/src/Orchard.Web/Core/Navigation/Drivers/NavigationPartDriver.cs +++ b/src/Orchard.Web/Core/Navigation/Drivers/NavigationPartDriver.cs @@ -1,8 +1,12 @@ using Orchard.ContentManagement; using Orchard.ContentManagement.Drivers; using Orchard.Core.Navigation.Models; +using Orchard.Core.Navigation.Services; using Orchard.Core.Navigation.ViewModels; +using Orchard.Localization; using Orchard.Security; +using Orchard.UI.Navigation; +using Orchard.Utility; namespace Orchard.Core.Navigation.Drivers { @@ -10,14 +14,30 @@ namespace Orchard.Core.Navigation.Drivers { private readonly IAuthorizationService _authorizationService; private readonly IWorkContextAccessor _workContextAccessor; private readonly IContentManager _contentManager; + private readonly IMenuService _menuService; + private readonly INavigationManager _navigationManager; public NavigationPartDriver( IAuthorizationService authorizationService, IWorkContextAccessor workContextAccessor, - IContentManager contentManager) { + IContentManager contentManager, + IMenuService menuService, + INavigationManager navigationManager) { _authorizationService = authorizationService; _workContextAccessor = workContextAccessor; _contentManager = contentManager; + _menuService = menuService; + _navigationManager = navigationManager; + + T = NullLocalizer.Instance; + } + + public Localizer T { get; set; } + + protected override string Prefix { + get { + return "NavigationPart"; + } } protected override DriverResult Editor(NavigationPart part, dynamic shapeHelper) { @@ -28,14 +48,48 @@ namespace Orchard.Core.Navigation.Drivers { return ContentShape("Parts_Navigation_Edit", () => { // loads all menu part of type ContentMenuItem linking to the current content item - var model = new NavigationPartViewModel() { + var model = new NavigationPartViewModel { Part = part, - ContentMenuItems = _contentManager.Query() - .Join().Where(x => x.ContentMenuItemRecord == part.ContentItem.Record).List() + ContentMenuItems = _contentManager + .Query() + .Join() + .Where(x => x.ContentMenuItemRecord == part.ContentItem.Record) + .List(), + Menus = _menuService.GetMenus(), }; return shapeHelper.EditorTemplate(TemplateName: "Parts.Navigation.Edit", Model: model, Prefix: Prefix); }); } + + protected override DriverResult Editor(NavigationPart part, IUpdateModel updater, dynamic shapeHelper) { + var currentUser = _workContextAccessor.GetContext().CurrentUser; + if (!_authorizationService.TryCheckAccess(Permissions.ManageMainMenu, currentUser, part)) + return null; + + var model = new NavigationPartViewModel(); + + if (updater.TryUpdateModel(model, Prefix, null, null)) { + if(model.AddMenuItem) { + if (string.IsNullOrEmpty(model.MenuText)) { + updater.AddModelError("MenuText", T("The MenuText field is required")); + } + else { + var menu = _contentManager.Get(model.CurrentMenuId); + + if(menu != null) { + var menuItem = _contentManager.Create("ContentMenuItem"); + menuItem.Content = part.ContentItem; + + menuItem.As().MenuText = model.MenuText; + menuItem.As().MenuPosition = Position.GetNext(_navigationManager.BuildMenu(menu)); + menuItem.As().Menu = menu; + } + } + } + } + + return Editor(part, shapeHelper); + } } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Navigation/Handlers/MenuPartHandler.cs b/src/Orchard.Web/Core/Navigation/Handlers/MenuPartHandler.cs index ac97ff062..479e0e691 100644 --- a/src/Orchard.Web/Core/Navigation/Handlers/MenuPartHandler.cs +++ b/src/Orchard.Web/Core/Navigation/Handlers/MenuPartHandler.cs @@ -25,16 +25,21 @@ namespace Orchard.Core.Navigation.Handlers { OnActivated(PropertySetHandlers); } - protected static void PropertySetHandlers(ActivatedContentContext context, MenuPart menuPart) { + protected void PropertySetHandlers(ActivatedContentContext context, MenuPart menuPart) { menuPart.MenuField.Setter(menu => { - menuPart.Record.MenuId = menu.ContentItem.Id; + if(menu == null || menu.ContentItem == null) { + menuPart.Record.MenuId = 0; + } + else { + menuPart.Record.MenuId = menu.ContentItem.Id; + } + return menu; }); - } - protected void LazyLoadHandlers(MenuPart menuPart) { menuPart.MenuField.Loader(ctx => - _contentManager.Get(menuPart.Record.MenuId, menuPart.IsPublished() ? VersionOptions.Published : VersionOptions.Latest)); + _contentManager.Get(menuPart.Record.MenuId, menuPart.IsPublished() ? VersionOptions.Published : VersionOptions.Latest) + ); } protected override void GetItemMetadata(GetContentItemMetadataContext context) { diff --git a/src/Orchard.Web/Core/Navigation/Migrations.cs b/src/Orchard.Web/Core/Navigation/Migrations.cs index 703829029..e574d92ad 100644 --- a/src/Orchard.Web/Core/Navigation/Migrations.cs +++ b/src/Orchard.Web/Core/Navigation/Migrations.cs @@ -14,7 +14,7 @@ namespace Orchard.Core.Navigation { public int Create() { ContentDefinitionManager.AlterPartDefinition("MenuPart", builder => builder.Attachable()); ContentDefinitionManager.AlterPartDefinition("NavigationPart", builder => builder.Attachable()); - ContentDefinitionManager.AlterTypeDefinition("Page", cfg => cfg.WithPart("MenuPart")); + ContentDefinitionManager.AlterTypeDefinition("Page", cfg => cfg.WithPart("NavigationPart")); SchemaBuilder.CreateTable("MenuItemPartRecord", table => table @@ -165,14 +165,29 @@ namespace Orchard.Core.Navigation { ContentDefinitionManager.AlterPartDefinition("NavigationPart", builder => builder.Attachable()); + SchemaBuilder.CreateTable("ContentMenuItemPartRecord", + table => table + .ContentPartRecord() + .Column("ContentMenuItemRecord_id") + ); + + ContentDefinitionManager.AlterTypeDefinition("ContentMenuItem", cfg => cfg + .WithPart("MenuPart") + .WithPart("CommonPart") + .WithPart("IdentityPart") + .WithPart("ContentMenuItemPart") + .DisplayedAs("Content Menu Item") + .WithSetting("Description", "Adds a Content Item to the menu.") + .WithSetting("Stereotype", "MenuItem") + ); // create a Main Menu var mainMenu = _menuService.Create("Main Menu"); // assign the Main Menu to all current menu items foreach (var menuItem in _menuService.Get()) { - // if they don't have a position, then they are not displayed - if(string.IsNullOrWhiteSpace(menuItem.MenuPosition)) { + // if they don't have a position or a text, then they are not displayed + if(string.IsNullOrWhiteSpace(menuItem.MenuPosition) || string.IsNullOrEmpty(menuItem.MenuText)) { continue; } menuItem.Menu = mainMenu.ContentItem; diff --git a/src/Orchard.Web/Core/Navigation/Services/AdminMenuNavigationProvider.cs b/src/Orchard.Web/Core/Navigation/Services/AdminMenuNavigationProvider.cs index a9f865a21..12dcd4375 100644 --- a/src/Orchard.Web/Core/Navigation/Services/AdminMenuNavigationProvider.cs +++ b/src/Orchard.Web/Core/Navigation/Services/AdminMenuNavigationProvider.cs @@ -25,7 +25,7 @@ namespace Orchard.Core.Navigation.Services { if (menuPart != null) { var part = menuPart; - builder.Add(new LocalizedString(HttpUtility.HtmlEncode(part.AdminMenuText)), + builder.Add(new LocalizedString(part.AdminMenuText), part.AdminMenuPosition, item => item.Action(_contentManager.GetItemMetadata(part.ContentItem).AdminRouteValues)); // todo: somehow determine if they will ultimately have rights to the destination and hide if not. possibly would need to add a Permission to metadata. diff --git a/src/Orchard.Web/Core/Navigation/ViewModels/NavigationPartViewModel.cs b/src/Orchard.Web/Core/Navigation/ViewModels/NavigationPartViewModel.cs index 17034dd26..3f5a60686 100644 --- a/src/Orchard.Web/Core/Navigation/ViewModels/NavigationPartViewModel.cs +++ b/src/Orchard.Web/Core/Navigation/ViewModels/NavigationPartViewModel.cs @@ -1,9 +1,14 @@ using System.Collections.Generic; +using Orchard.ContentManagement; using Orchard.Core.Navigation.Models; namespace Orchard.Core.Navigation.ViewModels { public class NavigationPartViewModel { public IEnumerable ContentMenuItems { get; set; } public NavigationPart Part { get; set; } + public IEnumerable Menus { get; set; } + public string MenuText { get; set; } + public bool AddMenuItem { get; set; } + public int CurrentMenuId { get; set; } } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Navigation/Views/EditorTemplates/Parts.Navigation.Edit.cshtml b/src/Orchard.Web/Core/Navigation/Views/EditorTemplates/Parts.Navigation.Edit.cshtml index d937d7100..795e74a74 100644 --- a/src/Orchard.Web/Core/Navigation/Views/EditorTemplates/Parts.Navigation.Edit.cshtml +++ b/src/Orchard.Web/Core/Navigation/Views/EditorTemplates/Parts.Navigation.Edit.cshtml @@ -9,18 +9,35 @@ @T("The menu items linking to this content item.") @if(Model.ContentMenuItems.Any()) {
    - @foreach(var menuPart in Model.ContentMenuItems) { - var menuContentItem = contentManager.Get(menuPart.Menu.Id); - var menuName = Html.ItemDisplayText(menuContentItem).ToString(); -
  • -
    @menuPart.MenuText @T("on") @Html.ActionLink(menuName, "Index", "Admin", new { area = "Navigation", menuId = menuContentItem.Id }, new {})
    -
  • - } + @foreach(var menuPart in Model.ContentMenuItems) { + var menuContentItem = contentManager.Get(menuPart.Menu.Id); + var menuName = Html.ItemDisplayText(menuContentItem).ToString(); +
  • +
    @menuPart.MenuText @T("on") @Html.ActionLink(menuName, "Index", "Admin", new { area = "Navigation", menuId = menuContentItem.Id }, new {})
    +
  • + }
} else { @T("Not displayed in any menu.") } - +
+ @Html.EditorFor(m => m.AddMenuItem) + +
+ + @T("Select which menu you want the content item to be added on.") + + + @Html.TextBoxFor(m => m.MenuText, new { @class = "text-box single-line" }) + @T("The text that should appear in the menu.") +
+ + +
\ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Commands/BlogCommands.cs b/src/Orchard.Web/Modules/Orchard.Blogs/Commands/BlogCommands.cs index 35f880e6b..e68cddf65 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Commands/BlogCommands.cs +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Commands/BlogCommands.cs @@ -91,9 +91,11 @@ namespace Orchard.Blogs.Commands { var menu = _menuService.GetMenu(MenuName); if (menu != null) { - blog.As().MenuPosition = Position.GetNext(_navigationManager.BuildMenu(menu)); - blog.As().MenuText = MenuText; - blog.As().Menu = menu.ContentItem; + var menuItem = _contentManager.Create("ContentMenuItem"); + menuItem.Content = blog; + menuItem.As().MenuPosition = Position.GetNext(_navigationManager.BuildMenu(menu)); + menuItem.As().MenuText = MenuText; + menuItem.As().Menu = menu; } } diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Controllers/BlogAdminController.cs b/src/Orchard.Web/Modules/Orchard.Blogs/Controllers/BlogAdminController.cs index 73d41861d..a47cfeff7 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Controllers/BlogAdminController.cs +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Controllers/BlogAdminController.cs @@ -154,7 +154,7 @@ namespace Orchard.Blogs.Controllers { list.AddRange(_blogService.Get(VersionOptions.Latest) .Select(b => { var blog = Services.ContentManager.BuildDisplay(b, "SummaryAdmin"); - blog.TotalPostCount = _blogPostService.Get(b, VersionOptions.Latest).Count(); + blog.TotalPostCount = _blogPostService.PostCount(b, VersionOptions.Latest); return blog; })); diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Handlers/BlogPartArchiveHandler.cs b/src/Orchard.Web/Modules/Orchard.Blogs/Handlers/BlogPartArchiveHandler.cs index 775943dc8..31bc10d81 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Handlers/BlogPartArchiveHandler.cs +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Handlers/BlogPartArchiveHandler.cs @@ -32,7 +32,7 @@ namespace Orchard.Blogs.Handlers { var posts = blogPostService.Get(blogPostPart.BlogPart, VersionOptions.Published); // create a dictionary of all the year/month combinations and their count of posts that are published in this blog - var inMemoryBlogArchives = new Dictionary(posts.Count()); + var inMemoryBlogArchives = new Dictionary(); foreach (var post in posts) { if (!post.Has()) continue; diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Handlers/BlogPostPartHandler.cs b/src/Orchard.Web/Modules/Orchard.Blogs/Handlers/BlogPostPartHandler.cs index f9e3c12bf..68c802cd6 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Handlers/BlogPostPartHandler.cs +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Handlers/BlogPostPartHandler.cs @@ -43,7 +43,7 @@ namespace Orchard.Blogs.Handlers { // Ensure the "right" set of published posts for the blog is obtained blogPart.ContentItem.ContentManager.Flush(); - blogPart.PostCount = _blogPostService.Get(blogPart, VersionOptions.Published).Count(); + blogPart.PostCount = _blogPostService.PostCount(blogPart); } } diff --git a/src/Orchard.Web/Modules/Orchard.Comments/Controllers/AdminController.cs b/src/Orchard.Web/Modules/Orchard.Comments/Controllers/AdminController.cs index 599699702..991c852e8 100644 --- a/src/Orchard.Web/Modules/Orchard.Comments/Controllers/AdminController.cs +++ b/src/Orchard.Web/Modules/Orchard.Comments/Controllers/AdminController.cs @@ -49,26 +49,26 @@ namespace Orchard.Comments.Controllers { options = new CommentIndexOptions(); // Filtering - IContentQuery comments; + IContentQuery commentsQuery; switch (options.Filter) { case CommentIndexFilter.All: - comments = _commentService.GetComments(); + commentsQuery = _commentService.GetComments(); break; case CommentIndexFilter.Approved: - comments = _commentService.GetComments(CommentStatus.Approved); + commentsQuery = _commentService.GetComments(CommentStatus.Approved); break; case CommentIndexFilter.Pending: - comments = _commentService.GetComments(CommentStatus.Pending); + commentsQuery = _commentService.GetComments(CommentStatus.Pending); break; case CommentIndexFilter.Spam: - comments = _commentService.GetComments(CommentStatus.Spam); + commentsQuery = _commentService.GetComments(CommentStatus.Spam); break; default: throw new ArgumentOutOfRangeException(); } - var pagerShape = Shape.Pager(pager).TotalItemCount(comments.Count()); - var entries = comments + var pagerShape = Shape.Pager(pager).TotalItemCount(commentsQuery.Count()); + var entries = commentsQuery .OrderByDescending(cpr => cpr.CommentDateUtc) .Slice(pager.GetStartIndex(), pager.PageSize) .ToList() diff --git a/src/Orchard.Web/Modules/Orchard.Pages/Commands/PageCommands.cs b/src/Orchard.Web/Modules/Orchard.Pages/Commands/PageCommands.cs index 57b22cf02..3f438a014 100644 --- a/src/Orchard.Web/Modules/Orchard.Pages/Commands/PageCommands.cs +++ b/src/Orchard.Web/Modules/Orchard.Pages/Commands/PageCommands.cs @@ -80,9 +80,11 @@ namespace Orchard.Pages.Commands { var menu = _menuService.GetMenu(MenuName); if (menu != null) { - page.As().MenuPosition = Position.GetNext(_navigationManager.BuildMenu(menu)); - page.As().MenuText = MenuText; - page.As().Menu = menu.ContentItem; + var menuItem = _contentManager.Create("ContentMenuItem"); + menuItem.Content = page; + menuItem.As().MenuPosition = Position.GetNext(_navigationManager.BuildMenu(menu)); + menuItem.As().MenuText = MenuText; + menuItem.As().Menu = menu; } } diff --git a/src/Orchard.Web/Modules/Orchard.Tags/Services/TagService.cs b/src/Orchard.Web/Modules/Orchard.Tags/Services/TagService.cs index 2f27e5b1b..b5045086a 100644 --- a/src/Orchard.Web/Modules/Orchard.Tags/Services/TagService.cs +++ b/src/Orchard.Web/Modules/Orchard.Tags/Services/TagService.cs @@ -142,7 +142,10 @@ namespace Orchard.Tags.Services { } public int GetTaggedContentItemCount(int tagId, VersionOptions options) { - return GetTaggedContentItems(tagId, options).Count(); + return _orchardServices.ContentManager + .Query() + .Where(tpr => tpr.Tags.Any(tr => tr.TagRecord.Id == tagId)) + .Count(); } private void TagContentItem(TagsPartRecord tagsPartRecord, string tagName) { diff --git a/src/Orchard.Web/Modules/Orchard.Widgets/Controllers/AdminController.cs b/src/Orchard.Web/Modules/Orchard.Widgets/Controllers/AdminController.cs index 56fc03bb5..bb9c014c3 100644 --- a/src/Orchard.Web/Modules/Orchard.Widgets/Controllers/AdminController.cs +++ b/src/Orchard.Web/Modules/Orchard.Widgets/Controllers/AdminController.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Globalization; using System.Web.Mvc; using System.Linq; using Orchard.ContentManagement; @@ -116,9 +117,9 @@ namespace Orchard.Widgets.Controllers { return RedirectToAction("Index"); } - IEnumerable layers = _widgetsService.GetLayers(); + IEnumerable layers = _widgetsService.GetLayers().ToList(); - if (layers.Count() == 0) { + if (!layers.Any()) { Services.Notifier.Error(T("Layer not found: {0}", layerId)); return RedirectToAction("Index"); } @@ -147,8 +148,8 @@ namespace Orchard.Widgets.Controllers { if (widgetPart == null) return HttpNotFound(); try { - int widgetPosition = _widgetsService.GetWidgets().Where(widget => widget.Zone == widgetPart.Zone).Count() + 1; - widgetPart.Position = widgetPosition.ToString(); + int widgetPosition = _widgetsService.GetWidgets().Count(widget => widget.Zone == widgetPart.Zone) + 1; + widgetPart.Position = widgetPosition.ToString(CultureInfo.InvariantCulture); widgetPart.Zone = zone; widgetPart.LayerPart = _widgetsService.GetLayer(layerId); dynamic model = Services.ContentManager.BuildEditor(widgetPart); diff --git a/src/Orchard.Web/Modules/Orchard.Widgets/Services/WidgetsService.cs b/src/Orchard.Web/Modules/Orchard.Widgets/Services/WidgetsService.cs index e6a6cb665..92a79369e 100644 --- a/src/Orchard.Web/Modules/Orchard.Widgets/Services/WidgetsService.cs +++ b/src/Orchard.Web/Modules/Orchard.Widgets/Services/WidgetsService.cs @@ -78,6 +78,10 @@ namespace Orchard.Widgets.Services { } public IEnumerable GetZones(ExtensionDescriptor theme) { + if(theme == null) { + return Enumerable.Empty(); + } + IEnumerable zones = new List(); // get the zones for this theme diff --git a/src/Orchard.Web/Modules/UpgradeTo14/AdminMenu.cs b/src/Orchard.Web/Modules/UpgradeTo15/AdminMenu.cs similarity index 67% rename from src/Orchard.Web/Modules/UpgradeTo14/AdminMenu.cs rename to src/Orchard.Web/Modules/UpgradeTo15/AdminMenu.cs index dcb26de5e..8133fe697 100644 --- a/src/Orchard.Web/Modules/UpgradeTo14/AdminMenu.cs +++ b/src/Orchard.Web/Modules/UpgradeTo15/AdminMenu.cs @@ -2,7 +2,7 @@ using Orchard.Security; using Orchard.UI.Navigation; -namespace UpgradeTo14 { +namespace UpgradeTo15 { public class AdminMenu : INavigationProvider { public Localizer T { get; set; } @@ -12,9 +12,9 @@ namespace UpgradeTo14 { public void GetNavigation(NavigationBuilder builder) { builder - .Add(T("Migrate to 1.4"), "0", menu => menu.Action("Index", "Route", new { area = "UpgradeTo14" }) - .Add(T("Migrate Routes"), "0", item => item.Action("Index", "Route", new { area = "UpgradeTo14" }).LocalNav().Permission(StandardPermissions.SiteOwner)) - .Add(T("Migrate Fields"), "0", item => item.Action("Index", "Field", new { area = "UpgradeTo14" }).LocalNav().Permission(StandardPermissions.SiteOwner)) + .Add(T("Migrate to 1.5"), "0", menu => menu.Action("Index", "Route", new { area = "UpgradeTo15" }) + .Add(T("Migrate Routes"), "0", item => item.Action("Index", "Route", new { area = "UpgradeTo15" }).LocalNav().Permission(StandardPermissions.SiteOwner)) + .Add(T("Migrate Fields"), "0", item => item.Action("Index", "Field", new { area = "UpgradeTo15" }).LocalNav().Permission(StandardPermissions.SiteOwner)) ); } } diff --git a/src/Orchard.Web/Modules/UpgradeTo14/Controllers/FieldController.cs b/src/Orchard.Web/Modules/UpgradeTo15/Controllers/FieldController.cs similarity index 95% rename from src/Orchard.Web/Modules/UpgradeTo14/Controllers/FieldController.cs rename to src/Orchard.Web/Modules/UpgradeTo15/Controllers/FieldController.cs index 7aeecb7ec..9b6cf9045 100644 --- a/src/Orchard.Web/Modules/UpgradeTo14/Controllers/FieldController.cs +++ b/src/Orchard.Web/Modules/UpgradeTo15/Controllers/FieldController.cs @@ -4,15 +4,14 @@ using System.Web.Mvc; using Orchard; using Orchard.ContentManagement; using Orchard.ContentManagement.MetaData; -using Orchard.Data; using Orchard.Environment.Features; using Orchard.Localization; using Orchard.Security; using Orchard.UI.Admin; using Orchard.UI.Notify; -using UpgradeTo14.ViewModels; +using UpgradeTo15.ViewModels; -namespace UpgradeTo14.Controllers { +namespace UpgradeTo15.Controllers { [Admin] public class FieldController : Controller { private readonly IContentDefinitionManager _contentDefinitionManager; diff --git a/src/Orchard.Web/Modules/UpgradeTo14/Controllers/RouteController.cs b/src/Orchard.Web/Modules/UpgradeTo15/Controllers/RouteController.cs similarity index 96% rename from src/Orchard.Web/Modules/UpgradeTo14/Controllers/RouteController.cs rename to src/Orchard.Web/Modules/UpgradeTo15/Controllers/RouteController.cs index 8a6087aca..845780bec 100644 --- a/src/Orchard.Web/Modules/UpgradeTo14/Controllers/RouteController.cs +++ b/src/Orchard.Web/Modules/UpgradeTo15/Controllers/RouteController.cs @@ -18,9 +18,9 @@ using Orchard.Reports.Services; using Orchard.Security; using Orchard.UI.Admin; using Orchard.UI.Notify; -using UpgradeTo14.ViewModels; +using UpgradeTo15.ViewModels; -namespace UpgradeTo14.Controllers { +namespace UpgradeTo15.Controllers { [Admin] public class RouteController : Controller { private readonly IContentDefinitionManager _contentDefinitionManager; @@ -73,7 +73,7 @@ namespace UpgradeTo14.Controllers { if(TryUpdateModel(viewModel)) { // creating report - _reportsCoordinator.Register("Migration", "UpgradeTo14", "Migrating " + string.Join(" ,", viewModel.ContentTypes.Where(x => x.IsChecked).Select(x => x.ContentTypeName).ToArray())); + _reportsCoordinator.Register("Migration", "UpgradeTo15", "Migrating " + string.Join(" ,", viewModel.ContentTypes.Where(x => x.IsChecked).Select(x => x.ContentTypeName).ToArray())); var contentTypesToMigrate = viewModel.ContentTypes.Where(c => c.IsChecked).Select(c => c.ContentTypeName); diff --git a/src/Orchard.Web/Modules/UpgradeTo14/Module.txt b/src/Orchard.Web/Modules/UpgradeTo15/Module.txt similarity index 60% rename from src/Orchard.Web/Modules/UpgradeTo14/Module.txt rename to src/Orchard.Web/Modules/UpgradeTo15/Module.txt index 3fcc45fbf..3dc6142ba 100644 --- a/src/Orchard.Web/Modules/UpgradeTo14/Module.txt +++ b/src/Orchard.Web/Modules/UpgradeTo15/Module.txt @@ -1,11 +1,11 @@ -Name: UpgradeTo14 +Name: UpgradeTo15 AntiForgery: enabled Author: The Orchard Team Website: http://orchardproject.net Version: 1.5 -OrchardVersion: 1.4 +OrchardVersion: 1.5 Description: Description for the module Features: - UpgradeTo14: - Description: Description for feature UpgradeTo14. + UpgradeTo15: + Description: Description for feature UpgradeTo15. Dependencies: Orchard.Autoroute, Title \ No newline at end of file diff --git a/src/Orchard.Web/Modules/UpgradeTo14/Properties/AssemblyInfo.cs b/src/Orchard.Web/Modules/UpgradeTo15/Properties/AssemblyInfo.cs similarity index 94% rename from src/Orchard.Web/Modules/UpgradeTo14/Properties/AssemblyInfo.cs rename to src/Orchard.Web/Modules/UpgradeTo15/Properties/AssemblyInfo.cs index 1566bee55..b57d6ab15 100644 --- a/src/Orchard.Web/Modules/UpgradeTo14/Properties/AssemblyInfo.cs +++ b/src/Orchard.Web/Modules/UpgradeTo15/Properties/AssemblyInfo.cs @@ -6,7 +6,7 @@ using System.Security; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("UpgradeTo14")] +[assembly: AssemblyTitle("UpgradeTo15")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyProduct("Orchard")] diff --git a/src/Orchard.Web/Modules/UpgradeTo14/Scripts/Web.config b/src/Orchard.Web/Modules/UpgradeTo15/Scripts/Web.config similarity index 100% rename from src/Orchard.Web/Modules/UpgradeTo14/Scripts/Web.config rename to src/Orchard.Web/Modules/UpgradeTo15/Scripts/Web.config diff --git a/src/Orchard.Web/Modules/UpgradeTo14/Styles/Web.config b/src/Orchard.Web/Modules/UpgradeTo15/Styles/Web.config similarity index 100% rename from src/Orchard.Web/Modules/UpgradeTo14/Styles/Web.config rename to src/Orchard.Web/Modules/UpgradeTo15/Styles/Web.config diff --git a/src/Orchard.Web/Modules/UpgradeTo14/UpgradeTo14.csproj b/src/Orchard.Web/Modules/UpgradeTo15/UpgradeTo15.csproj similarity index 92% rename from src/Orchard.Web/Modules/UpgradeTo14/UpgradeTo14.csproj rename to src/Orchard.Web/Modules/UpgradeTo15/UpgradeTo15.csproj index fab7e66e5..36b59c633 100644 --- a/src/Orchard.Web/Modules/UpgradeTo14/UpgradeTo14.csproj +++ b/src/Orchard.Web/Modules/UpgradeTo15/UpgradeTo15.csproj @@ -9,8 +9,8 @@ {fae04ec0-301f-11d3-bf4b-00c04f79efbc} Library Properties - UpgradeTo14 - UpgradeTo14 + UpgradeTo15 + UpgradeTo15 v4.0 false @@ -40,9 +40,8 @@ - - False - ..\..\..\..\lib\nhibernate\NHibernate.dll + + ..\..\..\..\lib\fluentnhibernate\NHibernate.dll diff --git a/src/Orchard.Web/Modules/UpgradeTo14/ViewModels/MigrateViewModel.cs b/src/Orchard.Web/Modules/UpgradeTo15/ViewModels/MigrateViewModel.cs similarity index 85% rename from src/Orchard.Web/Modules/UpgradeTo14/ViewModels/MigrateViewModel.cs rename to src/Orchard.Web/Modules/UpgradeTo15/ViewModels/MigrateViewModel.cs index 71537ffd9..a26027d86 100644 --- a/src/Orchard.Web/Modules/UpgradeTo14/ViewModels/MigrateViewModel.cs +++ b/src/Orchard.Web/Modules/UpgradeTo15/ViewModels/MigrateViewModel.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace UpgradeTo14.ViewModels { +namespace UpgradeTo15.ViewModels { public class MigrateViewModel { public IList ContentTypes { get; set; } } diff --git a/src/Orchard.Web/Modules/UpgradeTo14/Views/Field/Index.cshtml b/src/Orchard.Web/Modules/UpgradeTo15/Views/Field/Index.cshtml similarity index 100% rename from src/Orchard.Web/Modules/UpgradeTo14/Views/Field/Index.cshtml rename to src/Orchard.Web/Modules/UpgradeTo15/Views/Field/Index.cshtml diff --git a/src/Orchard.Web/Modules/UpgradeTo14/Views/Route/Index.cshtml b/src/Orchard.Web/Modules/UpgradeTo15/Views/Route/Index.cshtml similarity index 100% rename from src/Orchard.Web/Modules/UpgradeTo14/Views/Route/Index.cshtml rename to src/Orchard.Web/Modules/UpgradeTo15/Views/Route/Index.cshtml diff --git a/src/Orchard.Web/Modules/UpgradeTo14/Views/Web.config b/src/Orchard.Web/Modules/UpgradeTo15/Views/Web.config similarity index 100% rename from src/Orchard.Web/Modules/UpgradeTo14/Views/Web.config rename to src/Orchard.Web/Modules/UpgradeTo15/Views/Web.config diff --git a/src/Orchard.Web/Modules/UpgradeTo14/Web.config b/src/Orchard.Web/Modules/UpgradeTo15/Web.config similarity index 100% rename from src/Orchard.Web/Modules/UpgradeTo14/Web.config rename to src/Orchard.Web/Modules/UpgradeTo15/Web.config diff --git a/src/Orchard.sln b/src/Orchard.sln index 69f0987e6..8e058673f 100644 --- a/src/Orchard.sln +++ b/src/Orchard.sln @@ -136,8 +136,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Alias", "Orchard.We EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Autoroute", "Orchard.Web\Modules\Orchard.Autoroute\Orchard.Autoroute.csproj", "{66FCCD76-2761-47E3-8D11-B45D0001DDAA}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UpgradeTo14", "Orchard.Web\Modules\UpgradeTo14\UpgradeTo14.csproj", "{8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Autoroute.Specs", "Orchard.Web\Modules\Orchard.Autoroute\Specs\Orchard.Autoroute.Specs.csproj", "{AC4402A1-61C4-4229-B840-FB1777DAE10C}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.AntiSpam", "Orchard.Web\Modules\Orchard.AntiSpam\Orchard.AntiSpam.csproj", "{91BC2E7F-DA04-421C-98EF-76D37CEC130C}" @@ -754,16 +752,6 @@ Global {66FCCD76-2761-47E3-8D11-B45D0001DDAA}.FxCop|Any CPU.Build.0 = Release|Any CPU {66FCCD76-2761-47E3-8D11-B45D0001DDAA}.Release|Any CPU.ActiveCfg = Release|Any CPU {66FCCD76-2761-47E3-8D11-B45D0001DDAA}.Release|Any CPU.Build.0 = Release|Any CPU - {8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.CodeCoverage|Any CPU.ActiveCfg = Release|Any CPU - {8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.CodeCoverage|Any CPU.Build.0 = Release|Any CPU - {8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.Coverage|Any CPU.ActiveCfg = Release|Any CPU - {8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.Coverage|Any CPU.Build.0 = Release|Any CPU - {8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.FxCop|Any CPU.ActiveCfg = Release|Any CPU - {8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.FxCop|Any CPU.Build.0 = Release|Any CPU - {8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.Release|Any CPU.Build.0 = Release|Any CPU {AC4402A1-61C4-4229-B840-FB1777DAE10C}.CodeCoverage|Any CPU.ActiveCfg = Release|Any CPU {AC4402A1-61C4-4229-B840-FB1777DAE10C}.CodeCoverage|Any CPU.Build.0 = Release|Any CPU {AC4402A1-61C4-4229-B840-FB1777DAE10C}.Coverage|Any CPU.ActiveCfg = Release|Any CPU @@ -811,6 +799,16 @@ Global {E826F796-8CE3-4B5B-8423-5AA5F81D2FC3}.FxCop|Any CPU.Build.0 = Release|Any CPU {E826F796-8CE3-4B5B-8423-5AA5F81D2FC3}.Release|Any CPU.ActiveCfg = Release|Any CPU {E826F796-8CE3-4B5B-8423-5AA5F81D2FC3}.Release|Any CPU.Build.0 = Release|Any CPU + {8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.CodeCoverage|Any CPU.ActiveCfg = Release|Any CPU + {8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.CodeCoverage|Any CPU.Build.0 = Release|Any CPU + {8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.Coverage|Any CPU.ActiveCfg = Release|Any CPU + {8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.Coverage|Any CPU.Build.0 = Release|Any CPU + {8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.FxCop|Any CPU.ActiveCfg = Release|Any CPU + {8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.FxCop|Any CPU.Build.0 = Release|Any CPU + {8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -859,11 +857,11 @@ Global {3787DDE5-E5C8-4841-BDA7-DCB325388064} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5} {475B6C45-B27C-438B-8966-908B9D6D1077} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5} {66FCCD76-2761-47E3-8D11-B45D0001DDAA} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5} - {8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5} {91BC2E7F-DA04-421C-98EF-76D37CEC130C} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5} {2CF067CA-064B-43C6-8B88-5E3B99A65F1D} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5} {F301EF7D-F19C-4D83-AA94-CB64F29C037D} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5} {E826F796-8CE3-4B5B-8423-5AA5F81D2FC3} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5} + {8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5} {ABC826D4-2FA1-4F2F-87DE-E6095F653810} = {74E681ED-FECC-4034-B9BD-01B0BB1BDECA} {F112851D-B023-4746-B6B1-8D2E5AD8F7AA} = {74E681ED-FECC-4034-B9BD-01B0BB1BDECA} {6CB3EB30-F725-45C0-9742-42599BA8E8D2} = {74E681ED-FECC-4034-B9BD-01B0BB1BDECA}