[19856] | 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 |
|
---|
[23989] | 11 | <!-- use the 'main' layout -->
|
---|
| 12 | <xsl:import href="layouts/main.xsl"/>
|
---|
[25660] | 13 | <xsl:import href="layouts/toc.xsl"/>
|
---|
[31537] | 14 |
|
---|
| 15 | <!-- templates for adding user comments -->
|
---|
| 16 | <xsl:import href="layouts/usercomments.xsl"/>
|
---|
[23989] | 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>
|
---|
[19856] | 26 |
|
---|
[26316] | 27 | <!-- optional cgi-params for links to document pages -->
|
---|
| 28 | <xsl:variable name="opt-doc-link-args"></xsl:variable>
|
---|
[19988] | 29 | <!-- set page title -->
|
---|
| 30 | <xsl:template name="pageTitle"><gslib:documentTitle/></xsl:template>
|
---|
[19856] | 31 |
|
---|
[19988] | 32 | <!-- set page breadcrumbs -->
|
---|
[23813] | 33 | <xsl:template name="breadcrumbs">
|
---|
| 34 | <gslib:siteLink/><gslib:rightArrow/>
|
---|
| 35 | <gslib:collectionNameLinked/><gslib:rightArrow/>
|
---|
| 36 | <a>
|
---|
| 37 | <xsl:attribute name="href">
|
---|
[25371] | 38 | <xsl:value-of select="$library_name"/>/collection/<xsl:value-of select="$collName"/>/document/<xsl:value-of select="/page/pageResponse/document/documentNode[1]/@nodeID"/>
|
---|
[23813] | 39 | </xsl:attribute>
|
---|
| 40 | <xsl:variable name="documentTitleVar">
|
---|
| 41 | <gslib:documentTitle/>
|
---|
| 42 | </xsl:variable>
|
---|
[24009] | 43 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.document')"/>
|
---|
[23813] | 44 | </a>
|
---|
| 45 | </xsl:template>
|
---|
[23989] | 46 |
|
---|
| 47 | <xsl:template match="/">
|
---|
| 48 | <xsl:choose>
|
---|
| 49 | <!-- if this is the realistic books version of the page -->
|
---|
| 50 | <xsl:when test="$bookswitch = 'flashxml'">
|
---|
| 51 | <html>
|
---|
| 52 | <body>
|
---|
| 53 | <xsl:apply-templates select="/page/pageResponse/document"/>
|
---|
| 54 | </body>
|
---|
| 55 | </html>
|
---|
| 56 | </xsl:when>
|
---|
| 57 | <!-- if this is the regular version of the page -->
|
---|
| 58 | <xsl:otherwise>
|
---|
[25917] | 59 | <xsl:call-template name="mainTemplate"/>
|
---|
[23989] | 60 | </xsl:otherwise>
|
---|
| 61 | </xsl:choose>
|
---|
| 62 | </xsl:template>
|
---|
[24650] | 63 |
|
---|
[26020] | 64 | <xsl:template name="documentHeading">
|
---|
[29755] | 65 | <b><xsl:text> </xsl:text><gsf:metadata name="Title"/></b><br/>
|
---|
[26020] | 66 | </xsl:template>
|
---|
| 67 |
|
---|
| 68 | <xsl:template name="documentContent">
|
---|
[26298] | 69 | <div id="gs-document">
|
---|
| 70 | <xsl:call-template name="documentPre"/>
|
---|
| 71 | <xsl:call-template name="wrappedSectionImage"/>
|
---|
| 72 | <div id="gs-document-text">
|
---|
| 73 | <xsl:call-template name="documentNodeText"/>
|
---|
| 74 | </div>
|
---|
| 75 | </div>
|
---|
[30773] | 76 | </xsl:template>
|
---|
| 77 |
|
---|
[26175] | 78 | <xsl:template name="sectionHeading">
|
---|
[25936] | 79 | <xsl:call-template name="sectionTitle"/>
|
---|
| 80 | </xsl:template>
|
---|
| 81 |
|
---|
[26020] | 82 | <xsl:template name="topLevelSectionContent">
|
---|
| 83 | <xsl:call-template name="wrappedSectionImage"/>
|
---|
| 84 | <xsl:call-template name="wrappedSectionText"/>
|
---|
| 85 | </xsl:template>
|
---|
| 86 |
|
---|
| 87 | <xsl:template name="sectionContent">
|
---|
| 88 | <xsl:call-template name="wrappedSectionImage"/>
|
---|
| 89 | <xsl:call-template name="wrappedSectionText"/>
|
---|
| 90 | </xsl:template>
|
---|
| 91 |
|
---|
| 92 | <xsl:template name="wrappedSectionText">
|
---|
[29861] | 93 | <br /><br />
|
---|
[30020] | 94 | <div id="text{@nodeID}" class="sectionText"><!-- *** -->
|
---|
[31791] | 95 | <xsl:choose>
|
---|
| 96 | <xsl:when test="/page/pageRequest/paramList/param[(@name='docEdit') and (@value='on' or @value='true' or @value='1')]">
|
---|
[30020] | 97 | <xsl:attribute name="contenteditable">
|
---|
| 98 | <xsl:text>true</xsl:text>
|
---|
| 99 | </xsl:attribute>
|
---|
[31791] | 100 | <xsl:call-template name="documentNodeTextForEditing"/>
|
---|
| 101 | </xsl:when>
|
---|
| 102 | <xsl:otherwise>
|
---|
[26020] | 103 | <xsl:attribute name="style">
|
---|
| 104 | <xsl:choose>
|
---|
| 105 | <xsl:when test="/page/pageRequest/paramList/param[@name = 'view']/@value = 'image'">
|
---|
| 106 | <xsl:text>display:none;</xsl:text>
|
---|
| 107 | </xsl:when>
|
---|
| 108 | <xsl:otherwise>
|
---|
| 109 | <xsl:text>display:block;</xsl:text>
|
---|
| 110 | </xsl:otherwise>
|
---|
| 111 | </xsl:choose>
|
---|
| 112 | </xsl:attribute>
|
---|
[31791] | 113 | <xsl:call-template name="documentNodeText"/>
|
---|
[26020] | 114 |
|
---|
[31791] | 115 | </xsl:otherwise>
|
---|
| 116 | </xsl:choose>
|
---|
[26020] | 117 | </div>
|
---|
| 118 | </xsl:template>
|
---|
| 119 |
|
---|
| 120 | <xsl:template name="sectionImage">
|
---|
| 121 | <gsf:image type="screen"/>
|
---|
| 122 | </xsl:template>
|
---|
| 123 |
|
---|
[24650] | 124 | <!-- Used to make sure that regardless what the collection designer uses for the title and content we can wrap it properly -->
|
---|
| 125 | <!-- If editing, be aware that the Document Basket looks for specific classes that this template bakes in (key points marked with ***) -->
|
---|
| 126 | <xsl:template name="wrapDocumentNodes">
|
---|
[30478] | 127 | <xsl:variable name="nodeID" select="@nodeID"/>
|
---|
[25433] | 128 | <a name="{@nodeID}"><xsl:text> </xsl:text></a>
|
---|
[25936] | 129 |
|
---|
[25433] | 130 | <!-- Section header -->
|
---|
| 131 | <table class="sectionHeader"><tr>
|
---|
[25936] | 132 |
|
---|
[25433] | 133 | <!-- Expand/collapse button -->
|
---|
| 134 | <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'">
|
---|
| 135 | <td class="headerTD">
|
---|
| 136 | <img id="dtoggle{@nodeID}" onclick="toggleSection('{@nodeID}');" class="icon">
|
---|
| 137 | <xsl:attribute name="src">
|
---|
[25143] | 138 | <xsl:choose>
|
---|
[30478] | 139 | <xsl:when test="/page/pageRequest/paramList/param[@name = 'ed']/@value = '1' or util:oidIsMatchOrParent($nodeID, /page/pageResponse/document/@selectedNode)">
|
---|
[25433] | 140 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'collapse_image')"/>
|
---|
[25143] | 141 | </xsl:when>
|
---|
| 142 | <xsl:otherwise>
|
---|
[25433] | 143 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'expand_image')"/>
|
---|
[25143] | 144 | </xsl:otherwise>
|
---|
| 145 | </xsl:choose>
|
---|
| 146 | </xsl:attribute>
|
---|
[25433] | 147 | </img>
|
---|
| 148 | </td>
|
---|
| 149 | </xsl:if>
|
---|
[25936] | 150 |
|
---|
[25433] | 151 | <!-- Title -->
|
---|
| 152 | <td id="header{@nodeID}" class="headerTD sectionTitle"><!-- *** -->
|
---|
[25936] | 153 | <p>
|
---|
| 154 | <xsl:attribute name="class"><xsl:value-of select="util:hashToDepthClass(@nodeID)"/> sectionHeader</xsl:attribute>
|
---|
| 155 |
|
---|
| 156 | <xsl:if test="util:hashToSectionId(@nodeID)">
|
---|
| 157 | <span class="sectionNumberSpan">
|
---|
| 158 | <xsl:value-of select="util:hashToSectionId(@nodeID)"/>
|
---|
| 159 | <xsl:text> </xsl:text>
|
---|
| 160 | </span>
|
---|
| 161 | </xsl:if>
|
---|
| 162 | <!-- Display the title for the section regardless of whether automatic section numbering is turned on -->
|
---|
[26175] | 163 | <span><xsl:call-template name="sectionHeading"/></span>
|
---|
[25936] | 164 | </p>
|
---|
[25433] | 165 | </td>
|
---|
| 166 |
|
---|
| 167 | <!-- "back to top" link -->
|
---|
[26216] | 168 | <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'">
|
---|
[25433] | 169 | <td class="backToTop headerTD">
|
---|
| 170 | <a href="javascript:scrollToTop();">
|
---|
| 171 | <xsl:text disable-output-escaping="yes">▲</xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.back_to_top')"/>
|
---|
| 172 | </a>
|
---|
| 173 | </td>
|
---|
| 174 | </xsl:if>
|
---|
| 175 | </tr></table>
|
---|
[25936] | 176 |
|
---|
[25433] | 177 | <div id="doc{@nodeID}"><!-- *** -->
|
---|
| 178 | <xsl:choose>
|
---|
| 179 | <xsl:when test="/page/pageRequest/paramList/param[@name = 'ed']/@value = '1' or /page/pageResponse/document/@selectedNode = @nodeID">
|
---|
| 180 | <xsl:attribute name="class">
|
---|
| 181 | <xsl:text>sectionContainer hasText</xsl:text>
|
---|
| 182 | </xsl:attribute>
|
---|
[25177] | 183 | <xsl:attribute name="style">
|
---|
[25433] | 184 | <xsl:text>display:block;</xsl:text>
|
---|
| 185 | </xsl:attribute>
|
---|
| 186 | </xsl:when>
|
---|
| 187 | <xsl:when test="/page/pageRequest/paramList/param[@name = 'ed']/@value = '1' or util:oidIsMatchOrParent(@nodeID, /page/pageResponse/document/@selectedNode)">
|
---|
| 188 | <xsl:attribute name="class">
|
---|
| 189 | <xsl:text>sectionContainer noText</xsl:text>
|
---|
| 190 | </xsl:attribute>
|
---|
| 191 | <xsl:attribute name="style">
|
---|
| 192 | <xsl:text>display:block;</xsl:text>
|
---|
| 193 | </xsl:attribute>
|
---|
| 194 | </xsl:when>
|
---|
| 195 | <xsl:otherwise>
|
---|
| 196 | <xsl:attribute name="class">
|
---|
| 197 | <xsl:text>sectionContainer noText</xsl:text>
|
---|
| 198 | </xsl:attribute>
|
---|
| 199 | <xsl:attribute name="style">
|
---|
| 200 | <xsl:text>display:none;</xsl:text>
|
---|
| 201 | </xsl:attribute>
|
---|
| 202 | </xsl:otherwise>
|
---|
| 203 | </xsl:choose>
|
---|
| 204 |
|
---|
[28274] | 205 | <xsl:if test="/page/pageRequest/userInformation and /page/pageRequest/userInformation/@editEnabled = 'true' and /page/pageRequest/paramList/param[@name='docEdit']/@value = '1' 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))">
|
---|
[25433] | 206 | <table id="meta{@nodeID}">
|
---|
| 207 | <xsl:attribute name="style">
|
---|
[25177] | 208 | <xsl:choose>
|
---|
[25433] | 209 | <xsl:when test="/page/pageRequest/paramList/param[@name = 'dmd']/@value = 'true'">
|
---|
| 210 | <xsl:text>display:block;</xsl:text>
|
---|
[25177] | 211 | </xsl:when>
|
---|
| 212 | <xsl:otherwise>
|
---|
[25433] | 213 | <xsl:text>display:none;</xsl:text>
|
---|
[25177] | 214 | </xsl:otherwise>
|
---|
| 215 | </xsl:choose>
|
---|
| 216 | </xsl:attribute>
|
---|
[25433] | 217 | <xsl:value-of select="util:clearMetadataStorage()"/>
|
---|
| 218 | <xsl:for-each select="metadataList/metadata">
|
---|
| 219 | <xsl:sort select="@name"/>
|
---|
| 220 | <tr>
|
---|
| 221 | <td class="metaTableCellName"><xsl:value-of select="@name"/></td>
|
---|
[31049] | 222 | <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>
|
---|
[25433] | 223 | </tr>
|
---|
| 224 | </xsl:for-each>
|
---|
| 225 | </table>
|
---|
| 226 | </xsl:if>
|
---|
[26020] | 227 | <xsl:choose>
|
---|
| 228 | <xsl:when test="../../document">
|
---|
| 229 | <xsl:call-template name="topLevelSectionContent"/>
|
---|
| 230 | </xsl:when>
|
---|
| 231 | <xsl:otherwise>
|
---|
| 232 | <xsl:call-template name="sectionContent"/>
|
---|
| 233 | </xsl:otherwise>
|
---|
| 234 | </xsl:choose>
|
---|
[25433] | 235 | <xsl:if test="documentNode">
|
---|
| 236 | <xsl:for-each select="documentNode">
|
---|
[24650] | 237 | <xsl:call-template name="wrapDocumentNodes"/>
|
---|
[25433] | 238 | </xsl:for-each>
|
---|
| 239 | </xsl:if>
|
---|
| 240 | </div>
|
---|
[24650] | 241 | </xsl:template>
|
---|
[19988] | 242 |
|
---|
[30345] | 243 | <xsl:template name="javascriptForDocumentView">
|
---|
| 244 | <script type="text/javascript" src="interfaces/{$interface_name}/js/document_scripts.js"><xsl:text> </xsl:text></script>
|
---|
[31416] | 245 | <script type="text/javascript">
|
---|
| 246 | <xsl:text disable-output-escaping="yes">
|
---|
| 247 | function goToAnchor(sectionID,anchor)
|
---|
| 248 | {
|
---|
| 249 | var docIdentifier = '</xsl:text><xsl:value-of select="//documentNode[@nodeType = 'root']/@nodeID"/><xsl:text disable-output-escaping="yes">';
|
---|
| 250 | focusAnchor(docIdentifier + "."+ sectionID,0,1,anchor);
|
---|
| 251 | }
|
---|
| 252 | </xsl:text>
|
---|
| 253 | </script>
|
---|
[30345] | 254 | </xsl:template>
|
---|
[29172] | 255 | <xsl:template name="javascriptForDocumentEditing">
|
---|
[31749] | 256 | <!-- <script type="text/javascript" src="interfaces/{$interface_name}/js/documentmaker_scripts.js"><xsl:text> </xsl:text></script>-->
|
---|
| 257 | <script type="text/javascript" src="interfaces/{$interface_name}/js/documentedit_scripts.js"><xsl:text> </xsl:text></script>
|
---|
| 258 | <script type="text/javascript" src="interfaces/{$interface_name}/js/documentedit_scripts_util.js"><xsl:text> </xsl:text></script>
|
---|
[30382] | 259 | <script type="text/javascript" src="interfaces/{$interface_name}/js/hierarchy.js"><xsl:text> </xsl:text></script>
|
---|
[25462] | 260 | <script type="text/javascript">
|
---|
| 261 | <xsl:text disable-output-escaping="yes">
|
---|
[30773] | 262 |
|
---|
[25462] | 263 | $(window).load(function()
|
---|
| 264 | {
|
---|
| 265 | if(gs.cgiParams.docEdit == "1")
|
---|
| 266 | {
|
---|
| 267 | readyPageForEditing();
|
---|
| 268 | }
|
---|
| 269 | });
|
---|
| 270 | </xsl:text>
|
---|
[30382] | 271 | <!-- download and process hierarchy files -->
|
---|
| 272 | <xsl:text disable-output-escaping="yes">$(document).ready(function(){</xsl:text>
|
---|
| 273 | <xsl:for-each select="//classifier[@hfile]">
|
---|
| 274 | <xsl:text disable-output-escaping="yes">downloadAndProcessHierarchyFile('</xsl:text>
|
---|
| 275 | <xsl:text>sites/localsite/collect/</xsl:text><xsl:value-of select="$collName"/><xsl:text>/etc/</xsl:text><xsl:value-of select="@hfile"/>
|
---|
| 276 | <xsl:text disable-output-escaping="yes">','</xsl:text><xsl:value-of select="@metadata"/><xsl:text disable-output-escaping="yes">');</xsl:text>
|
---|
| 277 | </xsl:for-each>
|
---|
| 278 | <xsl:text disable-output-escaping="yes">});</xsl:text>
|
---|
| 279 |
|
---|
[25462] | 280 | </script>
|
---|
[29172] | 281 |
|
---|
| 282 | </xsl:template>
|
---|
[24791] | 283 |
|
---|
[29172] | 284 | <!-- the page content -->
|
---|
| 285 | <xsl:template match="/page/pageResponse/document">
|
---|
| 286 | <xsl:if test="$bookswitch = 'off'">
|
---|
[30345] | 287 | <xsl:call-template name="javascriptForDocumentView"/>
|
---|
[30773] | 288 | <gslib:langfrag name="doc"/>
|
---|
[29172] | 289 | <xsl:if test="/page/pageResponse/collection[@name = $collName]/metadataList/metadata[@name = 'tidyoption'] = 'tidy'">
|
---|
| 290 | <script type="text/javascript">
|
---|
| 291 | <xsl:text disable-output-escaping="yes">
|
---|
| 292 | if(document.URL.indexOf("book=on") != -1)
|
---|
| 293 | {
|
---|
| 294 | loadBook();
|
---|
| 295 | }
|
---|
| 296 | </xsl:text>
|
---|
| 297 | </script>
|
---|
| 298 | </xsl:if>
|
---|
| 299 | </xsl:if>
|
---|
| 300 | <xsl:variable name="canDoEditing">
|
---|
| 301 | <xsl:if test="/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>
|
---|
| 302 | </xsl:variable>
|
---|
| 303 | <xsl:if test="$canDoEditing = 'true'">
|
---|
| 304 | <xsl:call-template name="javascriptForDocumentEditing"/>
|
---|
| 305 | <gsf:metadata name="all"/>
|
---|
| 306 | <gslib:langfrag name="dse"/>
|
---|
[30773] | 307 | <gslib:langfrag name="de"/>
|
---|
[29172] | 308 | </xsl:if>
|
---|
| 309 |
|
---|
[23989] | 310 | <xsl:if test="$bookswitch = 'off'">
|
---|
[24018] | 311 | <div id="bookdiv" style="visibility:hidden; height:0px; display:inline;"><xsl:text> </xsl:text></div>
|
---|
| 312 |
|
---|
[29172] | 313 | <div id="float-anchor" style="width: 30%; min-width:180px; float:right; margin: 0 0 10px 20px;">
|
---|
[31749] | 314 | <xsl:if test="$canDoEditing = 'true'">
|
---|
[25371] | 315 | <xsl:call-template name="editBar"/>
|
---|
[25072] | 316 | </xsl:if>
|
---|
[24791] | 317 | <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'">
|
---|
[25371] | 318 | <xsl:call-template name="rightSidebar"/>
|
---|
[24650] | 319 | </xsl:if>
|
---|
[29440] | 320 | <!-- add in some text just in case nothing has been added to this div-->
|
---|
| 321 | <xsl:text> </xsl:text>
|
---|
[29172] | 322 | </div>
|
---|
[31752] | 323 | <xsl:if test="$canDoEditing = 'true'">
|
---|
| 324 | <script type="text/javascript">
|
---|
[29172] | 325 | if (keep_editing_controls_visible) {
|
---|
| 326 | $(function() {
|
---|
| 327 | moveScroller();
|
---|
| 328 | });
|
---|
| 329 | }
|
---|
| 330 | </script>
|
---|
[31752] | 331 | </xsl:if>
|
---|
[23989] | 332 | </xsl:if>
|
---|
| 333 |
|
---|
[19856] | 334 | <!-- display the document -->
|
---|
[23813] | 335 | <xsl:choose>
|
---|
[19856] | 336 | <xsl:when test="@external != ''">
|
---|
| 337 | <xsl:call-template name="externalPage">
|
---|
| 338 | <xsl:with-param name="external" select="@external"/>
|
---|
| 339 | </xsl:call-template>
|
---|
| 340 | </xsl:when>
|
---|
[23989] | 341 | <xsl:when test="$bookswitch = 'flashxml'">
|
---|
[25720] | 342 | <xsl:call-template name="documentNodeFlashXML"/>
|
---|
[23989] | 343 | </xsl:when>
|
---|
| 344 | <xsl:when test="$bookswitch = 'on'">
|
---|
[24018] | 345 | <div id="bookdiv" style="display:inline;"><xsl:text> </xsl:text></div>
|
---|
[24791] | 346 | <!-- *** in document-scripts.js *** -->
|
---|
[24467] | 347 | <script type="text/javascript">
|
---|
| 348 | <xsl:text disable-output-escaping="yes">
|
---|
| 349 | if(document.URL.indexOf("book=on") != -1)
|
---|
| 350 | {
|
---|
| 351 | loadBook();
|
---|
| 352 | }
|
---|
| 353 | </xsl:text>
|
---|
| 354 | </script>
|
---|
[23989] | 355 | </xsl:when>
|
---|
[29166] | 356 | <!-- 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-->
|
---|
| 357 | <!-- This is the first choice from wrappedDocument template-->
|
---|
| 358 | <xsl:when test="$canDoEditing = 'true' and /page/pageRequest/paramList/param[@name='docEdit']/@value = '1'">
|
---|
[30773] | 359 | <div id="gs-document" style="width: 67%">
|
---|
[29166] | 360 | <xsl:call-template name="documentPre"/>
|
---|
| 361 | <div id="gs-document-text" class="documenttext" collection="{/page/pageResponse/collection/@name}"><!-- *** -->
|
---|
[29525] | 362 | <xsl:choose>
|
---|
| 363 | <xsl:when test="@docType='simple'">
|
---|
| 364 | <xsl:call-template name="wrapDocumentNodes"/>
|
---|
| 365 | </xsl:when>
|
---|
| 366 | <xsl:otherwise>
|
---|
[29166] | 367 | <xsl:for-each select="documentNode">
|
---|
| 368 | <xsl:call-template name="wrapDocumentNodes"/>
|
---|
| 369 | </xsl:for-each>
|
---|
[29525] | 370 | </xsl:otherwise>
|
---|
| 371 | </xsl:choose>
|
---|
[29166] | 372 | </div>
|
---|
| 373 | </div>
|
---|
| 374 | </xsl:when>
|
---|
[25837] | 375 | <xsl:when test="@docType='simple'">
|
---|
| 376 | <xsl:call-template name="documentHeading"/><br/>
|
---|
| 377 | <xsl:call-template name="documentContent"/>
|
---|
[31537] | 378 | <br /><xsl:call-template name="userCommentsSection"/>
|
---|
[29172] | 379 | </xsl:when>
|
---|
[25837] | 380 | <xsl:otherwise> <!-- display the standard greenstone document -->
|
---|
[26298] | 381 | <xsl:call-template name="wrappedDocument"/>
|
---|
[31540] | 382 | <br /><xsl:call-template name="userCommentsSection"/>
|
---|
[25837] | 383 | </xsl:otherwise>
|
---|
| 384 | </xsl:choose>
|
---|
| 385 | </xsl:template>
|
---|
[25949] | 386 |
|
---|
[25824] | 387 | <xsl:template name="wrappedDocument">
|
---|
[25837] | 388 | <xsl:choose>
|
---|
[25936] | 389 | <!-- NOTE: alb = ajax load bypass -->
|
---|
[26205] | 390 | <!--
|
---|
[31534] | 391 | If we have asked for expanded document, then do this.
|
---|
| 392 | OR If the docType is hierarchy and we want to bypass the ajax load then do this
|
---|
| 393 | OR If the docType is hierarchy and we have asked for the top level document then do this
|
---|
[26205] | 394 | -->
|
---|
[31534] | 395 | <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, '.')))))">
|
---|
[25837] | 396 | <div id="gs-document">
|
---|
| 397 | <xsl:call-template name="documentPre"/>
|
---|
| 398 | <div id="gs-document-text" class="documenttext" collection="{/page/pageResponse/collection/@name}"><!-- *** -->
|
---|
| 399 | <xsl:for-each select="documentNode">
|
---|
| 400 | <xsl:call-template name="wrapDocumentNodes"/>
|
---|
| 401 | </xsl:for-each>
|
---|
| 402 | </div>
|
---|
| 403 | </div>
|
---|
| 404 | </xsl:when>
|
---|
[25972] | 405 | <xsl:when test="/page/pageResponse/document/@docType = 'paged' or /page/pageResponse/document/@docType = 'pagedhierarchy'">
|
---|
[25936] | 406 | <div id="gs-document">
|
---|
| 407 | <div id="tocLoadingImage" style="text-align:center;">
|
---|
| 408 | <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>
|
---|
| 409 | </div>
|
---|
| 410 | </div>
|
---|
| 411 | <script type="text/javascript">
|
---|
| 412 | <xsl:text disable-output-escaping="yes">
|
---|
| 413 | $(window).load(function()
|
---|
| 414 | {
|
---|
[26296] | 415 | var sectionID = gs.cgiParams.d;
|
---|
| 416 | var callbackFunction = null;
|
---|
| 417 | if(sectionID.indexOf("\\.") == -1)
|
---|
| 418 | {
|
---|
| 419 | callbackFunction = function()
|
---|
| 420 | {
|
---|
| 421 | focusSection(sectionID);
|
---|
| 422 | };
|
---|
| 423 | }
|
---|
| 424 |
|
---|
| 425 | var docID = sectionID.replace(/([^.]*)\..*/, "$1");
|
---|
| 426 | var url = gs.xsltParams.library_name + "?a=d&c=" + gs.cgiParams.c + "&excerptid=gs-document&dt=hierarchy&d=" + docID;
|
---|
| 427 | loadTopLevelPage(callbackFunction, url);
|
---|
[25936] | 428 | });
|
---|
| 429 | </xsl:text>
|
---|
| 430 | </script>
|
---|
| 431 | </xsl:when>
|
---|
[25837] | 432 | <xsl:otherwise>
|
---|
| 433 | <div id="gs-document">
|
---|
| 434 | <div id="tocLoadingImage" style="text-align:center;">
|
---|
| 435 | <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>
|
---|
| 436 | </div>
|
---|
| 437 | </div>
|
---|
| 438 | <script type="text/javascript">
|
---|
| 439 | <xsl:text disable-output-escaping="yes">
|
---|
| 440 | $(window).load(function()
|
---|
| 441 | {
|
---|
| 442 | loadTopLevelPage(function()
|
---|
| 443 | {
|
---|
| 444 | //Don't focus the section until the table of contents is loaded
|
---|
| 445 | var tocCheck = function()
|
---|
[25371] | 446 | {
|
---|
[25837] | 447 | if(gs.variables.tocLoaded)
|
---|
[25371] | 448 | {
|
---|
[25837] | 449 | focusSection("</xsl:text><xsl:value-of select="/page/pageResponse/document/@selectedNode"/><xsl:text disable-output-escaping="yes">");
|
---|
| 450 | }
|
---|
| 451 | else
|
---|
| 452 | {
|
---|
| 453 | setTimeout(tocCheck, 500);
|
---|
| 454 | }
|
---|
| 455 | }
|
---|
| 456 | tocCheck();
|
---|
| 457 | });
|
---|
| 458 | });
|
---|
| 459 | </xsl:text>
|
---|
| 460 | </script>
|
---|
| 461 | </xsl:otherwise>
|
---|
[19856] | 462 | </xsl:choose>
|
---|
[24791] | 463 |
|
---|
[19856] | 464 | <div class="clear"><xsl:text> </xsl:text></div>
|
---|
[23989] | 465 | </xsl:template>
|
---|
| 466 |
|
---|
[25371] | 467 | <xsl:template name="editBar">
|
---|
[29172] | 468 | <table style="width:100%; border:none;" id="editBar" class="ui-widget-content"><tr>
|
---|
[25371] | 469 | <td id="editBarLeft" style="width:70%"><xsl:text> </xsl:text></td>
|
---|
| 470 | <td id="editBarRight">
|
---|
| 471 | <div style="text-align:center;">
|
---|
[30097] | 472 | <!-- edit structure button -->
|
---|
| 473 | <!-- comment this out as its not working -->
|
---|
| 474 | <!-- <div style="margin:5px;" class="ui-state-default ui-corner-all">
|
---|
[30773] | 475 | <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, 'dse.edit_structure')"/></a>
|
---|
[30097] | 476 | </div>-->
|
---|
| 477 | <!-- edit content button -->
|
---|
[25371] | 478 | <div style="margin:5px;" class="ui-state-default ui-corner-all">
|
---|
[25462] | 479 | <a id="editContentButton" style="padding: 3px; text-decoration:none;">
|
---|
| 480 | <xsl:attribute name="href">
|
---|
| 481 | <xsl:value-of select="$library_name"/>
|
---|
| 482 | <xsl:text>/collection/</xsl:text>
|
---|
| 483 | <xsl:value-of select="$collName"/>
|
---|
| 484 | <xsl:text>/document/</xsl:text>
|
---|
[26140] | 485 | <xsl:choose>
|
---|
| 486 | <xsl:when test="count(//documentNode) > 0">
|
---|
| 487 | <xsl:value-of select="/page/pageResponse/document/documentNode/@nodeID"/>
|
---|
| 488 | </xsl:when>
|
---|
| 489 | <xsl:otherwise>
|
---|
| 490 | <xsl:value-of select="/page/pageResponse/document/@nodeID"/>
|
---|
| 491 | </xsl:otherwise>
|
---|
| 492 | </xsl:choose>
|
---|
[25462] | 493 | <xsl:if test="not(/page/pageRequest/paramList/param[@name = 'docEdit']/@value = '1')">
|
---|
[29166] | 494 | <xsl:text>?ed=1&docEdit=1</xsl:text>
|
---|
[25462] | 495 | </xsl:if>
|
---|
| 496 | </xsl:attribute>
|
---|
| 497 | <xsl:choose>
|
---|
| 498 | <xsl:when test="/page/pageRequest/paramList/param[@name = 'docEdit']/@value = '1'">
|
---|
[30773] | 499 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'de.hide_editor')"/>
|
---|
[25462] | 500 | </xsl:when>
|
---|
| 501 | <xsl:otherwise>
|
---|
[30773] | 502 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'de.edit_content')"/>
|
---|
[25462] | 503 | </xsl:otherwise>
|
---|
| 504 | </xsl:choose>
|
---|
| 505 | </a>
|
---|
[25371] | 506 | </div>
|
---|
| 507 | </div>
|
---|
| 508 | </td>
|
---|
| 509 | </tr></table>
|
---|
[25720] | 510 | <gslib:langfrag name="dse"/>
|
---|
[25371] | 511 | </xsl:template>
|
---|
| 512 |
|
---|
[23989] | 513 | <!-- Highlight annotations if requested -->
|
---|
[25720] | 514 | <xsl:template name="displayAnnotation">
|
---|
[23989] | 515 | <xsl:choose>
|
---|
[31248] | 516 | <xsl:when test="/page/pageRequest/paramList/param[@name = 'hl']/@value = 'off' or /page/pageResponse/format[@type='display']/gsf:option[@name='disableSearchTermHighlighting']/@value='true'">
|
---|
[29399] | 517 | <span class="noTermHighlight"><xsl:value-of select="."/></span>
|
---|
[23989] | 518 | </xsl:when>
|
---|
| 519 | <xsl:otherwise>
|
---|
[29399] | 520 | <span class="termHighlight"><xsl:value-of select="."/></span>
|
---|
[23989] | 521 | </xsl:otherwise>
|
---|
| 522 | </xsl:choose>
|
---|
| 523 | </xsl:template>
|
---|
[25660] | 524 |
|
---|
[24650] | 525 | <!-- The default template for displaying section titles -->
|
---|
[25720] | 526 | <xsl:template name="sectionTitle">
|
---|
[24650] | 527 | <xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Title']"/>
|
---|
| 528 | </xsl:template>
|
---|
| 529 |
|
---|
[26020] | 530 | <xsl:template name="wrappedSectionImage">
|
---|
[25433] | 531 | <gsf:variable name="screenImageWidth"><gsf:metadata name="ScreenWidth"/></gsf:variable>
|
---|
| 532 | <gsf:variable name="screenImageHeight"><gsf:metadata name="ScreenHeight"/></gsf:variable>
|
---|
| 533 | <gsf:variable name="imageWidth"><gsf:metadata name="ImageWidth"/></gsf:variable>
|
---|
| 534 | <gsf:variable name="imageHeight"><gsf:metadata name="ImageHeight"/></gsf:variable>
|
---|
| 535 |
|
---|
| 536 | <xsl:choose>
|
---|
[28164] | 537 | <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')">
|
---|
[25936] | 538 | <div id="image{@nodeID}">
|
---|
| 539 | <div id="wrap{util:replace(@nodeID, '.', '_')}" class="zoomImage" style="position:relative; width: {$screenImageWidth}px; height: {$screenImageHeight}px;">
|
---|
| 540 | <div id="small{util:replace(@nodeID, '.', '_')}" style="position:relative; width: {$screenImageWidth}px; height: {$screenImageHeight}px;">
|
---|
[28622] | 541 | <gsf:link type="source"><gsf:image type="screen"/></gsf:link>
|
---|
[25433] | 542 | </div>
|
---|
[26408] | 543 | <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;">
|
---|
| 544 | <div id="overlay{util:replace(@nodeID, '.', '_')}" style="width: 600px; height: 600px; position: absolute; top: 0; left: 0; z-index: 200;">
|
---|
[25936] | 545 | <xsl:text> </xsl:text>
|
---|
| 546 | </div>
|
---|
| 547 | <div id="large{util:replace(@nodeID, '.', '_')}" style="position: relative; width: {$imageWidth}px; height: {$imageHeight}px;">
|
---|
[28622] | 548 | <gsf:link type="source"><gsf:image type="source"/></gsf:link>
|
---|
[25936] | 549 | </div>
|
---|
[25433] | 550 | </div>
|
---|
| 551 | </div>
|
---|
[25936] | 552 | <script type="text/javascript">
|
---|
| 553 | <xsl:text disable-output-escaping="yes">
|
---|
| 554 | {
|
---|
| 555 | var nodeID = "</xsl:text><xsl:value-of select="@nodeID"/><xsl:text disable-output-escaping="yes">";
|
---|
| 556 | nodeID = nodeID.replace(/\./g, "_");
|
---|
[25462] | 557 |
|
---|
[25936] | 558 | var bigHeight = </xsl:text><xsl:value-of select="$imageHeight"/><xsl:text disable-output-escaping="yes">;
|
---|
| 559 | var smallHeight = </xsl:text><xsl:value-of select="$screenImageHeight"/><xsl:text disable-output-escaping="yes">;
|
---|
[25462] | 560 |
|
---|
[25936] | 561 | var multiplier = bigHeight / smallHeight;
|
---|
[25433] | 562 |
|
---|
[25936] | 563 | $("#wrap" + nodeID).anythingZoomer({
|
---|
| 564 | smallArea: "#small" + nodeID,
|
---|
| 565 | largeArea: "#large" + nodeID,
|
---|
| 566 | zoomPort: "#overlay" + nodeID,
|
---|
| 567 | mover: "#mover" + nodeID,
|
---|
| 568 | expansionSize:50,
|
---|
| 569 | speedMultiplier:multiplier
|
---|
| 570 | });
|
---|
[26024] | 571 |
|
---|
[29321] | 572 | $("#zoomOptions input").prop("checked", false);
|
---|
[29441] | 573 | $("#zoomOptions").css("display", "");
|
---|
[25936] | 574 | }
|
---|
| 575 | </xsl:text>
|
---|
| 576 | </script>
|
---|
| 577 | </div>
|
---|
[25433] | 578 | </xsl:when>
|
---|
[26020] | 579 | <xsl:otherwise>
|
---|
[25433] | 580 | <div id="image{@nodeID}">
|
---|
| 581 | <xsl:attribute name="style">
|
---|
| 582 | <xsl:choose>
|
---|
| 583 | <xsl:when test="/page/pageRequest/paramList/param[@name = 'view']/@value = 'text'">
|
---|
| 584 | <xsl:text>display:none;</xsl:text>
|
---|
| 585 | </xsl:when>
|
---|
| 586 | <xsl:otherwise>
|
---|
| 587 | <xsl:text>display:block;</xsl:text>
|
---|
| 588 | </xsl:otherwise>
|
---|
| 589 | </xsl:choose>
|
---|
| 590 | </xsl:attribute>
|
---|
[26020] | 591 | <xsl:call-template name="sectionImage"/><xsl:text> </xsl:text>
|
---|
[25433] | 592 | </div>
|
---|
[26020] | 593 | </xsl:otherwise>
|
---|
[25433] | 594 | </xsl:choose>
|
---|
| 595 | </xsl:template>
|
---|
[25837] | 596 |
|
---|
[25824] | 597 | <!-- The default template for displaying the document node text -->
|
---|
[25837] | 598 | <!-- equivalent to gsf:text -->
|
---|
[25824] | 599 | <xsl:template name="documentNodeText">
|
---|
[25433] | 600 | <!-- Hides the "This document has no text." message -->
|
---|
| 601 | <xsl:variable name="noText"><gsf:metadata name="NoText"/></xsl:variable>
|
---|
[28622] | 602 | <xsl:choose>
|
---|
| 603 | <xsl:when test="not($noText = '1')">
|
---|
| 604 |
|
---|
[25837] | 605 | <!-- Section text -->
|
---|
| 606 | <xsl:for-each select="nodeContent">
|
---|
| 607 | <xsl:for-each select="node()">
|
---|
| 608 | <xsl:choose>
|
---|
| 609 | <xsl:when test="not(name())">
|
---|
[30478] | 610 | <xsl:value-of select="." disable-output-escaping="yes"/>
|
---|
[25837] | 611 | </xsl:when>
|
---|
| 612 | <xsl:when test="name() = 'annotation'">
|
---|
| 613 | <xsl:call-template name="displayAnnotation"/>
|
---|
| 614 | </xsl:when>
|
---|
| 615 | <xsl:otherwise>
|
---|
| 616 | <xsl:apply-templates/>
|
---|
| 617 | </xsl:otherwise>
|
---|
| 618 | </xsl:choose>
|
---|
| 619 | </xsl:for-each>
|
---|
[23989] | 620 | </xsl:for-each>
|
---|
[28622] | 621 | </xsl:when>
|
---|
| 622 | <xsl:when test="$noText = '1' and not(metadataList/metadata[@name='Image'])">
|
---|
| 623 | <gsf:link type="source"><gsf:metadata name="Source"/></gsf:link>
|
---|
| 624 | </xsl:when>
|
---|
| 625 | </xsl:choose>
|
---|
| 626 | <xsl:text> </xsl:text>
|
---|
[19856] | 627 | </xsl:template>
|
---|
[25824] | 628 |
|
---|
[31791] | 629 | <!-- The default template for displaying the document node text in
|
---|
| 630 | editing mode -->
|
---|
| 631 | <!-- equivalent to gsf:text -->
|
---|
| 632 | <xsl:template name="documentNodeTextForEditing">
|
---|
| 633 | <!-- Section text -->
|
---|
| 634 | <xsl:for-each select="nodeContent">
|
---|
| 635 | <xsl:for-each select="node()">
|
---|
| 636 | <xsl:choose>
|
---|
| 637 | <xsl:when test="not(name())">
|
---|
| 638 | <xsl:value-of select="." disable-output-escaping="yes"/>
|
---|
| 639 | </xsl:when>
|
---|
| 640 | <xsl:otherwise>
|
---|
| 641 | <xsl:apply-templates/>
|
---|
| 642 | </xsl:otherwise>
|
---|
| 643 | </xsl:choose>
|
---|
| 644 | </xsl:for-each>
|
---|
| 645 | </xsl:for-each>
|
---|
| 646 | </xsl:template>
|
---|
[23989] | 647 | <!-- Used to produce a version of the page in a format that can be read by the realistic books plugin -->
|
---|
[25720] | 648 | <xsl:template name="documentNodeFlashXML">
|
---|
[23989] | 649 | <xsl:text disable-output-escaping="yes">
|
---|
| 650 | <Section>
|
---|
| 651 | <Description>
|
---|
| 652 | <Metadata name="Title">
|
---|
| 653 | </xsl:text>
|
---|
| 654 | <xsl:value-of select="normalize-space(metadataList/metadata[@name = 'Title'])"/>
|
---|
| 655 | <xsl:text disable-output-escaping="yes">
|
---|
| 656 | </Metadata>
|
---|
| 657 | </Description>
|
---|
| 658 | </xsl:text>
|
---|
| 659 |
|
---|
| 660 | <xsl:value-of select="normalize-space(nodeContent)" disable-output-escaping="yes"/>
|
---|
| 661 |
|
---|
[25660] | 662 | <xsl:for-each select="documentNode">
|
---|
[25720] | 663 | <xsl:call-template name="documentNodeFlashXML"/>
|
---|
[25660] | 664 | </xsl:for-each>
|
---|
[23989] | 665 |
|
---|
| 666 | <xsl:text disable-output-escaping="yes">
|
---|
| 667 | </Section>
|
---|
| 668 | </xsl:text>
|
---|
| 669 | </xsl:template>
|
---|
| 670 |
|
---|
[23813] | 671 | <xsl:template name="externalPage">
|
---|
| 672 | <xsl:param name="external"/>
|
---|
| 673 | <xsl:variable name="go_forward_link">
|
---|
| 674 | <a>
|
---|
| 675 | <xsl:attribute name="href">
|
---|
| 676 | <xsl:value-of select="$external"/>
|
---|
| 677 | </xsl:attribute>
|
---|
| 678 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'external.go_forward')"/>
|
---|
| 679 | </a>
|
---|
| 680 | </xsl:variable>
|
---|
| 681 | <h2><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'external.title')"/></h2>
|
---|
| 682 | <p><xsl:value-of select="util:getInterfaceTextWithDOM($interface_name, /page/@lang, 'external.text', $go_forward_link)" disable-output-escaping="yes"/></p>
|
---|
| 683 | </xsl:template>
|
---|
[19856] | 684 |
|
---|
| 685 | <xsl:template match="/page"><xsl:apply-templates select="/page/pageResponse/document"/></xsl:template> <!-- this to be deleted eventually -->
|
---|
[23989] | 686 |
|
---|
[25371] | 687 | <xsl:template name="documentPre">
|
---|
[24996] | 688 | <xsl:if test="/page/pageResponse/format[@type='display' or @type='browse' or @type='search']/gsf:option[@name='mapEnabled']/@value = 'true'">
|
---|
| 689 | <xsl:call-template name="mapFeatures"/>
|
---|
| 690 | </xsl:if>
|
---|
| 691 | </xsl:template>
|
---|
| 692 |
|
---|
| 693 | <xsl:template name="mapFeatures">
|
---|
[25462] | 694 | <div id="map_canvas" class="map_canvas_full"><xsl:text> </xsl:text></div>
|
---|
[24996] | 695 |
|
---|
[26178] | 696 | <xsl:choose>
|
---|
| 697 | <!-- HIERARCHICAL DOCUMENTS -->
|
---|
| 698 | <xsl:when test="count(//documentNode) > 0">
|
---|
| 699 | <xsl:for-each select="documentNode">
|
---|
| 700 | <xsl:call-template name="mapPlacesNearHere"/>
|
---|
| 701 | </xsl:for-each>
|
---|
| 702 | </xsl:when>
|
---|
| 703 | <!-- SIMPLE DOCUMENTS -->
|
---|
| 704 | <xsl:otherwise>
|
---|
| 705 | <xsl:call-template name="mapPlacesNearHere"/>
|
---|
| 706 | </xsl:otherwise>
|
---|
| 707 | </xsl:choose>
|
---|
[24996] | 708 |
|
---|
| 709 | <div id="jsonNodes" style="display:none;">
|
---|
| 710 | <xsl:text>[</xsl:text>
|
---|
[26139] | 711 | <xsl:choose>
|
---|
| 712 | <!-- HIERARCHICAL DOCUMENTS -->
|
---|
| 713 | <xsl:when test="count(//documentNode) > 0">
|
---|
| 714 | <xsl:for-each select="//documentNode">
|
---|
| 715 | <xsl:if test="metadataList/metadata[@name = 'Latitude'] and metadataList/metadata[@name = 'Longitude']">
|
---|
| 716 | <xsl:text>{</xsl:text>
|
---|
| 717 | <xsl:text disable-output-escaping="yes">"nodeID":"</xsl:text><xsl:value-of select="@nodeID"/><xsl:text disable-output-escaping="yes">",</xsl:text>
|
---|
| 718 | <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>
|
---|
| 719 | <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>
|
---|
| 720 | <xsl:text disable-output-escaping="yes">"lng":</xsl:text><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Longitude']"/>
|
---|
| 721 | <xsl:text>}</xsl:text>
|
---|
| 722 | <xsl:if test="not(position() = count(//documentNode))">
|
---|
| 723 | <xsl:text>,</xsl:text>
|
---|
| 724 | </xsl:if>
|
---|
| 725 | </xsl:if>
|
---|
| 726 | </xsl:for-each>
|
---|
| 727 | </xsl:when>
|
---|
| 728 | <!-- SIMPLE DOCUMENTS -->
|
---|
| 729 | <xsl:otherwise>
|
---|
| 730 | <xsl:for-each select="/page/pageResponse/document">
|
---|
| 731 | <xsl:if test="metadataList/metadata[@name = 'Latitude'] and metadataList/metadata[@name = 'Longitude']">
|
---|
| 732 | <xsl:text>{</xsl:text>
|
---|
| 733 | <xsl:text disable-output-escaping="yes">"nodeID":"</xsl:text><xsl:value-of select="@selectedNode"/><xsl:text disable-output-escaping="yes">",</xsl:text>
|
---|
| 734 | <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>
|
---|
| 735 | <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>
|
---|
| 736 | <xsl:text disable-output-escaping="yes">"lng":</xsl:text><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Longitude']"/>
|
---|
| 737 | <xsl:text>}</xsl:text>
|
---|
| 738 | </xsl:if>
|
---|
| 739 | </xsl:for-each>
|
---|
| 740 | </xsl:otherwise>
|
---|
| 741 | </xsl:choose>
|
---|
[24996] | 742 | <xsl:text>]</xsl:text>
|
---|
| 743 | </div>
|
---|
| 744 | </xsl:template>
|
---|
[26178] | 745 |
|
---|
| 746 | <xsl:template name="mapPlacesNearHere">
|
---|
| 747 | <xsl:if test="metadataList/metadata[@name = 'Latitude'] and metadataList/metadata[@name = 'Longitude']">
|
---|
| 748 | <div style="background:#BBFFBB; padding: 5px; margin:0px auto; width:890px;">
|
---|
[30773] | 749 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.map_nearby_docs')"/>
|
---|
[26178] | 750 | <img id="nearbyDocumentsToggle" style="margin-left:5px;" src="interfaces/{$interface_name}/images/expand.png">
|
---|
| 751 | <xsl:attribute name="onclick">
|
---|
| 752 | <xsl:text>performDistanceSearch('</xsl:text>
|
---|
| 753 | <xsl:value-of select="@nodeID"/>
|
---|
| 754 | <xsl:text>', '</xsl:text>
|
---|
| 755 | <gsf:metadata name="Latitude"/>
|
---|
| 756 | <xsl:text>', '</xsl:text>
|
---|
| 757 | <gsf:metadata name="Longitude"/>
|
---|
| 758 | <xsl:text>', 2);</xsl:text>
|
---|
| 759 | </xsl:attribute>
|
---|
| 760 | </img>
|
---|
| 761 | <div id="nearbyDocuments"><xsl:text> </xsl:text></div>
|
---|
| 762 | </div>
|
---|
| 763 | </xsl:if>
|
---|
| 764 | </xsl:template>
|
---|
[19856] | 765 | </xsl:stylesheet>
|
---|