Foundry: Formatting
git-svn-id: https://svn.libreccm.org/ccm/trunk@3267 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
ba3e747651
commit
9259c8ec59
|
|
@ -211,15 +211,15 @@ processor, some are read from the configuration files of Foundry and some are de
|
||||||
</foundry:doc>
|
</foundry:doc>
|
||||||
<xsl:variable name="languages">
|
<xsl:variable name="languages">
|
||||||
|
|
||||||
</xsl:variable>-->
|
</xsl:variable>-->
|
||||||
|
|
||||||
<foundry:doc section="devel" type="env-var">
|
<foundry:doc section="devel" type="env-var">
|
||||||
<foundry:doc-desc>
|
<foundry:doc-desc>
|
||||||
<p>
|
<p>
|
||||||
The languages supported by this theme. They are configured in
|
The languages supported by this theme. They are configured in
|
||||||
<code>conf/global.xml</code> using the <code><supported-languages></code>
|
<code>conf/global.xml</code> using the <code><supported-languages></code>
|
||||||
element. Example for german and english:
|
element. Example for german and english:
|
||||||
<pre>
|
<pre>
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<foundry:configuration>
|
<foundry:configuration>
|
||||||
…
|
…
|
||||||
|
|
@ -229,89 +229,89 @@ processor, some are read from the configuration files of Foundry and some are de
|
||||||
</supported-languages>
|
</supported-languages>
|
||||||
…
|
…
|
||||||
</foundry:configuration>
|
</foundry:configuration>
|
||||||
</pre>
|
</pre>
|
||||||
</p>
|
</p>
|
||||||
</foundry:doc-desc>
|
</foundry:doc-desc>
|
||||||
</foundry:doc>
|
</foundry:doc>
|
||||||
<xsl:variable name="supported-languages"
|
<xsl:variable name="supported-languages"
|
||||||
select="document(foundry:gen-path('conf/global.xml'))/foundry:configuration/supported-languages"/>
|
select="document(foundry:gen-path('conf/global.xml'))/foundry:configuration/supported-languages"/>
|
||||||
|
|
||||||
<foundry:doc section="devel" type="template-tag">
|
<foundry:doc section="devel" type="template-tag">
|
||||||
<foundry:doc-desc>
|
<foundry:doc-desc>
|
||||||
<p>
|
<p>
|
||||||
The language to use by theme engine for static texts etc. The language is determined
|
The language to use by theme engine for static texts etc. The language is determined
|
||||||
as follows:
|
as follows:
|
||||||
</p>
|
</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>If the negotiated language is also in the <code>supported-languages</code></li>
|
<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
|
<li>If not the language which set by the default attribute of the
|
||||||
<code><supported-languages></code> is used, but only if this language
|
<code><supported-languages></code> is used, but only if this language
|
||||||
is in the supported languages.</li>
|
is in the supported languages.</li>
|
||||||
<li>Otherwise the first of the supported languages is used.</li>
|
<li>Otherwise the first of the supported languages is used.</li>
|
||||||
</ul>
|
</ul>
|
||||||
</foundry:doc-desc>
|
</foundry:doc-desc>
|
||||||
</foundry:doc>
|
</foundry:doc>
|
||||||
<xsl:variable name="language">
|
<xsl:variable name="language">
|
||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
<xsl:when test="$supported-languages/language[@locale=$negotiated-language]">
|
<xsl:when test="$supported-languages/language[@locale=$negotiated-language]">
|
||||||
<xsl:value-of select="$negotiated-language"/>
|
<xsl:value-of select="$negotiated-language"/>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
<xsl:when test="not($supported-languages/language[@locale=$negotiated-language]) and $supported-languages/language[$supported-languages/@default]">
|
<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:value-of select="$supported-languages/language[$supported-languages/@default]"/>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
<xsl:otherwise>
|
<xsl:otherwise>
|
||||||
<xsl:value-of select="$supported-languages/language[1]/@locale"/>
|
<xsl:value-of select="$supported-languages/language[1]/@locale"/>
|
||||||
</xsl:otherwise>
|
</xsl:otherwise>
|
||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
|
|
||||||
</xsl:variable>
|
</xsl:variable>
|
||||||
|
|
||||||
<!-- **************************************************************************** -->
|
<!-- **************************************************************************** -->
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Variables describing the user agent.
|
Variables describing the user agent.
|
||||||
ToDo: Check if we still need them.
|
ToDo: Check if we still need them.
|
||||||
-->
|
-->
|
||||||
<!--<foundry:doc section="devel" type="evn-var">
|
<!--<foundry:doc section="devel" type="evn-var">
|
||||||
<foundry:doc-desc>
|
<foundry:doc-desc>
|
||||||
<p>
|
<p>
|
||||||
The name of the user agent (browser) which is used to access CCM.
|
The name of the user agent (browser) which is used to access CCM.
|
||||||
</p>
|
</p>
|
||||||
</foundry:doc-desc>
|
</foundry:doc-desc>
|
||||||
</foundry:doc>-->
|
</foundry:doc>-->
|
||||||
<xsl:param name="user-agent"/>
|
<xsl:param name="user-agent"/>
|
||||||
|
|
||||||
<xsl:variable name="mozilla-version">
|
<xsl:variable name="mozilla-version">
|
||||||
<xsl:value-of select="substring(substring-after($user-agent, 'Mozilla/'), 1, 1)"/>
|
<xsl:value-of select="substring(substring-after($user-agent, 'Mozilla/'), 1, 1)"/>
|
||||||
</xsl:variable>
|
</xsl:variable>
|
||||||
|
|
||||||
<!-- Firefox -->
|
<!-- Firefox -->
|
||||||
<xsl:variable name="firefox-version">
|
<xsl:variable name="firefox-version">
|
||||||
<xsl:value-of select="substring(substring-after($user-agent, 'Firefox/'), 1, 1)"/>
|
<xsl:value-of select="substring(substring-after($user-agent, 'Firefox/'), 1, 1)"/>
|
||||||
</xsl:variable>
|
</xsl:variable>
|
||||||
|
|
||||||
<!-- Konqueror -->
|
<!-- Konqueror -->
|
||||||
<xsl:variable name="konqueror-version">
|
<xsl:variable name="konqueror-version">
|
||||||
<xsl:value-of select="substring(substring-after($user-agent, 'Konqueror/'), 1, 1)"/>
|
<xsl:value-of select="substring(substring-after($user-agent, 'Konqueror/'), 1, 1)"/>
|
||||||
</xsl:variable>
|
</xsl:variable>
|
||||||
|
|
||||||
<!-- Opera -->
|
<!-- Opera -->
|
||||||
<xsl:variable name="opera-version1">
|
<xsl:variable name="opera-version1">
|
||||||
<xsl:value-of select="substring(substring-after($user-agent, 'Opera/'), 1, 1)"/>
|
<xsl:value-of select="substring(substring-after($user-agent, 'Opera/'), 1, 1)"/>
|
||||||
</xsl:variable>
|
</xsl:variable>
|
||||||
|
|
||||||
<xsl:variable name="opera-version2">
|
<xsl:variable name="opera-version2">
|
||||||
<xsl:value-of select="substring(substring-after($user-agent, 'Opera '), 1, 1)"/>
|
<xsl:value-of select="substring(substring-after($user-agent, 'Opera '), 1, 1)"/>
|
||||||
</xsl:variable>
|
</xsl:variable>
|
||||||
|
|
||||||
<!-- MSIE -->
|
<!-- MSIE -->
|
||||||
<xsl:variable name="msie_version">
|
<xsl:variable name="msie_version">
|
||||||
<xsl:value-of select="substring(substring-after($user-agent, 'MSIE '), 1, 1)"/>
|
<xsl:value-of select="substring(substring-after($user-agent, 'MSIE '), 1, 1)"/>
|
||||||
</xsl:variable>
|
</xsl:variable>
|
||||||
|
|
||||||
<!-- AppleWebKit -->
|
<!-- AppleWebKit -->
|
||||||
<xsl:variable name="webkit_version">
|
<xsl:variable name="webkit_version">
|
||||||
<xsl:value-of select="substring(substring-after($user-agent, 'AppleWebKit/'), 1, 3)"/>
|
<xsl:value-of select="substring(substring-after($user-agent, 'AppleWebKit/'), 1, 3)"/>
|
||||||
</xsl:variable>
|
</xsl:variable>
|
||||||
|
|
||||||
</xsl:stylesheet>
|
</xsl:stylesheet>
|
||||||
Loading…
Reference in New Issue