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 | <xsl:variable name="bookswitch">
|
---|
16 | <xsl:choose>
|
---|
17 | <xsl:when test="/page/pageRequest/paramList/param[@name='book']/@value">
|
---|
18 | <xsl:value-of select="/page/pageRequest/paramList/param[@name='book']/@value"/>
|
---|
19 | </xsl:when>
|
---|
20 | <xsl:otherwise>off</xsl:otherwise>
|
---|
21 | </xsl:choose>
|
---|
22 | </xsl:variable>
|
---|
23 |
|
---|
24 | <!-- optional cgi-params for links to document pages -->
|
---|
25 | <xsl:variable name="opt-doc-link-args"></xsl:variable>
|
---|
26 | <!-- set page title -->
|
---|
27 | <xsl:template name="pageTitle"><gslib:documentTitle/></xsl:template>
|
---|
28 |
|
---|
29 | <!-- set page breadcrumbs -->
|
---|
30 | <xsl:template name="breadcrumbs">
|
---|
31 | <gslib:siteLink/><gslib:rightArrow/>
|
---|
32 | <gslib:collectionNameLinked/><gslib:rightArrow/>
|
---|
33 | <a>
|
---|
34 | <xsl:attribute name="href">
|
---|
35 | <xsl:value-of select="$library_name"/>/collection/<xsl:value-of select="$collName"/>/document/<xsl:value-of select="/page/pageResponse/document/documentNode[1]/@nodeID"/>
|
---|
36 | </xsl:attribute>
|
---|
37 | <xsl:variable name="documentTitleVar">
|
---|
38 | <gslib:documentTitle/>
|
---|
39 | </xsl:variable>
|
---|
40 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.document')"/>
|
---|
41 | </a>
|
---|
42 | </xsl:template>
|
---|
43 |
|
---|
44 | <xsl:template match="/">
|
---|
45 | <xsl:choose>
|
---|
46 | <!-- if this is the realistic books version of the page -->
|
---|
47 | <xsl:when test="$bookswitch = 'flashxml'">
|
---|
48 | <html>
|
---|
49 | <body>
|
---|
50 | <xsl:apply-templates select="/page/pageResponse/document"/>
|
---|
51 | </body>
|
---|
52 | </html>
|
---|
53 | </xsl:when>
|
---|
54 | <!-- if this is the regular version of the page -->
|
---|
55 | <xsl:otherwise>
|
---|
56 | <xsl:call-template name="mainTemplate"/>
|
---|
57 | </xsl:otherwise>
|
---|
58 | </xsl:choose>
|
---|
59 | </xsl:template>
|
---|
60 |
|
---|
61 | <xsl:template name="documentHeading">
|
---|
62 | <b><gsf:metadata name="Title"/></b><br/>
|
---|
63 | </xsl:template>
|
---|
64 |
|
---|
65 | <xsl:template name="documentContent">
|
---|
66 | <div id="gs-document">
|
---|
67 | <xsl:call-template name="documentPre"/>
|
---|
68 | <xsl:call-template name="wrappedSectionImage"/>
|
---|
69 | <div id="gs-document-text">
|
---|
70 | <xsl:call-template name="documentNodeText"/>
|
---|
71 | </div>
|
---|
72 | </div>
|
---|
73 | </xsl:template>
|
---|
74 |
|
---|
75 | <xsl:template name="sectionHeading">
|
---|
76 | <xsl:call-template name="sectionTitle"/>
|
---|
77 | </xsl:template>
|
---|
78 |
|
---|
79 | <xsl:template name="topLevelSectionContent">
|
---|
80 | <xsl:call-template name="wrappedSectionImage"/>
|
---|
81 | <xsl:call-template name="wrappedSectionText"/>
|
---|
82 | </xsl:template>
|
---|
83 |
|
---|
84 | <xsl:template name="sectionContent">
|
---|
85 | <xsl:call-template name="wrappedSectionImage"/>
|
---|
86 | <xsl:call-template name="wrappedSectionText"/>
|
---|
87 | </xsl:template>
|
---|
88 |
|
---|
89 | <xsl:template name="wrappedSectionText">
|
---|
90 | <div id="text{@nodeID}" class="sectionText"><!-- *** -->
|
---|
91 | <xsl:attribute name="style">
|
---|
92 | <xsl:choose>
|
---|
93 | <xsl:when test="/page/pageRequest/paramList/param[@name = 'view']/@value = 'image'">
|
---|
94 | <xsl:text>display:none;</xsl:text>
|
---|
95 | </xsl:when>
|
---|
96 | <xsl:otherwise>
|
---|
97 | <xsl:text>display:block;</xsl:text>
|
---|
98 | </xsl:otherwise>
|
---|
99 | </xsl:choose>
|
---|
100 | </xsl:attribute>
|
---|
101 |
|
---|
102 | <xsl:call-template name="documentNodeText"/>
|
---|
103 | </div>
|
---|
104 | </xsl:template>
|
---|
105 |
|
---|
106 | <xsl:template name="sectionImage">
|
---|
107 | <gsf:image type="screen"/>
|
---|
108 | </xsl:template>
|
---|
109 |
|
---|
110 | <!-- Used to make sure that regardless what the collection designer uses for the title and content we can wrap it properly -->
|
---|
111 | <!-- If editing, be aware that the Document Basket looks for specific classes that this template bakes in (key points marked with ***) -->
|
---|
112 | <xsl:template name="wrapDocumentNodes">
|
---|
113 | <a name="{@nodeID}"><xsl:text> </xsl:text></a>
|
---|
114 |
|
---|
115 | <!-- Section header -->
|
---|
116 | <table class="sectionHeader"><tr>
|
---|
117 |
|
---|
118 | <!-- Expand/collapse button -->
|
---|
119 | <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'">
|
---|
120 | <td class="headerTD">
|
---|
121 | <img id="dtoggle{@nodeID}" onclick="toggleSection('{@nodeID}');" class="icon">
|
---|
122 | <xsl:attribute name="src">
|
---|
123 | <xsl:choose>
|
---|
124 | <xsl:when test="/page/pageRequest/paramList/param[@name = 'ed']/@value = '1' or util:oidIsMatchOrParent(@nodeID, /page/pageResponse/document/@selectedNode)">
|
---|
125 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'collapse_image')"/>
|
---|
126 | </xsl:when>
|
---|
127 | <xsl:otherwise>
|
---|
128 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'expand_image')"/>
|
---|
129 | </xsl:otherwise>
|
---|
130 | </xsl:choose>
|
---|
131 | </xsl:attribute>
|
---|
132 | </img>
|
---|
133 | </td>
|
---|
134 | </xsl:if>
|
---|
135 |
|
---|
136 | <!-- Title -->
|
---|
137 | <td id="header{@nodeID}" class="headerTD sectionTitle"><!-- *** -->
|
---|
138 | <p>
|
---|
139 | <xsl:attribute name="class"><xsl:value-of select="util:hashToDepthClass(@nodeID)"/> sectionHeader</xsl:attribute>
|
---|
140 |
|
---|
141 | <xsl:if test="util:hashToSectionId(@nodeID)">
|
---|
142 | <span class="sectionNumberSpan">
|
---|
143 | <xsl:value-of select="util:hashToSectionId(@nodeID)"/>
|
---|
144 | <xsl:text> </xsl:text>
|
---|
145 | </span>
|
---|
146 | </xsl:if>
|
---|
147 | <!-- Display the title for the section regardless of whether automatic section numbering is turned on -->
|
---|
148 | <span><xsl:call-template name="sectionHeading"/></span>
|
---|
149 | </p>
|
---|
150 | </td>
|
---|
151 |
|
---|
152 | <!-- "back to top" link -->
|
---|
153 | <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'">
|
---|
154 | <td class="backToTop headerTD">
|
---|
155 | <a href="javascript:scrollToTop();">
|
---|
156 | <xsl:text disable-output-escaping="yes">▲</xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.back_to_top')"/>
|
---|
157 | </a>
|
---|
158 | </td>
|
---|
159 | </xsl:if>
|
---|
160 | </tr></table>
|
---|
161 |
|
---|
162 | <div id="doc{@nodeID}"><!-- *** -->
|
---|
163 | <xsl:choose>
|
---|
164 | <xsl:when test="/page/pageRequest/paramList/param[@name = 'ed']/@value = '1' or /page/pageResponse/document/@selectedNode = @nodeID">
|
---|
165 | <xsl:attribute name="class">
|
---|
166 | <xsl:text>sectionContainer hasText</xsl:text>
|
---|
167 | </xsl:attribute>
|
---|
168 | <xsl:attribute name="style">
|
---|
169 | <xsl:text>display:block;</xsl:text>
|
---|
170 | </xsl:attribute>
|
---|
171 | </xsl:when>
|
---|
172 | <xsl:when test="/page/pageRequest/paramList/param[@name = 'ed']/@value = '1' or util:oidIsMatchOrParent(@nodeID, /page/pageResponse/document/@selectedNode)">
|
---|
173 | <xsl:attribute name="class">
|
---|
174 | <xsl:text>sectionContainer noText</xsl:text>
|
---|
175 | </xsl:attribute>
|
---|
176 | <xsl:attribute name="style">
|
---|
177 | <xsl:text>display:block;</xsl:text>
|
---|
178 | </xsl:attribute>
|
---|
179 | </xsl:when>
|
---|
180 | <xsl:otherwise>
|
---|
181 | <xsl:attribute name="class">
|
---|
182 | <xsl:text>sectionContainer noText</xsl:text>
|
---|
183 | </xsl:attribute>
|
---|
184 | <xsl:attribute name="style">
|
---|
185 | <xsl:text>display:none;</xsl:text>
|
---|
186 | </xsl:attribute>
|
---|
187 | </xsl:otherwise>
|
---|
188 | </xsl:choose>
|
---|
189 |
|
---|
190 | <xsl:if test="/page/pageRequest/userInformation 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))">
|
---|
191 | <table id="meta{@nodeID}">
|
---|
192 | <xsl:attribute name="style">
|
---|
193 | <xsl:choose>
|
---|
194 | <xsl:when test="/page/pageRequest/paramList/param[@name = 'dmd']/@value = 'true'">
|
---|
195 | <xsl:text>display:block;</xsl:text>
|
---|
196 | </xsl:when>
|
---|
197 | <xsl:otherwise>
|
---|
198 | <xsl:text>display:none;</xsl:text>
|
---|
199 | </xsl:otherwise>
|
---|
200 | </xsl:choose>
|
---|
201 | </xsl:attribute>
|
---|
202 | <xsl:value-of select="util:clearMetadataStorage()"/>
|
---|
203 | <xsl:for-each select="metadataList/metadata">
|
---|
204 | <xsl:sort select="@name"/>
|
---|
205 | <xsl:if test="util:checkMetadataNotDuplicate(@name, .)">
|
---|
206 | <tr>
|
---|
207 | <td class="metaTableCellName"><xsl:value-of select="@name"/></td>
|
---|
208 | <td class="metaTableCell"><xsl:value-of disable-output-escaping="yes" select="."/></td>
|
---|
209 | </tr>
|
---|
210 | </xsl:if>
|
---|
211 | </xsl:for-each>
|
---|
212 | </table>
|
---|
213 | </xsl:if>
|
---|
214 |
|
---|
215 | <xsl:choose>
|
---|
216 | <xsl:when test="../../document">
|
---|
217 | <xsl:call-template name="topLevelSectionContent"/>
|
---|
218 | </xsl:when>
|
---|
219 | <xsl:otherwise>
|
---|
220 | <xsl:call-template name="sectionContent"/>
|
---|
221 | </xsl:otherwise>
|
---|
222 | </xsl:choose>
|
---|
223 |
|
---|
224 | <xsl:if test="documentNode">
|
---|
225 | <xsl:for-each select="documentNode">
|
---|
226 | <xsl:call-template name="wrapDocumentNodes"/>
|
---|
227 | </xsl:for-each>
|
---|
228 | </xsl:if>
|
---|
229 | </div>
|
---|
230 | </xsl:template>
|
---|
231 |
|
---|
232 | <!-- the page content -->
|
---|
233 | <xsl:template match="/page/pageResponse/document">
|
---|
234 | <xsl:if test="/page/pageRequest/userInformation 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))">
|
---|
235 | <script type="text/javascript" src="interfaces/{$interface_name}/js/documentmaker_scripts.js"><xsl:text> </xsl:text></script>
|
---|
236 | <script type="text/javascript" src="interfaces/{$interface_name}/js/documentmaker_scripts_util.js"><xsl:text> </xsl:text></script>
|
---|
237 | <script type="text/javascript">
|
---|
238 | <xsl:text disable-output-escaping="yes">
|
---|
239 | $(window).load(function()
|
---|
240 | {
|
---|
241 | if(gs.cgiParams.docEdit == "1")
|
---|
242 | {
|
---|
243 | readyPageForEditing();
|
---|
244 | }
|
---|
245 | });
|
---|
246 | </xsl:text>
|
---|
247 | </script>
|
---|
248 | <gsf:metadata name="all"/>
|
---|
249 | </xsl:if>
|
---|
250 |
|
---|
251 | <xsl:if test="$bookswitch = 'off'">
|
---|
252 | <div id="bookdiv" style="visibility:hidden; height:0px; display:inline;"><xsl:text> </xsl:text></div>
|
---|
253 |
|
---|
254 | <script type="text/javascript" src="interfaces/{$interface_name}/js/document_scripts.js"><xsl:text> </xsl:text></script>
|
---|
255 |
|
---|
256 | <xsl:if test="/page/pageResponse/collection[@name = $collName]/metadataList/metadata[@name = 'tidyoption'] = 'tidy'">
|
---|
257 | <script type="text/javascript">
|
---|
258 | <xsl:text disable-output-escaping="yes">
|
---|
259 | if(document.URL.indexOf("book=on") != -1)
|
---|
260 | {
|
---|
261 | loadBook();
|
---|
262 | }
|
---|
263 | </xsl:text>
|
---|
264 | </script>
|
---|
265 | </xsl:if>
|
---|
266 |
|
---|
267 | <xsl:if test="/page/pageRequest/userInformation 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))">
|
---|
268 | <xsl:call-template name="editBar"/>
|
---|
269 | </xsl:if>
|
---|
270 |
|
---|
271 | <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'">
|
---|
272 | <xsl:call-template name="rightSidebar"/>
|
---|
273 | </xsl:if>
|
---|
274 | </xsl:if>
|
---|
275 |
|
---|
276 | <!-- display the document -->
|
---|
277 | <xsl:choose>
|
---|
278 | <xsl:when test="@external != ''">
|
---|
279 | <xsl:call-template name="externalPage">
|
---|
280 | <xsl:with-param name="external" select="@external"/>
|
---|
281 | </xsl:call-template>
|
---|
282 | </xsl:when>
|
---|
283 | <xsl:when test="$bookswitch = 'flashxml'">
|
---|
284 | <xsl:call-template name="documentNodeFlashXML"/>
|
---|
285 | </xsl:when>
|
---|
286 | <xsl:when test="$bookswitch = 'on'">
|
---|
287 | <div id="bookdiv" style="display:inline;"><xsl:text> </xsl:text></div>
|
---|
288 | <!-- *** in document-scripts.js *** -->
|
---|
289 | <script type="text/javascript">
|
---|
290 | <xsl:text disable-output-escaping="yes">
|
---|
291 | if(document.URL.indexOf("book=on") != -1)
|
---|
292 | {
|
---|
293 | loadBook();
|
---|
294 | }
|
---|
295 | </xsl:text>
|
---|
296 | </script>
|
---|
297 | </xsl:when>
|
---|
298 | <xsl:when test="@docType='simple'">
|
---|
299 | <xsl:call-template name="documentHeading"/><br/>
|
---|
300 | <xsl:call-template name="documentContent"/>
|
---|
301 | </xsl:when>
|
---|
302 | <xsl:otherwise> <!-- display the standard greenstone document -->
|
---|
303 | <xsl:call-template name="wrappedDocument"/>
|
---|
304 | </xsl:otherwise>
|
---|
305 | </xsl:choose>
|
---|
306 | </xsl:template>
|
---|
307 |
|
---|
308 | <xsl:template name="wrappedDocument">
|
---|
309 | <xsl:choose>
|
---|
310 | <!-- NOTE: alb = ajax load bypass -->
|
---|
311 | <!--
|
---|
312 | If the docType is hierarchy and we want to bypass the ajax load then do this
|
---|
313 | OR If the docType is hierarchy and we have asked for the expanded document OR we have asked for the top level document then do this
|
---|
314 | -->
|
---|
315 | <xsl:when test="/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 (/page/pageRequest/paramList/param[@name = 'ed']/@value = '1' or not(util:contains(/page/pageResponse/document/@selectedNode, '.')))))">
|
---|
316 | <div id="gs-document">
|
---|
317 | <xsl:call-template name="documentPre"/>
|
---|
318 | <div id="gs-document-text" class="documenttext" collection="{/page/pageResponse/collection/@name}"><!-- *** -->
|
---|
319 | <xsl:for-each select="documentNode">
|
---|
320 | <xsl:call-template name="wrapDocumentNodes"/>
|
---|
321 | </xsl:for-each>
|
---|
322 | </div>
|
---|
323 | </div>
|
---|
324 | </xsl:when>
|
---|
325 | <xsl:when test="/page/pageResponse/document/@docType = 'paged' or /page/pageResponse/document/@docType = 'pagedhierarchy'">
|
---|
326 | <div id="gs-document">
|
---|
327 | <div id="tocLoadingImage" style="text-align:center;">
|
---|
328 | <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>
|
---|
329 | </div>
|
---|
330 | </div>
|
---|
331 | <script type="text/javascript">
|
---|
332 | <xsl:text disable-output-escaping="yes">
|
---|
333 | $(window).load(function()
|
---|
334 | {
|
---|
335 | var sectionID = gs.cgiParams.d;
|
---|
336 | var callbackFunction = null;
|
---|
337 | if(sectionID.indexOf("\\.") == -1)
|
---|
338 | {
|
---|
339 | callbackFunction = function()
|
---|
340 | {
|
---|
341 | focusSection(sectionID);
|
---|
342 | };
|
---|
343 | }
|
---|
344 |
|
---|
345 | var docID = sectionID.replace(/([^.]*)\..*/, "$1");
|
---|
346 | var url = gs.xsltParams.library_name + "?a=d&c=" + gs.cgiParams.c + "&excerptid=gs-document&dt=hierarchy&d=" + docID;
|
---|
347 | loadTopLevelPage(callbackFunction, url);
|
---|
348 | });
|
---|
349 | </xsl:text>
|
---|
350 | </script>
|
---|
351 | </xsl:when>
|
---|
352 | <xsl:otherwise>
|
---|
353 | <div id="gs-document">
|
---|
354 | <div id="tocLoadingImage" style="text-align:center;">
|
---|
355 | <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>
|
---|
356 | </div>
|
---|
357 | </div>
|
---|
358 | <script type="text/javascript">
|
---|
359 | <xsl:text disable-output-escaping="yes">
|
---|
360 | $(window).load(function()
|
---|
361 | {
|
---|
362 | loadTopLevelPage(function()
|
---|
363 | {
|
---|
364 | //Don't focus the section until the table of contents is loaded
|
---|
365 | var tocCheck = function()
|
---|
366 | {
|
---|
367 | if(gs.variables.tocLoaded)
|
---|
368 | {
|
---|
369 | focusSection("</xsl:text><xsl:value-of select="/page/pageResponse/document/@selectedNode"/><xsl:text disable-output-escaping="yes">");
|
---|
370 | }
|
---|
371 | else
|
---|
372 | {
|
---|
373 | setTimeout(tocCheck, 500);
|
---|
374 | }
|
---|
375 | }
|
---|
376 | tocCheck();
|
---|
377 | });
|
---|
378 | });
|
---|
379 | </xsl:text>
|
---|
380 | </script>
|
---|
381 | </xsl:otherwise>
|
---|
382 | </xsl:choose>
|
---|
383 |
|
---|
384 | <div class="clear"><xsl:text> </xsl:text></div>
|
---|
385 | </xsl:template>
|
---|
386 |
|
---|
387 | <xsl:template name="editBar">
|
---|
388 | <table style="width:100%"><tr>
|
---|
389 | <td id="editBarLeft" style="width:70%"><xsl:text> </xsl:text></td>
|
---|
390 | <td id="editBarRight">
|
---|
391 | <div style="text-align:center;">
|
---|
392 | <div style="margin:5px;" class="ui-state-default ui-corner-all">
|
---|
393 | <a style="padding: 3px; text-decoration:none;" href="{$library_name}?a=g&sa=documentbasket&c=&s=DisplayDocumentList&rt=r&p.c={/page/pageResponse/collection/@name}&docToEdit={/page/pageResponse/document/documentNode/@nodeID}"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.edit_structure')"/></a>
|
---|
394 | </div>
|
---|
395 | <div style="margin:5px;" class="ui-state-default ui-corner-all">
|
---|
396 | <a id="editContentButton" style="padding: 3px; text-decoration:none;">
|
---|
397 | <xsl:attribute name="href">
|
---|
398 | <xsl:value-of select="$library_name"/>
|
---|
399 | <xsl:text>/collection/</xsl:text>
|
---|
400 | <xsl:value-of select="$collName"/>
|
---|
401 | <xsl:text>/document/</xsl:text>
|
---|
402 | <xsl:choose>
|
---|
403 | <xsl:when test="count(//documentNode) > 0">
|
---|
404 | <xsl:value-of select="/page/pageResponse/document/documentNode/@nodeID"/>
|
---|
405 | </xsl:when>
|
---|
406 | <xsl:otherwise>
|
---|
407 | <xsl:value-of select="/page/pageResponse/document/@nodeID"/>
|
---|
408 | </xsl:otherwise>
|
---|
409 | </xsl:choose>
|
---|
410 | <xsl:if test="not(/page/pageRequest/paramList/param[@name = 'docEdit']/@value = '1')">
|
---|
411 | <xsl:text>?ed=1&docEdit=1&dt=hierarchy</xsl:text>
|
---|
412 | </xsl:if>
|
---|
413 | </xsl:attribute>
|
---|
414 | <xsl:choose>
|
---|
415 | <xsl:when test="/page/pageRequest/paramList/param[@name = 'docEdit']/@value = '1'">
|
---|
416 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.hide_editor')"/>
|
---|
417 | </xsl:when>
|
---|
418 | <xsl:otherwise>
|
---|
419 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.edit_content')"/>
|
---|
420 | </xsl:otherwise>
|
---|
421 | </xsl:choose>
|
---|
422 | </a>
|
---|
423 | </div>
|
---|
424 | </div>
|
---|
425 | </td>
|
---|
426 | </tr></table>
|
---|
427 | <gslib:langfrag name="dse"/>
|
---|
428 | </xsl:template>
|
---|
429 |
|
---|
430 | <!-- Highlight annotations if requested -->
|
---|
431 | <xsl:template name="displayAnnotation">
|
---|
432 | <xsl:choose>
|
---|
433 | <xsl:when test="/page/pageRequest/paramList/param[@name = 'hl']/@value = 'on'">
|
---|
434 | <span class="termHighlight"><xsl:value-of select="."/></span>
|
---|
435 | </xsl:when>
|
---|
436 | <xsl:otherwise>
|
---|
437 | <span class="noTermHighlight"><xsl:value-of select="."/></span>
|
---|
438 | </xsl:otherwise>
|
---|
439 | </xsl:choose>
|
---|
440 | </xsl:template>
|
---|
441 |
|
---|
442 | <!-- The default template for displaying section titles -->
|
---|
443 | <xsl:template name="sectionTitle">
|
---|
444 | <xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Title']"/>
|
---|
445 | </xsl:template>
|
---|
446 |
|
---|
447 | <xsl:template name="wrappedSectionImage">
|
---|
448 | <gsf:variable name="screenImageWidth"><gsf:metadata name="ScreenWidth"/></gsf:variable>
|
---|
449 | <gsf:variable name="screenImageHeight"><gsf:metadata name="ScreenHeight"/></gsf:variable>
|
---|
450 | <gsf:variable name="imageWidth"><gsf:metadata name="ImageWidth"/></gsf:variable>
|
---|
451 | <gsf:variable name="imageHeight"><gsf:metadata name="ImageHeight"/></gsf:variable>
|
---|
452 |
|
---|
453 | <xsl:choose>
|
---|
454 | <xsl:when test="metadataList/metadata[@name = 'Screen'] and metadataList/metadata[@name = 'SourceFile'] and ($imageWidth div $screenImageWidth > 1.2)">
|
---|
455 | <div id="image{@nodeID}">
|
---|
456 | <div id="wrap{util:replace(@nodeID, '.', '_')}" class="zoomImage" style="position:relative; width: {$screenImageWidth}px; height: {$screenImageHeight}px;">
|
---|
457 | <div id="small{util:replace(@nodeID, '.', '_')}" style="position:relative; width: {$screenImageWidth}px; height: {$screenImageHeight}px;">
|
---|
458 | <gsf:image type="screen"/>
|
---|
459 | </div>
|
---|
460 | <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;">
|
---|
461 | <div id="overlay{util:replace(@nodeID, '.', '_')}" style="width: 600px; height: 600px; position: absolute; top: 0; left: 0; z-index: 200;">
|
---|
462 | <xsl:text> </xsl:text>
|
---|
463 | </div>
|
---|
464 | <div id="large{util:replace(@nodeID, '.', '_')}" style="position: relative; width: {$imageWidth}px; height: {$imageHeight}px;">
|
---|
465 | <gsf:image type="source"/>
|
---|
466 | </div>
|
---|
467 | </div>
|
---|
468 | </div>
|
---|
469 | <script type="text/javascript">
|
---|
470 | <xsl:text disable-output-escaping="yes">
|
---|
471 | {
|
---|
472 | var nodeID = "</xsl:text><xsl:value-of select="@nodeID"/><xsl:text disable-output-escaping="yes">";
|
---|
473 | nodeID = nodeID.replace(/\./g, "_");
|
---|
474 |
|
---|
475 | var bigHeight = </xsl:text><xsl:value-of select="$imageHeight"/><xsl:text disable-output-escaping="yes">;
|
---|
476 | var smallHeight = </xsl:text><xsl:value-of select="$screenImageHeight"/><xsl:text disable-output-escaping="yes">;
|
---|
477 |
|
---|
478 | var multiplier = bigHeight / smallHeight;
|
---|
479 |
|
---|
480 | $("#wrap" + nodeID).anythingZoomer({
|
---|
481 | smallArea: "#small" + nodeID,
|
---|
482 | largeArea: "#large" + nodeID,
|
---|
483 | zoomPort: "#overlay" + nodeID,
|
---|
484 | mover: "#mover" + nodeID,
|
---|
485 | expansionSize:50,
|
---|
486 | speedMultiplier:multiplier
|
---|
487 | });
|
---|
488 |
|
---|
489 | $("#zoomOptions input").attr("checked", false);
|
---|
490 | $("#zoomOptions").css("display", null);
|
---|
491 | }
|
---|
492 | </xsl:text>
|
---|
493 | </script>
|
---|
494 | </div>
|
---|
495 | </xsl:when>
|
---|
496 | <xsl:otherwise>
|
---|
497 | <div id="image{@nodeID}">
|
---|
498 | <xsl:attribute name="style">
|
---|
499 | <xsl:choose>
|
---|
500 | <xsl:when test="/page/pageRequest/paramList/param[@name = 'view']/@value = 'text'">
|
---|
501 | <xsl:text>display:none;</xsl:text>
|
---|
502 | </xsl:when>
|
---|
503 | <xsl:otherwise>
|
---|
504 | <xsl:text>display:block;</xsl:text>
|
---|
505 | </xsl:otherwise>
|
---|
506 | </xsl:choose>
|
---|
507 | </xsl:attribute>
|
---|
508 | <xsl:call-template name="sectionImage"/><xsl:text> </xsl:text>
|
---|
509 | </div>
|
---|
510 | </xsl:otherwise>
|
---|
511 | </xsl:choose>
|
---|
512 | </xsl:template>
|
---|
513 |
|
---|
514 | <!-- The default template for displaying the document node text -->
|
---|
515 | <!-- equivalent to gsf:text -->
|
---|
516 | <xsl:template name="documentNodeText">
|
---|
517 | <!-- Hides the "This document has no text." message -->
|
---|
518 | <xsl:variable name="noText"><gsf:metadata name="NoText"/></xsl:variable>
|
---|
519 | <xsl:if test="not($noText = '1')">
|
---|
520 | <!-- Section text -->
|
---|
521 | <xsl:for-each select="nodeContent">
|
---|
522 | <xsl:for-each select="node()">
|
---|
523 | <xsl:choose>
|
---|
524 | <xsl:when test="not(name())">
|
---|
525 | <xsl:value-of select="." disable-output-escaping="yes"/>
|
---|
526 | </xsl:when>
|
---|
527 | <xsl:when test="name() = 'annotation'">
|
---|
528 | <xsl:call-template name="displayAnnotation"/>
|
---|
529 | </xsl:when>
|
---|
530 | <xsl:otherwise>
|
---|
531 | <xsl:apply-templates/>
|
---|
532 | </xsl:otherwise>
|
---|
533 | </xsl:choose>
|
---|
534 | </xsl:for-each>
|
---|
535 | </xsl:for-each>
|
---|
536 | </xsl:if><xsl:text> </xsl:text>
|
---|
537 | </xsl:template>
|
---|
538 |
|
---|
539 | <!-- Used to produce a version of the page in a format that can be read by the realistic books plugin -->
|
---|
540 | <xsl:template name="documentNodeFlashXML">
|
---|
541 | <xsl:text disable-output-escaping="yes">
|
---|
542 | <Section>
|
---|
543 | <Description>
|
---|
544 | <Metadata name="Title">
|
---|
545 | </xsl:text>
|
---|
546 | <xsl:value-of select="normalize-space(metadataList/metadata[@name = 'Title'])"/>
|
---|
547 | <xsl:text disable-output-escaping="yes">
|
---|
548 | </Metadata>
|
---|
549 | </Description>
|
---|
550 | </xsl:text>
|
---|
551 |
|
---|
552 | <xsl:value-of select="normalize-space(nodeContent)" disable-output-escaping="yes"/>
|
---|
553 |
|
---|
554 | <xsl:for-each select="documentNode">
|
---|
555 | <xsl:call-template name="documentNodeFlashXML"/>
|
---|
556 | </xsl:for-each>
|
---|
557 |
|
---|
558 | <xsl:text disable-output-escaping="yes">
|
---|
559 | </Section>
|
---|
560 | </xsl:text>
|
---|
561 | </xsl:template>
|
---|
562 |
|
---|
563 | <xsl:template name="externalPage">
|
---|
564 | <xsl:param name="external"/>
|
---|
565 | <xsl:variable name="go_forward_link">
|
---|
566 | <a>
|
---|
567 | <xsl:attribute name="href">
|
---|
568 | <xsl:value-of select="$external"/>
|
---|
569 | </xsl:attribute>
|
---|
570 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'external.go_forward')"/>
|
---|
571 | </a>
|
---|
572 | </xsl:variable>
|
---|
573 | <h2><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'external.title')"/></h2>
|
---|
574 | <p><xsl:value-of select="util:getInterfaceTextWithDOM($interface_name, /page/@lang, 'external.text', $go_forward_link)" disable-output-escaping="yes"/></p>
|
---|
575 | </xsl:template>
|
---|
576 |
|
---|
577 | <xsl:template match="/page"><xsl:apply-templates select="/page/pageResponse/document"/></xsl:template> <!-- this to be deleted eventually -->
|
---|
578 |
|
---|
579 | <xsl:template name="documentPre">
|
---|
580 | <xsl:if test="/page/pageResponse/format[@type='display' or @type='browse' or @type='search']/gsf:option[@name='mapEnabled']/@value = 'true'">
|
---|
581 | <xsl:call-template name="mapFeatures"/>
|
---|
582 | </xsl:if>
|
---|
583 | </xsl:template>
|
---|
584 |
|
---|
585 | <xsl:template name="mapFeatures">
|
---|
586 | <div id="map_canvas" class="map_canvas_full"><xsl:text> </xsl:text></div>
|
---|
587 |
|
---|
588 | <xsl:choose>
|
---|
589 | <!-- HIERARCHICAL DOCUMENTS -->
|
---|
590 | <xsl:when test="count(//documentNode) > 0">
|
---|
591 | <xsl:for-each select="documentNode">
|
---|
592 | <xsl:call-template name="mapPlacesNearHere"/>
|
---|
593 | </xsl:for-each>
|
---|
594 | </xsl:when>
|
---|
595 | <!-- SIMPLE DOCUMENTS -->
|
---|
596 | <xsl:otherwise>
|
---|
597 | <xsl:call-template name="mapPlacesNearHere"/>
|
---|
598 | </xsl:otherwise>
|
---|
599 | </xsl:choose>
|
---|
600 |
|
---|
601 | <div id="jsonNodes" style="display:none;">
|
---|
602 | <xsl:text>[</xsl:text>
|
---|
603 | <xsl:choose>
|
---|
604 | <!-- HIERARCHICAL DOCUMENTS -->
|
---|
605 | <xsl:when test="count(//documentNode) > 0">
|
---|
606 | <xsl:for-each select="//documentNode">
|
---|
607 | <xsl:if test="metadataList/metadata[@name = 'Latitude'] and metadataList/metadata[@name = 'Longitude']">
|
---|
608 | <xsl:text>{</xsl:text>
|
---|
609 | <xsl:text disable-output-escaping="yes">"nodeID":"</xsl:text><xsl:value-of select="@nodeID"/><xsl:text disable-output-escaping="yes">",</xsl:text>
|
---|
610 | <xsl:text disable-output-escaping="yes">"title":"</xsl:text><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Title']"/><xsl:text disable-output-escaping="yes">",</xsl:text>
|
---|
611 | <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>
|
---|
612 | <xsl:text disable-output-escaping="yes">"lng":</xsl:text><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Longitude']"/>
|
---|
613 | <xsl:text>}</xsl:text>
|
---|
614 | <xsl:if test="not(position() = count(//documentNode))">
|
---|
615 | <xsl:text>,</xsl:text>
|
---|
616 | </xsl:if>
|
---|
617 | </xsl:if>
|
---|
618 | </xsl:for-each>
|
---|
619 | </xsl:when>
|
---|
620 | <!-- SIMPLE DOCUMENTS -->
|
---|
621 | <xsl:otherwise>
|
---|
622 | <xsl:for-each select="/page/pageResponse/document">
|
---|
623 | <xsl:if test="metadataList/metadata[@name = 'Latitude'] and metadataList/metadata[@name = 'Longitude']">
|
---|
624 | <xsl:text>{</xsl:text>
|
---|
625 | <xsl:text disable-output-escaping="yes">"nodeID":"</xsl:text><xsl:value-of select="@selectedNode"/><xsl:text disable-output-escaping="yes">",</xsl:text>
|
---|
626 | <xsl:text disable-output-escaping="yes">"title":"</xsl:text><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Title']"/><xsl:text disable-output-escaping="yes">",</xsl:text>
|
---|
627 | <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>
|
---|
628 | <xsl:text disable-output-escaping="yes">"lng":</xsl:text><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Longitude']"/>
|
---|
629 | <xsl:text>}</xsl:text>
|
---|
630 | </xsl:if>
|
---|
631 | </xsl:for-each>
|
---|
632 | </xsl:otherwise>
|
---|
633 | </xsl:choose>
|
---|
634 | <xsl:text>]</xsl:text>
|
---|
635 | </div>
|
---|
636 | </xsl:template>
|
---|
637 |
|
---|
638 | <xsl:template name="mapPlacesNearHere">
|
---|
639 | <xsl:if test="metadataList/metadata[@name = 'Latitude'] and metadataList/metadata[@name = 'Longitude']">
|
---|
640 | <div style="background:#BBFFBB; padding: 5px; margin:0px auto; width:890px;">
|
---|
641 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.maps.nearby_docs')"/>
|
---|
642 | <img id="nearbyDocumentsToggle" style="margin-left:5px;" src="interfaces/{$interface_name}/images/expand.png">
|
---|
643 | <xsl:attribute name="onclick">
|
---|
644 | <xsl:text>performDistanceSearch('</xsl:text>
|
---|
645 | <xsl:value-of select="@nodeID"/>
|
---|
646 | <xsl:text>', '</xsl:text>
|
---|
647 | <gsf:metadata name="Latitude"/>
|
---|
648 | <xsl:text>', '</xsl:text>
|
---|
649 | <gsf:metadata name="Longitude"/>
|
---|
650 | <xsl:text>', 2);</xsl:text>
|
---|
651 | </xsl:attribute>
|
---|
652 | </img>
|
---|
653 | <div id="nearbyDocuments"><xsl:text> </xsl:text></div>
|
---|
654 | </div>
|
---|
655 | </xsl:if>
|
---|
656 | </xsl:template>
|
---|
657 | </xsl:stylesheet>
|
---|