summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xdocs/CHANGELOG2
-rw-r--r--lib/class/stream.class.php32
-rw-r--r--stream.php6
-rw-r--r--templates/rightbar.inc.php8
4 files changed, 42 insertions, 6 deletions
diff --git a/docs/CHANGELOG b/docs/CHANGELOG
index be94e802..aceeef4c 100755
--- a/docs/CHANGELOG
+++ b/docs/CHANGELOG
@@ -4,6 +4,8 @@
--------------------------------------------------------------------------
v.3.4-Alpha3
+ - Fixed all playlist methods, send, send and clear and clear on
+ send now work correctly
- Added single song view
- Added Play Select drop down back in
- Fixed ordering of catalogs
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
?>
diff --git a/stream.php b/stream.php
index 38b950fe..995367c1 100644
--- a/stream.php
+++ b/stream.php
@@ -76,6 +76,12 @@ switch ($_REQUEST['action']) {
} // end switch on type
} // end foreach
+ // Check to see if 'clear' was passed if it was then we need to reset the basket
+ // FIXME: We need to reload the rightbar when we do this... sigh...
+ if ($_REQUEST['playlist_method'] == 'clear' || $GLOBALS['user']->prefs['playlist_method'] == 'clear') {
+ $GLOBALS['user']->playlist->clear();
+ }
+
break;
/* This is run if we need to gather info based on a tmp playlist */
case 'tmp_playlist':
diff --git a/templates/rightbar.inc.php b/templates/rightbar.inc.php
index 155fd420..85d935c5 100644
--- a/templates/rightbar.inc.php
+++ b/templates/rightbar.inc.php
@@ -100,11 +100,7 @@
// We do a little magic here to force a iframe reload depending on preference
// We do this last because we want it to load, and we want to know if there is anything
// to even pass
-if ($GLOBALS['user']->prefs['playlist_method'] != 'default' AND AJAX_INCLUDE == '1' AND count($objects)) {
- // Set the target
- $_SESSION['iframe']['target'] = Config::get('web_path') . '/stream.php?action=basket';
- echo "<script type=\"text/javascript\">";
- echo "reload_util();";
- echo "</script>";
+if (count($objects)) {
+ Stream::run_playlist_method();
}
?>