2 * Written by Richard W.M. Jones <rich@merjis.com>.
3 * Copyright (C) 2004 Merjis Ltd.
4 * $Id: delete_file_form.ml,v 1.4 2004/09/08 09:54:28 rich Exp $
13 open Cocanwiki_template
15 let template = get_template "delete_file_form.html"
17 let run r (q : cgi) (dbh : Dbi.connection) (hostid, _, _) _ =
18 let id = int_of_string (q#param "id") in
20 let sth = dbh#prepare_cached "select name from files
21 where hostid = ? and id = ?" in
22 sth#execute [`Int hostid; `Int id];
24 let name = sth#fetch1string () in
26 template#set "id" (string_of_int id);
27 template#set "name" name;
32 register_script ~restrict:[CanEdit] run