-
Notifications
You must be signed in to change notification settings - Fork 0
/
Common.xsl
223 lines (215 loc) · 11.7 KB
/
Common.xsl
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
222
223
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="tagList">
<xsl:param name="name">tagAsked</xsl:param>
<xsl:param name="style">none</xsl:param>
<xsl:param name="size">7</xsl:param>
<xsl:param name="mode">TAG_USED</xsl:param>
<xsl:param name="mode2">NONE</xsl:param>
<xsl:param name="type">all</xsl:param>
<xsl:param name="incMinor">false</xsl:param>
<xsl:param name="box">MULTIPLE</xsl:param>
<xsl:param name="onChange"></xsl:param>
<xsl:param name="id"></xsl:param>
<xsl:param name="class"></xsl:param>
<xsl:param name="setRel">false</xsl:param>
<xsl:if test="not(@box) or @box = $box">
<xsl:if test="not(@mode) or @mode = $mode">
<xsl:if test="who|what|where">
<xsl:if test="$style = 'list' or $style = 'multiple'">
<select>
<xsl:if test="$style = 'multiple'">
<xsl:attribute name="multiple">yes</xsl:attribute>
<xsl:attribute name="size"><xsl:value-of select="$size" /></xsl:attribute>
</xsl:if>
<xsl:if test="not($onChange = '')">
<xsl:attribute name="onChange"><xsl:value-of select="$onChange" /></xsl:attribute>
</xsl:if>
<xsl:if test="not($id = '')">
<xsl:attribute name="id"><xsl:value-of select="$id" /></xsl:attribute>
</xsl:if>
<xsl:if test="not($class = '')">
<xsl:attribute name="class"><xsl:value-of select="$class" /></xsl:attribute>
</xsl:if>
<xsl:attribute name="name"><xsl:value-of select="$name"/></xsl:attribute>
<xsl:if test="$style = 'list'">
<option value="-1">==========</option>
</xsl:if>
<xsl:if test="not(@mode) or @mode = $mode">
<optgroup label="Who">
<xsl:apply-templates select="who">
<xsl:with-param name="style"><xsl:value-of select="$style" /></xsl:with-param>
<xsl:with-param name="type"><xsl:value-of select="$type" /></xsl:with-param>
<xsl:with-param name="incMinor"><xsl:value-of select="$incMinor" /></xsl:with-param>
</xsl:apply-templates>
</optgroup>
<optgroup label="What">
<xsl:apply-templates select="what">
<xsl:with-param name="style"><xsl:value-of select="$style" /></xsl:with-param>
<xsl:with-param name="type"><xsl:value-of select="$type" /></xsl:with-param>
<xsl:with-param name="incMinor"><xsl:value-of select="$incMinor" /></xsl:with-param>
</xsl:apply-templates>
</optgroup>
<optgroup label="Where">
<xsl:apply-templates select="where">
<xsl:with-param name="style"><xsl:value-of select="$style" /></xsl:with-param>
<xsl:with-param name="type"><xsl:value-of select="$type" /></xsl:with-param>
<xsl:with-param name="incMinor"><xsl:value-of select="$incMinor" /></xsl:with-param>
</xsl:apply-templates>
</optgroup>
</xsl:if>
<xsl:if test="not($mode2 = 'NONE')">
<xsl:if test="not(../tags[@mode = $mode2]/*)">
<optgroup>
<xsl:attribute name="label">--- <xsl:value-of select="$mode2" /> ---</xsl:attribute>
<xsl:apply-templates select="../tagList[@mode = $mode2]/*">
<xsl:with-param name="style"><xsl:value-of select="$style" /></xsl:with-param>
<xsl:with-param name="type"><xsl:value-of select="$type" /></xsl:with-param>
<xsl:with-param name="incMinor"><xsl:value-of select="$incMinor" /></xsl:with-param>
</xsl:apply-templates>
</optgroup>
</xsl:if>
</xsl:if>
</select>
</xsl:if>
<xsl:if test="not($style = 'list' or $style = 'multiple')">
<div class="tags">
<xsl:apply-templates select="who">
<xsl:with-param name="type"><xsl:value-of select="$type" /></xsl:with-param>
<xsl:with-param name="style"><xsl:value-of select="$style" /></xsl:with-param>
<xsl:with-param name="incMinor"><xsl:value-of select="$incMinor" /></xsl:with-param>
<xsl:with-param name="setRel"><xsl:value-of select="$setRel" /></xsl:with-param>
</xsl:apply-templates>
<xsl:apply-templates select="author">
<xsl:with-param name="type"><xsl:value-of select="$type" /></xsl:with-param>
<xsl:with-param name="style"><xsl:value-of select="$style" /></xsl:with-param>
<xsl:with-param name="incMinor"><xsl:value-of select="$incMinor" /></xsl:with-param>
<xsl:with-param name="setRel"><xsl:value-of select="$setRel" /></xsl:with-param>
</xsl:apply-templates>
<xsl:apply-templates select="what">
<xsl:with-param name="type"><xsl:value-of select="$type" /></xsl:with-param>
<xsl:with-param name="style"><xsl:value-of select="$style" /></xsl:with-param>
<xsl:with-param name="incMinor"><xsl:value-of select="$incMinor" /></xsl:with-param>
<xsl:with-param name="setRel"><xsl:value-of select="$setRel" /></xsl:with-param>
</xsl:apply-templates>
<xsl:apply-templates select="where">
<xsl:with-param name="type"><xsl:value-of select="$type" /></xsl:with-param>
<xsl:with-param name="style"><xsl:value-of select="$style" /></xsl:with-param>
<xsl:with-param name="incMinor"><xsl:value-of select="$incMinor" /></xsl:with-param>
<xsl:with-param name="setRel"><xsl:value-of select="$setRel" /></xsl:with-param>
</xsl:apply-templates>
</div>
</xsl:if>
</xsl:if>
</xsl:if>
</xsl:if>
</xsl:template>
<xsl:template match="where|what|who|author">
<xsl:param name="type">all</xsl:param>
<xsl:param name="style">none</xsl:param>
<xsl:param name="incMinor">false</xsl:param>
<xsl:param name="setRel">false</xsl:param>
<xsl:if test="(@minor and $incMinor = 'true') or not(@minor)">
<xsl:if test="$type = 'all' or $type = name(.)">
<xsl:if test="$style = 'list' or $style = 'multiple'">
<option>
<xsl:attribute name="value"><xsl:value-of select="@id"/></xsl:attribute>
<xsl:if test="@checked = 'true'">
<xsl:attribute name="selected">selected</xsl:attribute>
</xsl:if>
<!--[<xsl:value-of select="name(.)"/>]--><xsl:if test="@minor">(</xsl:if><xsl:value-of select="name"/><xsl:if test="@minor">)</xsl:if>
</option>
</xsl:if>
<xsl:if test="not($style = 'list' or $style = 'multiple')">
<a class="tag_link">
<xsl:if test="$setRel != 'false'">
<xsl:attribute name="rel"><xsl:value-of select="@id"/></xsl:attribute>
</xsl:if>
<xsl:attribute name="href">Tag__<xsl:value-of select="@id"/>__<xsl:value-of select="name"/></xsl:attribute>
<xsl:if test="birthdate">
<xsl:attribute name="title"><xsl:value-of select="birthdate"/> ans</xsl:attribute>
</xsl:if>
<xsl:if test="@minor">(</xsl:if>
<xsl:value-of select="name"/>
<xsl:if test="@minor">)</xsl:if>
</a>
<xsl:if test="position() != last()">, </xsl:if><xsl:if test="position() = last() and name(.) = 'who' and (count(../what)!= 0 or count(../where) != 0)">, </xsl:if><xsl:if test="position() = last() and name(.) = 'what' and count(../where) != 0">, </xsl:if>
</xsl:if>
</xsl:if>
</xsl:if>
</xsl:template>
<xsl:template match="exception">
<b><xsl:value-of select="."/></b><br/>
</xsl:template>
<xsl:template match="message">
<i><xsl:value-of select="."/></i><br/>
</xsl:template>
<xsl:template name="get_validate_addr">
<xsl:param name="to_add"></xsl:param>
<xsl:if test="../return_to/name = 'Photos'"><xsl:value-of select="../return_to/name"/>?<xsl:value-of select="$to_add" />&id=<xsl:value-of select="@id" />&page=<xsl:value-of select="../return_to/page" />&album=<xsl:value-of select="../return_to/album" />&albmPage=<xsl:value-of select="../return_to/albmPage" />#<xsl:value-of select="@id" /></xsl:if>
<xsl:if test="../return_to/name = 'Tags' "><xsl:value-of select="../return_to/name"/>?<xsl:value-of select="$to_add" />&id=<xsl:value-of select="@id" />&page=<xsl:value-of select="../return_to/page" /><xsl:for-each select="../return_to/tagsAsked">&tagAsked=<xsl:value-of select="." /></xsl:for-each>#<xsl:value-of select="@id" /></xsl:if>
</xsl:template>
<xsl:template match="page">
<div class="item">
<div class="body">
<div class="pagination">
<xsl:apply-templates select="@previ"/>
<xsl:apply-templates select="@first"/>
<xsl:if test="@first"><span>...</span></xsl:if>
<xsl:apply-templates select="prev"/>
<xsl:if test="@first or @last or prev or next"><span class="current"><xsl:value-of select="@current" /> </span></xsl:if>
<xsl:apply-templates select="next"/>
<xsl:if test="@last">... </xsl:if>
<xsl:apply-templates select="@last"/>
<xsl:apply-templates select="@nexti"/>
</div>
</div>
</div>
</xsl:template>
<xsl:template match="prev|next|@nexti|@previ|@first|@last">
<a>
<xsl:if test="/webAlbums/photos">
<xsl:attribute name="href">Photos__<xsl:value-of select="../url/album" />_p<xsl:value-of select="." /><xsl:if test="not(/webAlbums/affichage/@static)">_pa<xsl:value-of select="/webAlbums/photos/display/photoList/page/url/albmPage" /></xsl:if>__<xsl:value-of select="/webAlbums/photos/display/album/title" /></xsl:attribute>
</xsl:if>
<xsl:if test="/webAlbums/albums">
<xsl:attribute name="href">Albums__p<xsl:value-of select="."/></xsl:attribute>
</xsl:if>
<xsl:if test="/webAlbums/tags">
<xsl:attribute name="href">Tag<xsl:for-each select="/webAlbums/tags/display/title/tagList/*">__<xsl:value-of select="@id" /></xsl:for-each><xsl:if test=". != '0'">_p<xsl:value-of select="." /></xsl:if><xsl:for-each select="/webAlbums/tags/display/title/tagList/*">__<xsl:value-of select="name" /></xsl:for-each></xsl:attribute>
</xsl:if>
<xsl:if test="name(.) = 'nexti'">Next »</xsl:if>
<xsl:if test="name(.) = 'previ'">« Previous</xsl:if>
<xsl:if test="not(name(.) = 'nexti') and not (name(.) = 'previ')"><xsl:value-of select="." /></xsl:if>
</a>
</xsl:template>
<xsl:template name="print_return_link">
<div class="item">
<div class="content">
<div class="return">
<a>
<xsl:attribute name="href">
<xsl:if test="/webAlbums/photos/display">
Albums__p<xsl:value-of select="/webAlbums/photos/display/photoList/page/url/albmPage" />#<xsl:value-of select="/webAlbums/photos/display/album/@id" />
</xsl:if>
<xsl:if test="/webAlbums/albums or /webAlbums/tags or /webAlbums/config">
Choix<xsl:if test="/webAlbums/affichage/@static">__<xsl:value-of select="/webAlbums/loginInfo/themeid" />__<xsl:value-of select="/webAlbums/loginInfo/theme" /></xsl:if>
</xsl:if>
</xsl:attribute>
<xsl:if test="/webAlbums/photos/display">Retour aux Albums</xsl:if>
<xsl:if test="/webAlbums/albums or /webAlbums/tags or /webAlbums/config">Retour au Choix</xsl:if>
</a>
</div>
</div>
</div>
</xsl:template>
<xsl:template match="exif">
<table>
<xsl:for-each select="./*">
<tr>
<th><xsl:value-of select="name"/></th>
<td><xsl:value-of select="value"/></td>
</tr>
</xsl:for-each>
</table>
</xsl:template>
</xsl:stylesheet>