1
0
Fork 0
mirror of https://github.com/Yetangitu/ampache synced 2025-10-05 02:39:47 +02:00

javascript modification/rss no_session fix/On useradd display right accesslevel(bounty1370)

This commit is contained in:
pb1dft 2007-02-16 00:05:09 +00:00
parent 68917e09f5
commit 79d6b4b7e4
8 changed files with 40 additions and 55 deletions

View file

@ -125,7 +125,11 @@ switch ($action) {
$type = 'new_user'; $type = 'new_user';
require_once(conf('prefix') . '/templates/show_edit_user.inc.php'); require_once(conf('prefix') . '/templates/show_edit_user.inc.php');
break; 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"); show_confirmation("New User Added",$username . " has been created with an access level of " . $access,"admin/users.php");
break; break;
case 'delete': case 'delete':

View file

@ -43,66 +43,39 @@ function selectField(element)
var element_id = document.getElementById(element); var element_id = document.getElementById(element);
element_id.focus(); element_id.focus();
} }
var checkflag_song = "false";
function check_songs() { var checkflag = "false";
if (checkflag_song == "false") {
if (document.forms.songs.elements["song[]"].length == undefined) { function check_select(type,name) {
document.forms.songs.elements["song[]"].checked = true; 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 { else {
for (i = 0; i < document.forms.songs.elements["song[]"].length; i++) { for (i = 0; i < eval("document.forms."+ type +"s"+ name +".elements[\""+ type +"[]\"].length"); i++) {
document.forms.songs.elements["song[]"][i].checked = true; var zz = eval("document.forms."+ type +"s"+ name +".elements[\""+ type +"[]\"][i]");
zz.checked = true;
} }
} }
checkflag_song = "true"; checkflag = "true";
return "Unselect All"; return "Unselect All";
} }
else { else {
if (document.forms.songs.elements["song[]"].length == undefined) { if ( eval("document.forms."+ type +"s"+ name +".elements[\""+ type +"[]\"].length") == undefined) {
document.forms.songs.elements["song[]"].checked = false; var zz = eval("document.forms."+ type +"s"+ name +".elements[\""+ type +"[]\"]");
zz.checked = false;
} }
else { else {
for (i = 0; i < document.forms.songs.elements["song[]"].length; i++) { for (i = 0; i < eval("document.forms."+ type +"s"+ name +".elements[\""+ type +"[]\"].length"); i++) {
document.forms.songs.elements["song[]"][i].checked = false; var zz = eval("document.forms."+ type +"s"+ name +".elements[\""+ type +"[]\"][i]");
} zz.checked = false;
}
} }
checkflag_song = "false"; checkflag = "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";
return "Select All"; return "Select All";
} }
} }

View file

@ -20,7 +20,7 @@
*/ */
$no_session = 1; define('NO_SESSION','1');
require('lib/init.php'); require('lib/init.php');
/* Check Perms */ /* Check Perms */

View file

@ -30,7 +30,7 @@ $web_path = conf('web_path');
<table class="tabledata" cellspacing="0" cellpadding="0" border="0"> <table class="tabledata" cellspacing="0" cellpadding="0" border="0">
<tr class="table-header"> <tr class="table-header">
<th align="center"> <th align="center">
&nbsp;&nbsp;<a href="#" onclick="check_songs(); return false;"><?php echo _('Select'); ?></a> &nbsp;&nbsp;<a href="#" onclick="check_select('song'); return false;"><?php echo _('Select'); ?></a>
</th> </th>
<th><?php echo _('Cover'); ?></th> <th><?php echo _('Cover'); ?></th>
<th><a href="<?php echo $web_path; ?>/<?php echo $_SESSION['view_script']; ?>?action=<?php echo $_REQUEST['action']; ?>&amp;artist=<?php echo $artist->id ?>&amp;keep_view=true&amp;sort_type=album.name&amp;sort_order=0"><?php echo _('Album Name'); ?></th> <th><a href="<?php echo $web_path; ?>/<?php echo $_SESSION['view_script']; ?>?action=<?php echo $_REQUEST['action']; ?>&amp;artist=<?php echo $artist->id ?>&amp;keep_view=true&amp;sort_type=album.name&amp;sort_order=0"><?php echo _('Album Name'); ?></th>

View file

@ -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"> <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"> <table class="tabledata" cellspacing="0">
<tr class="table-header"> <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 _('Title'); ?></td>
<td><?php echo _('Album'); ?></td> <td><?php echo _('Album'); ?></td>
<td><?php echo _('Artist'); ?></td> <td><?php echo _('Artist'); ?></td>

View file

@ -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"> <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"> <table class="tabledata" cellspacing="0" cellpadding="0">
<tr class="table-header"> <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 _('Object'); ?></th>
<th><?php echo _('User'); ?></th> <th><?php echo _('User'); ?></th>
<th><?php echo _('Flag'); ?></th> <th><?php echo _('Flag'); ?></th>

View file

@ -28,8 +28,12 @@ $web_path = conf('web_path');
$title = $type . ' ' . _('Playlists'); $title = $type . ' ' . _('Playlists');
?> ?>
<?php show_box_top($title); ?> <?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 --> <table class="tabledata" cellspacing="0" cellpadding="0" border="0"> <!-- Playlist Table -->
<tr class="table-header"> <tr class="table-header">
<th align="center">
&nbsp;&nbsp;<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 _('Playlist Name'); ?></th>
<th><?php echo _('# Songs'); ?></th> <th><?php echo _('# Songs'); ?></th>
<th><?php echo _('Owner'); ?></th> <th><?php echo _('Owner'); ?></th>
@ -40,6 +44,9 @@ foreach ($playlists as $playlist) {
$playlist_user = new User($playlist->user); $playlist_user = new User($playlist->user);
$count = $playlist->get_song_count(); ?> $count = $playlist->get_song_count(); ?>
<tr class="<?php echo flip_class(); ?>"> <tr class="<?php echo flip_class(); ?>">
<td align="center">
<input name="playlist[]" value="<?php echo $playlist->id; ?>" type="checkbox" />
</td>
<td> <td>
<a href="<?php echo $web_path; ?>/playlist.php?action=show_playlist&amp;playlist_id=<?php echo $playlist->id; ?>"> <a href="<?php echo $web_path; ?>/playlist.php?action=show_playlist&amp;playlist_id=<?php echo $playlist->id; ?>">
<?php echo scrub_out($playlist->name); ?> <?php echo scrub_out($playlist->name); ?>
@ -76,5 +83,6 @@ foreach ($playlists as $playlist) {
</tr> </tr>
<?php } ?> <?php } ?>
</table> </table>
</form>
<?php show_box_bottom(); ?> <?php show_box_bottom(); ?>

View file

@ -40,7 +40,7 @@ if (is_object($playlist) && ($GLOBALS['user']->username == $playlist->user || $G
</tr> </tr>
<?php } ?> <?php } ?>
<tr class="table-header"> <tr class="table-header">
<th>&nbsp;&nbsp;<a href="#" onclick="check_songs(); return false;">Select</a></th> <th>&nbsp;&nbsp;<a href="#" onclick="check_select('song'); return false;">Select</a></th>
<?php if ($playlist_owner) { ?> <?php if ($playlist_owner) { ?>
<th><?php echo _('Track'); ?></th> <th><?php echo _('Track'); ?></th>
<?php } ?> <?php } ?>