瀏覽代碼

load themes relative to context root

svn path=/trunk/mcs/; revision=61560
Konstantin Triger 19 年之前
父節點
當前提交
8799f00b45

+ 4 - 0
mcs/class/System.Web/System.Web.Compilation/ChangeLog

@@ -1,3 +1,7 @@
+2006-06-08	Konstantin Triger <[email protected]>
+
+	* ThemeDirectoryCompiler.cs: use physical path instead of virtual path.
+
 2006-04-24  Andrew Skiba  <[email protected]>
 
 	* ThemeDirectoryCompiler.cs: use UrlUtils.Combine to combine pathes

+ 3 - 3
mcs/class/System.Web/System.Web.Compilation/ThemeDirectoryCompiler.cs

@@ -46,18 +46,18 @@ namespace System.Web.UI
 			string physicalPath = context.Request.MapPath (virtualPath);
 			string[] skin_files = Directory.GetFiles (physicalPath, "*.skin");
 
-			PageThemeParser ptp = new PageThemeParser (virtualPath, context);
+			PageThemeParser ptp = new PageThemeParser (physicalPath, context);
 			
 			string[] css_files = Directory.GetFiles (physicalPath, "*.css");
 			string[] css_urls = new string[css_files.Length];
 			for (int i = 0; i < css_files.Length; i++)
-				css_urls[i] = UrlUtils.Combine (virtualPath, Path.GetFileName (css_files[i]));
+				css_urls [i] = UrlUtils.Combine (physicalPath, Path.GetFileName (css_files [i]));
 			ptp.LinkedStyleSheets = css_urls;
 			
 			ptp.RootBuilder = new RootBuilder ();
 
 			for (int i = 0; i < skin_files.Length; i ++) {
-				string skin_file_url = UrlUtils.Combine (virtualPath, Path.GetFileName (skin_files[i]));
+				string skin_file_url = UrlUtils.Combine (physicalPath, Path.GetFileName (skin_files [i]));
 				PageThemeFileParser ptfp = new PageThemeFileParser (skin_file_url,
 										   skin_files[i],
 										   context);

+ 5 - 0
mcs/class/System.Web/System.Web.UI/ChangeLog

@@ -1,3 +1,8 @@
+2006-06-08	Konstantin Triger <[email protected]>
+
+	* Page.cs: For loading themes, use '~/App_Themes' instead of './App_Themes' to enable theme support
+		for files in sub folders.
+
 2006-05-25  Andrew Skiba  <[email protected]>
 
 	* Control.cs: move 2.0 stuff into ifdef NET_2_0

+ 2 - 2
mcs/class/System.Web/System.Web.UI/Page.cs

@@ -479,7 +479,7 @@ public class Page : TemplateControl, IHttpHandler
 				_styleSheetTheme = ps.StyleSheetTheme;
 		}
 		if (_styleSheetTheme != null && _styleSheetTheme != "")
-			_styleSheetPageTheme = ThemeDirectoryCompiler.GetCompiledInstance ("./App_Themes/" + _styleSheetTheme + "/", _context);
+			_styleSheetPageTheme = ThemeDirectoryCompiler.GetCompiledInstance ("~/App_Themes/" + _styleSheetTheme + "/", _context);
 	}
 
 	void InitializeTheme ()
@@ -490,7 +490,7 @@ public class Page : TemplateControl, IHttpHandler
 				_theme = ps.Theme;
 		}
 		if (_theme != null && _theme != "") {
-			_pageTheme = ThemeDirectoryCompiler.GetCompiledInstance ("./App_Themes/" + _theme + "/", _context);
+			_pageTheme = ThemeDirectoryCompiler.GetCompiledInstance ("~/App_Themes/" + _theme + "/", _context);
 		}
 	}