/** * Displays a select box with all the playlists listed * * @author Ross Carlson * @version 1/13/05 * @since 1/13/05 * @param $width the width, in pixels, of the select box * @param onclick: whether or not to submit on select. * @param type: the type of playlists to show: static|dynamic|all **/ function playlistSelect($width, $onchange = false, $type = "static", $session_pl = true, $varname = "jz_playlist", $return = false) { global $jzUSER; $display = new jzDisplay(); $retVal = ""; $retVal .= $display->openSelect($varname, $width, $onchange, true); if ($session_pl && $type != "dynamic") { $retVal .= '<option value= "session">' . word(" - Session Playlist - ") . '</option>' . "\n"; } $lists = $jzUSER->listPlaylists($type); foreach ($lists as $id => $pname) { $retVal .= '<option value="' . $id . '"'; if ($_SESSION['jz_playlist'] == $id) { $retVal .= " selected"; } $retVal .= '>' . $pname . '</option>' . "\n"; } $retVal .= $display->closeSelect(true); if ($return) { return $retVal; } else { echo $retVal; } }