* Started writing wiki code. It completely does not work. :)
authorArt Cancro <ajc@citadel.org>
Fri, 20 Jan 2006 21:39:28 +0000 (21:39 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 20 Jan 2006 21:39:28 +0000 (21:39 +0000)
webcit/ChangeLog
webcit/Makefile.in
webcit/messages.c
webcit/webcit.c
webcit/webcit.h
webcit/wiki.c [new file with mode: 0644]

index 9e48525efe6a36185f55e6b3156b6097609ccc68..e21c168c60424defdc4e7428be60f2e896f4a73b 100644 (file)
@@ -1,5 +1,8 @@
 $Id$
 
+Fri Jan 20 16:39:04 EST 2006 ajc
+* Started writing wiki code.  It completely does not work.  :)
+
 Fri Jan 20 21:03:25 CET 2006 dothebart
 * Started with doxygen style comments and doxygen config.
        
index b6cdbaa6d280b011efe5328e409190f80448cb08..d5508a6bfea29a9323d64a40a33553ccc4a47567 100644 (file)
@@ -46,7 +46,7 @@ webserver: webserver.o context_loop.o tools.o ical_dezonify.o \
        vcard.o vcard_edit.o preferences.o html2html.o listsub.o \
        mime_parser.o graphics.o netconf.o siteconfig.o subst.o rss.o \
        calendar.o calendar_tools.o calendar_view.o event.o \
-       availability.o iconbar.o crypto.o inetconf.o notes.o \
+       availability.o iconbar.o crypto.o inetconf.o notes.o wiki.o \
        groupdav_main.o groupdav_get.o groupdav_propfind.o fmt_date.o \
        groupdav_options.o autocompletion.o gettext.o tabs.o \
        groupdav_delete.o groupdav_put.o http_datestring.o setup_wizard.o \
@@ -56,7 +56,7 @@ webserver: webserver.o context_loop.o tools.o ical_dezonify.o \
        roomops.o messages.o userlist.o paging.o sysmsgs.o useredit.o \
        locate_host.o siteconfig.o subst.o vcard.o vcard_edit.o floors.o \
        mime_parser.o graphics.o netconf.o preferences.o html2html.o rss.o \
-       summary.o calendar.o calendar_tools.o calendar_view.o event.o \
+       summary.o calendar.o calendar_tools.o calendar_view.o event.o wiki.o \
        availability.o ical_dezonify.o iconbar.o crypto.o inetconf.o notes.o \
        groupdav_main.o groupdav_get.o groupdav_propfind.o groupdav_delete.o \
        groupdav_options.o autocompletion.o tabs.o \
index 4bde21073c7cb5e06fc6a7c069def2208ae1e19f..0009f6b9c0292cedf508cc51023c3e965506a958 100644 (file)
@@ -1860,6 +1860,12 @@ void readloop(char *oper)
        char *datesort_button;
        int bbs_reverse = 0;
 
+       if (WC->wc_view == VIEW_WIKI) {
+               sprintf(buf, "wiki/%s/home", WC->wc_roomname);
+               http_redirect(buf);
+               return;
+       }
+
        startmsg = atol(bstr("startmsg"));
        maxmsgs = atoi(bstr("maxmsgs"));
        is_summary = atoi(bstr("summary"));
index 7220a5d7eae9eaf010e3bf3129cfa4e6563dfc10..b702b3f626e90bf5246a790ede576b16825b28c7 100644 (file)
@@ -1327,6 +1327,8 @@ void session_loop(struct httprequest *req)
                print_message(arg1);
        } else if (!strcasecmp(action, "msgheaders")) {
                display_headers(arg1);
+       } else if (!strcasecmp(action, "wiki")) {
+               display_wiki_page(arg1, arg2);
        } else if (!strcasecmp(action, "display_enter")) {
                display_enter();
        } else if (!strcasecmp(action, "post")) {
index d7708f68fbbec1387dbb4e34de6bb375af810b22..06f1b820b522a0fa3fbc4d383a576c8cff96dbfb 100644 (file)
@@ -658,6 +658,7 @@ void httplang_to_locale(char *LocaleString);
 void tabbed_dialog(int num_tabs, char *tabnames[]);
 void begin_tab(int tabnum, int num_tabs);
 void end_tab(int tabnum, int num_tabs);
+void display_wiki_page(char *roomname, char *pagename);
 
 void embed_room_banner(char *, int);
 
diff --git a/webcit/wiki.c b/webcit/wiki.c
new file mode 100644 (file)
index 0000000..dc72dba
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * $Id:  $
+ */
+/**
+ *
+ * \defgroup Wiki Wiki; Functions pertaining to rooms with a wiki view
+ *
+ */
+
+/*@{*/
+#include "webcit.h"
+
+
+
+/** 
+ * \brief Convert a string to something suitable as a wiki index
+ *
+ * \param s The string to be converted.
+ */
+void str_wiki_index(char *s)
+{
+       int i;
+
+       if (s == NULL) return;
+
+       /* First remove all non-alphanumeric characters */
+       for (i=0; i<strlen(s); ++i) {
+               if (!isalnum(s[i])) {
+                       strcpy(&s[i], &s[i+1]);
+               }
+       }
+
+       /* Then make everything lower case */
+       for (i=0; i<strlen(s); ++i) {
+               s[i] = tolower(s[i]);
+       }
+}
+
+/**
+ * \brief Display a specific page from a wiki room
+ *
+ * \param roomname The name of the room containing the wiki
+ * \param pagename The index of the page being requested
+ */
+void display_wiki_page(char *roomname, char *pagename)
+{
+       output_headers(1, 1, 1, 0, 0, 0);
+
+       wprintf("roomname=%s<br>pagename=%s<br>\n", roomname, pagename);
+
+       wDumpContent(1);
+}
+
+
+/** @} */