Continuing theming work...

--HG--
extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4044193
This commit is contained in:
skewed
2009-12-17 00:53:03 +00:00
parent 51bc29d464
commit 8625676409
9 changed files with 58 additions and 18 deletions

View File

@@ -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"};
}
}
}

View File

@@ -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) {

View File

@@ -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

View File

@@ -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><%