diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-11-24 21:16:13 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-11-24 21:16:13 +0000 |
commit | 27ba8110cab5b09220a110f0e2f3af026582c9fc (patch) | |
tree | d54b665062b1dab40deff47ca519eca1ee251db0 /server | |
parent | 3508380e994d80c6df1a287606a969c218d81694 (diff) | |
download | ampache-27ba8110cab5b09220a110f0e2f3af026582c9fc.tar.gz ampache-27ba8110cab5b09220a110f0e2f3af026582c9fc.tar.bz2 ampache-27ba8110cab5b09220a110f0e2f3af026582c9fc.zip |
democratic play working, if still slightly sketchy
Diffstat (limited to 'server')
-rw-r--r-- | server/ajax.server.php | 4 | ||||
-rw-r--r-- | server/democratic.ajax.php | 50 |
2 files changed, 54 insertions, 0 deletions
diff --git a/server/ajax.server.php b/server/ajax.server.php index 21b19f7a..4f9a954b 100644 --- a/server/ajax.server.php +++ b/server/ajax.server.php @@ -61,6 +61,10 @@ switch ($_REQUEST['page']) { require_once Config::get('prefix') . '/server/stream.ajax.php'; exit; break; + case 'democratic': + require_once Config::get('prefix') . '/server/democratic.ajax.php'; + exit; + break; default: // A taste of compatibility break; diff --git a/server/democratic.ajax.php b/server/democratic.ajax.php new file mode 100644 index 00000000..1bf2cdcb --- /dev/null +++ b/server/democratic.ajax.php @@ -0,0 +1,50 @@ +<?php +/* + + Copyright (c) 2001 - 2007 Ampache.org + All rights reserved. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License v2 + as published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ + +/** + * Sub-Ajax page, requires AJAX_INCLUDE as one + */ +if (AJAX_INCLUDE != '1') { exit; } + +switch ($_REQUEST['action']) { + case 'delete': + if (!$GLOBALS['user']->has_access('75')) { + exit; + } + + $democratic = Democratic::get_current_playlist(); + $democratic->delete_votes($_REQUEST['row_id']); + + ob_start(); + $objects = $democratic->get_items(); + require_once Config::get('prefix') . '/templates/show_democratic_playlist.inc.php'; + $results['democratic_playlist'] = ob_get_contents(); + ob_end_clean(); + + break; + default: + $results['rfc3514'] = '0x1'; + break; +} // switch on action; + +// We always do this +echo xml_from_array($results); +?> |