mirror of
https://github.com/Yetangitu/ampache
synced 2025-10-04 10:19:25 +02:00
Prompt for new playlist name
This commit is contained in:
parent
961c9c6a6b
commit
435500ee66
3 changed files with 13 additions and 2 deletions
|
@ -87,6 +87,14 @@ function handlePlaylistAction(url, id) {
|
|||
$("#playlistdialog").dialog("close");
|
||||
}
|
||||
|
||||
function createNewPlaylist(title, url, id) {
|
||||
var plname = window.prompt(title, '');
|
||||
if (plname != null) {
|
||||
url += '&name=' + plname;
|
||||
handlePlaylistAction(url, id);
|
||||
}
|
||||
}
|
||||
|
||||
/************************************************************/
|
||||
/* Dialog selection to start a broadcast */
|
||||
/************************************************************/
|
||||
|
|
|
@ -61,7 +61,10 @@ switch ($_REQUEST['action']) {
|
|||
break;
|
||||
}
|
||||
|
||||
$name = $_REQUEST['name'];
|
||||
if (empty($name)) {
|
||||
$name = $GLOBALS['user']->username . ' - ' . date("Y-m-d H:i:s",time());
|
||||
}
|
||||
$playlist_id = Playlist::create($name, 'private');
|
||||
if (!$playlist_id) {
|
||||
break;
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
<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=' . $object_type . '&item_id=' . $object_id; ?>', 'rb_append_dplaylist_new');">
|
||||
<a href="javascript:void(0);" id="rb_append_dplaylist_new" onclick="createNewPlaylist('<?php echo T_('Playlist name'); ?>', '<?php echo AmpConfig::get('ajax_url') . '?page=playlist&action=append_item&item_type=' . $object_type . '&item_id=' . $object_id; ?>', 'rb_append_dplaylist_new');">
|
||||
<?php echo T_('Add to New Playlist'); ?>
|
||||
</a>
|
||||
</li>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue