(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: orphans.ml,v 1.4 2006/03/28 13:20:00 rich Exp $
+ * $Id: orphans.ml,v 1.6 2006/12/06 09:46:57 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
open Cocanwiki_template
let run r (q : cgi) dbh hostid _ _ =
- let template = get_template dbh hostid "orphans.html" in
+ let template = get_template r dbh hostid "orphans.html" in
(* Start with the front page, the contents of the site menu and the
* special "copyright" page.
let border' =
PGSQL(dbh) "select distinct to_url from links
where hostid = $hostid and from_url in $@border
- and to_url not in $@pages')" in
+ and to_url not in $@pages'" in
if border' = [] then pages'
else loop pages' border'
in
let table =
List.map (fun (page, title) ->
- [ "page", Template.VarString page;
- "title", Template.VarString title ]) rows in
+ let page = Option.get page in
+ [ "page", Template.VarString page;
+ "title", Template.VarString title ]) rows in
template#table "pages" table;