source: trunk/gsdl3/web/interfaces/default/transform/style.xsl@ 6693

Last change on this file since 6693 was 6693, checked in by nzdl, 20 years ago

made the home help pref buttons smaller text

  • Property svn:keywords set to Author Date Id Revision
File size: 11.2 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 extension-element-prefixes="java util"
7 exclude-result-prefixes="java util">
8
9 <!-- some global parameters - these are set by whoever is invoking the transformation -->
10 <xsl:param name="interface_name"/>
11 <xsl:param name="library_name"/>
12
13 <!-- some global variables -->
14 <xsl:variable name="colour-button-text">#345437</xsl:variable>
15 <xsl:variable name="colour-navbar-link-text">#345437</xsl:variable>
16 <xsl:variable name="colour-navbar-selected-text">#c6aa69</xsl:variable>
17
18 <!-- the main page layout template is here -->
19 <xsl:template match="page">
20 <html>
21 <xsl:call-template name="pageHead"/>
22 <body xsl:use-attribute-sets="body-style">
23 <table border="0" cellspacing="0" cellpadding="0" width="100%">
24 <td valign="top" width="65"><!-- a space for our side bar-->
25 <img src="interfaces/default/images/spacer.gif" width="65" height="1" alt="" border="0"/><!-- an image cos netscape ignores the cell width -->
26 </td>
27 <td>
28 <table width="100%">
29 <tr><td>
30 <xsl:apply-templates select="pageResponse"/>
31 <xsl:call-template name="greenstoneFooter"/>
32 </td></tr>
33 </table>
34 </td>
35 </table>
36 </body>
37 </html>
38 </xsl:template>
39
40 <xsl:attribute-set name="body-style">
41 <xsl:attribute name="bgcolor">#ffffff</xsl:attribute>
42 <xsl:attribute name="text">#000000</xsl:attribute>
43 <xsl:attribute name="link">#006666</xsl:attribute>
44 <xsl:attribute name="alink">#cc9900</xsl:attribute>
45 <xsl:attribute name="vlink">#666633</xsl:attribute>
46 <xsl:attribute name="background">interfaces/default/images/chalk.gif</xsl:attribute>
47 </xsl:attribute-set>
48
49 <xsl:attribute-set name="td-brownbutton">
50 <xsl:attribute name='background'>interfaces/default/images/brownbutton.gif</xsl:attribute>
51 <xsl:attribute name='height'>20</xsl:attribute>
52 <xsl:attribute name='align'>center</xsl:attribute>
53 </xsl:attribute-set>
54
55 <xsl:attribute-set name="td-brownbutton-off">
56 <xsl:attribute name='background'>interfaces/default/images/greenbar.gif</xsl:attribute>
57 <xsl:attribute name='height'>20</xsl:attribute>
58 <xsl:attribute name='align'>center</xsl:attribute>
59 </xsl:attribute-set>
60
61 <xsl:attribute-set name="td-navbar">
62 <xsl:attribute name='background'>interfaces/default/images/greenbar.gif</xsl:attribute>
63 <xsl:attribute name='height'>20</xsl:attribute>
64 <xsl:attribute name='align'>center</xsl:attribute>
65 </xsl:attribute-set>
66
67 <xsl:template name="greenstonePageBanner">
68 <center><img src="interfaces/default/images/gsdlhead.gif"><xsl:attribute name="alt"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/></xsl:attribute></img></center>
69 <xsl:call-template name="dividerBar"/>
70 </xsl:template>
71
72 <xsl:template name="greenstoneFooter">
73 <center>
74 <p/>
75 <small><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gs3power')"/></small>
76 </center>
77 </xsl:template>
78
79 <xsl:template name="standardPageBanner">
80 <xsl:param name="collName"/>
81 <xsl:param name="pageType"/>
82 <xsl:variable name="this-element" select="/page/pageResponse/collection|/page/pageResponse/serviceCluster"/>
83 <table width="100%">
84 <tr>
85 <td align="left">
86 <a href="{$library_name}?a=p&amp;sa=about&amp;c={$collName}">
87 <xsl:choose>
88 <xsl:when test="$this-element/displayItem[@name='icon']">
89 <img border="0">
90 <xsl:attribute name="src">
91 <xsl:value-of select="$this-element/metadataList/metadata[@name='httpPath']"/>/images/<xsl:value-of select="$this-element/displayItem[@name='icon']"/>
92 </xsl:attribute>
93 <xsl:attribute name="alt">
94 <xsl:value-of select="$this-element/displayItem[@name='name']"/>
95 </xsl:attribute>
96 <xsl:attribute name="title">
97 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'aboutpage')"/>
98 </xsl:attribute>
99 </img>
100 </xsl:when>
101 <xsl:otherwise>
102 <b><xsl:value-of select="$this-element/displayItem[@name='name']"/></b>
103 </xsl:otherwise>
104 </xsl:choose>
105 </a>
106 </td>
107 <td align="right">
108 <table cellspacing='4'>
109 <tr>
110 <td xsl:use-attribute-sets="td-brownbutton">
111 <a style="text-decoration:none" href="{$library_name}?a=p&amp;sa=home"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_tip')"/></xsl:attribute>
112 <b><font size='-1' color='{$colour-button-text}'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_b')"/></font></b>
113 </a>
114 </td>
115 <xsl:choose>
116 <xsl:when test="$pageType='help'">
117 <td xsl:use-attribute-sets="td-brownbutton-off">
118 <b><font size='-1' color='{$colour-button-text}'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/></font></b>
119 </td>
120 </xsl:when>
121 <xsl:otherwise>
122 <td xsl:use-attribute-sets="td-brownbutton">
123 <a style="text-decoration:none" href="{$library_name}?a=p&amp;sa=help&amp;c={$collName}"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_tip')"/></xsl:attribute>
124 <b><font size='-1' color='{$colour-button-text}'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/></font></b>
125 </a>
126 </td>
127 </xsl:otherwise>
128 </xsl:choose>
129 <xsl:choose>
130 <xsl:when test="$pageType='pref'">
131 <td xsl:use-attribute-sets="td-brownbutton-off">
132 <b><font size='-1' color='{$colour-button-text}'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/></font></b>
133 </td>
134 </xsl:when>
135 <xsl:otherwise>
136 <td xsl:use-attribute-sets="td-brownbutton">
137 <a style="text-decoration:none" href="{$library_name}?a=p&amp;sa=pref&amp;c={$collName}"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_tip')"/></xsl:attribute>
138 <b><font size='-1' color='{$colour-button-text}'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/></font></b>
139 </a>
140 </td>
141 </xsl:otherwise>
142 </xsl:choose>
143 </tr>
144 </table>
145 </td>
146 </tr>
147 </table>
148 <p/>
149 </xsl:template>
150
151 <xsl:template name="navigationBar">
152 <xsl:param name="collName"/>
153 <xsl:variable name="this-element" select="/page/pageResponse/collection|/page/pageResponse/serviceCluster"/>
154 <xsl:variable name="this-service" select="/page/pageResponse/service/@name"/>
155 <table border='0' cellspacing='0' width='100%'>
156 <tr>
157 <xsl:for-each select="$this-element/serviceList/service">
158 <xsl:variable name="action"><xsl:choose>
159 <xsl:when test="@name=$this-service">CURRENT</xsl:when>
160 <xsl:when test="@type='query'">q</xsl:when>
161 <xsl:when test="@type='browse'">b</xsl:when>
162 <xsl:when test="@type='process'">pr</xsl:when>
163 <xsl:when test="@type='applet'">a</xsl:when>
164 <xsl:otherwise>DO_NOT_DISPLAY</xsl:otherwise>
165 </xsl:choose></xsl:variable>
166 <xsl:choose>
167 <xsl:when test="$action='CURRENT'">
168 <td xsl:use-attribute-sets="td-navbar"><b><nobr><font size='+1' color='{$colour-navbar-selected-text}'><xsl:value-of select="displayItem[@name='name']"/></font></nobr></b></td>
169 </xsl:when>
170 <xsl:when test="$action !='DO_NOT_DISPLAY'">
171 <td xsl:use-attribute-sets="td-navbar"><a style="text-decoration:none" href="{$library_name}?a={$action}&amp;rt=d&amp;s={@name}&amp;c={$collName}"><xsl:if test="displayItem[@name='description']"><xsl:attribute name='title'><xsl:value-of select="displayItem[@name='description']"/></xsl:attribute></xsl:if><b><nobr><font size='+1' color='{$colour-navbar-link-text}'><xsl:value-of select="displayItem[@name='name']"/></font></nobr></b></a></td>
172 </xsl:when>
173 </xsl:choose>
174 </xsl:for-each>
175 </tr>
176 </table>
177 <br/>
178 </xsl:template>
179
180
181 <xsl:template name="dividerBar">
182 <xsl:param name='text'/>
183 <br/><table width='100%' border="0" cellpadding="0" cellspacing="0">
184 <tr><td valign='bottom' height='20' background='interfaces/default/images/greenbar.gif'><font size="+1" color="black"><b>&#160;<xsl:value-of select='$text'/></b></font></td></tr></table><br/>
185 </xsl:template>
186
187 <!-- Display the appropriate image, depending on the node type -->
188 <xsl:template match="documentNode" mode="displayNodeIcon">
189
190 <!-- Root node: book icon (open or closed) -->
191 <xsl:choose>
192 <xsl:when test="@nodeType='root'">
193 <xsl:choose>
194 <xsl:when test="documentNode">
195 <xsl:call-template name="openbookimg">
196 <xsl:with-param name="title">Close this book</xsl:with-param>
197 </xsl:call-template>
198 </xsl:when>
199 <xsl:otherwise>
200 <xsl:call-template name="closedbookimg">
201 <xsl:with-param name="title">Open this document and view contents</xsl:with-param>
202 </xsl:call-template>
203 </xsl:otherwise>
204 </xsl:choose>
205 </xsl:when>
206
207 <!-- Interior node: folder icon (open or closed) -->
208 <xsl:when test="@nodeType='interior'">
209 <xsl:choose>
210 <xsl:when test="documentNode">
211 <xsl:call-template name="openfolderimg">
212 <xsl:with-param name="title">Close this folder</xsl:with-param>
213 </xsl:call-template>
214 </xsl:when>
215 <xsl:otherwise>
216 <xsl:call-template name="closedfolderimg">
217 <xsl:with-param name="title">Open this folder and view contents</xsl:with-param>
218 </xsl:call-template>
219 </xsl:otherwise>
220 </xsl:choose>
221 </xsl:when>
222
223 <!-- Leaf node: page icon, and this is the default -->
224 <xsl:otherwise>
225 <xsl:call-template name="textpageimg">
226 <xsl:with-param name="title">View the document</xsl:with-param>
227 </xsl:call-template>
228 </xsl:otherwise>
229 </xsl:choose>
230 </xsl:template>
231
232 <xsl:template name="openbookimg">
233 <xsl:param name="alt"/>
234 <xsl:param name="title"/>
235 <img border="0" width="28" height="23"
236 src="interfaces/default/images/openbook.gif"
237 alt="{$alt}" title="{$title}"/>
238 </xsl:template>
239
240 <xsl:template name="closedbookimg">
241 <xsl:param name="alt"/>
242 <xsl:param name="title"/>
243 <img border="0" width="18" height="11"
244 src="interfaces/default/images/book.gif"
245 alt="{$alt}" title="{$title}"/>
246 </xsl:template>
247
248 <xsl:template name="openfolderimg">
249 <xsl:param name="alt"/>
250 <xsl:param name="title"/>
251 <img border="0" width="23" height="15"
252 src="interfaces/default/images/openfldr.gif"
253 alt="{$alt}" title="{$title}"/>
254 </xsl:template>
255
256 <xsl:template name="closedfolderimg">
257 <xsl:param name="alt"/>
258 <xsl:param name="title"/>
259 <img border="0" width="23" height="15"
260 src="interfaces/default/images/clsdfldr.gif"
261 alt="{$alt}" title="{$title}"/>
262 </xsl:template>
263
264 <xsl:template name="textpageimg">
265 <xsl:param name="alt"/>
266 <xsl:param name="title"/>
267 <img border="0" width="16" height="21"
268 src="interfaces/default/images/itext.gif"
269 alt="{$alt}" title="{$title}"/>
270 </xsl:template>
271
272 <xsl:template name="bookshelfimg">
273 <xsl:param name="alt"/>
274 <xsl:param name="title"/>
275 <img border="0" width="20" height="16"
276 src="interfaces/default/images/bshelf.gif"
277 alt="{$alt}" title="{$title}"/>
278 </xsl:template>
279</xsl:stylesheet>
280
281
Note: See TracBrowser for help on using the repository browser.