removed scriptname, argument, value, sort and orderby from GET parameters

git-svn-id: http://yolanda.mister-muffin.de/svn@214 7eef14d0-6ed0-489d-bf55-20463b2d70db
This commit is contained in:
josch 2007-12-19 23:32:01 +00:00
parent fee846b3c1
commit 09eca66dad
3 changed files with 4 additions and 246 deletions

View file

@ -15,11 +15,7 @@ if($query->param('query') or $query->param('orderby'))
#TODO: clean up scriptname, argument, value only being there because of
#TODO: account.pl also calling fill_results() which will be changed
$page->{'search'} = [''];
$page->{'results'}->{'scriptname'} = 'search.pl';
$page->{'results'}->{'argument'} = 'query';
$page->{'results'}->{'value'} = $query->param('query');
$page->{'results'}->{'orderby'} = $query->param('orderby');
$page->{'results'}->{'sort'} = $query->param('sort');
$page->{'results'}->{'query'} = $query->param('query');
my @args = ();

View file

@ -207,17 +207,8 @@ elsif($query->url_param('title') or $query->url_param('id'))
}
else
{
#when an ambigous title was passed there may me many results - display them like search.pl does
$page->{'results'}->{'scriptname'} = 'video.pl';
$page->{'results'}->{'argument'} = 'title';
$page->{'results'}->{'value'} = $query->param('title');
$page->{'results'}->{'orderby'} = $query->param('orderby');
$page->{'results'}->{'sort'} = $query->param('sort');
$page->{'search'} = [''];
fill_results(@args);
#when an ambigous title was passed there may me many results
#redirect to an appropriate search or throw an error with a link to such a search
}
}
else

View file

@ -47,107 +47,6 @@
</xsl:for-each>
</xsl:template>
<xsl:template name="results-heading">
<!--
this is deprecated - dont use it.
-->
<div>
<xsl:choose>
<xsl:when test="//results/@value!=''">
<xsl:if test="//results/@argument='query'">
<!-- <xsl:value-of select="$locale_strings[@id='results_for_query']" /> -->
<i><xsl:value-of select="//results/@value" /></i><br />
</xsl:if>
<xsl:if test="//results/@orderby!=''">
<xsl:value-of select="$locale_strings[@id='ordered_by']" />
<xsl:choose>
<xsl:when test="//results/@orderby='relevance'">
<xsl:value-of select="$locale_strings[@id='relevance']" />
</xsl:when>
<xsl:when test="//results/@orderby='duration'">
<xsl:value-of select="$locale_strings[@id='duration']" />
</xsl:when>
<xsl:when test="//results/@orderby='filesize'">
<xsl:value-of select="$locale_strings[@id='filesize']" />
</xsl:when>
<xsl:when test="//results/@orderby='viewcount'">
<xsl:value-of select="$locale_strings[@id='viewcount']" />
</xsl:when>
<xsl:when test="//results/@orderby='downloadcount'">
<xsl:value-of select="$locale_strings[@id='downloadcount']" />
</xsl:when>
<xsl:when test="//results/@orderby='timestamp'">
<xsl:value-of select="$locale_strings[@id='timestamp']" />
</xsl:when>
</xsl:choose>
<xsl:choose>
<xsl:when test="//results/@sort='asc'">
<xsl:value-of select="$locale_strings[@id='ascending']" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$locale_strings[@id='descending']" />
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:when>
<xsl:when test="//results/@orderby!=''">
<xsl:choose>
<xsl:when test="//results/@orderby='timestamp'">
<xsl:choose>
<xsl:when test="//results/@sort='asc'">
<xsl:value-of select="$locale_strings[@id='videos_oldest']" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$locale_strings[@id='videos_newest']" />
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="//results/@orderby='downloadcount'">
<xsl:choose>
<xsl:when test="//results/@sort='asc'">
<xsl:value-of select="$locale_strings[@id='videos_downloaded_least']" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$locale_strings[@id='videos_downloaded_most']" />
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="//results/@orderby='viewcount'">
<xsl:choose>
<xsl:when test="//results/@sort='asc'">
<xsl:value-of select="$locale_strings[@id='videos_viewed_least']" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$locale_strings[@id='videos_viewed_most']" />
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="//results/@orderby='duration'">
<xsl:choose>
<xsl:when test="//results/@sort='asc'">
<xsl:value-of select="$locale_strings[@id='videos_shortest']" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$locale_strings[@id='videos_lengthest']" />
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="//results/@orderby='filesize'">
<xsl:choose>
<xsl:when test="//results/@sort='asc'">
<xsl:value-of select="$locale_strings[@id='videos_smallest']" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$locale_strings[@id='videos_biggest']" />
</xsl:otherwise>
</xsl:choose>
</xsl:when>
</xsl:choose>
</xsl:when>
</xsl:choose>
</div>
</xsl:template>
<xsl:template name="results">
@ -178,136 +77,8 @@
</xsl:template>
<xsl:template name="results-ordering">
<!--
this is deprecated - dont use it.
-->
<div>
<form method="get">
<xsl:attribute name="action">
<xsl:value-of select="//results/@scriptname" />
</xsl:attribute>
<fieldset>
<input type="hidden">
<xsl:attribute name="name">
<xsl:value-of select="//results/@argument" />
</xsl:attribute>
<xsl:attribute name="value">
<xsl:value-of select="//results/@value" />
</xsl:attribute>
</input>
order by:
<select name="orderby">
<xsl:if test="//results/@query!=''">
<option value="relevance">
<xsl:if test="//results/@orderby='relevance'">
<xsl:attribute name="selected">selected</xsl:attribute>
</xsl:if>
<xsl:value-of select="$locale_strings[@id='relevance']" />
</option>
</xsl:if>
<option value="filesize">
<xsl:if test="//results/@orderby='filesize'">
<xsl:attribute name="selected">selected</xsl:attribute>
</xsl:if>
<xsl:value-of select="$locale_strings[@id='filesize']" />
</option>
<option value="duration">
<xsl:if test="//results/@orderby='duration'">
<xsl:attribute name="selected">selected</xsl:attribute>
</xsl:if>
<xsl:value-of select="$locale_strings[@id='duration']" />
</option>
<option value="viewcount">
<xsl:if test="//results/@orderby='viewcount'">
<xsl:attribute name="selected">selected</xsl:attribute>
</xsl:if>
<xsl:value-of select="$locale_strings[@id='viewcount']" />
</option>
<option value="downloadcount">
<xsl:if test="//results/@orderby='downloadcount'">
<xsl:attribute name="selected">selected</xsl:attribute>
</xsl:if>
<xsl:value-of select="$locale_strings[@id='downloadcount']" />
</option>
<option value="timestamp">
<xsl:if test="//results/@orderby='timestamp'">
<xsl:attribute name="selected">selected</xsl:attribute>
</xsl:if>
<xsl:value-of select="$locale_strings[@id='timestamp']" />
</option>
</select>
<select name="sort">
<option value="desc">
<xsl:if test="//results/@sort='desc'">
<xsl:attribute name="selected">selected</xsl:attribute>
</xsl:if>
<xsl:value-of select="$locale_strings[@id='descending']" />
</option>
<option value="asc">
<xsl:if test="//results/@sort='asc'">
<xsl:attribute name="selected">selected</xsl:attribute>
</xsl:if>
<xsl:value-of select="$locale_strings[@id='ascending']" />
</option>
</select>
pagesize:
<select name="pagesize">
<option>
<xsl:if test="//results/@pagesize='1'">
<xsl:attribute name="selected">selected</xsl:attribute>
</xsl:if>
1
</option>
<option>
<xsl:if test="//results/@pagesize='2'">
<xsl:attribute name="selected">selected</xsl:attribute>
</xsl:if>
2
</option>
<option>
<xsl:if test="//results/@pagesize='5'">
<xsl:attribute name="selected">selected</xsl:attribute>
</xsl:if>
5
</option>
<option>
<xsl:if test="//results/@pagesize='10'">
<xsl:attribute name="selected">selected</xsl:attribute>
</xsl:if>
10
</option>
<option>
<xsl:if test="//results/@pagesize='20'">
<xsl:attribute name="selected">selected</xsl:attribute>
</xsl:if>
20
</option>
<option>
<xsl:if test="//results/@pagesize='50'">
<xsl:attribute name="selected">selected</xsl:attribute>
</xsl:if>
50
</option>
<option>
<xsl:if test="//results/@pagesize='100'">
<xsl:attribute name="selected">selected</xsl:attribute>
</xsl:if>
100
</option>
</select>
<input type="submit" />
</fieldset>
</form>
</div>
</xsl:template>
<xsl:template name="pagination-arrows">
<xsl:variable name="query_string" select="concat('/', //results/@scriptname, '?', //results/@argument, '=', //results/@value, '&amp;orderby=', //results/@orderby, '&amp;sort=', //results/@sort, '&amp;pagesize=', //results/@pagesize)" />
<xsl:variable name="query_string" select="concat($site_strings[@id='page_results'], //results/@query, '&amp;pagesize=', //results/@pagesize)" />
<div>
<a>
<xsl:attribute name="href">