source: greenstone3/trunk/web/interfaces/classic/transform/pref.xsl@ 14382

Last change on this file since 14382 was 14382, checked in by anna, 15 years ago

Added hidden param c in preference form.

  • Property svn:keywords set to Author Date Id Revision
File size: 10.0 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 extension-element-prefixes="java util"
7 exclude-result-prefixes="java util">
8
9 <xsl:include href="style.xsl"/>
10 <!--<xsl:include href="pref-text.xsl"/>-->
11
12 <xsl:output method="html"/>
13
14 <xsl:template name="pageTitle">
15 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_tip')"/>
16 </xsl:template>
17
18 <!-- page specific style goes here -->
19 <xsl:template name="pageStyle"/>
20
21
22 <xsl:template match="pageResponse">
23 <xsl:variable name="collName" select="/page/pageRequest/paramList/param[@name='c']/@value"/>
24 <center>
25 <xsl:call-template name="standardPageBanner">
26 <xsl:with-param name="collName" select="$collName"/>
27 <xsl:with-param name="pageType">pref</xsl:with-param>
28 </xsl:call-template>
29 <xsl:call-template name="navigationBar">
30 <xsl:with-param name="collName" select="$collName"/>
31 </xsl:call-template>
32 <form name="PrefForm" method="get" action="{$library_name}">
33 <input type='hidden' name='a' value='p'/>
34 <input type='hidden' name='sa' value='pref'/>
35 <!-- added parameter -->
36 <input type='hidden' name='c' value="{$collName}"/>
37 <table>
38 <tr><td><h3><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.prespref')"/></h3></td></tr>
39 <tr><td><xsl:call-template name="pres-prefs"/></td></tr>
40 <tr><td><xsl:call-template name="dividerBar"/></td></tr>
41 <tr><td><h3><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.searchpref')"/></h3></td></tr>
42 <tr><td><xsl:call-template name="search-prefs"/></td></tr>
43 <tr><td><xsl:call-template name="dividerBar"/></td></tr>
44 </table>
45 </form>
46 </center>
47 </xsl:template>
48
49
50 <xsl:template name="pres-prefs">
51 <table>
52 <tr><td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.interfacelang')"/></td><td align='left'>English</td></tr>
53 <tr><td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.encoding')"/></td><td align='left'>UTF-8</td></tr>
54 </table>
55 </xsl:template>
56
57 <xsl:template name="search-prefs">
58 <xsl:param name="ns">s1.</xsl:param>
59 <xsl:variable name="ct"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='ct']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='ct']/@value"/></xsl:when><xsl:otherwise>0</xsl:otherwise></xsl:choose></xsl:variable>
60 <table>
61 <tr><td> </td><td> </td><td align='right'><input type='submit' value='set prefs'/></td></tr>
62 <xsl:choose>
63 <xsl:when test="$ct=0">
64 <xsl:call-template name='text-search-prefs'/>
65 </xsl:when>
66 <xsl:otherwise>
67 <!-- search type -->
68 <xsl:variable name='querytype'><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='qt']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='qt']/@value"/></xsl:when><xsl:otherwise>0</xsl:otherwise></xsl:choose></xsl:variable>
69 <tr><td rowspan='2' valign='baseline'>Type of search:</td><td><input type='radio' name='qt' value='0'><xsl:if test="$querytype=0"><xsl:attribute name="checked"></xsl:attribute></xsl:if></input></td><td align='left'> text search</td></tr>
70 <tr><td></td><td>
71 <table>
72 <xsl:call-template name='text-search-prefs'/>
73 </table></td></tr>
74
75 <tr><td> </td><td><input type='radio' name='qt' value='1'><xsl:if test="$querytype=1"><xsl:attribute name="checked"></xsl:attribute></xsl:if></input></td><td> form search<br /></td></tr>
76 <tr><td></td><td></td><td>
77 <table>
78 <!-- query form mode -->
79 <xsl:variable name="queryfmode"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='qfm']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='qfm']/@value"/></xsl:when><xsl:otherwise>0</xsl:otherwise></xsl:choose></xsl:variable>
80 <tr><td valign='baseline'>Form type:</td><td><input type='radio' name='qfm' value='0'><xsl:if test="$queryfmode=0"><xsl:attribute name="checked"></xsl:attribute></xsl:if></input> simple <br />
81 <input type='radio' name='qfm' value='1'><xsl:if test="$queryfmode=1"><xsl:attribute name="checked"></xsl:attribute></xsl:if></input> advanced</td></tr>
82 <!-- query form num boxes -->
83 <xsl:variable name="numbox"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='qfn']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='qfn']/@value"/></xsl:when><xsl:otherwise>4</xsl:otherwise></xsl:choose></xsl:variable>
84 <tr><td colspan='2'>with <select name="qfn">
85 <option value="2"><xsl:if test="$numbox=2"><xsl:attribute name="selected"></xsl:attribute></xsl:if>2</option>
86 <option value="4"><xsl:if test="$numbox=4"><xsl:attribute name="selected"></xsl:attribute></xsl:if>4</option>
87 <option value="6"><xsl:if test="$numbox=6"><xsl:attribute name="selected"></xsl:attribute></xsl:if>6</option>
88 <option value="8"><xsl:if test="$numbox=8"><xsl:attribute name="selected"></xsl:attribute></xsl:if>8</option>
89 </select> fields</td></tr>
90 </table></td></tr>
91 </xsl:otherwise>
92 </xsl:choose>
93 <!-- case folding -->
94 <xsl:variable name="casevar" select="concat($ns,'case')"/>
95 <xsl:variable name="case"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name=$casevar]"><xsl:value-of select="/page/pageRequest/paramList/param[@name=$casevar]/@value"/></xsl:when><xsl:otherwise>1</xsl:otherwise></xsl:choose></xsl:variable>
96 <tr><td rowspan='2' valign='baseline'>Case differences:</td><td><input type='radio' name='{$ns}case' value='1'><xsl:if test="$case=1"><xsl:attribute name="checked"></xsl:attribute></xsl:if></input></td><td> ignore case differences</td></tr>
97 <tr><td><input type='radio' name='{$ns}case' value='0'><xsl:if test="$case=0"><xsl:attribute name="checked"></xsl:attribute></xsl:if></input></td><td> upper/lower case must match</td></tr>
98 <!-- stemming -->
99 <xsl:variable name="stemvar" select="concat($ns,'stem')"/>
100 <xsl:variable name="stem"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name=$stemvar]"><xsl:value-of select="/page/pageRequest/paramList/param[@name=$stemvar]/@value"/></xsl:when><xsl:otherwise>0</xsl:otherwise></xsl:choose></xsl:variable>
101 <tr><td rowspan='2' valign='baseline'>Word endings:</td><td><input type='radio' name='{$ns}stem' value='1'><xsl:if test="$stem=1"><xsl:attribute name="checked"></xsl:attribute></xsl:if></input></td><td> ignore word endings</td></tr>
102 <tr><td><input type='radio' name='{$ns}stem' value='0'><xsl:if test="$stem=0"><xsl:attribute name="checked"></xsl:attribute></xsl:if></input></td><td> whole word must match</td></tr>
103 <!-- hit display -->
104 <xsl:variable name="maxvar" select="concat($ns,'maxDocs')"/>
105 <xsl:variable name="maxdocs"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name=$maxvar]"><xsl:value-of select="/page/pageRequest/paramList/param[@name=$maxvar]/@value"/></xsl:when><xsl:otherwise>50</xsl:otherwise></xsl:choose></xsl:variable>
106 <xsl:variable name="hits"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='hitsPerPage']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='hitsPerPage']/@value"/></xsl:when><xsl:otherwise>20</xsl:otherwise></xsl:choose></xsl:variable>
107 <tr><td colspan='3'>Return up to
108 <select name="{$ns}maxDocs">
109 <option value="50"><xsl:if test="$maxdocs=50"><xsl:attribute name="selected"></xsl:attribute></xsl:if>50</option>
110 <option value="100"><xsl:if test="$maxdocs=100"><xsl:attribute name="selected"></xsl:attribute></xsl:if>100</option>
111 <option value="200"><xsl:if test="$maxdocs=200"><xsl:attribute name="selected"></xsl:attribute></xsl:if>200</option>
112 <option value="-1"><xsl:if test="$maxdocs=-1"><xsl:attribute name="selected"></xsl:attribute></xsl:if>all</option>
113 </select>
114 hits with
115 <select name="hitsPerPage">
116 <option value="10"><xsl:if test="$hits=10"><xsl:attribute name="selected"></xsl:attribute></xsl:if>10 </option>
117 <option value="20"><xsl:if test="$hits=20"><xsl:attribute name="selected"></xsl:attribute></xsl:if>20</option>
118 <option value="50"><xsl:if test="$hits=50"><xsl:attribute name="selected"></xsl:attribute></xsl:if>50</option>
119 <option value="-1"><xsl:if test="$hits=-1"><xsl:attribute name="selected"></xsl:attribute></xsl:if>all</option>
120 </select>
121 hits per page.
122 </td></tr>
123 </table>
124 </xsl:template>
125
126 <xsl:template name="text-search-prefs">
127 <!-- query mode -->
128 <xsl:variable name="querymode"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='qm']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='qm']/@value"/></xsl:when><xsl:otherwise>0</xsl:otherwise></xsl:choose></xsl:variable>
129 <tr><td rowspan='2' valign='baseline'>Query mode:</td><td><input type='radio' name='qm' value='0'><xsl:if test="$querymode=0"><xsl:attribute name="checked"></xsl:attribute></xsl:if></input></td><td> simple query mode</td></tr>
130 <tr><td><input type='radio' name='qm' value='1'><xsl:if test="$querymode=1"><xsl:attribute name="checked"></xsl:attribute></xsl:if></input></td><td> advanced query mode (allows boolean searching using !, &amp;, |, and parentheses)</td></tr>
131
132 <!-- query box size -->
133 <xsl:variable name="boxsize"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='qb']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='qb']/@value"/></xsl:when><xsl:otherwise>0</xsl:otherwise></xsl:choose></xsl:variable>
134 <tr><td rowspan='2' valign='baseline'>Query box size:</td><td><input type='radio' name='qb' value='0'><xsl:if test="$boxsize=0"><xsl:attribute name="checked"></xsl:attribute></xsl:if></input></td><td> regular query box</td></tr>
135 <tr><td><input type='radio' name='qb' value='1'><xsl:if test="$boxsize=1"><xsl:attribute name="checked"></xsl:attribute></xsl:if></input></td><td> large query box</td></tr>
136 </xsl:template>
137</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.