Exemple #1
0
         $browse->set_start(0);
     }
     ob_start();
     $browse->show_objects(null, $argument);
     $results[$browse->get_content_div()] = ob_get_clean();
     break;
 case 'toggle_tag':
     $type = $_SESSION['tagcloud_type'] ? $_SESSION['tagcloud_type'] : 'song';
     $browse->set_type($type);
     break;
 case 'delete_object':
     switch ($_REQUEST['type']) {
         case 'playlist':
             // Check the perms we need to on this
             $playlist = new Playlist($_REQUEST['id']);
             if (!$playlist->has_access()) {
                 exit;
             }
             // Delete it!
             $playlist->delete();
             $key = 'playlist_row_' . $playlist->id;
             break;
         case 'smartplaylist':
             $playlist = new Search($_REQUEST['id'], 'song');
             if (!$playlist->has_access()) {
                 exit;
             }
             $playlist->delete();
             $key = 'smartplaylist_row_' . $playlist->id;
             break;
         case 'live_stream':
Exemple #2
0
 /**
  * playlist_remove_song
  * This remove a song from a playlist
  */
 public static function playlist_remove_song($input)
 {
     ob_end_clean();
     $playlist = new Playlist($input['filter']);
     $track = new Playlist($input['track']);
     if (!$playlist->has_access()) {
         echo XML_Data::error('401', T_('Access denied to this playlist.'));
     } else {
         $playlist->delete_track_number($track);
         echo XML_Data::single_string('success');
     }
 }