Fixed theme detection when opening a namespace with incorrect casing.
This commit is contained in:
parent
462716961d
commit
ab22f73cbb
3 changed files with 6 additions and 6 deletions
|
@ -16,5 +16,5 @@ using System.Reflection;
|
||||||
//
|
//
|
||||||
// You can specify all the values or you can default the Revision and Build Numbers
|
// You can specify all the values or you can default the Revision and Build Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
[assembly: AssemblyVersion("3.0.1.403")]
|
[assembly: AssemblyVersion("3.0.1.404")]
|
||||||
[assembly: AssemblyFileVersion("3.0.1.403")]
|
[assembly: AssemblyFileVersion("3.0.1.404")]
|
||||||
|
|
|
@ -763,6 +763,7 @@ namespace ScrewTurn.Wiki {
|
||||||
/// <param name="nspace">The namespace (<c>null</c> for the root).</param>
|
/// <param name="nspace">The namespace (<c>null</c> for the root).</param>
|
||||||
/// <returns>The theme name.</returns>
|
/// <returns>The theme name.</returns>
|
||||||
public static string GetTheme(string nspace) {
|
public static string GetTheme(string nspace) {
|
||||||
|
if(!string.IsNullOrEmpty(nspace)) nspace = Pages.FindNamespace(nspace).Name;
|
||||||
string propertyName = "Theme" + (!string.IsNullOrEmpty(nspace) ? "-" + nspace : "");
|
string propertyName = "Theme" + (!string.IsNullOrEmpty(nspace) ? "-" + nspace : "");
|
||||||
return GetString(Provider.GetSetting(propertyName), "Default");
|
return GetString(Provider.GetSetting(propertyName), "Default");
|
||||||
}
|
}
|
||||||
|
@ -773,6 +774,7 @@ namespace ScrewTurn.Wiki {
|
||||||
/// <param name="nspace">The namespace (<c>null</c> for the root).</param>
|
/// <param name="nspace">The namespace (<c>null</c> for the root).</param>
|
||||||
/// <param name="theme">The theme name.</param>
|
/// <param name="theme">The theme name.</param>
|
||||||
public static void SetTheme(string nspace, string theme) {
|
public static void SetTheme(string nspace, string theme) {
|
||||||
|
if(!string.IsNullOrEmpty(nspace)) nspace = Pages.FindNamespace(nspace).Name;
|
||||||
string propertyName = "Theme" + (!string.IsNullOrEmpty(nspace) ? "-" + nspace : "");
|
string propertyName = "Theme" + (!string.IsNullOrEmpty(nspace) ? "-" + nspace : "");
|
||||||
Provider.SetSetting(propertyName, theme);
|
Provider.SetSetting(propertyName, theme);
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,9 +31,6 @@ namespace ScrewTurn.Wiki {
|
||||||
string nspace = GetCurrentNamespace();
|
string nspace = GetCurrentNamespace();
|
||||||
if(!string.IsNullOrEmpty(nspace)) pageName = pageName.Substring(nspace.Length + 1); // Trim Namespace. from pageName
|
if(!string.IsNullOrEmpty(nspace)) pageName = pageName.Substring(nspace.Length + 1); // Trim Namespace. from pageName
|
||||||
|
|
||||||
//HttpContext.Current.Response.Filter =
|
|
||||||
// new ScrewTurn.Wiki.RelativeUrlFilterStream(HttpContext.Current.Response.Filter, nspace);
|
|
||||||
|
|
||||||
string queryString = ""; // Empty or begins with ampersand, not question mark
|
string queryString = ""; // Empty or begins with ampersand, not question mark
|
||||||
try {
|
try {
|
||||||
// This might throw exceptions if 3rd-party modules interfer with the request pipeline
|
// This might throw exceptions if 3rd-party modules interfer with the request pipeline
|
||||||
|
@ -53,7 +50,7 @@ namespace ScrewTurn.Wiki {
|
||||||
else if(ext.Equals("aspx")) {
|
else if(ext.Equals("aspx")) {
|
||||||
// System page requested, redirect to the root of the application
|
// System page requested, redirect to the root of the application
|
||||||
// For example: http://www.server.com/Namespace.Edit.aspx?Page=MainPage -> http://www.server.com/Edit.aspx?Page=MainPage&NS=Namespace
|
// For example: http://www.server.com/Namespace.Edit.aspx?Page=MainPage -> http://www.server.com/Edit.aspx?Page=MainPage&NS=Namespace
|
||||||
if(!string.IsNullOrEmpty(nspace)) { // Needed to avoid infinite loops
|
if(!string.IsNullOrEmpty(nspace)) {
|
||||||
if(!queryString.Contains("NS=")) {
|
if(!queryString.Contains("NS=")) {
|
||||||
HttpContext.Current.RewritePath("~/" + Tools.UrlEncode(pageName) + "." + ext + "?NS=" + Tools.UrlEncode(nspace) + queryString);
|
HttpContext.Current.RewritePath("~/" + Tools.UrlEncode(pageName) + "." + ext + "?NS=" + Tools.UrlEncode(nspace) + queryString);
|
||||||
}
|
}
|
||||||
|
@ -122,6 +119,7 @@ namespace ScrewTurn.Wiki {
|
||||||
if(string.IsNullOrEmpty(nspace)) nspace = null;
|
if(string.IsNullOrEmpty(nspace)) nspace = null;
|
||||||
if(nspace == null) nspace = GetCurrentNamespace();
|
if(nspace == null) nspace = GetCurrentNamespace();
|
||||||
if(string.IsNullOrEmpty(nspace)) nspace = null;
|
if(string.IsNullOrEmpty(nspace)) nspace = null;
|
||||||
|
else nspace = Pages.FindNamespace(nspace).Name;
|
||||||
|
|
||||||
if(nspace != null) {
|
if(nspace != null) {
|
||||||
string tempStringLower = tempString.ToLowerInvariant();
|
string tempStringLower = tempString.ToLowerInvariant();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue