source: main/trunk/greenstone3/web/interfaces/default/transform/pages/document.xsl@ 37005

Last change on this file since 37005 was 37005, checked in by davidb, 17 months ago

Introduction of documentPost to balance out documentPre; change to use Image rather than Source/SourceFile in places where images are to be displayed in the browser (Source might be a format such as TIFF that a browser cannot display, however Image can be controlled by the collectinConfig.xml file to be web friendly

File size: 43.5 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
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 <xsl:import href="layouts/toc.xsl"/>
14
15 <!-- templates for adding user comments -->
16 <xsl:import href="layouts/usercomments.xsl"/>
17
18 <!-- We technically need this include. However, it is imported with toc.xsl -->
19 <!-- <xsl:include href="document-shared.xsl" /> -->
20
21 <xsl:variable name="docID" select="/page/pageRequest/paramList/param[@name='d']/@value"/>
22
23 <xsl:variable name="bookswitch">
24 <xsl:choose>
25 <xsl:when test="/page/pageRequest/paramList/param[@name='book']/@value">
26 <xsl:value-of select="/page/pageRequest/paramList/param[@name='book']/@value"/>
27 </xsl:when>
28 <xsl:otherwise>off</xsl:otherwise>
29 </xsl:choose>
30 </xsl:variable>
31
32 <xsl:variable name="canDoEditing">
33 <xsl:if test="$isEditingAllowed = '1' and (/page/pageRequest/userInformation and /page/pageRequest/userInformation/@editEnabled = 'true' and (util:contains(/page/pageRequest/userInformation/@groups, 'administrator') or util:contains(/page/pageRequest/userInformation/@groups, 'all-collections-editor') or util:contains(/page/pageRequest/userInformation/@groups, $thisCollectionEditor)))">true</xsl:if>
34 </xsl:variable>
35 <xsl:variable name="editingTurnedOn">
36 <xsl:if test="/page/pageRequest/paramList/param[@name='docEdit']/@value = '1'">true</xsl:if>
37 </xsl:variable>
38
39 <!-- optional cgi-params for links to document pages -->
40 <xsl:variable name="opt-doc-link-args"></xsl:variable>
41 <!-- set page title -->
42 <xsl:template name="pageTitle"><gslib:documentTitle/></xsl:template>
43
44 <!-- set page breadcrumbs -->
45 <xsl:template name="breadcrumbs">
46 <gslib:siteLink/><gslib:rightArrow/>
47 <gslib:groupLinks/>
48 <gslib:collectionNameLinked/><gslib:rightArrow/>
49 <a>
50 <xsl:attribute name="href">
51 <xsl:value-of select="$library_name"/>/collection/<xsl:value-of select="$collName"/>/document/<xsl:value-of select="/page/pageResponse/document/documentNode[1]/@nodeID"/>
52 </xsl:attribute>
53 <xsl:variable name="documentTitleVar">
54 <gslib:documentTitle/>
55 </xsl:variable>
56 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.document')"/>
57 </a>
58 </xsl:template>
59
60 <xsl:template match="/">
61 <xsl:choose>
62 <!-- if this is the realistic books version of the page -->
63 <xsl:when test="$bookswitch = 'flashxml'">
64 <html>
65 <body>
66 <xsl:apply-templates select="/page/pageResponse/document"/>
67 </body>
68 </html>
69 </xsl:when>
70 <!-- if this is the regular version of the page -->
71 <xsl:otherwise>
72 <xsl:call-template name="mainTemplate"/>
73 </xsl:otherwise>
74 </xsl:choose>
75 </xsl:template>
76
77 <xsl:template name="documentHeading">
78 <span style="font-weight:bold; font-size: 120%;">
79 <xsl:call-template name="choose-title"/>
80 </span>
81 </xsl:template>
82
83 <!-- content of a simple document. Will not be used for editing mode -->
84 <xsl:template name="documentContent">
85 <div id="gs-document">
86 <xsl:call-template name="documentPre"/>
87 <xsl:call-template name="wrappedSectionImage"/>
88 <div id="gs-document-text">
89 <xsl:call-template name="documentNodeText"/>
90 </div>
91 <xsl:call-template name="documentPost"/>
92 </div>
93 </xsl:template>
94
95 <xsl:template name="topLevelSectionContent">
96 <xsl:call-template name="wrappedSectionImage"/>
97 <xsl:call-template name="wrappedSectionText"/>
98 </xsl:template>
99
100 <xsl:template name="sectionContent">
101 <xsl:call-template name="wrappedSectionImage"/>
102 <xsl:call-template name="wrappedSectionText"/>
103 </xsl:template>
104 <xsl:template name="sectionContentForEditing">
105 <xsl:call-template name="wrappedSectionImage"/>
106 <xsl:call-template name="wrappedSectionTextForEditing"/>
107 </xsl:template>
108
109 <xsl:template name="wrappedSectionTextForEditing">
110 <br /><br />
111 <div id="text{@nodeID}" class="sectionText" style="display:block;"><!-- *** -->
112 <xsl:attribute name="contenteditable">
113 <xsl:text>true</xsl:text>
114 </xsl:attribute>
115 <xsl:call-template name="documentNodeTextForEditing"/>
116 </div>
117 </xsl:template>
118
119 <xsl:template name="wrappedSectionText">
120 <br /><br />
121
122 <div id="text{@nodeID}" class="sectionText"><!-- *** -->
123 <xsl:attribute name="style">
124 <xsl:choose>
125 <xsl:when test="/page/pageRequest/paramList/param[@name = 'view']/@value = 'image'">
126 <xsl:text>display:none;</xsl:text>
127 </xsl:when>
128 <xsl:otherwise>
129 <xsl:text>display:block;</xsl:text>
130 </xsl:otherwise>
131 </xsl:choose>
132 </xsl:attribute>
133 <xsl:call-template name="documentNodeText"/>
134 </div>
135 </xsl:template>
136
137 <xsl:template name="sectionImage">
138 <gsf:image type="screen"/>
139 </xsl:template>
140
141 <!-- Used to make sure that regardless what the collection designer uses for the title and content we can wrap it properly -->
142 <!-- If editing, be aware that the Document Basket looks for specific classes that this template bakes in (key points marked with ***) -->
143 <xsl:template name="wrapDocumentNodes">
144 <xsl:variable name="nodeID" select="@nodeID"/>
145 <a name="{@nodeID}"><xsl:text> </xsl:text></a>
146
147 <!-- Section header -->
148 <table class="sectionHeader"><tr>
149
150 <!-- Expand/collapse button -->
151 <xsl:if test="not(/page/pageResponse/format[@type='display' or @type='browse' or @type='search']/gsf:option[@name='sectionExpandCollapse']/@value) or /page/pageResponse/format[@type='display' or @type='browse' or @type='search']/gsf:option[@name='sectionExpandCollapse']/@value = 'true'">
152 <td class="headerTD">
153 <img id="dtoggle{@nodeID}" onclick="toggleSection('{@nodeID}');" class="icon">
154 <xsl:attribute name="src">
155 <xsl:choose>
156 <xsl:when test="/page/pageRequest/paramList/param[@name = 'ed']/@value = '1' or util:oidIsMatchOrParent($nodeID, /page/pageResponse/document/@selectedNode)">
157 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'collapse_image')"/>
158 </xsl:when>
159 <xsl:otherwise>
160 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'expand_image')"/>
161 </xsl:otherwise>
162 </xsl:choose>
163 </xsl:attribute>
164 </img>
165 </td>
166 </xsl:if>
167
168 <!-- Title -->
169 <td id="header{@nodeID}" class="headerTD sectionTitle"><!-- *** -->
170 <p>
171 <xsl:attribute name="class"><xsl:value-of select="util:hashToDepthClass(@nodeID)"/> sectionHeader</xsl:attribute>
172
173 <xsl:if test="util:hashToSectionId(@nodeID)">
174 <span class="sectionNumberSpan">
175 <xsl:value-of select="util:hashToSectionId(@nodeID)"/>
176 <xsl:text> </xsl:text>
177 </span>
178 </xsl:if>
179 <!-- Display the title for the section regardless of whether automatic section numbering is turned on -->
180 <span><xsl:call-template name="sectionHeading"/></span>
181 </p>
182 </td>
183
184 <!-- "back to top" link -->
185 <xsl:if test="util:hashToDepthClass(@nodeID) != 'sectionHeaderDepthTitle' and not(/page/pageResponse/format[@type='display']/gsf:option[@name='backToTopLinks']) or /page/pageResponse/format[@type='display']/gsf:option[@name='backToTopLinks']/@value='true'">
186 <td class="backToTop headerTD">
187 <a href="javascript:scrollToTop();">
188 <xsl:text disable-output-escaping="yes">&#9650;</xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.back_to_top')"/>
189 </a>
190 </td>
191 </xsl:if>
192 </tr></table>
193
194 <div id="doc{@nodeID}"><!-- *** -->
195 <xsl:choose>
196 <xsl:when test="/page/pageRequest/paramList/param[@name = 'ed']/@value = '1' or /page/pageResponse/document/@selectedNode = @nodeID">
197 <xsl:attribute name="class">
198 <xsl:text>sectionContainer hasText</xsl:text>
199 </xsl:attribute>
200 <xsl:attribute name="style">
201 <xsl:text>display:block;</xsl:text>
202 </xsl:attribute>
203 </xsl:when>
204 <xsl:when test="/page/pageRequest/paramList/param[@name = 'ed']/@value = '1' or util:oidIsMatchOrParent(@nodeID, /page/pageResponse/document/@selectedNode)">
205 <xsl:attribute name="class">
206 <xsl:text>sectionContainer noText</xsl:text>
207 </xsl:attribute>
208 <xsl:attribute name="style">
209 <xsl:text>display:block;</xsl:text>
210 </xsl:attribute>
211 </xsl:when>
212 <xsl:otherwise>
213 <xsl:attribute name="class">
214 <xsl:text>sectionContainer noText</xsl:text>
215 </xsl:attribute>
216 <xsl:attribute name="style">
217 <xsl:text>display:none;</xsl:text>
218 </xsl:attribute>
219 </xsl:otherwise>
220 </xsl:choose>
221
222 <xsl:choose>
223 <xsl:when test="$canDoEditing = 'true' and $editingTurnedOn = 'true'">
224 <table id="meta{@nodeID}">
225 <xsl:attribute name="style">
226 <xsl:choose>
227 <xsl:when test="/page/pageRequest/paramList/param[@name = 'dmd']/@value = 'true'">
228 <xsl:text>display:block;</xsl:text>
229 </xsl:when>
230 <xsl:otherwise>
231 <xsl:text>display:none;</xsl:text>
232 </xsl:otherwise>
233 </xsl:choose>
234 </xsl:attribute>
235 <xsl:value-of select="util:clearMetadataStorage()"/>
236 <xsl:for-each select="metadataList/metadata">
237 <xsl:sort select="@name"/>
238 <tr>
239 <td class="metaTableCellName"><xsl:value-of select="@name"/></td>
240 <td class="metaTableCell"> <textarea autocomplete="off"><xsl:attribute name="class">metaTableCellArea <xsl:value-of select="translate(@name, '.-', '')"/></xsl:attribute><xsl:value-of select="."/></textarea></td>
241 </tr>
242 </xsl:for-each>
243 </table>
244 <xsl:if test="$isMapGPSEditingAllowed = '1'">
245 <div id="map-and-controls-{@nodeID}" tabindex="-1">
246 <div id="map-{@nodeID}" style="height: 300px;"><xsl:text> </xsl:text></div>
247
248
249 <div id="ControlPanel-{@nodeID}" class="ControlPanel" >
250 <div id="ControlButtons">
251
252 <button onclick="gsmap_store['map-{@nodeID}'].deleteAllShapes()" >Clear All</button>
253 <button onclick="gsmap_store['map-{@nodeID}'].deleteSelectedShapes()" >Delete Selected</button>
254 <button onclick="gsmap_store['map-{@nodeID}'].mapEditorHistory.undo()" >Undo</button>
255 <button onclick="gsmap_store['map-{@nodeID}'].mapEditorHistory.redo()" >Redo</button>
256 <input type="checkbox" name="draggableCB" id="draggableCB-{@nodeID}" value="false" /> Lock all shapes location <br/>
257 </div>
258
259 <div id="SecondRow">
260 <div id="LineThickness">
261 <p class="valueEditor">Line thickness:
262 <div class="valueChanger">
263 <input type="number" class="valueInput" id="thicknessRangeVal-{@nodeID}" min="1.00" max="5.00" value="1.00" step="0.01" />
264 <span class="unit" style="display:none">%</span>
265 <!-- % sign added above, to keep the thickness field width equal to that of the opacity field -->
266 <!-- setting the step attribute to 0.01 means we allow 2 decimal places
267 (then Firefox won't make the box red/invalid for values with 2 dec places)
268 -->
269 </div>
270 <input type="range" size="2" min="20" max="100" value="1" class="slider" id="thicknessRange-{@nodeID}" />
271 </p>
272 </div>
273
274 <div id="ColourOpacity">
275 <p class="valueEditor">Colour opacity:
276 <div class="valueChanger">
277 <input type="number" class="valueInput" id="opacityRangeVal-{@nodeID}" min="0.0" max="100.0" value="40" />
278 <span class="unit">%</span>
279 </div>
280 <input type="range" min="0" max="100" value="40" class="slider" id="colourOpacity-{@nodeID}" />
281 </p>
282 </div>
283 </div>
284 <div id = "ThirdRow">
285 <div id="FillColour">
286 <p> Fill Colour:</p> <div id="color-palette1-{@nodeID}"><xsl:text> </xsl:text></div>
287 </div>
288 </div>
289 <div id = "FourthRow">
290 <p>Label Text:
291 <input type="text" class="description" id="description-{@nodeID}" value="" />
292 </p>
293 </div>
294
295 </div>
296 <!--
297 <div id="style-selector-control-{@nodeID}" class="map-control">
298 <select id="style-selector-{@nodeID}" class="selector-control">
299 <option value="default" selected="selected">Default</option>
300 <option value="silver">Silver</option>
301 <option value="night">Night mode</option>
302 <option value="retro">Retro</option>
303 <option value="paleDawn">Pale Dawn</option>
304 <option value="avocadoWorld">Avocado World</option>
305 <option value="bright">Bright</option>
306 <option value="turquoise">Turquoise</option>
307 <option value="hiding">Hide features</option>
308 </select>
309 </div>
310 -->
311 </div>
312 </xsl:if>
313 <xsl:call-template name="sectionContentForEditing"/>
314 </xsl:when>
315 <xsl:otherwise>
316 <xsl:choose>
317 <xsl:when test="../../document">
318 <xsl:call-template name="topLevelSectionContent"/>
319 </xsl:when>
320 <xsl:otherwise>
321 <xsl:call-template name="sectionContent"/>
322 </xsl:otherwise>
323 </xsl:choose>
324 </xsl:otherwise>
325 </xsl:choose>
326 <xsl:if test="documentNode">
327 <xsl:for-each select="documentNode">
328 <xsl:call-template name="wrapDocumentNodes"/>
329 </xsl:for-each>
330 </xsl:if>
331 </div>
332 </xsl:template>
333
334 <xsl:template name="javascriptForDocumentView">
335 <script type="text/javascript" src="interfaces/{$interface_name}/js/utility_scripts.js"><xsl:text> </xsl:text></script>
336 <script type="text/javascript" src="interfaces/{$interface_name}/js/document_scripts.js"><xsl:text> </xsl:text></script>
337 <gsf:metadata name="Thumb" hidden="true"/>
338 <script type="text/javascript">
339 <xsl:text disable-output-escaping="yes">
340 function goToAnchor(sectionID,anchor)
341 {
342 var docIdentifier = '</xsl:text><xsl:value-of select="//documentNode[@nodeType = 'root']/@nodeID"/><xsl:text disable-output-escaping="yes">';
343 focusAnchor(docIdentifier + "."+ sectionID,0,1,anchor);
344 }
345 </xsl:text>
346 </script>
347 <xsl:call-template name="customJavascriptForDocumentView"/>
348 </xsl:template>
349
350 <!-- Use this to add in extra javascript/files for an interface, site, collection -->
351 <xsl:template name="customJavascriptForDocumentView">
352 </xsl:template>
353
354 <xsl:template name="javascriptForDocumentEditing">
355 <!-- <script type="text/javascript" src="interfaces/{$interface_name}/js/documentmaker_scripts.js"><xsl:text> </xsl:text></script>-->
356 <script type="text/javascript" src="interfaces/{$interface_name}/js/documentedit_scripts.js"><xsl:text> </xsl:text></script>
357 <script type="text/javascript" src="interfaces/{$interface_name}/js/documentedit_scripts_util.js"><xsl:text> </xsl:text></script>
358 <script type="text/javascript" src="interfaces/{$interface_name}/js/map-scripts-shapes-util.js"><xsl:text> </xsl:text></script>
359 <script type="text/javascript" src="interfaces/{$interface_name}/js/map-scripts-editor-history.js"><xsl:text> </xsl:text></script>
360 <script type="text/javascript" src="interfaces/{$interface_name}/js/map-scripts-editor-themes.js"><xsl:text> </xsl:text></script>
361 <!-- LEAVE THIS NEXT LINE IN, IF USING CUSTOM OVERLAYS TO SHOW LABELS ON THE MAP -->
362 <!--<script type="text/javascript" src="interfaces/{$interface_name}/js/label-overlay-class.js"><xsl:text> </xsl:text></script>-->
363 <script type="text/javascript" src="interfaces/{$interface_name}/js/map-scripts-editor.js"><xsl:text> </xsl:text></script>
364 <script type="text/javascript" src="interfaces/{$interface_name}/js/hierarchy.js"><xsl:text> </xsl:text></script>
365
366 <link rel="stylesheet" href="interfaces/{$interface_name}/style/map-editors.css" type="text/css"/>
367
368 <script type="text/javascript">
369 <xsl:text disable-output-escaping="yes">
370
371 $(window).on("load", function()
372 {
373 if(gs.cgiParams.docEdit == "1")
374 {
375 readyPageForEditing(</xsl:text><xsl:value-of select="$isMapGPSEditingAllowed"/><xsl:text disable-output-escaping="yes">);
376 }
377 });
378 </xsl:text>
379 <!-- download and process hierarchy files -->
380 <xsl:text disable-output-escaping="yes">$(document).ready(function(){</xsl:text>
381 <xsl:for-each select="//classifier[@hfile]">
382 <xsl:if test="@hfile != ''">
383 <xsl:text disable-output-escaping="yes">downloadAndProcessHierarchyFile('</xsl:text>
384 <xsl:text>sites/localsite/collect/</xsl:text><xsl:value-of select="$collName"/><xsl:text>/etc/</xsl:text><xsl:value-of select="@hfile"/>
385 <xsl:text disable-output-escaping="yes">','</xsl:text><xsl:value-of select="@metadata"/><xsl:text disable-output-escaping="yes">');</xsl:text>
386 </xsl:if>
387 </xsl:for-each>
388 <xsl:text disable-output-escaping="yes">});</xsl:text>
389
390 </script>
391 <xsl:call-template name="customJavascriptForDocumentEditing"/>
392 </xsl:template>
393
394 <!-- Use this to add in extra javascript/files for an interface, site, collection -->
395 <xsl:template name="customJavascriptForDocumentEditing">
396 </xsl:template>
397
398 <!-- the page content -->
399 <xsl:template match="/page/pageResponse/document">
400 <xsl:if test="$bookswitch = 'off'">
401 <xsl:call-template name="javascriptForDocumentView"/>
402 <gslib:langfrag name="doc"/>
403 <xsl:if test="/page/pageResponse/collection[@name = $collName]/metadataList/metadata[@name = 'tidyoption'] = 'tidy'">
404 <script type="text/javascript">
405 <xsl:text disable-output-escaping="yes">
406 if(document.URL.indexOf("book=on") != -1)
407 {
408 loadBook();
409 }
410 </xsl:text>
411 </script>
412 </xsl:if>
413 </xsl:if>
414 <xsl:if test="$canDoEditing = 'true'">
415 <xsl:call-template name="javascriptForDocumentEditing"/>
416 <gslib:langfrag name="dse"/>
417 <gslib:langfrag name="de"/>
418 </xsl:if>
419
420 <xsl:if test="$bookswitch = 'off'">
421 <div id="bookdiv" style="visibility:hidden; height:0px; display:inline;"><xsl:text> </xsl:text></div>
422
423 <div id="float-anchor" style="width: 30%; min-width:180px; float:right; margin: 0 0 10px 20px;">
424 <xsl:if test="$canDoEditing = 'true'">
425 <xsl:call-template name="editBar"/>
426 </xsl:if>
427 <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'">
428 <xsl:call-template name="rightSidebarTOC"/>
429 </xsl:if>
430 <!-- add in some text just in case nothing has been added to this div-->
431 <xsl:text> </xsl:text>
432 </div>
433 <xsl:if test="$canDoEditing = 'true'">
434 <script type="text/javascript">
435 if (keep_editing_controls_visible) {
436 $(function() {
437 moveScroller();
438 });
439 }
440 </script>
441 </xsl:if>
442 </xsl:if>
443
444 <!-- display the document -->
445 <xsl:choose>
446 <xsl:when test="@external != ''">
447 <xsl:call-template name="externalPage">
448 <xsl:with-param name="external" select="@external"/>
449 </xsl:call-template>
450 </xsl:when>
451 <xsl:when test="$bookswitch = 'flashxml'">
452 <xsl:call-template name="documentNodeFlashXML"/>
453 </xsl:when>
454 <xsl:when test="$bookswitch = 'on'">
455 <div id="bookdiv" style="display:inline;"><xsl:text> </xsl:text></div>
456 <!-- *** in document-scripts.js *** -->
457 <script type="text/javascript">
458 <xsl:text disable-output-escaping="yes">
459 if(document.URL.indexOf("book=on") != -1)
460 {
461 loadBook();
462 }
463 </xsl:text>
464 </script>
465 </xsl:when>
466 <!-- we want to do this stuff even if docType is simple or paged. Don't want to just set dt=hierarchy as that gives other unnecessary stuff-->
467 <!-- This is the first choice from wrappedDocument template-->
468 <xsl:when test="$canDoEditing = 'true' and $editingTurnedOn = 'true' ">
469 <div id="gs-document" style="width: 67%">
470 <xsl:call-template name="documentPre"/>
471 <div id="gs-document-text" class="documenttext" collection="{/page/pageResponse/collection/@name}"><!-- *** -->
472 <xsl:choose>
473 <xsl:when test="@docType='simple'">
474 <xsl:call-template name="wrapDocumentNodes"/>
475 </xsl:when>
476 <xsl:otherwise>
477 <xsl:for-each select="documentNode">
478 <xsl:call-template name="wrapDocumentNodes"/>
479 </xsl:for-each>
480 </xsl:otherwise>
481 </xsl:choose>
482 </div>
483 <xsl:call-template name="documentPost"/>
484 </div>
485 </xsl:when>
486 <xsl:when test="@docType='simple'">
487 <xsl:call-template name="documentHeading"/><br/>
488 <xsl:call-template name="documentContent"/>
489 <br /><xsl:call-template name="userCommentsSection"/>
490 </xsl:when>
491 <xsl:otherwise> <!-- display the standard greenstone document -->
492 <xsl:call-template name="wrappedDocument"/>
493 <br /><xsl:call-template name="userCommentsSection"/>
494 </xsl:otherwise>
495 </xsl:choose>
496 </xsl:template>
497
498 <xsl:template name="wrappedDocument">
499 <xsl:choose>
500 <!-- NOTE: alb = ajax load bypass -->
501 <!--
502 If we have asked for expanded document, then do this.
503 OR If the docType is hierarchy and we want to bypass the ajax load then do this
504 OR If the docType is hierarchy and we have asked for the top level document then do this
505 -->
506 <xsl:when test="/page/pageRequest/paramList/param[@name = 'ed']/@value = '1' or (/page/pageResponse/document/@docType = 'hierarchy' and (/page/pageRequest/paramList/param[@name = 'alb']/@value = '1' or (string-length(/page/pageRequest/paramList/param[@name = 'd']/@value) > 0 and not(util:contains(/page/pageResponse/document/@selectedNode, '.')))))">
507 <div id="gs-document">
508 <xsl:call-template name="documentPre"/>
509 <div id="gs-document-text" class="documenttext" collection="{/page/pageResponse/collection/@name}"><!-- *** -->
510 <xsl:for-each select="documentNode">
511 <xsl:call-template name="wrapDocumentNodes"/>
512 </xsl:for-each>
513 </div>
514 <xsl:call-template name="documentPost"/>
515 </div>
516 </xsl:when>
517 <xsl:when test="/page/pageResponse/document/@docType = 'paged' or /page/pageResponse/document/@docType = 'pagedhierarchy'">
518 <div id="gs-document">
519 <div id="tocLoadingImage" style="text-align:center;">
520 <img src="{util:getInterfaceText($interface_name, /page/@lang, 'loading_image')}"/><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.loading')"/><xsl:text>...</xsl:text>
521 </div>
522 </div>
523 <script type="text/javascript">
524 <xsl:text disable-output-escaping="yes">
525 $(window).on("load", function()
526 {
527 var sectionID = gs.cgiParams.d;
528 var callbackFunction = null;
529 if(sectionID.indexOf(".") != -1)
530 {
531 callbackFunction = function()
532 {
533 focusSection(sectionID);
534 };
535 }
536 else {
537 callbackFunction = function()
538 {
539
540 expandAndExecute(sectionID+".1", null, null, null);
541 };
542 }
543 var docID = sectionID.replace(/([^.]*)\..*/, "$1");
544 var url = gs.xsltParams.library_name + "?a=d&amp;c=" + gs.cgiParams.c + "&amp;excerptid=gs-document&amp;dt=hierarchy&amp;d=" + docID;
545 if(gs.cgiParams.p_s) {
546 url += "&amp;p.s="+gs.cgiParams.p_s;
547 }
548 loadTopLevelPage(callbackFunction, url);
549 });
550 </xsl:text>
551 </script>
552 </xsl:when>
553 <xsl:otherwise>
554 <div id="gs-document">
555 <div id="tocLoadingImage" style="text-align:center;">
556 <img src="{util:getInterfaceText($interface_name, /page/@lang, 'loading_image')}"/><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.loading')"/><xsl:text>...</xsl:text>
557 </div>
558 </div>
559 <script type="text/javascript">
560 <xsl:text disable-output-escaping="yes">
561 $(window).on("load", function()
562 {
563 loadTopLevelPage(function()
564 {
565 //Don't focus the section until the table of contents is loaded
566 var tocCheck = function()
567 {
568 if(gs.variables.tocLoaded)
569 {
570 focusSection("</xsl:text><xsl:value-of select="/page/pageResponse/document/@selectedNode"/><xsl:text disable-output-escaping="yes">");
571 }
572 else
573 {
574 setTimeout(tocCheck, 500);
575 }
576 }
577 tocCheck();
578 });
579 });
580 </xsl:text>
581 </script>
582 </xsl:otherwise>
583 </xsl:choose>
584
585 <div class="clear"><xsl:text> </xsl:text></div>
586 </xsl:template>
587
588 <xsl:template name="editBar">
589 <table style="width:100%; border:none;" id="editBar" class="ui-widget-content"><tr>
590 <td id="editBarLeft" style="width:70%"><xsl:text> </xsl:text></td>
591 <td id="editBarRight">
592 <div style="text-align:center;">
593 <!-- edit structure button -->
594 <!-- comment this out as its not working -->
595 <!-- <div style="margin:5px;" class="ui-state-default ui-corner-all">
596 <a style="padding: 3px; text-decoration:none;" href="{$library_name}?a=g&amp;sa=documentbasket&amp;c=&amp;s=DisplayDocumentList&amp;rt=r&amp;p.c={/page/pageResponse/collection/@name}&amp;docToEdit={/page/pageResponse/document/documentNode/@nodeID}"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'dse.edit_structure')"/></a>
597 </div>-->
598 <!-- edit content button -->
599 <div style="margin:5px;" class="ui-state-default ui-corner-all">
600 <a id="editContentButton" style="padding: 3px; text-decoration:none;">
601 <xsl:attribute name="href">
602 <xsl:value-of select="$library_name"/>
603 <xsl:text>/collection/</xsl:text>
604 <xsl:value-of select="$collName"/>
605 <xsl:text>/document/</xsl:text>
606 <xsl:choose>
607 <xsl:when test="count(//documentNode) > 0">
608 <xsl:value-of select="/page/pageResponse/document/documentNode/@nodeID"/>
609 </xsl:when>
610 <xsl:otherwise>
611 <xsl:value-of select="/page/pageResponse/document/@nodeID"/>
612 </xsl:otherwise>
613 </xsl:choose>
614 <xsl:if test="not(/page/pageRequest/paramList/param[@name = 'docEdit']/@value = '1')">
615 <xsl:text>?ed=1&amp;docEdit=1</xsl:text>
616 </xsl:if>
617 </xsl:attribute>
618 <xsl:choose>
619 <xsl:when test="/page/pageRequest/paramList/param[@name = 'docEdit']/@value = '1'">
620 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'de.hide_editor')"/>
621 </xsl:when>
622 <xsl:otherwise>
623 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'de.edit_content')"/>
624 </xsl:otherwise>
625 </xsl:choose>
626 </a>
627 </div>
628 </div>
629 </td>
630 </tr></table>
631 <gslib:langfrag name="dse"/>
632 </xsl:template>
633
634 <xsl:template name="wrappedSectionImage">
635 <gsf:variable name="screenImageWidth"><gsf:metadata name="ScreenWidth"/></gsf:variable>
636 <gsf:variable name="screenImageHeight"><gsf:metadata name="ScreenHeight"/></gsf:variable>
637 <gsf:variable name="imageWidth"><gsf:metadata name="ImageWidth"/></gsf:variable>
638 <gsf:variable name="imageHeight"><gsf:metadata name="ImageHeight"/></gsf:variable>
639
640 <xsl:choose>
641 <!-- **** Should the test of 'Source' perhaps be changed to 'Image' to be more consistent with usage else where for showing an web friendy Image-->
642 <xsl:when test="metadataList/metadata[@name = 'Screen'] and metadataList/metadata[@name = 'Source'] and ($imageWidth div $screenImageWidth > 1.2) and (not(/page/pageResponse/format[@type='display']/gsf:option[@name='disableZoom']) or /page/pageResponse/format[@type='display']/gsf:option[@name='disableZoom']/@value='false')">
643 <gsf:div id="tidyDiv" />
644 <!-- adding a div with clear:both when the image doesn't nicely fit in beside the side bar. Otherwise, the divs stays up, but the image moves down and everything looks and acts weird. -->
645 <script type="text/javascript">
646 <xsl:text disable-output-escaping="yes">
647
648 var containerWidth = document.getElementById("container").offsetWidth;
649 var sidebarWidth = document.getElementById("rightSidebar").offsetWidth;
650 if (containerWidth - sidebarWidth &lt; </xsl:text><xsl:value-of select="$screenImageWidth"/><xsl:text disable-output-escaping="yes">) {
651 $("#tidyDiv").css("clear", "both");
652 }
653 </xsl:text>
654 </script>
655 <gsf:div id="image{@nodeID}">
656 <!-- when we ask for an individual section content we set ed=1. putting this test here prevents downloading all the screen and full images for each section of the document when we are just looking at the contents list. ed is not set for simple docs, so do this if doctype is simple -->
657 <xsl:if test="/page/pageResponse/document[@docType='simple'] or /page/pageRequest/paramList/param[@name = 'ed']/@value='1'">
658
659 <div id="wrap{util:replace(@nodeID, '.', '_')}" class="zoomImage" style="position:relative; width: {$screenImageWidth}px; height: {$screenImageHeight}px;">
660 <div id="small{util:replace(@nodeID, '.', '_')}" style="position:relative; width: {$screenImageWidth}px; height: {$screenImageHeight}px;">
661 <gsf:link type="source" target="_blank"><gsf:image type="screen"/></gsf:link>
662 </div>
663 <div id="mover{util:replace(@nodeID, '.', '_')}" style="border: 1px solid green; position: absolute; top: 0; left: 0; width: 598px; height: 598px; overflow: hidden; z-index: 100; background: white; display: none;">
664 <div id="overlay{util:replace(@nodeID, '.', '_')}" style="width: 600px; height: 600px; position: absolute; top: 0; left: 0; z-index: 200;">
665 <xsl:text> </xsl:text>
666 </div>
667 <div id="large{util:replace(@nodeID, '.', '_')}" style="position: relative; width: {$imageWidth}px; height: {$imageHeight}px;">
668 <gsf:link type="source"><gsf:image type="image"/></gsf:link>
669 </div>
670 </div>
671 </div>
672 <script type="text/javascript">
673 <xsl:text disable-output-escaping="yes">
674 {
675 var nodeID = "</xsl:text><xsl:value-of select="@nodeID"/><xsl:text disable-output-escaping="yes">";
676 nodeID = nodeID.replace(/\./g, "_");
677
678 var bigHeight = </xsl:text><xsl:value-of select="$imageHeight"/><xsl:text disable-output-escaping="yes">;
679 var smallHeight = </xsl:text><xsl:value-of select="$screenImageHeight"/><xsl:text disable-output-escaping="yes">;
680
681 var multiplier = bigHeight / smallHeight;
682
683 $("#wrap" + nodeID).anythingZoomer({
684 smallArea: "#small" + nodeID,
685 largeArea: "#large" + nodeID,
686 zoomPort: "#overlay" + nodeID,
687 mover: "#mover" + nodeID,
688 expansionSize:50,
689 speedMultiplier:multiplier
690 });
691
692 $("#zoomOptions input").prop("checked", false);
693 $("#zoomOptions").css("display", "");
694 }
695 </xsl:text>
696 </script>
697 </xsl:if>
698 </gsf:div>
699 </xsl:when>
700 <xsl:otherwise>
701 <gsf:div id="image{@nodeID}">
702 <xsl:attribute name="style">
703 <xsl:choose>
704 <xsl:when test="/page/pageRequest/paramList/param[@name = 'view']/@value = 'text'">
705 <xsl:text>display:none;</xsl:text>
706 </xsl:when>
707 <xsl:otherwise>
708 <xsl:text>display:block;</xsl:text>
709 </xsl:otherwise>
710 </xsl:choose>
711 </xsl:attribute>
712 <xsl:call-template name="sectionImage"/><xsl:text> </xsl:text>
713 </gsf:div>
714 </xsl:otherwise>
715 </xsl:choose>
716 </xsl:template>
717
718 <!-- The default template for displaying the document node text -->
719 <!-- equivalent to gsf:text -->
720 <xsl:template name="documentNodeText">
721 <xsl:param name="force">0</xsl:param>
722 <!-- Hides the "This document has no text." message -->
723 <xsl:variable name="noText"><gsf:metadata name="NoText"/></xsl:variable>
724 <xsl:choose>
725 <xsl:when test="$force = '1' or not($noText = '1')">
726
727 <!-- Section text -->
728 <xsl:for-each select="nodeContent">
729 <xsl:call-template name="displayMarkedUpTextAndAnnotations"/>
730 </xsl:for-each>
731 </xsl:when>
732 <xsl:when test="$noText = '1' and not(metadataList/metadata[@name='ImageType'])">
733 <gsf:link type="source"><gsf:metadata name="Source"/></gsf:link>
734 </xsl:when>
735 </xsl:choose>
736 <xsl:text> </xsl:text>
737 </xsl:template>
738
739 <!-- The default template for displaying the document node text in
740 editing mode -->
741 <!-- Note: we need to put some content in if the nodeContent is empty, otherwise you end up with an empty div, it gets changed to <div> and the ckeditor ends up being attached to everything else afterwards. -->
742 <!-- equivalent to gsf:text -->
743 <xsl:template name="documentNodeTextForEditing">
744 <!-- Section text -->
745 <xsl:for-each select="nodeContent">
746 <xsl:if test="not(node())"><gsf:space/></xsl:if>
747 <xsl:for-each select="node()">
748 <xsl:choose>
749 <xsl:when test="not(name())">
750 <xsl:value-of select="." disable-output-escaping="yes"/>
751 </xsl:when>
752 <xsl:otherwise>
753 <xsl:apply-templates/>
754 </xsl:otherwise>
755 </xsl:choose>
756 </xsl:for-each>
757 </xsl:for-each>
758 </xsl:template>
759
760 <!-- Used to produce a version of the page in a format that can be read by the realistic books plugin -->
761 <xsl:template name="documentNodeFlashXML">
762 <xsl:text disable-output-escaping="yes">
763 &lt;Section&gt;
764 &lt;Description&gt;
765 &lt;Metadata name="Title"&gt;
766 </xsl:text>
767 <xsl:value-of select="normalize-space(metadataList/metadata[@name = 'Title'])"/>
768 <xsl:text disable-output-escaping="yes">
769 &lt;/Metadata&gt;
770 &lt;/Description&gt;
771 </xsl:text>
772
773 <xsl:value-of select="normalize-space(nodeContent)" disable-output-escaping="yes"/>
774
775 <xsl:for-each select="documentNode">
776 <xsl:call-template name="documentNodeFlashXML"/>
777 </xsl:for-each>
778
779 <xsl:text disable-output-escaping="yes">
780 &lt;/Section&gt;
781 </xsl:text>
782 </xsl:template>
783
784 <xsl:template name="externalPage">
785 <xsl:param name="external"/>
786 <xsl:variable name="go_forward_link">
787 <a>
788 <xsl:attribute name="href">
789 <xsl:value-of select="$external"/>
790 </xsl:attribute>
791 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'external.go_forward')"/>
792 </a>
793 </xsl:variable>
794 <h2><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'external.title')"/></h2>
795 <p><xsl:value-of select="util:getInterfaceTextWithDOM($interface_name, /page/@lang, 'external.text', $go_forward_link)" disable-output-escaping="yes"/></p>
796 </xsl:template>
797
798 <xsl:template match="/page"><gslib:displayErrorsIfAny/><xsl:apply-templates select="/page/pageResponse/document"/></xsl:template> <!-- this to be deleted eventually -->
799
800 <xsl:template name="documentPre">
801 <xsl:if test="/page/pageResponse/format[@type='display' or @type='browse' or @type='search']/gsf:option[@name='mapEnabled']/@value = 'true'">
802 <xsl:call-template name="mapFeatures"/>
803 </xsl:if>
804 </xsl:template>
805
806 <xsl:template name="documentPost">
807 <!-- empty by default, to be overridden as needed -->
808 </xsl:template>
809
810
811 <xsl:template name="mapFeatures">
812 <div id="map_canvas" class="map_canvas_full"><xsl:text> </xsl:text></div>
813
814 <xsl:choose>
815 <!-- HIERARCHICAL DOCUMENTS -->
816 <xsl:when test="count(//documentNode) > 0">
817 <xsl:for-each select="documentNode">
818 <xsl:call-template name="mapPlacesNearHere"/>
819 </xsl:for-each>
820 </xsl:when>
821 <!-- SIMPLE DOCUMENTS -->
822 <xsl:otherwise>
823 <xsl:call-template name="mapPlacesNearHere"/>
824 </xsl:otherwise>
825 </xsl:choose>
826
827 <div id="jsonNodes" style="display:none;">
828 <xsl:text>[</xsl:text>
829 <xsl:choose>
830 <!-- HIERARCHICAL DOCUMENTS -->
831 <xsl:when test="count(//documentNode) > 0">
832 <xsl:for-each select="//documentNode">
833 <xsl:if test="(metadataList/metadata[@name = 'Latitude'] and metadataList/metadata[@name = 'Longitude']) or metadataList/metadata[@name = 'Coordinate'] or metadataList/metadata[@name = 'GPS.mapOverlay'] or metadataList/metadata[@name = 'descendants_GPS.mapOverlay']">
834 <xsl:text>{</xsl:text>
835 <xsl:text disable-output-escaping="yes">"nodeID":"</xsl:text><xsl:value-of select="@nodeID"/><xsl:text disable-output-escaping="yes">",</xsl:text>
836 <xsl:text disable-output-escaping="yes">"title":"</xsl:text><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Title']"/>
837 <xsl:text disable-output-escaping="yes">"</xsl:text>
838 <xsl:if test="metadataList/metadata[@name = 'Latitude'] and metadataList/metadata[@name = 'Longitude']">
839 <xsl:text disable-output-escaping="yes">,</xsl:text>
840 <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>
841 <xsl:text disable-output-escaping="yes">"lng":</xsl:text><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Longitude']"/>
842 </xsl:if>
843 <!--
844 <xsl:if test="metadataList/metadata[@name = 'Coordinate']">
845 <xsl:text disable-output-escaping="yes">,</xsl:text>
846 <xsl:text disable-output-escaping="yes">"coords":</xsl:text>
847 <xsl:text>[</xsl:text>
848 <xsl:for-each select="metadataList/metadata[@name = 'Coordinate']">
849 <xsl:text disable-output-escaping="yes">"</xsl:text>
850 <xsl:value-of disable-output-escaping="yes" select="current()"/>
851 <xsl:text disable-output-escaping="yes">"</xsl:text>
852 <xsl:text disable-output-escaping="yes">,</xsl:text>
853 </xsl:for-each>
854 <xsl:text>]</xsl:text>
855 </xsl:if>
856 -->
857 <xsl:if test="metadataList/metadata[@name = 'GPS.mapOverlay']">
858 <xsl:text disable-output-escaping="yes">,</xsl:text>
859 <xsl:text disable-output-escaping="yes">"mapoverlay":</xsl:text>
860 <xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'GPS.mapOverlay']"/>
861 </xsl:if>
862
863 <xsl:if test="metadataList/metadata[@name = 'descendants_GPS.mapOverlay']">
864 <xsl:variable name="count"><xsl:value-of select="count(metadataList/metadata[@name = 'descendants_GPS.mapOverlay'])"/></xsl:variable>
865 <xsl:text disable-output-escaping="yes">,</xsl:text>
866 <xsl:text disable-output-escaping="yes">"descendantsMapoverlays":[</xsl:text>
867 <xsl:for-each select="metadataList/metadata[@name = 'descendants_GPS.mapOverlay']">
868 <xsl:value-of disable-output-escaping="yes" select="current()"/>
869 <xsl:if test="not(position() = $count)">
870 <xsl:text disable-output-escaping="yes">,</xsl:text>
871 </xsl:if>
872 </xsl:for-each>
873 <xsl:text disable-output-escaping="yes">]</xsl:text>
874 </xsl:if>
875
876 <xsl:text>}</xsl:text>
877
878 <xsl:if test="not(position() = count(//documentNode))">
879 <xsl:text>,</xsl:text>
880 </xsl:if>
881
882 </xsl:if>
883 </xsl:for-each>
884 </xsl:when>
885 <!-- SIMPLE DOCUMENTS -->
886 <xsl:otherwise>
887 <xsl:for-each select="/page/pageResponse/document">
888 <xsl:if test="(metadataList/metadata[@name = 'Latitude'] and metadataList/metadata[@name = 'Longitude']) or metadataList/metadata[@name = 'Coordinate'] or metadataList/metadata[@name = 'GPS.mapOverlay'] or metadataList/metadata[@name = 'descendants_GPS.mapOverlay']">
889 <xsl:text>{</xsl:text>
890 <xsl:text disable-output-escaping="yes">"nodeID":"</xsl:text><xsl:value-of select="@selectedNode"/><xsl:text disable-output-escaping="yes">",</xsl:text>
891 <xsl:text disable-output-escaping="yes">"title":"</xsl:text><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Title']"/>
892 <xsl:text disable-output-escaping="yes">"</xsl:text>
893 <xsl:if test="metadataList/metadata[@name = 'Latitude'] and metadataList/metadata[@name = 'Longitude']">
894 <xsl:text disable-output-escaping="yes">,</xsl:text>
895 <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>
896 <xsl:text disable-output-escaping="yes">"lng":</xsl:text><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Longitude']"/>
897 </xsl:if>
898 <!--
899 <xsl:if test="metadataList/metadata[@name = 'Coordinate']">
900 <xsl:text disable-output-escaping="yes">,</xsl:text>
901 <xsl:text disable-output-escaping="yes">"coords":</xsl:text>
902 <xsl:text>[</xsl:text>
903 <xsl:for-each select="metadataList/metadata[@name = 'Coordinate']">
904 <xsl:text disable-output-escaping="yes">"</xsl:text>
905 <xsl:value-of disable-output-escaping="yes" select="current()"/>
906 <xsl:text disable-output-escaping="yes">"</xsl:text>
907 <xsl:text disable-output-escaping="yes">,</xsl:text>
908 </xsl:for-each>
909 <xsl:text>]</xsl:text>
910 </xsl:if>
911 -->
912 <xsl:if test="metadataList/metadata[@name = 'GPS.mapOverlay']">
913 <xsl:text disable-output-escaping="yes">,</xsl:text>
914 <xsl:text disable-output-escaping="yes">"mapoverlay":</xsl:text>
915 <xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'GPS.mapOverlay']"/>
916 </xsl:if>
917
918 <xsl:if test="metadataList/metadata[@name = 'descendants_GPS.mapOverlay']">
919 <xsl:variable name="count"><xsl:value-of select="count(metadataList/metadata[@name = 'descendants_GPS.mapOverlay'])"/></xsl:variable>
920 <xsl:text disable-output-escaping="yes">,</xsl:text>
921 <xsl:text disable-output-escaping="yes">"descendantsMapoverlays":[</xsl:text>
922 <xsl:for-each select="metadataList/metadata[@name = 'descendants_GPS.mapOverlay']">
923 <xsl:value-of disable-output-escaping="yes" select="current()"/>
924 <xsl:if test="not(position() = $count)">
925 <xsl:text disable-output-escaping="yes">,</xsl:text>
926 </xsl:if>
927 </xsl:for-each>
928 <xsl:text disable-output-escaping="yes">]</xsl:text>
929 </xsl:if>
930
931 <xsl:text>}</xsl:text>
932 </xsl:if>
933 </xsl:for-each>
934 </xsl:otherwise>
935 </xsl:choose>
936 <xsl:text>]</xsl:text>
937 </div>
938
939 <!-- TODO: Why do we have to do this to see Coordinate meta appear in extraMetadataList on o=xml page, when Lat and Lng appear without doing the same???
940 Furthermore, map-tools.xsl already requests Coordinate meta, and map-tools.xsl is always included when format statement for collection in
941 search|browse|doc display view has mapEnabled=true -->
942 <gsf:metadata name="Coordinate" hidden="true"/>
943 <gsf:metadata name="GPS.mapOverlay" hidden="true"/>
944 <gsf:metadata name="GPS.mapOverlay" select="descendants" hidden="true"/>
945 </xsl:template>
946
947 <xsl:template name="mapPlacesNearHere">
948 <xsl:if test="metadataList/metadata[@name = 'Latitude'] and metadataList/metadata[@name = 'Longitude']">
949 <div style="background:#BBFFBB; padding: 5px; margin:0px auto; width:890px;">
950 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.map_nearby_docs')"/>
951 <img id="nearbyDocumentsToggle" style="margin-left:5px;" src="interfaces/{$interface_name}/images/expand.png">
952 <xsl:attribute name="onclick">
953 <xsl:text>performDistanceSearch('</xsl:text>
954 <xsl:value-of select="@nodeID"/>
955 <xsl:text>', '</xsl:text>
956 <gsf:metadata name="Latitude"/>
957 <xsl:text>', '</xsl:text>
958 <gsf:metadata name="Longitude"/>
959 <xsl:text>', 2);</xsl:text>
960 </xsl:attribute>
961 </img>
962 <div id="nearbyDocuments"><xsl:text> </xsl:text></div>
963 </div>
964 </xsl:if>
965
966 <xsl:if test="metadataList/metadata[@name = 'Coordinate']">
967 <div style="background:#BBFFBB; padding: 5px; margin:0px auto; width:890px;">
968 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.map_nearby_docs')"/>
969 <xsl:for-each select="metadataList/metadata[@name = 'Coordinate']">
970
971 <xsl:variable name="coordinate"><xsl:value-of select="current()"/></xsl:variable>
972
973
974 <img id="nearbyDocumentsToggle" style="margin-left:5px;" src="interfaces/{$interface_name}/images/expand.png">
975 <xsl:attribute name="onclick">
976 <xsl:text>performDistanceSearchWithCoordinates('</xsl:text>
977 <xsl:value-of select="@nodeID"/>
978 <xsl:text>', '</xsl:text>
979 <xsl:value-of select="$coordinate"/><!--<gsf:metadata name="Coordinate"/>-->
980 <xsl:text>', 2);</xsl:text>
981 </xsl:attribute>
982 </img>
983 </xsl:for-each>
984 <div id="nearbyDocuments"><xsl:text> </xsl:text></div>
985 </div>
986 </xsl:if>
987 </xsl:template>
988</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.