]> code.citadel.org Git - citadel.git/blobdiff - webcit/webcit.c
* add transitional beginboxx template and move some places to the new syntax
[citadel.git] / webcit / webcit.c
index 91bbc4e86ac349c8755148e335f87288f8c4b70a..c2866279e847c260c6e282df4e8ab688fa51f868 100644 (file)
@@ -385,7 +385,10 @@ void hprintf(const char *format,...)
 void tmplput_trailing_javascript(StrBuf *Target, int nArgs, WCTemplateToken *Tokens, void *vContext, int ContextType)
 {
        struct wcsession *WCC = WC;
-       StrBufAppendBuf(WCC->WBuf, WCC->trailing_javascript, 0);
+
+       if (WCC != NULL)
+               StrBufAppendTemplate(Target, nArgs, Tokens, vContext, ContextType,
+                                    WCC->trailing_javascript, 0);
 }
 
 /*
@@ -790,7 +793,7 @@ void print_menu_box(char* Title, char *Class, int nLines, ...)
        long i;
        
        svput("BOXTITLE", WCS_STRING, Title);
-       do_template("beginbox", NULL);
+       do_template("beginboxx", NULL);
        
        wprintf("<ul class=\"%s\">", Class);
        
@@ -1907,6 +1910,11 @@ void tmplput_importantmessage(StrBuf *Target, int nArgs, WCTemplateToken *Tokens
        struct wcsession *WCC = WC;
        
        if (WCC != NULL) {
+/*
+               StrBufAppendTemplate(Target, nArgs, Tokens, Context, ContextType,
+                                    WCC->ImportantMessage, 0);
+*/
+               WCC->ImportantMessage[0] = '\0';
                StrEscAppend(Target, NULL, WCC->ImportantMessage, 0, 0);
                        WCC->ImportantMessage[0] = '\0';
        }
@@ -1925,9 +1933,12 @@ int ConditionalBstr(WCTemplateToken *Tokens, void *Context, int ContextType)
 
 void tmplput_bstr(StrBuf *Target, int nArgs, WCTemplateToken *Tokens, void *Context, int ContextType)
 {
-       StrBufAppendBuf(Target, 
-                       SBstr(Tokens->Params[0]->Start, 
-                             Tokens->Params[0]->len), 0);
+       const StrBuf *Buf = SBstr(Tokens->Params[0]->Start, 
+                           Tokens->Params[0]->len);
+       if (Buf != NULL)
+               StrBufAppendTemplate(Target, nArgs, Tokens, 
+                                    Context, ContextType,
+                                    Buf, 1);
 }