mirror of
https://github.com/Yetangitu/ampache
synced 2025-10-05 02:39:47 +02:00
parent
470dcea5b3
commit
7a337edcad
22 changed files with 378 additions and 363 deletions
|
@ -570,8 +570,7 @@ class Tag extends database_object
|
|||
*/
|
||||
public static function filter_with_prefs($l)
|
||||
{
|
||||
$colors = array('#0000FF',
|
||||
'#00FF00', '#FFFF00', '#00FFFF','#FF00FF','#FF0000');
|
||||
$colors = array('#0000FF','#00FF00', '#FFFF00', '#00FFFF','#FF00FF','#FF0000');
|
||||
$prefs = 'tag company';
|
||||
|
||||
$ulist = explode(' ', $prefs);
|
||||
|
@ -661,7 +660,7 @@ class Tag extends database_object
|
|||
*/
|
||||
public static function clean_tag($value)
|
||||
{
|
||||
$tag = preg_replace("/[^\w\_\-\s\&]/","",$value);
|
||||
$tag = preg_replace("/[^\w\_\-\s\&]/u", "", $value);
|
||||
|
||||
return $tag;
|
||||
|
||||
|
|
|
@ -18,81 +18,61 @@
|
|||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
//
|
||||
|
||||
|
||||
/************************************************************/
|
||||
/* Dialog selection to add song to an existing/new playlist */
|
||||
/************************************************************/
|
||||
|
||||
function showPlaylistDialog(item_type, item_id) {
|
||||
/*var parent = this;
|
||||
parent.songId = song_id;
|
||||
var closeplaylist;
|
||||
function showPlaylistDialog(e, item_type, item_id) {
|
||||
closePlaylistDialog();
|
||||
|
||||
parent.dialog_buttons = {};
|
||||
this.dialog_buttons[jsSaveTitle] = function() {
|
||||
$.ajax({
|
||||
url : parent.saveUrl,
|
||||
type : 'POST',
|
||||
data : $(parent.editFormId).serializeArray(),
|
||||
success : function(resp){
|
||||
var new_id = $.trim(resp.lastChild.textContent);
|
||||
$("#editdialog").dialog("close");
|
||||
|
||||
// resp should contain the new identifier, otherwise we take the same as the edited item
|
||||
if (new_id == '') {
|
||||
new_id = parent.editId;
|
||||
}
|
||||
|
||||
var url = jsAjaxServer + '/refresh_updated.server.php?action=' + parent.refreshAction + '&id=' + new_id;
|
||||
// Reload only table
|
||||
$('#' + parent.refreshRowPrefix + parent.editId).load(url, function() {
|
||||
// Update the current row identifier with new id
|
||||
$('#' + parent.refreshRowPrefix + parent.editId).attr("id", parent.refreshRowPrefix + new_id);
|
||||
});
|
||||
},
|
||||
error : function(resp){
|
||||
$("#editdialog").dialog("close");
|
||||
}
|
||||
});
|
||||
}
|
||||
this.dialog_buttons[jsCancelTitle] = function() {
|
||||
$("#editdialog").dialog("close");
|
||||
}
|
||||
var parent = this;
|
||||
parent.itemType = item_type;
|
||||
parent.itemId = item_id;
|
||||
parent.contentUrl = jsAjaxServer + '/show_edit_playlist.server.php?action=show_edit_object&item_type=' + item_type + '&item_id=' + item_id;
|
||||
parent.editDialogId = '<div id="playlistdialog"></div>';
|
||||
|
||||
$(parent.editDialogId).dialog({
|
||||
title: edit_title,
|
||||
modal: true,
|
||||
dialogClass: 'editdialogstyle',
|
||||
modal: false,
|
||||
dialogClass: 'playlistdialogstyle',
|
||||
resizable: false,
|
||||
width: 600,
|
||||
draggable: false,
|
||||
width: 300,
|
||||
height: 100,
|
||||
autoOpen: false,
|
||||
open: function () {
|
||||
closeplaylist = 1;
|
||||
$(document).bind('click', overlayclickclose);
|
||||
$(this).load(parent.contentUrl, function() {
|
||||
$(this).dialog('option', 'position', 'center');
|
||||
|
||||
if ($('#edit_tags').length > 0) {
|
||||
$("#edit_tags").tagit({
|
||||
allowSpaces: true,
|
||||
singleField: true,
|
||||
singleFieldDelimiter: ',',
|
||||
availableTags: parent.editTagChoices
|
||||
});
|
||||
}
|
||||
$('#playlistdialog').focus();
|
||||
});
|
||||
},
|
||||
focus: function() {
|
||||
closeplaylist = 0;
|
||||
},
|
||||
close: function (e) {
|
||||
$(document).unbind('click');
|
||||
$(this).empty();
|
||||
$(this).dialog("destroy");
|
||||
},
|
||||
buttons: dialog_buttons
|
||||
}
|
||||
});
|
||||
|
||||
$("#editdialog").dialog("open");*/
|
||||
$("#playlistdialog").dialog("option", "position", [e.clientX + 10, e.clientY]);
|
||||
$("#playlistdialog").dialog("open");
|
||||
closeplaylist = 0;
|
||||
}
|
||||
|
||||
function overlayclickclose() {
|
||||
if (closeplaylist) {
|
||||
$('#playlistdialog').dialog('close');
|
||||
}
|
||||
closeplaylist = 1;
|
||||
}
|
||||
|
||||
function closePlaylistDialog() {
|
||||
$("#playlistdialog").dialog("close");
|
||||
return false;
|
||||
}
|
||||
/*
|
||||
$(window).resize(function() {
|
||||
$("#editdialog").dialog("option", "position", ['center', 'center']);
|
||||
});
|
||||
*/
|
||||
|
||||
/***************************************************/
|
||||
/* Edit modal dialog for artists, albums and songs */
|
||||
|
@ -156,6 +136,7 @@ function showEditDialog(edit_type, edit_id, edit_form_id, edit_title, edit_tag_c
|
|||
resizable: false,
|
||||
width: 600,
|
||||
autoOpen: false,
|
||||
show: { effect: "fade", duration: 400 },
|
||||
open: function () {
|
||||
$(this).load(parent.contentUrl, function() {
|
||||
$(this).dialog('option', 'position', 'center');
|
||||
|
|
|
@ -30,7 +30,6 @@ if (!AmpConfig::get('allow_localplay_playback') || !Access::check('interface','2
|
|||
exit;
|
||||
}
|
||||
|
||||
|
||||
switch ($_REQUEST['action']) {
|
||||
case 'show_add_instance':
|
||||
// This requires 50 or better
|
||||
|
@ -82,11 +81,6 @@ switch ($_REQUEST['action']) {
|
|||
// Pull the current playlist and require the template
|
||||
$objects = $localplay->get();
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_localplay_status.inc.php';
|
||||
$browse = new Browse();
|
||||
$browse->set_type('playlist_localplay');
|
||||
$browse->set_static_content(true);
|
||||
$browse->show_objects($objects);
|
||||
$browse->store();
|
||||
break;
|
||||
} // end switch action
|
||||
|
||||
|
|
|
@ -145,7 +145,7 @@ switch ($_REQUEST['action']) {
|
|||
}
|
||||
|
||||
$playlist = new Playlist($_REQUEST['playlist_id']);
|
||||
$playlist->add_songs(array($_REQUEST['song_id']));
|
||||
$playlist->add_songs(array($_REQUEST['song_id']), 'ORDERED');
|
||||
break;
|
||||
case 'prune_empty':
|
||||
if (!$GLOBALS['user']->has_access(100)) {
|
||||
|
|
|
@ -45,78 +45,101 @@ switch ($_REQUEST['action']) {
|
|||
|
||||
$results['browse_content'] = ob_get_clean();
|
||||
break;
|
||||
case 'create':
|
||||
case 'append_item':
|
||||
// Only song item are supported with playlists
|
||||
|
||||
debug_event('playlist', 'Appending items to playlist {'.$_REQUEST['playlist_id'].'}...', '5');
|
||||
|
||||
if (!isset($_REQUEST['playlist_id']) || empty($_REQUEST['playlist_id'])) {
|
||||
if (!Access::check('interface','25')) {
|
||||
debug_event('DENIED','Error:' . $GLOBALS['user']->username . ' does not have user access, unable to create playlist','1');
|
||||
break;
|
||||
}
|
||||
|
||||
// Pull the current active playlist items
|
||||
$objects = $GLOBALS['user']->playlist->get_items();
|
||||
|
||||
$name = $GLOBALS['user']->username . ' - ' . date("Y-m-d H:i:s",time());
|
||||
|
||||
// generate the new playlist
|
||||
$playlist_id = Playlist::create($name,'public');
|
||||
if (!$playlist_id) { break; }
|
||||
$playlist = new Playlist($playlist_id);
|
||||
|
||||
// Iterate through and add them to our new playlist
|
||||
foreach ($objects as $object_data) {
|
||||
// For now only allow songs on here, we'll change this later
|
||||
$type = array_shift($object_data);
|
||||
if ($type == 'song') {
|
||||
$songs[] = array_shift($object_data);
|
||||
}
|
||||
} // object_data
|
||||
|
||||
// Add our new songs
|
||||
$playlist->add_songs($songs, 'ORDERED');
|
||||
$playlist->format();
|
||||
$object_ids = $playlist->get_items();
|
||||
ob_start();
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_playlist.inc.php';
|
||||
$results['content'] = ob_get_clean();
|
||||
if (!$playlist_id) {
|
||||
break;
|
||||
case 'append':
|
||||
// Pull the current active playlist items
|
||||
$objects = $GLOBALS['user']->playlist->get_items();
|
||||
|
||||
// Create the playlist object
|
||||
}
|
||||
$playlist = new Playlist($playlist_id);
|
||||
} else {
|
||||
$playlist = new Playlist($_REQUEST['playlist_id']);
|
||||
}
|
||||
|
||||
// We need to make sure that they have access
|
||||
if (!$playlist->has_access()) {
|
||||
break;
|
||||
}
|
||||
|
||||
$songs = array();
|
||||
$item_id = $_REQUEST['item_id'];
|
||||
|
||||
// Iterate through and add them to our new playlist
|
||||
switch ($_REQUEST['item_type']) {
|
||||
case 'smartplaylist':
|
||||
$smartplaylist = new Search('song', $item_id);
|
||||
$items = $playlist->get_items();
|
||||
foreach ($items as $item) {
|
||||
$songs[] = $item['object_id'];
|
||||
}
|
||||
break;
|
||||
case 'album_preview':
|
||||
$preview_songs = Song_preview::get_song_previews($item_id);
|
||||
foreach ($preview_songs as $song) {
|
||||
if (!empty($song->file)) {
|
||||
$songs[] = $song->id;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'album':
|
||||
debug_event('playlist', 'Adding all songs of album {'.$item_id.'}...', '5');
|
||||
$album = new Album($item_id);
|
||||
$songs = $album->get_songs();
|
||||
foreach ($songs as $song_id) {
|
||||
$songs[] = $song_id;
|
||||
}
|
||||
break;
|
||||
case 'artist':
|
||||
debug_event('playlist', 'Adding all songs of artist {'.$item_id.'}...', '5');
|
||||
$artist = new Artist($item_id);
|
||||
$songs = $artist->get_songs();
|
||||
foreach ($songs as $song_id) {
|
||||
$songs[] = $song_id;
|
||||
}
|
||||
break;
|
||||
case 'song_preview':
|
||||
case 'song':
|
||||
debug_event('playlist', 'Adding song {'.$item_id.'}...', '5');
|
||||
$songs[] = $item_id;
|
||||
break;
|
||||
default:
|
||||
debug_event('playlist', 'Adding all songs of current playlist...', '5');
|
||||
$objects = $GLOBALS['user']->playlist->get_items();
|
||||
foreach ($objects as $object_data) {
|
||||
// For now only allow songs on here, we'll change this later
|
||||
$type = array_shift($object_data);
|
||||
if ($type == 'song') {
|
||||
$songs[] = array_shift($object_data);
|
||||
}
|
||||
} // object_data
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// Override normal include procedure
|
||||
if (count($songs) > 0) {
|
||||
Ajax::set_include_override(true);
|
||||
|
||||
// Add our new songs
|
||||
$playlist->add_songs($songs, 'ORDERED');
|
||||
$playlist->format();
|
||||
|
||||
/*$playlist->format();
|
||||
$object_ids = $playlist->get_items();
|
||||
ob_start();
|
||||
require_once AmpConfig::get('prefix') . '/templates/show_playlist.inc.php';
|
||||
$results['content'] = ob_get_contents();
|
||||
ob_end_clean();
|
||||
ob_end_clean();*/
|
||||
debug_event('playlist', 'Items added successfully!', '5');
|
||||
} else {
|
||||
debug_event('playlist', 'No item to add. Aborting...', '5');
|
||||
}
|
||||
break;
|
||||
default:
|
||||
$results['rfc3514'] = '0x1';
|
||||
break;
|
||||
} // switch on action;
|
||||
}
|
||||
|
||||
// We always do this
|
||||
echo xoutput_from_array($results);
|
||||
|
|
46
server/show_edit_playlist.server.php
Normal file
46
server/show_edit_playlist.server.php
Normal file
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
/* vim:set softtabstop=4 shiftwidth=4 expandtab: */
|
||||
/**
|
||||
*
|
||||
* LICENSE: GNU General Public License, version 2 (GPLv2)
|
||||
* Copyright 2001 - 2013 Ampache.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License v2
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
/* Because this is accessed via Ajax we are going to allow the session_id
|
||||
* as part of the get request
|
||||
*/
|
||||
|
||||
define('AJAX_INCLUDE','1');
|
||||
|
||||
require_once '../lib/init.php';
|
||||
|
||||
$results = '';
|
||||
|
||||
debug_event('show_edit_playlist.server.php', 'Called.', '5');
|
||||
|
||||
switch ($_REQUEST['action']) {
|
||||
case 'show_edit_object':
|
||||
ob_start();
|
||||
require AmpConfig::get('prefix') . '/templates/show_playlists_dialog.inc.php';
|
||||
$results = ob_get_contents();
|
||||
ob_end_clean();
|
||||
break;
|
||||
default:
|
||||
exit();
|
||||
}
|
||||
|
||||
echo $results;
|
|
@ -22,13 +22,13 @@
|
|||
?>
|
||||
<ul id="rb_action">
|
||||
<li>
|
||||
<?php echo Ajax::button('?page=stream&action=basket','all', T_('Play'),'rightbar_play'); ?>
|
||||
<?php echo Ajax::button('?page=stream&action=basket','all', T_('Play'), 'rightbar_play'); ?>
|
||||
</li>
|
||||
<li id="pl_add">
|
||||
<?php echo UI::get_icon('playlist_add', T_('Add to Playlist')); ?>
|
||||
<ul id="pl_action_additems" class="submenu">
|
||||
<li>
|
||||
<?php echo Ajax::text('?page=playlist&action=create', T_('Add to New Playlist'),'rb_create_playlist'); ?>
|
||||
<?php echo Ajax::text('?page=playlist&action=append_item', T_('Add to New Playlist'), 'rb_create_playlist'); ?>
|
||||
</li>
|
||||
<?php
|
||||
$playlists = Playlist::get_users($GLOBALS['user']->id);
|
||||
|
@ -38,7 +38,7 @@
|
|||
$playlist->format();
|
||||
?>
|
||||
<li>
|
||||
<?php echo Ajax::text('?page=playlist&action=append&playlist_id=' . $playlist->id, $playlist->f_name, 'rb_append_playlist_' . $playlist->id); ?>
|
||||
<?php echo Ajax::text('?page=playlist&action=append_item&playlist_id='. $playlist->id, $playlist->f_name, 'rb_append_playlist_'.$playlist->id); ?>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
|
|
|
@ -61,8 +61,8 @@ if (AmpConfig::get('show_played_times')) {
|
|||
}
|
||||
?>
|
||||
<div id="information_actions">
|
||||
<h3><?php echo T_('Actions'); ?>:</h3>
|
||||
<ul>
|
||||
<h3><?php echo T_('Actions'); ?>:</h3>
|
||||
<ul>
|
||||
<?php if (AmpConfig::get('directplay')) { ?>
|
||||
<li>
|
||||
<?php echo Ajax::button('?page=stream&action=directplay&playtype=album&album_id=' . $album->id,'play', T_('Play album'),'directplay_full_' . $album->id); ?>
|
||||
|
@ -122,7 +122,7 @@ if (AmpConfig::get('show_played_times')) {
|
|||
<a href="<?php echo $web_path; ?>/batch.php?action=album&id=<?php echo $album->id; ?>"><?php echo T_('Download'); ?></a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</ul>
|
||||
</div>
|
||||
<?php UI::show_box_bottom(); ?>
|
||||
<div id="additional_information">
|
||||
|
|
|
@ -46,7 +46,7 @@ if (Art::is_enabled()) {
|
|||
<span class="cel_item_add">
|
||||
<?php echo Ajax::button('?action=basket&type=album&id=' . $album->id,'add', T_('Add to temporary playlist'),'add_album_' . $album->id); ?>
|
||||
<?php echo Ajax::button('?action=basket&type=album_random&id=' . $album->id,'random', T_('Random to temporary playlist'),'random_album_' . $album->id); ?>
|
||||
<a id="<?php echo 'add_playlist_'.$album->id ?>" onclick="showPlaylistDialog('album', '<?php echo $album->id ?>')">
|
||||
<a id="<?php echo 'add_playlist_'.$album->id ?>" onclick="showPlaylistDialog(event, 'album', '<?php echo $album->id ?>')">
|
||||
<?php echo UI::get_icon('playlist_add', T_('Add to existing playlist')); ?>
|
||||
</a>
|
||||
</span>
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
<span class="cel_item_add">
|
||||
<?php echo Ajax::button('?action=basket&type=artist&id=' . $artist->id,'add', T_('Add to temporary playlist'),'add_artist_' . $artist->id); ?>
|
||||
<?php echo Ajax::button('?action=basket&type=artist_random&id=' . $artist->id,'random', T_('Random to temporary playlist'),'random_artist_' . $artist->id); ?>
|
||||
<a id="<?php echo 'add_playlist_'.$artist->id ?>" onclick="showPlaylistDialog('artist', '<?php echo $artist->id ?>')">
|
||||
<a id="<?php echo 'add_playlist_'.$artist->id ?>" onclick="showPlaylistDialog(event, 'artist', '<?php echo $artist->id ?>')">
|
||||
<?php echo UI::get_icon('playlist_add', T_('Add to existing playlist')); ?>
|
||||
</a>
|
||||
</span>
|
||||
|
|
|
@ -32,9 +32,6 @@
|
|||
<td class="cel_add">
|
||||
<span class="cel_item_add">
|
||||
<?php echo Ajax::button('?action=basket&type=live_stream&id=' . $radio->id,'add', T_('Add to temporary playlist'),'add_radio_' . $radio->id); ?>
|
||||
<a id="<?php echo 'add_playlist_'.$radio->id ?>" onclick="showPlaylistDialog('radio', '<?php echo $radio->id ?>')">
|
||||
<?php echo UI::get_icon('playlist_add', T_('Add to existing playlist')); ?>
|
||||
</a>
|
||||
</span>
|
||||
</td>
|
||||
<td class="cel_streamurl"><?php echo $radio->f_url_link; ?></td>
|
||||
|
|
|
@ -27,27 +27,35 @@ $now_playing = $status['track_title'] ? $status['track_title'] . ' - ' . $status
|
|||
<?php UI::show_box_top(T_('Localplay Control') . ' - '. strtoupper($localplay->type), 'box box_localplay_status'); ?>
|
||||
<?php echo T_('Now Playing'); ?>:<i><?php echo $now_playing; ?></i>
|
||||
<div id="information_actions">
|
||||
<ul>
|
||||
<li>
|
||||
<?php echo Ajax::button('?page=localplay&action=command&command=volume_mute','volumemute', T_('Mute'),'localplay_mute'); ?>
|
||||
<?php echo Ajax::button('?page=localplay&action=command&command=volume_down','volumedn', T_('Decrease Volume'),'localplay_volume_dn'); ?>
|
||||
<?php echo Ajax::button('?page=localplay&action=command&command=volume_up','volumeup', T_('Increase Volume'),'localplay_volume_up'); ?>
|
||||
<?php echo T_('Volume'); ?>:<?php echo $status['volume']; ?>%
|
||||
</li>
|
||||
<li>
|
||||
<ul>
|
||||
<li>
|
||||
<?php echo Ajax::button('?page=localplay&action=command&command=volume_mute','volumemute', T_('Mute'),'localplay_mute'); ?>
|
||||
<?php echo Ajax::button('?page=localplay&action=command&command=volume_down','volumedn', T_('Decrease Volume'),'localplay_volume_dn'); ?>
|
||||
<?php echo Ajax::button('?page=localplay&action=command&command=volume_up','volumeup', T_('Increase Volume'),'localplay_volume_up'); ?>
|
||||
<?php echo T_('Volume'); ?>:<?php echo $status['volume']; ?>%
|
||||
</li>
|
||||
<li>
|
||||
<?php echo print_bool($status['repeat']); ?> |
|
||||
<?php echo Ajax::text('?page=localplay&action=repeat&value=' . invert_bool($status['repeat']), print_bool(invert_bool($status['repeat'])), 'localplay_repeat'); ?>
|
||||
<?php echo T_('Repeat'); ?>
|
||||
</li>
|
||||
<li>
|
||||
</li>
|
||||
<li>
|
||||
<?php echo print_bool($status['random']); ?> |
|
||||
<?php echo Ajax::text('?page=localplay&action=random&value=' . invert_bool($status['random']), print_bool(invert_bool($status['random'])), 'localplay_random'); ?>
|
||||
<?php echo T_('Random'); ?>
|
||||
</li>
|
||||
<li>
|
||||
</li>
|
||||
<li>
|
||||
<?php echo Ajax::button('?page=localplay&action=command&command=delete_all','delete', T_('Clear Playlist'),'localplay_clear_all'); ?><?php echo T_('Clear Playlist'); ?>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$browse = new Browse();
|
||||
$browse->set_type('playlist_localplay');
|
||||
$browse->set_static_content(true);
|
||||
$browse->show_objects($objects);
|
||||
$browse->store();
|
||||
?>
|
||||
<?php UI::show_box_bottom(); ?>
|
||||
<?php Ajax::end_container(); ?>
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
<span class="cel_item_add">
|
||||
<?php echo Ajax::button('?action=basket&type=playlist&id=' . $playlist->id,'add', T_('Add to temporary playlist'),'add_playlist_' . $playlist->id); ?>
|
||||
<?php echo Ajax::button('?action=basket&type=playlist_random&id=' . $playlist->id,'random', T_('Random to temporary playlist'),'random_playlist_' . $playlist->id); ?>
|
||||
<a id="<?php echo 'add_playlist_'.$playlist->id ?>" onclick="showPlaylistDialog('playlist', '<?php echo $playlist->id ?>')">
|
||||
<a id="<?php echo 'add_playlist_'.$playlist->id ?>" onclick="showPlaylistDialog(event, 'playlist', '<?php echo $playlist->id ?>')">
|
||||
<?php echo UI::get_icon('playlist_add', T_('Add to existing playlist')); ?>
|
||||
</a>
|
||||
</span>
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
<td class="cel_add">
|
||||
<span class="cel_item_add">
|
||||
<?php echo Ajax::button('?action=basket&type=song&id=' . $song->id,'add', T_('Add to temporary playlist'),'playlist_add_' . $song->id); ?>
|
||||
<a id="<?php echo 'add_playlist_'.$song->id ?>" onclick="showPlaylistDialog('song', '<?php echo $song->id ?>')">
|
||||
<a id="<?php echo 'add_playlist_'.$song->id ?>" onclick="showPlaylistDialog(event, 'song', '<?php echo $song->id ?>')">
|
||||
<?php echo UI::get_icon('playlist_add', T_('Add to existing playlist')); ?>
|
||||
</a>
|
||||
</span>
|
||||
|
|
43
templates/show_playlists_dialog.inc.php
Normal file
43
templates/show_playlists_dialog.inc.php
Normal file
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
/* vim:set softtabstop=4 shiftwidth=4 expandtab: */
|
||||
/**
|
||||
*
|
||||
* LICENSE: GNU General Public License, version 2 (GPLv2)
|
||||
* Copyright 2001 - 2013 Ampache.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License v2
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
?>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<a href="<?php echo AmpConfig::get('ajax_url').'?page=playlist&action=append_item&item_type='.$_REQUEST['item_type'].'&item_id='.$_REQUEST['item_id']; ?>" onclick="return closePlaylistDialog();">
|
||||
<?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="<?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']; ?>" onclick="return closePlaylistDialog();">
|
||||
<?php echo $playlist->f_name; ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ul>
|
|
@ -100,7 +100,7 @@ UI::show_box_top(T_('Recently Played') . $link, 'box box_recently_played');
|
|||
<td class="cel_add">
|
||||
<span class="cel_item_add">
|
||||
<?php echo Ajax::button('?action=basket&type=song&id='.$song->id, 'add', T_('Add to temporary playlist'), 'add_'.$song->id); ?>
|
||||
<a id="<?php echo 'add_playlist_'.$song->id ?>" onclick="showPlaylistDialog('song', '<?php echo $song->id ?>')">
|
||||
<a id="<?php echo 'add_playlist_'.$song->id ?>" onclick="showPlaylistDialog(event, 'song', '<?php echo $song->id ?>')">
|
||||
<?php echo UI::get_icon('playlist_add', T_('Add to existing playlist')); ?>
|
||||
</a>
|
||||
</span>
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
<td class="cel_add">
|
||||
<span class="cel_item_add">
|
||||
<?php echo Ajax::button('?action=basket&type=smartplaylist&id=' . $playlist->id,'add', T_('Add to temporary playlist'),'add_playlist_' . $playlist->id); ?>
|
||||
<a id="<?php echo 'add_playlist_'.$playlist->id ?>" onclick="showPlaylistDialog('smartplaylist', '<?php echo $playlist->id ?>')">
|
||||
<a id="<?php echo 'add_playlist_'.$playlist->id ?>" onclick="showPlaylistDialog(event, 'smartplaylist', '<?php echo $playlist->id ?>')">
|
||||
<?php echo UI::get_icon('playlist_add', T_('Add to existing playlist')); ?>
|
||||
</a>
|
||||
</span>
|
||||
|
|
|
@ -22,15 +22,12 @@
|
|||
?>
|
||||
<?php if (AmpConfig::get('echonest_api_key')) { ?>
|
||||
<td class="cel_play">
|
||||
<span class="cel_play_content"> </span>
|
||||
<div class="cel_play_hover">
|
||||
<?php if (AmpConfig::get('directplay') && !empty($song->file)) { ?>
|
||||
<?php echo Ajax::button('?page=stream&action=directplay&playtype=song_preview&id=' . $song->id,'play_preview', T_('Play song Preview'),'play_song_' . $song->id); ?>
|
||||
<?php if (Stream_Playlist::check_autoplay_append()) { ?>
|
||||
<?php echo Ajax::button('?page=stream&action=directplay&playtype=song_preview&id=' . $song->id . '&append=true','play_add_preview', T_('Play Add Song Preview'),'addplay_song_' . $song->id); ?>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</td>
|
||||
<?php } ?>
|
||||
<td class="cel_song"><?php echo $song->title; ?></td>
|
||||
|
@ -39,7 +36,7 @@
|
|||
<span class="cel_item_add">
|
||||
<?php if (!empty($song->file)) { ?>
|
||||
<?php echo Ajax::button('?action=basket&type=song_preview&id=' . $song->id,'add', T_('Add to temporary playlist'),'add_' . $song->id); ?>
|
||||
<a id="<?php echo 'add_playlist_'.$song->id ?>" onclick="showPlaylistDialog('song_preview', '<?php echo $song->id ?>')">
|
||||
<a id="<?php echo 'add_playlist_'.$song->id ?>" onclick="showPlaylistDialog(event, 'song_preview', '<?php echo $song->id ?>')">
|
||||
<?php echo UI::get_icon('playlist_add', T_('Add to existing playlist')); ?>
|
||||
</a>
|
||||
<?php } ?>
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
<td class="cel_add">
|
||||
<span class="cel_item_add">
|
||||
<?php echo Ajax::button('?action=basket&type=song&id=' . $song->id,'add', T_('Add to temporary playlist'),'add_' . $song->id); ?>
|
||||
<a id="<?php echo 'add_playlist_'.$song->id ?>" onclick="showPlaylistDialog('song', '<?php echo $song->id ?>')">
|
||||
<a id="<?php echo 'add_playlist_'.$song->id ?>" onclick="showPlaylistDialog(event, 'song', '<?php echo $song->id ?>')">
|
||||
<?php echo UI::get_icon('playlist_add', T_('Add to existing playlist')); ?>
|
||||
</a>
|
||||
</span>
|
||||
|
|
|
@ -1,128 +0,0 @@
|
|||
<?php
|
||||
/* vim:set softtabstop=4 shiftwidth=4 expandtab: */
|
||||
/**
|
||||
*
|
||||
* LICENSE: GNU General Public License, version 2 (GPLv2)
|
||||
* Copyright 2001 - 2013 Ampache.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License v2
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
?>
|
||||
|
||||
<div id="musicbox" class="musicbox absolute box-shadow" style="top: 450px; left: 1439px; display: block;">
|
||||
<div id="head-add" class="header_add p_10 relative">
|
||||
<div style="display: block;">
|
||||
<div class="floatl block_cover">
|
||||
<div class="cover" style="margin-bottom:0">
|
||||
<img class="img_main" src="http://cdn-images.deezer.com/images/cover/e8cd709b7505068baec252a3d24ed920/30x30-000000-80-0-0.jpg" width="30" height="30" alt="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="floatl label">
|
||||
<dl>
|
||||
<dt class="to_e">Dying Kings</dt>
|
||||
<dd class="to_e">WE ARE MATCH</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
<p style="display: none;"></p>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="list_playlists">
|
||||
<p class="" style="height30px;line-height:30px"><b>Ajouter à une playlist existante</b></p>
|
||||
<div id="add-content" style="height: 110px;">
|
||||
<div class="tinyscroll_viewport">
|
||||
<div class="tinyscroll_overview" style="top: 0px;">
|
||||
<ul id="add-playlist-content"><li id="add-playlist" data-id="11714796">
|
||||
<a href="javascript:void(0);" onclick="musicbox.addToPlaylist($(this).parent().attr('data-id')); return false;" style="overflow:hidden;height:22px;line-height:22px">Autre</a>
|
||||
</li><li id="add-playlist" data-id="8445567">
|
||||
<a href="javascript:void(0);" onclick="musicbox.addToPlaylist($(this).parent().attr('data-id')); return false;" style="overflow:hidden;height:22px;line-height:22px">Cascada Perfect Day</a>
|
||||
</li><li id="add-playlist" data-id="49229476">
|
||||
<a href="javascript:void(0);" onclick="musicbox.addToPlaylist($(this).parent().attr('data-id')); return false;" style="overflow:hidden;height:22px;line-height:22px">Groupe</a>
|
||||
</li><li id="add-playlist" data-id="13358479">
|
||||
<a href="javascript:void(0);" onclick="musicbox.addToPlaylist($(this).parent().attr('data-id')); return false;" style="overflow:hidden;height:22px;line-height:22px">Hit Dance</a>
|
||||
</li><li id="add-playlist" data-id="33847922">
|
||||
<a href="javascript:void(0);" onclick="musicbox.addToPlaylist($(this).parent().attr('data-id')); return false;" style="overflow:hidden;height:22px;line-height:22px">Manix</a>
|
||||
</li><li id="add-playlist" data-id="13710068">
|
||||
<a href="javascript:void(0);" onclick="musicbox.addToPlaylist($(this).parent().attr('data-id')); return false;" style="overflow:hidden;height:22px;line-height:22px">max puissant</a>
|
||||
</li><li id="add-playlist" data-id="11714814">
|
||||
<a href="javascript:void(0);" onclick="musicbox.addToPlaylist($(this).parent().attr('data-id')); return false;" style="overflow:hidden;height:22px;line-height:22px">Playlist Christophe</a>
|
||||
</li><li id="add-playlist" data-id="26402207">
|
||||
<a href="javascript:void(0);" onclick="musicbox.addToPlaylist($(this).parent().attr('data-id')); return false;" style="overflow:hidden;height:22px;line-height:22px">ROCK</a>
|
||||
</li></ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="bottom-add" class="options_musicbox">
|
||||
<ul>
|
||||
<li id="btn-new-list">
|
||||
<a href="javascript:void(0)" class="to_e" style="display:block" onclick="musicbox.openCreatePlaylist(); return false;">
|
||||
<i class="icn icon icon-playlist pull-left"></i>
|
||||
<span>Créer une nouvelle playlist</span>
|
||||
<input id="input-new-title" style="display: none; height: 19px; width: 142px; border: 1px solid rgb(205, 205, 205); background-color: rgb(238, 238, 238); background-position: initial initial; background-repeat: initial initial;" type="text" class="floatl m_0 mt_5 p_0 pl_7 rad_2" value="Nouvelle playlist" onfocus="this.select();" onblur="if (this.value == '') { this.value = 'Nouvelle playlist'; }" onkeypress="if (event.keyCode == 13) { musicbox.createPlaylist($(this)); }">
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div>
|
||||
<form method="post" id="edit_album_<?php echo $album->id; ?>" class="edit_dialog_content">
|
||||
<table class="tabledata" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td class="edit_dialog_content_header"><?php echo T_('Name') ?></td>
|
||||
<td><input type="text" name="name" value="<?php echo scrub_out($album->full_name); ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="edit_dialog_content_header"><?php echo T_('Artist') ?></td>
|
||||
<td>
|
||||
<?php
|
||||
/*if ($album->artist_count == '1') {*/
|
||||
show_artist_select('artist', $album->artist_id);
|
||||
/*} else {
|
||||
echo T_('Various');
|
||||
}*/
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="edit_dialog_content_header"><?php echo T_('Year') ?></td>
|
||||
<td><input type="text" name="year" value="<?php echo scrub_out($album->year); ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="edit_dialog_content_header"><?php echo T_('Disk') ?></td>
|
||||
<td><input type="text" name="disk" value="<?php echo scrub_out($album->disk); ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="edit_dialog_content_header"><?php echo T_('MusicBrainz ID') ?></td>
|
||||
<td><input type="text" name="mbid" value="<?php echo $album->mbid; ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="edit_dialog_content_header"><?php echo T_('Tags') ?></td>
|
||||
<td>
|
||||
<input type="text" name="edit_tags" id="edit_tags" value="<?php echo Tag::get_display($album->tags); ?>" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="edit_dialog_content_header"></td>
|
||||
<td><input type="checkbox" name="apply_childs" value="checked" /><?php echo T_(' Apply tags to all childs (override tags for songs)') ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="hidden" name="id" value="<?php echo $album->id; ?>" />
|
||||
<input type="hidden" name="type" value="album_row" />
|
||||
</form>
|
||||
</div>
|
|
@ -35,9 +35,6 @@
|
|||
<td class="cel_add">
|
||||
<span class="cel_item_add">
|
||||
<?php echo Ajax::button('?action=basket&type=video&id=' . $video->id,'add', T_('Add to temporary playlist'),'add_video_' . $video->id); ?>
|
||||
<a id="<?php echo 'add_playlist_'.$video->id ?>" onclick="showPlaylistDialog('video', '<?php echo $video->id ?>')">
|
||||
<?php echo UI::get_icon('playlist_add', T_('Add to existing playlist')); ?>
|
||||
</a>
|
||||
</span>
|
||||
</td>
|
||||
<td class="cel_codec"><?php echo $video->f_codec; ?></td>
|
||||
|
|
|
@ -326,6 +326,66 @@ input[type=button]:focus:active, input[type=submit]:focus:active {
|
|||
border: 2px solid #ffc763;
|
||||
}
|
||||
|
||||
/***********************************************
|
||||
jQuery add to playlist dialog
|
||||
***********************************************/
|
||||
.playlistdialogstyle.ui-dialog {
|
||||
background-color: #222;
|
||||
font-size: 10px;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 2px;
|
||||
border-color: #1d1d1d;
|
||||
border: 2px solid rgba(0,0,0,0.15);
|
||||
}
|
||||
|
||||
.playlistdialogstyle.ui-widget-content a {
|
||||
background-color: #222;
|
||||
color: #eee;
|
||||
text-decoration: none;
|
||||
text-align: left;
|
||||
padding: 0.4em;
|
||||
}
|
||||
|
||||
.playlistdialogstyle.ui-widget-content a:hover {
|
||||
color: #ff9d00;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.playlistdialogstyle.ui-dialog .ui-dialog-titlebar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.playlistdialogstyle.ui-dialog .ui-dialog-title {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.playlistdialogstyle.ui-dialog .ui-dialog-content {
|
||||
background-color: #222;
|
||||
color: #999;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.playlistdialogstyle.ui-dialog .ui-dialog-buttonpane {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.playlistdialogstyle.ui-dialog .ui-dialog-buttonset button {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.playlistdialogstyle.ui-dialog .ui-dialog-buttonset button:hover {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.playlistdialogstyle.ui-dialog .ui-dialog-buttonset button:focus:active {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/***********************************************
|
||||
Main
|
||||
***********************************************/
|
||||
|
@ -871,8 +931,6 @@ input[type=button]:focus:active, input[type=submit]:focus:active {
|
|||
}
|
||||
|
||||
#rightbar #localplay-control {
|
||||
border: 1px solid #e3e3e3;
|
||||
background: #f6f6f6;
|
||||
padding: 5px;
|
||||
text-align: center;
|
||||
margin: 7px 0px;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue