mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-22 20:13:50 +08:00
Merge
--HG-- branch : dev
This commit is contained in:
13
src/Orchard.Web/Core/Navigation/AdminMenu.cs
Normal file
13
src/Orchard.Web/Core/Navigation/AdminMenu.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using Orchard.UI.Navigation;
|
||||
|
||||
namespace Orchard.Core.Navigation {
|
||||
public class AdminMenu : INavigationProvider {
|
||||
public string MenuName { get { return "admin"; } }
|
||||
|
||||
public void GetNavigation(NavigationBuilder builder) {
|
||||
builder.Add("Navigation", "12",
|
||||
menu => menu
|
||||
.Add("Manage Main Menu", "2.0", item => item.Action("Index", "Admin", new { area = "Navigation" }).Permission(Permissions.ManageMainMenu)));
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,21 @@
|
||||
using System.Web.Mvc;
|
||||
using Orchard.Core.Navigation.ViewModels;
|
||||
using Orchard.Localization;
|
||||
|
||||
namespace Orchard.Core.Navigation.Controllers {
|
||||
[ValidateInput(false)]
|
||||
public class AdminController : Controller {
|
||||
public IOrchardServices Services { get; private set; }
|
||||
|
||||
public AdminController(IOrchardServices services) {
|
||||
Services = services;
|
||||
T = NullLocalizer.Instance;
|
||||
}
|
||||
|
||||
public Localizer T { get; set; }
|
||||
|
||||
public ActionResult Index() {
|
||||
return View(new NavigationIndexViewModel());
|
||||
}
|
||||
}
|
||||
}
|
21
src/Orchard.Web/Core/Navigation/Models/MenuPart.cs
Normal file
21
src/Orchard.Web/Core/Navigation/Models/MenuPart.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System.Web.Mvc;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.Core.Navigation.Records;
|
||||
|
||||
namespace Orchard.Core.Navigation.Models {
|
||||
public class MenuPart : ContentPart<MenuPartRecord> {
|
||||
[HiddenInput(DisplayValue = false)]
|
||||
public int Id { get { return ContentItem.Id; } }
|
||||
|
||||
public string MenuText {
|
||||
get { return Record.MenuText; }
|
||||
set { Record.MenuText = value; }
|
||||
}
|
||||
|
||||
[HiddenInput(DisplayValue = false)]
|
||||
public string MenuPosition {
|
||||
get { return Record.MenuPosition; }
|
||||
set { Record.MenuPosition = value; }
|
||||
}
|
||||
}
|
||||
}
|
27
src/Orchard.Web/Core/Navigation/Permissions.cs
Normal file
27
src/Orchard.Web/Core/Navigation/Permissions.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System.Collections.Generic;
|
||||
using Orchard.Security.Permissions;
|
||||
|
||||
namespace Orchard.Core.Navigation {
|
||||
public class Permissions : IPermissionProvider {
|
||||
public static readonly Permission ManageMainMenu = new Permission { Name = "ManageMainMenu", Description = "Manage main menu" };
|
||||
|
||||
public string ModuleName {
|
||||
get { return "Navigation"; }
|
||||
}
|
||||
|
||||
public IEnumerable<Permission> GetPermissions() {
|
||||
return new[] {
|
||||
ManageMainMenu
|
||||
};
|
||||
}
|
||||
|
||||
public IEnumerable<PermissionStereotype> GetDefaultStereotypes() {
|
||||
return new[] {
|
||||
new PermissionStereotype {
|
||||
Name = "Administrators",
|
||||
Permissions = new[] {ManageMainMenu}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,8 @@
|
||||
using Orchard.ContentManagement.Records;
|
||||
|
||||
namespace Orchard.Core.Navigation.Records {
|
||||
public class MenuPartRecord : ContentPartRecord {
|
||||
public virtual string MenuText { get; set; }
|
||||
public virtual string MenuPosition { get; set; }
|
||||
}
|
||||
}
|
12
src/Orchard.Web/Core/Navigation/Services/MainMenu.cs
Normal file
12
src/Orchard.Web/Core/Navigation/Services/MainMenu.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using Orchard.UI.Navigation;
|
||||
|
||||
namespace Orchard.Core.Navigation.Services {
|
||||
public class MainMenu : INavigationProvider {
|
||||
public string MenuName { get { return "MainMenu"; } }
|
||||
|
||||
public void GetNavigation(NavigationBuilder builder) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,6 @@
|
||||
using Orchard.Mvc.ViewModels;
|
||||
|
||||
namespace Orchard.Core.Navigation.ViewModels {
|
||||
public class NavigationIndexViewModel : AdminViewModel {
|
||||
}
|
||||
}
|
3
src/Orchard.Web/Core/Navigation/Views/Admin/Index.ascx
Normal file
3
src/Orchard.Web/Core/Navigation/Views/Admin/Index.ascx
Normal file
@@ -0,0 +1,3 @@
|
||||
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<NavigationIndexViewModel>" %>
|
||||
<%@ Import Namespace="Orchard.Core.Navigation.ViewModels"%>
|
||||
<h1><%=Html.TitleForPage(T("Edit Main Menu").ToString())%></h1>
|
34
src/Orchard.Web/Core/Navigation/Views/Web.config
Normal file
34
src/Orchard.Web/Core/Navigation/Views/Web.config
Normal file
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0"?>
|
||||
<configuration>
|
||||
<system.web>
|
||||
<httpHandlers>
|
||||
<add path="*" verb="*"
|
||||
type="System.Web.HttpNotFoundHandler"/>
|
||||
</httpHandlers>
|
||||
|
||||
<!--
|
||||
Enabling request validation in view pages would cause validation to occur
|
||||
after the input has already been processed by the controller. By default
|
||||
MVC performs request validation before a controller processes the input.
|
||||
To change this behavior apply the ValidateInputAttribute to a
|
||||
controller or action.
|
||||
-->
|
||||
<pages
|
||||
validateRequest="false"
|
||||
pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
|
||||
pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
|
||||
userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
|
||||
<controls>
|
||||
<add assembly="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc" />
|
||||
</controls>
|
||||
</pages>
|
||||
</system.web>
|
||||
|
||||
<system.webServer>
|
||||
<validation validateIntegratedModeConfiguration="false"/>
|
||||
<handlers>
|
||||
<remove name="BlockViewHandler"/>
|
||||
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler"/>
|
||||
</handlers>
|
||||
</system.webServer>
|
||||
</configuration>
|
@@ -102,6 +102,13 @@
|
||||
<Compile Include="Feeds\Models\FeedResponse.cs" />
|
||||
<Compile Include="Feeds\Rss\RssFeedBuilder.cs" />
|
||||
<Compile Include="Feeds\Rss\RssResult.cs" />
|
||||
<Compile Include="Navigation\AdminMenu.cs" />
|
||||
<Compile Include="Navigation\Controllers\AdminController.cs" />
|
||||
<Compile Include="Navigation\Models\MenuPart.cs" />
|
||||
<Compile Include="Navigation\Permissions.cs" />
|
||||
<Compile Include="Navigation\Records\MenuPartRecord.cs" />
|
||||
<Compile Include="Navigation\Services\MainMenu.cs" />
|
||||
<Compile Include="Navigation\ViewModels\NavigationIndexViewModel.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Scheduling\Records\ScheduledTaskRecord.cs" />
|
||||
<Compile Include="Scheduling\Services\PublishingTaskHandler.cs" />
|
||||
@@ -202,8 +209,10 @@
|
||||
<Content Include="Themes\Views\Web.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Navigation\Controllers\" />
|
||||
<Folder Include="Navigation\Models\" />
|
||||
<Content Include="Navigation\Views\Admin\Index.ascx" />
|
||||
<Content Include="Navigation\Views\Web.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Scheduling\Controllers\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
|
Reference in New Issue
Block a user