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

Last change on this file since 8526 was 8526, checked in by kjdon, 19 years ago

tidied up the style stuff - now uses css. pageHead is now defined by style, with pageTitle and pageStyle in each page. got rid of the attribute sets and colors in style - uses css instead.

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