root/trunk/democratic.php

Revision 1538, 2.3 kB (checked in by vollmerk, 8 months ago)

last commit before stable release, been a long hard road

Line 
1<?php
2/*
3
4 Copyright (c) Ampache.org
5 All rights reserved.
6
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License v2
9 as published by the Free Software Foundation.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
19
20*/
21
22require_once 'lib/init.php';
23
24/* Make sure they have access to this */
25if (!Config::get('allow_democratic_playback')) { 
26        access_denied(); 
27        exit;
28}
29
30show_header(); 
31
32// Switch on their action
33switch ($_REQUEST['action']) { 
34        case 'show_create': 
35                if (!Access::check('interface','75')) { 
36                        access_denied(); 
37                        break;
38                } 
39
40                // Show the create page
41                require_once Config::get('prefix') . '/templates/show_create_democratic.inc.php'; 
42        break; 
43        case 'delete': 
44                if (!Access::check('interface','75')) { 
45                        access_denied(); 
46                        break; 
47                } 
48       
49                Democratic::delete($_REQUEST['democratic_id']); 
50
51                $title = ''; 
52                $text = _('The Requested Playlist has been deleted.'); 
53                $url = Config::get('web_path') . '/democratic.php?action=manage_playlists'; 
54                show_confirmation($title,$text,$url); 
55        break; 
56        case 'create': 
57                // Only power users here
58                if (!Access::check('interface','75')) { 
59                        access_denied(); 
60                        break;
61                } 
62
63                // Create the playlist
64                Democratic::create($_POST); 
65                header("Location: " . Config::get('web_path') . "/democratic.php?action=manage_playlists");     
66        break; 
67        case 'manage_playlists': 
68                if (!Access::check('interface','75')) { 
69                        access_denied(); 
70                        break;
71                } 
72                // Get all of the non-user playlists
73                $playlists = Democratic::get_playlists(); 
74
75                require_once Config::get('prefix') . '/templates/show_manage_democratic.inc.php'; 
76
77        break;
78        case 'show_playlist': 
79        default: 
80                $democratic = Democratic::get_current_playlist(); 
81                $democratic->set_parent(); 
82                $objects = $democratic->get_items();
83                require_once Config::get('prefix') . '/templates/show_democratic.inc.php';
84        break;
85} // end switch on action
86
87show_footer(); 
88
89?>
Note: See TracBrowser for help on using the browser.