diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2009-03-15 22:46:28 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2009-03-15 22:46:28 +0000 |
commit | 1a475806e052e5c7d7115887002f98a3c2be500f (patch) | |
tree | 307290b1b1161ae72cb300469ca273a81d764214 /democratic.php | |
parent | 4979ca79f67ae1328c14b186617b8cca5ce5e364 (diff) | |
download | ampache-1a475806e052e5c7d7115887002f98a3c2be500f.tar.gz ampache-1a475806e052e5c7d7115887002f98a3c2be500f.tar.bz2 ampache-1a475806e052e5c7d7115887002f98a3c2be500f.zip |
fix democratic play interface feedback issues and make the wizard actually work
Diffstat (limited to 'democratic.php')
-rw-r--r-- | democratic.php | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/democratic.php b/democratic.php index 6bee39d5..eda7bf63 100644 --- a/democratic.php +++ b/democratic.php @@ -63,10 +63,25 @@ switch ($_REQUEST['action']) { access_denied(); break; } + + $democratic = Democratic::get_current_playlist(); - // Create the playlist - Democratic::create($_POST); - header("Location: " . Config::get('web_path') . "/democratic.php?action=manage_playlists"); + // If we don't have anything currently create something + if (!$democratic->id) { + // Create the playlist + Democratic::create($_POST); + $democratic = Democratic::get_current_playlist(); + } + else { + $democratic->update($_POST); + } + + // Now check for additional things we might have to do + if ($_POST['force_democratic']) { + Democratic::set_user_preferences(); + } + + header("Location: " . Config::get('web_path') . "/democratic.php?action=show"); break; case 'manage_playlists': if (!Access::check('interface','75')) { @@ -82,6 +97,11 @@ switch ($_REQUEST['action']) { case 'show_playlist': default: $democratic = Democratic::get_current_playlist(); + if (!$democratic->id) { + require_once Config::get('prefix') . '/templates/show_democratic.inc.php'; + break; + } + $democratic->set_parent(); $democratic->format(); require_once Config::get('prefix') . '/templates/show_democratic.inc.php'; |