source: trunk/gsdl3/web/interfaces/default/transform/pref.xsl@ 13996

Last change on this file since 13996 was 13996, checked in by lh92, 15 years ago

Added code to display the page turning when book switch is on and the tidy_option is set

  • Property svn:keywords set to Author Date Id Revision
File size: 6.2 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 <!-- style includes global params interface_name, library_name -->
10 <xsl:include href="style.xsl"/>
11
12 <xsl:output method="html"/>
13
14 <xsl:template name="pageTitle">
15 <xsl:choose><xsl:when test="/page/pageResponse/*/displayItem[@name='name']"><xsl:value-of select="/page/pageResponse/*/displayItem[@name='name']"/></xsl:when><xsl:otherwise><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/></xsl:otherwise></xsl:choose>: <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_t')"/>
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
25 <xsl:variable name="tidyoption"><xsl:value-of select="/page/pageResponse/collection/metadataList/metadata[@name='tidyoption']"/></xsl:variable>
26
27 <xsl:call-template name="standardPageBanner">
28 <xsl:with-param name="collName" select="$collName"/>
29 <xsl:with-param name="pageType">pref</xsl:with-param>
30 </xsl:call-template>
31
32 <xsl:call-template name="navigationBar">
33 <xsl:with-param name="collName" select="$collName"/>
34 </xsl:call-template>
35 <div id="qureyform">
36 <form name="PrefForm" method="get" action="{$library_name}">
37 <input type='hidden' name='a' value='p'/>
38 <input type='hidden' name='sa' value='pref'/>
39 <input type='hidden' name='c' value="{$collName}"/>
40 <div class="formheading"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.prespref')"/></div>
41 <ul id="presprefs"><xsl:call-template name="pres-prefs"/></ul>
42 <ul id="berrybasketprefs" ><xsl:call-template name="berrybasket-prefs"/></ul>
43
44 <xsl:if test="$tidyoption='tidy'">
45 <ul id="bookprefs"><xsl:call-template name="book-prefs"/></ul>
46 </xsl:if>
47
48 <div class="formheading"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.searchpref')"/></div>
49 <ul id="searchprefs"><xsl:call-template name="search-prefs"/></ul>
50 <input type='submit'><xsl:attribute name="value"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.set_prefs')"/></xsl:attribute></input>
51 </form>
52 </div>
53 </xsl:template>
54
55 <xsl:template name="pres-prefs">
56 <li><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.interfacelang')"/> <xsl:call-template name="lang-list"/></li>
57 <li><span class="rightspace"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.encoding')"/></span>x</li>
58 </xsl:template>
59
60 <xsl:template name="lang-list">
61 <xsl:variable name="current" select="/page/@lang"/>
62 <select name="l">
63 <xsl:for-each select="/page/pageResponse/languageList/language">
64 <option value="{@name}"><xsl:if test="@name=$current"><xsl:attribute name="selected"></xsl:attribute></xsl:if><xsl:value-of select="displayItem[@name='name']"/></option>
65 </xsl:for-each>
66 </select>
67 </xsl:template>
68
69 <xsl:template name="search-prefs">
70 <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>
71 <li><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.hitsperpage')"/>
72 <select name="hitsPerPage">
73 <option value="20"><xsl:if test="$hits=20"><xsl:attribute name="selected"></xsl:attribute></xsl:if>20</option>
74 <option value="50"><xsl:if test="$hits=50"><xsl:attribute name="selected"></xsl:attribute></xsl:if>50</option>
75 <option value="100"><xsl:if test="$hits=100"><xsl:attribute name="selected"></xsl:attribute></xsl:if>100</option>
76 <option value="-1"><xsl:if test="$hits=-1"><xsl:attribute name="selected"></xsl:attribute></xsl:if><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.all')"/></option>
77 </select>
78 </li>
79 </xsl:template>
80
81 <xsl:template name="berrybasket-prefs">
82 <xsl:variable name="berrybasket"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='berrybasket']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='berrybasket']/@value"/></xsl:when><xsl:otherwise>off</xsl:otherwise></xsl:choose></xsl:variable>
83
84 <li><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.berrybasket')"/> <select name="berrybasket">
85 <option value="on"><xsl:if test="$berrybasket='on'"><xsl:attribute name="selected"></xsl:attribute></xsl:if><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.berrybasket.on')"/></option>
86 <option value="off"><xsl:if test="$berrybasket='off'"><xsl:attribute name="selected"></xsl:attribute></xsl:if><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.berrybasket.off')"/></option>
87 </select>
88 </li>
89 </xsl:template>
90
91<xsl:template name="book-prefs">
92 <xsl:variable name="book"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='book']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='book']/@value"/></xsl:when><xsl:otherwise>off</xsl:otherwise></xsl:choose></xsl:variable>
93
94 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.book')"/> <select name="book">
95 <option value="on"><xsl:if test="$book='on'"><xsl:attribute name="selected"></xsl:attribute></xsl:if><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.berrybasket.on')"/></option>
96 <option value="off"><xsl:if test="$book='off'"><xsl:attribute name="selected"></xsl:attribute></xsl:if><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.berrybasket.off')"/></option>
97 </select>
98
99 </xsl:template>
100</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.