Changeset 13996 for trunk/gsdl3/web/interfaces
- Timestamp:
- 2007-03-28T16:24:18+12:00 (17 years ago)
- Location:
- trunk/gsdl3/web/interfaces/default/transform
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl3/web/interfaces/default/transform/config_format.xsl
r13227 r13996 37 37 </xsl:when> 38 38 <xsl:otherwise> <!-- a document link --> 39 <a><xslt:attribute name="href"><xslt:value-of select='$library_name'/>?a=d&c=<xslt:value-of select='$collName'/>&d=<xslt:value-of select='@nodeID'/>&dt=<xslt:value-of select='@docType'/><xslt:if test="@nodeType='leaf'">&sib=1</xslt:if>&p.a=<xslt:value-of select="/page/pageRequest/@action"/>&p.sa=<xsl:value-of select="/page/pageRequest/@subaction"/>&p.s=<xslt:value-of select="$serviceName"/></xslt:attribute><xsl:apply-templates/></a> 39 <xslt:variable name="bookswitch"><xslt:value-of select="/page/pageRequest/paramList/param[@name='book']/@value"/></xslt:variable> 40 <xslt:choose> 41 <xslt:when test="$bookswitch = 'on' or $bookswitch = 'flashxml'"> 42 <a><xslt:attribute name="href"><xslt:value-of select='$library_name'/>?a=d&ed=1&book=on&c=<xslt:value-of select='$collName'/>&d=<xslt:value-of select='@nodeID'/>&dt=<xslt:value-of select='@docType'/><xslt:if test="@nodeType='leaf'">&sib=1</xslt:if>&p.a=<xslt:value-of select="/page/pageRequest/@action"/>&p.sa=<xsl:value-of select="/page/pageRequest/@subaction"/>&p.s=<xslt:value-of select="$serviceName"/></xslt:attribute><xsl:apply-templates/></a> 43 </xslt:when> 44 <xslt:otherwise> 45 <a><xslt:attribute name="href"><xslt:value-of select='$library_name'/>?a=d&book=off&c=<xslt:value-of select='$collName'/>&d=<xslt:value-of select='@nodeID'/>&dt=<xslt:value-of select='@docType'/><xslt:if test="@nodeType='leaf'">&sib=1</xslt:if>&p.a=<xslt:value-of select="/page/pageRequest/@action"/>&p.sa=<xsl:value-of select="/page/pageRequest/@subaction"/>&p.s=<xslt:value-of select="$serviceName"/></xslt:attribute><xsl:apply-templates/></a> 46 </xslt:otherwise> 47 </xslt:choose> 40 48 </xsl:otherwise> 41 49 </xsl:choose> -
trunk/gsdl3/web/interfaces/default/transform/document.xsl
r13831 r13996 14 14 <xsl:output method="html"/> 15 15 <xsl:variable name="berrybasketswitch"><xsl:value-of select="/page/pageRequest/paramList/param[@name='berrybasket']/@value"/></xsl:variable> 16 <xsl:variable name="bookswitch"><xsl:value-of select="/page/pageRequest/paramList/param[@name='book']/@value"/></xsl:variable> 16 17 17 18 <xsl:template name="pageTitle"> … … 41 42 <xsl:template match="pageResponse"> 42 43 <xsl:variable name="collName"><xsl:value-of select="/page/pageRequest/paramList/param[@name='c']/@value"/></xsl:variable> 43 <xsl:call-template name="standardPageBanner"> 44 <xsl:with-param name="collName" select="$collName"/> 45 </xsl:call-template> 46 <xsl:call-template name="navigationBar"> 47 <xsl:with-param name="collName" select="$collName"/> 48 </xsl:call-template> 49 50 <!--<xsl:if test="$berryBaskets = 'true'">--> 51 <xsl:if test="$berrybasketswitch = 'on'"> 52 <xsl:call-template name="documentBerryBasket"> 53 <xsl:with-param name="collName" select="$collName"/> 54 <xsl:with-param name="selectedNode" select="/page/pageResponse/document/@selectedNode"/> 55 <xsl:with-param name="rootNode" select="/page/pageResponse/document/documentNode[@nodeType='root']/@nodeID"/> 56 <xsl:with-param name="docType" select="/page/pageResponse/document/@docType"/> 57 </xsl:call-template> 58 </xsl:if> 44 <xsl:choose> 45 <xsl:when test="$bookswitch = 'on' or $bookswitch = 'off'"> 46 <xsl:call-template name="standardPageBanner"> 47 <xsl:with-param name="collName" select="$collName"/> 48 </xsl:call-template> 49 <xsl:call-template name="navigationBar"> 50 <xsl:with-param name="collName" select="$collName"/> 51 </xsl:call-template> 52 53 <!--<xsl:if test="$berryBaskets = 'true'">--> 54 <xsl:if test="$berrybasketswitch = 'on'"> 55 <xsl:call-template name="documentBerryBasket"> 56 <xsl:with-param name="collName" select="$collName"/> 57 <xsl:with-param name="selectedNode" select="/page/pageResponse/document/@selectedNode"/> 58 <xsl:with-param name="rootNode" select="/page/pageResponse/document/documentNode[@nodeType='root']/@nodeID"/> 59 <xsl:with-param name="docType" select="/page/pageResponse/document/@docType"/> 60 </xsl:call-template> 61 </xsl:if> 62 </xsl:when> 63 </xsl:choose> 59 64 60 65 <!-- display the document --> 61 <div id="content"> 66 <xsl:if test="$bookswitch != 'flashxml'"> 67 <xsl:text disable-output-escaping="yes"><div id="content"></xsl:text> 68 </xsl:if> 62 69 <xsl:apply-templates select="document"> 63 70 <xsl:with-param name="collName" select="$collName"/> 64 71 </xsl:apply-templates> 65 </div> 72 <xsl:if test="$bookswitch != 'flashxml'"> 73 <xsl:text disable-output-escaping="yes"></div></xsl:text> 74 </xsl:if> 66 75 </xsl:template> 67 76 … … 69 78 <xsl:param name="collName"/> 70 79 80 <xsl:if test="$bookswitch = 'flashxml'"> 81 <xsl:call-template name="xmldocumentContentPeeling"> 82 <xsl:with-param name="collName" select="$collName"/> 83 </xsl:call-template> 84 </xsl:if> 85 86 <xsl:if test="$bookswitch = 'off'"> 71 87 <xsl:call-template name="documentHeading"> 72 88 <xsl:with-param name="collName" select="$collName"/> … … 81 97 <xsl:call-template name="documentArrows"> 82 98 <xsl:with-param name="collName" select="$collName"/> 83 </xsl:call-template> 99 </xsl:call-template> 100 </xsl:if> 101 <xsl:if test="$bookswitch = 'on'"> 102 <xsl:call-template name="documentHeading"> 103 <xsl:with-param name="collName" select="$collName"/> 104 </xsl:call-template> 105 <div id="bookdiv"></div> 106 <script type="text/javascript"> 107 <xsl:text disable-output-escaping="yes"> 108 var doc_url = document.URL; 109 doc_url = doc_url.replace(/(&|\?)book=[a-z]+/gi,''); 110 doc_url += '&book=flashxml'; 111 112 // var src_image = "http://kia.cs.waikato.ac.nz:8080/greenstone3/sites/localsite/collect/gs2mgdemo/index/assoc/HASH49aa.dir/cover.jpg" 113 //var doc_url = "/greenstone3/library?a=d&c=gs2mgdemo&d=HASH49aab56062938fbe2ff7f1&dt=hierarchy&p.a=b&p.s=ClassifierBrowse&ed=1"; 114 115 var flash_plug_html = "" 116 flash_plug_html += '<OBJECT align="middle" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" \n'; 117 flash_plug_html += ' codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" \n'; 118 flash_plug_html += ' height="100%" id="Book" swLiveConnect="true" \n'; 119 flash_plug_html += ' width="100%">\n'; 120 flash_plug_html += ' <PARAM name="allowScriptAccess" value="always" />\n'; 121 flash_plug_html += ' <PARAM name="movie" value="Book.swf'; 122 flash_plug_html += '?src_image=' + escape(img_cover); 123 flash_plug_html += '&doc_url=' + escape(doc_url) 124 flash_plug_html += '" />\n'; 125 flash_plug_html += ' <PARAM name="quality" value="high" />\n'; 126 flash_plug_html += ' <PARAM name="bgcolor" value="#FFFFFF" />\n'; 127 flash_plug_html += ' <EMBED align="middle" \n'; 128 flash_plug_html += ' allowScriptAccess="always" swLiveConnect="true" \n'; 129 flash_plug_html += ' bgcolor="#FFFFFF" height="100%" name="Book" \n'; 130 flash_plug_html += ' pluginspage="http://www.macromedia.com/go/getflashplayer" \n'; 131 flash_plug_html += ' quality="high" \n'; 132 flash_plug_html += ' src="Book.swf'; 133 flash_plug_html += '?src_image=' + escape(img_cover); 134 flash_plug_html += '&doc_url=' + escape(doc_url); 135 flash_plug_html += '"\n'; 136 flash_plug_html += ' type="application/x-shockwave-flash" width="100%" />\n'; 137 flash_plug_html += '</OBJECT>\n'; 138 var flash_div = document.getElementById("bookdiv"); 139 flash_div.innerHTML = flash_plug_html; 140 </xsl:text> 141 </script> 142 </xsl:if> 84 143 </xsl:template> 85 144 … … 100 159 <div id="docheadwrapper"> 101 160 <div id="documentinfo"> 102 <xsl:if test="string($doCoverImage) != 'false' and (@docType='paged' or @docType='hierarchy')"> 103 <div id="headingimage"> 104 <xsl:call-template name="coverImage"/> 105 </div> 106 </xsl:if> 161 162 <xsl:choose> 163 <xsl:when test="$bookswitch = 'on'"> 164 <xsl:if test="string($doCoverImage) != 'false' and (@docType='paged' or @docType='hierarchy')"> 165 <div id="headingimage"> 166 <xsl:call-template name="coverImage"/> 167 </div> 168 </xsl:if> 169 </xsl:when> 170 <xsl:otherwise> 171 <xsl:if test="string($doCoverImage) != 'false' and (@docType='paged' or @docType='hierarchy')"> 172 <div id="headingimage"> 173 <xsl:call-template name="coverImage"/> 174 </div> 175 </xsl:if> 107 176 108 <ul id="docbuttons" > 109 <xsl:call-template name="documentButtons"> 110 <xsl:with-param name="collName" select="$collName"/> 111 </xsl:call-template> 112 </ul> 177 <ul id="docbuttons" > 178 <xsl:call-template name="documentButtons"> 179 <xsl:with-param name="collName" select="$collName"/> 180 </xsl:call-template> 181 </ul> 182 </xsl:otherwise> 183 </xsl:choose> 113 184 </div> 114 185 <!--<div><xsl:call-template name="enrichServices"> 115 186 <xsl:with-param name="collName" select="$collName"/> 116 187 </xsl:call-template></div>--> 117 <xsl:if test="string($doTOC) != 'false'"> 188 <xsl:if test="$bookswitch = 'off'"> 189 <xsl:if test="string($doTOC) != 'false'"> 118 190 <div id="toc"> 119 191 <xsl:call-template name="TOC"> 120 192 <xsl:with-param name="collName" select="$collName"/> 121 193 </xsl:call-template> 122 </div>123 </xsl:if>124 125 194 </div> 126 </xsl:template> 195 </xsl:if> 196 </xsl:if> 197 </div> 198 </xsl:template> 127 199 128 200 <xsl:template name="coverImage"> 129 <img><xsl:attribute name='src'><xsl:value-of select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>/index/assoc/<xsl:value-of select="metadataList/metadata[@name='archivedir']"/>/cover.jpg</xsl:attribute></img> 201 <xsl:choose> 202 <xsl:when test="$bookswitch = 'on'"> 203 <script type="text/javascript"> 204 <xsl:text disable-output-escaping="yes">var img_cover = '</xsl:text><xsl:value-of select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>/index/assoc/<xsl:value-of select="metadataList/metadata[@name='archivedir']"/>/cover.jpg<xsl:text disable-output-escaping="yes">';</xsl:text> 205 </script> 206 </xsl:when> 207 <xsl:otherwise> 208 <img><xsl:attribute name='src'><xsl:value-of select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>/index/assoc/<xsl:value-of select="metadataList/metadata[@name='archivedir']"/>/cover.jpg</xsl:attribute></img> 209 </xsl:otherwise> 210 </xsl:choose> 130 211 </xsl:template> 131 212 … … 266 347 <div class="documenttext"> 267 348 <xsl:choose> 268 <xsl:when test="@docType='simple'"> 269 <xsl:apply-templates select="nodeContent"/> 270 </xsl:when> 349 <xsl:when test="@docType='simple'"><xsl:apply-templates select="nodeContent"/></xsl:when> 271 350 <xsl:otherwise> 272 351 <xsl:apply-templates select="descendant-or-self::node()/documentNode" mode="content"/> … … 290 369 <xsl:for-each select="node()"> 291 370 <xsl:choose> 292 <xsl:when test="not(name())"><xsl:value-of select="." disable-output-escaping="yes"/></xsl:when> 371 <xsl:when test="not(name())"> 372 <xsl:value-of select="." disable-output-escaping="yes"/> 373 </xsl:when> 293 374 <xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise> 294 375 </xsl:choose> 295 376 </xsl:for-each> 296 377 </xsl:template> 378 379 <xsl:template name="xmldocumentContentPeeling"> 380 <xsl:choose> 381 <xsl:when test="@docType='simple'"> 382 <xsl:apply-templates select="nodeContent"/> 383 </xsl:when> 384 <xsl:otherwise> 385 <xsl:call-template name="xmlpeelingContents" /> 386 </xsl:otherwise> 387 </xsl:choose> 388 </xsl:template> 389 390 <xsl:template name="xmlpeelingContents"> 391 <xsl:if test="documentNode"> 392 <xsl:apply-templates select="documentNode" mode="xmlpeeling" /> 393 </xsl:if> 394 </xsl:template> 395 396 <xsl:template match="documentNode" mode="xmlpeeling"> 397 <!-- get title --> 398 <xsl:choose> 399 <xsl:when test="nodeContent"> 400 <xsl:text disable-output-escaping="yes"> 401 <Section> 402 <Description> 403 <Metadata name="Title"> 404 </xsl:text> 405 <xsl:value-of select="normalize-space(metadataList/metadata[@name='Title'])"/> 406 <xsl:text disable-output-escaping="yes"> 407 </Metadata> 408 </Description> 409 </xsl:text> 410 <xsl:value-of select="normalize-space(nodeContent)" disable-output-escaping="yes"/> 411 <xsl:text disable-output-escaping="yes"></Sec></xsl:text> 412 </xsl:when> 413 </xsl:choose> 414 415 <!-- recurse to the children --> 416 <xsl:if test="documentNode"> 417 <xsl:apply-templates select="documentNode" mode="xmlpeeling" /> 418 </xsl:if> 419 420 <!-- end the section --> 421 <xsl:text disable-output-escaping="yes"> 422 </Section> 423 </xsl:text> 424 </xsl:template> 297 425 298 426 <!-- match any file nodes --> -
trunk/gsdl3/web/interfaces/default/transform/pref.xsl
r13505 r13996 22 22 <xsl:template match="pageResponse"> 23 23 <xsl:variable name="collName" select="/page/pageRequest/paramList/param[@name='c']/@value"/> 24 25 <xsl:variable name="tidyoption"><xsl:value-of select="/page/pageResponse/collection/metadataList/metadata[@name='tidyoption']"/></xsl:variable> 26 24 27 <xsl:call-template name="standardPageBanner"> 25 28 <xsl:with-param name="collName" select="$collName"/> … … 38 41 <ul id="presprefs"><xsl:call-template name="pres-prefs"/></ul> 39 42 <ul id="berrybasketprefs" ><xsl:call-template name="berrybasket-prefs"/></ul> 43 44 <xsl:if test="$tidyoption='tidy'"> 45 <ul id="bookprefs"><xsl:call-template name="book-prefs"/></ul> 46 </xsl:if> 47 40 48 <div class="formheading"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.searchpref')"/></div> 41 49 <ul id="searchprefs"><xsl:call-template name="search-prefs"/></ul> … … 81 89 </xsl:template> 82 90 83 91 <xsl:template name="book-prefs"> 92 <xsl:variable name="book"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='book']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='book']/@value"/></xsl:when><xsl:otherwise>off</xsl:otherwise></xsl:choose></xsl:variable> 93 94 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.book')"/> <select name="book"> 95 <option value="on"><xsl:if test="$book='on'"><xsl:attribute name="selected"></xsl:attribute></xsl:if><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.berrybasket.on')"/></option> 96 <option value="off"><xsl:if test="$book='off'"><xsl:attribute name="selected"></xsl:attribute></xsl:if><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.berrybasket.off')"/></option> 97 </select> 98 99 </xsl:template> 84 100 </xsl:stylesheet> -
trunk/gsdl3/web/interfaces/default/transform/style.xsl
r13505 r13996 17 17 <!-- the main page layout template is here --> 18 18 <xsl:template match="page"> 19 <html> 19 <xsl:variable name="bookswitch"><xsl:value-of select="/page/pageRequest/paramList/param[@name='book']/@value"/></xsl:variable> 20 <xsl:variable name="a"><xsl:value-of select="/page/pageRequest/paramList/param[@name='a']/@value"/></xsl:variable> 21 22 <xsl:choose> 23 <xsl:when test="$bookswitch = 'flashxml' and $a = 'd'"> 24 <html> 25 <xsl:call-template name="response" /> 26 </html> 27 </xsl:when> 28 29 <xsl:otherwise> 30 <html> 20 31 <xsl:call-template name="pageHead"/> 21 22 <body> 23 <div id="globalwrapper"> 32 <body> 33 <div id="globalwrapper"> 34 <xsl:call-template name="response" /> 35 <xsl:call-template name="greenstoneFooter"/> 36 </div> 37 </body> 38 </html> 39 </xsl:otherwise> 40 </xsl:choose> 41 </xsl:template> 42 43 <xsl:template name="response"> 24 44 <xsl:apply-templates select="pageResponse"/> 25 45 <xsl:if test="descendant::error"> … … 53 73 </div> 54 74 </xsl:if> 55 <xsl:call-template name="greenstoneFooter"/> 56 </div> 57 </body> 58 </html> 59 </xsl:template> 75 </xsl:template> 60 76 61 77 <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
Note:
See TracChangeset
for help on using the changeset viewer.