mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-01-22 21:02:08 +08:00
- Adding some debug logging of view search locations
- Making the Themes (Core) Package a theme as well so the default theme can be reactivated --HG-- extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4045306
This commit is contained in:
@@ -142,6 +142,8 @@
|
||||
<Content Include="Common\Views\EditorTemplates\Parts\Common.Body.ascx" />
|
||||
<Content Include="Common\Views\EditorTemplates\Parts\Common.Owner.ascx" />
|
||||
<Content Include="Settings\Views\EditorTemplates\Items\Settings.Site.ascx" />
|
||||
<Content Include="Themes\Theme.gif" />
|
||||
<Content Include="Themes\Theme.txt" />
|
||||
<Content Include="Themes\Scripts\jquery-1.3.2-vsdoc.js" />
|
||||
<Content Include="Themes\Scripts\jquery-1.3.2.js" />
|
||||
<Content Include="Themes\Scripts\jquery-1.3.2.min-vsdoc.js" />
|
||||
|
||||
BIN
src/Orchard.Web/Core/Themes/Theme.gif
Normal file
BIN
src/Orchard.Web/Core/Themes/Theme.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
6
src/Orchard.Web/Core/Themes/Theme.txt
Normal file
6
src/Orchard.Web/Core/Themes/Theme.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
name: Blue (default)
|
||||
author: Jonathan Wall
|
||||
description: This is the default theme that has a resemblance to the default ASP.NET MVC web project style for some reason.
|
||||
version: 1.0
|
||||
tags: blue, default
|
||||
homepage: http://www.orchardproject.net
|
||||
@@ -1,4 +1,6 @@
|
||||
<%@ Page Language="C#" Inherits="Orchard.Mvc.ViewPage<ThemesIndexViewModel>" %>
|
||||
<%@ Import Namespace="Orchard.Themes"%>
|
||||
<%@ Import Namespace="Orchard.Extensions"%>
|
||||
<%@ Import Namespace="Orchard.Core.Themes.ViewModels"%>
|
||||
<h1><%=Html.TitleForPage(T("Manage Themes").ToString()) %></h1>
|
||||
<h2><%=_Encoded("Current Theme")%></h2>
|
||||
@@ -8,7 +10,7 @@
|
||||
} else {
|
||||
%><h3><%=Html.Encode(Model.CurrentTheme.DisplayName) %></h3>
|
||||
<p>
|
||||
<%=Html.Image(ResolveUrl("~/Themes/" + Model.CurrentTheme.ThemeName + "/Theme.gif"), Html.Encode(Model.CurrentTheme.DisplayName), null) %><br />
|
||||
<%=Html.Image(ResolveUrl(Html.Resolve<IExtensionManager>().GetThemeLocation(Model.CurrentTheme) + "/Theme.gif"), Html.Encode(Model.CurrentTheme.DisplayName), null)%><br />
|
||||
<%=_Encoded("By") %> <%=Html.Encode(Model.CurrentTheme.Author) %><br />
|
||||
<%=Html.Encode(Model.CurrentTheme.Version) %><br />
|
||||
<%=Html.Encode(Model.CurrentTheme.Description) %><br />
|
||||
@@ -23,7 +25,7 @@
|
||||
%> <li>
|
||||
<h3><%=Html.Encode(theme.DisplayName) %></h3>
|
||||
<p>
|
||||
<%=Html.Image(ResolveUrl("~/Themes/" + theme.ThemeName + "/Theme.gif"), Html.Encode(theme.DisplayName), null) %><br />
|
||||
<%=Html.Image(ResolveUrl(Html.Resolve<IExtensionManager>().GetThemeLocation(theme) + "/Theme.gif"), Html.Encode(theme.DisplayName), null)%><br />
|
||||
<%=_Encoded("By") %> <%=Html.Encode(theme.Author) %><br />
|
||||
<%=Html.Encode(theme.Version) %><br />
|
||||
<%=Html.Encode(theme.Description) %><br />
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using Orchard.Extensions;
|
||||
using Orchard.Logging;
|
||||
using Orchard.Mvc.Filters;
|
||||
using Orchard.Themes;
|
||||
|
||||
@@ -25,6 +26,8 @@ namespace Orchard.Mvc.ViewEngines {
|
||||
_viewEngineProviders = viewEngineProviders;
|
||||
}
|
||||
|
||||
public ILogger Logger { get; set; }
|
||||
|
||||
public void OnResultExecuting(ResultExecutingContext filterContext) {
|
||||
var viewResultBase = filterContext.Result as ViewResultBase;
|
||||
if (viewResultBase == null) {
|
||||
@@ -44,6 +47,7 @@ namespace Orchard.Mvc.ViewEngines {
|
||||
|
||||
themeViewEngines = _viewEngineProviders
|
||||
.Select(x => x.CreateThemeViewEngine(new CreateThemeViewEngineParams { VirtualPath = themeLocation }));
|
||||
Logger.Debug("Theme location:\r\n\t-{0}", themeLocation);
|
||||
}
|
||||
|
||||
|
||||
@@ -53,6 +57,7 @@ namespace Orchard.Mvc.ViewEngines {
|
||||
var packageLocations = packages.Select(x => Path.Combine(x.Descriptor.Location, x.Descriptor.Name));
|
||||
var packageViewEngines = _viewEngineProviders
|
||||
.Select(x => x.CreatePackagesViewEngine(new CreatePackagesViewEngineParams { VirtualPaths = packageLocations }));
|
||||
Logger.Debug("Package locations:\r\n\t-{0}", string.Join("\r\n\t-", packageLocations.ToArray()));
|
||||
|
||||
var requestViewEngines = new ViewEngineCollection(
|
||||
themeViewEngines
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using Orchard.Logging;
|
||||
|
||||
namespace Orchard.Mvc.ViewEngines {
|
||||
public class WebFormsViewEngineProvider : IViewEngineProvider {
|
||||
|
||||
static string[] DisabledFormats = new[] { "~/Disabled" };
|
||||
|
||||
public ILogger Logger { get; set; }
|
||||
|
||||
public IViewEngine CreateThemeViewEngine(CreateThemeViewEngineParams parameters) {
|
||||
// Area: if "area" in RouteData. Url hit for package...
|
||||
// Area-Layout Paths - no-op because LayoutViewEngine uses multi-pass instead of layout paths
|
||||
@@ -34,6 +37,8 @@ namespace Orchard.Mvc.ViewEngines {
|
||||
parameters.VirtualPath + "/Views/{0}.aspx",
|
||||
};
|
||||
|
||||
Logger.Debug("PartialViewLocationFormats (theme): \r\n\t-{0}", string.Join("\r\n\t-", viewEngine.PartialViewLocationFormats));
|
||||
|
||||
// for "routed" request views...
|
||||
// enable /Views/{area}/{controller}/{viewName}
|
||||
viewEngine.AreaPartialViewLocationFormats = new[] {
|
||||
@@ -41,6 +46,8 @@ namespace Orchard.Mvc.ViewEngines {
|
||||
parameters.VirtualPath + "/Views/{2}/{1}/{0}.aspx",
|
||||
};
|
||||
|
||||
Logger.Debug("AreaPartialViewLocationFormats (theme): \r\n\t-{0}", string.Join("\r\n\t-", viewEngine.AreaPartialViewLocationFormats));
|
||||
|
||||
return viewEngine;
|
||||
}
|
||||
|
||||
@@ -52,6 +59,8 @@ namespace Orchard.Mvc.ViewEngines {
|
||||
"~/Packages/{2}/Views/{1}/{0}.aspx",
|
||||
};
|
||||
|
||||
Logger.Debug("AreaFormats (package): \r\n\t-{0}", string.Join("\r\n\t-", areaFormats));
|
||||
|
||||
var universalFormats = parameters.VirtualPaths
|
||||
.SelectMany(x => new[] {
|
||||
x + "/Views/{0}.ascx",
|
||||
@@ -59,6 +68,8 @@ namespace Orchard.Mvc.ViewEngines {
|
||||
})
|
||||
.ToArray();
|
||||
|
||||
Logger.Debug("UniversalFormats (package): \r\n\t-{0}", string.Join("\r\n\t-", universalFormats));
|
||||
|
||||
var viewEngine = new WebFormViewEngine {
|
||||
MasterLocationFormats = DisabledFormats,
|
||||
ViewLocationFormats = universalFormats,
|
||||
|
||||
Reference in New Issue
Block a user