Added the navigation box (see email).
[cocanwiki.git] / scripts / edit.ml
index 016b0bb..df0242e 100644 (file)
@@ -1,7 +1,7 @@
 (* COCANWIKI - a wiki written in Objective CAML.
  * Written by Richard W.M. Jones <rich@merjis.com>.
  * Copyright (C) 2004 Merjis Ltd.
- * $Id: edit.ml,v 1.17 2004/10/09 09:52:10 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
@@ -323,11 +323,19 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid {hostname = hostname} user =
                    q "The page name supplied is too short or invalid.";
                  return () in
 
+    (* Initial page contents. *)
+    let contents =
+      match pt with
+         Page url -> []
+       | Title title ->
+           [ "", "",
+             "<b>" ^ title ^ "</b> is " ] in
+
     let model = { id = 0;
                  pt = pt;
                  description = title;
                  redirect = "";
-                 contents = [] } in
+                 contents = contents } in
 
     model_to_template model template
   in
@@ -521,7 +529,8 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid {hostname = hostname} user =
          let sth =
            dbh#prepare_cached
              "set constraints pages_redirect_cn, sitemenu_url_cn,
-                   page_emails_url_cn, links_from_cn deferred" in
+                   page_emails_url_cn, links_from_cn, recently_visited_url_cn
+                   deferred" in
          sth#execute [];
 
          (* Mark the old page as deleted.  NB. There is a small race