Changeset 4270


Ignore:
Timestamp:
2003-05-12T16:31:41+12:00 (21 years ago)
Author:
kjdon
Message:

fixed a bug where no docs would be displayed if all docs are supposed to be displayed

Location:
trunk/gsdl3/web/interfaces/default/transform
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl3/web/interfaces/default/transform/basicquery.xsl

    r4253 r4270  
    7878      <tr valign="top">
    7979    <xsl:for-each select="documentNodeList/documentNode">
    80       <xsl:if test="position()&gt; (($hn - 1)*$hp) and position() &lt;= ($hn * $hp)">
     80      <xsl:if test="$hp=-1 or (position()&gt; (($hn - 1)*$hp) and position() &lt;= ($hn * $hp))">
    8181        <tr>
    8282          <xsl:apply-templates select=".">
  • trunk/gsdl3/web/interfaces/default/transform/querytools.xsl

    r4255 r4270  
    55  <xsl:template name="result-navigation">
    66    <xsl:param name="library"/>
    7     <xsl:variable name="hp">20</xsl:variable>
    8     <xsl:variable name="hn" select="ancestor::page/pageRequest/paramList/param[@name='hn']/@value"/>
    9     <xsl:variable name="sa" select="ancestor::page/pageRequest/@subaction"/>
    10     <xsl:variable name="prev" select="$hn - 1"/>
    11     <xsl:variable name="next" select="$hn + 1"/>
    12     <xsl:variable name="count" select="count(documentNodeList/documentNode)"/>
    13     <p />
    14     <center>
    15       <table cellspacing='0' cellpadding='0' width='100%'>
    16     <tr>
    17       <td align='left'>
    18         <xsl:if test="$hn &gt; 1"><a href="{$library}?a=q&amp;rt=r&amp;hn={$prev}"><img src="interfaces/default/images/less.gif" width='30' height='16' border='0' align='top'/><xsl:call-template name="text"><xsl:with-param name="key">query.matches</xsl:with-param></xsl:call-template><xsl:text> </xsl:text><xsl:value-of select="number(($prev - 1)*$hp + 1)"/> - <xsl:value-of select="number(($prev * $hp))"/></a></xsl:if>
    19       </td>
    20       <td align='right'>
    21         <xsl:if test="(($hn * $hp) + 1)  &lt; $count">
    22           <xsl:variable name='m' select="number($next * $hp)"/>
    23           <xsl:variable name='mm'><xsl:choose><xsl:when test="$m &lt; $count"><xsl:value-of select='$m'/></xsl:when><xsl:otherwise><xsl:value-of select='$count'/></xsl:otherwise></xsl:choose></xsl:variable>
    24           <a href="{$library}?a=q&amp;sa={$sa}&amp;rt=r&amp;hn={$next}"><xsl:call-template name="text"><xsl:with-param name="key">query.matches</xsl:with-param></xsl:call-template><xsl:text> </xsl:text><xsl:value-of select="number(($next - 1)*$hp + 1)"/> - <xsl:value-of select="$mm"/><img src="interfaces/default/images/more.gif" width='30' height='16' border='0' align='top'/></a></xsl:if></td> </tr>
    25       </table>
    26     </center>
     7    <xsl:variable name="hp"><xsl:choose><xsl:when test="ancestor::page/pageRequest/paramList/param[@name='hp']"><xsl:value-of select="ancestor::page/pageRequest/paramList/param[@name='hp']/@value"/></xsl:when><xsl:otherwise>20</xsl:otherwise></xsl:choose></xsl:variable>
     8    <xsl:if test="not($hp=-1)">
     9      <xsl:variable name="hn"><xsl:choose><xsl:when test="ancestor::page/pageRequest/paramList/param[@name='hn']"><xsl:value-of select="ancestor::page/pageRequest/paramList/param[@name='hn']/@value"/></xsl:when><xsl:otherwise>1</xsl:otherwise></xsl:choose></xsl:variable>
     10      <xsl:variable name="sa" select="ancestor::page/pageRequest/@subaction"/>
     11      <xsl:variable name="prev" select="$hn - 1"/>
     12      <xsl:variable name="next" select="$hn + 1"/>
     13      <xsl:variable name="count" select="count(documentNodeList/documentNode)"/>
     14      <p />
     15      <center>
     16    <table cellspacing='0' cellpadding='0' width='537'>
     17      <tr>
     18        <td align='left'>
     19          <xsl:if test="$hn &gt; 1"><a href="{$library}?a=q&amp;rt=r&amp;hn={$prev}"><img src="interfaces/default/images/less.gif" width='30' height='16' border='0' align='top'/><xsl:call-template name="text"><xsl:with-param name="key">query.matches</xsl:with-param></xsl:call-template><xsl:text> </xsl:text><xsl:value-of select="number(($prev - 1)*$hp + 1)"/> - <xsl:value-of select="number(($prev * $hp))"/></a></xsl:if>
     20        </td>
     21        <td align='right'>
     22          <xsl:if test="(($hn * $hp) + 1)  &lt; $count">
     23        <xsl:variable name='m' select="number($next * $hp)"/>
     24        <xsl:variable name='mm'><xsl:choose><xsl:when test="$m &lt; $count"><xsl:value-of select='$m'/></xsl:when><xsl:otherwise><xsl:value-of select='$count'/></xsl:otherwise></xsl:choose></xsl:variable>
     25        <a href="{$library}?a=q&amp;sa={$sa}&amp;rt=r&amp;hn={$next}"><xsl:call-template name="text"><xsl:with-param name="key">query.matches</xsl:with-param></xsl:call-template><xsl:text> </xsl:text><xsl:value-of select="number(($next - 1)*$hp + 1)"/> - <xsl:value-of select="$mm"/><img src="interfaces/default/images/more.gif" width='30' height='16' border='0' align='top'/></a></xsl:if></td> </tr>
     26    </table>
     27      </center>
     28    </xsl:if>
    2729  </xsl:template>
    2830 
    2931</xsl:stylesheet>
     32
     33
Note: See TracChangeset for help on using the changeset viewer.