diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-12-24 00:57:36 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-12-24 00:57:36 +0000 |
commit | 3d8ff28ac56f30075bd9c485e2ee94f486717e6f (patch) | |
tree | 46413c2ccfc5d7f99a26ecb3fe6f23ac0a9278cd /lib/class/browse.class.php | |
parent | ee64379cf4c093d589502e72036759e66671cac7 (diff) | |
download | ampache-3d8ff28ac56f30075bd9c485e2ee94f486717e6f.tar.gz ampache-3d8ff28ac56f30075bd9c485e2ee94f486717e6f.tar.bz2 ampache-3d8ff28ac56f30075bd9c485e2ee94f486717e6f.zip |
fixed filters being applied incorrectly, and removed un-needed query on show album
Diffstat (limited to 'lib/class/browse.class.php')
-rw-r--r-- | lib/class/browse.class.php | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/lib/class/browse.class.php b/lib/class/browse.class.php index d74d2514..caaf79b5 100644 --- a/lib/class/browse.class.php +++ b/lib/class/browse.class.php @@ -36,6 +36,10 @@ class Browse { // Boolean if this is a simple browse method (use different paging code) public static $simple_browse; + // Static Content, this is defaulted to false, if set to true then wen can't + // apply any filters that would change the result set. + public static $static_content = false; + /** * constructor * This should never be called @@ -58,9 +62,6 @@ class Browse { switch ($key) { case 'show_art': - case 'min_count': - case 'unplayed': - case 'rated': $key = $_REQUEST['key']; if ($_SESSION['browse']['filter'][$key]) { unset($_SESSION['browse']['filter'][$key]); @@ -69,14 +70,23 @@ class Browse { $_SESSION['browse']['filter'][$key] = 1; } break; + case 'min_count': + case 'unplayed': + case 'rated': + + break; case 'alpha_match': + if (self::$static_content) { return false; } if ($value == _('All')) { $value = ''; } $_SESSION['browse']['filter'][$key] = $value; break; default: // Rien a faire + return false; break; } // end switch + + return true; } // set_filter @@ -100,7 +110,6 @@ class Browse { */ public static function reset_supplemental_objects() { - $_SESSION['browse']['supplemental'] = array(); } // reset_supplemental_objects @@ -138,6 +147,7 @@ class Browse { $_SESSION['browse']['type'] = $type; // Resets the simple browse self::set_simple_browse(0); + self::set_static_content(0); self::reset_supplemental_objects(); break; default: @@ -226,6 +236,21 @@ class Browse { } // set_simple_browse /** + * set_static_content + * This sets true/false if the content of this browse + * should be static, if they are then content filtering/altering + * methods will be skipped + */ + public static function set_static_content($value) { + + $value = make_bool($value); + self::$static_content = $value; + + $_SESSION['browse']['static'] = $value; + + } // set_static_content + + /** * get_saved * This looks in the session for the saved * stuff and returns what it finds @@ -723,6 +748,7 @@ class Browse { public static function _auto_init() { self::$simple_browse = make_bool($_SESSION['browse']['simple']); + self::$static_content = make_bool($_SESSION['browse']['static']); } // _auto_init |