/** * getPlaylists * Get all playlists a user is allowed to play. * Takes optional user in parameter. */ public static function getplaylists($input) { self::check_version($input); $r = Subsonic_XML_Data::createSuccessResponse(); $username = $input['username']; // Don't allow playlist listing for another user if (empty($username) || $username == $GLOBALS['user']->username) { Subsonic_XML_Data::addPlaylists($r, Playlist::get_playlists(), Search::get_searches()); } else { $user = User::get_from_username($username); if ($user->id) { Subsonic_XML_Data::addPlaylists($r, Playlist::get_users($user->id)); } else { Subsonic_XML_Data::addPlaylists($r, array()); } } self::apiOutput($input, $r); }
*/ ?> <ul> <li> <a href="javascript:void(0);" id="rb_append_dplaylist_new" onclick="handlePlaylistAction('<?php echo AmpConfig::get('ajax_url') . '?page=playlist&action=append_item&item_type=' . $_REQUEST['item_type'] . '&item_id=' . $_REQUEST['item_id']; ?> ', 'rb_append_dplaylist_new');"> <?php echo T_('Add to New Playlist'); ?> </a> </li> <?php $playlists = Playlist::get_users($GLOBALS['user']->id); Playlist::build_cache($playlists); foreach ($playlists as $playlist_id) { $playlist = new Playlist($playlist_id); $playlist->format(); ?> <li> <a href="javascript:void(0);" id="rb_append_dplaylist_<?php echo $playlist->id; ?> " onclick="handlePlaylistAction('<?php echo AmpConfig::get('ajax_url') . '?page=playlist&action=append_item&playlist_id=' . $playlist->id . '&item_type=' . $_REQUEST['item_type'] . '&item_id=' . $_REQUEST['item_id']; ?> ', 'rb_append_dplaylist_<?php echo $playlist->id; ?>