hosts.search_box.
Version 1.1.2.
Bumped release number.
-# $Id: Makefile.config,v 1.4 2004/09/22 12:04:28 rich Exp $
+# $Id: Makefile.config,v 1.5 2004/09/27 16:21:09 rich Exp $
PACKAGE := cocanwiki
-VERSION := 1.1.1
+VERSION := 1.1.2
# Normally ignored. However, if you are installing centrally (using
# 'make pkg-install'), then the components are installed in the
theme_css text,
feedback_email text,
mailing_list boolean DEFAULT false NOT NULL,
- is_template boolean DEFAULT false NOT NULL
+ is_template boolean DEFAULT false NOT NULL,
+ search_box boolean DEFAULT true NOT NULL
);
-cocanwiki (1.1.1-5) unstable; urgency=low
+cocanwiki (1.1.2-1) unstable; urgency=low
* Initial Release.
/* Stylesheet for COCANWIKI.
- * $Id: standard.css,v 1.5 2004/09/24 10:44:55 rich Exp $
+ * $Id: standard.css,v 1.6 2004/09/27 16:21:09 rich Exp $
*/
body {
span.search_term {
background-color: #ff0;
border: 1px solid #eeb;
-}
\ No newline at end of file
+}
+
+/* Search box. */
+div#search_div {
+ position: absolute;
+ left: 50%;
+ width: 49%;
+ top: 0.95em;
+ text-align: right;
+}
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: edit_host_settings.ml,v 1.3 2004/09/24 16:30:07 rich Exp $
+ * $Id: edit_host_settings.ml,v 1.4 2004/09/27 16:21:09 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
let theme_css = q#param "theme_css" in
let feedback_email = q#param "feedback_email" in
let mailing_list = q#param_true "mailing_list" in
+ let search_box = q#param_true "search_box" in
let theme_css = if theme_css = "" then `Null else `String theme_css in
let feedback_email =
(* Update the database. *)
let sth = dbh#prepare_cached "update hosts set edit_anon = ?,
create_account_anon = ?, theme_css = ?,
- feedback_email = ?, mailing_list = ?
+ feedback_email = ?, mailing_list = ?,
+ search_box = ?
where id = ?" in
sth#execute [`Bool edit_anon; `Bool create_account_anon;
- theme_css; feedback_email; `Bool mailing_list;
+ theme_css; feedback_email; `Bool mailing_list; `Bool search_box;
`Int hostid];
dbh#commit ();
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: edit_host_settings_form.ml,v 1.2 2004/09/24 16:30:07 rich Exp $
+ * $Id: edit_host_settings_form.ml,v 1.3 2004/09/27 16:21:09 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
let sth =
dbh#prepare_cached
"select canonical_hostname, edit_anon, create_account_anon, theme_css,
- feedback_email, mailing_list
+ feedback_email, mailing_list, search_box
from hosts where id = ?" in
sth#execute [`Int hostid];
let canonical_hostname, edit_anon, create_account_anon, theme_css,
- feedback_email, mailing_list =
+ feedback_email, mailing_list, search_box =
match sth#fetch1 () with
[ `String canonical_hostname;
`Bool edit_anon; `Bool create_account_anon;
(`String _ | `Null) as theme_css;
(`String _ | `Null) as feedback_email;
- `Bool mailing_list ] ->
+ `Bool mailing_list; `Bool search_box ] ->
let theme_css =
match theme_css with `String s -> s | `Null -> "" in
let feedback_email =
match feedback_email with `String s -> s | `Null -> "" in
canonical_hostname, edit_anon, create_account_anon, theme_css,
- feedback_email, mailing_list
+ feedback_email, mailing_list, search_box
| _ -> assert false in
template#set "canonical_hostname" canonical_hostname;
template#conditional "create_account_anon" create_account_anon;
template#set "feedback_email" feedback_email;
template#conditional "mailing_list" mailing_list;
+ template#conditional "search_box" search_box;
(* Themes table. *)
let table =
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: host_menu.ml,v 1.2 2004/09/24 16:30:07 rich Exp $
+ * $Id: host_menu.ml,v 1.3 2004/09/27 16:21:09 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
dbh#prepare_cached
"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
+ t.name, t.description, h.feedback_email, h.mailing_list,
+ h.search_box
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 =
+ feedback_email, mailing_list, search_box =
match sth#fetch1 () with
[ `String canonical_hostname; `Bool has_global_css;
`Bool edit_anon; `Bool create_account_anon; `Bool has_theme_css;
(`String _ | `Null) as theme_name;
(`String _ | `Null) as theme_description;
(`String _ | `Null) as feedback_email;
- `Bool mailing_list ] ->
+ `Bool mailing_list; `Bool search_box ] ->
let theme_name =
match theme_name with `String s -> s | `Null -> "" in
let theme_description =
| `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
+ feedback_email, mailing_list, search_box
| _ -> assert false in
template#set "canonical_hostname" canonical_hostname;
template#conditional "has_feedback_email" has_feedback_email;
template#set "feedback_email" feedback_email;
template#conditional "mailing_list" mailing_list;
+ template#conditional "search_box" search_box;
q#template template
(* 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.22 2004/09/27 12:37:54 rich Exp $
+ * $Id: page.ml,v 1.23 2004/09/27 16:21:09 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
(* Host-specific fields. *)
let sth = dbh#prepare_cached "select css is not null,
feedback_email is not null,
- mailing_list
+ mailing_list, search_box
from hosts where id = ?" in
sth#execute [`Int hostid];
- let has_host_css, has_feedback_email, mailing_list =
+ let has_host_css, has_feedback_email, mailing_list, search_box =
match sth#fetch1 () with
- | [ `Bool has_host_css; `Bool has_feedback_email; `Bool mailing_list ] ->
- has_host_css, has_feedback_email, mailing_list
+ | [ `Bool has_host_css; `Bool has_feedback_email; `Bool mailing_list;
+ `Bool search_box ] ->
+ has_host_css, has_feedback_email, mailing_list, search_box
| _ -> assert false in
(* Can the user edit? Manage users? etc. *)
t#conditional "has_feedback_email" has_feedback_email;
t#conditional "mailing_list" mailing_list;
+ t#conditional "search_box" search_box;
t#conditional "can_edit" can_edit;
t#conditional "can_manage_users" can_manage_users;
</td>
</tr>
<tr>
+<th> Search box: </th>
+<td>
+<input type="checkbox" name="search_box" value="1" ::if(search_box)::checked="checked"::end:: id="search_box"/><label for="search_box">Search box on each page</label>
+</td>
+</tr>
+<tr>
<th> Theme: </th>
<td>
<select name="theme_css">
</td>
</tr>
<tr>
+<th> Search box: </th>
+<td> ::if(search_box)::Yes::else::No::end:: </td>
+</tr>
+<tr>
<th> Theme: </th>
<td> ::if(has_theme_css)::<strong>::theme_name_html::</strong> <br/> ::theme_description_html:: ::else:: Standard wiki theme ::end:: </td>
</tr>
</ul>
</div>
+::if(search_box)::
+<div id="search_div">
+<form method="get" action="/_bin/search.cmo">
+<input name="q" value=""/><input type="submit" value="Search"/>
+</form>
+</div>
+::end::
+
<div id="footer_div">
<hr/>