Foundry current status

git-svn-id: https://svn.libreccm.org/ccm/trunk@2853 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2014-09-12 18:11:51 +00:00
parent b4cd75d64f
commit 0a9887617b
19 changed files with 1780 additions and 2 deletions

View File

@ -0,0 +1,351 @@
<!DOCTYPE HTML><html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
<title>Foundry Theming Engine for LibreCCM - Documentation</title>
<style type="text/css">
.missing-static-text {
border: 2px solid red;
color: red;
font-weight: bold;
}
</style>
</head>
<body>
<header>
Header
</header>
<nav>
Navigation
</nav>
<main>
<section id="overview">
<h1>Overview</h1>
<p>
Placeholder
</p>
</section>
<section id="user-manual">
<h1>User Manual</h1>
<section id="user/about-foundry">
<h1>About Foundry</h1>
<p>
Placeholder
</p>
</section>
<section id="user/layout-templates">
<h1>Layout templates</h1>
<p>
Placeholder
</p>
</section>
<section id="user/css-files">
<h1>CSS files</h1>
<p>
Placeholder
</p>
</section>
<section id="lib/template-tags">
<h1>Templates Tags Reference</h1>
<h2>aside</h2>
<dl>
<dt>
Description
</dt>
<dd>
Generates a HTML5 <code>aside</code> element.
</dd>
<dt>See also</dt>
<dd>
<ul>
<li>
<a href="http://www.w3.org/TR/html5/sections.html#the-aside-element">http://www.w3.org/TR/html5/sections.html#the-aside-element</a>
</li>
</ul>
</dd>
</dl>
<h2>body</h2>
<dl>
<dt>
Description
</dt>
<dd>
Generates the HTML <code>body</code> element.
</dd>
<dt>See also</dt>
<dd>
<ul></ul>
</dd>
</dl>
<h2>div</h2>
<dl>
<dt>
Description
</dt>
<dd>
Generates a HTML <code>div</code> element.
</dd>
<dt>See also</dt>
<dd>
<ul></ul>
</dd>
</dl>
<h2>divIfNotEmpty</h2>
<dl>
<dt>
Description
</dt>
<dd>
Generates a HTML <code>div</code> element, but only if the content is not empty.
</dd>
<dt>See also</dt>
<dd>
<ul></ul>
</dd>
</dl>
<h2>footer</h2>
<dl>
<dt>
Description
</dt>
<dd>
Creates a HTML5 footer element.
</dd>
<dt>See also</dt>
<dd>
<ul></ul>
</dd>
</dl>
<h2>head</h2>
<dl>
<dt>
Description
</dt>
<dd>
Creates the HTML <code>head</code> element which may contain meta data and stylesheets
etc. It also generates some meta data like the generator meta information or the
language meta information.
</dd>
<dt>See also</dt>
<dd>
<ul></ul>
</dd>
</dl>
<h2>header</h2>
<dl>
<dt>
Description
</dt>
<dd>
Generates a HTML5 <code>header</code> element.
</dd>
<dt>See also</dt>
<dd>
<ul></ul>
</dd>
</dl>
<h2>main</h2>
<dl>
<dt>
Description
</dt>
<dd>
Generates a HTML5 <code>main</code> element.
</dd>
<dt>See also</dt>
<dd>
<ul></ul>
</dd>
</dl>
<h2>meta</h2>
<dl>
<dt>
Description
</dt>
<dd>
Generates a meta data field in in the <code>head</code> element.
</dd>
<dt>See also</dt>
<dd>
<ul></ul>
</dd>
</dl>
<h2>nav</h2>
<dl>
<dt>
Description
</dt>
<dd>
Generates a HTML5 <code>nav</code> element.
</dd>
<dt>See also</dt>
<dd>
<ul></ul>
</dd>
</dl>
<h2>script</h2>
<dl>
<dt>
Attributes
</dt>
<dd>
<dl>
<dt>
<code>absolute</code>
</dt>
<dd>
If set to <code>true</code> the path in the <code>src</code> is used as it is.
</dd>
<dt>
<code>src</code>
</dt>
<dd>
The path of the script to include. If the <code>absolute&gt;</code> attribute is not
set (or not set to <code>true</code> the path is interpreted relative to the
theme directory. For example the path of a script included using
<pre>
&lt;script type="text/javascript" src="scripts/example.js"/&gt;
</pre>
in the a theme named <code>my-theme</code> at the server
<code>http://www.example.org</code> is altered to the absolute path
<code>http://www.example.org/themes/published-themedir/itb/scripts/example.js</code>.
If the <code>absolute</code> attribute is set to <code>true</code> the path is not
altered. One usecase for an absolute path is to load an script from a content delivery
network.
</dd>
<dt>
<code>type</code>
</dt>
<dd>
The type of the script. Usally this is <code>text/javascript</code>. If the attribute
is not set in the layout template, it is automatically set to
<code>text/javascript</code>.
</dd>
</dl>
</dd>
<dt>
Description
</dt>
<dd>
Used to include a script (usally a JavaScript). The script is either provided
a content of the element or as an external file. Embedded scripts should only be used
for small parts of code, like the code for activating jQuery plugins for some elements.
Everything which is longer than five or six lines should be put into a external file
in the scripts directory of the theme.
</dd>
<dt>See also</dt>
<dd>
<ul></ul>
</dd>
</dl>
<h2>section</h2>
<dl>
<dt>
Description
</dt>
<dd>
Generates a HTML5 <code>section</code> element.
</dd>
<dt>See also</dt>
<dd>
<ul></ul>
</dd>
</dl>
<h2>span</h2>
<dl>
<dt>
Description
</dt>
<dd>
Generates a <code>span</code> element.
</dd>
<dt>See also</dt>
<dd>
<ul></ul>
</dd>
</dl>
<h2>title</h2>
<dl>
<dt>
Description
</dt>
<dd>
Generates the title in the HTML head.
</dd>
<dt>See also</dt>
<dd>
<ul></ul>
</dd>
</dl>
</section>
</section>
<section id="developer-manual">
<h1>Developer Manual</h1>
<section id="devel/foundry-structure">
<h1>The overall structure of foundry</h1>
<p>
Placeholder
</p>
</section>
<section id="devel/coding-style">
<h1>Foundry Coding Style</h1>
<p>
This document describes the coding conventions for the Foundry theming engine.
</p>
<h2>Naming</h2>
<p>
The naming rules described here apply to all names: Names of layout elements,
XSL template names, EXSLT functions, files, ids and classes (in the
<code>class</code> attribute).
</p>
<p>
Use the dash "-" to separate parts of a name instead of camel case or the
underscore. For example: <code>get-setting</code> instead of <code>getSetting</code> or
<code>set_setting</code>.
</p>
<p>
Names should be lowercase.
</p>
<h2>Namespace declarations</h2>
<p>
In the XSL files, XML namespaces are only defined at the
<code>&lt;xsl:stylesheet&gt;</code> element. The XSL namespace is the first one is
declared first. The other namespace follow in alphabetic order (ordered by their
prefix).
</p>
<h2>Indention, line length and formating</h2>
<p>
Indention is done using spaces. Indention depth is four (4) spaces per level.
</p>
<p>
Try to keep the line length below 100 characters per line. Because of some restrictions
of XML this will be possible in every case.
</p>
<p>
Insert a line break after each attribute of an XML element. The first attribute
is on the same line as the element. For example write
</p>
<pre>
&lt;xsl:param name=example-param"
select="'example'"/&gt;
</pre>
<p>
instead of
</p>
<pre>
&lt;xsl:param name=example-param" select="'example'"/&gt;
</pre>
</section>
<section id="devel/foundry-doc-system">
<h1>The documentation system of Foundry</h1>
<p>
Placeholder
</p>
</section>
</section>
</main>
<footer>
Footer
</footer>
</body>
</html>

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<foundry:documentation xmlns:foundry="http://foundry.libreccm.org">
<foundry:doc-static-text href="overview"/>
<foundry:doc-chapter id="user-manual"
title="User Manual">
<foundry:doc-static-text href="user/about-foundry"/>
<foundry:doc-static-text href="user/layout-templates"/>
<foundry:doc-static-text href="user/css-files"/>
<foundry:doc-generated title="Templates Tags Reference"
href="lib/template-tags"/>
</foundry:doc-chapter>
<foundry:doc-chapter id="developer-manual"
title="Developer Manual">
<foundry:doc-static-text href="devel/foundry-structure"/>
<foundry:doc-static-text href="devel/coding-style"/>
<foundry:doc-static-text href="devel/foundry-doc-system"/>
<!--<foundry:doc-generated title="XSL Templates and Function references"
href="lib/lib"/>-->
</foundry:doc-chapter>
</foundry:documentation>

View File

@ -0,0 +1,60 @@
<!DOCTYPE html>
<html>
<head>
<title>Foundry Coding Style</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
</head>
<body>
<h1>Foundry Coding Style</h1>
<p>
This document describes the coding conventions for the Foundry theming engine.
</p>
<h2>Naming</h2>
<p>
The naming rules described here apply to all names: Names of layout elements,
XSL template names, EXSLT functions, files, ids and classes (in the
<code>class</code> attribute).
</p>
<p>
Use the dash &quot;-&quot; to separate parts of a name instead of camel case or the
underscore. For example: <code>get-setting</code> instead of <code>getSetting</code> or
<code>set_setting</code>.
</p>
<p>
Names should be lowercase.
</p>
<h2>Namespace declarations</h2>
<p>
In the XSL files, XML namespaces are only defined at the
<code>&lt;xsl:stylesheet&gt;</code> element. The XSL namespace is the first one is
declared first. The other namespace follow in alphabetic order (ordered by their
prefix).
</p>
<h2>Indention, line length and formating</h2>
<p>
Indention is done using spaces. Indention depth is four (4) spaces per level.
</p>
<p>
Try to keep the line length below 100 characters per line. Because of some restrictions
of XML this will be possible in every case.
</p>
<p>
Insert a line break after each attribute of an XML element. The first attribute
is on the same line as the element. For example write
</p>
<pre>
&lt;xsl:param name=example-param"
select="'example'"/&gt;
</pre>
<p>
instead of
</p>
<pre>
&lt;xsl:param name=example-param" select="'example'"/&gt;
</pre>
</body>
</html>

View File

@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<title>The documentation system of Foundry</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
</head>
<body>
<h1>The documentation system of Foundry</h1>
<p>
Placeholder
</p>
</body>
</html>

View File

@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<title>The overall structure of foundry</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
</head>
<body>
<h1>The overall structure of foundry</h1>
<p>
Placeholder
</p>
</body>
</html>

View File

@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<title>Foundry Documentation - Overview</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
</head>
<body>
<h1>Overview</h1>
<p>
Placeholder
</p>
</body>
</html>

View File

@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<title>About Foundry</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
</head>
<body>
<h1>About Foundry</h1>
<p>
Placeholder
</p>
</body>
</html>

View File

@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<title>Foundry Documentation - CSS files</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
</head>
<body>
<h1>CSS files</h1>
<p>
Placeholder
</p>
</body>
</html>

View File

@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<title>Foundry Documentation - Layout templates</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
</head>
<body>
<h1>Layout templates</h1>
<p>
Placeholder
</p>
</body>
</html>

View File

@ -0,0 +1,197 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE stylesheet [<!ENTITY nbsp '&#160;'>
<!ENTITY shy '&#173;'>]>
<!--
Copyright 2014 Jens Pelzetter for the LibreCCM Foundation
This file is part of the Foundry Theme Engine for LibreCCM
Foundry is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
Foundry is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Foundry If not, see <http://www.gnu.org/licenses/>.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:bebop="http://www.arsdigita.com/bebop/1.0"
xmlns:foundry="http://foundry.libreccm.org"
xmlns:ui="http://www.arsdigita.com/ui/1.0"
exclude-result-prefixes="xsl bebop foundry ui"
version="1.0">
<xsl:output method="html"
indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="/foundry:documentation">
<xsl:value-of select="'&lt;!DOCTYPE HTML&gt;'"
disable-output-escaping="yes" />
<html>
<head>
<meta http-equiv="content-type"
content="text/html; charset=UTF-8"/>
<title>Foundry Theming Engine for LibreCCM - Documentation</title>
<style type="text/css">
.missing-static-text {
border: 2px solid red;
color: red;
font-weight: bold;
}
</style>
</head>
<body>
<header>
Header
</header>
<nav>
Navigation
</nav>
<main>
<xsl:apply-templates/>
</main>
<footer>
Footer
</footer>
</body>
</html>
</xsl:template>
<xsl:template match="/foundry:documentation/foundry:doc-chapter">
<section id="{./@id}">
<h1>
<xsl:value-of select="./@title"/>
</h1>
<xsl:apply-templates/>
</section>
</xsl:template>
<xsl:template match="/foundry:documentation//foundry:doc-static-text">
<section id="{./@href}">
<xsl:choose>
<xsl:when test="document(concat('../static-texts/', ./@href, '.html'))">
<xsl:copy-of select="document(concat('../static-texts/', ./@href, '.html'))/html/body/*"/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="message" select="concat('The static text file &quot;', ./@href, '.html&quot; was not found')"/>
<div class="missing-static-text">
<xsl:value-of select="$message"/>
<xsl:message>
<xsl:value-of select="$message"/>
</xsl:message>
</div>
</xsl:otherwise>
</xsl:choose>
</section>
</xsl:template>
<xsl:template match="/foundry:documentation//foundry:doc-generated">
<section id="{./@href}">
<h1>
<xsl:value-of select="./@title"/>
</h1>
<xsl:apply-templates select="document(concat('../../foundry/', ./@href, '.xsl'))"/>
</section>
</xsl:template>
<xsl:template match="xsl:import | xsl:include">
<xsl:apply-templates select="document(./@href)"/>
</xsl:template>
<xsl:template match="foundry:doc[@section='user' and @type='template-tag']">
<h2>
<xsl:value-of select="./following::xsl:template/@match"/>
</h2>
<dl>
<xsl:apply-templates/>
</dl>
</xsl:template>
<xsl:template match="foundry:doc-attributes">
<dt>
Attributes
</dt>
<dd>
<dl>
<xsl:apply-templates select="foundry:doc-attribute"/>
</dl>
</dd>
</xsl:template>
<xsl:template match="foundry:doc-attributes/foundry:doc-attribute">
<dt>
<code>
<xsl:value-of select="./@name"/>
</code>
</dt>
<dd>
<xsl:apply-templates/>
</dd>
</xsl:template>
<xsl:template match="foundry:doc-desc">
<dt>
Description
</dt>
<dd>
<!--<xsl:copy-of select="./*"/>-->
<xsl:apply-templates/>
</dd>
</xsl:template>
<xsl:template match="foundry:doc-desc//code | foundry:doc-attribute//code">
<code>
<xsl:value-of select="."/>
</code>
</xsl:template>
<xsl:template match="foundry:doc-desc//p | foundry:doc-attribute//p">
<p>
<xsl:value-of select="."/>
<xsl:apply-templates/>
</p>
</xsl:template>
<xsl:template match="foundry:doc-desc//pre | foundry:doc-attribute//pre">
<pre>
<xsl:value-of select="."/>
</pre>
</xsl:template>
<xsl:template match="foundry:doc-see-also">
<dt>See also</dt>
<dd>
<ul>
<xsl:apply-templates select="foundry:doc-link"/>
</ul>
</dd>
</xsl:template>
<xsl:template match="foundry:doc-see-also/foundry:doc-link">
<li>
<a href="{./@href}">
<xsl:choose>
<xsl:when test="string-length(.) &gt; 0">
<xsl:value-of select="."/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="./@href"/>
</xsl:otherwise>
</xsl:choose>
</a>
</li>
</xsl:template>
</xsl:stylesheet>

View File

@ -0,0 +1,30 @@
<?xml version="1.0"?>
<!DOCTYPE stylesheet>
<!--
Copyright 2014 Jens Pelzetter for the LibreCCM Foundation
This file is part of the Foundry Theme Engine for LibreCCM
Foundry is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
Foundry is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Foundry If not, see <http://www.gnu.org/licenses/>.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:import href="lib/global-vars.xsl"/>
<xsl:import href="lib/template-parser.xsl"/>
<xsl:import href="lib/template-tags.xsl"/>
<xsl:import href="lib/utils.xsl"/>
</xsl:stylesheet>

View File

@ -0,0 +1,220 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE stylesheet [<!ENTITY nbsp '&#160;'>
<!ENTITY shy '&#173;'>
<!ENTITY hellip '&#8230;'>
]>
<!--
Copyright 2014 Jens Pelzetter for the LibreCCM Foundation
This file is part of the Foundry Theme Engine for LibreCCM
Foundry is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
Foundry is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Foundry If not, see <http://www.gnu.org/licenses/>.
-->
<!--
This file defines several global variables (constants). Some are provided by CCM thorough the XSL
processor, some are read from the configuration files of Foundry and some are defined here.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:bebop="http://www.arsdigita.com/bebop/1.0"
xmlns:foundry="http://foundry.libreccm.org"
xmlns:ui="http://www.arsdigita.com/ui/1.0"
version="1.0">
<!-- Foundry internal variables -->
<foundry:doc section="devel">
<foundry:doc-desc>
The version of Foundry.
</foundry:doc-desc>
</foundry:doc>
<xsl:variable name="foundry-version" select="'1.0-SNAPSHOT'"/>
<!-- **************************************************************************** -->
<!-- CCM Environment variables -->
<foundry:doc section="devel">
<foundry:doc-desc>
The path the to theme file. This path is used at several points to load files which are
part of the theme, like CSS files, images and fonts.
</foundry:doc-desc>
</foundry:doc>
<xsl:param name="theme-prefix"/>
<foundry:doc section="devel">
<foundry:doc-dec>
The context prefix in which CCM is installed. If CCM is installed into the ROOT context
of the servlet container, this variable will be empty.
</foundry:doc-dec>
</foundry:doc>
<xsl:param name="context-prefix"/>
<foundry:doc section="devel">
<foundry:doc-desc>
The path on which the CCM dispatcher Servlet is mounted. Usually this is <code>CCM</code>
</foundry:doc-desc>
</foundry:doc>
<xsl:param name="dispatcher-prefix"/>
<xsl:variable name="username">
<xsl:choose>
<xsl:when test="/bebop:page/ui:userBanner/@screenName">
<xsl:value-of select="concat(/bebop:page/ui:userBanner/@givenName, ' ', /bebop:page/ui:userBanner/@familyName)"/>
</xsl:when>
</xsl:choose>
</xsl:variable>
<!-- System variables -->
<foundry:doc section="devel">
<foundry:doc-desc>
This variables stores the XML created by CCM for later access.
</foundry:doc-desc>
</foundry:doc>
<xsl:variable name="result-tree" select="/bebop:page"/>
<!-- **************************************************************************** -->
<!-- Double click protection -->
<foundry:doc section="devel">
<foundry:doc-desc>
Activate double click protection on buttons?
</foundry:doc-desc>
</foundry:doc>
<xsl:param name="dcp-on-buttons"/>
<foundry:doc section="devel">
<foundry:doc-desc>
Activate double click protection on links?
</foundry:doc-desc>
</foundry:doc>
<xsl:param name="dcp-on-links"/>
<!-- **************************************************************************** -->
<!-- Language related variables -->
<foundry:doc section="devel">
<foundry:doc-desc>
The language to use as negotiated by CCM.
</foundry:doc-desc>
</foundry:doc>
<xsl:param name="negotiated-language"/>
<!--<foundry:doc section="devel">
<foundry:doc-desc>
The languages supported by this theme. Set in the <code>global.xml</code> configuration
file.
</foundry:doc-desc>
</foundry:doc>
<xsl:variable name="languages">
</xsl:variable>-->
<foundry:doc section="devel">
<foundry:doc-desc>
The languages supported by this theme. They are configured in
<code>settings/global.xml</code> using the <code>&lt;supported-languages&gt;</code>
element. Example for german and english:
<pre>
&lt;?xml version="1.0"?&gt;
&lt;settings&gt;
&hellip;
&lt;supported-languages default="de"&gt;
&lt;language locale=de"&gt;
&lt;language locale=en"&gt;
&lt;/supported-languages&gt;
&hellip;
&lt;/settings&gt;
</pre>
</foundry:doc-desc>
</foundry:doc>
<xsl:variable name="supported-languages"
select="document(concat($theme-prefix, 'settings/global.xml'))/settings/supported-languages"/>
<foundry:doc section="devel">
<foundry:doc-desc>
The language to use by theming engine for static texts etc. The language is determined
as follows:
<ul>
<li>If the negotiated language is also in the <code>supported-languages</code></li>
<li>If not the language which set by the default attribute of the
<code>&lt;supported-languages&gt;</code> is used, but only if this language
is in the supported languages.</li>
<li>Otherwise the first of the supported languages is used.</li>
</ul>
</foundry:doc-desc>
</foundry:doc>
<xsl:variable name="language">
<xsl:choose>
<xsl:when test="$supported-languages/language[@locale=$negotiated-language]">
<xsl:value-of select="$negotiated-language"/>
</xsl:when>
<xsl:when test="not($supported-languages/language[@locale=$negotiated-language]) and $supported-languages/language[$supported-languages/@default]">
<xsl:value-of select="$supported-languages/language[$supported-languages/@default]"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$supported-languages/language[1]/@locale"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- **************************************************************************** -->
<!--
Variables describing the user agent.
ToDo: Check if we still need them.
-->
<foundry:doc section="devel">
<foundry:doc-desc>
The name of the user agent (browser) which is used to access CCM.
</foundry:doc-desc>
</foundry:doc>
<xsl:param name="user-agent"/>
<xsl:variable name="mozilla-version">
<xsl:value-of select="substring(substring-after($user-agent, 'Mozilla/'), 1, 1)"/>
</xsl:variable>
<!-- Firefox -->
<xsl:variable name="firefox-version">
<xsl:value-of select="substring(substring-after($user-agent, 'Firefox/'), 1, 1)"/>
</xsl:variable>
<!-- Konqueror -->
<xsl:variable name="konqueror-version">
<xsl:value-of select="substring(substring-after($user-agent, 'Konqueror/'), 1, 1)"/>
</xsl:variable>
<!-- Opera -->
<xsl:variable name="opera-version1">
<xsl:value-of select="substring(substring-after($user-agent, 'Opera/'), 1, 1)"/>
</xsl:variable>
<xsl:variable name="opera-version2">
<xsl:value-of select="substring(substring-after($user-agent, 'Opera '), 1, 1)"/>
</xsl:variable>
<!-- MSIE -->
<xsl:variable name="msie_version">
<xsl:value-of select="substring(substring-after($user-agent, 'MSIE '), 1, 1)"/>
</xsl:variable>
<!-- AppleWebKit -->
<xsl:variable name="webkit_version">
<xsl:value-of select="substring(substring-after($user-agent, 'AppleWebKit/'), 1, 3)"/>
</xsl:variable>
</xsl:stylesheet>

View File

@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE stylesheet [<!ENTITY nbsp '&#160;'>
<!ENTITY shy '&#173;'>]>
<!--
Copyright 2014 Jens Pelzetter for the LibreCCM Foundation
This file is part of the Foundry Theme Engine for LibreCCM
Foundry is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
Foundry is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Foundry If not, see <http://www.gnu.org/licenses/>.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:bebop="http://www.arsdigita.com/bebop/1.0"
xmlns:foundry="http://foundry.libreccm.org"
xmlns:ui="http://www.arsdigita.com/ui/1.0"
version="1.0">
<foundry:doc section="devel">
<foundry:doc-param name="template-file"
mandantory="yes">
The name of the template file to process.
</foundry:doc-param>
<foundry:doc-desc>
This template is the entry point for the template parser.
</foundry:doc-desc>
</foundry:doc>
<xsl:template name="foundry:process-template">
<xsl:param name="template-file"/>
<xsl:apply-templates select="document(concat($theme-prefix, '/templates/', $template-file))"/>
</xsl:template>
<foundry:doc section="user">
<foundry:doc-desc>
Root element of a template. Generates the doctype statement and and
<code>&lt;html&gt;</code> root element.
</foundry:doc-desc>
</foundry:doc>
<xsl:template match="page-layout">
<xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html&gt;</xsl:text>
<html xmlns="http://www.w3.org/1999/xhtml">
<xsl:attribute name="lang">
<xsl:value-of select="$language"/>
</xsl:attribute>
<xsl:attribute name="id">
<xsl:choose>
<xsl:when test="@application = 'admin' or @application = 'content-center' or @application = 'content-section'
or @application = 'theme' or @application = 'shortcuts' or @application = 'subsite' or @application = 'terms' or @application = 'atoz' or @application = 'ds'
or @class = 'cms-admin' or @class = 'admin'">
<xsl:text>cms</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>site</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:apply-templates/>
</html>
</xsl:template>
<foundry:doc section="user">
<foundry:doc-desc>
Root element for generating a HTML fragment instead of a complete HTML document.
</foundry:doc-desc>
</foundry:doc>
<xsl:template match="fragment-layout">
<div class="ccm-fragment">
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template name="mandalay:set-id-and-class">
<xsl:param name="current-layout-node" select="."/>
<xsl:variable name="cond-class">
<xsl:if test="$current-layout-node/@classIf">
<!-- DE Funktioniert leider nicht in einer Zeile, daher die Hilfsvariable -->
<xsl:variable name="key" select="substring-before($current-layout-node/@classIf, ',')"/>
<xsl:variable name="condition">
<xsl:apply-templates select="//*[@id=$key]"/>
</xsl:variable>
<xsl:if test="normalize-space($condition)">
<xsl:value-of select="substring-after($current-layout-node/@classIf, ', ')"/>
</xsl:if>
</xsl:if>
</xsl:variable>
<xsl:variable name="type-class">
<xsl:if test="$current-layout-node/@setTypeClass='true'">
<xsl:call-template name="mandalay:getContentTypeName"/>
</xsl:if>
</xsl:variable>
<xsl:variable name="color-class">
<xsl:if test="$current-layout-node/@withColorset='true'">
<xsl:call-template name="mandalay:getColorset"/>
</xsl:if>
</xsl:variable>
<xsl:if test="$current-layout-node/@id">
<xsl:attribute name="id">
<xsl:value-of select="@id"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="$current-layout-node/@class or $cond-class != '' or $type-class != '' or $color-class != ''">
<xsl:attribute name="class">
<xsl:value-of select="normalize-space(concat($current-layout-node/@class, ' ', $cond-class, ' ', $type-class, ' ', $color-class))"/>
</xsl:attribute>
</xsl:if>
</xsl:template>
</xsl:stylesheet>

View File

@ -0,0 +1,28 @@
<?xml version="1.0"?>
<!DOCTYPE stylesheet>
<!--
Copyright 2014 Jens Pelzetter for the LibreCCM Foundation
This file is part of the Foundry Theme Engine for LibreCCM
Foundry is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
Foundry is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Foundry If not, see <http://www.gnu.org/licenses/>.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:import href="template-tags/html-tags.xsl"/>
<xsl:import href="template-tags/loaders.xsl"/>
</xsl:stylesheet>

View File

@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2014 Jens Pelzetter for the LibreCCM Foundation
This file is part of the Foundry Theme Engine for LibreCCM
Foundry is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
Foundry is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Foundry If not, see <http://www.gnu.org/licenses/>.
-->
<!-- This file contains several template tags which output data from the result tree -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:foundry="http://foundry.libreccm.org"
xslns:func="http://exslt.org/functions"
version="1.0">
<xsl:template match="show-page-title">
<xsl:choose>
<xsl:when test="name(..) = 'title'">
<xsl:value-of select="foundry:title()"/>
</xsl:when>
<xsl:otherwise>
<h1>
<xsl:value-of select="foundry:title"/>
</h1>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<foundry:doc section="user"
type="template-tag">
<foundry:doc-desc>
Outputs a static text which is retrieved from the
<code>static-texts/global.xml</code> file in the layout file. The key is the content
of the element. If at least one of the attributes <code>id</code>, <code>class</code>
or <code>with-colorset</code> is present at the attribute, the text is wrapped in a
<code>span</code> element.
</foundry:doc-desc>
<foundry:doc-attributes>
<foundry:doc-attribute name="id">
An unique id for the text.
</foundry:doc-attribute>
<foundry:doc-attribute name="class">
One or more classes to format the text per CSS.
</foundry:doc-attribute>
<foundry:doc-attribute name="with-colorset">
Add the classes for using the Colorset feature to the <code>span</code> element
the text is wrapped in.
</foundry:doc-attribute>
</foundry:doc-attributes>
</foundry:doc>
<xsl:template match="show-text">
<xsl:choose>
<xsl:when test="@id != '' or @class != '' or with-colorset = 'true'">
<span>
<xsl:call-template name="foundry-set-id-and-class"/>
<xsl:value-of select="foundry:get-static-text(.)"/>
</span>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="foundry:get-static-text(.)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>

View File

@ -0,0 +1,448 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE stylesheet [<!ENTITY nbsp '&#160;'>
<!ENTITY shy '&#173;'>]>
<!--
Copyright 2014 Jens Pelzetter for the LibreCCM Foundation
This file is part of the Foundry Theme Engine for LibreCCM
Foundry is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
Foundry is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Foundry If not, see <http://www.gnu.org/licenses/>.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:bebop="http://www.arsdigita.com/bebop/1.0"
xmlns:foundry="http://foundry.libreccm.org"
xmlns:ui="http://www.arsdigita.com/ui/1.0"
exclude-result-prefixes="xsl bebop foundry ui"
version="1.0">
<foundry:doc>
<foundry:doc-desc>
Generates a HTML <code>a</code> element.
</foundry:doc-desc>
<foundry:doc-see-also>
<foundry:doc-link href="http://www.w3.org/TR/html5/text-level-semantics.html#the-a-element"/>
</foundry:doc-see-also>
</foundry:doc>
<xsl:template match="a">
<a>
<xsl:if test="./@download">
<xsl:attribute name="download" select="./@download"/>
</xsl:if>
<xsl:if test="./@href-property">
<xsl:attribute name="href" select="$data-tree/*[name = ./@href-property]"/>
</xsl:if>
<xsl:if test="./@href-static">
<xsl:attribute name="href" select=".@href-static"/>
</xsl:if>
<xsl:if test="./@hreflang">
<xsl:attribute name="hreflang" select="./@hreflang"/>
</xsl:if>
<xsl:if test="./@rel">
<xsl:attribute name="rel" select="./@rel"/>
</xsl:if>
<xsl:if test="./@type">
<xsl:attribute name="type" select="./@type"/>
</xsl:if>
<xsl:call-template name="foundry:set-id-and-class"/>
<xsl:apply-templates/>
</a>
</xsl:template>
<foundry:doc section="user" type="template-tag">
<foundry:doc-desc>
Generates a HTML5 <code>aside</code> element.
</foundry:doc-desc>
<foundry:doc-see-also>
<foundry:doc-link href="http://www.w3.org/TR/html5/sections.html#the-aside-element"/>
</foundry:doc-see-also>
</foundry:doc>
<xsl:template match="aside">
<aside>
<xsl:call-template name="foundry:set-id-and-class"/>
<xsl:apply-templates/>
</aside>
</xsl:template>
<foundry:doc section="user" type="template-tag">
<foundry:doc-desc>
Generates the HTML <code>body</code> element.
</foundry:doc-desc>
<foundry:doc-see-also>
<foundry:doc-link href="http://www.w3.org/TR/html5/sections.html#the-body-element"/>
</foundry:doc-see-also>
</foundry:doc>
<xsl:template match="body">
<body>
<xsl:call-template name="foundry:set-id-and-class"/>
<span id="top"/>
<a href="#startcontent" accesskey="S" class="nav-hide">
<xsl:attribute name="title"
select="foundry:get-static-text('layout/page/skipnav/title')"/>
<xsl:value-of select="foundry:get-static-text('layout/page/skipnav/link')"/>
</a>
<xsl:apply-templates/>
</body>
</xsl:template>
<foundry:doc section="user"
type="template-tag">
<foundry:doc-desc>
Generates a HTML <code>div</code> element.
</foundry:doc-desc>
<foundry:doc-see-also>
<foundry:doc-link href="http://www.w3.org/TR/html5/grouping-content.html#the-div-element"/>
</foundry:doc-see-also>
</foundry:doc>
<xsl:template match="div">
<div>
<xsl:call-template name="foundry:set-id-and-class"/>
<xsl:apply-templates/>
</div>
</xsl:template>
<foundry:doc section="user" type="template-tag">
<foundry:doc-desc>
Generates a HTML <code>div</code> element, but only if the content is not empty.
</foundry:doc-desc>
<foundry:doc-see-also>
<foundry:doc-link href="#div"/>
</foundry:doc-see-also>
</foundry:doc>
<xsl:template match="divIfNotEmpty">
<xsl:variable name="divContent">
<xsl:apply-templates/>
</xsl:variable>
<xsl:if test="normalize-space($divContent)">
<div>
<xsl:call-template name="mandalay:set-id-and-class"/>
<xsl:apply-templates/>
</div>
</xsl:if>
</xsl:template>
<xsl:template match="h1">
<xsl:call-template name="foundry:set-id-and-class"/>
<xsl:apply:templates/>
</xsl:template>
<xsl:template match="h2">
<xsl:call-template name="foundry:set-id-and-class"/>
<xsl:apply:templates/>
</xsl:template>
<xsl:template match="h3">
<xsl:call-template name="foundry:set-id-and-class"/>
<xsl:apply:templates/>
</xsl:template>
<xsl:template match="h4">
<xsl:call-template name="foundry:set-id-and-class"/>
<xsl:apply:templates/>
</xsl:template>
<xsl:template match="h5">
<xsl:call-template name="foundry:set-id-and-class"/>
<xsl:apply:templates/>
</xsl:template>
<xsl:template match="h6">
<xsl:call-template name="foundry:set-id-and-class"/>
<xsl:apply:templates/>
</xsl:template>
<foundry:doc section="user" type="template-tag">
<foundry:doc-desc>
Creates a HTML5 footer element.
</foundry:doc-desc>
<foundry:doc-see-also>
<foundry:doc-link href="http://www.w3.org/TR/html5/sections.html#the-footer-element"/>
</foundry:doc-see-also>
</foundry:doc>
<xsl:template match="footer">
<footer>
<xsl:call-template name="mandalay:set-id-and-class"/>
<xsl:apply-templates/>
</footer>
</xsl:template>
<foundry:doc section="user" type="template-tag">
<foundry:doc-desc>
Creates the HTML <code>head</code> element which may contain meta data and stylesheets
etc. It also generates some meta data like the generator meta information or the
language meta information.
</foundry:doc-desc>
<foundry:doc-see-also>
<foundry:doc-link href="http://www.w3.org/TR/html5/document-metadata.html#the-head-element"/>
</foundry:doc-see-also>
</foundry:doc>
<xsl:template match="head">
<head>
<meta name="generator">
<xsl:attribute name="content">
<xsl:value-of select="concat($result-tree/bebop:systemInformation/@appname, ' ', $result-tree/bebop:systemInformation/@version)"/>
</xsl:attribute>
</meta>
<!-- EN These meta informations are needed to get Level 3 WAI -->
<meta name="language" content="{$language}"/>
<meta name="keywords">
<xsl:attribute name="content">
<xsl:call-template name="foundry:keywords"/>
</xsl:attribute>
</meta>
<meta name="description">
<xsl:attribute name="content">
<xsl:call-template name="foundry:description"/>
</xsl:attribute>
</meta>
<xsl:apply-templates/>
<xsl:call-template name="bebop:double-click-protection"/>
<xsl:apply-templates select="$result-tree//script"/>
<!--
Set favicon if exists. This three different variants for including the favicon
are necessary to satisfy all browsers.
-->
<link href="{$theme-prefix}/images/favicon.png"
type="image/png"
rel="shortcut icon"/>
</head>
</xsl:template>
<foundry:doc section="user" type="template-tag">
<foundry:doc-desc>
Generates a HTML5 <code>header</code> element.
</foundry:doc-desc>
<foundry:doc-see-also>
<foundry:doc-link href="http://www.w3.org/TR/html5/sections.html#the-header-element"/>
</foundry:doc-see-also>
</foundry:doc>
<xsl:template match="header">
<header>
<xsl:call-template name="mandalay:set-id-and-class"/>
<xsl:apply-templates/>
</header>
</xsl:template>
<foundry:doc section="user" type="template-tag">
<foundry:doc-desc>
Generates a HTML5 <code>main</code> element.
</foundry:doc-desc>
<foundry:doc-see-also>
<foundry:doc-link href="http://www.w3.org/TR/html5/grouping-content.html#the-main-element"/>
</foundry:doc-see-also>
</foundry:doc>
<xsl:template match="main">
<main>
<xsl:call-template name="mandalay:set-id-and-class"/>
<xsl:apply-templates/>
</main>
</xsl:template>
<foundry:doc section="user" type="template-tag">
<foundry:doc-desc>
Generates a meta data field in in the <code>head</code> element.
</foundry:doc-desc>
<foundry:doc-see-also>
<foundry:doc-link href="#head"/>
<foundry:doc-link href="http://www.w3.org/TR/html5/document-metadata.html#the-meta-element"/>
</foundry:doc-see-also>
</foundry:doc>
<xsl:template match="meta">
<meta>
<xsl:if test="@name">
<xsl:attribute name="name">
<xsl:value-of select="@name"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="@http-equiv">
<xsl:attribute name="http-equiv">
<xsl:value-of select="@http-equiv"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="@content">
<xsl:attribute name="content">
<xsl:value-of select="@content"/>
</xsl:attribute>
</xsl:if>
</meta>
</xsl:template>
<foundry:doc section="user" type="template-tag">
<foundry:doc-desc>
Generates a HTML5 <code>nav</code> element.
</foundry:doc-desc>
<foundry:doc-see-also>
<foundry:doc-link href="http://www.w3.org/TR/html5/sections.html#the-nav-element"/>
</foundry:doc-see-also>
</foundry:doc>
<xsl:template match="nav">
<nav>
<xsl:call-template name="mandalay:set-id-and-class"/>
<xsl:apply-templates/>
</nav>
</xsl:template>
<xsl:template match="p">
<p>
<xsl:call-template name="mandalay:set-id-and-class"/>
<xsl:apply-templates/>
</p>
</xsl:template>
<foundry:doc section="user" type="template-tag">
<foundry:doc-attributes>
<foundry:doc-attribute name="absolute">
If set to <code>true</code> the path in the <code>src</code> is used as it is.
</foundry:doc-attribute>
<foundry:doc-attribute name="src">
The path of the script to include. If the <code>absolute></code> attribute is not
set (or not set to <code>true</code> the path is interpreted relative to the
theme directory. For example the path of a script included using
<pre>
&lt;script type="text/javascript" src="scripts/example.js"/>
</pre>
in the a theme named <code>my-theme</code> at the server
<code>http://www.example.org</code> is altered to the absolute path
<code>http://www.example.org/themes/published-themedir/itb/scripts/example.js</code>.
If the <code>absolute</code> attribute is set to <code>true</code> the path is not
altered. One usecase for an absolute path is to load an script from a content delivery
network.
</foundry:doc-attribute>
<foundry:doc-attribute name="type">
The type of the script. Usally this is <code>text/javascript</code>. If the attribute
is not set in the layout template, it is automatically set to
<code>text/javascript</code>.
</foundry:doc-attribute>
</foundry:doc-attributes>
<foundry:doc-desc>
Used to include a script (usally a JavaScript). The script is either provided
a content of the element or as an external file. Embedded scripts should only be used
for small parts of code, like the code for activating jQuery plugins for some elements.
Everything which is longer than five or six lines should be put into a external file
in the scripts directory of the theme.
</foundry:doc-desc>
<foundry:doc-see-also>
<foundry:doc-link href="http://www.w3.org/TR/html5/scripting-1.html#the-script-element"/>
</foundry:doc-see-also>
</foundry:doc>
<xsl:template match="script">
<script>
<xsl:attribute name="type">
<xsl:choose>
<xsl:when test="./@type">
<xsl:value-of select="./@type"/>
</xsl:when>
<xsl:otherwise>
<xsl-value-of select="'text/javascript'"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:if test="./@src">
<xsl:attribute name="src">
<xsl:choose>
<xsl:when test="./@absolute = 'true'">
<xsl:value-of select="./@src"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat($theme-prefix, ./@src)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:if>
<xsl:if test="string-length(.)">
<xsl:value-of select="."/>
</xsl:if>
</script>
</xsl:template>
<foundry:doc section="user" type="template-tag">
<foundry:doc-desc>
Generates a HTML5 <code>section</code> element.
</foundry:doc-desc>
<foundry:doc-see-also>
<foundry:doc-link href="http://www.w3.org/TR/html5/text-level-semantics.html#the-span-element"/>
</foundry:doc-see-also>
</foundry:doc>
<xsl:template match="section">
<section>
<xsl:call-template name="mandalay:set-id-and-class"/>
<xsl:apply-templates/>
</section>
</xsl:template>
<foundry:doc section="user" type="template-tag">
<foundry:doc-desc>
Generates a <code>span</code> element.
</foundry:doc-desc>
<foundry:doc-see-also>
<foundry:doc-link href="http://www.w3.org/TR/html5/text-level-semantics.html#the-span-element"/>
</foundry:doc-see-also>
</foundry:doc>
<xsl:template match="span">
<span>
<xsl:call-template name="mandalay:set-id-and-class"/>
<xsl:apply-templates/>
</span>
</xsl:template>
<foundry:doc section="user" type="template-tag">
<foundry:doc-desc>
<p>
Generates the title in the HTML head. The other elements are allowed in the
<code>&lt;title&gt;</code> tag:
</p>
<ul>
<li><code>show-text</code></li>
<li><code>show-page-title</code></li>
</ul>
</foundry:doc-desc>
<foundry:doc-see-also>
<foundry:doc-link href="http://www.w3.org/TR/html5/document-metadata.html#the-title-element"/>
<foundry:doc-link href="#show-text"/>
<foundry:doc-link href="#show-page-title"/>
</foundry:doc-see-also>
</foundry:doc>
<xsl:template match="title">
<title>
<xsl:for-each select="showText | usePageTitle">
<xsl:apply-templates select="."/>
<xsl:if test="position() != last()">
<xsl:value-of select="foundry:get-setting('layout-parser',
'title/separator',
' - ',
../separator)"/>
</xsl:if>
</xsl:for-each>
</title>
</xsl:template>
</xsl:stylesheet>

View File

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE stylesheet [<!ENTITY nbsp '&#160;'>
<!ENTITY shy '&#173;'>]>
<!--
Copyright 2014 Jens Pelzetter for the LibreCCM Foundation
This file is part of the Foundry Theme Engine for LibreCCM
Foundry is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
Foundry is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Foundry If not, see <http://www.gnu.org/licenses/>.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:bebop="http://www.arsdigita.com/bebop/1.0"
xmlns:foundry="http://foundry.libreccm.org"
xmlns:ui="http://www.arsdigita.com/ui/1.0"
version="1.0">
<xsl:template match="load-css-files">
<xsl:call-template name="foundry:load-css-files"/>
</xsl:template>
<xsl:template match="load-fancybox">
<xsl:call-template name="foundry:load-fancy-box"/>
</xsl:template>
<xsl:template match="load-jquery">
<script type="text/javascript" src="{$context-prefix}/assets/jquery.js"/>
</xsl:template>
<xsl:template match="load-jquery-ui">
<script type="text/javascript" src="{$context-prefix}/assets/jquery-ui.min.js"/>
</xsl:template>
<xsl:template match="load-mathjax">
<script type="text/javascript"
src="{$context-prefix}/assets/mathjax/MathJax.js?config=TeX-MML-AM_HTMLorMML"/>
</xsl:template>
<xsl:template match="load-html5shiv">
<xsl:value-of disable-output-escaping="yes" select="concat('
&lt;!--
&lt;!-[if lt IE 9]&gt;
&lt;script src=&quot;', $context-prefix, '/assets/html5shiv.js&quot;/&gt;
&lt;![endif]
--&gt;')"/>
</xsl:template>
</xsl:stylesheet>

View File

@ -22,7 +22,7 @@
-->
<!--
This file contains utility functions for Foundry. Most of them are implemented as
This file contains utility functions and templates for Foundry. Most of them are implemented as
EXSLT functions.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
@ -31,6 +31,8 @@ EXSLT functions.
version="1.0">
<foundry:doc section="devel">
<foundry:doc-param name="level"
mandatory="yes">
@ -134,7 +136,7 @@ EXSLT functions.
</func:result>
</func:function>
<foundry:doc section="devel">
<foundry:doc section="devel">
<foundry:doc-param name="message"
mandatory="yes">
The message text.
@ -187,6 +189,12 @@ EXSLT functions.
The value to use if there is no entry for the setting in the settings file.
</p>
</foundry:doc-param>
<foundry:doc-param name="node"
mandatory="no">
<p>
A node from the layout template which overrides the value from the configuration.
</p>
</foundry:doc-param>
<foundry:doc-result>
The value of the requested setting or if no value has been set the provided default
value. If no default value has been provided the result is an empty string.
@ -201,8 +209,12 @@ EXSLT functions.
<xsl:param name="module"/>
<xsl:param name="setting"/>
<xsl:param name="default" select="''"/>
<xsl:param name="node"/>
<xsl:choose>
<xsl:when test="$node and $node != ''">
<func:result select="$node"/>
</xsl:when>
<xsl:when test="$module = ''">
<func:result select="document(concat($theme-prefix, '/conf/global.xml'))/foundry:configuration/setting[@id=$setting]"/>
</xsl:when>
@ -343,4 +355,66 @@ EXSLT functions.
</xsl:if>
</xsl:template>
<func:function name="foundry:shying">
<xsl:param name="text"/>
<func:result select="translate($text, '\-', '&shy;'"/>
</func:function>
<func:function name="foundry:title">
<func:result>
<xsl:choose>
<!-- Use fixed title for some special content items -->
<xsl:when test="$resultTree//cms:contentPanel">
<xsl:choose>
<!-- Glossary -->
<xsl:when test="$resultTree/cms:contentPanel/cms:item/type/label = 'Glossary Item'">
<xsl:value-of select="foundry:get-static-text('layout/page/title/glossary')"/>
</xsl:when>
<!-- FAQ -->
<xsl:when test="$resultTree/cms:contentPanel/cms:item/type/label = 'FAQ Item'">
<xsl:value-of select="foundry:get-static-text('layout/page/title/faq')"/>
</xsl:when>
<!-- Else use title of CI -->
<xsl:otherwise>
<xsl:value-of select="foundry:shying($result-tree//cms:contentPanel/cms:item/title)"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<!-- Localized title for A-Z list -->
<xsl:when test="$resultTree/bebop:title = 'AtoZ'">
<xsl:value-of select="foundry:get-static-text('layout/page/title/atoz')"/>
</xsl:when>
<!-- Localized title for search -->
<xsl:when test="$resultTree/bebop:title = 'Search'">
<xsl:value-of select="foundry:get-static-text('layout/page/title/search')"/>
</xsl:when>
<!-- Localized title for log in -->
<xsl:when test="$resultTree/@application = 'login'">
<xsl:value-of select="foundry:get-static-text('layout/page/title/login')"/>
</xsl:when>
<!-- Localited title for sitemap -->
<xsl:when test="$resultTree/@id = 'sitemapPage'">
<xsl:value-of select="foundry:get-static-text('layout/page/title/sitemap')"/>
</xsl:when>
<!-- Title for content section-->
<xsl:otherwise>
<xsl:for-each select="$resultTree/nav:categoryMenu//nav:category[@isSelected='true']">
<xsl:choose>
<!-- Special rule: Use content item title für root-page in navigation -->
<xsl:when test="position() = last() and position() = 1">
<xsl:value-of select="foundry:shying(/bebop:page//title)"/>
</xsl:when>
<!-- Else use the name of the category -->
<xsl:when test="position() = last()">
<xsl:value-of select="foundry:shying(./@title)"/>
</xsl:when>
</xsl:choose>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
</func:result>
</func:function>
</xsl:stylesheet>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<page-layout>
<head>
<title>
<separator>: </separator>
<show-text>layout/page/head/title</show-text>
<show-page-title/>
</title>
</head>
</page-layout>