summaryrefslogtreecommitdiffstats
path: root/lib/class/browse.class.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-09-28 02:18:08 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-09-28 02:18:08 +0000
commit705fba8f49faa42ed7f004f67b74a996c29ddb3d (patch)
treee6409a5c1f9106a03e0abbb13cdb92e9c1a0968a /lib/class/browse.class.php
parent9030c16466ec16db505d755d9b6405b5a40c897d (diff)
downloadampache-705fba8f49faa42ed7f004f67b74a996c29ddb3d.tar.gz
ampache-705fba8f49faa42ed7f004f67b74a996c29ddb3d.tar.bz2
ampache-705fba8f49faa42ed7f004f67b74a996c29ddb3d.zip
ajax loading thingy added to css, fixed random methods on rightbar and added a default sort to the browse methods
Diffstat (limited to 'lib/class/browse.class.php')
-rw-r--r--lib/class/browse.class.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/class/browse.class.php b/lib/class/browse.class.php
index fae2670b..89341ec2 100644
--- a/lib/class/browse.class.php
+++ b/lib/class/browse.class.php
@@ -119,7 +119,7 @@ class Browse {
* set_sort
* This sets the current sort(s)
*/
- public static function set_sort($sort) {
+ public static function set_sort($sort,$order='') {
switch ($_SESSION['browse']['type']) {
case 'song':
@@ -145,9 +145,13 @@ class Browse {
// If it's not in our list, smeg off!
if (!in_array($sort,$valid_array)) {
return false;
- }
-
- if ($_SESSION['browse']['sort'][$sort] == 'DESC') {
+ }
+
+ if ($order) {
+ $_SESSION['browse']['sort'] = array();
+ $_SESSION['browse']['sort'][$sort] = $order;
+ }
+ elseif ($_SESSION['browse']['sort'][$sort] == 'DESC') {
// Reset it till I can figure out how to interface the hotness
$_SESSION['browse']['sort'] = array();
$_SESSION['browse']['sort'][$sort] = 'ASC';
@@ -572,6 +576,9 @@ class Browse {
// First pull the objects
$objects = self::get_saved();
+ // If there's nothing there don't do anything
+ if (!count($objects)) { return false; }
+
foreach ($objects as $object_id) {
$object_id = Dba::escape($object_id);
$where_sql .= "`id`='$object_id' OR";