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 | |
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')
-rw-r--r-- | lib/class/xmldata.class.php | 35 | ||||
-rw-r--r-- | lib/javascript-base.js | 48 |
2 files changed, 46 insertions, 37 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! */ diff --git a/lib/javascript-base.js b/lib/javascript-base.js index 9742f54d..0e9296ba 100644 --- a/lib/javascript-base.js +++ b/lib/javascript-base.js @@ -44,42 +44,6 @@ function selectField(element) element_id.focus(); } -var checkflag = "false"; - -function check_select(type,name) { - if ( name == undefined){ - var name = ''; - } - if ( checkflag == "false") { - if ( eval("document.forms."+ type +"s"+ name +".elements[\""+ type +"[]\"].length") == undefined) { - var zz = eval("document.forms."+ type +"s"+ name +".elements[\""+ type +"[]\"]"); - zz.checked = true; - } - else { - for (i = 0; i < eval("document.forms."+ type +"s"+ name +".elements[\""+ type +"[]\"].length"); i++) { - var zz = eval("document.forms."+ type +"s"+ name +".elements[\""+ type +"[]\"][i]"); - zz.checked = true; - } - } - checkflag = "true"; - return "Unselect All"; - } - else { - if ( eval("document.forms."+ type +"s"+ name +".elements[\""+ type +"[]\"].length") == undefined) { - var zz = eval("document.forms."+ type +"s"+ name +".elements[\""+ type +"[]\"]"); - zz.checked = false; - } - else { - for (i = 0; i < eval("document.forms."+ type +"s"+ name +".elements[\""+ type +"[]\"].length"); i++) { - var zz = eval("document.forms."+ type +"s"+ name +".elements[\""+ type +"[]\"][i]"); - zz.checked = false; - } - } - checkflag = "false"; - return "Select All"; - } -} - // function for the catalog mojo fluf function update_txt(value,field) { document.getElementById(field).innerHTML=value; @@ -89,7 +53,17 @@ function update_txt(value,field) { // IE issue fixed by Spocky, we have to use the iframe for Democratic Play & Localplay // which don't actually prompt for a new file function reload_util(target) { - document.getElementById('util_iframe').src = document.getElementById('util_iframe').src; + + if (navigator.appName == 'Opera') { + document.getElementById('util_iframe').contentWindow.location.reload(true); + } + else if (navigator.appName == 'Konqueror') { + alert(document.getElementById('util_iframe').location.url); + document.getElementById('util_iframe').location.url = document.getElementById('util_iframe').location.url + } + else { + document.getElementById('util_iframe').src = document.getElementById('util_iframe').src; + } } // Log them out |