* print the header of the tab into the comment before the tab starts.
authorWilfried Göesgens <willi@citadel.org>
Sat, 14 Aug 2010 15:01:28 +0000 (15:01 +0000)
committerWilfried Göesgens <willi@citadel.org>
Sat, 14 Aug 2010 15:01:28 +0000 (15:01 +0000)
webcit/subst.c
webcit/tabs.c
webcit/webcit.h

index ee0e324e726bafe5cd84db4083d9f5ff5f72b6b1..02d9fa550b02b3a226eda089bd4c7b009d35a550 100644 (file)
@@ -2741,7 +2741,7 @@ void tmpl_do_tabbed(StrBuf *Target, WCTemplputParams *TP)
 
        StrTabbedDialog(Target, nTabs, TabNames);
        for (i = 0; i < ntabs; i++) {
-               StrBeginTab(Target, i, nTabs);
+               StrBeginTab(Target, i, nTabs, TabNames);
                DoTemplate(TKEY(i * 2 + 1), Target, TP);
                StrEndTab(Target, i, nTabs);
        }
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" )
                        );
index 279c540e2e76629c816ad56f358d0d61866e8928..730739485da1e416b0b9ba56465dcd1707be212e 100644 (file)
@@ -807,7 +807,7 @@ long unescape_input(char *buf);
 void check_thread_pool_size(void);
 void spawn_another_worker_thread(void);
 void StrEndTab(StrBuf *Target, int tabnum, int num_tabs);
-void StrBeginTab(StrBuf *Target, int tabnum, int num_tabs);
+void StrBeginTab(StrBuf *Target, int tabnum, int num_tabs, StrBuf **Names);
 void StrTabbedDialog(StrBuf *Target, int num_tabs, StrBuf *tabnames[]);
 void tabbed_dialog(int num_tabs, char *tabnames[]);
 void begin_tab(int tabnum, int num_tabs);