mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 11:44:58 +08:00
Merge with default
--HG-- branch : NH3
This commit is contained in:
@@ -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
|
||||
|
@@ -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;
|
||||
|
@@ -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<MenuPart>()
|
||||
.Join<ContentMenuItemPartRecord>().Where(x => x.ContentMenuItemRecord == part.ContentItem.Record).List()
|
||||
ContentMenuItems = _contentManager
|
||||
.Query<MenuPart>()
|
||||
.Join<ContentMenuItemPartRecord>()
|
||||
.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<ContentMenuItemPart>("ContentMenuItem");
|
||||
menuItem.Content = part.ContentItem;
|
||||
|
||||
menuItem.As<MenuPart>().MenuText = model.MenuText;
|
||||
menuItem.As<MenuPart>().MenuPosition = Position.GetNext(_navigationManager.BuildMenu(menu));
|
||||
menuItem.As<MenuPart>().Menu = menu;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return Editor(part, shapeHelper);
|
||||
}
|
||||
}
|
||||
}
|
@@ -25,16 +25,21 @@ namespace Orchard.Core.Navigation.Handlers {
|
||||
OnActivated<MenuPart>(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) {
|
||||
|
@@ -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<int>("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;
|
||||
|
@@ -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.
|
||||
|
@@ -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<MenuPart> ContentMenuItems { get; set; }
|
||||
public NavigationPart Part { get; set; }
|
||||
public IEnumerable<ContentItem> Menus { get; set; }
|
||||
public string MenuText { get; set; }
|
||||
public bool AddMenuItem { get; set; }
|
||||
public int CurrentMenuId { get; set; }
|
||||
}
|
||||
}
|
@@ -9,18 +9,35 @@
|
||||
<span class="hint">@T("The menu items linking to this content item.")</span>
|
||||
@if(Model.ContentMenuItems.Any()) {
|
||||
<ul>
|
||||
@foreach(var menuPart in Model.ContentMenuItems) {
|
||||
var menuContentItem = contentManager.Get(menuPart.Menu.Id);
|
||||
var menuName = Html.ItemDisplayText(menuContentItem).ToString();
|
||||
<li>
|
||||
<div><span>@menuPart.MenuText</span> @T("on") <span>@Html.ActionLink(menuName, "Index", "Admin", new { area = "Navigation", menuId = menuContentItem.Id }, new {}) </span></div>
|
||||
</li>
|
||||
}
|
||||
@foreach(var menuPart in Model.ContentMenuItems) {
|
||||
var menuContentItem = contentManager.Get(menuPart.Menu.Id);
|
||||
var menuName = Html.ItemDisplayText(menuContentItem).ToString();
|
||||
<li>
|
||||
<div><span>@menuPart.MenuText</span> @T("on") <span>@Html.ActionLink(menuName, "Index", "Admin", new { area = "Navigation", menuId = menuContentItem.Id }, new {}) </span></div>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
}
|
||||
else {
|
||||
@T("Not displayed in any menu.")
|
||||
}
|
||||
|
||||
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
@Html.EditorFor(m => m.AddMenuItem)
|
||||
<label for="@Html.FieldIdFor(m => m.AddMenuItem)" class="forcheckbox">@T("Add on a menu")</label>
|
||||
<div data-controllerid="@Html.FieldIdFor(m => m.AddMenuItem)">
|
||||
<select id="@Html.FieldIdFor(m => m.CurrentMenuId)" name="@Html.FieldNameFor(m => m.CurrentMenuId)">
|
||||
@foreach (ContentItem menu in Model.Menus) {
|
||||
@Html.SelectOption(Model.CurrentMenuId, menu.Id, Html.ItemDisplayText(menu).ToString())
|
||||
}
|
||||
</select>
|
||||
<span class="hint">@T("Select which menu you want the content item to be added on.")</span>
|
||||
|
||||
<label for="MenuText">@T("Menu text")</label>
|
||||
@Html.TextBoxFor(m => m.MenuText, new { @class = "text-box single-line" })
|
||||
<span class="hint">@T("The text that should appear in the menu.")</span>
|
||||
</div>
|
||||
|
||||
|
||||
</fieldset>
|
@@ -91,9 +91,11 @@ namespace Orchard.Blogs.Commands {
|
||||
var menu = _menuService.GetMenu(MenuName);
|
||||
|
||||
if (menu != null) {
|
||||
blog.As<MenuPart>().MenuPosition = Position.GetNext(_navigationManager.BuildMenu(menu));
|
||||
blog.As<MenuPart>().MenuText = MenuText;
|
||||
blog.As<MenuPart>().Menu = menu.ContentItem;
|
||||
var menuItem = _contentManager.Create<ContentMenuItemPart>("ContentMenuItem");
|
||||
menuItem.Content = blog;
|
||||
menuItem.As<MenuPart>().MenuPosition = Position.GetNext(_navigationManager.BuildMenu(menu));
|
||||
menuItem.As<MenuPart>().MenuText = MenuText;
|
||||
menuItem.As<MenuPart>().Menu = menu;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
}));
|
||||
|
||||
|
@@ -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<DateTime, int>(posts.Count());
|
||||
var inMemoryBlogArchives = new Dictionary<DateTime, int>();
|
||||
foreach (var post in posts) {
|
||||
if (!post.Has<CommonPart>())
|
||||
continue;
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -49,26 +49,26 @@ namespace Orchard.Comments.Controllers {
|
||||
options = new CommentIndexOptions();
|
||||
|
||||
// Filtering
|
||||
IContentQuery<CommentPart, CommentPartRecord> comments;
|
||||
IContentQuery<CommentPart, CommentPartRecord> 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<CommentPartRecord>(cpr => cpr.CommentDateUtc)
|
||||
.Slice(pager.GetStartIndex(), pager.PageSize)
|
||||
.ToList()
|
||||
|
@@ -80,9 +80,11 @@ namespace Orchard.Pages.Commands {
|
||||
var menu = _menuService.GetMenu(MenuName);
|
||||
|
||||
if (menu != null) {
|
||||
page.As<MenuPart>().MenuPosition = Position.GetNext(_navigationManager.BuildMenu(menu));
|
||||
page.As<MenuPart>().MenuText = MenuText;
|
||||
page.As<MenuPart>().Menu = menu.ContentItem;
|
||||
var menuItem = _contentManager.Create<ContentMenuItemPart>("ContentMenuItem");
|
||||
menuItem.Content = page;
|
||||
menuItem.As<MenuPart>().MenuPosition = Position.GetNext(_navigationManager.BuildMenu(menu));
|
||||
menuItem.As<MenuPart>().MenuText = MenuText;
|
||||
menuItem.As<MenuPart>().Menu = menu;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -142,7 +142,10 @@ namespace Orchard.Tags.Services {
|
||||
}
|
||||
|
||||
public int GetTaggedContentItemCount(int tagId, VersionOptions options) {
|
||||
return GetTaggedContentItems(tagId, options).Count();
|
||||
return _orchardServices.ContentManager
|
||||
.Query<TagsPart, TagsPartRecord>()
|
||||
.Where(tpr => tpr.Tags.Any(tr => tr.TagRecord.Id == tagId))
|
||||
.Count();
|
||||
}
|
||||
|
||||
private void TagContentItem(TagsPartRecord tagsPartRecord, string tagName) {
|
||||
|
@@ -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<LayerPart> layers = _widgetsService.GetLayers();
|
||||
IEnumerable<LayerPart> 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);
|
||||
|
@@ -78,6 +78,10 @@ namespace Orchard.Widgets.Services {
|
||||
}
|
||||
|
||||
public IEnumerable<string> GetZones(ExtensionDescriptor theme) {
|
||||
if(theme == null) {
|
||||
return Enumerable.Empty<string>();
|
||||
}
|
||||
|
||||
IEnumerable<string> zones = new List<string>();
|
||||
|
||||
// get the zones for this theme
|
||||
|
@@ -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))
|
||||
);
|
||||
}
|
||||
}
|
@@ -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;
|
@@ -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);
|
||||
|
@@ -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
|
@@ -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")]
|
@@ -9,8 +9,8 @@
|
||||
<ProjectTypeGuids>{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>UpgradeTo14</RootNamespace>
|
||||
<AssemblyName>UpgradeTo14</AssemblyName>
|
||||
<RootNamespace>UpgradeTo15</RootNamespace>
|
||||
<AssemblyName>UpgradeTo15</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<MvcBuildViews>false</MvcBuildViews>
|
||||
<FileUpgradeFlags>
|
||||
@@ -40,9 +40,8 @@
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="NHibernate, Version=2.1.2.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\lib\nhibernate\NHibernate.dll</HintPath>
|
||||
<Reference Include="NHibernate">
|
||||
<HintPath>..\..\..\..\lib\fluentnhibernate\NHibernate.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
@@ -1,6 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace UpgradeTo14.ViewModels {
|
||||
namespace UpgradeTo15.ViewModels {
|
||||
public class MigrateViewModel {
|
||||
public IList<ContentTypeEntry> ContentTypes { get; set; }
|
||||
}
|
@@ -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}
|
||||
|
Reference in New Issue
Block a user