Location: PHPKode > projects > Axis Groupware > musiclib/add_to_playlist.php
<?
$GLOBALS['phpgw_info']['flags'] = array ("currentapp" => "musiclib",
						 "enable_nextmatchs_class" => True,
						 "noheader" => True);
include('../header.inc.php');

include ("inc/config.inc.php");
$referrer = split('/',$_SERVER['HTTP_REFERER']);

#echo $referrer[4];
#echo "<br>";
#echo $searchFor;

$add_to_playlist_array = $HTTP_POST_VARS['add_to_playlist_array'];
$playlist_id = $HTTP_POST_VARS['playlist_id'];

#print_r($add_to_playlist_array)."<br>";
#echo "$playlist_id"."<br>";

switch ($mode) {

	case 'album':
		
		foreach($add_to_playlist_array as $id) {
			$query = construct_song_select("WHERE album_id=".$id. 
									  	  " ORDER BY artist_name, album_title, track");
			$result = $GLOBALS['phpgw']->db->query($query,__LINE__,__FILE__);
		
			while($GLOBALS['phpgw']->db->next_record()) {
				$add_albums_array[] = $GLOBALS['phpgw']->db->f('id');
			}
		}
	
		$new_list = add_to_playlist('album',$playlist_id,$add_albums_array);
	
		break;
	default:
		$new_list = add_to_playlist($mode,$playlist_id,$add_to_playlist_array);
}

if ($playlist_id=='new') 
{
	header("Location: ".$GLOBALS['phpgw']->link("/musiclib/playlists.php","id=".$new_list."&mode=new"));
} 
else if ($action=='doSearch') 
{
	header("Location: ".$GLOBALS['phpgw']->link("/musiclib/searches.php","action=doSearch&search=".$search."&searchFor=".$searchFor));
} 
else 
{
	header("Location: ".$_SERVER['HTTP_REFERER']);
}

?>
Return current item: Axis Groupware