diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2009-03-13 03:15:09 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2009-03-13 03:15:09 +0000 |
commit | b92109a64fe2fca1520be0536f8092e2f50ef8f4 (patch) | |
tree | 9157861555c44e2135cd42e1aec3d0da28d390cd /lib/class/browse.class.php | |
parent | 8398183bf5a383cee7da656fd116457c799678f7 (diff) | |
download | ampache-b92109a64fe2fca1520be0536f8092e2f50ef8f4.tar.gz ampache-b92109a64fe2fca1520be0536f8092e2f50ef8f4.tar.bz2 ampache-b92109a64fe2fca1520be0536f8092e2f50ef8f4.zip |
put supplemental object support back into the browse object for now, replace later
Diffstat (limited to 'lib/class/browse.class.php')
-rw-r--r-- | lib/class/browse.class.php | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/lib/class/browse.class.php b/lib/class/browse.class.php index 316061ab..f36c47f6 100644 --- a/lib/class/browse.class.php +++ b/lib/class/browse.class.php @@ -66,6 +66,34 @@ class Browse extends Query { } // set_simple_browse /** + * add_supplemental_object + * Legacy function, need to find a better way to do that + */ + public static function add_supplemental_object($class,$uid) { + + $_SESSION['browse']['supplemental'][$class] = intval($uid); + + return true; + + } // add_supplemental_object + + /** + * get_supplemental_objects + * This returns an array of 'class','id' for additional objects that need to be + * created before we start this whole browsing thing + */ + public static function get_supplemental_objects() { + + $objects = $_SESSION['browse']['supplemental']; + + if (!is_array($objects)) { $objects = array(); } + + return $objects; + + } // get_supplemental_objects + + + /** * show_objects * This takes an array of objects * and requires the correct template based on the @@ -89,6 +117,13 @@ class Browse extends Query { $object_ids = array_slice($object_ids,parent::get_start(),parent::get_offset(),TRUE); } + // Load any additional object we need for this + $extra_objects = self::get_supplemental_objects(); + + foreach ($extra_objects as $class_name => $id) { + ${$class_name} = new $class_name($id); + } + // Format any matches we have so we can show them to the masses if ($filter_value = parent::get_filter('alpha_match')) { $match = ' (' . $filter_value . ')'; |