From 421805ce6ab1d3b2e0a16346c544eadf2d44f8be Mon Sep 17 00:00:00 2001 From: Karl 'vollmerk' Vollmer Date: Wed, 14 Nov 2007 06:44:50 +0000 Subject: fixed the playlist methods, they all work now... semi-bug where the rightbar does not refresh when the playlist is cleared so its not obvious it worked until a manual reload, will fix later --- lib/class/stream.class.php | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'lib/class/stream.class.php') diff --git a/lib/class/stream.class.php b/lib/class/stream.class.php index e274e78a..c661b351 100644 --- a/lib/class/stream.class.php +++ b/lib/class/stream.class.php @@ -627,6 +627,38 @@ class Stream { } // auto_init + /** + * run_playlist_method + * This takes care of the different types of 'playlist methods' the reason this is here + * is because it deals with streaming rather then playlist mojo. If something needs to happen + * this will echo the javascript required to cause a reload of the iframe. + */ + public static function run_playlist_method() { + + // If this wasn't ajax included run away + if (AJAX_INCLUDE != '1') { return false; } + + switch ($GLOBALS['user']->prefs['playlist_method']) { + default: + case 'clear': + case 'default': + return true; + break; + case 'send': + $_SESSION['iframe']['target'] = Config::get('web_path') . '/stream.php?action=basket'; + break; + case 'send_clear': + $_SESSION['iframe']['target'] = Config::get('web_path') . '/stream.php?action=basket&playlist_method=clear'; + break; + } // end switch on method + + // Load our javascript + echo ""; + + } // run_playlist_method + } //end of stream class ?> -- cgit