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