X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=scripts%2Fedit_host_css.ml;h=b322acb8203d75c95b07ad0b53b11b8c40e50a7c;hb=262f6a0c34949247ba6b78399b787e693da38d86;hp=790486b884aa2878e67fac07c0514439f07ddc87;hpb=e828b148d6338765d7f5ca8f10567d5d9ef00548;p=cocanwiki.git diff --git a/scripts/edit_host_css.ml b/scripts/edit_host_css.ml index 790486b..b322acb 100644 --- a/scripts/edit_host_css.ml +++ b/scripts/edit_host_css.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * Copyright (C) 2004 Merjis Ltd. - * $Id: edit_host_css.ml,v 1.5 2005/11/24 14:54:11 rich Exp $ + * $Id: edit_host_css.ml,v 1.6 2006/03/27 18:09:46 rich Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,18 +28,17 @@ open Cocanwiki open Cocanwiki_ok open Cocanwiki_strings -let run r (q : cgi) (dbh : Dbi.connection) hostid _ _ = +let run r (q : cgi) dbh hostid _ _ = let css = q#param "css" in - let css = if string_is_whitespace css then `Null else `String css in + let css = if string_is_whitespace css then None else Some css in (* XXX We should version the global stylesheet. However this requires * some fairly non-trivial coding. *) - let sth = dbh#prepare_cached "update hosts set css = ? where id = ?" in - sth#execute [css; `Int hostid]; + PGSQL(dbh) "update hosts set css = $?css where id = $hostid"; - dbh#commit (); + PGOCaml.commit dbh; let buttons = [ ok_button "/_bin/host_menu.cmo";