source: main/trunk/greenstone3/web/interfaces/gs2/transform/gslib.xsl@ 25875

Last change on this file since 25875 was 25875, checked in by kjdon, 12 years ago

renamed library.xsl to gslib.xsl

File size: 5.4 KB
RevLine 
[18439]1<?xml version="1.0" encoding="UTF-8"?>
2
3<xsl:stylesheet version="1.0"
[20019]4 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
5 xmlns:gslib="http://www.greenstone.org/XSL/Library"
6 exclude-result-prefixes="xalan gslib gsf xslt gs3">
[18439]7
8
[20019]9 <xsl:output method="html"
10 doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
11 doctype-system="http://www.w3.org/TR/html4/loose.dtd"/>
[18439]12
[20019]13 <!-- some global parameters - these are set by whoever is invoking the transformation -->
[18439]14 <xsl:param name="interface_name"/>
15 <xsl:param name="library_name"/>
16
[20019]17 <!-- every pages .............................................. -->
[18439]18
[20019]19 <xsl:variable name="a"><xsl:value-of select="/page/pageRequest/paramList/param[@name='a']/@value"/></xsl:variable>
20 <xsl:variable name="collections" select="/page/pageResponse/collectionList/collection"/>
[18439]21
[20019]22 <xsl:template name="GS2LibDividerBar">
23 <xsl:param name='text'/>
24 <xsl:choose>
[18439]25 <xsl:when test="$text">
[20019]26 <div class="divbar"><xsl:value-of select="$text"/></div>
[18439]27 </xsl:when>
28 <xsl:otherwise>
[20019]29 <div class="divbar"><xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text></div>
[18439]30 </xsl:otherwise>
31 </xsl:choose>
32 </xsl:template>
33
[20019]34 <xsl:template match="error">
[18439]35 Error: <xsl:value-of select="."/>
36 </xsl:template>
37
[20019]38 <!-- site home .................................................... -->
[18439]39
40
[20019]41 <xsl:template name="pageTitleLanguageDependant">
42 <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
43 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/><xsl:text> </xsl:text>
44 </xsl:template>
[18439]45
46
[20019]47 <xsl:template name="greenstoneLogoAlternateText">
48 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/>
49 </xsl:template>
[18439]50
51
[20019]52 <xsl:template name="collectionLinkWithImage">
53 <xsl:choose>
54 <xsl:when test="displayItem[@name='icon']">
55 <a href="{$library_name}?a=p&amp;amp;sa=about&amp;amp;c={@name}">
56 <img>
57 <xsl:attribute name="src">
58 <xsl:value-of select="metadataList/metadata[@name='httpPath']"/>/images/<xsl:value-of select="displayItem[@name='icon']"/>
59 </xsl:attribute>
60 <xsl:attribute name="alt">
61 <xsl:value-of select="displayItem[@name='name']"/>
62 </xsl:attribute>
63 </img>
64 </a>
65 </xsl:when>
66 <xsl:otherwise>
67 <a class="noimage" href="{$library_name}?a=p&amp;amp;sa=about&amp;amp;c={@name}">
68 <xsl:value-of select="displayItem[@name='name']"/>
69 </a>
70 </xsl:otherwise>
71 </xsl:choose>
72 </xsl:template>
[18439]73
[20023]74 <xsl:variable name="collName" select="/page/pageRequest/paramList/param[@name='c']/@value"/>
75 <xsl:variable name="this-element" select="/page/pageResponse/collection|/page/pageResponse/serviceCluster"/>
[18439]76
[20023]77 <xsl:template name="collectionHomeLinkWithLogoIfAvailable">
78 <a href="{$library_name}?a=p&amp;sa=about&amp;c={$collName}">
79 <xsl:choose>
80 <xsl:when test="$this-element/displayItem[@name='icon']">
81 <img border="0">
82 <xsl:attribute name="src">
83 <xsl:value-of select="$this-element/metadataList/metadata[@name='httpPath']"/>/images/<xsl:value-of select="$this-element/displayItem[@name='icon']"/>
84 </xsl:attribute>
85 <xsl:attribute name="alt">
86 <xsl:value-of select="$this-element/displayItem[@name='name']"/>
87 </xsl:attribute>
88 <xsl:attribute name="title">
89 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'aboutpage')"/>
90 </xsl:attribute>
91 </img>
92 </xsl:when>
93 <xsl:otherwise>
94 <xsl:value-of select="$this-element/displayItem[@name='name']"/>
95 </xsl:otherwise>
96 </xsl:choose>
97 </a>
98 </xsl:template>
99
[20019]100 <xsl:template name="quickSearchForm">
[18439]101 <form name="QuickSearch" method="get" action="{$library_name}">
[20019]102 <input type="hidden" name="a" value="q"/>
103 <input type="hidden" name="rt" value="rd"/>
104 <input type="hidden" name="s" value="{/page/pageResponse/serviceList/service[@name='TextQuery']/@name}"/>
105 <input type="hidden" name="s1.collection" value="all"/>
106 <input type="text" name="s1.query" size="20"/>
107 <input type="submit" value="Quick Search"/>
[18439]108 </form>
[20019]109 </xsl:template>
110
111
112 <xsl:template match="serviceClusterList">
[18439]113 <xsl:for-each select="serviceCluster">
114 <a href="{$library_name}?a=p&amp;amp;sa=about&amp;amp;c={@name}"><xsl:value-of select='@name'/><xsl:value-of select="displayItem[@name='name']"/></a>
115 </xsl:for-each>
116 </xsl:template>
117
118
119
[20019]120 <xsl:template name="poweredByGS3LanguageDependant">
121 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gs3power')"/>
[18439]122 </xsl:template>
123
[20229]124 <!-- the gberg collection has two options for its templates - a gs2 one and a gs3 one. Because calling a template is now a compile time error with tomcat 6, we can't call undefined templates anymore. this was happening in the branch that wasn't used. So, defining templates here that are used by the gs3 version. hopefully this will go away once we are using oran skin and derivatives -->
125 <xsl:template name="aboutCollectionPageTitle"/>
126 <xsl:template name="textDirectionAttribute"/>
127 <xsl:template name="displayErrorsIfAny"/>
128 <xsl:template name="homeButtonTop"/>
129 <xsl:template name="helpButtonTop"/>
130 <xsl:template name="preferencesButtonTop"/>
131 <xsl:template name="servicesNavigationBar"/>
132 <xsl:template name="noTextBar"/>
133 <xsl:template name="collectionDescriptionTextAndServicesLinks"/>
134 <xsl:template name="poweredByGS3TextBar"/>
[18439]135
136
137</xsl:stylesheet>
138
139
Note: See TracBrowser for help on using the repository browser.