* Repaired pieces of the wiki engine that have fallen into disrepair.
authorArt Cancro <ajc@citadel.org>
Tue, 6 Oct 2009 03:38:06 +0000 (03:38 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 6 Oct 2009 03:38:06 +0000 (03:38 +0000)
webcit/groupdav_propfind.c
webcit/static/t/edit_message.html
webcit/wiki.c

index 35b08bb9ed49e05f01e167a67198d9ef6844ad9c..2a2821f39938c2240c0afedd4a3a52b44277ca49 100644 (file)
@@ -6,8 +6,7 @@
  * A few notes about our XML output:
  *
  * --> Yes, we are spewing tags directly instead of using an XML library.
- *     If you would like to rewrite this using libxml2, code it up and submit
- *     a patch.  Whining will be summarily ignored.
+ *     Whining about it will be summarily ignored.
  *
  * --> XML is deliberately output with no whitespace/newlines between tags.
  *     This makes it difficult to read, but we have discovered clients which
@@ -74,7 +73,7 @@ void groupdav_collection_list(void)
        now = time(NULL);
        http_datestring(datestring, sizeof datestring, now);
 
-       /**
+       /*
         * Be rude.  Completely ignore the XML request and simply send them
         * everything we know about.  Let the client sort it out.
         */
@@ -90,8 +89,8 @@ void groupdav_collection_list(void)
                "<multistatus xmlns=\"DAV:\" xmlns:G=\"http://groupdav.org/\">"
        );
 
-       /**
-        *      If the client is requesting the root, show a root node.
+       /*
+        * If the client is requesting the root, show a root node.
         */
        if (starting_point == 0) {
                wprintf("<response>");
@@ -112,8 +111,8 @@ void groupdav_collection_list(void)
                wprintf("</response>");
        }
 
-       /**
-        *      If the client is requesting "/groupdav", show a /groupdav subdirectory.
+       /*
+        * If the client is requesting "/groupdav", show a /groupdav subdirectory.
         */
        if ((starting_point + WCC->Hdr->HR.dav_depth) >= 1) {
                wprintf("<response>");
@@ -134,8 +133,8 @@ void groupdav_collection_list(void)
                wprintf("</response>");
        }
 
-       /**
-        *      Now go through the list and make it look like a DAV collection
+       /*
+        * Now go through the list and make it look like a DAV collection
         */
        serv_puts("LKRA");
        serv_getln(buf, sizeof buf);
@@ -157,11 +156,13 @@ void groupdav_collection_list(void)
                 * GroupDAV calendar even if the user has switched it to a
                 * Calendar List view.
                 */
-               if ((view == VIEW_CALENDAR) || 
-                   (view == VIEW_TASKS) || 
-                   (view == VIEW_ADDRESSBOOK) ||
-                   (view == VIEW_NOTES) ||
-                   (view == VIEW_JOURNAL) ) {
+               if (    (view == VIEW_CALENDAR) || 
+                       (view == VIEW_TASKS) || 
+                       (view == VIEW_ADDRESSBOOK) ||
+                       (view == VIEW_NOTES) ||
+                       (view == VIEW_JOURNAL) ||
+                       (view == VIEW_WIKI)
+               ) {
                        is_groupware_collection = 1;
                }
                else {
@@ -201,6 +202,9 @@ void groupdav_collection_list(void)
                        case VIEW_JOURNAL:
                                wprintf("<G:vjournal-collection />");
                                break;
+                       case VIEW_WIKI:
+                               wprintf("<G:wiki-collection />");
+                               break;
                        }
 
                        wprintf("</resourcetype>");
@@ -363,13 +367,13 @@ void groupdav_propfind(void)
        );
 
 
-       /** Transmit the collection resource (FIXME check depth and starting point) */
+       /* Transmit the collection resource (FIXME check depth and starting point) */
        wprintf("<response>");
 
        wprintf("<href>");
-               groupdav_identify_host();
-               wprintf("/groupdav/");
-               urlescputs(ChrPtr(WCC->wc_roomname));
+       groupdav_identify_host();
+       wprintf("/groupdav/");
+       urlescputs(ChrPtr(WCC->wc_roomname));
        wprintf("</href>");
 
        wprintf("<propstat>");
@@ -402,9 +406,9 @@ void groupdav_propfind(void)
        wprintf("</propstat>");
        wprintf("</response>");
 
-       /** Transmit the collection listing (FIXME check depth and starting point) */
+       /* Transmit the collection listing (FIXME check depth and starting point) */
 
-       MsgNum = NewStrBuf ();
+       MsgNum = NewStrBuf();
        serv_puts("MSGS ALL");
 
        StrBuf_ServGetln(MsgNum);
index 1c16c178592da4842242b2779e2aa60dd51afbba..43efcff220e6cb2ec6a3cb0ecdc4ec339f3f7eb4 100644 (file)
@@ -8,6 +8,7 @@
 <input type="hidden" name="nonce" value="<?NONCE>">
 <input type="hidden" name="force_room" value="<?ROOMNAME("X")>">
 <input type="hidden" name="references" value="<?BSTR("references")>">
+<input type="hidden" name="wikipage" value="<?BSTR("wikipage")>">
 
 <p class="send_edit_msg">
 <?!("COND:SUBST", 1, "RCPTREQUIRED")><input type="submit" name="send_button" value="<?_("Send message")>"><?!("X", 1)>
index efc3c88902a9b19bbe5bb264799f3b118ae5e546..adc3fb86837b28d7dca9c997e8b013cb30ec2293 100644 (file)
@@ -106,7 +106,7 @@ int wiki_GetParamsGetServerCall(SharedMessageStatus *Stat,
                                           long len)
 {
        char buf[SIZ];
-       sprintf(buf, "wiki?room=%s&page=home", ChrPtr(WC->wc_roomname));
+       sprintf(buf, "wiki?room=%s?page=home", ChrPtr(WC->wc_roomname));
        http_redirect(buf);
        return 300;
 }
@@ -122,10 +122,9 @@ InitModule_WIKI
                NULL,
                NULL,
                NULL
-               );
+       );
 
        WebcitAddUrlHandler(HKEY("wiki"), display_wiki_page, 0);
-       return ;
 }