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

Last change on this file since 37023 was 37023, checked in by davidb, 15 months ago

Fix for the 'google' not defined JS error, caused by the fact that the Google map API JS file had not been included earlier with a <script> tag.

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
359 <xsl:if test="/page/pageResponse/format/gsf:option[@name='allowMapGPSEditing']/@value = 'true']">
360 <script type="text/javascript" src="interfaces/{$interface_name}/js/map-scripts-editor-history.js"><xsl:text> </xsl:text></script>
361 <script type="text/javascript" src="interfaces/{$interface_name}/js/map-scripts-editor-themes.js"><xsl:text> </xsl:text></script>
362 <!-- LEAVE THIS NEXT LINE IN, IF USING CUSTOM OVERLAYS TO SHOW LABELS ON THE MAP -->
363 <!--<script type="text/javascript" src="interfaces/{$interface_name}/js/label-overlay-class.js"><xsl:text> </xsl:text></script>-->
364 <script type="text/javascript" src="interfaces/{$interface_name}/js/map-scripts-editor.js"><xsl:text> </xsl:text></script>
365 <link rel="stylesheet" href="interfaces/{$interface_name}/style/map-editors.css" type="text/css"/>
366 </xsl:if>
367
368 <script type="text/javascript" src="interfaces/{$interface_name}/js/hierarchy.js"><xsl:text> </xsl:text></script>
369
370
371 <script type="text/javascript">
372 <xsl:text disable-output-escaping="yes">
373
374 $(window).on("load", function()
375 {
376 if(gs.cgiParams.docEdit == "1")
377 {
378 readyPageForEditing(</xsl:text><xsl:value-of select="$isMapGPSEditingAllowed"/><xsl:text disable-output-escaping="yes">);
379 }
380 });
381 </xsl:text>
382 <!-- download and process hierarchy files -->
383 <xsl:text disable-output-escaping="yes">$(document).ready(function(){</xsl:text>
384 <xsl:for-each select="//classifier[@hfile]">
385 <xsl:if test="@hfile != ''">
386 <xsl:text disable-output-escaping="yes">downloadAndProcessHierarchyFile('</xsl:text>
387 <xsl:text>sites/localsite/collect/</xsl:text><xsl:value-of select="$collName"/><xsl:text>/etc/</xsl:text><xsl:value-of select="@hfile"/>
388 <xsl:text disable-output-escaping="yes">','</xsl:text><xsl:value-of select="@metadata"/><xsl:text disable-output-escaping="yes">');</xsl:text>
389 </xsl:if>
390 </xsl:for-each>
391 <xsl:text disable-output-escaping="yes">});</xsl:text>
392
393 </script>
394 <xsl:call-template name="customJavascriptForDocumentEditing"/>
395 </xsl:template>
396
397 <!-- Use this to add in extra javascript/files for an interface, site, collection -->
398 <xsl:template name="customJavascriptForDocumentEditing">
399 </xsl:template>
400
401 <!-- the page content -->
402 <xsl:template match="/page/pageResponse/document">
403 <xsl:if test="$bookswitch = 'off'">
404 <xsl:call-template name="javascriptForDocumentView"/>
405 <gslib:langfrag name="doc"/>
406 <xsl:if test="/page/pageResponse/collection[@name = $collName]/metadataList/metadata[@name = 'tidyoption'] = 'tidy'">
407 <script type="text/javascript">
408 <xsl:text disable-output-escaping="yes">
409 if(document.URL.indexOf("book=on") != -1)
410 {
411 loadBook();
412 }
413 </xsl:text>
414 </script>
415 </xsl:if>
416 </xsl:if>
417 <xsl:if test="$canDoEditing = 'true'">
418 <xsl:call-template name="javascriptForDocumentEditing"/>
419 <gslib:langfrag name="dse"/>
420 <gslib:langfrag name="de"/>
421 </xsl:if>
422
423 <xsl:if test="$bookswitch = 'off'">
424 <div id="bookdiv" style="visibility:hidden; height:0px; display:inline;"><xsl:text> </xsl:text></div>
425
426 <div id="float-anchor" style="width: 30%; min-width:180px; float:right; margin: 0 0 10px 20px;">
427 <xsl:if test="$canDoEditing = 'true'">
428 <xsl:call-template name="editBar"/>
429 </xsl:if>
430 <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'">
431 <xsl:call-template name="rightSidebarTOC"/>
432 </xsl:if>
433 <!-- add in some text just in case nothing has been added to this div-->
434 <xsl:text> </xsl:text>
435 </div>
436 <xsl:if test="$canDoEditing = 'true'">
437 <script type="text/javascript">
438 if (keep_editing_controls_visible) {
439 $(function() {
440 moveScroller();
441 });
442 }
443 </script>
444 </xsl:if>
445 </xsl:if>
446
447 <!-- display the document -->
448 <xsl:choose>
449 <xsl:when test="@external != ''">
450 <xsl:call-template name="externalPage">
451 <xsl:with-param name="external" select="@external"/>
452 </xsl:call-template>
453 </xsl:when>
454 <xsl:when test="$bookswitch = 'flashxml'">
455 <xsl:call-template name="documentNodeFlashXML"/>
456 </xsl:when>
457 <xsl:when test="$bookswitch = 'on'">
458 <div id="bookdiv" style="display:inline;"><xsl:text> </xsl:text></div>
459 <!-- *** in document-scripts.js *** -->
460 <script type="text/javascript">
461 <xsl:text disable-output-escaping="yes">
462 if(document.URL.indexOf("book=on") != -1)
463 {
464 loadBook();
465 }
466 </xsl:text>
467 </script>
468 </xsl:when>
469 <!-- 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-->
470 <!-- This is the first choice from wrappedDocument template-->
471 <xsl:when test="$canDoEditing = 'true' and $editingTurnedOn = 'true' ">
472 <div id="gs-document" style="width: 67%">
473 <xsl:call-template name="documentPre"/>
474 <div id="gs-document-text" class="documenttext" collection="{/page/pageResponse/collection/@name}"><!-- *** -->
475 <xsl:choose>
476 <xsl:when test="@docType='simple'">
477 <xsl:call-template name="wrapDocumentNodes"/>
478 </xsl:when>
479 <xsl:otherwise>
480 <xsl:for-each select="documentNode">
481 <xsl:call-template name="wrapDocumentNodes"/>
482 </xsl:for-each>
483 </xsl:otherwise>
484 </xsl:choose>
485 </div>
486 <xsl:call-template name="documentPost"/>
487 </div>
488 </xsl:when>
489 <xsl:when test="@docType='simple'">
490 <xsl:call-template name="documentHeading"/><br/>
491 <xsl:call-template name="documentContent"/>
492 <br /><xsl:call-template name="userCommentsSection"/>
493 </xsl:when>
494 <xsl:otherwise> <!-- display the standard greenstone document -->
495 <xsl:call-template name="wrappedDocument"/>
496 <br /><xsl:call-template name="userCommentsSection"/>
497 </xsl:otherwise>
498 </xsl:choose>
499 </xsl:template>
500
501 <xsl:template name="wrappedDocument">
502 <xsl:choose>
503 <!-- NOTE: alb = ajax load bypass -->
504 <!--
505 If we have asked for expanded document, then do this.
506 OR If the docType is hierarchy and we want to bypass the ajax load then do this
507 OR If the docType is hierarchy and we have asked for the top level document then do this
508 -->
509 <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, '.')))))">
510 <div id="gs-document">
511 <xsl:call-template name="documentPre"/>
512 <div id="gs-document-text" class="documenttext" collection="{/page/pageResponse/collection/@name}"><!-- *** -->
513 <xsl:for-each select="documentNode">
514 <xsl:call-template name="wrapDocumentNodes"/>
515 </xsl:for-each>
516 </div>
517 <xsl:call-template name="documentPost"/>
518 </div>
519 </xsl:when>
520 <xsl:when test="/page/pageResponse/document/@docType = 'paged' or /page/pageResponse/document/@docType = 'pagedhierarchy'">
521 <div id="gs-document">
522 <div id="tocLoadingImage" style="text-align:center;">
523 <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>
524 </div>
525 </div>
526 <script type="text/javascript">
527 <xsl:text disable-output-escaping="yes">
528 $(window).on("load", function()
529 {
530 var sectionID = gs.cgiParams.d;
531 var callbackFunction = null;
532 if(sectionID.indexOf(".") != -1)
533 {
534 callbackFunction = function()
535 {
536 focusSection(sectionID);
537 };
538 }
539 else {
540 callbackFunction = function()
541 {
542
543 expandAndExecute(sectionID+".1", null, null, null);
544 };
545 }
546 var docID = sectionID.replace(/([^.]*)\..*/, "$1");
547 var url = gs.xsltParams.library_name + "?a=d&amp;c=" + gs.cgiParams.c + "&amp;excerptid=gs-document&amp;dt=hierarchy&amp;d=" + docID;
548 if(gs.cgiParams.p_s) {
549 url += "&amp;p.s="+gs.cgiParams.p_s;
550 }
551 loadTopLevelPage(callbackFunction, url);
552 });
553 </xsl:text>
554 </script>
555 </xsl:when>
556 <xsl:otherwise>
557 <div id="gs-document">
558 <div id="tocLoadingImage" style="text-align:center;">
559 <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>
560 </div>
561 </div>
562 <script type="text/javascript">
563 <xsl:text disable-output-escaping="yes">
564 $(window).on("load", function()
565 {
566 loadTopLevelPage(function()
567 {
568 //Don't focus the section until the table of contents is loaded
569 var tocCheck = function()
570 {
571 if(gs.variables.tocLoaded)
572 {
573 focusSection("</xsl:text><xsl:value-of select="/page/pageResponse/document/@selectedNode"/><xsl:text disable-output-escaping="yes">");
574 }
575 else
576 {
577 setTimeout(tocCheck, 500);
578 }
579 }
580 tocCheck();
581 });
582 });
583 </xsl:text>
584 </script>
585 </xsl:otherwise>
586 </xsl:choose>
587
588 <div class="clear"><xsl:text> </xsl:text></div>
589 </xsl:template>
590
591 <xsl:template name="editBar">
592 <table style="width:100%; border:none;" id="editBar" class="ui-widget-content"><tr>
593 <td id="editBarLeft" style="width:70%"><xsl:text> </xsl:text></td>
594 <td id="editBarRight">
595 <div style="text-align:center;">
596 <!-- edit structure button -->
597 <!-- comment this out as its not working -->
598 <!-- <div style="margin:5px;" class="ui-state-default ui-corner-all">
599 <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>
600 </div>-->
601 <!-- edit content button -->
602 <div style="margin:5px;" class="ui-state-default ui-corner-all">
603 <a id="editContentButton" style="padding: 3px; text-decoration:none;">
604 <xsl:attribute name="href">
605 <xsl:value-of select="$library_name"/>
606 <xsl:text>/collection/</xsl:text>
607 <xsl:value-of select="$collName"/>
608 <xsl:text>/document/</xsl:text>
609 <xsl:choose>
610 <xsl:when test="count(//documentNode) > 0">
611 <xsl:value-of select="/page/pageResponse/document/documentNode/@nodeID"/>
612 </xsl:when>
613 <xsl:otherwise>
614 <xsl:value-of select="/page/pageResponse/document/@nodeID"/>
615 </xsl:otherwise>
616 </xsl:choose>
617 <xsl:if test="not(/page/pageRequest/paramList/param[@name = 'docEdit']/@value = '1')">
618 <xsl:text>?ed=1&amp;docEdit=1</xsl:text>
619 </xsl:if>
620 </xsl:attribute>
621 <xsl:choose>
622 <xsl:when test="/page/pageRequest/paramList/param[@name = 'docEdit']/@value = '1'">
623 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'de.hide_editor')"/>
624 </xsl:when>
625 <xsl:otherwise>
626 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'de.edit_content')"/>
627 </xsl:otherwise>
628 </xsl:choose>
629 </a>
630 </div>
631 </div>
632 </td>
633 </tr></table>
634 <gslib:langfrag name="dse"/>
635 </xsl:template>
636
637 <xsl:template name="wrappedSectionImage">
638 <gsf:variable name="screenImageWidth"><gsf:metadata name="ScreenWidth"/></gsf:variable>
639 <gsf:variable name="screenImageHeight"><gsf:metadata name="ScreenHeight"/></gsf:variable>
640 <gsf:variable name="imageWidth"><gsf:metadata name="ImageWidth"/></gsf:variable>
641 <gsf:variable name="imageHeight"><gsf:metadata name="ImageHeight"/></gsf:variable>
642
643 <xsl:choose>
644 <!-- **** Should the test of 'Source' perhaps be changed to 'Image' to be more consistent with usage else where for showing an web friendy Image-->
645 <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')">
646 <gsf:div id="tidyDiv" />
647 <!-- 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. -->
648 <script type="text/javascript">
649 <xsl:text disable-output-escaping="yes">
650
651 var containerWidth = document.getElementById("container").offsetWidth;
652 var sidebarWidth = document.getElementById("rightSidebar").offsetWidth;
653 if (containerWidth - sidebarWidth &lt; </xsl:text><xsl:value-of select="$screenImageWidth"/><xsl:text disable-output-escaping="yes">) {
654 $("#tidyDiv").css("clear", "both");
655 }
656 </xsl:text>
657 </script>
658 <gsf:div id="image{@nodeID}">
659 <!-- 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 -->
660 <xsl:if test="/page/pageResponse/document[@docType='simple'] or /page/pageRequest/paramList/param[@name = 'ed']/@value='1'">
661
662 <div id="wrap{util:replace(@nodeID, '.', '_')}" class="zoomImage" style="position:relative; width: {$screenImageWidth}px; height: {$screenImageHeight}px;">
663 <div id="small{util:replace(@nodeID, '.', '_')}" style="position:relative; width: {$screenImageWidth}px; height: {$screenImageHeight}px;">
664 <gsf:link type="source" target="_blank"><gsf:image type="screen"/></gsf:link>
665 </div>
666 <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;">
667 <div id="overlay{util:replace(@nodeID, '.', '_')}" style="width: 600px; height: 600px; position: absolute; top: 0; left: 0; z-index: 200;">
668 <xsl:text> </xsl:text>
669 </div>
670 <div id="large{util:replace(@nodeID, '.', '_')}" style="position: relative; width: {$imageWidth}px; height: {$imageHeight}px;">
671 <gsf:link type="source"><gsf:image type="image"/></gsf:link>
672 </div>
673 </div>
674 </div>
675 <script type="text/javascript">
676 <xsl:text disable-output-escaping="yes">
677 {
678 var nodeID = "</xsl:text><xsl:value-of select="@nodeID"/><xsl:text disable-output-escaping="yes">";
679 nodeID = nodeID.replace(/\./g, "_");
680
681 var bigHeight = </xsl:text><xsl:value-of select="$imageHeight"/><xsl:text disable-output-escaping="yes">;
682 var smallHeight = </xsl:text><xsl:value-of select="$screenImageHeight"/><xsl:text disable-output-escaping="yes">;
683
684 var multiplier = bigHeight / smallHeight;
685
686 $("#wrap" + nodeID).anythingZoomer({
687 smallArea: "#small" + nodeID,
688 largeArea: "#large" + nodeID,
689 zoomPort: "#overlay" + nodeID,
690 mover: "#mover" + nodeID,
691 expansionSize:50,
692 speedMultiplier:multiplier
693 });
694
695 $("#zoomOptions input").prop("checked", false);
696 $("#zoomOptions").css("display", "");
697 }
698 </xsl:text>
699 </script>
700 </xsl:if>
701 </gsf:div>
702 </xsl:when>
703 <xsl:otherwise>
704 <gsf:div id="image{@nodeID}">
705 <xsl:attribute name="style">
706 <xsl:choose>
707 <xsl:when test="/page/pageRequest/paramList/param[@name = 'view']/@value = 'text'">
708 <xsl:text>display:none;</xsl:text>
709 </xsl:when>
710 <xsl:otherwise>
711 <xsl:text>display:block;</xsl:text>
712 </xsl:otherwise>
713 </xsl:choose>
714 </xsl:attribute>
715 <xsl:call-template name="sectionImage"/><xsl:text> </xsl:text>
716 </gsf:div>
717 </xsl:otherwise>
718 </xsl:choose>
719 </xsl:template>
720
721 <!-- The default template for displaying the document node text -->
722 <!-- equivalent to gsf:text -->
723 <xsl:template name="documentNodeText">
724 <xsl:param name="force">0</xsl:param>
725 <!-- Hides the "This document has no text." message -->
726 <xsl:variable name="noText"><gsf:metadata name="NoText"/></xsl:variable>
727 <xsl:choose>
728 <xsl:when test="$force = '1' or not($noText = '1')">
729
730 <!-- Section text -->
731 <xsl:for-each select="nodeContent">
732 <xsl:call-template name="displayMarkedUpTextAndAnnotations"/>
733 </xsl:for-each>
734 </xsl:when>
735 <xsl:when test="$noText = '1' and not(metadataList/metadata[@name='ImageType'])">
736 <gsf:link type="source"><gsf:metadata name="Source"/></gsf:link>
737 </xsl:when>
738 </xsl:choose>
739 <xsl:text> </xsl:text>
740 </xsl:template>
741
742 <!-- The default template for displaying the document node text in
743 editing mode -->
744 <!-- 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. -->
745 <!-- equivalent to gsf:text -->
746 <xsl:template name="documentNodeTextForEditing">
747 <!-- Section text -->
748 <xsl:for-each select="nodeContent">
749 <xsl:if test="not(node())"><gsf:space/></xsl:if>
750 <xsl:for-each select="node()">
751 <xsl:choose>
752 <xsl:when test="not(name())">
753 <xsl:value-of select="." disable-output-escaping="yes"/>
754 </xsl:when>
755 <xsl:otherwise>
756 <xsl:apply-templates/>
757 </xsl:otherwise>
758 </xsl:choose>
759 </xsl:for-each>
760 </xsl:for-each>
761 </xsl:template>
762
763 <!-- Used to produce a version of the page in a format that can be read by the realistic books plugin -->
764 <xsl:template name="documentNodeFlashXML">
765 <xsl:text disable-output-escaping="yes">
766 &lt;Section&gt;
767 &lt;Description&gt;
768 &lt;Metadata name="Title"&gt;
769 </xsl:text>
770 <xsl:value-of select="normalize-space(metadataList/metadata[@name = 'Title'])"/>
771 <xsl:text disable-output-escaping="yes">
772 &lt;/Metadata&gt;
773 &lt;/Description&gt;
774 </xsl:text>
775
776 <xsl:value-of select="normalize-space(nodeContent)" disable-output-escaping="yes"/>
777
778 <xsl:for-each select="documentNode">
779 <xsl:call-template name="documentNodeFlashXML"/>
780 </xsl:for-each>
781
782 <xsl:text disable-output-escaping="yes">
783 &lt;/Section&gt;
784 </xsl:text>
785 </xsl:template>
786
787 <xsl:template name="externalPage">
788 <xsl:param name="external"/>
789 <xsl:variable name="go_forward_link">
790 <a>
791 <xsl:attribute name="href">
792 <xsl:value-of select="$external"/>
793 </xsl:attribute>
794 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'external.go_forward')"/>
795 </a>
796 </xsl:variable>
797 <h2><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'external.title')"/></h2>
798 <p><xsl:value-of select="util:getInterfaceTextWithDOM($interface_name, /page/@lang, 'external.text', $go_forward_link)" disable-output-escaping="yes"/></p>
799 </xsl:template>
800
801 <xsl:template match="/page"><gslib:displayErrorsIfAny/><xsl:apply-templates select="/page/pageResponse/document"/></xsl:template> <!-- this to be deleted eventually -->
802
803 <xsl:template name="documentPre">
804 <xsl:if test="/page/pageResponse/format[@type='display' or @type='browse' or @type='search']/gsf:option[@name='mapEnabled']/@value = 'true'">
805 <xsl:call-template name="mapFeatures"/>
806 </xsl:if>
807 </xsl:template>
808
809 <xsl:template name="documentPost">
810 <!-- empty by default, to be overridden as needed -->
811 </xsl:template>
812
813
814 <xsl:template name="mapFeatures">
815 <div id="map_canvas" class="map_canvas_full"><xsl:text> </xsl:text></div>
816
817 <xsl:choose>
818 <!-- HIERARCHICAL DOCUMENTS -->
819 <xsl:when test="count(//documentNode) > 0">
820 <xsl:for-each select="documentNode">
821 <xsl:call-template name="mapPlacesNearHere"/>
822 </xsl:for-each>
823 </xsl:when>
824 <!-- SIMPLE DOCUMENTS -->
825 <xsl:otherwise>
826 <xsl:call-template name="mapPlacesNearHere"/>
827 </xsl:otherwise>
828 </xsl:choose>
829
830 <div id="jsonNodes" style="display:none;">
831 <xsl:text>[</xsl:text>
832 <xsl:choose>
833 <!-- HIERARCHICAL DOCUMENTS -->
834 <xsl:when test="count(//documentNode) > 0">
835 <xsl:for-each select="//documentNode">
836 <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']">
837 <xsl:text>{</xsl:text>
838 <xsl:text disable-output-escaping="yes">"nodeID":"</xsl:text><xsl:value-of select="@nodeID"/><xsl:text disable-output-escaping="yes">",</xsl:text>
839 <xsl:text disable-output-escaping="yes">"title":"</xsl:text><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Title']"/>
840 <xsl:text disable-output-escaping="yes">"</xsl:text>
841 <xsl:if test="metadataList/metadata[@name = 'Latitude'] and metadataList/metadata[@name = 'Longitude']">
842 <xsl:text disable-output-escaping="yes">,</xsl:text>
843 <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>
844 <xsl:text disable-output-escaping="yes">"lng":</xsl:text><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Longitude']"/>
845 </xsl:if>
846 <!--
847 <xsl:if test="metadataList/metadata[@name = 'Coordinate']">
848 <xsl:text disable-output-escaping="yes">,</xsl:text>
849 <xsl:text disable-output-escaping="yes">"coords":</xsl:text>
850 <xsl:text>[</xsl:text>
851 <xsl:for-each select="metadataList/metadata[@name = 'Coordinate']">
852 <xsl:text disable-output-escaping="yes">"</xsl:text>
853 <xsl:value-of disable-output-escaping="yes" select="current()"/>
854 <xsl:text disable-output-escaping="yes">"</xsl:text>
855 <xsl:text disable-output-escaping="yes">,</xsl:text>
856 </xsl:for-each>
857 <xsl:text>]</xsl:text>
858 </xsl:if>
859 -->
860 <xsl:if test="metadataList/metadata[@name = 'GPS.mapOverlay']">
861 <xsl:text disable-output-escaping="yes">,</xsl:text>
862 <xsl:text disable-output-escaping="yes">"mapoverlay":</xsl:text>
863 <xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'GPS.mapOverlay']"/>
864 </xsl:if>
865
866 <xsl:if test="metadataList/metadata[@name = 'descendants_GPS.mapOverlay']">
867 <xsl:variable name="count"><xsl:value-of select="count(metadataList/metadata[@name = 'descendants_GPS.mapOverlay'])"/></xsl:variable>
868 <xsl:text disable-output-escaping="yes">,</xsl:text>
869 <xsl:text disable-output-escaping="yes">"descendantsMapoverlays":[</xsl:text>
870 <xsl:for-each select="metadataList/metadata[@name = 'descendants_GPS.mapOverlay']">
871 <xsl:value-of disable-output-escaping="yes" select="current()"/>
872 <xsl:if test="not(position() = $count)">
873 <xsl:text disable-output-escaping="yes">,</xsl:text>
874 </xsl:if>
875 </xsl:for-each>
876 <xsl:text disable-output-escaping="yes">]</xsl:text>
877 </xsl:if>
878
879 <xsl:text>}</xsl:text>
880
881 <xsl:if test="not(position() = count(//documentNode))">
882 <xsl:text>,</xsl:text>
883 </xsl:if>
884
885 </xsl:if>
886 </xsl:for-each>
887 </xsl:when>
888 <!-- SIMPLE DOCUMENTS -->
889 <xsl:otherwise>
890 <xsl:for-each select="/page/pageResponse/document">
891 <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']">
892 <xsl:text>{</xsl:text>
893 <xsl:text disable-output-escaping="yes">"nodeID":"</xsl:text><xsl:value-of select="@selectedNode"/><xsl:text disable-output-escaping="yes">",</xsl:text>
894 <xsl:text disable-output-escaping="yes">"title":"</xsl:text><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Title']"/>
895 <xsl:text disable-output-escaping="yes">"</xsl:text>
896 <xsl:if test="metadataList/metadata[@name = 'Latitude'] and metadataList/metadata[@name = 'Longitude']">
897 <xsl:text disable-output-escaping="yes">,</xsl:text>
898 <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>
899 <xsl:text disable-output-escaping="yes">"lng":</xsl:text><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Longitude']"/>
900 </xsl:if>
901 <!--
902 <xsl:if test="metadataList/metadata[@name = 'Coordinate']">
903 <xsl:text disable-output-escaping="yes">,</xsl:text>
904 <xsl:text disable-output-escaping="yes">"coords":</xsl:text>
905 <xsl:text>[</xsl:text>
906 <xsl:for-each select="metadataList/metadata[@name = 'Coordinate']">
907 <xsl:text disable-output-escaping="yes">"</xsl:text>
908 <xsl:value-of disable-output-escaping="yes" select="current()"/>
909 <xsl:text disable-output-escaping="yes">"</xsl:text>
910 <xsl:text disable-output-escaping="yes">,</xsl:text>
911 </xsl:for-each>
912 <xsl:text>]</xsl:text>
913 </xsl:if>
914 -->
915 <xsl:if test="metadataList/metadata[@name = 'GPS.mapOverlay']">
916 <xsl:text disable-output-escaping="yes">,</xsl:text>
917 <xsl:text disable-output-escaping="yes">"mapoverlay":</xsl:text>
918 <xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'GPS.mapOverlay']"/>
919 </xsl:if>
920
921 <xsl:if test="metadataList/metadata[@name = 'descendants_GPS.mapOverlay']">
922 <xsl:variable name="count"><xsl:value-of select="count(metadataList/metadata[@name = 'descendants_GPS.mapOverlay'])"/></xsl:variable>
923 <xsl:text disable-output-escaping="yes">,</xsl:text>
924 <xsl:text disable-output-escaping="yes">"descendantsMapoverlays":[</xsl:text>
925 <xsl:for-each select="metadataList/metadata[@name = 'descendants_GPS.mapOverlay']">
926 <xsl:value-of disable-output-escaping="yes" select="current()"/>
927 <xsl:if test="not(position() = $count)">
928 <xsl:text disable-output-escaping="yes">,</xsl:text>
929 </xsl:if>
930 </xsl:for-each>
931 <xsl:text disable-output-escaping="yes">]</xsl:text>
932 </xsl:if>
933
934 <xsl:text>}</xsl:text>
935 </xsl:if>
936 </xsl:for-each>
937 </xsl:otherwise>
938 </xsl:choose>
939 <xsl:text>]</xsl:text>
940 </div>
941
942 <!-- 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???
943 Furthermore, map-tools.xsl already requests Coordinate meta, and map-tools.xsl is always included when format statement for collection in
944 search|browse|doc display view has mapEnabled=true -->
945 <gsf:metadata name="Coordinate" hidden="true"/>
946 <gsf:metadata name="GPS.mapOverlay" hidden="true"/>
947 <gsf:metadata name="GPS.mapOverlay" select="descendants" hidden="true"/>
948 </xsl:template>
949
950 <xsl:template name="mapPlacesNearHere">
951 <xsl:if test="metadataList/metadata[@name = 'Latitude'] and metadataList/metadata[@name = 'Longitude']">
952 <div style="background:#BBFFBB; padding: 5px; margin:0px auto; width:890px;">
953 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.map_nearby_docs')"/>
954 <img id="nearbyDocumentsToggle" style="margin-left:5px;" src="interfaces/{$interface_name}/images/expand.png">
955 <xsl:attribute name="onclick">
956 <xsl:text>performDistanceSearch('</xsl:text>
957 <xsl:value-of select="@nodeID"/>
958 <xsl:text>', '</xsl:text>
959 <gsf:metadata name="Latitude"/>
960 <xsl:text>', '</xsl:text>
961 <gsf:metadata name="Longitude"/>
962 <xsl:text>', 2);</xsl:text>
963 </xsl:attribute>
964 </img>
965 <div id="nearbyDocuments"><xsl:text> </xsl:text></div>
966 </div>
967 </xsl:if>
968
969 <xsl:if test="metadataList/metadata[@name = 'Coordinate']">
970 <div style="background:#BBFFBB; padding: 5px; margin:0px auto; width:890px;">
971 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.map_nearby_docs')"/>
972 <xsl:for-each select="metadataList/metadata[@name = 'Coordinate']">
973
974 <xsl:variable name="coordinate"><xsl:value-of select="current()"/></xsl:variable>
975
976
977 <img id="nearbyDocumentsToggle" style="margin-left:5px;" src="interfaces/{$interface_name}/images/expand.png">
978 <xsl:attribute name="onclick">
979 <xsl:text>performDistanceSearchWithCoordinates('</xsl:text>
980 <xsl:value-of select="@nodeID"/>
981 <xsl:text>', '</xsl:text>
982 <xsl:value-of select="$coordinate"/><!--<gsf:metadata name="Coordinate"/>-->
983 <xsl:text>', 2);</xsl:text>
984 </xsl:attribute>
985 </img>
986 </xsl:for-each>
987 <div id="nearbyDocuments"><xsl:text> </xsl:text></div>
988 </div>
989 </xsl:if>
990 </xsl:template>
991</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.