add sort-by-voting to frontend

git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@461 b3834d28-1941-0410-a4f8-b48e95affb8f
This commit is contained in:
cweiske 2009-10-28 22:30:12 +00:00
parent 55554bc0f1
commit cadcca8d6a

View file

@ -92,36 +92,56 @@ window.onload = playerLoad;
<p id="sort"><?php echo $total.' '.T_("bookmark(s)"); ?> - <?php echo T_("Sort by:"); ?> <p id="sort"><?php echo $total.' '.T_("bookmark(s)"); ?> - <?php echo T_("Sort by:"); ?>
<?php <?php
$titleArrow = '';
$dateArrow = '';
$votingArrow = '';
$dateSort = 'date_desc';
$titleSort = 'title_asc';
$votingSort = 'voting_asc';
switch(getSortOrder()) { switch(getSortOrder()) {
case 'date_asc': case 'date_asc':
$titleArrow = '';
$dateArrow = ' &uarr;'; $dateArrow = ' &uarr;';
$dateSort = 'date_desc'; $dateSort = 'date_desc';
$titleSort = 'title_asc';
break; break;
case 'title_asc': case 'title_asc':
$titleArrow = ' &uarr;'; $titleArrow = ' &uarr;';
$dateArrow = '';
$dateSort = 'date_desc';
$titleSort = 'title_desc'; $titleSort = 'title_desc';
break; break;
case 'title_desc': case 'title_desc':
$titleArrow = ' &darr;'; $titleArrow = ' &darr;';
$dateArrow = '';
$dateSort = 'date_desc';
$titleSort = 'title_asc'; $titleSort = 'title_asc';
break; break;
case 'voting_asc':
$votingArrow = ' &uarr;';
$votingSort = 'voting_desc';
break;
case 'voting_desc':
$votingArrow = ' &darr;';
$votingSort = 'voting_asc';
break;
case 'date_desc': case 'date_desc':
default: default:
$titleArrow = '';
$dateArrow = ' &darr;'; $dateArrow = ' &darr;';
$dateSort = 'date_asc'; $dateSort = 'date_asc';
$titleSort = 'title_asc';
break; break;
} }
?> <a href="?sort=<?php echo $dateSort ?>"><?php echo T_("Date").$dateArrow; ?></a><span> ?>
/ </span> <a href="?sort=<?php echo $titleSort ?>"><?php echo T_("Title").$titleArrow; ?></a><span> <a href="?sort=<?php echo $dateSort ?>"><?php echo T_("Date").$dateArrow; ?></a>
/ </span> <?php <span>/</span>
<a href="?sort=<?php echo $titleSort ?>"><?php echo T_("Title").$titleArrow; ?></a>
<span>/</span>
<?php if ($GLOBALS['enableVoting']) { ?>
<a href="?sort=<?php echo $votingSort ?>"><?php echo T_("Voting").$votingArrow; ?></a>
<span>/</span>
<?php } ?>
<?php
if($currenttag!= '') { if($currenttag!= '') {
if($user!= '') { if($user!= '') {
echo ' - '; echo ' - ';