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

Last change on this file since 33509 was 33509, checked in by kjdon, 5 years ago

only display Map GPS editing stuff if its allowed in config file

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