From 7a22894ce78e2a2aaa5c20a77b2192c0981c2541 Mon Sep 17 00:00:00 2001 From: jensp Date: Wed, 1 Jun 2016 11:23:17 +0000 Subject: [PATCH] Some extensions for Foundry: - An element with the "with-colorset" attribute will now get two classes: The numbered colorset class (colorset-1, colorset-2 etc) *and* a named colorset class (colorset-$name, where $name is the name of currently selected category) - New attribute "with-application-class" which adds the name of current application to the classes of the element. The class has the form "application-$applicationname" where $applicationname is the name of current application as provided in the XML from CCM - New attribute "with-path-classes". If this attribute is set to "yes" a class of the form path-$category-names" is added for each catgory in the path. $category-names is a string concatenated from the names of the categories in the path. git-svn-id: https://svn.libreccm.org/ccm/trunk@4127 8810af33-2d31-482b-a856-94f89814c4df --- .../foundry/foundry/lib/template-parser.xsl | 328 +++++++++++------- 1 file changed, 196 insertions(+), 132 deletions(-) diff --git a/ccm-core/web/themes/foundry/foundry/lib/template-parser.xsl b/ccm-core/web/themes/foundry/foundry/lib/template-parser.xsl index 343c4cc06..286dbee5f 100644 --- a/ccm-core/web/themes/foundry/foundry/lib/template-parser.xsl +++ b/ccm-core/web/themes/foundry/foundry/lib/template-parser.xsl @@ -4,9 +4,9 @@ ]> @@ -193,7 +193,7 @@

- The attributes to copy separated by an empty space. For example: + The attributes to copy separated by an empty space. For example: autofocus disabled form formaction formenctype formmethod formnovalidate formtarget name type value.

@@ -206,7 +206,7 @@ - + @@ -228,7 +228,7 @@ - + @@ -242,7 +242,7 @@ - + @@ -266,8 +266,8 @@

- Processes a given URL for use in the src attribute of an - audio, img or video element. The function + Processes a given URL for use in the src attribute of an + audio, img or video element. The function distigushes between this cases:

@@ -280,26 +280,26 @@
The URL starts with a slash (/)
In this case the URL points to a resource managed by the CCM which also - manages the theme. In this case the URL is prefixed with the + manages the theme. In this case the URL is prefixed with the dispatcher-prefix and the parameters, if any, are appended.
Other cases
- If none of the two other cases match the URL points to a URL in the theme. In - this case the URL is processed by the + If none of the two other cases match the URL points to a URL in the theme. In + this case the URL is processed by the gen-path - function. The parameters, if any + function. The parameters, if any are appended.

- If parameters are passed to this function they are appended to the URL. The + If parameters are passed to this function they are appended to the URL. The parameters are passed as string formatted as URL parameters, for example foo=hello&bar=world. A leading ? or & is removed before adding the string the URL. If the URL already contains parameters (if the URL contains a ?) the paramters string is added with a leading - ampersand (&). If not the parameters are appended using a + ampersand (&). If not the parameters are appended using a ? character.

@@ -307,10 +307,10 @@ - + - @@ -322,7 +322,7 @@ - + @@ -333,7 +333,7 @@ - + @@ -361,7 +361,7 @@ - + @@ -370,7 +370,55 @@ - + + + + Helper function to create classes from the current category path + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Helper functions for retrieving the name of the content type of the current content item @@ -380,7 +428,7 @@ - + Helper template for processing arrows/links for sorting items. @@ -430,7 +478,7 @@
- + Helper template for processing additional attributes in the data tree XML. They copied @@ -458,7 +506,7 @@ - +

@@ -467,9 +515,9 @@

- Additional attributes to copy from the layout tree. data attributes + Additional attributes to copy from the layout tree. data attributes (e.g.data-toggle) are - copied automatically. Also id and class are already + copied automatically. Also id and class are already processed by this template.

@@ -507,22 +555,22 @@ - + - + - + - + @@ -544,30 +592,30 @@ - + - + - + @@ -580,7 +628,7 @@ - + @@ -612,34 +660,46 @@ - + - - + - + + + + + + + + + + + + + - + - + - + @@ -652,21 +712,25 @@ - - - @@ -675,7 +739,7 @@ - + @@ -689,30 +753,30 @@ - + - + - + - + - + - - - + - + - + - + - + - - - + - + - - - + - + - + @@ -846,7 +910,7 @@ - + @@ -857,7 +921,7 @@ - + @@ -868,7 +932,7 @@ - + @@ -879,7 +943,7 @@ - + @@ -887,5 +951,5 @@ - +