# /packages/mp3jukebox/www/admin/playlist-edit-2.tcl ad_page_contract { This page edits a playlist @author wirth@ybos.net @creation-date 2000-03-02 } { playlist_id:naturalnum,notnull remove_threshold:integer,notnull playlist_name } -properties { page_title:onevalue context:onevalue form_action:onevalue hidden_vars:onevalue name remove_threshold:onevalue } set title "Edit a Playlist" set context [list $title] set page_title "Edit a Playlist" #requires admin permission as under /admin set creation_ip [ad_conn "peeraddr"] set creation_user [ad_conn "user_id"] #remove_threshold expects a negative number for vote threshold, but the user #will expect to type in a positive number. So we change it to negative behind #the scenes for them. If they type in a negative number or zero, we input the number as is. if {$remove_threshold > 0} { set neg_remove_threshold [expr $remove_threshold * -1] } else { set neg_remove_threshold $remove_threshold } if [catch { db_dml update_playlist " update mp3_playlists set name=:playlist_name, remove_threshold=:neg_remove_threshold where playlist_id=:playlist_id " } errmsg ] { set complaint " The database did not accept your input. See details for the error message below\n\n\t
$errmsg" ad_return_error "Database Error" "$complaint" ad_script_abort } else { ad_returnredirect one-playlist?playlist_id=$playlist_id }