mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-24 13:33:34 +08:00
Migrating Site Settings
--HG-- branch : dev
This commit is contained in:
@@ -1,20 +1,18 @@
|
|||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using Orchard.ContentManagement;
|
using Orchard.ContentManagement;
|
||||||
using Orchard.ContentManagement.Drivers;
|
using Orchard.ContentManagement.Drivers;
|
||||||
using Orchard.Core.ContentsLocation.Models;
|
|
||||||
using Orchard.Core.Messaging.Models;
|
using Orchard.Core.Messaging.Models;
|
||||||
using Orchard.Core.Messaging.Services;
|
|
||||||
using Orchard.Core.Messaging.ViewModels;
|
using Orchard.Core.Messaging.ViewModels;
|
||||||
using Orchard.Localization;
|
using Orchard.Localization;
|
||||||
using Orchard.Messaging.Services;
|
using Orchard.Messaging.Services;
|
||||||
|
|
||||||
namespace Orchard.Core.Messaging.Drivers {
|
namespace Orchard.Core.Messaging.Drivers {
|
||||||
[UsedImplicitly]
|
[UsedImplicitly]
|
||||||
public class ContentSubscriptionPartDriver : ContentPartDriver<MessageSettingsPart> {
|
public class MessageSettingsPartDriver : ContentPartDriver<MessageSettingsPart> {
|
||||||
private readonly IMessageManager _messageQueueManager;
|
private readonly IMessageManager _messageQueueManager;
|
||||||
public IOrchardServices Services { get; set; }
|
public IOrchardServices Services { get; set; }
|
||||||
|
|
||||||
public ContentSubscriptionPartDriver(IOrchardServices services, IMessageManager messageQueueManager) {
|
public MessageSettingsPartDriver(IOrchardServices services, IMessageManager messageQueueManager) {
|
||||||
_messageQueueManager = messageQueueManager;
|
_messageQueueManager = messageQueueManager;
|
||||||
Services = services;
|
Services = services;
|
||||||
T = NullLocalizer.Instance;
|
T = NullLocalizer.Instance;
|
||||||
|
@@ -5,8 +5,8 @@ using Orchard.ContentManagement.Handlers;
|
|||||||
|
|
||||||
namespace Orchard.Core.Messaging.Handlers {
|
namespace Orchard.Core.Messaging.Handlers {
|
||||||
[UsedImplicitly]
|
[UsedImplicitly]
|
||||||
public class SmtpSettingsPartHandler : ContentHandler {
|
public class MessageSettingsPartHandler : ContentHandler {
|
||||||
public SmtpSettingsPartHandler(IRepository<MessageSettingsPartRecord> repository) {
|
public MessageSettingsPartHandler(IRepository<MessageSettingsPartRecord> repository) {
|
||||||
Filters.Add(new ActivatingFilter<MessageSettingsPart>("Site"));
|
Filters.Add(new ActivatingFilter<MessageSettingsPart>("Site"));
|
||||||
Filters.Add(StorageFilter.For(repository));
|
Filters.Add(StorageFilter.For(repository));
|
||||||
}
|
}
|
||||||
|
@@ -200,6 +200,7 @@
|
|||||||
<Compile Include="Scheduling\Services\ScheduledTaskExecutor.cs" />
|
<Compile Include="Scheduling\Services\ScheduledTaskExecutor.cs" />
|
||||||
<Compile Include="Scheduling\Models\Task.cs" />
|
<Compile Include="Scheduling\Models\Task.cs" />
|
||||||
<Compile Include="Settings\DataMigrations\SettingsDataMigration.cs" />
|
<Compile Include="Settings\DataMigrations\SettingsDataMigration.cs" />
|
||||||
|
<Compile Include="Settings\Drivers\SiteSettingsPartDriver.cs" />
|
||||||
<Compile Include="Settings\ViewModels\SiteCulturesViewModel.cs" />
|
<Compile Include="Settings\ViewModels\SiteCulturesViewModel.cs" />
|
||||||
<Compile Include="Settings\Metadata\ContentDefinitionManager.cs" />
|
<Compile Include="Settings\Metadata\ContentDefinitionManager.cs" />
|
||||||
<Compile Include="Settings\Metadata\Records\ContentFieldDefinitionRecord.cs" />
|
<Compile Include="Settings\Metadata\Records\ContentFieldDefinitionRecord.cs" />
|
||||||
@@ -221,7 +222,7 @@
|
|||||||
<Compile Include="Settings\Handlers\SiteSettingsPartHandler.cs" />
|
<Compile Include="Settings\Handlers\SiteSettingsPartHandler.cs" />
|
||||||
<Compile Include="Settings\Models\SiteSettingsPart.cs" />
|
<Compile Include="Settings\Models\SiteSettingsPart.cs" />
|
||||||
<Compile Include="Settings\Services\SiteService.cs" />
|
<Compile Include="Settings\Services\SiteService.cs" />
|
||||||
<Compile Include="Settings\ViewModels\SettingsIndexViewModel.cs" />
|
<Compile Include="Settings\ViewModels\SiteSettingsPartViewModel.cs" />
|
||||||
<Compile Include="Shapes\CoreShapes.cs" />
|
<Compile Include="Shapes\CoreShapes.cs" />
|
||||||
<Compile Include="XmlRpc\Controllers\HomeController.cs" />
|
<Compile Include="XmlRpc\Controllers\HomeController.cs" />
|
||||||
<Compile Include="XmlRpc\Controllers\LiveWriterController.cs" />
|
<Compile Include="XmlRpc\Controllers\LiveWriterController.cs" />
|
||||||
@@ -310,6 +311,7 @@
|
|||||||
<None Include="Routable\Views\DisplayTemplates\Parts\Routable.RoutePart.cshtml" />
|
<None Include="Routable\Views\DisplayTemplates\Parts\Routable.RoutePart.cshtml" />
|
||||||
<Content Include="Settings\Module.txt" />
|
<Content Include="Settings\Module.txt" />
|
||||||
<Content Include="Settings\Styles\admin.css" />
|
<Content Include="Settings\Styles\admin.css" />
|
||||||
|
<None Include="Settings\Views\Admin\Copy of Index.cshtml" />
|
||||||
<None Include="Settings\Views\Admin\Index.cshtml" />
|
<None Include="Settings\Views\Admin\Index.cshtml" />
|
||||||
<None Include="Settings\Views\Admin\Culture.cshtml" />
|
<None Include="Settings\Views\Admin\Culture.cshtml" />
|
||||||
<Content Include="Settings\Views\DisplayTemplates\CurrentCulture.ascx" />
|
<Content Include="Settings\Views\DisplayTemplates\CurrentCulture.ascx" />
|
||||||
@@ -335,6 +337,7 @@
|
|||||||
<Content Include="Shapes\Views\UI\Switchable.ascx" />
|
<Content Include="Shapes\Views\UI\Switchable.ascx" />
|
||||||
<Content Include="Web.config" />
|
<Content Include="Web.config" />
|
||||||
<Content Include="XmlRpc\Module.txt" />
|
<Content Include="XmlRpc\Module.txt" />
|
||||||
|
<None Include="Settings\Views\EditorTemplates\Parts\Settings.SiteSettingsPart.cshtml" />
|
||||||
<None Include="Shapes\Views\Display.cshtml" />
|
<None Include="Shapes\Views\Display.cshtml" />
|
||||||
<None Include="Shapes\Views\Menu.ascx_" />
|
<None Include="Shapes\Views\Menu.ascx_" />
|
||||||
<None Include="XmlRpc\Views\Home\Index.cshtml" />
|
<None Include="XmlRpc\Views\Home\Index.cshtml" />
|
||||||
@@ -365,7 +368,6 @@
|
|||||||
<Content Include="Feeds\Module.txt" />
|
<Content Include="Feeds\Module.txt" />
|
||||||
<Content Include="Navigation\Module.txt" />
|
<Content Include="Navigation\Module.txt" />
|
||||||
<Content Include="Scheduling\Module.txt" />
|
<Content Include="Scheduling\Module.txt" />
|
||||||
<Content Include="Settings\Views\EditorTemplates\Items\Settings.Site.ascx" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="Dashboard\Module.txt" />
|
<Content Include="Dashboard\Module.txt" />
|
||||||
|
@@ -35,11 +35,8 @@ namespace Orchard.Core.Settings.Controllers {
|
|||||||
if (!Services.Authorizer.Authorize(Permissions.ManageSettings, T("Not authorized to manage settings")))
|
if (!Services.Authorizer.Authorize(Permissions.ManageSettings, T("Not authorized to manage settings")))
|
||||||
return new HttpUnauthorizedResult();
|
return new HttpUnauthorizedResult();
|
||||||
|
|
||||||
var site = _siteService.GetSiteSettings().As<SiteSettingsPart>();
|
var model = Services.ContentManager.BuildEditorModel(_siteService.GetSiteSettings());
|
||||||
var model = new SettingsIndexViewModel {
|
|
||||||
Site = site,
|
|
||||||
SiteCultures = _cultureManager.ListCultures()
|
|
||||||
};
|
|
||||||
return View(model);
|
return View(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -49,7 +46,7 @@ namespace Orchard.Core.Settings.Controllers {
|
|||||||
return new HttpUnauthorizedResult();
|
return new HttpUnauthorizedResult();
|
||||||
|
|
||||||
var site = _siteService.GetSiteSettings().As<SiteSettingsPart>();
|
var site = _siteService.GetSiteSettings().As<SiteSettingsPart>();
|
||||||
var model = new SettingsIndexViewModel { Site = Services.ContentManager.UpdateEditorModel(site, this) };
|
var model = new SiteSettingsPartViewModel { Site = Services.ContentManager.UpdateEditorModel(site, this) };
|
||||||
|
|
||||||
if (!ModelState.IsValid) {
|
if (!ModelState.IsValid) {
|
||||||
Services.TransactionManager.Cancel();
|
Services.TransactionManager.Cancel();
|
||||||
|
@@ -0,0 +1,43 @@
|
|||||||
|
using JetBrains.Annotations;
|
||||||
|
using Orchard.ContentManagement;
|
||||||
|
using Orchard.ContentManagement.Drivers;
|
||||||
|
using Orchard.Core.Settings.Models;
|
||||||
|
using Orchard.Core.Settings.ViewModels;
|
||||||
|
using Orchard.Localization.Services;
|
||||||
|
using Orchard.Settings;
|
||||||
|
|
||||||
|
namespace Orchard.Core.Settings.Drivers {
|
||||||
|
[UsedImplicitly]
|
||||||
|
public class SiteSettingsPartDriver : ContentPartDriver<SiteSettingsPart> {
|
||||||
|
private readonly ISiteService _siteService;
|
||||||
|
private readonly ICultureManager _cultureManager;
|
||||||
|
|
||||||
|
public SiteSettingsPartDriver(ISiteService siteService, ICultureManager cultureManager) {
|
||||||
|
_siteService = siteService;
|
||||||
|
_cultureManager = cultureManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override string Prefix { get { return "SiteSettings"; } }
|
||||||
|
|
||||||
|
protected override DriverResult Editor(SiteSettingsPart part) {
|
||||||
|
var site = _siteService.GetSiteSettings().As<SiteSettingsPart>();
|
||||||
|
|
||||||
|
var model = new SiteSettingsPartViewModel {
|
||||||
|
Site = site,
|
||||||
|
SiteCultures = _cultureManager.ListCultures()
|
||||||
|
};
|
||||||
|
|
||||||
|
return ContentPartTemplate(model, "Parts/Settings.SiteSettingsPart");
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override DriverResult Editor(SiteSettingsPart part, IUpdateModel updater) {
|
||||||
|
var site = _siteService.GetSiteSettings().As<SiteSettingsPart>();
|
||||||
|
var model = new SiteSettingsPartViewModel { Site = site };
|
||||||
|
|
||||||
|
if (updater.TryUpdateModel(model, Prefix, null, null)) {
|
||||||
|
}
|
||||||
|
|
||||||
|
return ContentPartTemplate(model, "Parts/Settings.SiteSettingsPart");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -4,7 +4,7 @@ using Orchard.ContentManagement;
|
|||||||
using Orchard.Core.Settings.Models;
|
using Orchard.Core.Settings.Models;
|
||||||
|
|
||||||
namespace Orchard.Core.Settings.ViewModels {
|
namespace Orchard.Core.Settings.ViewModels {
|
||||||
public class SettingsIndexViewModel {
|
public class SiteSettingsPartViewModel {
|
||||||
public SiteSettingsPart Site { get; set; }
|
public SiteSettingsPart Site { get; set; }
|
||||||
public IEnumerable<string> SiteCultures { get; set; }
|
public IEnumerable<string> SiteCultures { get; set; }
|
||||||
|
|
@@ -0,0 +1,35 @@
|
|||||||
|
@model SettingsIndexViewModel
|
||||||
|
@using Orchard.Core.Settings.ViewModels
|
||||||
|
<h1>@Html.TitleForPage(T("Manage Settings").ToString())</h1>
|
||||||
|
@using (Html.BeginFormAntiForgeryPost()) {
|
||||||
|
@Html.ValidationSummary()
|
||||||
|
<fieldset>
|
||||||
|
<legend>@T("Global Settings")</legend>
|
||||||
|
<div>
|
||||||
|
<label for="SiteName">@T("Site name")</label>
|
||||||
|
@Html.EditorFor(m => m.SiteName)
|
||||||
|
@Html.ValidationMessage("SiteName", "*")
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label for="SiteCulture">@T("Default Site Culture")</label>
|
||||||
|
@Html.DropDownList("SiteCulture", new SelectList(Model.SiteCultures, Model.SiteCulture))
|
||||||
|
@Html.ValidationMessage("SiteCulture", "*")
|
||||||
|
<p>@Html.ActionLink(T("Add or remove supported cultures for the site.").ToString(), "Culture")</p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label for="PageTitleSeparator">@T("Page title separator")</label>
|
||||||
|
@Html.EditorFor(x => x.PageTitleSeparator)
|
||||||
|
@Html.ValidationMessage("PageTitleSeparator", "*")
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label for="SuperUser">@T("Super user")</label>
|
||||||
|
@Html.EditorFor(x=>x.SuperUser)
|
||||||
|
@Html.ValidationMessage("SuperUser", "*")
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<fieldset>
|
||||||
|
@Html.EditorFor(s => s.Id)
|
||||||
|
<input class="button primaryAction" type="submit" value="@T("Save")" />
|
||||||
|
</fieldset>
|
||||||
|
}
|
@@ -1,35 +1,11 @@
|
|||||||
@model SettingsIndexViewModel
|
<h1>@Html.TitleForPage(T("Manage Settings").ToString())</h1>
|
||||||
@using Orchard.Core.Settings.ViewModels
|
|
||||||
<h1>@Html.TitleForPage(T("Manage Settings").ToString())</h1>
|
|
||||||
@using (Html.BeginFormAntiForgeryPost()) {
|
@using (Html.BeginFormAntiForgeryPost()) {
|
||||||
@Html.ValidationSummary()
|
@Html.ValidationSummary()
|
||||||
|
@//todo : (sebros) Zone names are not consistent for settings parts, clean it
|
||||||
|
@Display(Model.body)
|
||||||
|
@Display(Model.primary)
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>@T("Global Settings")</legend>
|
|
||||||
<div>
|
|
||||||
<label for="SiteName">@T("Site name")</label>
|
|
||||||
@Html.EditorFor(m => m.SiteName)
|
|
||||||
@Html.ValidationMessage("SiteName", "*")
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<label for="SiteCulture">@T("Default Site Culture")</label>
|
|
||||||
@Html.DropDownList("SiteCulture", new SelectList(Model.SiteCultures, Model.SiteCulture))
|
|
||||||
@Html.ValidationMessage("SiteCulture", "*")
|
|
||||||
<p>@Html.ActionLink(T("Add or remove supported cultures for the site.").ToString(), "Culture")</p>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<label for="PageTitleSeparator">@T("Page title separator")</label>
|
|
||||||
@Html.EditorFor(x => x.PageTitleSeparator)
|
|
||||||
@Html.ValidationMessage("PageTitleSeparator", "*")
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<label for="SuperUser">@T("Super user")</label>
|
|
||||||
@Html.EditorFor(x=>x.SuperUser)
|
|
||||||
@Html.ValidationMessage("SuperUser", "*")
|
|
||||||
</div>
|
|
||||||
</fieldset>
|
|
||||||
|
|
||||||
<fieldset>
|
|
||||||
@Html.EditorFor(s => s.Id)
|
|
||||||
<input class="button primaryAction" type="submit" value="@T("Save")" />
|
<input class="button primaryAction" type="submit" value="@T("Save")" />
|
||||||
</fieldset>
|
</fieldset>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,5 +0,0 @@
|
|||||||
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<ContentItemViewModel<SiteSettingsPart>>" %>
|
|
||||||
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
|
|
||||||
<%@ Import Namespace="Orchard.Core.Settings.Models"%>
|
|
||||||
<% Html.Zone("primary");
|
|
||||||
Html.ZonesAny(); %>
|
|
@@ -0,0 +1,25 @@
|
|||||||
|
@model Orchard.Core.Settings.ViewModels.SiteSettingsPartViewModel
|
||||||
|
<fieldset>
|
||||||
|
<legend>@T("Global Settings")</legend>
|
||||||
|
<div>
|
||||||
|
<label for="SiteName">@T("Site name")</label>
|
||||||
|
@Html.EditorFor(m => m.SiteName)
|
||||||
|
@Html.ValidationMessage("SiteName", "*")
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label for="SiteCulture">@T("Default Site Culture")</label>
|
||||||
|
@Html.DropDownList("SiteCulture", new SelectList(Model.SiteCultures, Model.SiteCulture))
|
||||||
|
@Html.ValidationMessage("SiteCulture", "*")
|
||||||
|
<p>@Html.ActionLink(T("Add or remove supported cultures for the site.").ToString(), "Culture")</p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label for="PageTitleSeparator">@T("Page title separator")</label>
|
||||||
|
@Html.EditorFor(x => x.PageTitleSeparator)
|
||||||
|
@Html.ValidationMessage("PageTitleSeparator", "*")
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label for="SuperUser">@T("Super user")</label>
|
||||||
|
@Html.EditorFor(x=>x.SuperUser)
|
||||||
|
@Html.ValidationMessage("SuperUser", "*")
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
@@ -9,7 +9,7 @@ namespace Orchard.Users.Handlers {
|
|||||||
public RegistrationSettingsPartHandler(IRepository<RegistrationSettingsPartRecord> repository) {
|
public RegistrationSettingsPartHandler(IRepository<RegistrationSettingsPartRecord> repository) {
|
||||||
Filters.Add(new ActivatingFilter<RegistrationSettingsPart>("Site"));
|
Filters.Add(new ActivatingFilter<RegistrationSettingsPart>("Site"));
|
||||||
Filters.Add(StorageFilter.For(repository));
|
Filters.Add(StorageFilter.For(repository));
|
||||||
Filters.Add(new TemplateFilterForRecord<RegistrationSettingsPartRecord>("RegistrationSettings"));
|
Filters.Add(new TemplateFilterForRecord<RegistrationSettingsPartRecord>("RegistrationSettings", "Parts/Users.RegistrationSettings"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -1,15 +1,15 @@
|
|||||||
using System;
|
using Orchard.ContentManagement.Records;
|
||||||
using Orchard.ContentManagement.Records;
|
|
||||||
|
|
||||||
namespace Orchard.ContentManagement.Handlers {
|
namespace Orchard.ContentManagement.Handlers {
|
||||||
[Obsolete]
|
|
||||||
public class TemplateFilterForRecord<TRecord> : TemplateFilterBase<ContentPart<TRecord>> where TRecord : ContentPartRecord, new() {
|
public class TemplateFilterForRecord<TRecord> : TemplateFilterBase<ContentPart<TRecord>> where TRecord : ContentPartRecord, new() {
|
||||||
private readonly string _prefix;
|
private readonly string _prefix;
|
||||||
private string _location;
|
private string _location;
|
||||||
private string _position;
|
private string _position;
|
||||||
|
private readonly string _templateName;
|
||||||
|
|
||||||
public TemplateFilterForRecord(string prefix) {
|
public TemplateFilterForRecord(string prefix, string templateName) {
|
||||||
_prefix = prefix;
|
_prefix = prefix;
|
||||||
|
_templateName = templateName;
|
||||||
_location = "primary";
|
_location = "primary";
|
||||||
_position = "5";
|
_position = "5";
|
||||||
}
|
}
|
||||||
@@ -24,13 +24,14 @@ namespace Orchard.ContentManagement.Handlers {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
//protected override void BuildEditorShape(BuildEditorModelContext context, ContentPart<TRecord> part) {
|
protected override void BuildEditorShape(BuildEditorModelContext context, ContentPart<TRecord> part) {
|
||||||
// context.ContentItem.Zones[_location].Add(part.Record, _position);
|
var templateShape = context.Shape.EditorTemplate(TemplateName: _templateName, Model: part.Record, Prefix: _prefix);
|
||||||
//}
|
context.Model.Zones[_location].Add(templateShape, _position);
|
||||||
|
}
|
||||||
|
|
||||||
//protected override void UpdateEditorShape(UpdateEditorModelContext context, ContentPart<TRecord> part) {
|
protected override void UpdateEditorShape(UpdateEditorModelContext context, ContentPart<TRecord> part) {
|
||||||
// context.Updater.TryUpdateModel(part.Record, _prefix, null, null);
|
context.Updater.TryUpdateModel(part.Record, _prefix, null, null);
|
||||||
// BuildEditorShape(context, part);
|
BuildEditorShape(context, part);
|
||||||
//}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Concurrent;
|
using System.Collections.Concurrent;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
@@ -45,6 +46,7 @@ namespace Orchard.DisplayManagement.Descriptors.ShapeAttributeStrategy {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[DebuggerStepThrough]
|
||||||
private Func<DisplayContext, IHtmlString> CreateDelegate(
|
private Func<DisplayContext, IHtmlString> CreateDelegate(
|
||||||
ShapeAttributeOccurrence attributeOccurrence,
|
ShapeAttributeOccurrence attributeOccurrence,
|
||||||
ShapeDescriptor descriptor) {
|
ShapeDescriptor descriptor) {
|
||||||
@@ -55,8 +57,7 @@ namespace Orchard.DisplayManagement.Descriptors.ShapeAttributeStrategy {
|
|||||||
return PerformInvoke(context, attributeOccurrence.MethodInfo, serviceInstance);
|
return PerformInvoke(context, attributeOccurrence.MethodInfo, serviceInstance);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private IHtmlString PerformInvoke(DisplayContext displayContext, MethodInfo methodInfo, object serviceInstance) {
|
private IHtmlString PerformInvoke(DisplayContext displayContext, MethodInfo methodInfo, object serviceInstance) {
|
||||||
var output = new HtmlStringWriter();
|
var output = new HtmlStringWriter();
|
||||||
var arguments = methodInfo.GetParameters()
|
var arguments = methodInfo.GetParameters()
|
||||||
|
@@ -1,12 +1,11 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
using System.Web.Mvc;
|
using System.Web.Mvc;
|
||||||
using System.Web.Routing;
|
using System.Web.Routing;
|
||||||
using System.Web.SessionState;
|
using System.Web.SessionState;
|
||||||
using Autofac;
|
using Autofac;
|
||||||
using Autofac.Integration.Web;
|
|
||||||
using Orchard.Environment;
|
using Orchard.Environment;
|
||||||
using Orchard.Environment.AutofacUtil;
|
|
||||||
using Orchard.Environment.Configuration;
|
using Orchard.Environment.Configuration;
|
||||||
|
|
||||||
namespace Orchard.Mvc.Routes {
|
namespace Orchard.Mvc.Routes {
|
||||||
@@ -150,6 +149,7 @@ namespace Orchard.Mvc.Routes {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[DebuggerStepThrough]
|
||||||
public void EndProcessRequest(IAsyncResult result) {
|
public void EndProcessRequest(IAsyncResult result) {
|
||||||
try {
|
try {
|
||||||
_httpAsyncHandler.EndProcessRequest(result);
|
_httpAsyncHandler.EndProcessRequest(result);
|
||||||
|
@@ -1,11 +1,10 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Web.Mvc;
|
using System.Web.Mvc;
|
||||||
|
|
||||||
namespace Orchard.Mvc.ViewEngines.Razor {
|
namespace Orchard.Mvc.ViewEngines.Razor {
|
||||||
public class RazorViewEngine : CshtmlViewEngine {
|
public class RazorViewEngine : CshtmlViewEngine {
|
||||||
|
[DebuggerStepThrough]
|
||||||
protected override bool FileExists(ControllerContext controllerContext, string virtualPath) {
|
protected override bool FileExists(ControllerContext controllerContext, string virtualPath) {
|
||||||
if (!virtualPath.EndsWith(".cshtml", StringComparison.InvariantCultureIgnoreCase))
|
if (!virtualPath.EndsWith(".cshtml", StringComparison.InvariantCultureIgnoreCase))
|
||||||
return false;
|
return false;
|
||||||
|
Reference in New Issue
Block a user