blob: dfe8c789a2f9523ca4dec17f5d719253b36867df (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
|
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE stylesheet [
<!ENTITY raquo "»" >
<!ENTITY blank " " >
]>
<xsl:transform version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exsl="http://exslt.org/common"
extension-element-prefixes="exsl">
<!-- ********************************************************************* -->
<!-- ** Create single image page for each imag ** -->
<!-- ********************************************************************* -->
<xsl:template name="createImagePage">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><xsl:value-of select="title"/></title>
<link rel="stylesheet" type="text/css">
<xsl:attribute name="href">../cleanframes/<xsl:value-of select="$style"/></xsl:attribute>
</link>
</head>
<body id="imagePage">
<table border="0" width="100%">
<tr>
<td align="center">
<img src="{full/@fileName}" width="{full/@width}" height="{full/@height}" />
<xsl:if test="original/@fileName != ''">
<p>
<a href="{original/@fileName}"><xsl:value-of select="$i18nOriginalImage"/></a>
(<xsl:value-of select="original/@width"/>x<xsl:value-of select="original/@height"/>)
</p>
</xsl:if>
ยด </td>
</tr>
</table>
<div id="caption">
<xsl:value-of select="description"/>
</div>
</body>
</html>
</xsl:template>
<!-- ********************************************************************* -->
<!-- ** Create thumbnail page for each collection ** -->
<!-- ********************************************************************* -->
<xsl:template name="createThumbnailPage">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><xsl:value-of select="name"/></title>
<link rel="stylesheet" type="text/css">
<xsl:attribute name="href">cleanframes/<xsl:value-of select="$style"/></xsl:attribute>
</link>
</head>
<h1>
<span>
<xsl:value-of select="name"/>
</span>
</h1>
<body id="collectionPage">
<ul>
<xsl:variable name="folder" select='fileName'/>
<xsl:for-each select="image">
<li>
<a href="{$folder}/{full/@fileName}.html" target="image">
<img src="{$folder}/{thumbnail/@fileName}" width="{thumbnail/@width}" height="{thumbnail/@height}"/>
</a><br/>
(<xsl:value-of select="position()"/>/<xsl:value-of select="last()"/>)
</li>
<exsl:document href='{$folder}/{full/@fileName}.html'>
<xsl:call-template name="createImagePage"/>
</exsl:document>
</xsl:for-each>
</ul>
</body>
</html>
</xsl:template>
<!-- ********************************************************************* -->
<!-- ** Create frameset page if only one collection ** -->
<!-- ********************************************************************* -->
<xsl:template name="createFrameSetPage">
<!-- ** create variable tsize for the width of the thumbnails frame ** -->
<!-- ** add 10 pixel to tsize for the border around the thumbnail ** -->
<xsl:variable name="tsize" select="3*(image[1]/thumbnail/@width + 18) + 65"/>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>
<xsl:value-of select="name"/>
</title>
<link rel="stylesheet" type="text/css">
<xsl:attribute name="href">cleanframes/<xsl:value-of select="$style"/></xsl:attribute>
</link>
</head>
<frameset cols="{$tsize},*" noresize="1" border="0">
<frame src="thmbs.html" name="mythmbs"/>
<frame src="blank.html" name="image"/>
</frameset>
<exsl:document href="thmbs.html">
<xsl:call-template name="createThumbnailPage"/>
</exsl:document>
</html>
</xsl:template>
<!-- ********************************************************************* -->
<!-- ** Create the collection index page when more than one collection ** -->
<!-- ********************************************************************* -->
<xsl:template name="createCollectionIndexPage">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><xsl:value-of select="$i18nCollectionList"/></title>
<link rel="stylesheet" type="text/css">
<xsl:attribute name="href">cleanframes/<xsl:value-of select="$style"/></xsl:attribute>
</link>
</head>
<body id="collectPage">
<xsl:for-each select="collections/collection">
␣
<a href="Thmbs{fileName}.html" target="mythmbs">
<xsl:value-of select="name"/>
</a>
<xsl:for-each select="image">
<xsl:choose>
<xsl:when test="position()=last()">
(<xsl:value-of select="last()"/>)
</xsl:when>
</xsl:choose>
</xsl:for-each>
<exsl:document href="Thmbs{fileName}.html">
<xsl:call-template name="createThumbnailPage"/>
</exsl:document>
</xsl:for-each>
</body>
</html>
</xsl:template>
<!-- ********************************************************************* -->
<!-- ** Create the frameset page when more than one collection ** -->
<!-- ********************************************************************* -->
<xsl:template name="createCollectionFrameSetPage">
<!-- ** create variable tsize for the width of the thumbnails frame ** -->
<!-- ** add 10 pixel to tsize for the border around the thumbnail ** -->
<xsl:variable name="tsize" select="3*(collections/collection[1]/image[1]/thumbnail/@width + 18) + 65"/>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>
<xsl:value-of select="name"/>
</title>
<link rel="stylesheet" type="text/css">
<xsl:attribute name="href">cleanframes/<xsl:value-of select="$style"/></xsl:attribute>
</link>
</head>
<frameset rows="40,*" noresize="1" border="0">
<frame src="collect.html" name="collection"/>
<frameset cols="{$tsize},*" noresize="1" border="0">
<frame src="blank.html" name="mythmbs"/>
<frame src="blank.html" name="image"/>
</frameset>
</frameset>
</html>
<exsl:document href="collect.html">
<xsl:call-template name="createCollectionIndexPage"/>
</exsl:document>
</xsl:template>
<!-- ********************************************************************* -->
<!-- ** Create a blank page ** -->
<!-- ** as a starting page when more than one collection is used ** -->
<!-- ********************************************************************* -->
<xsl:template name="createBlankPage">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>
<xsl:value-of select="name"/>
</title>
<link rel="stylesheet" type="text/css">
<xsl:attribute name="href">cleanframes/<xsl:value-of select="$style"/></xsl:attribute>
</link>
</head>
<body id="collectionPage">
<xsl:value-of select="title"/>
</body>
</html>
</xsl:template>
<!-- ********************************************************************* -->
<!-- ** the beginning of all ** -->
<!-- ********************************************************************* -->
<xsl:template match="/">
<xsl:choose>
<xsl:when test="count(collections/collection) > 1">
<xsl:call-template name="createCollectionFrameSetPage"/>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="collections/collection">
<xsl:call-template name="createFrameSetPage"/>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
<exsl:document href="blank.html">
<xsl:call-template name="createBlankPage"/>
</exsl:document>
</xsl:template>
</xsl:transform>
|