Added the framework to allow us to populate standards parts of the
[cocanwiki.git] / scripts / cocanwiki_ok.ml
1 (* COCANWIKI scripts.
2  * Written by Richard W.M. Jones <rich@merjis.com>.
3  * Copyright (C) 2004 Merjis Ltd.
4  * $Id: cocanwiki_ok.ml,v 1.4 2004/09/08 15:46:52 rich Exp $
5  *)
6
7 open Apache
8 open Registry
9 open Cgi
10 open Printf
11
12 open Cocanwiki_template
13
14 (* Override StdPages.ok and StdPages.error with out our versions.
15  * Also have some standard buttons around.
16  *)
17 let ok_error_template = _get_template "ok_error.html"
18
19 let error ?cookie ?cookies ?title ?(icon = "/_graphics/error.png")
20     ?icon_alt ?back_button ?close_button q message =
21   StdPages.error ?cookie ?cookies ~template:ok_error_template
22     ?title ~icon ?icon_alt ?back_button ?close_button q message
23
24 let ok ?cookie ?cookies ?title ?(icon = "/_graphics/ok.png")
25     ?icon_alt ?back_button ?close_button ?buttons q message =
26   StdPages.ok ?cookie ?cookies ~template:ok_error_template
27     ?title ~icon ?icon_alt ?back_button ?close_button ?buttons q message
28
29 let ok_button url = { StdPages.label = "     OK     ";
30                       StdPages.link = url;
31                       StdPages.method_ = None;
32                       StdPages.params = [] }