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

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

made a lot of changes, cant remember tham all. config stuff is now global params, translate stuff is now done on the fly using java and XSLTUtil, redoing the document display stuff so that it switches automatically between toc, page nav, and just displaying the text

  • Property svn:keywords set to Author Date Id Revision
File size: 5.4 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 <!-- the main page layout template is here -->
14 <xsl:template match="page">
15 <html>
16 <xsl:call-template name="pageHead"/>
17 <body xsl:use-attribute-sets="body-style">
18 <table border="0" cellspacing="0" cellpadding="0" width="100%">
19 <td valign="top" width="65">
20 <img src="interfaces/default/images/spacer.gif" width="65" height="1" alt="" border="0"/>
21 </td>
22 <td>
23 <center>
24 <table width="537">
25 <tr/>
26 <td/>
27 <xsl:apply-templates select="pageResponse"/>
28 <xsl:call-template name="greenstoneFooter"/>
29 </table>
30 </center>
31 </td>
32 </table>
33 </body>
34 </html>
35 </xsl:template>
36
37 <xsl:attribute-set name="body-style">
38 <xsl:attribute name="bgcolor">#ffffff</xsl:attribute>
39 <xsl:attribute name="text">#000000</xsl:attribute>
40 <xsl:attribute name="link">#006666</xsl:attribute>
41 <xsl:attribute name="alink">#cc9900</xsl:attribute>
42 <xsl:attribute name="vlink">#666633</xsl:attribute>
43 <xsl:attribute name="background">interfaces/default/images/chalk.gif</xsl:attribute>
44 </xsl:attribute-set>
45
46 <xsl:template name="greenstonePageBanner">
47 <center>
48 <table width="537" cellspacing="0" cellpadding="0">
49 <tr valign="top">
50 <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>
51 <td align="right"></td>
52 </tr>
53
54 <tr>
55 <td align="right"></td>
56 </tr>
57
58 <tr>
59 <td colspan="2"></td>
60 </tr>
61 </table>
62 <xsl:call-template name="greenBar"/>
63
64 </center>
65
66 <!-- end of page banner -->
67
68 </xsl:template>
69
70 <xsl:template name="greenstoneFooter">
71 <center>
72 <p/>
73 <small>powered by greenstone3</small>
74 </center>
75 </xsl:template>
76
77 <!-- just pass in collname cos use it everywhere - saves working it out lots of times -->
78 <xsl:template name="collectionPageBanner">
79 <xsl:param name="collName"/>
80 <xsl:variable name="httpPath" select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>
81 <xsl:variable name="colIcon" select="/page/pageResponse/collection/metadataList/metadata[@name='colIcon']"/>
82 <table width="537">
83 <tr>
84 <td align="left">
85 <a href="{$library_name}?a=p&amp;sa=about&amp;c={$collName}">
86 <img width="150" border="0">
87 <xsl:attribute name="src">
88 <xsl:value-of select="$httpPath"/>/images/<xsl:value-of select="$colIcon"/>
89 </xsl:attribute>
90 <xsl:attribute name="alt">
91 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'aboutpage')"/>
92 </xsl:attribute>
93 </img>
94 </a>
95 </td>
96 <td align="right">
97 <a href="{$library_name}?a=p&amp;sa=home">
98 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home')"/>
99 </a>
100 </td>
101 </tr>
102 </table>
103
104 <xsl:call-template name="greenBar"/>
105 </xsl:template>
106
107
108 <!-- do we want different stuff for cluster or same as collection -->
109 <xsl:template name="clusterPageBanner">
110 <xsl:param name="clusterName"/>
111 <table width="537">
112 <tr><td align="left"><a href="{$library_name}?a=p&amp;sa=about&amp;c={$clusterName}"><xsl:value-of select="$clusterName"/></a></td><td align="right"><a href="{$library_name}?a=p&amp;sa=home"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home')"/></a></td></tr></table>
113
114 <xsl:call-template name="greenBar"/>
115 </xsl:template>
116
117 <xsl:template name="greenBar">
118 <p/><img src="interfaces/default/images/divb.gif" width="537" height="17"/>
119 </xsl:template>
120
121
122
123 <!-- Display the appropriate image, depending on the node type -->
124 <xsl:template match="documentNode" mode="displayNodeIcon">
125
126 <!-- Root node: book icon (open or closed) -->
127 <xsl:if test="@nodeType='root'">
128 <xsl:choose>
129 <xsl:when test="documentNode">
130 <img border="0" width="28" height="23"
131 src="interfaces/default/images/openbook.gif"
132 alt="Close this book"/>
133 </xsl:when>
134 <xsl:otherwise>
135 <img border="0" width="18" height="11"
136 src="interfaces/default/images/book.gif"
137 alt="Open this document and view contents"/>
138 </xsl:otherwise>
139 </xsl:choose>
140 </xsl:if>
141
142 <!-- Interior node: folder icon (open or closed) -->
143 <xsl:if test="@nodeType='interior'">
144 <xsl:choose>
145 <xsl:when test="documentNode">
146 <img border="0" width="23" height="15"
147 src="interfaces/default/images/openfldr.gif"
148 alt="Close this folder"/>
149 </xsl:when>
150 <xsl:otherwise>
151 <img border="0" width="23" height="15"
152 src="interfaces/default/images/clsdfldr.gif"
153 alt="Open this folder and view contents"/>
154 </xsl:otherwise>
155 </xsl:choose>
156 </xsl:if>
157
158 <!-- Leaf node: page icon -->
159 <xsl:if test="@nodeType='leaf'">
160 <img border="0" width="16" height="21"
161 src="interfaces/default/images/itext.gif"
162 alt="View the document"/>
163 </xsl:if>
164 </xsl:template>
165
166</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.