From d6978d316016d0c96753ace2a2e474c50bd40c42 Mon Sep 17 00:00:00 2001 From: rich Date: Wed, 8 Sep 2004 14:47:47 +0000 Subject: [PATCH] Editable site menu. --- scripts/Makefile | 3 +- scripts/edit_sitemenu.ml | 300 +++++++++++++++++++++++++++++++++++++++++++ templates/edit_sitemenu.html | 56 ++++++++ templates/page.html | 5 +- 4 files changed, 362 insertions(+), 2 deletions(-) create mode 100644 scripts/edit_sitemenu.ml create mode 100644 templates/edit_sitemenu.html diff --git a/scripts/Makefile b/scripts/Makefile index 987806b..423e712 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -1,5 +1,5 @@ # Makefile for COCANWIKI. -# $Id: Makefile,v 1.8 2004/09/08 12:45:38 rich Exp $ +# $Id: Makefile,v 1.9 2004/09/08 14:47:47 rich Exp $ include ../Makefile.config @@ -31,6 +31,7 @@ OBJS := create.cmo \ edit.cmo \ edit_page_css.cmo \ edit_page_css_form.cmo \ + edit_sitemenu.cmo \ edit_user.cmo \ edit_user_form.cmo \ file.cmo \ diff --git a/scripts/edit_sitemenu.ml b/scripts/edit_sitemenu.ml new file mode 100644 index 0000000..25997e8 --- /dev/null +++ b/scripts/edit_sitemenu.ml @@ -0,0 +1,300 @@ +(* COCANWIKI scripts. + * Written by Richard W.M. Jones . + * Copyright (C) 2004 Merjis Ltd. + * $Id: edit_sitemenu.ml,v 1.1 2004/09/08 14:47:47 rich Exp $ + *) + +open Apache +open Registry +open Cgi +open Printf + +open ExtString +open ExtList + +open Cocanwiki +open Cocanwiki_template +open Cocanwiki_ok +open Cocanwiki_emailnotify +open Cocanwiki_strings + +let template = get_template "edit_sitemenu.html" + +(* We keep an "internal model" of the menu - see build_internal_model () + * below. + *) +type model_t = (string * string) list (* label, url *) + +let run r (q : cgi) (dbh : Dbi.connection) (hostid, hostname, _) _ = + (* Workaround bugs in IE, specifically lack of support for + + +::end:: + + +-> + + +

+ +

+::end:: + + + + + + +
+ + + + + \ No newline at end of file diff --git a/templates/page.html b/templates/page.html index df3fe71..77a4353 100644 --- a/templates/page.html +++ b/templates/page.html @@ -63,11 +63,14 @@
  • Images
  • Files
  • Edit stylesheet for this page
  • -
  • Wiki administration
  • +
  • Edit site menu
  • ::end:: ::if(can_manage_users)::
  • Manage users
  • ::end:: +::if(can_edit):: +
  • Server administration
  • +::end::
    -- 1.8.3.1