From f04b1dfadd9b74091e7a616cc86eb7daf3b27dcc Mon Sep 17 00:00:00 2001 From: jensp Date: Wed, 8 Oct 2014 13:32:46 +0000 Subject: [PATCH] Foundry: - Encapsulated the generation of a path to a resource file in function - Some enhancements for the CSS loader git-svn-id: https://svn.libreccm.org/ccm/trunk@2904 8810af33-2d31-482b-a856-94f89814c4df --- .../web/themes/foundry/conf/css-files.xml | 6 ++ .../foundry/foundry/lib/global-vars.xsl | 2 +- .../foundry/foundry/lib/template-parser.xsl | 12 ++-- .../lib/template-tags/content-items.xsl | 16 ++--- .../lib/template-tags/foundry-doc-tags.xsl | 6 +- .../foundry/lib/template-tags/html-tags.xsl | 4 +- .../foundry/lib/template-tags/loaders.xsl | 25 ++++--- .../web/themes/foundry/foundry/lib/utils.xsl | 68 +++++++++++++++---- .../web/themes/foundry/foundry/main.xsl | 14 ++-- .../web/themes/foundry/styles/public.css | 5 ++ 10 files changed, 110 insertions(+), 48 deletions(-) create mode 100644 ccm-sci-bundle/web/themes/foundry/styles/public.css diff --git a/ccm-sci-bundle/web/themes/foundry/conf/css-files.xml b/ccm-sci-bundle/web/themes/foundry/conf/css-files.xml index f67c89d5f..4a43e9c32 100644 --- a/ccm-sci-bundle/web/themes/foundry/conf/css-files.xml +++ b/ccm-sci-bundle/web/themes/foundry/conf/css-files.xml @@ -1,3 +1,9 @@ + + public.css + + + public.css + \ No newline at end of file diff --git a/ccm-sci-bundle/web/themes/foundry/foundry/lib/global-vars.xsl b/ccm-sci-bundle/web/themes/foundry/foundry/lib/global-vars.xsl index c7ed6158a..c815a6c33 100644 --- a/ccm-sci-bundle/web/themes/foundry/foundry/lib/global-vars.xsl +++ b/ccm-sci-bundle/web/themes/foundry/foundry/lib/global-vars.xsl @@ -155,7 +155,7 @@ processor, some are read from the configuration files of Foundry and some are de + select="document(foundry:gen-path('conf/global.xml'))/foundry:configuration/supported-languages"/> diff --git a/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-parser.xsl b/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-parser.xsl index 7bc25cebb..efd5f10d8 100644 --- a/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-parser.xsl +++ b/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-parser.xsl @@ -199,14 +199,14 @@ - + - + diff --git a/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/content-items.xsl b/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/content-items.xsl index b6b12a33a..5bc837ffc 100644 --- a/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/content-items.xsl +++ b/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/content-items.xsl @@ -133,10 +133,10 @@ - + - + @@ -283,18 +283,18 @@ - + - + diff --git a/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/foundry-doc-tags.xsl b/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/foundry-doc-tags.xsl index 7690b6a81..a40eb4801 100644 --- a/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/foundry-doc-tags.xsl +++ b/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/foundry-doc-tags.xsl @@ -156,7 +156,7 @@ - - + @@ -303,7 +303,7 @@ - + diff --git a/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/html-tags.xsl b/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/html-tags.xsl index 548e4d613..9cd742592 100644 --- a/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/html-tags.xsl +++ b/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/html-tags.xsl @@ -478,7 +478,7 @@ - + @@ -652,7 +652,7 @@ - + diff --git a/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/loaders.xsl b/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/loaders.xsl index 712c6f682..88c3194e8 100644 --- a/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/loaders.xsl +++ b/ccm-sci-bundle/web/themes/foundry/foundry/lib/template-tags/loaders.xsl @@ -53,8 +53,8 @@ - - + + @@ -62,7 +62,7 @@ - + @@ -76,8 +76,8 @@ conditional comments in the other CSS files instead? --> - - + + @@ -85,7 +85,7 @@ - + @@ -114,18 +114,25 @@ - + + + + href="{foundry:gen-path(concat('styles/', $filename))}" /> diff --git a/ccm-sci-bundle/web/themes/foundry/foundry/lib/utils.xsl b/ccm-sci-bundle/web/themes/foundry/foundry/lib/utils.xsl index 4d62f14dd..119341b63 100644 --- a/ccm-sci-bundle/web/themes/foundry/foundry/lib/utils.xsl +++ b/ccm-sci-bundle/web/themes/foundry/foundry/lib/utils.xsl @@ -126,9 +126,53 @@ XSLT 2.0 functions. - + + +

+ Helper function for generating paths to theme resources like CSS files etc. Use this + function instead of concatenating paths yourself. For example, instead of +

+
+                document(concat($theme-prefix, 'path/to/resource/file')
+            
+

+ use foundry:gen-path: +

+
+                document(foundry:gen-path('path/to/resource/file'))
+            
+

+ path/to/resource/file is meant as a placeholder here. A real world + example is a settings file, for example conf/global.xml. For this file + a usage of the foundry:gen-path function would look like this +

+
+                document(foundry:gen-path('conf/global.xml')
+            
+

+ The advantage of this function is the encapsulation of the path generation process. + foundry:gen-path. +

+
+ + + The path of the file to generate to path to, relative to the theme directory. + + + +

+ The absolute path for the file. +

+
+
+ + + + + +
- + - - + + @@ -556,23 +600,23 @@ XSLT 2.0 functions. - + - + - + - - + + @@ -592,10 +636,10 @@ XSLT 2.0 functions. - + - + diff --git a/ccm-sci-bundle/web/themes/foundry/foundry/main.xsl b/ccm-sci-bundle/web/themes/foundry/foundry/main.xsl index c9a74e715..a6673838f 100644 --- a/ccm-sci-bundle/web/themes/foundry/foundry/main.xsl +++ b/ccm-sci-bundle/web/themes/foundry/foundry/main.xsl @@ -50,22 +50,22 @@ - + + select="document(foundry:gen-path('conf/templates.xml'))/templates/applications/application[@name=$application and @class=$class]"/> - + + select="document(foundry:gen-path('conf/templates.xml'))/templates/applications/application[@name=$application and not(@class)]"/> @@ -73,10 +73,10 @@ - + + select="document(foundry:gen-path('conf/templates.xml'))/templates/applications/default"/> @@ -107,7 +107,7 @@ --> - + \ No newline at end of file diff --git a/ccm-sci-bundle/web/themes/foundry/styles/public.css b/ccm-sci-bundle/web/themes/foundry/styles/public.css new file mode 100644 index 000000000..cb60c5497 --- /dev/null +++ b/ccm-sci-bundle/web/themes/foundry/styles/public.css @@ -0,0 +1,5 @@ +/* + +Public CSS file + +*/ \ No newline at end of file