diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-11-14 06:44:50 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-11-14 06:44:50 +0000 |
commit | 421805ce6ab1d3b2e0a16346c544eadf2d44f8be (patch) | |
tree | 61604c8fb8cc23f8cdd196e51c41b31f37c347ae | |
parent | cd935ce9508fac75637cac57c3d7855e1f3f754a (diff) | |
download | ampache-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
-rwxr-xr-x | docs/CHANGELOG | 2 | ||||
-rw-r--r-- | lib/class/stream.class.php | 32 | ||||
-rw-r--r-- | stream.php | 6 | ||||
-rw-r--r-- | templates/rightbar.inc.php | 8 |
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 ?> @@ -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(); } ?> |