diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-12-22 05:14:14 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-12-22 05:14:14 +0000 |
commit | be699cab75c8993175a4994316b9665105c86696 (patch) | |
tree | 596b557876c39104d9f2ccd614ec85f303205337 /lib/class/xmldata.class.php | |
parent | 7cbf829be1d29abf1ac4ef26a541d65e98538233 (diff) | |
download | ampache-be699cab75c8993175a4994316b9665105c86696.tar.gz ampache-be699cab75c8993175a4994316b9665105c86696.tar.bz2 ampache-be699cab75c8993175a4994316b9665105c86696.zip |
fixed opera playback, added playlist mojo to the xml api doodly, konqueror is still broken as is the API and XML-RPC stuff, also updated prototype.js
Diffstat (limited to 'lib/class/xmldata.class.php')
-rw-r--r-- | lib/class/xmldata.class.php | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/lib/class/xmldata.class.php b/lib/class/xmldata.class.php index ac776635..6d5baa26 100644 --- a/lib/class/xmldata.class.php +++ b/lib/class/xmldata.class.php @@ -207,6 +207,41 @@ class xmlData { } // genres /** + * playlists + * This takes an array of playlist ids and then returns a nice pretty XML document + */ + public static function playlists($playlists) { + + if (count($playlists) > self::$limit) { + $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" . + "</playlist>\n"; + + + } // end foreach + + // Build the final and then send her off + $final = self::_header() . $string . self::_footer(); + + return $final; + + } // playlists + + /** * songs * This returns an xml document from an array of song ids spiffy isn't it! */ |