本文整理汇总了PHP中Playlist::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Playlist::delete方法的具体用法?PHP Playlist::delete怎么用?PHP Playlist::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Playlist
的用法示例。
在下文中一共展示了Playlist::delete方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: switch
$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':
if (!$GLOBALS['user']->has_access('75')) {
exit;
}
$radio = new Live_Stream($_REQUEST['id']);
示例2: deleteplaylist
/**
* deletePlaylist
* Delete a saved playlist.
* Takes playlist id in parameter.
*/
public static function deleteplaylist($input)
{
self::check_version($input, "1.2.0");
$playlistId = self::check_parameter($input, 'id');
if (Subsonic_XML_Data::isSmartPlaylist($playlistId)) {
$playlist = new Search(Subsonic_XML_Data::getAmpacheId($playlistId), 'song');
$playlist->delete();
} else {
$playlist = new Playlist(Subsonic_XML_Data::getAmpacheId($playlistId));
$playlist->delete();
}
$r = Subsonic_XML_Data::createSuccessResponse();
self::apiOutput($input, $r);
}
示例3: playlists
public static function playlists($params)
{
$r = Plex_XML_Data::createContainer();
$n = count($params);
$createMode = $_SERVER['REQUEST_METHOD'] == 'POST';
$editMode = $_SERVER['REQUEST_METHOD'] == 'PUT';
$delMode = $_SERVER['REQUEST_METHOD'] == 'DELETE';
if ($createMode || $editMode || $delMode) {
self::check_access(50);
}
if ($n <= 1) {
$plid = 0;
if ($n == 0 && $createMode) {
// Create a new playlist
//$type = $_GET['type'];
$title = $_GET['title'];
//$smart = $_GET['smart'];
//$summary = $_GET['summary'];
$uri = $_GET['uri'];
$plid = Playlist::create($title, 'public');
$playlist = new Playlist($plid);
$key = Plex_XML_Data::getKeyFromFullUri($uri);
$id = Plex_XML_Data::getKeyFromMetadataUri($key);
if ($id) {
$item = Plex_XML_Data::createLibraryItem($id);
$medias = $item->get_medias();
$playlist->add_medias($medias);
}
$plid = Plex_XML_Data::getPlaylistId($plid);
} else {
if ($n == 1 && $params[0] != "all") {
$plid = $params[0];
}
}
if ($plid) {
if (Plex_XML_Data::isPlaylist($plid)) {
$playlist = new Playlist(Plex_XML_Data::getAmpacheId($plid));
if ($playlist->id) {
if ($delMode) {
// Delete playlist
$playlist->delete();
} else {
// Display playlist information
Plex_XML_Data::addPlaylist($r, $playlist);
}
}
}
} else {
// List all playlists
Plex_XML_Data::setPlaylists($r);
}
} elseif ($n >= 2) {
$plid = $params[0];
if (Plex_XML_Data::isPlaylist($plid) && $params[1] == "items") {
$playlist = new Playlist(Plex_XML_Data::getAmpacheId($plid));
if ($playlist->id) {
if ($n == 2) {
if ($editMode) {
// Add a new item to playlist
$uri = $_GET['uri'];
$key = Plex_XML_Data::getKeyFromFullUri($uri);
$id = Plex_XML_Data::getKeyFromMetadataUri($key);
if ($id) {
$item = Plex_XML_Data::createLibraryItem($id);
$medias = $item->get_medias();
$playlist->add_medias($medias);
Plex_XML_Data::addPlaylist($r, $playlist);
}
} else {
Plex_XML_Data::setPlaylistItems($r, $playlist);
}
} elseif ($n == 3) {
$index = intval($params[2]);
if ($delMode) {
$playlist->delete_track_number($index);
$playlist->regenerate_track_numbers();
exit;
}
}
}
}
}
Plex_XML_Data::setContainerSize($r);
self::apiOutputXml($r->asXML());
}
示例4: action_delete_playlist
public function action_delete_playlist()
{
$user = $this->is_logged();
if ($user === false) {
return Redirect::to_action('login');
} else {
$playlist = new Playlist($_POST['id']);
$playlist->delete();
}
}
示例5: playlist_delete
/**
* playlist_delete
* This delete a playlist
*/
public static function playlist_delete($input)
{
ob_end_clean();
$playlist = new Playlist($input['filter']);
if (!$playlist->has_access()) {
echo XML_Data::error('401', T_('Access denied to this playlist.'));
} else {
$playlist->delete();
echo XML_Data::single_string('success');
}
}
示例6: deleteplaylist
/**
* deletePlaylist
* Delete a saved playlist.
* Takes playlist id in parameter.
*/
public static function deleteplaylist($input)
{
self::check_version($input, "1.2.0");
$playlistId = self::check_parameter($input, 'playlistId');
$playlist = new Playlist($playlistId);
$playlist->delete();
$r = Subsonic_XML_Data::createSuccessResponse();
self::apiOutput($input, $r);
}