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 | |
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()
-rw-r--r-- | lib/class/browse.class.php | 33 | ||||
-rw-r--r-- | templates/show_album.inc.php | 1 | ||||
-rw-r--r-- | templates/show_artist.inc.php | 6 |
3 files changed, 31 insertions, 9 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()) { diff --git a/templates/show_album.inc.php b/templates/show_album.inc.php index e2f2e069..96b2f6ac 100644 --- a/templates/show_album.inc.php +++ b/templates/show_album.inc.php @@ -88,6 +88,7 @@ $title = scrub_out($album->name) . ' (' . $album->year . ')' . $disk .'&nb Browse::set_simple_browse(1); Browse::set_filter('album', $album->id); Browse::set_sort('track','ASC'); + Browse::reset_total(); Browse::get_objects(); Browse::show_objects(); ?> diff --git a/templates/show_artist.inc.php b/templates/show_artist.inc.php index 1d6906a6..84e200a0 100644 --- a/templates/show_artist.inc.php +++ b/templates/show_artist.inc.php @@ -58,9 +58,7 @@ if (Config::get('ratings')) { </div> <?php show_box_bottom(); ?> <?php - Browse::reset_filters(); Browse::set_type($object_type); - Browse::set_static_content(1); - Browse::save_objects($object_ids); - Browse::show_objects(); + Browse::reset(); + Browse::show_objects($object_ids); ?> |