source: main/trunk/model-interfaces-dev/heritage-nz/transform/layouts/header.xsl@ 33074

Last change on this file since 33074 was 33074, checked in by davidb, 5 years ago

Changes to provided customized layout requested by Heritage NZ, including searching and browsing on About page in text, and berry baskets

  • Property svn:mime-type set to application/xml
File size: 7.0 KB
Line 
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
21
22 <!-- ***** QUICK SEARCH AREA ***** -->
23 <!-- Search form should only appear if there's a search (query) service AND it has an index.
24 By default, all collections end up with some query service (default is MGPP) even when they have
25 no search indexes, which is why the extra test for the presence of an index/fq-something is necessary. -->
26 <xsl:template name="quick-search-area">
27 <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@type='query']">
28 <xsl:variable name="subaction" select="/page/pageRequest/@subaction"/>
29 <div id="quicksearcharea">
30 <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']">
31 <xsl:choose>
32 <xsl:when test="not(page/pageRequest[@action='q']) or /page/pageRequest/paramList/param[@name='qs']/@value = '1'">
33 <form action="{$library_name}/collection/{$collNameChecked}/search/TextQuery">
34 <!-- This parameter says that we have come from the quick search area -->
35 <input type="hidden" name="qs" value="1"/>
36 <input type="hidden" name="rt" value="rd"/>
37 <input type="hidden" name="s1.level">
38 <xsl:attribute name="value">
39 <xsl:value-of select="/page/pageResponse/collection/serviceList/service[@name='TextQuery']/paramList/param[@name = 'level']/@default"/>
40 </xsl:attribute>
41 </input>
42 <xsl:choose>
43 <xsl:when test="/page/pageResponse/service[@name = 'TextQuery']/paramList/param[@name = 'startPage']">
44 <input type="hidden" name="s1.startPage" value="1"/>
45 </xsl:when>
46 <xsl:otherwise>
47 <input type="hidden" name="startPage" value="1"/>
48 </xsl:otherwise>
49 </xsl:choose>
50
51 <!-- The query text box -->
52 <span class="querybox">
53 <xsl:variable name="qs">
54 <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='query']" mode="calculate-default"/>
55 </xsl:variable>
56 <nobr>
57 <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='query']">
58 <!--
59 <xsl:with-param name="default" select="java:org.greenstone.gsdl3.util.XSLTUtil.tidyWhitespace($qs, /page/@lang)"/>
60 -->
61 <xsl:with-param name="default" select="normalize-space($qs)"/>
62
63 </xsl:apply-templates>
64 </nobr>
65 </span>
66 <!-- The index selection list -->
67 <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='index']/@type = 'enum_single'">
68 <span class="textselect">
69 <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='index']">
70 <xsl:with-param name="default">
71 <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='index']" mode="calculate-default"/>
72 </xsl:with-param>
73 <xsl:with-param name="hideSingle">false</xsl:with-param>
74 <xsl:with-param name="quickSearch">true</xsl:with-param>
75 </xsl:apply-templates>
76 </span>
77 </xsl:if>
78 <!-- The partition selection list -->
79 <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='indexSubcollection']/@type = 'enum_single'">
80 <span class="textselect">
81 <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='indexSubcollection']">
82 <xsl:with-param name="default">
83 <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='indexSubcollection']" mode="calculate-default"/>
84 </xsl:with-param>
85 <xsl:with-param name="hideSingle">true</xsl:with-param>
86 <xsl:with-param name="quickSearch">true</xsl:with-param>
87 </xsl:apply-templates>
88 </span>
89 </xsl:if>
90 <!-- The language selection list -->
91 <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='indexLanguage']/@type = 'enum_single'">
92 <span class="textselect">
93 <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='indexLanguage']">
94 <xsl:with-param name="default">
95 <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='indexLanguage']" mode="calculate-default"/>
96 </xsl:with-param>
97 <xsl:with-param name="hideSingle">true</xsl:with-param>
98 <xsl:with-param name="quickSearch">true</xsl:with-param>
99 </xsl:apply-templates>
100 </span>
101 </xsl:if>
102 <!-- The submit button (for TextQuery) -->
103 <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']">
104 <input type="submit" id="quickSearchSubmitButton">
105 <xsl:attribute name="value">
106 <xsl:value-of select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/displayItem[@name='submit']"/>
107 </xsl:attribute>
108 </input>
109 <br/>
110 </xsl:if>
111 </form>
112 </xsl:when>
113 <xsl:otherwise><br/></xsl:otherwise>
114 </xsl:choose>
115 </xsl:if>
116 <!-- The list of other search types -->
117 <ul>
118 <xsl:for-each select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@type='query']">
119 <xsl:if test="/page/pageRequest/paramList/param[@name='qs']/@value = 1 or not(@name = /page/pageRequest/paramList/param[@name='s']/@value)">
120 <!-- **** Customized -->
121 <xsl:if test="@name != 'TextQuery'">
122
123 <li class="ui-state-default ui-corner-all">
124 <a>
125 <xsl:attribute name="href">
126 <xsl:value-of select="$library_name"/>/collection/<xsl:value-of select="$collNameChecked"/>/search/<xsl:value-of select="@name"/>
127 </xsl:attribute>
128 <xsl:value-of select="displayItem[@name='name']"/>
129 </a>
130 </li>
131 </xsl:if>
132 </xsl:if>
133 </xsl:for-each>
134 </ul>
135 </div>
136 </xsl:if>
137 </xsl:template>
138
139</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.