source: main/branches/64_bit_Greenstone/greenstone3/web/interfaces/oran/transform/layouts/header.xsl@ 24007

Last change on this file since 24007 was 24007, checked in by sjm84, 13 years ago

Updating this branch to match the latest Greenstone3 changes

  • Property svn:executable set to *
File size: 10.2 KB
Line 
1<xsl:stylesheet version="1.0"
2 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3 xmlns:java="http://xml.apache.org/xslt/java"
4 xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
5 xmlns:gslib="http://www.greenstone.org/skinning"
6 extension-element-prefixes="java util"
7 exclude-result-prefixes="java util">
8
9 <xsl:include href="../query-common.xsl"/>
10
11 <!-- If the c parameter is empty then use the p.c parameter for the collection name-->
12 <xsl:variable name="collNameChecked">
13 <xsl:choose>
14 <xsl:when test="$collName = '' and /page/pageRequest/paramList/param[@name='p.c']/@value">
15 <xsl:value-of select="/page/pageRequest/paramList/param[@name='p.c']/@value"/>
16 </xsl:when>
17 <xsl:otherwise>
18 <xsl:value-of select="$collName"/>
19 </xsl:otherwise>
20 </xsl:choose>
21 </xsl:variable>
22
23 <!-- Creates a header for -->
24 <xsl:template name="create-html-header">
25 <title><xsl:call-template name="pageTitle"/> :: <xsl:call-template name="siteName"/></title>
26 <link rel="stylesheet" href="interfaces/{$interface_name}/style/core.css" type="text/css"/>
27 <link rel="shortcut icon" href="favicon.ico"/>
28 </xsl:template>
29
30 <!-- ***** HEADER LAYOUT TEMPLATE ***** -->
31 <xsl:template name="create-banner">
32 <div id="breadcrumbs"><xsl:call-template name="breadcrumbs"/><xsl:text> </xsl:text></div>
33 <table id="titlesearchcontainer">
34 <tr>
35 <xsl:call-template name="page-title-area"/>
36 <xsl:call-template name="quick-search-area"/>
37 </tr>
38 </table>
39 <xsl:call-template name="home-help-preferences"/>
40 <xsl:call-template name="browsing-tabs"/>
41 </xsl:template>
42
43 <!-- ***** BROWSING TABS ***** -->
44 <xsl:template name="browsing-tabs">
45 <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service">
46 <ul id="nav">
47 <!-- If this collection has a ClassifierBrowse service then add a tab for each classifier-->
48 <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@type='browse' and @name='ClassifierBrowse']">
49 <!-- Loop through each classifier -->
50 <xsl:for-each select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='ClassifierBrowse']/classifierList/classifier">
51 <xsl:element name="li">
52 <!-- If this tab is selected then colour it differently (right part) -->
53 <xsl:if test="@name = /page/pageRequest/paramList/param[@name = 'cl' and /page/pageRequest/@action = 'b']/@value">
54 <xsl:attribute name='style'>background: transparent url('interfaces/oran/images/tab-right-selected.png') scroll no-repeat 100% -100px;</xsl:attribute>
55 </xsl:if>
56
57 <xsl:element name="a">
58 <!-- If this tab is selected then colour it differently (left part) -->
59 <xsl:if test="@name = /page/pageRequest/paramList/param[@name = 'cl' and /page/pageRequest/@action = 'b']/@value">
60 <xsl:attribute name='style'>background: transparent url('interfaces/oran/images/tab-left-selected.png') no-repeat scroll 0 -100px;</xsl:attribute>
61 </xsl:if>
62
63 <!-- Add a title element to the <a> tag if a description exists for this classifier -->
64 <xsl:if test="displayItem[@name='description']">
65 <xsl:attribute name='title'><xsl:value-of select="displayItem[@name='description']"/></xsl:attribute>
66 </xsl:if>
67
68 <!-- Add the href element to the <a> tag -->
69 <xsl:choose>
70 <xsl:when test="@name">
71 <xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=b&amp;rt=s&amp;s=ClassifierBrowse&amp;c=<xsl:value-of select="/page/pageResponse/collection[@name=$collNameChecked]/@name"/>&amp;cl=<xsl:value-of select="@name"/></xsl:attribute>
72 </xsl:when>
73 <xsl:otherwise>
74 <xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=b&amp;rt=d&amp;s=ClassifierBrowse&amp;c=<xsl:value-of select="/page/pageResponse/collection[@name=$collNameChecked]/@name"/></xsl:attribute>
75 </xsl:otherwise>
76 </xsl:choose>
77
78 <!-- Add the actual text of the <a> tag -->
79 <xsl:value-of select="displayItem[@name='name']"/>
80 </xsl:element>
81 </xsl:element>
82 </xsl:for-each>
83 </xsl:if>
84
85 <!-- all other services -->
86 <xsl:for-each select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[not(@type='query') and not(@type='browse')]">
87 <xsl:call-template name="navigationTab"/>
88 </xsl:for-each>
89 </ul>
90 </xsl:if>
91 </xsl:template>
92
93 <!-- ***** HOME HELP PREFERENCES ***** -->
94 <xsl:template name="home-help-preferences">
95 <xsl:if test="/page/pageResponse/collection">
96 <ul id="bannerLinks">
97
98 <!-- preferences -->
99 <li>
100 <a href="{$library_name}?a=p&amp;amp;sa=pref&amp;amp;c={$collNameChecked}">
101 <xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_tip')"/></xsl:attribute>
102 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/>
103 </a>
104 </li>
105
106 <!-- help -->
107 <li>
108 <a href="{$library_name}?a=p&amp;amp;sa=help&amp;amp;c={$collNameChecked}">
109 <xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_tip')"/></xsl:attribute>
110 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/>
111 </a>
112 </li>
113
114 <!-- home -->
115 <li>
116 <a href="{$library_name}?a=p&amp;amp;sa=home">
117 <xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_tip')"/></xsl:attribute>
118 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_b')"/>
119 </a>
120 </li>
121 </ul>
122 </xsl:if>
123 </xsl:template>
124
125 <!-- ***** PAGE TITLE ***** -->
126 <xsl:template name="page-title-area">
127 <xsl:variable name="pageTitleVar"><xsl:call-template name="pageTitle"/></xsl:variable>
128 <td id="titlearea">
129 <h2>
130 <!-- Resize the title based on how long it is -->
131 <xsl:attribute name="style">
132 <xsl:choose>
133 <xsl:when test="string-length($pageTitleVar) &lt; 20">
134 font-size: 24px; line-height: 26px;
135 </xsl:when>
136 <xsl:when test="string-length($pageTitleVar) &lt; 30">
137 font-size: 22px; line-height: 24px;
138 </xsl:when>
139 <xsl:when test="string-length($pageTitleVar) &lt; 40">
140 font-size: 20px; line-height: 22px;
141 </xsl:when>
142 <xsl:when test="string-length($pageTitleVar) &lt; 50">
143 font-size: 18px; line-height: 20px;
144 </xsl:when>
145 <xsl:when test="string-length($pageTitleVar) &lt; 60">
146 font-size: 16px; line-height: 18px;
147 </xsl:when>
148 <xsl:when test="string-length($pageTitleVar) &lt; 70">
149 font-size: 15px; line-height: 17px;
150 </xsl:when>
151 <xsl:when test="string-length($pageTitleVar) &lt; 80">
152 font-size: 14px; line-height: 16px;
153 </xsl:when>
154 <xsl:when test="string-length($pageTitleVar) &lt; 90">
155 font-size: 13px; line-height: 15px;
156 </xsl:when>
157 <xsl:otherwise>
158 font-size: 12px; line-height: 14px;
159 </xsl:otherwise>
160 </xsl:choose>
161 </xsl:attribute>
162 <!--<xsl:value-of select="string-length($pageTitleVar)" />-->
163 <xsl:value-of select="$pageTitleVar" />
164 </h2>
165 </td>
166 </xsl:template>
167
168
169 <!-- ***** QUICK SEARCH AREA ***** -->
170 <xsl:template name="quick-search-area">
171 <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']">
172 <xsl:variable name="subaction" select="/page/pageRequest/@subaction"/>
173 <td id="quicksearcharea">
174 <form>
175 <input type="hidden" name="a" value="q"/>
176 <input type="hidden" name="sa" value="{$subaction}"/>
177 <input type="hidden" name="rt" value="rd"/>
178 <input type="hidden" name="s" value="TextQuery"/>
179 <input type="hidden" name="c" value="{$collNameChecked}"/>
180 <input type="hidden" name="startPage" value="1"/>
181 <!-- The query text box -->
182 <span class="querybox">
183 <xsl:variable name="qs">
184 <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='query']" mode="calculate-default"/>
185 </xsl:variable>
186 <nobr>
187 <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='query']">
188 <xsl:with-param name="default" select="java:org.greenstone.gsdl3.util.XSLTUtil.tidyWhitespace($qs)"/>
189 </xsl:apply-templates>
190 </nobr>
191 </span>
192 <!-- The index selection list -->
193 <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='index']/@type = 'enum_single'">
194 <span class="textselect">
195 <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='index']">
196 <xsl:with-param name="default">
197 <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='index']" mode="calculate-default"/>
198 </xsl:with-param>
199 </xsl:apply-templates>
200 </span>
201 </xsl:if>
202 <!-- The submit button -->
203 <input type="submit">
204 <xsl:attribute name="value">
205 <xsl:value-of select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/displayItem[@name='submit']"/>
206 </xsl:attribute>
207 </input>
208 <br/>
209 <!-- The list of other search types -->
210 <table>
211 <tr>
212 <xsl:for-each select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@type='query']">
213 <td>
214 <a>
215 <xsl:attribute name="href">
216 ?a=q&amp;rt=d&amp;c=<xsl:value-of select="$collNameChecked"/>&amp;s=<xsl:value-of select="@name"/>
217 </xsl:attribute>
218 <xsl:value-of select="displayItem[@name='name']"/>
219 </a>
220 </td>
221 </xsl:for-each>
222 </tr>
223 </table>
224 </form>
225 </td>
226 </xsl:if>
227 </xsl:template>
228</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.