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 | xmlns:gslib="http://www.greenstone.org/skinning"
|
---|
7 | xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat"
|
---|
8 | extension-element-prefixes="java util"
|
---|
9 | exclude-result-prefixes="java util gsf">
|
---|
10 |
|
---|
11 | <!-- use the 'main' layout -->
|
---|
12 | <xsl:import href="layouts/main.xsl"/>
|
---|
13 |
|
---|
14 | <!-- style includes global params interface_name, library_name -->
|
---|
15 | <xsl:include href=".old/berrytools.xsl"/>
|
---|
16 |
|
---|
17 | <xsl:variable name="bookswitch">
|
---|
18 | <xsl:choose>
|
---|
19 | <xsl:when test="/page/pageRequest/paramList/param[@name='book']/@value">
|
---|
20 | <xsl:value-of select="/page/pageRequest/paramList/param[@name='book']/@value"/>
|
---|
21 | </xsl:when>
|
---|
22 | <xsl:otherwise>off</xsl:otherwise>
|
---|
23 | </xsl:choose>
|
---|
24 | </xsl:variable>
|
---|
25 |
|
---|
26 | <!-- set page title -->
|
---|
27 | <xsl:template name="pageTitle"><gslib:documentTitle/></xsl:template>
|
---|
28 |
|
---|
29 | <!-- set page breadcrumbs -->
|
---|
30 | <xsl:template name="breadcrumbs">
|
---|
31 | <gslib:siteLink/><gslib:rightArrow/>
|
---|
32 | <gslib:collectionNameLinked/><gslib:rightArrow/>
|
---|
33 | <a>
|
---|
34 | <xsl:attribute name="href">
|
---|
35 | <xsl:value-of select="$library_name"/>?a=d&c=<xsl:value-of select="$collName"/>&d=<xsl:value-of select="/page/pageResponse/document/documentNode[1]/@nodeID"/>&dt=<xsl:value-of select="/page/pageResponse/document/documentNode/@docType"/>&p.a=b&p.s=<xsl:value-of select="/page/pageResponse/service/@name"/>
|
---|
36 | </xsl:attribute>
|
---|
37 | <xsl:variable name="documentTitleVar">
|
---|
38 | <gslib:documentTitle/>
|
---|
39 | </xsl:variable>
|
---|
40 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.document')"/>
|
---|
41 | </a>
|
---|
42 | </xsl:template>
|
---|
43 |
|
---|
44 | <xsl:template match="/">
|
---|
45 | <xsl:choose>
|
---|
46 | <!-- if this is the realistic books version of the page -->
|
---|
47 | <xsl:when test="$bookswitch = 'flashxml'">
|
---|
48 | <html>
|
---|
49 | <body>
|
---|
50 | <xsl:apply-templates select="/page/pageResponse/document"/>
|
---|
51 | </body>
|
---|
52 | </html>
|
---|
53 | </xsl:when>
|
---|
54 | <!-- if this is the regular version of the page -->
|
---|
55 | <xsl:otherwise>
|
---|
56 | <xsl:apply-imports/>
|
---|
57 | </xsl:otherwise>
|
---|
58 | </xsl:choose>
|
---|
59 | </xsl:template>
|
---|
60 |
|
---|
61 | <!-- Used to make sure that regardless what the collection designer uses for the title and content we can wrap it properly -->
|
---|
62 | <!-- If editing, be aware that the Document Basket looks for specific classes that this template bakes in (key points marked with ***) -->
|
---|
63 | <xsl:template name="wrapDocumentNodes">
|
---|
64 | <xsl:for-each select="documentNode">
|
---|
65 | <a name="{@nodeID}"><xsl:text> </xsl:text></a>
|
---|
66 | <!-- Section header -->
|
---|
67 | <table class="sectionHeader"><tr>
|
---|
68 |
|
---|
69 | <!-- Expand/collapse button -->
|
---|
70 | <td class="headerTD">
|
---|
71 | <img id="dtoggle{@nodeID}" onclick="toggleSection('{@nodeID}');" class="icon">
|
---|
72 | <xsl:attribute name="src">
|
---|
73 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'collapse_image')"/>
|
---|
74 | </xsl:attribute>
|
---|
75 | </img>
|
---|
76 | </td>
|
---|
77 |
|
---|
78 | <!-- Title -->
|
---|
79 | <td id="header{@nodeID}" class="headerTD sectionTitle"><!-- *** -->
|
---|
80 | <!-- Get the title from the title sectionTitle template -->
|
---|
81 | <xsl:choose>
|
---|
82 | <xsl:when test="not(/page/pageRequest/paramList/param[@name = 'dmd']) or /page/pageRequest/paramList/param[@name = 'dmd']/@value = 'false'">
|
---|
83 | <xsl:apply-templates select="." mode="sectionTitleFormat"/>
|
---|
84 | </xsl:when>
|
---|
85 | <xsl:otherwise>
|
---|
86 | <xsl:apply-templates select="." mode="sectionTitle"/>
|
---|
87 | </xsl:otherwise>
|
---|
88 | </xsl:choose>
|
---|
89 | </td>
|
---|
90 |
|
---|
91 | <!-- "back to top" link -->
|
---|
92 | <xsl:if test="util:hashToDepthClass(@nodeID) != 'sectionHeaderDepthTitle'">
|
---|
93 | <td class="backToTop headerTD">
|
---|
94 | <a href="#top">
|
---|
95 | <xsl:text disable-output-escaping="yes">▲</xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.back_to_top')"/>
|
---|
96 | </a>
|
---|
97 | </td>
|
---|
98 | </xsl:if>
|
---|
99 | </tr></table>
|
---|
100 |
|
---|
101 | <div id="doc{@nodeID}" class="sectionContainer" style="display:block;"><!-- *** -->
|
---|
102 | <xsl:if test="/page/pageRequest/paramList/param[@name = 'dmd']/@value = 'true'">
|
---|
103 | <table id="meta{@nodeID}">
|
---|
104 | <xsl:for-each select="metadataList/metadata">
|
---|
105 | <xsl:sort select="@name"/>
|
---|
106 | <tr>
|
---|
107 | <td class="metaTableCellName"><xsl:value-of select="@name"/></td>
|
---|
108 | <td class="metaTableCell editable"><xsl:value-of select="."/></td>
|
---|
109 | </tr>
|
---|
110 | </xsl:for-each>
|
---|
111 | </table>
|
---|
112 | </xsl:if>
|
---|
113 | <div id="text{@nodeID}" class="sectionText"><!-- *** -->
|
---|
114 | <!-- Get the section content from the document template -->
|
---|
115 | <xsl:apply-templates select="." mode="document"/>
|
---|
116 | </div>
|
---|
117 | <xsl:if test="documentNode">
|
---|
118 | <xsl:call-template name="wrapDocumentNodes"/>
|
---|
119 | </xsl:if>
|
---|
120 | </div>
|
---|
121 | </xsl:for-each>
|
---|
122 | </xsl:template>
|
---|
123 |
|
---|
124 | <!-- the page content -->
|
---|
125 | <xsl:template match="/page/pageResponse/document">
|
---|
126 | <xsl:if test="/page/pageRequest/paramList/param[@name = 'dmd']/@value = 'true'">
|
---|
127 | <gsf:metadata name="all"/>
|
---|
128 | </xsl:if>
|
---|
129 |
|
---|
130 | <xsl:if test="$bookswitch = 'off'">
|
---|
131 | <div id="bookdiv" style="visibility:hidden; height:0px; display:inline;"><xsl:text> </xsl:text></div>
|
---|
132 |
|
---|
133 | <script type="text/javascript" src="interfaces/{$interface_name}/js/document_scripts.js"><xsl:text> </xsl:text></script>
|
---|
134 |
|
---|
135 | <xsl:if test="/page/pageResponse/collection[@name = $collName]/metadataList/metadata[@name = 'tidyoption'] = 'tidy'">
|
---|
136 | <script type="text/javascript">
|
---|
137 | <xsl:text disable-output-escaping="yes">
|
---|
138 | if(document.URL.indexOf("book=on") != -1)
|
---|
139 | {
|
---|
140 | loadBook();
|
---|
141 | }
|
---|
142 | </xsl:text>
|
---|
143 | </script>
|
---|
144 | </xsl:if>
|
---|
145 |
|
---|
146 | <!-- show the little berries for this document -->
|
---|
147 | <xsl:call-template name="documentBerryForDocumentPage"/>
|
---|
148 |
|
---|
149 | <xsl:if test="/page/pageRequest/paramList/param[@name = 'documentbasket']/@value = 'on'">
|
---|
150 | <table style="width:100%"><tr><td style="width:70%"><xsl:text> </xsl:text></td>
|
---|
151 | <td>
|
---|
152 | <div style="text-align:center;">
|
---|
153 | <div class="ui-state-default ui-corner-all">
|
---|
154 | <a style="padding: 3px; text-decoration:none;" href="{$library_name}?a=g&sa=documentbasket&c=&s=DisplayDocumentList&rt=r&p.c={/page/pageResponse/collection/@name}&docToEdit={/page/pageResponse/document/documentNode/@nodeID}">Edit this document</a>
|
---|
155 | </div>
|
---|
156 | </div>
|
---|
157 | </td>
|
---|
158 | </tr></table>
|
---|
159 | </xsl:if>
|
---|
160 |
|
---|
161 | <xsl:if test="not(/page/pageResponse/format[@type='display']/gsf:option[@name='sideBar']) or /page/pageResponse/format[@type='display']/gsf:option[@name='sideBar']/@value='true'">
|
---|
162 | <table id="rightSidebar">
|
---|
163 | <tr><td>
|
---|
164 | <xsl:call-template name="viewOptions"/>
|
---|
165 | </td></tr>
|
---|
166 | <tr><td>
|
---|
167 | <div id="contentsArea">
|
---|
168 | <!-- show the berry basket if it's turned on -->
|
---|
169 | <gslib:berryBasket/>
|
---|
170 |
|
---|
171 | <!-- the book's cover image -->
|
---|
172 | <div id="coverImage">
|
---|
173 | <xsl:attribute name="class">
|
---|
174 | <xsl:choose>
|
---|
175 | <xsl:when test="not(/page/pageResponse/format[@type='display']/gsf:option[@name='coverImage']) or /page/pageResponse/format[@type='display']/gsf:option[@name='coverImage']/@value='true'">visible</xsl:when>
|
---|
176 | <xsl:otherwise>hidden</xsl:otherwise>
|
---|
177 | </xsl:choose>
|
---|
178 | </xsl:attribute>
|
---|
179 | <gslib:coverImage/><xsl:text> </xsl:text>
|
---|
180 | </div>
|
---|
181 |
|
---|
182 | <!-- the contents (if enabled) -->
|
---|
183 | <xsl:choose>
|
---|
184 | <xsl:when test="/page/pageResponse/document/@docType = 'paged' and not(/page/pageRequest/paramList/param[@name = 'ed']/@value = '1')">
|
---|
185 | <!-- Table of contents will be dynamically retrieved when viewing a paged document -->
|
---|
186 | <script type="text/javascript">
|
---|
187 | <xsl:text disable-output-escaping="yes">
|
---|
188 | retrieveTableOfContents();
|
---|
189 | </xsl:text>
|
---|
190 | </script>
|
---|
191 | </xsl:when>
|
---|
192 | <xsl:otherwise>
|
---|
193 | <div id="tableOfContents">
|
---|
194 | <xsl:attribute name="class">
|
---|
195 | <xsl:choose>
|
---|
196 | <xsl:when test="count(//documentNode) > 1 and not(/page/pageResponse/format[@type='display']/gsf:option[@name='TOC']) or /page/pageResponse/format[@type='display']/gsf:option[@name='TOC']/@value='true'">visible</xsl:when>
|
---|
197 | <xsl:otherwise>hidden</xsl:otherwise>
|
---|
198 | </xsl:choose>
|
---|
199 | </xsl:attribute>
|
---|
200 | <xsl:apply-templates select="documentNode" mode="TOC"/>
|
---|
201 | <xsl:if test="@docType = 'paged'">
|
---|
202 | <table style="width:100%;"><tbody><tr>
|
---|
203 | <td style="width:10%; text-align:left;"><a href="?a=d&ed=1&book=off&dt=paged&c={/page/pageResponse/collection/@name}&d={/page/pageResponse/document/documentNode/@nodeID}"><img src="interfaces/{$interface_name}/images/previous.png"/></a></td>
|
---|
204 | <td style="width:20%; text-align:left;"><a href="?a=d&ed=1&book=off&dt=paged&c={/page/pageResponse/collection/@name}&d={/page/pageResponse/document/documentNode/@nodeID}">Previous</a></td>
|
---|
205 | <td style="width:40%; text-align:center;"><xsl:text>Go to page</xsl:text><input type="text" size="3"/></td>
|
---|
206 | <td style="width:20%; text-align:right;"><a href="?a=d&ed=1&book=off&dt=paged&c={/page/pageResponse/collection/@name}&d={/page/pageResponse/document/documentNode/@nodeID}">Next</a></td>
|
---|
207 | <td style="width:10%; text-align:right;"><a href="?a=d&ed=1&book=off&dt=paged&c={/page/pageResponse/collection/@name}&d={/page/pageResponse/document/documentNode/@nodeID}"><img src="interfaces/{$interface_name}/images/next.png"/></a></td>
|
---|
208 | </tr></tbody></table>
|
---|
209 | </xsl:if>
|
---|
210 | </div>
|
---|
211 | </xsl:otherwise>
|
---|
212 | </xsl:choose>
|
---|
213 | </div>
|
---|
214 | </td></tr>
|
---|
215 | </table>
|
---|
216 | </xsl:if>
|
---|
217 | </xsl:if>
|
---|
218 |
|
---|
219 | <!-- display the document -->
|
---|
220 | <xsl:choose>
|
---|
221 | <xsl:when test="@external != ''">
|
---|
222 | <xsl:call-template name="externalPage">
|
---|
223 | <xsl:with-param name="external" select="@external"/>
|
---|
224 | </xsl:call-template>
|
---|
225 | </xsl:when>
|
---|
226 | <xsl:when test="$bookswitch = 'flashxml'">
|
---|
227 | <xsl:apply-templates mode="flashxml"/>
|
---|
228 | </xsl:when>
|
---|
229 | <xsl:when test="$bookswitch = 'on'">
|
---|
230 | <div id="bookdiv" style="display:inline;"><xsl:text> </xsl:text></div>
|
---|
231 | <!-- *** in document-scripts.js *** -->
|
---|
232 | <script type="text/javascript">
|
---|
233 | <xsl:text disable-output-escaping="yes">
|
---|
234 | if(document.URL.indexOf("book=on") != -1)
|
---|
235 | {
|
---|
236 | loadBook();
|
---|
237 | }
|
---|
238 | </xsl:text>
|
---|
239 | </script>
|
---|
240 | </xsl:when>
|
---|
241 | <xsl:otherwise>
|
---|
242 | <div id="gs-document">
|
---|
243 | <div id="gs-document-image">
|
---|
244 | <xsl:attribute name="class">
|
---|
245 | <xsl:text>sectionImage</xsl:text>
|
---|
246 | <xsl:if test="/page/pageRequest/paramList/param[@name = 'view']/@value = 'text'"><xsl:text> hidden</xsl:text></xsl:if>
|
---|
247 | </xsl:attribute>
|
---|
248 | <!-- Get the section content from the document template -->
|
---|
249 | <xsl:call-template name="documentImage"/>
|
---|
250 | <xsl:text> </xsl:text>
|
---|
251 | </div>
|
---|
252 | <div id="gs-document-text" collection="{/page/pageResponse/collection/@name}"><!-- *** -->
|
---|
253 | <xsl:attribute name="class">
|
---|
254 | <xsl:text>documenttext</xsl:text>
|
---|
255 | <xsl:if test="/page/pageRequest/paramList/param[@name = 'view']/@value = 'image'"><xsl:text> hidden</xsl:text></xsl:if>
|
---|
256 | </xsl:attribute>
|
---|
257 | <xsl:call-template name="wrapDocumentNodes"/>
|
---|
258 | </div>
|
---|
259 | </div>
|
---|
260 | </xsl:otherwise>
|
---|
261 | </xsl:choose>
|
---|
262 |
|
---|
263 | <div class="clear"><xsl:text> </xsl:text></div>
|
---|
264 | </xsl:template>
|
---|
265 |
|
---|
266 | <!-- Highlight annotations if requested -->
|
---|
267 | <xsl:template match="annotation">
|
---|
268 | <xsl:choose>
|
---|
269 | <xsl:when test="/page/pageRequest/paramList/param[@name='hl' and @value='on']">
|
---|
270 | <span class="termHighlight"><xsl:value-of select="."/></span>
|
---|
271 | </xsl:when>
|
---|
272 | <xsl:otherwise>
|
---|
273 | <span class="noTermHighlight"><xsl:value-of select="."/></span>
|
---|
274 | </xsl:otherwise>
|
---|
275 | </xsl:choose>
|
---|
276 | </xsl:template>
|
---|
277 |
|
---|
278 | <xsl:template match="documentNode" mode="sectionTitleFormat">
|
---|
279 | <p>
|
---|
280 | <xsl:attribute name="class"><xsl:value-of select="util:hashToDepthClass(@nodeID)"/> sectionHeader</xsl:attribute>
|
---|
281 |
|
---|
282 | <xsl:if test="util:hashToSectionId(@nodeID)">
|
---|
283 | <span class="sectionNumberSpan">
|
---|
284 | <xsl:value-of select="util:hashToSectionId(@nodeID)"/>
|
---|
285 | <xsl:text> </xsl:text>
|
---|
286 | </span>
|
---|
287 | </xsl:if>
|
---|
288 | <!-- Display the title for the section regardless of whether automatic section numbering is turned on -->
|
---|
289 | <span><xsl:apply-templates select="." mode="sectionTitle"/></span>
|
---|
290 | </p>
|
---|
291 | </xsl:template>
|
---|
292 |
|
---|
293 | <!-- The default template for displaying section titles -->
|
---|
294 | <xsl:template match="documentNode" mode="sectionTitle">
|
---|
295 | <xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Title']"/>
|
---|
296 | </xsl:template>
|
---|
297 |
|
---|
298 | <!-- The default template for displaying the document content -->
|
---|
299 | <xsl:template match="documentNode" mode="document">
|
---|
300 | <xsl:call-template name="documentNodePre"/>
|
---|
301 | <!-- Section text -->
|
---|
302 | <xsl:for-each select="nodeContent">
|
---|
303 | <xsl:for-each select="node()">
|
---|
304 | <xsl:choose>
|
---|
305 | <xsl:when test="not(name())">
|
---|
306 | <xsl:value-of select="." disable-output-escaping="yes"/>
|
---|
307 | </xsl:when>
|
---|
308 | <xsl:otherwise>
|
---|
309 | <xsl:apply-templates select="."/>
|
---|
310 | </xsl:otherwise>
|
---|
311 | </xsl:choose>
|
---|
312 | </xsl:for-each>
|
---|
313 | </xsl:for-each><xsl:text> </xsl:text>
|
---|
314 | </xsl:template>
|
---|
315 |
|
---|
316 | <!-- The default template for displaying the document image -->
|
---|
317 | <xsl:template name="documentImage">
|
---|
318 | <xsl:variable name="imageTest"><gsf:metadata name="ScreenWidth"/></xsl:variable>
|
---|
319 | <xsl:if test="$imageTest != ''">
|
---|
320 | <h3>
|
---|
321 | <gsf:choose-metadata>
|
---|
322 | <gsf:metadata name="dc.Title"/>
|
---|
323 | <gsf:metadata name="ex.Title"/>
|
---|
324 | <gsf:default>Untitled</gsf:default>
|
---|
325 | </gsf:choose-metadata>
|
---|
326 | </h3>
|
---|
327 | <gsf:image type="screen"/>
|
---|
328 | </xsl:if>
|
---|
329 | </xsl:template>
|
---|
330 |
|
---|
331 | <!-- This template is used to display the table of contents -->
|
---|
332 | <xsl:template match="documentNode" mode="TOC">
|
---|
333 |
|
---|
334 | <!-- check if this is the currently selected table of contents item -->
|
---|
335 | <xsl:variable name="isCurrent" select="nodeContent"/>
|
---|
336 |
|
---|
337 | <!-- formulate the link -->
|
---|
338 | <xsl:variable name="contentsLink">
|
---|
339 | <xsl:value-of select='$library_name'/>?a=d&c=<gslib:collectionNameShort/>&d=<xsl:value-of select='@nodeID'/><xsl:if test="documentNode">.pr</xsl:if>&sib=1
|
---|
340 | </xsl:variable>
|
---|
341 |
|
---|
342 | <ul>
|
---|
343 | <table><tr>
|
---|
344 | <!-- The expand/collapse button (not displayed for the top level node) -->
|
---|
345 | <xsl:if test="util:hashToDepthClass(@nodeID) != 'sectionHeaderDepthTitle'">
|
---|
346 | <td>
|
---|
347 | <xsl:choose>
|
---|
348 | <xsl:when test="not(nodeContent and not(documentNode))">
|
---|
349 | <img id="ttoggle{@nodeID}" onclick="toggleSection('{@nodeID}');" class="icon">
|
---|
350 | <xsl:attribute name="src">
|
---|
351 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'collapse_image')"/>
|
---|
352 | </xsl:attribute>
|
---|
353 | </img>
|
---|
354 | </xsl:when>
|
---|
355 | <xsl:otherwise>
|
---|
356 | <xsl:attribute name="class">emptyIcon</xsl:attribute>
|
---|
357 | </xsl:otherwise>
|
---|
358 | </xsl:choose>
|
---|
359 | </td>
|
---|
360 | </xsl:if>
|
---|
361 |
|
---|
362 | <!-- The chapter/page icon -->
|
---|
363 | <td>
|
---|
364 | <img>
|
---|
365 | <xsl:if test="nodeContent and not(documentNode)">
|
---|
366 | <xsl:attribute name="class">leafNode</xsl:attribute>
|
---|
367 | </xsl:if>
|
---|
368 |
|
---|
369 | <xsl:attribute name="src">
|
---|
370 | <xsl:choose>
|
---|
371 | <xsl:when test="nodeContent and not(documentNode)">
|
---|
372 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'page_image')"/>
|
---|
373 | </xsl:when>
|
---|
374 | <xsl:otherwise>
|
---|
375 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'chapter_image')"/>
|
---|
376 | </xsl:otherwise>
|
---|
377 | </xsl:choose>
|
---|
378 | </xsl:attribute>
|
---|
379 | </img>
|
---|
380 | </td>
|
---|
381 |
|
---|
382 | <!-- The section name, links to the section in the document -->
|
---|
383 | <td>
|
---|
384 | <a>
|
---|
385 | <xsl:choose>
|
---|
386 | <xsl:when test="/page/pageResponse/document/@docType = 'paged'">
|
---|
387 | <xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=d&c=<xsl:value-of select="/page/pageResponse/collection/@name"/>&d=<xsl:value-of select="@nodeID"/>&dt=<xsl:value-of select="@docType"/>&p.a=b&p.s=<xsl:value-of select="/page/pageResponse/service/@name"/></xsl:attribute>
|
---|
388 | </xsl:when>
|
---|
389 | <xsl:otherwise>
|
---|
390 | <xsl:attribute name="href">#<xsl:value-of select="@nodeID"/></xsl:attribute>
|
---|
391 | </xsl:otherwise>
|
---|
392 | </xsl:choose>
|
---|
393 | <xsl:if test="util:hashToSectionId(@nodeID)">
|
---|
394 | <xsl:value-of select="util:hashToSectionId(@nodeID)"/>
|
---|
395 | <xsl:text> </xsl:text>
|
---|
396 | </xsl:if>
|
---|
397 | <xsl:apply-templates select="." mode="sectionTitle"/>
|
---|
398 | </a>
|
---|
399 | </td>
|
---|
400 | </tr></table>
|
---|
401 |
|
---|
402 | <!-- display any child items -->
|
---|
403 | <xsl:if test="documentNode">
|
---|
404 | <li id="toc{@nodeID}" style="display:block;">
|
---|
405 | <xsl:apply-templates select="documentNode" mode="TOC"/>
|
---|
406 | </li>
|
---|
407 | </xsl:if>
|
---|
408 |
|
---|
409 | </ul>
|
---|
410 | </xsl:template>
|
---|
411 |
|
---|
412 | <!-- Used to produce a version of the page in a format that can be read by the realistic books plugin -->
|
---|
413 | <xsl:template match="documentNode" mode="flashxml">
|
---|
414 | <xsl:text disable-output-escaping="yes">
|
---|
415 | <Section>
|
---|
416 | <Description>
|
---|
417 | <Metadata name="Title">
|
---|
418 | </xsl:text>
|
---|
419 | <xsl:value-of select="normalize-space(metadataList/metadata[@name = 'Title'])"/>
|
---|
420 | <xsl:text disable-output-escaping="yes">
|
---|
421 | </Metadata>
|
---|
422 | </Description>
|
---|
423 | </xsl:text>
|
---|
424 |
|
---|
425 | <xsl:value-of select="normalize-space(nodeContent)" disable-output-escaping="yes"/>
|
---|
426 |
|
---|
427 | <xsl:if test="documentNode">
|
---|
428 | <xsl:apply-templates select="documentNode" mode="flashxml"/>
|
---|
429 | </xsl:if>
|
---|
430 |
|
---|
431 | <xsl:text disable-output-escaping="yes">
|
---|
432 | </Section>
|
---|
433 | </xsl:text>
|
---|
434 | </xsl:template>
|
---|
435 |
|
---|
436 | <xsl:template name="externalPage">
|
---|
437 | <xsl:param name="external"/>
|
---|
438 | <xsl:variable name="go_forward_link">
|
---|
439 | <a>
|
---|
440 | <xsl:attribute name="href">
|
---|
441 | <xsl:value-of select="$external"/>
|
---|
442 | </xsl:attribute>
|
---|
443 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'external.go_forward')"/>
|
---|
444 | </a>
|
---|
445 | </xsl:variable>
|
---|
446 | <h2><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'external.title')"/></h2>
|
---|
447 | <p><xsl:value-of select="util:getInterfaceTextWithDOM($interface_name, /page/@lang, 'external.text', $go_forward_link)" disable-output-escaping="yes"/></p>
|
---|
448 | </xsl:template>
|
---|
449 |
|
---|
450 | <xsl:template match="/page"><xsl:apply-templates select="/page/pageResponse/document"/></xsl:template> <!-- this to be deleted eventually -->
|
---|
451 |
|
---|
452 | <xsl:template name="viewOptions">
|
---|
453 | <table class="viewOptions ui-state-default ui-corner-all"><tr>
|
---|
454 |
|
---|
455 | <!-- Paged-image options -->
|
---|
456 | <xsl:if test="/page/pageResponse/document/@docType = 'paged'">
|
---|
457 | <td>
|
---|
458 | <select id="viewSelection" onchange="changeView();">
|
---|
459 | <xsl:choose>
|
---|
460 | <xsl:when test="/page/pageRequest/paramList/param[@name = 'view']/@value = 'image'">
|
---|
461 | <option>Default view</option>
|
---|
462 | <option selected="true">Image view</option>
|
---|
463 | <option>Text view</option>
|
---|
464 | </xsl:when>
|
---|
465 | <xsl:when test="/page/pageRequest/paramList/param[@name = 'view']/@value = 'text'">
|
---|
466 | <option>Default view</option>
|
---|
467 | <option>Image view</option>
|
---|
468 | <option selected="true">Text view</option>
|
---|
469 | </xsl:when>
|
---|
470 | <xsl:otherwise>
|
---|
471 | <option selected="true">Default view</option>
|
---|
472 | <option>Image view</option>
|
---|
473 | <option>Text view</option>
|
---|
474 | </xsl:otherwise>
|
---|
475 | </xsl:choose>
|
---|
476 | </select>
|
---|
477 | </td>
|
---|
478 | </xsl:if>
|
---|
479 |
|
---|
480 | <!-- Realistic books link -->
|
---|
481 | <xsl:if test="/page/pageResponse/collection[@name = $collName]/metadataList/metadata[@name = 'tidyoption'] = 'tidy'">
|
---|
482 | <td>
|
---|
483 | <img>
|
---|
484 | <xsl:attribute name="src"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'realistic_books_image')"/></xsl:attribute>
|
---|
485 | </img>
|
---|
486 | <input id="rbOption" type="checkbox" onclick="bookInit();" class="optionCheckBox"/>
|
---|
487 | </td>
|
---|
488 | </xsl:if>
|
---|
489 |
|
---|
490 | <!-- Highlight on/off button -->
|
---|
491 | <xsl:if test="/page/pageRequest/paramList/param[@name = 'p.a']/@value = 'q' and count(//annotation) > 0">
|
---|
492 | <td>
|
---|
493 | <img>
|
---|
494 | <xsl:attribute name="src"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'highlight_image')"/></xsl:attribute>
|
---|
495 | </img>
|
---|
496 | <input id="highlightOption" type="checkbox" class="optionCheckBox">
|
---|
497 | <xsl:choose>
|
---|
498 | <xsl:when test="/page/pageRequest/paramList/param[@name = 'hl']/@value = 'on'">
|
---|
499 | <xsl:attribute name="onclick">
|
---|
500 | <xsl:text>removeHighlight();</xsl:text>
|
---|
501 | </xsl:attribute>
|
---|
502 | <xsl:attribute name="checked">true</xsl:attribute>
|
---|
503 | </xsl:when>
|
---|
504 | <xsl:otherwise>
|
---|
505 | <xsl:attribute name="onclick">
|
---|
506 | <xsl:text>addHighlight();</xsl:text>
|
---|
507 | </xsl:attribute>
|
---|
508 | </xsl:otherwise>
|
---|
509 | </xsl:choose>
|
---|
510 | </input>
|
---|
511 | </td>
|
---|
512 | </xsl:if>
|
---|
513 | <td style="vertical-align:top; text-align:right;">
|
---|
514 | <xsl:if test="not(/page/pageResponse/format[@type='display']/gsf:option[@name='TOC']) or /page/pageResponse/format[@type='display']/gsf:option[@name='TOC']/@value='true'">
|
---|
515 | <span class="tableOfContentsTitle">Table of Contents</span>
|
---|
516 | </xsl:if>
|
---|
517 | <a id="sidebarMinimizeButton" href="javascript:minimizeSidebar();" style="float: right; font-size:0.6em;">
|
---|
518 | <img class="icon" style="padding-top:3px;">
|
---|
519 | <xsl:attribute name="src">
|
---|
520 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'collapse_image')"/>
|
---|
521 | </xsl:attribute>
|
---|
522 | </img>
|
---|
523 | </a>
|
---|
524 | <a id="sidebarMaximizeButton" href="javascript:maximizeSidebar();" style="float: right; font-size:0.6em; display:none;">
|
---|
525 | <img class="icon" style="padding-top:3px;">
|
---|
526 | <xsl:attribute name="src">
|
---|
527 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'expand_image')"/>
|
---|
528 | </xsl:attribute>
|
---|
529 | </img>
|
---|
530 | </a>
|
---|
531 | </td>
|
---|
532 | </tr></table>
|
---|
533 | </xsl:template>
|
---|
534 |
|
---|
535 | <xsl:template name="documentNodePre">
|
---|
536 | <xsl:if test="/page/pageResponse/format[@type='display' or @type='browse' or @type='search']/gsf:option[@name='mapEnabled']/@value = 'true'">
|
---|
537 | <xsl:call-template name="mapFeatures"/>
|
---|
538 | </xsl:if>
|
---|
539 | </xsl:template>
|
---|
540 |
|
---|
541 | <xsl:template name="mapFeatures">
|
---|
542 | <div id="map_canvas" style="margin:0px auto; width:900px; height:500px;"><xsl:text> </xsl:text></div>
|
---|
543 |
|
---|
544 | <xsl:if test="metadataList/metadata[@name = 'Latitude'] and metadataList/metadata[@name = 'Longitude']">
|
---|
545 | <div style="background:#BBFFBB; padding: 5px; margin:0px auto; width:890px;">
|
---|
546 | <xsl:text>Show documents near here </xsl:text>
|
---|
547 | <img id="nearbyDocumentsToggle" src="interfaces/oran/images/expand.png">
|
---|
548 | <xsl:attribute name="onclick">
|
---|
549 | <xsl:text>performDistanceSearch('</xsl:text>
|
---|
550 | <xsl:value-of select="@nodeID"/>
|
---|
551 | <xsl:text>', '</xsl:text>
|
---|
552 | <gsf:metadata name="Latitude"/>
|
---|
553 | <xsl:text>', '</xsl:text>
|
---|
554 | <gsf:metadata name="Longitude"/>
|
---|
555 | <xsl:text>', 2);</xsl:text>
|
---|
556 | </xsl:attribute>
|
---|
557 | </img>
|
---|
558 | <div id="nearbyDocuments"><xsl:text> </xsl:text></div>
|
---|
559 | </div>
|
---|
560 | </xsl:if>
|
---|
561 |
|
---|
562 | <div id="jsonNodes" style="display:none;">
|
---|
563 | <xsl:text>[</xsl:text>
|
---|
564 | <xsl:for-each select="//documentNode">
|
---|
565 | <xsl:if test="metadataList/metadata[@name = 'Latitude'] and metadataList/metadata[@name = 'Longitude']">
|
---|
566 | <xsl:text>{</xsl:text>
|
---|
567 | <xsl:text disable-output-escaping="yes">"nodeID":"</xsl:text><xsl:value-of select="@nodeID"/><xsl:text disable-output-escaping="yes">",</xsl:text>
|
---|
568 | <xsl:text disable-output-escaping="yes">"title":"</xsl:text><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Title']"/><xsl:text disable-output-escaping="yes">",</xsl:text>
|
---|
569 | <xsl:text disable-output-escaping="yes">"lat":</xsl:text><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Latitude']"/><xsl:text>,</xsl:text>
|
---|
570 | <xsl:text disable-output-escaping="yes">"lng":</xsl:text><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Longitude']"/>
|
---|
571 | <xsl:text>}</xsl:text>
|
---|
572 | <xsl:if test="not(position() = count(//documentNode))">
|
---|
573 | <xsl:text>,</xsl:text>
|
---|
574 | </xsl:if>
|
---|
575 | </xsl:if>
|
---|
576 | </xsl:for-each>
|
---|
577 | <xsl:text>]</xsl:text>
|
---|
578 | </div>
|
---|
579 | </xsl:template>
|
---|
580 | </xsl:stylesheet>
|
---|
581 |
|
---|