source: other-projects/tipple-android/i-greenstone-server-files/greenstone/webapps/greenstone3/interfaces/gs2/transform/gslib.xsl@ 26899

Last change on this file since 26899 was 26899, checked in by davidb, 11 years ago

Tipple reborn after Chris's Summer of Code 2013

  • Property svn:mime-type set to application/xml
File size: 5.4 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2
3<xsl:stylesheet version="1.0"
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">
7
8
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"/>
12
13 <!-- some global parameters - these are set by whoever is invoking the transformation -->
14 <xsl:param name="interface_name"/>
15 <xsl:param name="library_name"/>
16
17 <!-- every pages .............................................. -->
18
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"/>
21
22 <xsl:template name="GS2LibDividerBar">
23 <xsl:param name='text'/>
24 <xsl:choose>
25 <xsl:when test="$text">
26 <div class="divbar"><xsl:value-of select="$text"/></div>
27 </xsl:when>
28 <xsl:otherwise>
29 <div class="divbar"><xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text></div>
30 </xsl:otherwise>
31 </xsl:choose>
32 </xsl:template>
33
34 <xsl:template match="error">
35 Error: <xsl:value-of select="."/>
36 </xsl:template>
37
38 <!-- site home .................................................... -->
39
40
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>
45
46
47 <xsl:template name="greenstoneLogoAlternateText">
48 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/>
49 </xsl:template>
50
51
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>
73
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"/>
76
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
100 <xsl:template name="quickSearchForm">
101 <form name="QuickSearch" method="get" action="{$library_name}">
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"/>
108 </form>
109 </xsl:template>
110
111
112 <xsl:template match="serviceClusterList">
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
120 <xsl:template name="poweredByGS3LanguageDependant">
121 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gs3power')"/>
122 </xsl:template>
123
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"/>
135
136
137</xsl:stylesheet>
138
139
Note: See TracBrowser for help on using the repository browser.