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

Last change on this file since 32217 was 32217, checked in by kjdon, 6 years ago

change ministry of ed url

  • 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 <p><a href="http://www.education.govt.nz/"><img src="sites/{$site_name}/collect/niupepa/images/MOE-logo.jpg" style="border:0px;" height="100"/></a>
49 <gsf:collectionText name="about.textyaymined"/></p>
50 <gsf:collectionText name="about.textxsupporgs2"/>
51 </xsl:template>
52
53<xsl:template name="languageswap">
54 <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>
55<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>
56 <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>
57<script type="text/javascript">
58 <xsl:text disable-output-escaping="yes">
59 $(window).ready(function()
60 {
61 var url = document.URL;
62 if(url.indexOf("?") != -1)
63 {
64 if(url.search(/[&amp;?]?l=[^&amp;\b]*/g) != -1)
65 {
66 url = url.replace(/([&amp;?]?)l=[^&amp;\b]*/g, "$1</xsl:text><xsl:value-of select="$langcgiarg"/><xsl:text disable-output-escaping="yes">");
67 $("#replaceLink").attr("href", url);
68 }
69 else
70 {
71 $("#replaceLink").attr("href", url + "&amp;</xsl:text><xsl:value-of select="$langcgiarg"/><xsl:text disable-output-escaping="yes">");
72 }
73 }
74 else
75 {
76 $("#replaceLink").attr("href", url + "?</xsl:text><xsl:value-of select="$langcgiarg"/><xsl:text disable-output-escaping="yes">");
77 }
78 });
79 </xsl:text>
80</script>
81
82</xsl:template>
83</xsl:stylesheet>
84
Note: See TracBrowser for help on using the repository browser.