<?
$GLOBALS['phpgw_info']['flags'] = array ("currentapp" => "musiclib",
"enable_nextmatchs_class" => True,
"noheader" => True);
include('../header.inc.php');
include ("inc/config.inc.php");
include ("inc/functions.inc.php");
#echo $_SERVER['HTTP_REFERER']."<br>";
$playlist_title = $HTTP_POST_VARS['playlist_title'];
$play_order = $HTTP_POST_VARS['play_order'];
$id_array = $HTTP_POST_VARS['id_array'];
$remove_array = $HTTP_POST_VARS['remove_array'];
#echo $mode;
if (!$mode) {
$mode = $HTTP_POST_VARS['mode'];
}
#echo "$add_to_playlist_array"."<br>";
#echo "$playlist_id"."<br>";
#echo $mode;
switch ($mode) {
case 'order':
modify_play_order($ids,$order);
header("Location: ".$GLOBALS['phpgw']->link("/musiclib/playlists.php","id=".$id));
break;
# Mozilla wants to set $mode to 'remove' when hitting enter in playorder field because it is the first button
# so all we can do is process them both together
case 'updateandremove':
if (isset($play_order)) {
update_playlist($id,$id_array,$play_order);
}
if (isset($remove_array)) {
remove_from_playlist($id,$remove_array);
}
header("Location: ".$GLOBALS['phpgw']->link("/musiclib/playlists.php","id=".$id));
break;
case 'delete':
delete_playlist($id);
header("Location: ".$GLOBALS['phpgw']->link("/musiclib/playlists.php"));
break;
case 'title':
change_playlist_title($id,$playlist_title);
header("Location: ".$GLOBALS['phpgw']->link("/musiclib/playlists.php","id=".$id));
break;
default :
if (isset($play_order)) {
update_playlist($id,$id_array,$play_order);
}
header("Location: ".$GLOBALS['phpgw']->link("/musiclib/playlists.php","id=".$id));
}
?>