source: main/trunk/model-cols/niupepa/transform/pages/about.xsl@ 26480

Last change on this file since 26480 was 26480, checked in by kjdon, 11 years ago

added internal page links as per original niupepa collection. removed a little bit of html format tags from the properties text strings

  • Property svn:executable set to *
File size: 3.3 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<xsl:stylesheet version="1.0"
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns:java="http://xml.apache.org/xslt/java"
5 xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
6 xmlns:gslib="http://www.greenstone.org/skinning"
7 xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat"
8 extension-element-prefixes="java util"
9 exclude-result-prefixes="java util gsf">
10
11 <!-- use the 'main' layout -->
12 <xsl:include href="layouts/main.xsl"/>
13
14 <!-- set page title -->
15 <xsl:template name="pageTitle"><gslib:collectionName/></xsl:template>
16
17 <!-- set page breadcrumbs -->
18 <xsl:template name="breadcrumbs"><gslib:siteLink/><gslib:rightArrow/></xsl:template>
19
20 <!-- the page content -->
21 <xsl:template match="/page">
22 <script type="text/javascript">
23 <xsl:text disable-output-escaping="yes">$(window).load(function()
24{
25 var links = $("a");
26 for(var i = 0; i &lt; links.length; i++)
27 {
28 if($(links[i]).attr("href") &amp;&amp; $(links[i]).attr("href").match("^#"))
29 {
30 $(links[i]).attr("href", document.URL + $(links[i]).attr("href"));
31 }
32 }
33});</xsl:text></script>
34 <xsl:call-template name="languageswap"/>
35 <h2><gsf:collectionText name="about.textxwelcome"/></h2>
36 <p><gsf:collectionText name="about.textxwelcome2"/></p>
37 <p><gsf:collectionText name="about.textxbackground"/></p>
38 <p><gsf:collectionText name="about.textxgrateful"/></p>
39
40 <hr/>
41
42 <h2><a name="background"><gsf:collectionText name="about.textxbackground2"/></a></h2>
43 <gsf:collectionText name="about.textxbackground3"/>
44
45 <hr/>
46
47 <h2><a name="support"><gsf:collectionText name="about.textxsupporgs"/></a></h2>
48 <a href="http://www.minedu.govt.nz/"><img src="http://www.minedu.govt.nz/minedu/images/ui/header/moe-logo.gif" style="border:0px;"/></a> <p><gsf:collectionText name="about.textyaymined"/></p>
49 <gsf:collectionText name="about.textxsupporgs2"/>
50 </xsl:template>
51
52<xsl:template name="languageswap">
53 <xsl:variable name="swaplangname"><xsl:choose><xsl:when test="/page/@lang = 'mi'">English</xsl:when><xsl:otherwise>Māori</xsl:otherwise></xsl:choose></xsl:variable>
54<div style="text-align:right;"><small><a id="replaceLink"><xsl:attribute name="title"><gsf:collectionText name="about.changelangtofrommaori"/></xsl:attribute><xsl:value-of select="$swaplangname"/></a></small></div>
55 <xsl:variable name="langcgiarg"><xsl:choose><xsl:when test="/page/@lang = 'mi'">l=en</xsl:when><xsl:otherwise>l=mi</xsl:otherwise></xsl:choose></xsl:variable>
56<script type="text/javascript">
57 <xsl:text disable-output-escaping="yes">
58 $(window).ready(function()
59 {
60 var url = document.URL;
61 if(url.indexOf("?") != -1)
62 {
63 if(url.search(/[&amp;?]?l=[^&amp;\b]*/g) != -1)
64 {
65 url = url.replace(/([&amp;?]?)l=[^&amp;\b]*/g, "$1</xsl:text><xsl:value-of select="$langcgiarg"/><xsl:text disable-output-escaping="yes">");
66 $("#replaceLink").attr("href", url);
67 }
68 else
69 {
70 $("#replaceLink").attr("href", url + "&amp;</xsl:text><xsl:value-of select="$langcgiarg"/><xsl:text disable-output-escaping="yes">");
71 }
72 }
73 else
74 {
75 $("#replaceLink").attr("href", url + "?</xsl:text><xsl:value-of select="$langcgiarg"/><xsl:text disable-output-escaping="yes">");
76 }
77 });
78 </xsl:text>
79</script>
80
81</xsl:template>
82</xsl:stylesheet>
83
Note: See TracBrowser for help on using the repository browser.