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 | <tr>
|
---|
106 | <td class="metaTableCellName"><xsl:value-of select="@name"/></td>
|
---|
107 | <td class="metaTableCell editable"><xsl:value-of select="."/></td>
|
---|
108 | </tr>
|
---|
109 | </xsl:for-each>
|
---|
110 | </table>
|
---|
111 | </xsl:if>
|
---|
112 | <div id="text{@nodeID}" class="sectionText"><!-- *** -->
|
---|
113 | <!-- Get the section content from the document template -->
|
---|
114 | <xsl:apply-templates select="." mode="document"/>
|
---|
115 | </div>
|
---|
116 | <xsl:if test="documentNode">
|
---|
117 | <xsl:call-template name="wrapDocumentNodes"/>
|
---|
118 | </xsl:if>
|
---|
119 | </div>
|
---|
120 | </xsl:for-each>
|
---|
121 | </xsl:template>
|
---|
122 |
|
---|
123 | <!-- the page content -->
|
---|
124 | <xsl:template match="/page/pageResponse/document">
|
---|
125 | <xsl:if test="/page/pageRequest/paramList/param[@name = 'dmd']/@value = 'true'">
|
---|
126 | <gsf:metadata name="all"/>
|
---|
127 | </xsl:if>
|
---|
128 |
|
---|
129 | <xsl:if test="$bookswitch = 'off'">
|
---|
130 | <div id="bookdiv" style="visibility:hidden; height:0px; display:inline;"><xsl:text> </xsl:text></div>
|
---|
131 |
|
---|
132 | <script type="text/javascript" src="interfaces/{$interface_name}/js/document_scripts.js"><xsl:text> </xsl:text></script>
|
---|
133 |
|
---|
134 | <xsl:if test="/page/pageResponse/collection[@name = $collName]/metadataList/metadata[@name = 'tidyoption'] = 'tidy'">
|
---|
135 | <script type="text/javascript">
|
---|
136 | <xsl:text disable-output-escaping="yes">
|
---|
137 | if(document.URL.indexOf("book=on") != -1)
|
---|
138 | {
|
---|
139 | loadBook();
|
---|
140 | }
|
---|
141 | </xsl:text>
|
---|
142 | </script>
|
---|
143 | </xsl:if>
|
---|
144 |
|
---|
145 | <!-- show the little berries for this document -->
|
---|
146 | <xsl:call-template name="documentBerryForDocumentPage"/>
|
---|
147 |
|
---|
148 | <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'">
|
---|
149 | <table id="rightSidebar">
|
---|
150 | <tr><td>
|
---|
151 | <xsl:call-template name="viewOptions"/>
|
---|
152 | </td></tr>
|
---|
153 | <tr><td>
|
---|
154 | <div id="contentsArea">
|
---|
155 | <!-- show the berry basket if it's turned on -->
|
---|
156 | <gslib:berryBasket/>
|
---|
157 |
|
---|
158 | <!-- the book's cover image -->
|
---|
159 | <div id="coverImage">
|
---|
160 | <xsl:attribute name="class">
|
---|
161 | <xsl:choose>
|
---|
162 | <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>
|
---|
163 | <xsl:otherwise>hidden</xsl:otherwise>
|
---|
164 | </xsl:choose>
|
---|
165 | </xsl:attribute>
|
---|
166 | <gslib:coverImage/><xsl:text> </xsl:text>
|
---|
167 | </div>
|
---|
168 |
|
---|
169 | <!-- the contents (if enabled) -->
|
---|
170 | <xsl:choose>
|
---|
171 | <xsl:when test="/page/pageResponse/document/@docType = 'paged' and not(/page/pageRequest/paramList/param[@name = 'ed']/@value = '1')">
|
---|
172 | <!-- Table of contents will be dynamically retrieved when viewing a paged document -->
|
---|
173 | <script type="text/javascript">
|
---|
174 | <xsl:text disable-output-escaping="yes">
|
---|
175 | retrieveTableOfContents();
|
---|
176 | </xsl:text>
|
---|
177 | </script>
|
---|
178 | </xsl:when>
|
---|
179 | <xsl:otherwise>
|
---|
180 | <div id="tableOfContents">
|
---|
181 | <xsl:attribute name="class">
|
---|
182 | <xsl:choose>
|
---|
183 | <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>
|
---|
184 | <xsl:otherwise>hidden</xsl:otherwise>
|
---|
185 | </xsl:choose>
|
---|
186 | </xsl:attribute>
|
---|
187 | <xsl:apply-templates select="documentNode" mode="TOC"/>
|
---|
188 | <xsl:if test="@docType = 'paged'">
|
---|
189 | <table style="width:100%;"><tbody><tr>
|
---|
190 | <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>
|
---|
191 | <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>
|
---|
192 | <td style="width:40%; text-align:center;"><xsl:text>Go to page</xsl:text><input type="text" size="3"/></td>
|
---|
193 | <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>
|
---|
194 | <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>
|
---|
195 | </tr></tbody></table>
|
---|
196 | </xsl:if>
|
---|
197 | </div>
|
---|
198 | </xsl:otherwise>
|
---|
199 | </xsl:choose>
|
---|
200 | </div>
|
---|
201 | </td></tr>
|
---|
202 | </table>
|
---|
203 | </xsl:if>
|
---|
204 | </xsl:if>
|
---|
205 |
|
---|
206 | <!-- display the document -->
|
---|
207 | <xsl:choose>
|
---|
208 | <xsl:when test="@external != ''">
|
---|
209 | <xsl:call-template name="externalPage">
|
---|
210 | <xsl:with-param name="external" select="@external"/>
|
---|
211 | </xsl:call-template>
|
---|
212 | </xsl:when>
|
---|
213 | <xsl:when test="$bookswitch = 'flashxml'">
|
---|
214 | <xsl:apply-templates mode="flashxml"/>
|
---|
215 | </xsl:when>
|
---|
216 | <xsl:when test="$bookswitch = 'on'">
|
---|
217 | <div id="bookdiv" style="display:inline;"><xsl:text> </xsl:text></div>
|
---|
218 | <!-- *** in document-scripts.js *** -->
|
---|
219 | <script type="text/javascript">
|
---|
220 | <xsl:text disable-output-escaping="yes">
|
---|
221 | if(document.URL.indexOf("book=on") != -1)
|
---|
222 | {
|
---|
223 | loadBook();
|
---|
224 | }
|
---|
225 | </xsl:text>
|
---|
226 | </script>
|
---|
227 | </xsl:when>
|
---|
228 | <xsl:otherwise>
|
---|
229 | <div id="gs-document">
|
---|
230 | <div id="gs-document-image">
|
---|
231 | <xsl:attribute name="class">
|
---|
232 | <xsl:text>sectionImage</xsl:text>
|
---|
233 | <xsl:if test="/page/pageRequest/paramList/param[@name = 'view']/@value = 'text'"><xsl:text> hidden</xsl:text></xsl:if>
|
---|
234 | </xsl:attribute>
|
---|
235 | <!-- Get the section content from the document template -->
|
---|
236 | <xsl:call-template name="documentImage"/>
|
---|
237 | <xsl:text> </xsl:text>
|
---|
238 | </div>
|
---|
239 | <div id="gs-document-text" collection="{/page/pageResponse/collection/@name}"><!-- *** -->
|
---|
240 | <xsl:attribute name="class">
|
---|
241 | <xsl:text>documenttext</xsl:text>
|
---|
242 | <xsl:if test="/page/pageRequest/paramList/param[@name = 'view']/@value = 'image'"><xsl:text> hidden</xsl:text></xsl:if>
|
---|
243 | </xsl:attribute>
|
---|
244 | <xsl:call-template name="wrapDocumentNodes"/>
|
---|
245 | </div>
|
---|
246 | </div>
|
---|
247 | </xsl:otherwise>
|
---|
248 | </xsl:choose>
|
---|
249 |
|
---|
250 | <div class="clear"><xsl:text> </xsl:text></div>
|
---|
251 | </xsl:template>
|
---|
252 |
|
---|
253 | <!-- Highlight annotations if requested -->
|
---|
254 | <xsl:template match="annotation">
|
---|
255 | <xsl:choose>
|
---|
256 | <xsl:when test="/page/pageRequest/paramList/param[@name='hl' and @value='on']">
|
---|
257 | <span class="termHighlight"><xsl:value-of select="."/></span>
|
---|
258 | </xsl:when>
|
---|
259 | <xsl:otherwise>
|
---|
260 | <span class="noTermHighlight"><xsl:value-of select="."/></span>
|
---|
261 | </xsl:otherwise>
|
---|
262 | </xsl:choose>
|
---|
263 | </xsl:template>
|
---|
264 |
|
---|
265 | <xsl:template match="documentNode" mode="sectionTitleFormat">
|
---|
266 | <p>
|
---|
267 | <xsl:attribute name="class"><xsl:value-of select="util:hashToDepthClass(@nodeID)"/> sectionHeader</xsl:attribute>
|
---|
268 |
|
---|
269 | <xsl:if test="util:hashToSectionId(@nodeID)">
|
---|
270 | <span class="sectionNumberSpan">
|
---|
271 | <xsl:value-of select="util:hashToSectionId(@nodeID)"/>
|
---|
272 | <xsl:text> </xsl:text>
|
---|
273 | </span>
|
---|
274 | </xsl:if>
|
---|
275 | <!-- Display the title for the section regardless of whether automatic section numbering is turned on -->
|
---|
276 | <span><xsl:apply-templates select="." mode="sectionTitle"/></span>
|
---|
277 | </p>
|
---|
278 | </xsl:template>
|
---|
279 |
|
---|
280 | <!-- The default template for displaying section titles -->
|
---|
281 | <xsl:template match="documentNode" mode="sectionTitle">
|
---|
282 | <xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Title']"/>
|
---|
283 | </xsl:template>
|
---|
284 |
|
---|
285 | <!-- The default template for displaying the document content -->
|
---|
286 | <xsl:template match="documentNode" mode="document">
|
---|
287 | <xsl:call-template name="documentNodePre"/>
|
---|
288 | <!-- Section text -->
|
---|
289 | <xsl:for-each select="nodeContent">
|
---|
290 | <xsl:for-each select="node()">
|
---|
291 | <xsl:choose>
|
---|
292 | <xsl:when test="not(name())">
|
---|
293 | <xsl:value-of select="." disable-output-escaping="yes"/>
|
---|
294 | </xsl:when>
|
---|
295 | <xsl:otherwise>
|
---|
296 | <xsl:apply-templates select="."/>
|
---|
297 | </xsl:otherwise>
|
---|
298 | </xsl:choose>
|
---|
299 | </xsl:for-each>
|
---|
300 | </xsl:for-each><xsl:text> </xsl:text>
|
---|
301 | </xsl:template>
|
---|
302 |
|
---|
303 | <!-- The default template for displaying the document image -->
|
---|
304 | <xsl:template name="documentImage">
|
---|
305 | <xsl:variable name="imageTest"><gsf:metadata name="ScreenWidth"/></xsl:variable>
|
---|
306 | <xsl:if test="$imageTest != ''">
|
---|
307 | <h3>
|
---|
308 | <gsf:choose-metadata>
|
---|
309 | <gsf:metadata name="dc.Title"/>
|
---|
310 | <gsf:metadata name="ex.Title"/>
|
---|
311 | <gsf:default>Untitled</gsf:default>
|
---|
312 | </gsf:choose-metadata>
|
---|
313 | </h3>
|
---|
314 | <gsf:image type="screen"/>
|
---|
315 | </xsl:if>
|
---|
316 | </xsl:template>
|
---|
317 |
|
---|
318 | <!-- This template is used to display the table of contents -->
|
---|
319 | <xsl:template match="documentNode" mode="TOC">
|
---|
320 |
|
---|
321 | <!-- check if this is the currently selected table of contents item -->
|
---|
322 | <xsl:variable name="isCurrent" select="nodeContent"/>
|
---|
323 |
|
---|
324 | <!-- formulate the link -->
|
---|
325 | <xsl:variable name="contentsLink">
|
---|
326 | <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
|
---|
327 | </xsl:variable>
|
---|
328 |
|
---|
329 | <ul>
|
---|
330 | <table><tr>
|
---|
331 | <!-- The expand/collapse button (not displayed for the top level node) -->
|
---|
332 | <xsl:if test="util:hashToDepthClass(@nodeID) != 'sectionHeaderDepthTitle'">
|
---|
333 | <td>
|
---|
334 | <xsl:choose>
|
---|
335 | <xsl:when test="not(nodeContent and not(documentNode))">
|
---|
336 | <img id="ttoggle{@nodeID}" onclick="toggleSection('{@nodeID}');" class="icon">
|
---|
337 | <xsl:attribute name="src">
|
---|
338 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'collapse_image')"/>
|
---|
339 | </xsl:attribute>
|
---|
340 | </img>
|
---|
341 | </xsl:when>
|
---|
342 | <xsl:otherwise>
|
---|
343 | <xsl:attribute name="class">emptyIcon</xsl:attribute>
|
---|
344 | </xsl:otherwise>
|
---|
345 | </xsl:choose>
|
---|
346 | </td>
|
---|
347 | </xsl:if>
|
---|
348 |
|
---|
349 | <!-- The chapter/page icon -->
|
---|
350 | <td>
|
---|
351 | <img>
|
---|
352 | <xsl:if test="nodeContent and not(documentNode)">
|
---|
353 | <xsl:attribute name="class">leafNode</xsl:attribute>
|
---|
354 | </xsl:if>
|
---|
355 |
|
---|
356 | <xsl:attribute name="src">
|
---|
357 | <xsl:choose>
|
---|
358 | <xsl:when test="nodeContent and not(documentNode)">
|
---|
359 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'page_image')"/>
|
---|
360 | </xsl:when>
|
---|
361 | <xsl:otherwise>
|
---|
362 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'chapter_image')"/>
|
---|
363 | </xsl:otherwise>
|
---|
364 | </xsl:choose>
|
---|
365 | </xsl:attribute>
|
---|
366 | </img>
|
---|
367 | </td>
|
---|
368 |
|
---|
369 | <!-- The section name, links to the section in the document -->
|
---|
370 | <td>
|
---|
371 | <a>
|
---|
372 | <xsl:choose>
|
---|
373 | <xsl:when test="/page/pageResponse/document/@docType = 'paged'">
|
---|
374 | <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>
|
---|
375 | </xsl:when>
|
---|
376 | <xsl:otherwise>
|
---|
377 | <xsl:attribute name="href">#<xsl:value-of select="@nodeID"/></xsl:attribute>
|
---|
378 | </xsl:otherwise>
|
---|
379 | </xsl:choose>
|
---|
380 | <xsl:if test="util:hashToSectionId(@nodeID)">
|
---|
381 | <xsl:value-of select="util:hashToSectionId(@nodeID)"/>
|
---|
382 | <xsl:text> </xsl:text>
|
---|
383 | </xsl:if>
|
---|
384 | <xsl:apply-templates select="." mode="sectionTitle"/>
|
---|
385 | </a>
|
---|
386 | </td>
|
---|
387 | </tr></table>
|
---|
388 |
|
---|
389 | <!-- display any child items -->
|
---|
390 | <xsl:if test="documentNode">
|
---|
391 | <li id="toc{@nodeID}" style="display:block;">
|
---|
392 | <xsl:apply-templates select="documentNode" mode="TOC"/>
|
---|
393 | </li>
|
---|
394 | </xsl:if>
|
---|
395 |
|
---|
396 | </ul>
|
---|
397 | </xsl:template>
|
---|
398 |
|
---|
399 | <!-- Used to produce a version of the page in a format that can be read by the realistic books plugin -->
|
---|
400 | <xsl:template match="documentNode" mode="flashxml">
|
---|
401 | <xsl:text disable-output-escaping="yes">
|
---|
402 | <Section>
|
---|
403 | <Description>
|
---|
404 | <Metadata name="Title">
|
---|
405 | </xsl:text>
|
---|
406 | <xsl:value-of select="normalize-space(metadataList/metadata[@name = 'Title'])"/>
|
---|
407 | <xsl:text disable-output-escaping="yes">
|
---|
408 | </Metadata>
|
---|
409 | </Description>
|
---|
410 | </xsl:text>
|
---|
411 |
|
---|
412 | <xsl:value-of select="normalize-space(nodeContent)" disable-output-escaping="yes"/>
|
---|
413 |
|
---|
414 | <xsl:if test="documentNode">
|
---|
415 | <xsl:apply-templates select="documentNode" mode="flashxml"/>
|
---|
416 | </xsl:if>
|
---|
417 |
|
---|
418 | <xsl:text disable-output-escaping="yes">
|
---|
419 | </Section>
|
---|
420 | </xsl:text>
|
---|
421 | </xsl:template>
|
---|
422 |
|
---|
423 | <xsl:template name="externalPage">
|
---|
424 | <xsl:param name="external"/>
|
---|
425 | <xsl:variable name="go_forward_link">
|
---|
426 | <a>
|
---|
427 | <xsl:attribute name="href">
|
---|
428 | <xsl:value-of select="$external"/>
|
---|
429 | </xsl:attribute>
|
---|
430 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'external.go_forward')"/>
|
---|
431 | </a>
|
---|
432 | </xsl:variable>
|
---|
433 | <h2><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'external.title')"/></h2>
|
---|
434 | <p><xsl:value-of select="util:getInterfaceTextWithDOM($interface_name, /page/@lang, 'external.text', $go_forward_link)" disable-output-escaping="yes"/></p>
|
---|
435 | </xsl:template>
|
---|
436 |
|
---|
437 | <xsl:template match="/page"><xsl:apply-templates select="/page/pageResponse/document"/></xsl:template> <!-- this to be deleted eventually -->
|
---|
438 |
|
---|
439 | <xsl:template name="viewOptions">
|
---|
440 | <table class="viewOptions ui-state-default ui-corner-all"><tr>
|
---|
441 |
|
---|
442 | <!-- Paged-image options -->
|
---|
443 | <xsl:if test="/page/pageResponse/document/@docType = 'paged'">
|
---|
444 | <td>
|
---|
445 | <select id="viewSelection" onchange="changeView();">
|
---|
446 | <xsl:choose>
|
---|
447 | <xsl:when test="/page/pageRequest/paramList/param[@name = 'view']/@value = 'image'">
|
---|
448 | <option>Default view</option>
|
---|
449 | <option selected="true">Image view</option>
|
---|
450 | <option>Text view</option>
|
---|
451 | </xsl:when>
|
---|
452 | <xsl:when test="/page/pageRequest/paramList/param[@name = 'view']/@value = 'text'">
|
---|
453 | <option>Default view</option>
|
---|
454 | <option>Image view</option>
|
---|
455 | <option selected="true">Text view</option>
|
---|
456 | </xsl:when>
|
---|
457 | <xsl:otherwise test="not(/page/pageRequest/paramList/param[@name = 'view']/@value)">
|
---|
458 | <option selected="true">Default view</option>
|
---|
459 | <option>Image view</option>
|
---|
460 | <option>Text view</option>
|
---|
461 | </xsl:otherwise>
|
---|
462 | </xsl:choose>
|
---|
463 | </select>
|
---|
464 | </td>
|
---|
465 | </xsl:if>
|
---|
466 |
|
---|
467 | <!-- Realistic books link -->
|
---|
468 | <xsl:if test="/page/pageResponse/collection[@name = $collName]/metadataList/metadata[@name = 'tidyoption'] = 'tidy'">
|
---|
469 | <td>
|
---|
470 | <img>
|
---|
471 | <xsl:attribute name="src"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'realistic_books_image')"/></xsl:attribute>
|
---|
472 | </img>
|
---|
473 | <input id="rbOption" type="checkbox" onclick="bookInit();" class="optionCheckBox"/>
|
---|
474 | </td>
|
---|
475 | </xsl:if>
|
---|
476 |
|
---|
477 | <!-- Highlight on/off button -->
|
---|
478 | <xsl:if test="/page/pageRequest/paramList/param[@name = 'p.a']/@value = 'q' and count(//annotation) > 0">
|
---|
479 | <td>
|
---|
480 | <img>
|
---|
481 | <xsl:attribute name="src"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'highlight_image')"/></xsl:attribute>
|
---|
482 | </img>
|
---|
483 | <input id="highlightOption" type="checkbox" class="optionCheckBox">
|
---|
484 | <xsl:choose>
|
---|
485 | <xsl:when test="/page/pageRequest/paramList/param[@name = 'hl']/@value = 'on'">
|
---|
486 | <xsl:attribute name="onclick">
|
---|
487 | <xsl:text>removeHighlight();</xsl:text>
|
---|
488 | </xsl:attribute>
|
---|
489 | <xsl:attribute name="checked">true</xsl:attribute>
|
---|
490 | </xsl:when>
|
---|
491 | <xsl:otherwise>
|
---|
492 | <xsl:attribute name="onclick">
|
---|
493 | <xsl:text>addHighlight();</xsl:text>
|
---|
494 | </xsl:attribute>
|
---|
495 | </xsl:otherwise>
|
---|
496 | </xsl:choose>
|
---|
497 | </input>
|
---|
498 | </td>
|
---|
499 | </xsl:if>
|
---|
500 | <td style="vertical-align:top; text-align:right;">
|
---|
501 | <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'">
|
---|
502 | <span class="tableOfContentsTitle">Table of Contents</span>
|
---|
503 | </xsl:if>
|
---|
504 | <a id="sidebarMinimizeButton" href="javascript:minimizeSidebar();" style="float: right; font-size:0.6em;">
|
---|
505 | <img class="icon" style="padding-top:3px;">
|
---|
506 | <xsl:attribute name="src">
|
---|
507 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'collapse_image')"/>
|
---|
508 | </xsl:attribute>
|
---|
509 | </img>
|
---|
510 | </a>
|
---|
511 | <a id="sidebarMaximizeButton" href="javascript:maximizeSidebar();" style="float: right; font-size:0.6em; display:none;">
|
---|
512 | <img class="icon" style="padding-top:3px;">
|
---|
513 | <xsl:attribute name="src">
|
---|
514 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'expand_image')"/>
|
---|
515 | </xsl:attribute>
|
---|
516 | </img>
|
---|
517 | </a>
|
---|
518 | </td>
|
---|
519 | </tr></table>
|
---|
520 | </xsl:template>
|
---|
521 |
|
---|
522 | <xsl:template name="documentNodePre">
|
---|
523 | <xsl:if test="/page/pageResponse/format[@type='display' or @type='browse' or @type='search']/gsf:option[@name='mapEnabled']/@value = 'true'">
|
---|
524 | <xsl:call-template name="mapFeatures"/>
|
---|
525 | </xsl:if>
|
---|
526 | </xsl:template>
|
---|
527 |
|
---|
528 | <xsl:template name="mapFeatures">
|
---|
529 | <div id="map_canvas" style="margin:0px auto; width:900px; height:500px;"><xsl:text> </xsl:text></div>
|
---|
530 |
|
---|
531 | <xsl:if test="metadataList/metadata[@name = 'Latitude'] and metadataList/metadata[@name = 'Longitude']">
|
---|
532 | <div style="background:#BBFFBB; padding: 5px; margin:0px auto; width:890px;">
|
---|
533 | <xsl:text>Show documents near here </xsl:text>
|
---|
534 | <img id="nearbyDocumentsToggle" src="interfaces/oran/images/expand.png">
|
---|
535 | <xsl:attribute name="onclick">
|
---|
536 | <xsl:text>performDistanceSearch('</xsl:text>
|
---|
537 | <xsl:value-of select="@nodeID"/>
|
---|
538 | <xsl:text>', '</xsl:text>
|
---|
539 | <gsf:metadata name="Latitude"/>
|
---|
540 | <xsl:text>', '</xsl:text>
|
---|
541 | <gsf:metadata name="Longitude"/>
|
---|
542 | <xsl:text>', 2);</xsl:text>
|
---|
543 | </xsl:attribute>
|
---|
544 | </img>
|
---|
545 | <div id="nearbyDocuments"><xsl:text> </xsl:text></div>
|
---|
546 | </div>
|
---|
547 | </xsl:if>
|
---|
548 |
|
---|
549 | <div id="jsonNodes" style="display:none;">
|
---|
550 | <xsl:text>[</xsl:text>
|
---|
551 | <xsl:for-each select="//documentNode">
|
---|
552 | <xsl:if test="metadataList/metadata[@name = 'Latitude'] and metadataList/metadata[@name = 'Longitude']">
|
---|
553 | <xsl:text>{</xsl:text>
|
---|
554 | <xsl:text disable-output-escaping="yes">"nodeID":"</xsl:text><xsl:value-of select="@nodeID"/><xsl:text disable-output-escaping="yes">",</xsl:text>
|
---|
555 | <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>
|
---|
556 | <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>
|
---|
557 | <xsl:text disable-output-escaping="yes">"lng":</xsl:text><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Longitude']"/>
|
---|
558 | <xsl:text>}</xsl:text>
|
---|
559 | <xsl:if test="not(position() = count(//documentNode))">
|
---|
560 | <xsl:text>,</xsl:text>
|
---|
561 | </xsl:if>
|
---|
562 | </xsl:if>
|
---|
563 | </xsl:for-each>
|
---|
564 | <xsl:text>]</xsl:text>
|
---|
565 | </div>
|
---|
566 | </xsl:template>
|
---|
567 | </xsl:stylesheet>
|
---|
568 |
|
---|