require AmpConfig::get('prefix') . '/templates/show_song_row.inc.php'; break; case 'refresh_album': $album = new Album($_REQUEST['id']); $album->format(); require AmpConfig::get('prefix') . '/templates/show_album_row.inc.php'; break; case 'refresh_artist': $artist = new Artist($_REQUEST['id'], $_SESSION['catalog']); $artist->format(); require AmpConfig::get('prefix') . '/templates/show_artist_row.inc.php'; break; case 'refresh_playlist': $playlist = new Playlist($_REQUEST['id']); $playlist->format(); $count = $playlist->get_song_count(); require AmpConfig::get('prefix') . '/templates/show_playlist_row.inc.php'; break; case 'refresh_smartplaylist': $playlist = new Search('song', $_REQUEST['id']); $playlist->format(); require AmpConfig::get('prefix') . '/templates/show_smartplaylist_row.inc.php'; break; case 'refresh_livestream': $radio = new Radio($_REQUEST['id']); $radio->format(); require AmpConfig::get('prefix') . '/templates/show_live_stream_row.inc.php'; break; case 'refresh_channel': $channel = new Channel($_REQUEST['id']); $channel->format();
/** * playlists * * This takes an array of playlist ids and then returns a nice pretty XML document * * @param array $playlists (description here...) * @return string return xml */ public static function playlists($playlists) { if (count($playlists) > self::$limit or self::$offset > 0) { $playlists = array_slice($playlists, self::$offset, self::$limit); } $string = ''; // Foreach the playlist ids foreach ($playlists as $playlist_id) { $playlist = new Playlist($playlist_id); $playlist->format(); $item_total = $playlist->get_song_count(); // Build this element $string .= "<playlist id=\"{$playlist->id}\">\n" . "\t<name><![CDATA[{$playlist->name}]]></name>\n" . "\t<owner><![CDATA[{$playlist->f_user}]]></owner>\n" . "\t<items>{$item_total}</items>\n" . "\t<type>{$playlist->type}</type>\n" . "</playlist>\n"; } // end foreach // Build the final and then send her off $final = self::_header() . $string . self::_footer(); return $final; }