* When editing a wiki page, insert the existing version of the page into the editor...
authorArt Cancro <ajc@citadel.org>
Tue, 6 Oct 2009 20:45:42 +0000 (20:45 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 6 Oct 2009 20:45:42 +0000 (20:45 +0000)
webcit/msg_renderers.c
webcit/static/t/edit_message.html
webcit/static/t/view_message_wikiedit.html [new file with mode: 0644]

index eeccd46ee121460e56d9f5d48bdcb65bfe241736..e16ae34bae60bad33ce3e66ce478460d28e0d85a 100644 (file)
@@ -1,5 +1,6 @@
 #include "webcit.h"
 #include "webserver.h"
+#include "groupdav.h"
 
 /*
  * message index functions
@@ -798,6 +799,21 @@ void tmplput_EDIT_MAIL_BODY(StrBuf *Target, WCTemplputParams *TP)
        FreeStrBuf(&Buf);
 }
 
+void tmplput_EDIT_WIKI_BODY(StrBuf *Target, WCTemplputParams *TP)      // FIXME
+{
+       const StrBuf *Mime;
+        long msgnum;
+       StrBuf *Buf;
+
+       msgnum = locate_message_by_uid(BSTR("wikipage"));
+       if (msgnum >= 0L) {
+               Buf = NewStrBuf();
+               read_message(Buf, HKEY("view_message_wikiedit"), msgnum, NULL, &Mime);
+               StrBufAppendTemplate(Target, TP, Buf, 1);
+               FreeStrBuf(&Buf);
+       }
+}
+
 void tmplput_MAIL_BODY(StrBuf *Target, WCTemplputParams *TP)
 {
        message_summary *Msg = (message_summary*) CTX;
@@ -1492,6 +1508,7 @@ InitModule_MSGRENDERERS
        RegisterNamespace("MAIL:BODY", 0, 2, tmplput_MAIL_BODY,  CTX_MAILSUM);
        RegisterNamespace("MAIL:QUOTETEXT", 1, 2, tmplput_QUOTED_MAIL_BODY,  CTX_NONE);
        RegisterNamespace("MAIL:EDITTEXT", 1, 2, tmplput_EDIT_MAIL_BODY,  CTX_NONE);
+       RegisterNamespace("MAIL:EDITWIKI", 1, 2, tmplput_EDIT_WIKI_BODY,  CTX_NONE);
        RegisterConditional(HKEY("COND:MAIL:SUMM:RFCA"), 0, Conditional_MAIL_SUMM_RFCA,  CTX_MAILSUM);
        RegisterConditional(HKEY("COND:MAIL:SUMM:CCCC"), 0, Conditional_MAIL_SUMM_CCCC,  CTX_MAILSUM);
        RegisterConditional(HKEY("COND:MAIL:SUMM:UNREAD"), 0, Conditional_MAIL_SUMM_UNREAD, CTX_MAILSUM);
index 0a9b4dd7f92e9a8626753c8f5f10e03e94479eb4..81a29406b41ab0d7fba16783d5a3bc56a6085888 100644 (file)
   <??("X", 5)>
 <?!("X", 4)>
 <?!("COND:ROOM:TYPE_IS", 7, "VIEW_WIKI")>
-FIXME insert the contents of the page called <b><tt><?BSTR("wikipage")></tt></b> here.
+<?MAIL:EDITWIKI("X")>
 <?!("X", 7)>
 </textarea>
 <?=("richedit")>
diff --git a/webcit/static/t/view_message_wikiedit.html b/webcit/static/t/view_message_wikiedit.html
new file mode 100644 (file)
index 0000000..cc4d790
--- /dev/null
@@ -0,0 +1,4 @@
+<div class="message_content">
+<?MAIL:BODY>
+<?!("COND:MAIL:MIME:ATTACH:SUBMESSAGES", 10)><?ITERATE("MAIL:MIME:ATTACH:SUBMESSAGES", "view_message_inline_attach")><?!("X", 10)>
+</div>