(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: page.ml,v 1.45 2006/03/28 16:24:07 rich Exp $
+ * $Id: page.ml,v 1.46 2006/07/26 13:11:25 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
None -> []
| Some pageid ->
let rows = PGSQL(dbh)
- "select ordering, sectionname, content, divname
+ "select ordering, sectionname, content, divname, jsgo
from contents where pageid = $pageid order by ordering" in
List.map
- (fun (ordering, sectionname, content, divname) ->
+ (fun (ordering, sectionname, content, divname, jsgo) ->
let divname, has_divname =
match divname with
| None -> "", false
| Some divname -> divname, true in
+ let jsgo, has_jsgo =
+ match jsgo with
+ | None -> "", false
+ | Some jsgo -> jsgo, true in
let sectionname, has_sectionname =
match sectionname with
| None -> "", false
Template.VarString
(Wikilib.xhtml_of_content dbh hostid content);
"has_divname", Template.VarConditional has_divname;
- "divname", Template.VarString divname ]) rows in
+ "divname", Template.VarString divname;
+ "has_jsgo", Template.VarConditional has_jsgo;
+ "jsgo", Template.VarString jsgo ]) rows in
(* Call an extension to generate the first section in this page? *)
let sections =
"content", Template.VarString content;
"has_divname", Template.VarConditional true;
"divname", Template.VarString "form_div";
+ "has_jsgo", Template.VarConditional false;
+ "jsgo", Template.VarString "";
] in
section :: sections in
| FPInternalRedirect page' ->
loop page' (i+1)
| FPExternalRedirect page' ->
- (* This normally happens when a user has request an uppercase
+ (* This normally happens when a user has requested an uppercase
* page name. We redirect to the true (lowercase) version.
*)
- q#redirect ("http://" ^ host.hostname ^ "/" ^ page');
- return ()
+ q#redirect ("http://" ^ host.hostname ^ "/" ^ page')
| FPNotFound ->
(* Might be a templated page with no content in it. *)
let extension = get_extension page' in