* copy daves great handler script and modify it to fit the simpler needs of webcit.
[citadel.git] / webcit / wiki.c
index 6c74212d5a8fded65120271c55f7d99f1d94c53d..7a9a66c9d9491b5a4422e7e4f972c3e39e9a7f70 100644 (file)
@@ -1,22 +1,14 @@
 /*
- * $Id:  $
- */
-/**
- *
- * \defgroup Wiki Wiki; Functions pertaining to rooms with a wiki view
+ * $Id$
  *
+ * Functions pertaining to rooms with a wiki view
  */
 
-/*@{*/
 #include "webcit.h"
 #include "groupdav.h"
 
-
-
-/** 
- * \brief Convert a string to something suitable as a wiki index
- *
- * \param s The string to be converted.
+/* 
+ * Convert a string to something suitable as a wiki index
  */
 void str_wiki_index(char *s)
 {
@@ -37,8 +29,8 @@ void str_wiki_index(char *s)
        }
 }
 
-/**
- * \brief Display a specific page from a wiki room
+/*
+ * Display a specific page from a wiki room
  */
 void display_wiki_page(void)
 {
@@ -51,7 +43,7 @@ void display_wiki_page(void)
        safestrncpy(pagename, bstr("page"), sizeof pagename);
        str_wiki_index(pagename);
 
-       if (strlen(roomname) > 0) {
+       if (!IsEmptyStr(roomname)) {
 
                /* If we're not in the correct room, try going there. */
                if (strcasecmp(roomname, WC->wc_roomname)) {
@@ -77,7 +69,7 @@ void display_wiki_page(void)
                return;
        }
 
-       if (strlen(pagename) == 0) {
+       if (IsEmptyStr(pagename)) {
                strcpy(pagename, "home");
        }
 
@@ -106,5 +98,10 @@ void display_wiki_page(void)
        wDumpContent(1);
 }
 
-
-/** @} */
+void 
+InitModule_WIKI
+(void)
+{
+       WebcitAddUrlHandler(HKEY("wiki"), display_wiki_page, 0);
+       return ;
+}