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

Last change on this file since 13505 was 13505, checked in by shaoqun, 15 years ago

replaced some div tags with ul and li tags

  • Property svn:keywords set to Author Date Id Revision
File size: 5.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 <!-- 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 <xsl:call-template name="standardPageBanner">
25 <xsl:with-param name="collName" select="$collName"/>
26 <xsl:with-param name="pageType">pref</xsl:with-param>
27 </xsl:call-template>
28
29 <xsl:call-template name="navigationBar">
30 <xsl:with-param name="collName" select="$collName"/>
31 </xsl:call-template>
32 <div id="qureyform">
33 <form name="PrefForm" method="get" action="{$library_name}">
34 <input type='hidden' name='a' value='p'/>
35 <input type='hidden' name='sa' value='pref'/>
36 <input type='hidden' name='c' value="{$collName}"/>
37 <div class="formheading"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.prespref')"/></div>
38 <ul id="presprefs"><xsl:call-template name="pres-prefs"/></ul>
39 <ul id="berrybasketprefs" ><xsl:call-template name="berrybasket-prefs"/></ul>
40 <div class="formheading"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.searchpref')"/></div>
41 <ul id="searchprefs"><xsl:call-template name="search-prefs"/></ul>
42 <input type='submit'><xsl:attribute name="value"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.set_prefs')"/></xsl:attribute></input>
43 </form>
44 </div>
45 </xsl:template>
46
47 <xsl:template name="pres-prefs">
48 <li><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.interfacelang')"/> <xsl:call-template name="lang-list"/></li>
49 <li><span class="rightspace"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.encoding')"/></span>x</li>
50 </xsl:template>
51
52 <xsl:template name="lang-list">
53 <xsl:variable name="current" select="/page/@lang"/>
54 <select name="l">
55 <xsl:for-each select="/page/pageResponse/languageList/language">
56 <option value="{@name}"><xsl:if test="@name=$current"><xsl:attribute name="selected"></xsl:attribute></xsl:if><xsl:value-of select="displayItem[@name='name']"/></option>
57 </xsl:for-each>
58 </select>
59 </xsl:template>
60
61 <xsl:template name="search-prefs">
62 <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>
63 <li><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.hitsperpage')"/>
64 <select name="hitsPerPage">
65 <option value="20"><xsl:if test="$hits=20"><xsl:attribute name="selected"></xsl:attribute></xsl:if>20</option>
66 <option value="50"><xsl:if test="$hits=50"><xsl:attribute name="selected"></xsl:attribute></xsl:if>50</option>
67 <option value="100"><xsl:if test="$hits=100"><xsl:attribute name="selected"></xsl:attribute></xsl:if>100</option>
68 <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>
69 </select>
70 </li>
71 </xsl:template>
72
73 <xsl:template name="berrybasket-prefs">
74 <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>
75
76 <li><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.berrybasket')"/> <select name="berrybasket">
77 <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>
78 <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>
79 </select>
80 </li>
81 </xsl:template>
82
83
84</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.