mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-22 20:13:50 +08:00
Continuing theming work...
--HG-- extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4044193
This commit is contained in:
@@ -4,7 +4,7 @@ using Orchard.Themes;
|
||||
namespace Orchard.Core.Themes {
|
||||
public class SafeModeThemeSelector : IThemeSelector {
|
||||
public ThemeSelectorResult GetTheme(RequestContext context) {
|
||||
return new ThemeSelectorResult {Priority = -100, ThemeName = "SafeMode"};
|
||||
return new ThemeSelectorResult {Priority = -100, ThemeName = "Themes"};
|
||||
}
|
||||
}
|
||||
}
|
@@ -49,14 +49,18 @@ namespace Orchard.Core.Themes.Services {
|
||||
var requestTheme = _themeSelectors
|
||||
.Select(x => x.GetTheme(requestContext))
|
||||
.Where(x => x != null)
|
||||
.OrderByDescending(x => x.Priority)
|
||||
.FirstOrDefault();
|
||||
.OrderByDescending(x => x.Priority);
|
||||
|
||||
if (requestTheme == null) {
|
||||
if (requestTheme.Count() < 1)
|
||||
return null;
|
||||
|
||||
foreach (var theme in requestTheme) {
|
||||
var t = GetThemeByName(theme.ThemeName);
|
||||
if (t != null)
|
||||
return t;
|
||||
}
|
||||
|
||||
return GetThemeByName(requestTheme.ThemeName);
|
||||
return null;
|
||||
}
|
||||
|
||||
public ITheme GetThemeByName(string name) {
|
||||
|
@@ -1,4 +1,4 @@
|
||||
name: SafeMode
|
||||
name: Safe Mode
|
||||
description: This is the default theme for the Themes extension.
|
||||
version: 1.0
|
||||
tags: safe, default
|
||||
|
@@ -5,7 +5,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
||||
<title><%=Html.Title() %> - Safe Mode!</title><%
|
||||
<title><%=Html.Title() %> - !!Safe Mode!!</title><%
|
||||
Html.Zone("head", ":metas :styles :scripts"); %>
|
||||
</head>
|
||||
<body><%
|
||||
|
Reference in New Issue
Block a user