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

Last change on this file since 36979 was 36979, checked in by kjdon, 17 months ago

added in the displayErrorsIfAny template - now if you try to request a document page with an invalid id, you get the error, instead of an untitled empty document.

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