* skeleton code for a wiki pagelist screen
authorArt Cancro <ajc@citadel.org>
Tue, 10 Nov 2009 18:23:07 +0000 (18:23 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 10 Nov 2009 18:23:07 +0000 (18:23 +0000)
webcit/static/t/wiki_pagelist.html [new file with mode: 0644]
webcit/wiki.c

diff --git a/webcit/static/t/wiki_pagelist.html b/webcit/static/t/wiki_pagelist.html
new file mode 100644 (file)
index 0000000..ddf9519
--- /dev/null
@@ -0,0 +1 @@
+<?DOBOXED("wiki_pagelist_inner", _("List of Wiki pages"))>
index d42802a8eb3331af0f8d97e5e2a0b139f3ed91b5..d72c281b3b41f411c3949a7de3133bed9d0b6d62 100644 (file)
@@ -249,6 +249,44 @@ void display_wiki_history(void)
 }
 
 
+/*
+ * 
+ */
+void tmplput_display_wiki_pagelist(StrBuf *Target, WCTemplputParams *TP)
+{
+       const StrBuf *roomname;
+
+       roomname = sbstr("room");
+       if (StrLength(roomname) > 0) {
+               /* If we're not in the correct room, try going there. */
+               if (strcasecmp(ChrPtr(roomname), ChrPtr(WC->wc_roomname))) {
+                       gotoroom(roomname);
+               }
+       
+               /* If we're still not in the correct room, it doesn't exist. */
+               if (strcasecmp(ChrPtr(roomname), ChrPtr(WC->wc_roomname))) {
+                       wc_printf(_("There is no room called '%s'."), ChrPtr(roomname));
+                       return;
+               }
+       }
+
+
+       /* FIXME put something here */
+}
+
+
+
+/*
+ * 
+ */
+void display_wiki_pagelist(void)
+{
+       output_headers(1, 1, 1, 0, 0, 0);
+       do_template("wiki_pagelist", NULL);
+       wDumpContent(1);
+}
+
+
 int wiki_Cleanup(void **ViewSpecific)
 {
        char pagename[5];
@@ -273,5 +311,6 @@ InitModule_WIKI
 
        WebcitAddUrlHandler(HKEY("wiki"), "", 0, display_wiki_page, 0);
        WebcitAddUrlHandler(HKEY("wiki_history"), "", 0, display_wiki_history, 0);
+       WebcitAddUrlHandler(HKEY("wiki_pagelist"), "", 0, display_wiki_pagelist, 0);
        RegisterNamespace("WIKI:DISPLAYHISTORY", 0, 0, tmplput_display_wiki_history, NULL, CTX_NONE);
 }