prefs['localplay_level'] < 1) { access_denied(); exit(); } /* Scrub in the action */ $action = scrub_in($_REQUEST['action']); show_template('header'); switch ($action) { case 'delete_song': $song_id = scrub_in($_REQUEST['song_id']); $songs = array($song_id); $localplay = init_localplay(); $localplay->delete($songs); $url = $web_path . '/localplay.php'; $title = _('Song(s) Removed from Playlist'); $body = ''; show_confirmation($title,$body,$url); break; case 'delete_all': $localplay = init_localplay(); $localplay->delete_all(); $url = $web_path . '/localplay.php'; $title = _('Song(s) Remove from Playlist'); $body = ''; show_confirmation($title,$body,$url); break; case 'repeat': $localplay = init_localplay(); $localplay->repeat(make_bool($_REQUEST['value'])); require_once (conf('prefix') . '/templates/show_localplay.inc.php'); break; case 'random': $localplay = init_localplay(); $localplay->random(make_bool($_REQUEST['value'])); require_once (conf('prefix') . '/templates/show_localplay.inc.php'); break; default: if ($localplay = init_localplay()) { require_once (conf('prefix') . '/templates/show_localplay.inc.php'); } else { $GLOBALS['error']->add_error('general',_('Localplay Init Failed')); $GLOBALS['error']->print_error('general'); } break; } // end switch action show_footer(); ?>