summaryrefslogtreecommitdiffstats
path: root/lib/class/stream.class.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-11-14 06:44:50 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-11-14 06:44:50 +0000
commit421805ce6ab1d3b2e0a16346c544eadf2d44f8be (patch)
tree61604c8fb8cc23f8cdd196e51c41b31f37c347ae /lib/class/stream.class.php
parentcd935ce9508fac75637cac57c3d7855e1f3f754a (diff)
downloadampache-421805ce6ab1d3b2e0a16346c544eadf2d44f8be.tar.gz
ampache-421805ce6ab1d3b2e0a16346c544eadf2d44f8be.tar.bz2
ampache-421805ce6ab1d3b2e0a16346c544eadf2d44f8be.zip
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
Diffstat (limited to 'lib/class/stream.class.php')
-rw-r--r--lib/class/stream.class.php32
1 files changed, 32 insertions, 0 deletions
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 "<script type=\"text/javascript\">";
+ echo "reload_util();";
+ echo "</script>";
+
+ } // run_playlist_method
+
} //end of stream class
?>