X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=scripts%2Fhost_menu.ml;h=e94bb4174c2bf371806820cb465ae29059a2cdd5;hb=e336401181f56f19ec18175d47462e7a5d5f07e2;hp=7806efcea77fa822a8913f7b44093c1a65061a58;hpb=b36e5c1ab955fc9cb3169f54373037c6bc2903a2;p=cocanwiki.git diff --git a/scripts/host_menu.ml b/scripts/host_menu.ml index 7806efc..e94bb41 100644 --- a/scripts/host_menu.ml +++ b/scripts/host_menu.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * Copyright (C) 2004 Merjis Ltd. - * $Id: host_menu.ml,v 1.6 2004/10/23 09:36:11 rich Exp $ + * $Id: host_menu.ml,v 1.7 2004/11/03 13:36:45 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 @@ -47,14 +47,17 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid host user = "select h.canonical_hostname, h.css is not null, h.edit_anon, h.create_account_anon, h.theme_css is not null, t.name, t.description, h.feedback_email, h.mailing_list, - h.search_box, h.navigation, h.view_anon + h.search_box, h.navigation, h.view_anon, + h.brand, coalesce (h.brand_tagline, ''), + coalesce (h.brand_description, '') from hosts h left outer join themes t on h.theme_css = t.theme_css where h.id = ?" in sth#execute [`Int hostid]; let canonical_hostname, has_global_css, edit_anon, create_account_anon, has_theme_css, theme_name, theme_description, has_feedback_email, - feedback_email, mailing_list, search_box, navigation, view_anon = + feedback_email, mailing_list, search_box, navigation, view_anon, + has_brand, brand, brand_tagline, brand_description = match sth#fetch1 () with [ `String canonical_hostname; `Bool has_global_css; `Bool edit_anon; `Bool create_account_anon; `Bool has_theme_css; @@ -62,7 +65,9 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid host user = (`String _ | `Null) as theme_description; (`String _ | `Null) as feedback_email; `Bool mailing_list; `Bool search_box; `Bool navigation; - `Bool view_anon ] -> + `Bool view_anon; + (`String _ | `Null) as brand; `String brand_tagline; + `String brand_description ] -> let theme_name = match theme_name with `String s -> s | `Null -> "" in let theme_description = @@ -71,9 +76,14 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid host user = match feedback_email with `String s -> s, true | `Null -> "", false in + let brand, has_brand = + match brand with + `String s -> s, true + | `Null -> "", false in canonical_hostname, has_global_css, edit_anon, create_account_anon, has_theme_css, theme_name, theme_description, has_feedback_email, - feedback_email, mailing_list, search_box, navigation, view_anon + feedback_email, mailing_list, search_box, navigation, view_anon, + has_brand, brand, brand_tagline, brand_description | _ -> assert false in template#set "canonical_hostname" canonical_hostname; @@ -88,7 +98,11 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid host user = template#conditional "mailing_list" mailing_list; template#conditional "search_box" search_box; template#conditional "navigation" navigation; - template#conditional "view_anon" view_anon + template#conditional "view_anon" view_anon; + template#conditional "has_brand" has_brand; + template#set "brand" brand; + template#set "brand_tagline" brand_tagline; + template#set "brand_description" brand_description; ); q#template template