From: Art Cancro Date: Tue, 6 Oct 2009 20:45:42 +0000 (+0000) Subject: * When editing a wiki page, insert the existing version of the page into the editor... X-Git-Tag: v7.86~793 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=c13875c0b9e4b352589bc6c2de0d60a4de7f304a * When editing a wiki page, insert the existing version of the page into the editor window. --- diff --git a/webcit/msg_renderers.c b/webcit/msg_renderers.c index eeccd46ee..e16ae34ba 100644 --- a/webcit/msg_renderers.c +++ b/webcit/msg_renderers.c @@ -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); diff --git a/webcit/static/t/edit_message.html b/webcit/static/t/edit_message.html index 0a9b4dd7f..81a29406b 100644 --- a/webcit/static/t/edit_message.html +++ b/webcit/static/t/edit_message.html @@ -115,7 +115,7 @@ -FIXME insert the contents of the page called here. + diff --git a/webcit/static/t/view_message_wikiedit.html b/webcit/static/t/view_message_wikiedit.html new file mode 100644 index 000000000..cc4d79071 --- /dev/null +++ b/webcit/static/t/view_message_wikiedit.html @@ -0,0 +1,4 @@ +
+ + +