has_access('100')) {
access_denied();
}
$action = scrub_in($_REQUEST['action']);
$song = scrub_in($_REQUEST['song']);
show_template('header');
show_menu_items('Admin');
show_admin_menu('Catalog');
$song_obj = new Song($_REQUEST['song_id']);
switch($action) {
case 'Update':
case 'update';
update_song_info($song);
edit_song_info($song);
break;
case "Edit":
case "edit":
edit_song_info($song);
break;
case 'disable':
// If we pass just one, make it still work
if (!is_array($_REQUEST['song_ids'])) { $song_obj->update_enabled(0,$_REQUEST['song_ids']); }
else {
foreach ($_REQUEST['song_ids'] as $song_id) {
$song_obj->update_enabled(0,$song_id);
} // end foreach
} // end else
show_confirmation(_("Songs Disabled"),_("The requested song(s) have been disabled"),return_referer());
break;
case "enabled":
// If we pass just one, make it still work
if (!is_array($_REQUEST['song_ids'])) { $song_obj->update_enabled(1,$_REQUEST['song_ids']); }
else {
foreach ($_REQUEST['song_ids'] as $song_id) {
$song_obj->update_enabled(1,$song_id);
} // end foreach
} // end else
show_confirmation(_("Songs Enabled"),_("The requested song(s) have been enabled"),return_referer());
break;
default:
echo "Don't know what to do yet.";
break;
} // end switch
/*
@function edit_song_info
@discussion yea this is just wrong
*/
function edit_song_info($song) {
$info = new Song($song);
preg_match("/^.*\/(.*?)$/",$info->file, $short);
$filename = htmlspecialchars($short[1]);
if(preg_match('/\.ogg$/',$short[1]))
{
$ogg = TRUE;
$oggwarn = "
This file is an OGG file, which Ampache only has limited support for.
";
$oggwarn .= "You can make changes to the database here, but Ampache will not change the actual file's information.
";
}
echo <<