mirror of
https://github.com/Yetangitu/ampache
synced 2025-10-05 10:49:37 +02:00
javascript modification/rss no_session fix/On useradd display right accesslevel(bounty1370)
This commit is contained in:
parent
68917e09f5
commit
79d6b4b7e4
8 changed files with 40 additions and 55 deletions
|
@ -126,6 +126,10 @@ switch ($action) {
|
|||
require_once(conf('prefix') . '/templates/show_edit_user.inc.php');
|
||||
break;
|
||||
}
|
||||
if ($access == 5){ $access = "Guest";}
|
||||
elseif ($access == 25){ $access = "User";}
|
||||
elseif ($access == 100){ $access = "Admin";}
|
||||
|
||||
show_confirmation("New User Added",$username . " has been created with an access level of " . $access,"admin/users.php");
|
||||
break;
|
||||
case 'delete':
|
||||
|
|
|
@ -43,66 +43,39 @@ function selectField(element)
|
|||
var element_id = document.getElementById(element);
|
||||
element_id.focus();
|
||||
}
|
||||
var checkflag_song = "false";
|
||||
|
||||
function check_songs() {
|
||||
if (checkflag_song == "false") {
|
||||
if (document.forms.songs.elements["song[]"].length == undefined) {
|
||||
document.forms.songs.elements["song[]"].checked = true;
|
||||
var checkflag = "false";
|
||||
|
||||
function check_select(type,name) {
|
||||
if ( name == undefined){
|
||||
var name = '';
|
||||
}
|
||||
if ( checkflag == "false") {
|
||||
if ( eval("document.forms."+ type +"s"+ name +".elements[\""+ type +"[]\"].length") == undefined) {
|
||||
var zz = eval("document.forms."+ type +"s"+ name +".elements[\""+ type +"[]\"]");
|
||||
zz.checked = true;
|
||||
}
|
||||
else {
|
||||
for (i = 0; i < document.forms.songs.elements["song[]"].length; i++) {
|
||||
document.forms.songs.elements["song[]"][i].checked = true;
|
||||
for (i = 0; i < eval("document.forms."+ type +"s"+ name +".elements[\""+ type +"[]\"].length"); i++) {
|
||||
var zz = eval("document.forms."+ type +"s"+ name +".elements[\""+ type +"[]\"][i]");
|
||||
zz.checked = true;
|
||||
}
|
||||
}
|
||||
checkflag_song = "true";
|
||||
checkflag = "true";
|
||||
return "Unselect All";
|
||||
}
|
||||
else {
|
||||
if (document.forms.songs.elements["song[]"].length == undefined) {
|
||||
document.forms.songs.elements["song[]"].checked = false;
|
||||
if ( eval("document.forms."+ type +"s"+ name +".elements[\""+ type +"[]\"].length") == undefined) {
|
||||
var zz = eval("document.forms."+ type +"s"+ name +".elements[\""+ type +"[]\"]");
|
||||
zz.checked = false;
|
||||
}
|
||||
else {
|
||||
for (i = 0; i < document.forms.songs.elements["song[]"].length; i++) {
|
||||
document.forms.songs.elements["song[]"][i].checked = false;
|
||||
for (i = 0; i < eval("document.forms."+ type +"s"+ name +".elements[\""+ type +"[]\"].length"); i++) {
|
||||
var zz = eval("document.forms."+ type +"s"+ name +".elements[\""+ type +"[]\"][i]");
|
||||
zz.checked = false;
|
||||
}
|
||||
}
|
||||
checkflag_song = "false";
|
||||
return "Select All";
|
||||
}
|
||||
}
|
||||
|
||||
function invert_songs() {
|
||||
for( i = 0; i < document.forms.songs.elements["song[]"].length; ++i ) {
|
||||
document.forms.songs.elements["song[]"][i].checked = !document.forms.songs.elements["song[]"][i].checked
|
||||
}
|
||||
}
|
||||
|
||||
var checkflag_results = "false";
|
||||
|
||||
function check_results() {
|
||||
if (checkflag_results == "false") {
|
||||
if (document.results.elements["results[]"].length == undefined) {
|
||||
document.results.elements["results[]"].checked = true;
|
||||
}
|
||||
else {
|
||||
for (i = 0; i < document.results.elements["results[]"].length; i++) {
|
||||
document.results.elements["results[]"][i].checked = true;
|
||||
}
|
||||
}
|
||||
checkflag_results = "true";
|
||||
return "Unselect All";
|
||||
}
|
||||
else {
|
||||
if (document.results.elements["results[]"].length == undefined) {
|
||||
document.results.elements["results[]"].checked = false;
|
||||
}
|
||||
else {
|
||||
for (i = 0; i < document.results.elements["results[]"].length; i++) {
|
||||
document.results.elements["results[]"][i].checked = false;
|
||||
}
|
||||
}
|
||||
checkflag_results = "false";
|
||||
checkflag = "false";
|
||||
return "Select All";
|
||||
}
|
||||
}
|
||||
|
|
2
rss.php
2
rss.php
|
@ -20,7 +20,7 @@
|
|||
|
||||
*/
|
||||
|
||||
$no_session = 1;
|
||||
define('NO_SESSION','1');
|
||||
require('lib/init.php');
|
||||
|
||||
/* Check Perms */
|
||||
|
|
|
@ -30,7 +30,7 @@ $web_path = conf('web_path');
|
|||
<table class="tabledata" cellspacing="0" cellpadding="0" border="0">
|
||||
<tr class="table-header">
|
||||
<th align="center">
|
||||
<a href="#" onclick="check_songs(); return false;"><?php echo _('Select'); ?></a>
|
||||
<a href="#" onclick="check_select('song'); return false;"><?php echo _('Select'); ?></a>
|
||||
</th>
|
||||
<th><?php echo _('Cover'); ?></th>
|
||||
<th><a href="<?php echo $web_path; ?>/<?php echo $_SESSION['view_script']; ?>?action=<?php echo $_REQUEST['action']; ?>&artist=<?php echo $artist->id ?>&keep_view=true&sort_type=album.name&sort_order=0"><?php echo _('Album Name'); ?></th>
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
<form name="songs" method="post" action="<?php echo conf('web_path'); ?>/admin/catalog.php" enctype="multipart/form-data" style="Display:inline">
|
||||
<table class="tabledata" cellspacing="0">
|
||||
<tr class="table-header">
|
||||
<td><a href="#" onclick="check_songs(); return false;"><?php echo _('Select'); ?></a></td>
|
||||
<td><a href="#" onclick="check_select('song'); return false;"><?php echo _('Select'); ?></a></td>
|
||||
<td><?php echo _('Title'); ?></td>
|
||||
<td><?php echo _('Album'); ?></td>
|
||||
<td><?php echo _('Artist'); ?></td>
|
||||
|
|
|
@ -24,7 +24,7 @@ $web_path = conf('web_path');
|
|||
<form id="songs" method="post" enctype="multipart/form-data" action="<?php echo conf('web_path'); ?>/admin/flag.php?action=reject_flags">
|
||||
<table class="tabledata" cellspacing="0" cellpadding="0">
|
||||
<tr class="table-header">
|
||||
<th><a href="#" onclick="check_songs(); return false;"><?php echo _('Select'); ?></a></th>
|
||||
<th><a href="#" onclick="check_select('song'); return false;"><?php echo _('Select'); ?></a></th>
|
||||
<th><?php echo _('Object'); ?></th>
|
||||
<th><?php echo _('User'); ?></th>
|
||||
<th><?php echo _('Flag'); ?></th>
|
||||
|
|
|
@ -28,8 +28,12 @@ $web_path = conf('web_path');
|
|||
$title = $type . ' ' . _('Playlists');
|
||||
?>
|
||||
<?php show_box_top($title); ?>
|
||||
<form id="playlists<?php echo $type;?>" method="post" enctype="multipart/form-data" action="playlist.php">
|
||||
<table class="tabledata" cellspacing="0" cellpadding="0" border="0"> <!-- Playlist Table -->
|
||||
<tr class="table-header">
|
||||
<th align="center">
|
||||
<a href="#" onclick="check_select('playlist','<?php echo $type;?>'); return false;"><?php echo _('Select'); ?></a>
|
||||
</th>
|
||||
<th><?php echo _('Playlist Name'); ?></th>
|
||||
<th><?php echo _('# Songs'); ?></th>
|
||||
<th><?php echo _('Owner'); ?></th>
|
||||
|
@ -40,6 +44,9 @@ foreach ($playlists as $playlist) {
|
|||
$playlist_user = new User($playlist->user);
|
||||
$count = $playlist->get_song_count(); ?>
|
||||
<tr class="<?php echo flip_class(); ?>">
|
||||
<td align="center">
|
||||
<input name="playlist[]" value="<?php echo $playlist->id; ?>" type="checkbox" />
|
||||
</td>
|
||||
<td>
|
||||
<a href="<?php echo $web_path; ?>/playlist.php?action=show_playlist&playlist_id=<?php echo $playlist->id; ?>">
|
||||
<?php echo scrub_out($playlist->name); ?>
|
||||
|
@ -76,5 +83,6 @@ foreach ($playlists as $playlist) {
|
|||
</tr>
|
||||
<?php } ?>
|
||||
</table>
|
||||
</form>
|
||||
<?php show_box_bottom(); ?>
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ if (is_object($playlist) && ($GLOBALS['user']->username == $playlist->user || $G
|
|||
</tr>
|
||||
<?php } ?>
|
||||
<tr class="table-header">
|
||||
<th> <a href="#" onclick="check_songs(); return false;">Select</a></th>
|
||||
<th> <a href="#" onclick="check_select('song'); return false;">Select</a></th>
|
||||
<?php if ($playlist_owner) { ?>
|
||||
<th><?php echo _('Track'); ?></th>
|
||||
<?php } ?>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue