From 1a475806e052e5c7d7115887002f98a3c2be500f Mon Sep 17 00:00:00 2001 From: Karl 'vollmerk' Vollmer Date: Sun, 15 Mar 2009 22:46:28 +0000 Subject: fix democratic play interface feedback issues and make the wizard actually work --- democratic.php | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'democratic.php') 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'; -- cgit