diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-08-19 03:45:47 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-08-19 03:45:47 +0000 |
commit | 8151391c527bdf306562eb8957fd84e23fdf0aeb (patch) | |
tree | de6d8c5e01d58ecfd6426af36600bbdd2d1d7cab /lib/class/browse.class.php | |
parent | 781d77e558dda2739550b90bbfed9be89fb03ab3 (diff) | |
download | ampache-8151391c527bdf306562eb8957fd84e23fdf0aeb.tar.gz ampache-8151391c527bdf306562eb8957fd84e23fdf0aeb.tar.bz2 ampache-8151391c527bdf306562eb8957fd84e23fdf0aeb.zip |
fix single album and artist views, corrected get_total() from show_objects()
Diffstat (limited to 'lib/class/browse.class.php')
-rw-r--r-- | lib/class/browse.class.php | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/lib/class/browse.class.php b/lib/class/browse.class.php index 14026fa4..ba9bb60c 100644 --- a/lib/class/browse.class.php +++ b/lib/class/browse.class.php @@ -115,6 +115,19 @@ class Browse { } // set_filter /** + * reset + * Reset everything + */ + public static function reset() { + + self::reset_filters(); + self::reset_total(); + self::reset_supplemental_objects(); + self::set_simple_browse(0); + + } // reset + + /** * reset_filter * This is a wrapper function that resets the filters */ @@ -135,6 +148,16 @@ class Browse { } // reset_supplemental_objects /** + * reset_total + * This resets the total for the browse type + */ + public static function reset_total() { + + unset($_SESSION['browse']['total'][self::$type]); + + } // reset_total + + /** * get_filter * returns the specified filter value */ @@ -151,7 +174,7 @@ class Browse { * if they pass us an array then use that! */ public static function get_total($objects=false) { - + // If they pass something then just return that if (is_array($objects)) { return count($objects); @@ -336,7 +359,7 @@ class Browse { public static function set_simple_browse($value) { $value = make_bool($value); - $_SESSION['browse'][self::$type]['simple'] = $value; + $_SESSION['browse']['simple'][self::$type] = $value; } // set_simple_browse @@ -366,7 +389,7 @@ class Browse { */ public static function is_simple_browse() { - return $_SESSION['browse'][self::$type]['simple']; + return $_SESSION['browse']['simple'][self::$type]; } // is_simple_browse @@ -883,7 +906,7 @@ class Browse { * type that we are currently browsing */ public static function show_objects($object_ids=false) { - + if (self::is_simple_browse()) { $object_ids = self::get_saved(); } @@ -892,7 +915,7 @@ class Browse { } // Reset the total items - self::$total_objects = self::get_total(count($object_ids)); + self::$total_objects = self::get_total($object_ids); // Limit is based on the users preferences if this is not a simple browse because we've got too much here if (count($object_ids) > self::$start AND !self::is_simple_browse()) { |