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

Last change on this file since 8585 was 8530, checked in by kjdon, 20 years ago

brownbutton changed to gsbutton, cos its no longer brown, and moved style info to a stylesheet

  • Property svn:keywords set to Author Date Id Revision
File size: 9.9 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 <!-- global style info goes here -->
14 <xsl:template name="globalStyle">
15 <link rel="stylesheet" href="interfaces/default/style/core.css" type="text/css"/>
16 </xsl:template>
17
18 <!-- the main page layout template is here -->
19 <xsl:template match="page">
20 <html>
21 <xsl:call-template name="pageHead"/>
22 <body>
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 <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
41 <xsl:template name="pageHead">
42 <head>
43 <title>
44 <xsl:call-template name="pageTitle"/><xsl:text> </xsl:text>
45 </title>
46 <xsl:call-template name="globalStyle"/>
47 <xsl:call-template name="pageStyle"/>
48 </head>
49 </xsl:template>
50
51
52 <xsl:template name="greenstonePageBanner">
53 <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>
54 <xsl:call-template name="dividerBar"/>
55 </xsl:template>
56
57 <xsl:template name="greenstoneFooter">
58 <center>
59 <p/>
60 <small><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gs3power')"/></small>
61 </center>
62 </xsl:template>
63
64 <xsl:template name="standardPageBanner">
65 <xsl:param name="collName"/>
66 <xsl:param name="pageType"/>
67 <xsl:variable name="this-element" select="/page/pageResponse/collection|/page/pageResponse/serviceCluster"/>
68 <table width="100%">
69 <tr>
70 <td align="left">
71 <a href="{$library_name}?a=p&amp;sa=about&amp;c={$collName}">
72 <xsl:choose>
73 <xsl:when test="$this-element/displayItem[@name='icon']">
74 <img border="0">
75 <xsl:attribute name="src">
76 <xsl:value-of select="$this-element/metadataList/metadata[@name='httpPath']"/>/images/<xsl:value-of select="$this-element/displayItem[@name='icon']"/>
77 </xsl:attribute>
78 <xsl:attribute name="alt">
79 <xsl:value-of select="$this-element/displayItem[@name='name']"/>
80 </xsl:attribute>
81 <xsl:attribute name="title">
82 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'aboutpage')"/>
83 </xsl:attribute>
84 </img>
85 </xsl:when>
86 <xsl:otherwise>
87 <b><xsl:value-of select="$this-element/displayItem[@name='name']"/></b>
88 </xsl:otherwise>
89 </xsl:choose>
90 </a>
91 </td>
92 <td align="right">
93 <table cellspacing='4'>
94 <tr>
95 <td class="gsbutton">
96 <a class="gsbutton" 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>
97 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_b')"/>
98 </a>
99 </td>
100 <xsl:choose>
101 <xsl:when test="$pageType='help'">
102 <td class="gsbuttonoff">
103 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/>
104 </td>
105 </xsl:when>
106 <xsl:otherwise>
107 <td class="gsbutton">
108 <a class="gsbutton" 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>
109 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/>
110 </a>
111 </td>
112 </xsl:otherwise>
113 </xsl:choose>
114 <xsl:choose>
115 <xsl:when test="$pageType='pref'">
116 <td class="gsbuttonoff">
117 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/>
118 </td>
119 </xsl:when>
120 <xsl:otherwise>
121 <td class="gsbutton">
122 <a class="gsbutton" 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>
123 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/>
124 </a>
125 </td>
126 </xsl:otherwise>
127 </xsl:choose>
128 </tr>
129 </table>
130 </td>
131 </tr>
132 </table>
133 <p/>
134 </xsl:template>
135
136
137 <xsl:template name="navigationBar">
138 <xsl:param name="collName"/>
139 <xsl:variable name="this-element" select="/page/pageResponse/collection|/page/pageResponse/serviceCluster"/>
140 <xsl:variable name="this-service" select="/page/pageResponse/service/@name"/>
141 <xsl:choose>
142 <xsl:when test="$this-element/serviceList/service">
143 <table border='0' cellspacing='0' width='100%'>
144 <tr>
145 <xsl:for-each select="$this-element/serviceList/service">
146 <xsl:variable name="action"><xsl:choose>
147 <xsl:when test="@name=$this-service">CURRENT</xsl:when>
148 <xsl:when test="@type='query'">q</xsl:when>
149 <xsl:when test="@type='browse'">b</xsl:when>
150 <xsl:when test="@type='process'">pr</xsl:when>
151 <xsl:when test="@type='applet'">a</xsl:when>
152 <xsl:otherwise>DO_NOT_DISPLAY</xsl:otherwise>
153 </xsl:choose></xsl:variable>
154 <xsl:choose>
155 <xsl:when test="$action='CURRENT'">
156 <td class="navbaroff"><nobr><xsl:value-of select="displayItem[@name='name']"/></nobr></td>
157 </xsl:when>
158 <xsl:when test="$action !='DO_NOT_DISPLAY'">
159 <td class="navbar"><a class="navbar" 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><nobr><xsl:value-of select="displayItem[@name='name']"/></nobr></a></td>
160 </xsl:when>
161 </xsl:choose>
162 </xsl:for-each>
163 </tr>
164 </table>
165 </xsl:when>
166 <xsl:otherwise>
167 <table border='0' cellspacing='0' width='100%'><tr><td class="navbar">&#160;</td></tr></table>
168 </xsl:otherwise>
169 </xsl:choose>
170 <br/>
171 </xsl:template>
172
173
174 <xsl:template name="dividerBar">
175 <xsl:param name='text'/>
176 <br/><table width='100%' border="0" cellpadding="0" cellspacing="0">
177 <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/>
178 </xsl:template>
179
180 <!-- Display the appropriate image, depending on the node type -->
181 <xsl:template match="documentNode" mode="displayNodeIcon">
182
183 <!-- Root node: book icon (open or closed) -->
184 <xsl:choose>
185 <xsl:when test="@nodeType='root'">
186 <xsl:choose>
187 <xsl:when test="documentNode">
188 <xsl:call-template name="openbookimg">
189 <xsl:with-param name="title">Close this book</xsl:with-param>
190 </xsl:call-template>
191 </xsl:when>
192 <xsl:otherwise>
193 <xsl:call-template name="closedbookimg">
194 <xsl:with-param name="title">Open this document and view contents</xsl:with-param>
195 </xsl:call-template>
196 </xsl:otherwise>
197 </xsl:choose>
198 </xsl:when>
199
200 <!-- Interior node: folder icon (open or closed) -->
201 <xsl:when test="@nodeType='interior'">
202 <xsl:choose>
203 <xsl:when test="documentNode">
204 <xsl:call-template name="openfolderimg">
205 <xsl:with-param name="title">Close this folder</xsl:with-param>
206 </xsl:call-template>
207 </xsl:when>
208 <xsl:otherwise>
209 <xsl:call-template name="closedfolderimg">
210 <xsl:with-param name="title">Open this folder and view contents</xsl:with-param>
211 </xsl:call-template>
212 </xsl:otherwise>
213 </xsl:choose>
214 </xsl:when>
215
216 <!-- Leaf node: page icon, and this is the default -->
217 <xsl:otherwise>
218 <xsl:call-template name="textpageimg">
219 <xsl:with-param name="title">View the document</xsl:with-param>
220 </xsl:call-template>
221 </xsl:otherwise>
222 </xsl:choose>
223 </xsl:template>
224
225 <xsl:template name="openbookimg">
226 <xsl:param name="alt"/>
227 <xsl:param name="title"/>
228 <img border="0" width="28" height="23"
229 src="interfaces/default/images/openbook.gif"
230 alt="{$alt}" title="{$title}"/>
231 </xsl:template>
232
233 <xsl:template name="closedbookimg">
234 <xsl:param name="alt"/>
235 <xsl:param name="title"/>
236 <img border="0" width="18" height="11"
237 src="interfaces/default/images/book.gif"
238 alt="{$alt}" title="{$title}"/>
239 </xsl:template>
240
241 <xsl:template name="openfolderimg">
242 <xsl:param name="alt"/>
243 <xsl:param name="title"/>
244 <img border="0" width="23" height="15"
245 src="interfaces/default/images/openfldr.gif"
246 alt="{$alt}" title="{$title}"/>
247 </xsl:template>
248
249 <xsl:template name="closedfolderimg">
250 <xsl:param name="alt"/>
251 <xsl:param name="title"/>
252 <img border="0" width="23" height="15"
253 src="interfaces/default/images/clsdfldr.gif"
254 alt="{$alt}" title="{$title}"/>
255 </xsl:template>
256
257 <xsl:template name="textpageimg">
258 <xsl:param name="alt"/>
259 <xsl:param name="title"/>
260 <img border="0" width="16" height="21"
261 src="interfaces/default/images/itext.gif"
262 alt="{$alt}" title="{$title}"/>
263 </xsl:template>
264
265 <xsl:template name="bookshelfimg">
266 <xsl:param name="alt"/>
267 <xsl:param name="title"/>
268 <img border="0" width="20" height="16"
269 src="interfaces/default/images/bshelf.gif"
270 alt="{$alt}" title="{$title}"/>
271 </xsl:template>
272</xsl:stylesheet>
273
274
Note: See TracBrowser for help on using the repository browser.