parent::get_start() AND !parent::is_simple()) { $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 . ')'; } elseif ($filter_value = parent::get_filter('starts_with')) { $match = ' (' . $filter_value . ')'; } // Set the correct classes based on type $class = "box browse_".self::$type; Ajax::start_container('browse_content'); // Switch on the type of browsing we're doing switch (parent::get_type()) { case 'song': show_box_top(_('Songs') . $match, $class); Song::build_cache($object_ids); require_once Config::get('prefix') . '/templates/show_songs.inc.php'; show_box_bottom(); break; case 'album': show_box_top(_('Albums') . $match, $class); Album::build_cache($object_ids,'extra'); require_once Config::get('prefix') . '/templates/show_albums.inc.php'; show_box_bottom(); break; case 'user': show_box_top(_('Manage Users') . $match, $class); require_once Config::get('prefix') . '/templates/show_users.inc.php'; show_box_bottom(); break; case 'artist': show_box_top(_('Artists') . $match, $class); Artist::build_cache($object_ids,'extra'); require_once Config::get('prefix') . '/templates/show_artists.inc.php'; show_box_bottom(); break; case 'live_stream': require_once Config::get('prefix') . '/templates/show_live_stream.inc.php'; show_box_top(_('Radio Stations') . $match, $class); require_once Config::get('prefix') . '/templates/show_live_streams.inc.php'; show_box_bottom(); break; case 'playlist': Playlist::build_cache($object_ids); show_box_top(_('Playlists') . $match, $class); require_once Config::get('prefix') . '/templates/show_playlists.inc.php'; show_box_bottom(); break; case 'playlist_song': show_box_top(_('Playlist Songs') . $match,$class); require_once Config::get('prefix') . '/templates/show_playlist_songs.inc.php'; show_box_bottom(); break; case 'playlist_localplay': show_box_top(_('Current Playlist')); require_once Config::get('prefix') . '/templates/show_localplay_playlist.inc.php'; show_box_bottom(); break; case 'catalog': show_box_top(_('Catalogs'), $class); require_once Config::get('prefix') . '/templates/show_catalogs.inc.php'; show_box_bottom(); break; case 'shoutbox': show_box_top(_('Shoutbox Records'),$class); require_once Config::get('prefix') . '/templates/show_manage_shoutbox.inc.php'; show_box_bottom(); break; case 'flagged': show_box_top(_('Flagged Records'),$class); require_once Config::get('prefix') . '/templates/show_flagged.inc.php'; show_box_bottom(); break; case 'tag': Tag::build_cache($tags); show_box_top(_('Tag Cloud'),$class); require_once Config::get('prefix') . '/templates/show_tagcloud.inc.php'; show_box_bottom(); break; case 'video': Video::build_cache($object_ids); show_box_top(_('Videos'),$class); require_once Config::get('prefix') . '/templates/show_videos.inc.php'; show_box_bottom(); break; case 'democratic': show_box_top(_('Democratic Playlist'),$class); require_once Config::get('prefix') . '/templates/show_democratic_playlist.inc.php'; show_box_bottom(); default: // Rien a faire break; } // end switch on type Ajax::end_container(); } // show_object /** * _auto_init * this function reloads information back from the session * it is called on creation of the class */ public static function _auto_init() { $offset = Config::get('offset_limit') ? Config::get('offset_limit') : '25'; parent::set_offset($offset); } // _auto_init public static function set_filter_from_request($r) { foreach ($r as $k=>$v) { //reinterpret v as a list of int $vl = explode(',', $v); $ok = 1; foreach($vl as $i) { if (!is_numeric($i)) { $ok = 0; break; } } if ($ok) if (sizeof($vl) == 1) self::set_filter($k, $vl[0]); else self::set_filter($k, $vl); } } } // browse