X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=scripts%2Fedit.ml;h=df0242ee443a8d604ce2ccdae1321a4379a1f2bc;hb=5b036c1119e5871a8996c98639cd861ea7d93e75;hp=bf7b482a75a30b13f6cf5c70eae9ba1823b6e3f5;hpb=4a1bf584fe7e2f731645378201d9cc087b2b846d;p=cocanwiki.git diff --git a/scripts/edit.ml b/scripts/edit.ml index bf7b482..df0242e 100644 --- a/scripts/edit.ml +++ b/scripts/edit.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.ml,v 1.9 2004/09/20 10:56:47 rich Exp $ + * $Id: edit.ml,v 1.19 2004/10/10 16:14:43 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 @@ -33,11 +33,15 @@ open Cocanwiki_emailnotify open Cocanwiki_diff open Cocanwiki_strings +(* Page of title. *) +type pt_t = Page of string | Title of string + (* We keep an "internal model" of the page - see build_internal_model () * below. *) type model_t = { - id : int; (* Original page ID. *) + id : int; (* Original page ID (0 = none). *) + pt : pt_t; (* Page of title (only used if id=0) *) description : string; (* Description. *) redirect : string; (* Redirect to ("" = none). *) contents : (string * string * string) list; @@ -45,9 +49,10 @@ type model_t = { * for each section. *) } -let run r (q : cgi) (dbh : Dbi.connection) hostid { hostname = hostname } _ = +let run r (q : cgi) (dbh : Dbi.connection) hostid {hostname = hostname} user = let template = get_template dbh hostid "edit.html" in let template_conflict = get_template dbh hostid "edit_conflict.html" in + let template_email = get_template dbh hostid "edit_page_email.txt" in (* Workaround bugs in IE, specifically lack of support for