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

Last change on this file since 5198 was 5198, checked in by kjdon, 21 years ago

changes to the nav bar and buttons

  • Property svn:keywords set to Author Date Id Revision
File size: 9.8 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">
25 <img src="interfaces/default/images/spacer.gif" width="65" height="1" alt="" border="0"/>
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>
69 <table width="100%" cellspacing="0" cellpadding="0">
70 <tr valign="top">
71 <td rowspan="2" align="left"><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></td>
72 <td align="right"></td>
73 </tr>
74
75 <tr>
76 <td align="right"></td>
77 </tr>
78
79 <tr>
80 <td colspan="2"></td>
81 </tr>
82 </table>
83 <xsl:call-template name="dividerBar"/>
84
85 </center>
86
87 <!-- end of page banner -->
88
89 </xsl:template>
90
91 <xsl:template name="greenstoneFooter">
92 <center>
93 <p/>
94 <small>powered by greenstone3</small>
95 </center>
96 </xsl:template>
97
98 <xsl:template name="standardPageBanner">
99 <xsl:param name="collName"/>
100 <xsl:param name="pageType"/>
101 <xsl:variable name="this-element" select="/page/pageResponse/collection|/page/pageResponse/serviceCluster"/>
102 <table width="100%">
103 <tr>
104 <td align="left">
105 <a href="{$library_name}?a=p&amp;sa=about&amp;c={$collName}">
106 <xsl:choose>
107 <xsl:when test="$this-element/displayItem[@name='icon']">
108 <img border="0">
109 <xsl:attribute name="src">
110 <xsl:value-of select="$this-element/metadataList/metadata[@name='httpPath']"/>/images/<xsl:value-of select="$this-element/displayItem[@name='icon']"/>
111 </xsl:attribute>
112 <xsl:attribute name="alt">
113 <xsl:value-of select="$this-element/displayItem[@name='name']"/>
114 </xsl:attribute>
115 <xsl:attribute name="title">
116 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'aboutpage')"/>
117 </xsl:attribute>
118 </img>
119 </xsl:when>
120 <xsl:otherwise>
121 <b><xsl:value-of select="$this-element/displayItem[@name='name']"/></b>
122 </xsl:otherwise>
123 </xsl:choose>
124 </a>
125 </td>
126 <td align="right">
127 <table cellspacing='4'>
128 <tr>
129 <td xsl:use-attribute-sets="td-brownbutton">
130 <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>
131 <b><font color='{$colour-button-text}'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_b')"/></font></b>
132 </a>
133 </td>
134 <xsl:choose>
135 <xsl:when test="$pageType='help'">
136 <td xsl:use-attribute-sets="td-brownbutton-off">
137 <b><font color='{$colour-button-text}'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/></font></b>
138 </td>
139 </xsl:when>
140 <xsl:otherwise>
141 <td xsl:use-attribute-sets="td-brownbutton">
142 <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>
143 <b><font color='{$colour-button-text}'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/></font></b>
144 </a>
145 </td>
146 </xsl:otherwise>
147 </xsl:choose>
148 <xsl:choose>
149 <xsl:when test="$pageType='pref'">
150 <td xsl:use-attribute-sets="td-brownbutton-off">
151 <b><font color='{$colour-button-text}'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/></font></b>
152 </td>
153 </xsl:when>
154 <xsl:otherwise>
155 <td xsl:use-attribute-sets="td-brownbutton">
156 <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>
157 <b><font color='{$colour-button-text}'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/></font></b>
158 </a>
159 </td>
160 </xsl:otherwise>
161 </xsl:choose>
162 </tr>
163 </table>
164 </td>
165 </tr>
166 </table>
167 <p/>
168 </xsl:template>
169
170 <xsl:template name="navigationBar">
171 <xsl:param name="collName"/>
172 <xsl:variable name="this-element" select="/page/pageResponse/collection|/page/pageResponse/serviceCluster"/>
173 <xsl:variable name="this-service" select="/page/pageResponse/service/@name"/>
174 <table border='0' cellspacing='0' width='100%'>
175 <tr>
176 <xsl:for-each select="$this-element/serviceList/service">
177 <xsl:variable name="action"><xsl:choose>
178 <xsl:when test="@name=$this-service">CURRENT</xsl:when>
179 <xsl:when test="@type='query'">q</xsl:when>
180 <xsl:when test="@type='browse'">b</xsl:when>
181 <xsl:when test="@type='process'">pr</xsl:when>
182 <xsl:when test="@type='applet'">a</xsl:when>
183 <xsl:otherwise>DO_NOT_DISPLAY</xsl:otherwise>
184 </xsl:choose></xsl:variable>
185 <xsl:choose>
186 <xsl:when test="$action='CURRENT'">
187 <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>
188 </xsl:when>
189 <xsl:when test="$action !='DO_NOT_DISPLAY'">
190 <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>
191 </xsl:when>
192 </xsl:choose>
193 </xsl:for-each>
194 </tr>
195 </table>
196 <br/>
197 </xsl:template>
198
199
200 <xsl:template name="dividerBar">
201 <xsl:param name='text'/>
202 <br/><table width='100%' border="0" cellpadding="0" cellspacing="0">
203 <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/>
204 </xsl:template>
205
206 <!-- Display the appropriate image, depending on the node type -->
207 <xsl:template match="documentNode" mode="displayNodeIcon">
208
209 <!-- Root node: book icon (open or closed) -->
210 <xsl:choose>
211 <xsl:when test="@nodeType='root'">
212 <xsl:choose>
213 <xsl:when test="documentNode">
214 <img border="0" width="28" height="23"
215 src="interfaces/default/images/openbook.gif"
216 alt="Close this book"/>
217 </xsl:when>
218 <xsl:otherwise>
219 <img border="0" width="18" height="11"
220 src="interfaces/default/images/book.gif"
221 alt="Open this document and view contents"/>
222 </xsl:otherwise>
223 </xsl:choose>
224 </xsl:when>
225
226 <!-- Interior node: folder icon (open or closed) -->
227 <xsl:when test="@nodeType='interior'">
228 <xsl:choose>
229 <xsl:when test="documentNode">
230 <img border="0" width="23" height="15"
231 src="interfaces/default/images/openfldr.gif"
232 alt="Close this folder"/>
233 </xsl:when>
234 <xsl:otherwise>
235 <img border="0" width="23" height="15"
236 src="interfaces/default/images/clsdfldr.gif"
237 alt="Open this folder and view contents"/>
238 </xsl:otherwise>
239 </xsl:choose>
240 </xsl:when>
241
242 <!-- Leaf node: page icon, and this is the default -->
243 <xsl:otherwise>
244 <img border="0" width="16" height="21"
245 src="interfaces/default/images/itext.gif"
246 alt="View the document"/>
247 </xsl:otherwise>
248 </xsl:choose>
249 </xsl:template>
250
251</xsl:stylesheet>
252
253
Note: See TracBrowser for help on using the repository browser.