1
0
Fork 0
mirror of https://github.com/Yetangitu/ampache synced 2025-10-03 09:49:30 +02:00

Fix few french translation

Avoid player exit confirmation on download links
Fix song removal from user uploader
This commit is contained in:
Afterster 2015-04-21 19:56:36 +02:00
parent db80fcc058
commit a4eafa834d
6 changed files with 43 additions and 32 deletions

View file

@ -203,13 +203,6 @@ function show_album_select($name='album', $album_id=0, $allow_add=false, $song_i
$key = "album_select_c" . ++$album_id_cnt; $key = "album_select_c" . ++$album_id_cnt;
} }
// Added ID field so we can easily observe this element
echo "<select name=\"$name\" id=\"$key\">\n";
if ($allow_none) {
echo "\t<option value=\"-2\"></option>\n";
}
$sql = "SELECT `album`.`id`, `album`.`name`, `album`.`prefix`, `disk` FROM `album`"; $sql = "SELECT `album`.`id`, `album`.`name`, `album`.`prefix`, `disk` FROM `album`";
$params = array(); $params = array();
if ($user) { if ($user) {
@ -218,6 +211,14 @@ function show_album_select($name='album', $album_id=0, $allow_add=false, $song_i
} }
$sql .= "ORDER BY `album`.`name`"; $sql .= "ORDER BY `album`.`name`";
$db_results = Dba::read($sql, $params); $db_results = Dba::read($sql, $params);
$count = Dba::num_rows($db_results);
// Added ID field so we can easily observe this element
echo "<select name=\"$name\" id=\"$key\">\n";
if ($allow_none) {
echo "\t<option value=\"-2\"></option>\n";
}
while ($r = Dba::fetch_assoc($db_results)) { while ($r = Dba::fetch_assoc($db_results)) {
$selected = ''; $selected = '';
@ -240,6 +241,10 @@ function show_album_select($name='album', $album_id=0, $allow_add=false, $song_i
echo "</select>\n"; echo "</select>\n";
if ($count === 0) {
echo "<script type='text/javascript'>check_inline_song_edit('" . $name . "', " . $song_id . ");</script>\n";
}
} // show_album_select } // show_album_select
/** /**
@ -257,12 +262,6 @@ function show_artist_select($name='artist', $artist_id=0, $allow_add=false, $son
$key = $name . "_select_c" . ++$artist_id_cnt; $key = $name . "_select_c" . ++$artist_id_cnt;
} }
echo "<select name=\"$name\" id=\"$key\">\n";
if ($allow_none) {
echo "\t<option value=\"-2\"></option>\n";
}
$sql = "SELECT `id`, `name`, `prefix` FROM `artist` "; $sql = "SELECT `id`, `name`, `prefix` FROM `artist` ";
$params = array(); $params = array();
if ($user) { if ($user) {
@ -271,6 +270,13 @@ function show_artist_select($name='artist', $artist_id=0, $allow_add=false, $son
} }
$sql .= "ORDER BY `name`"; $sql .= "ORDER BY `name`";
$db_results = Dba::read($sql, $params); $db_results = Dba::read($sql, $params);
$count = Dba::num_rows($db_results);
echo "<select name=\"$name\" id=\"$key\">\n";
if ($allow_none) {
echo "\t<option value=\"-2\"></option>\n";
}
while ($r = Dba::fetch_assoc($db_results)) { while ($r = Dba::fetch_assoc($db_results)) {
$selected = ''; $selected = '';
@ -290,6 +296,10 @@ function show_artist_select($name='artist', $artist_id=0, $allow_add=false, $son
echo "</select>\n"; echo "</select>\n";
if ($count === 0) {
echo "<script type='text/javascript'>check_inline_song_edit('" . $name . "', " . $song_id . ");</script>\n";
}
} // show_artist_select } // show_artist_select
/** /**

Binary file not shown.

View file

@ -989,11 +989,11 @@ msgstr "Erreur: Les fichiers de configuration sont introuvables ou illisible"
#: ../../labels.php:53 #: ../../labels.php:53
msgid "Label Added" msgid "Label Added"
msgstr "étiquette Ajouté" msgstr "Label ajouté"
#: ../../labels.php:78 #: ../../labels.php:78
msgid "Label cannot be found." msgid "Label cannot be found."
msgstr "Étiquette ne peut pas être trouvé." msgstr "Le label ne peut pas être trouvé."
#: ../../lib/class/access.class.php:155 ../../lib/class/access.class.php:159 #: ../../lib/class/access.class.php:155 ../../lib/class/access.class.php:159
msgid "Invalid IPv4 / IPv6 Address Entered" msgid "Invalid IPv4 / IPv6 Address Entered"
@ -1562,7 +1562,7 @@ msgstr "Vidéos personnelles"
#: ../../templates/show_edit_artist_row.inc.php:58 #: ../../templates/show_edit_artist_row.inc.php:58
#: ../../templates/sidebar_home.inc.php:36 #: ../../templates/sidebar_home.inc.php:36
msgid "Labels" msgid "Labels"
msgstr "Étiquettes d'étiquetage" msgstr "Labels"
#: ../../lib/class/browse.class.php:372 ../../templates/rightbar.inc.php:129 #: ../../lib/class/browse.class.php:372 ../../templates/rightbar.inc.php:129
#: ../../templates/show_recently_played.inc.php:162 #: ../../templates/show_recently_played.inc.php:162
@ -2067,11 +2067,11 @@ msgstr "Nom"
#: ../../templates/show_labels.inc.php:40 #: ../../templates/show_labels.inc.php:40
#: ../../templates/show_labels.inc.php:68 #: ../../templates/show_labels.inc.php:68
msgid "Category" msgid "Category"
msgstr "catégorie" msgstr "Catégorie"
#: ../../lib/class/share.class.php:200 #: ../../lib/class/share.class.php:200
msgid "Share edit" msgid "Share edit"
msgstr "Partager modifier" msgstr "Modifier partage"
#: ../../lib/class/share.class.php:341 ../../lib/class/share.class.php:343 #: ../../lib/class/share.class.php:341 ../../lib/class/share.class.php:343
#: ../../templates/show_shares.inc.php:23 #: ../../templates/show_shares.inc.php:23
@ -2080,7 +2080,7 @@ msgstr "Partager"
#: ../../lib/class/share.class.php:351 #: ../../lib/class/share.class.php:351
msgid "Advanced Share" msgid "Advanced Share"
msgstr "Partager avancée" msgstr "Partage avancé"
#: ../../lib/class/share.class.php:366 #: ../../lib/class/share.class.php:366
msgid "Temporary direct link" msgid "Temporary direct link"
@ -3991,7 +3991,7 @@ msgstr "Objet non valide sélectionnés"
#: ../../song.php:34 ../../song.php:48 ../../song.php:50 #: ../../song.php:34 ../../song.php:48 ../../song.php:50
msgid "Song Deletion" msgid "Song Deletion"
msgstr "chanson Suppression" msgstr "Suppression d'une chanson"
#: ../../song.php:35 #: ../../song.php:35
msgid "Are you sure you want to permanently delete this song?" msgid "Are you sure you want to permanently delete this song?"
@ -3999,7 +3999,7 @@ msgstr "Êtes-vous sûr de vouloir supprimer définitivement cette chanson?"
#: ../../song.php:48 #: ../../song.php:48
msgid "Song has been deleted." msgid "Song has been deleted."
msgstr "Chanson a été supprimé." msgstr "La chanson a été supprimée."
#: ../../song.php:50 #: ../../song.php:50
msgid "Cannot delete this song." msgid "Cannot delete this song."
@ -4660,22 +4660,22 @@ msgstr "Créer"
#: ../../templates/show_add_label.inc.php:23 #: ../../templates/show_add_label.inc.php:23
msgid "Add Label" msgid "Add Label"
msgstr "Ajouter une étiquette" msgstr "Ajouter un un label"
#: ../../templates/show_add_label.inc.php:37 #: ../../templates/show_add_label.inc.php:37
#: ../../templates/show_edit_label_row.inc.php:34 #: ../../templates/show_edit_label_row.inc.php:34
msgid "Personal" msgid "Personal"
msgstr "personnel" msgstr "Personnel"
#: ../../templates/show_add_label.inc.php:38 #: ../../templates/show_add_label.inc.php:38
#: ../../templates/show_edit_label_row.inc.php:35 #: ../../templates/show_edit_label_row.inc.php:35
msgid "Association" msgid "Association"
msgstr "association" msgstr "Association"
#: ../../templates/show_add_label.inc.php:39 #: ../../templates/show_add_label.inc.php:39
#: ../../templates/show_edit_label_row.inc.php:36 #: ../../templates/show_edit_label_row.inc.php:36
msgid "Company" msgid "Company"
msgstr "société" msgstr "Société"
#: ../../templates/show_add_label.inc.php:44 #: ../../templates/show_add_label.inc.php:44
#: ../../templates/show_edit_artist_row.inc.php:41 #: ../../templates/show_edit_artist_row.inc.php:41
@ -6396,19 +6396,19 @@ msgstr "Envoyer un email"
#: ../../templates/show_label.inc.php:70 ../../templates/show_label.inc.php:73 #: ../../templates/show_label.inc.php:70 ../../templates/show_label.inc.php:73
#: ../../templates/show_label_row.inc.php:45 #: ../../templates/show_label_row.inc.php:45
msgid "Label edit" msgid "Label edit"
msgstr "étiquette modifier" msgstr "Edition label"
#: ../../templates/show_label.inc.php:74 #: ../../templates/show_label.inc.php:74
msgid "Edit Label" msgid "Edit Label"
msgstr "Modifier le libellé" msgstr "Modifier le label"
#: ../../templates/show_labels.inc.php:28 #: ../../templates/show_labels.inc.php:28
msgid "Create a new label" msgid "Create a new label"
msgstr "Modifier étiquette" msgstr "Créer un nouveau label"
#: ../../templates/show_labels.inc.php:58 #: ../../templates/show_labels.inc.php:58
msgid "No label found" msgid "No label found"
msgstr "No label found" msgstr "Aucun label trouvé"
#: ../../templates/show_live_stream.inc.php:24 #: ../../templates/show_live_stream.inc.php:24
msgid "Manage Radio Stations" msgid "Manage Radio Stations"

View file

@ -43,17 +43,19 @@ switch ($_REQUEST['action']) {
$song = new Song($_REQUEST['song_id']); $song = new Song($_REQUEST['song_id']);
if ($song->id && $song->user_upload > 0) { if ($song->id && $song->user_upload > 0) {
if (Access::check('interface','50') || ($libitem->user_upload == $GLOBALS['user']->id && AmpConfig::get('upload_allow_remove'))) { if (Access::check('interface','50') || ($song->user_upload == $GLOBALS['user']->id && AmpConfig::get('upload_allow_remove'))) {
if ($song->remove_from_disk()) { if ($song->remove_from_disk()) {
show_confirmation(T_('Song Deletion'), T_('Song has been deleted.'), AmpConfig::get('web_path')); show_confirmation(T_('Song Deletion'), T_('Song has been deleted.'), AmpConfig::get('web_path'));
} else { } else {
show_confirmation(T_('Song Deletion'), T_('Cannot delete this song.'), AmpConfig::get('web_path')); show_confirmation(T_('Song Deletion'), T_('Cannot delete this song.'), AmpConfig::get('web_path'));
} }
} else { } else {
debug_event('song', 'Unauthorized to remove this song.', 1);
UI::access_denied(); UI::access_denied();
exit; exit;
} }
} else { } else {
debug_event('song', 'Cannot remove a song that wasn\'t uploaded.', 1);
UI::access_denied(); UI::access_denied();
exit; exit;
} }

View file

@ -47,7 +47,6 @@ if ($_REQUEST['append']) {
<?php if (AmpConfig::get('webplayer_confirmclose')) { ?> <?php if (AmpConfig::get('webplayer_confirmclose')) { ?>
document.onbeforeunload = null; document.onbeforeunload = null;
<?php } ?> <?php } ?>
if (appendmedia) { if (appendmedia) {
<?php echo WebPlayer::add_media_js($this); ?> <?php echo WebPlayer::add_media_js($this); ?>
} else if (playnext) { } else if (playnext) {

View file

@ -471,7 +471,7 @@ function stopBroadcast()
<?php if ($iframed && AmpConfig::get('webplayer_confirmclose') && !$is_share) { ?> <?php if ($iframed && AmpConfig::get('webplayer_confirmclose') && !$is_share) { ?>
window.parent.onbeforeunload = function (evt) { window.parent.onbeforeunload = function (evt) {
if (!$("#jquery_jplayer_1").data("jPlayer").status.paused) { if (!$("#jquery_jplayer_1").data("jPlayer").status.paused && (document.activeElement === undefined || (document.activeElement.href.indexOf('/batch.php') < 0 && document.activeElement.href.indexOf('/stream.php') < 0))) {
var message = '<?php echo T_('Media is currently playing. Are you sure you want to close') . ' ' . AmpConfig::get('site_title') . '?'; ?>'; var message = '<?php echo T_('Media is currently playing. Are you sure you want to close') . ' ' . AmpConfig::get('site_title') . '?'; ?>';
if (typeof evt == 'undefined') { if (typeof evt == 'undefined') {
evt = window.event; evt = window.event;