source: main/trunk/greenstone3/web/interfaces/oran/transform/pages/document.xsl@ 22785

Last change on this file since 22785 was 22785, checked in by sjm84, 10 years ago

The documenttext div now has the id "gs-document-text"

File size: 5.7 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<xsl:stylesheet version="1.0"
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns:java="http://xml.apache.org/xslt/java"
5 xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
6 xmlns:gslib="http://www.greenstone.org/skinning"
7 xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat"
8 extension-element-prefixes="java util"
9 exclude-result-prefixes="java util gsf">
10
11 <!-- style includes global params interface_name, library_name -->
12 <xsl:include href=".old/berrytools.xsl"/>
13
14 <!-- use the 'main' layout -->
15 <xsl:include href="layouts/main.xsl"/>
16
17 <!-- set page title -->
18 <xsl:template name="pageTitle"><gslib:documentTitle/></xsl:template>
19
20 <!-- set page breadcrumbs -->
21 <xsl:template name="breadcrumbs"><gslib:siteLink/><gslib:rightArrow/></xsl:template>
22
23 <!-- the page content -->
24 <xsl:template match="/page/pageResponse/document">
25
26 <!-- show the little berries for this document -->
27 <xsl:call-template name="documentBerryForDocumentPage"/>
28
29 <!-- the sidebar -->
30 <div id="rightSidebar">
31
32 <!-- show the berry basket if it's turned on -->
33 <gslib:berryBasket/>
34
35 <!-- the book's cover image -->
36 <div id="coverImage"><gslib:coverImage/></div>
37 <br/>
38
39 <!-- the contents -->
40 <ul id="tableOfContents">
41 <xsl:apply-templates select="documentNode/documentNode"/>
42 </ul>
43
44 </div>
45
46 <!-- display the document -->
47 <xsl:choose>
48
49 <xsl:when test="@external != ''">
50 <xsl:call-template name="externalPage">
51 <xsl:with-param name="external" select="@external"/>
52 </xsl:call-template>
53 </xsl:when>
54
55 <xsl:otherwise>
56 <!-- document heading -->
57 <xsl:variable name="doCoverImage" select="/page/pageResponse/format/gsf:option[@name='coverImages']/@value"/>
58 <xsl:variable name="doTOC" select="/page/pageResponse/format/gsf:option[@name='documentTOC']/@value"/>
59 <xsl:variable name="p.a" select="/page/pageRequest/paramList/param[@name='p.a']/@value"/>
60 <xsl:variable name="p.sa" select="/page/pageRequest/paramList/param[@name='p.sa']/@value"/>
61 <xsl:variable name="p.s" select="/page/pageRequest/paramList/param[@name='p.s']/@value"/>
62 <xsl:variable name="p.c"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='p.c']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='p.c']/@value"/></xsl:when><xsl:otherwise><xsl:value-of select="$collName"/></xsl:otherwise></xsl:choose></xsl:variable>
63
64 <!--
65 <div id="documentheading">
66
67 <!- -<a href="{$library_name}?a={$p.a}&amp;sa={$p.sa}&amp;s={$p.s}&amp;c={$p.c}&amp;rt=rd"><xsl:call-template name="openbookimg"><xsl:with-param name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'close_book')"/></xsl:with-param></xsl:call-template></a>- ->
68
69 <xsl:choose>
70 <xsl:when test="@docType='simple'"><xsl:value-of select="metadataList/metadata[@name='Title']" disable-output-escaping="yes"/></xsl:when>
71 <xsl:otherwise><xsl:value-of select="documentNode/metadataList/metadata[@name='Title']" disable-output-escaping="yes"/></xsl:otherwise>
72 </xsl:choose>
73
74 </div>
75 -->
76
77 <div id="gs-document-text" class="documenttext">
78 <xsl:for-each select="descendant-or-self::node()/nodeContent">
79 <h3><xsl:value-of disable-output-escaping="yes" select="../metadataList/metadata[@name='Title']"/></h3>
80 <xsl:for-each select="node()">
81 <xsl:choose>
82 <xsl:when test="not(name())">
83 <xsl:value-of select="." disable-output-escaping="yes"/>
84 </xsl:when>
85 <xsl:otherwise>
86 <xsl:apply-templates select="."/>
87 </xsl:otherwise>
88 </xsl:choose>
89 </xsl:for-each>
90 </xsl:for-each>
91 </div>
92
93 <gslib:previousNextButtons/>
94
95 </xsl:otherwise>
96 </xsl:choose>
97
98 <div class="clear"><xsl:text> </xsl:text></div>
99
100 </xsl:template>
101
102 <xsl:template match="documentNode">
103
104 <!-- check if this is the currently selected table of contents item -->
105 <xsl:variable name="isCurrent" select="nodeContent"/>
106
107 <!-- formulate the link -->
108 <xsl:variable name="contentsLink">
109 <xsl:value-of select='$library_name'/>?a=d&amp;c=<gslib:collectionNameShort/>&amp;d=<xsl:value-of select='@nodeID'/><xsl:if test="documentNode">.pr</xsl:if>&amp;sib=1<!--&amp;<xsl:if test="string($ec) = '1'">ec=1&amp;</xsl:if>
110 p.a=<xsl:value-of select="$p.a"/>&amp;
111 p.sa=<xsl:value-of select="$p.sa"/>&amp;
112 p.s=<xsl:value-of select="$p.s"/>&amp;
113 p.c=<xsl:value-of select="$p.c"/>-->
114 </xsl:variable>
115
116 <li>
117 <!-- display this item from the table of contents -->
118 <xsl:if test="$isCurrent"><xsl:attribute name="class">current</xsl:attribute></xsl:if>
119 <a>
120 <xsl:attribute name="href"><xsl:value-of select="translate( $contentsLink , ' ', '' )"/></xsl:attribute>
121 <xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='Title']"/>
122 </a>
123
124 <!-- display any child items -->
125 <xsl:if test="documentNode">
126 <ul>
127 <xsl:apply-templates select="documentNode"/>
128 </ul>
129 </xsl:if>
130
131 </li>
132
133 </xsl:template>
134 <xsl:template name="externalPage">
135 <xsl:param name="external"/>
136 <xsl:variable name="go_forward_link"><a><xsl:attribute name="href"><xsl:value-of select="$external"/></xsl:attribute><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'external.go_forward')"/></a></xsl:variable>
137 <h2><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'external.title')"/></h2>
138 <p><xsl:value-of select="util:getInterfaceTextWithDOM($interface_name, /page/@lang, 'external.text', $go_forward_link)" disable-output-escaping="yes"/>
139 </p>
140 </xsl:template>
141
142
143 <xsl:template match="/page"><xsl:apply-templates select="/page/pageResponse/document"/></xsl:template> <!-- this to be deleted eventually -->
144
145</xsl:stylesheet>
146
Note: See TracBrowser for help on using the repository browser.