$map[$item['object_type']] = array(); } if (!in_array($item['object_id'], $map[$item['object_type']])) { $map[$item['object_type']][] = $item['object_id']; } else { $tracks_to_rm[] = $item['track_id']; } } foreach ($tracks_to_rm as $track_id) { $playlist->delete_track($track_id); } $object_ids = $playlist->get_items(); require_once AmpConfig::get('prefix') . UI::find_template('show_playlist.inc.php'); break; case 'sort_tracks': $playlist = new Playlist($_REQUEST['playlist_id']); if (!$playlist->has_access()) { access_denied(); break; } /* Sort the tracks */ $playlist->sort_tracks(); $object_ids = $playlist->get_items(); require_once AmpConfig::get('prefix') . UI::find_template('show_playlist.inc.php'); break; default: require_once AmpConfig::get('prefix') . UI::find_template('show_playlist.inc.php'); break; } // switch on the action UI::show_footer();