當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Playlist::delete方法代碼示例

本文整理匯總了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']);
開發者ID:nioc,項目名稱:ampache,代碼行數:31,代碼來源:browse.ajax.php

示例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);
 }
開發者ID:bl00m,項目名稱:ampache,代碼行數:19,代碼來源:subsonic_api.class.php

示例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());
 }
開發者ID:cheese1,項目名稱:ampache,代碼行數:85,代碼來源:plex_api.class.php

示例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();
     }
 }
開發者ID:laiello,項目名稱:atm-music,代碼行數:10,代碼來源:playlist.php

示例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');
     }
 }
開發者ID:axelsimon,項目名稱:ampache,代碼行數:15,代碼來源:api.class.php

示例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);
 }
開發者ID:axelsimon,項目名稱:ampache,代碼行數:14,代碼來源:subsonic_api.class.php


注:本文中的Playlist::delete方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。