Changeset 26084


Ignore:
Timestamp:
2012-08-08T16:17:00+12:00 (12 years ago)
Author:
sjm84
Message:

Changed the way we hide the search area when a user performs a text search as the previous approach was causing the next and previous buttons to stop working

Location:
main/trunk/greenstone3
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/LibraryServlet.java

    r25761 r26084  
    694694
    695695        //Add custom HTTP headers if requested
    696         String httpHeadersParam = request.getParameter(GSParams.HTTPHEADERFIELDS);
     696        String httpHeadersParam = request.getParameter(GSParams.HTTP_HEADER_FIELDS);
    697697        if (httpHeadersParam != null && httpHeadersParam.length() > 0)
    698698        {
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSParams.java

    r25937 r26084  
    4747    public static final String PROCESS_ID = "pid"; // if a request wasn't completed, this identifies the request - used when asking for a status update
    4848
    49     public static final String HTTPHEADERFIELDS = "hhf";
     49    public static final String HTTP_HEADER_FIELDS = "hhf";
     50    public static final String QUICK_SEARCH = "qs";
    5051
    5152    // internal configure args
     
    9697        addParameter(DOCUMENT, true);
    9798        addParameter(DOCUMENT_TYPE, false);
     99        addParameter(QUICK_SEARCH, false);
    98100        addParameter(START_PAGE, false);
    99101        addParameter(S_START_PAGE, false);
  • main/trunk/greenstone3/web/interfaces/default/transform/layouts/header.xsl

    r26083 r26084  
    364364            <div id="quicksearcharea">
    365365                <form action="{$library_name}/collection/{$collNameChecked}/search/TextQuery">
    366                     <input type="hidden" name="rt" value="r"/>
     366                    <!-- This parameter says that we have come from the quick search area -->
     367                    <input type="hidden" name="qs" value="1"/>
     368                    <input type="hidden" name="rt" value="rd"/>
    367369                    <input type="hidden" name="s1.level">
    368370                        <xsl:attribute name="value">
  • main/trunk/greenstone3/web/interfaces/default/transform/pages/query.xsl

    r26049 r26084  
    2121    <!-- the page content -->
    2222    <xsl:template match="/page">
    23         <xsl:call-template name="queryPage"/>
     23        <xsl:if test="not(/page/pageRequest/paramList/param[@name = 'qs']) or /page/pageRequest/paramList/param[@name = 'qs']/@value = ''">
     24            <xsl:call-template name="queryPage"/>
     25        </xsl:if>
    2426        <xsl:call-template name="resultsPage"/>
    2527    </xsl:template>
     
    309311            <td id="prevArrowTD">
    310312                <xsl:if test="$currentPage != 1">
    311                     <a href="{$library_name}?a=q&amp;sa={/page/pageRequest/@subaction}&amp;c={$collName}&amp;s={/page/pageResponse/service/@name}&amp;rt=rd&amp;{$startPageName}={$currentPage - 1}">
     313                    <a href="{$library_name}?a=q&amp;sa={/page/pageRequest/@subaction}&amp;c={$collName}&amp;s={/page/pageResponse/service/@name}&amp;rt=rd&amp;{$startPageName}={$currentPage - 1}&amp;qs={/page/pageRequest/paramList/param[@name='qs']/@value}">
    312314                        <img src="interfaces/default/images/previous.png"/>
    313315                    </a>
     
    316318            <td id="prevTD">
    317319                <xsl:if test="$currentPage != 1">
    318                     <a href="{$library_name}?a=q&amp;sa={/page/pageRequest/@subaction}&amp;c={$collName}&amp;s={/page/pageResponse/service/@name}&amp;rt=rd&amp;{$startPageName}={$currentPage - 1}">Previous</a>
     320                    <a href="{$library_name}?a=q&amp;sa={/page/pageRequest/@subaction}&amp;c={$collName}&amp;s={/page/pageResponse/service/@name}&amp;rt=rd&amp;{$startPageName}={$currentPage - 1}&amp;qs={/page/pageRequest/paramList/param[@name='qs']/@value}">Previous</a>
    319321                </xsl:if>
    320322            </td>
     
    373375            <td id="nextTD">
    374376                <xsl:if test="($currentPage * $docsPerPage + 1) &lt; $docMax">
    375                     <a href="{$library_name}?a=q&amp;sa={/page/pageRequest/paramList/param[@name = 'sa']/@value}&amp;c={$collName}&amp;s={/page/pageResponse/service/@name}&amp;rt=rd&amp;{$startPageName}={$currentPage + 1}">Next</a>
     377                    <a href="{$library_name}?a=q&amp;sa={/page/pageRequest/paramList/param[@name = 'sa']/@value}&amp;c={$collName}&amp;s={/page/pageResponse/service/@name}&amp;rt=rd&amp;{$startPageName}={$currentPage + 1}&amp;qs={/page/pageRequest/paramList/param[@name='qs']/@value}">Next</a>
    376378                </xsl:if>
    377379            </td>
    378380            <td id="nextArrowTD">
    379381                <xsl:if test="($currentPage * $docsPerPage + 1) &lt; $docMax">
    380                     <a href="{$library_name}?a=q&amp;sa={/page/pageRequest/paramList/param[@name = 'sa']/@value}&amp;c={$collName}&amp;s={/page/pageResponse/service/@name}&amp;rt=rd&amp;{$startPageName}={$currentPage + 1}">
     382                    <a href="{$library_name}?a=q&amp;sa={/page/pageRequest/paramList/param[@name = 'sa']/@value}&amp;c={$collName}&amp;s={/page/pageResponse/service/@name}&amp;rt=rd&amp;{$startPageName}={$currentPage + 1}&amp;qs={/page/pageRequest/paramList/param[@name='qs']/@value}">
    381383                        <img src="interfaces/default/images/next.png"/>
    382384                    </a>
Note: See TracChangeset for help on using the changeset viewer.