1 | <?xml version="1.0" encoding="UTF-8"?>
|
---|
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 | <xsl:template name="favicon">
|
---|
12 | <link rel="shortcut icon" href="interfaces/{$interface_name}/images/favicon.ico"/>
|
---|
13 | </xsl:template>
|
---|
14 |
|
---|
15 | <xsl:template name="additionalHeaderContent-interface">
|
---|
16 | <link rel="stylesheet" href="interfaces/{$interface_name}/style/custom.css" type="text/css"/>
|
---|
17 | </xsl:template>
|
---|
18 |
|
---|
19 |
|
---|
20 | <!-- ***** PAGE TITLE ***** -->
|
---|
21 | <xsl:template name="page-title-area">
|
---|
22 | <xsl:variable name="pageTitleVar"><xsl:call-template name="pageTitle"/></xsl:variable>
|
---|
23 |
|
---|
24 | <div id="titlearea">
|
---|
25 | <h2>
|
---|
26 | <!-- Resize the title based on how long it is (There's probably a better way to do this) -->
|
---|
27 | <xsl:attribute name="style">
|
---|
28 | <xsl:choose>
|
---|
29 | <xsl:when test="string-length($pageTitleVar) < 20">
|
---|
30 | <xsl:text>font-size: 1.5em;</xsl:text>
|
---|
31 | </xsl:when>
|
---|
32 | <xsl:when test="string-length($pageTitleVar) < 30">
|
---|
33 | <xsl:text>font-size: 1.4em;</xsl:text>
|
---|
34 | </xsl:when>
|
---|
35 | <xsl:when test="string-length($pageTitleVar) < 40">
|
---|
36 | <xsl:text>font-size: 1.3em;</xsl:text>
|
---|
37 | </xsl:when>
|
---|
38 | <xsl:when test="string-length($pageTitleVar) < 50">
|
---|
39 | <xsl:text>font-size: 1.2em;</xsl:text>
|
---|
40 | </xsl:when>
|
---|
41 | <xsl:when test="string-length($pageTitleVar) < 60">
|
---|
42 | <xsl:text>font-size: 1.1em;</xsl:text>
|
---|
43 | </xsl:when>
|
---|
44 | <xsl:when test="string-length($pageTitleVar) < 70">
|
---|
45 | <xsl:text>font-size: 1em;</xsl:text>
|
---|
46 | </xsl:when>
|
---|
47 | <xsl:when test="string-length($pageTitleVar) < 80">
|
---|
48 | <xsl:text>font-size: 0.9em;</xsl:text>
|
---|
49 | </xsl:when>
|
---|
50 | <xsl:when test="string-length($pageTitleVar) < 90">
|
---|
51 | <xsl:text>font-size: 0.8em;</xsl:text>
|
---|
52 | </xsl:when>
|
---|
53 | <xsl:otherwise>
|
---|
54 | <xsl:text>font-size: 0.7em;</xsl:text>
|
---|
55 | </xsl:otherwise>
|
---|
56 | </xsl:choose>
|
---|
57 | </xsl:attribute>
|
---|
58 | <!--<xsl:value-of select="string-length($pageTitleVar)" />-->
|
---|
59 | <xsl:call-template name="pageTitle"/>
|
---|
60 | <!--<xsl:value-of select="$pageTitleVar" /> -->
|
---|
61 | </h2><xsl:text> </xsl:text>
|
---|
62 | </div>
|
---|
63 | </xsl:template>
|
---|
64 |
|
---|
65 |
|
---|
66 | <!-- ***** QUICK SEARCH AREA ***** -->
|
---|
67 | <!-- Search form should only appear if there's a search (query) service AND it has an index.
|
---|
68 | By default, all collections end up with some query service (default is MGPP) even when they have
|
---|
69 | no search indexes, which is why the extra test for the presence of an index/fq-something is necessary. -->
|
---|
70 | <xsl:template name="quick-search-area">
|
---|
71 | <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@type='query']">
|
---|
72 | <xsl:variable name="subaction" select="/page/pageRequest/@subaction"/>
|
---|
73 | <div id="quicksearcharea">
|
---|
74 | <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']">
|
---|
75 | <xsl:choose>
|
---|
76 | <xsl:when test="not(page/pageRequest[@action='q']) or /page/pageRequest/paramList/param[@name='qs']/@value = '1'">
|
---|
77 | <form action="{$library_name}/collection/{$collNameChecked}/search/TextQuery">
|
---|
78 | <!-- This parameter says that we have come from the quick search area -->
|
---|
79 | <input type="hidden" name="qs" value="1"/>
|
---|
80 | <input type="hidden" name="rt" value="rd"/>
|
---|
81 | <input type="hidden" name="s1.level">
|
---|
82 | <xsl:attribute name="value">
|
---|
83 | <xsl:value-of select="/page/pageResponse/collection/serviceList/service[@name='TextQuery']/paramList/param[@name = 'level']/@default"/>
|
---|
84 | </xsl:attribute>
|
---|
85 | </input>
|
---|
86 | <xsl:choose>
|
---|
87 | <xsl:when test="/page/pageResponse/service[@name = 'TextQuery']/paramList/param[@name = 'startPage']">
|
---|
88 | <input type="hidden" name="s1.startPage" value="1"/>
|
---|
89 | </xsl:when>
|
---|
90 | <xsl:otherwise>
|
---|
91 | <input type="hidden" name="startPage" value="1"/>
|
---|
92 | </xsl:otherwise>
|
---|
93 | </xsl:choose>
|
---|
94 |
|
---|
95 | <!-- The query text box -->
|
---|
96 | <span class="querybox">
|
---|
97 | <xsl:variable name="qs">
|
---|
98 | <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='query']" mode="calculate-default"/>
|
---|
99 | </xsl:variable>
|
---|
100 | <nobr>
|
---|
101 | <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='query']">
|
---|
102 | <!--
|
---|
103 | <xsl:with-param name="default" select="java:org.greenstone.gsdl3.util.XSLTUtil.tidyWhitespace($qs, /page/@lang)"/>
|
---|
104 | -->
|
---|
105 | <xsl:with-param name="default" select="normalize-space($qs)"/>
|
---|
106 |
|
---|
107 | </xsl:apply-templates>
|
---|
108 | </nobr>
|
---|
109 | </span>
|
---|
110 | <!-- The index selection list -->
|
---|
111 | <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='index']/@type = 'enum_single'">
|
---|
112 | <span class="textselect">
|
---|
113 | <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='index']">
|
---|
114 | <xsl:with-param name="default">
|
---|
115 | <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='index']" mode="calculate-default"/>
|
---|
116 | </xsl:with-param>
|
---|
117 | <xsl:with-param name="hideSingle">false</xsl:with-param>
|
---|
118 | <xsl:with-param name="quickSearch">true</xsl:with-param>
|
---|
119 | </xsl:apply-templates>
|
---|
120 | </span>
|
---|
121 | </xsl:if>
|
---|
122 | <!-- The partition selection list -->
|
---|
123 | <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='indexSubcollection']/@type = 'enum_single'">
|
---|
124 | <span class="textselect">
|
---|
125 | <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='indexSubcollection']">
|
---|
126 | <xsl:with-param name="default">
|
---|
127 | <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='indexSubcollection']" mode="calculate-default"/>
|
---|
128 | </xsl:with-param>
|
---|
129 | <xsl:with-param name="hideSingle">true</xsl:with-param>
|
---|
130 | <xsl:with-param name="quickSearch">true</xsl:with-param>
|
---|
131 | </xsl:apply-templates>
|
---|
132 | </span>
|
---|
133 | </xsl:if>
|
---|
134 | <!-- The language selection list -->
|
---|
135 | <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='indexLanguage']/@type = 'enum_single'">
|
---|
136 | <span class="textselect">
|
---|
137 | <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='indexLanguage']">
|
---|
138 | <xsl:with-param name="default">
|
---|
139 | <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='indexLanguage']" mode="calculate-default"/>
|
---|
140 | </xsl:with-param>
|
---|
141 | <xsl:with-param name="hideSingle">true</xsl:with-param>
|
---|
142 | <xsl:with-param name="quickSearch">true</xsl:with-param>
|
---|
143 | </xsl:apply-templates>
|
---|
144 | </span>
|
---|
145 | </xsl:if>
|
---|
146 | <!-- The submit button (for TextQuery) -->
|
---|
147 | <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']">
|
---|
148 | <input type="submit" id="quickSearchSubmitButton">
|
---|
149 | <xsl:attribute name="value">
|
---|
150 | <xsl:value-of select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/displayItem[@name='submit']"/>
|
---|
151 | </xsl:attribute>
|
---|
152 | </input>
|
---|
153 | <br/>
|
---|
154 | </xsl:if>
|
---|
155 | </form>
|
---|
156 | </xsl:when>
|
---|
157 | <xsl:otherwise><br/></xsl:otherwise>
|
---|
158 | </xsl:choose>
|
---|
159 | </xsl:if>
|
---|
160 | <!-- The list of other search types -->
|
---|
161 | <ul>
|
---|
162 | <xsl:for-each select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@type='query']">
|
---|
163 | <xsl:if test="/page/pageRequest/paramList/param[@name='qs']/@value = 1 or not(@name = /page/pageRequest/paramList/param[@name='s']/@value)">
|
---|
164 | <!-- **** Customized -->
|
---|
165 | <xsl:if test="@name != 'TextQuery'">
|
---|
166 |
|
---|
167 | <li class="ui-state-default ui-corner-all">
|
---|
168 | <a>
|
---|
169 | <xsl:attribute name="href">
|
---|
170 | <xsl:value-of select="$library_name"/>/collection/<xsl:value-of select="$collNameChecked"/>/search/<xsl:value-of select="@name"/>
|
---|
171 | </xsl:attribute>
|
---|
172 | <xsl:value-of select="displayItem[@name='name']"/>
|
---|
173 | </a>
|
---|
174 | </li>
|
---|
175 | </xsl:if>
|
---|
176 | </xsl:if>
|
---|
177 | </xsl:for-each>
|
---|
178 | </ul>
|
---|
179 | </div>
|
---|
180 | </xsl:if>
|
---|
181 | </xsl:template>
|
---|
182 |
|
---|
183 | </xsl:stylesheet>
|
---|