* print the header of the tab into the comment before the tab starts.
[citadel.git] / webcit / tabs.c
index 2adaaec9a45c3114fd82fdf9999cd2e141a29c23..d6172de36f9832c7ff512e075b4e47e3d034104b 100644 (file)
@@ -158,22 +158,31 @@ void StrTabbedDialog(StrBuf *Target, int num_tabs, StrBuf *tabnames[]) {
  * num_tabs:    total number oftabs to be printed
  *
  */
-void StrBeginTab(StrBuf *Target, int tabnum, int num_tabs) {
+void StrBeginTab(StrBuf *Target, int tabnum, int num_tabs, StrBuf **Names) {
 
        if (tabnum == num_tabs) {
                StrBufAppendBufPlain(
                        Target, 
-                       HKEY(
-                               "<!-- begin tab-common epilogue -->\n"
-                               "<div class=\"tabcontent_submit\">"), 0);
+                       HKEY("<!-- begin tab-common epilogue ["), 0);
+               StrEscAppend(Target, Names[tabnum], NULL, 0, 2);
+               StrBufAppendBufPlain(
+                       Target, 
+                       HKEY("] -->\n<div class=\"tabcontent_submit\">"), 0);
        }
 
        else {
+               StrBufAppendBufPlain(
+                       Target, 
+                       HKEY("<!-- begin tab"), 0);
+               StrBufAppendPrintf(
+                       Target,  "%d of %d [",
+                       tabnum, num_tabs);
+               
+               StrEscAppend(Target, Names[tabnum], NULL, 0, 2);
+
                StrBufAppendPrintf(
                        Target, 
-                       "<!-- begin tab %d of %d -->\n"
-                       "<div id=\"tabdiv%d\" style=\"display:%s\" class=\"tabcontent\" >",
-                       tabnum, num_tabs, 
+                       "] -->\n<div id=\"tabdiv%d\" style=\"display:%s\" class=\"tabcontent\" >",
                        tabnum,
                        ( (tabnum == 0) ? "block" : "none" )
                        );