dont abort
[citadel.git] / webcit / tabs.c
index 53b8e87c06558cda72da79918ccb221b664ec4d6..4b58ba590a64c086ce8eba75dd18583f63ff4655 100644 (file)
@@ -1,7 +1,3 @@
-/*
- * $Id$
- *
- */
 #include <stdarg.h>
 #define SHOW_ME_VAPPEND_PRINTF
 #include "webcit.h"
@@ -9,7 +5,7 @@
 /*
  * print tabbed dialog
  */
-void tabbed_dialog(int num_tabs, char *tabnames[]) {
+void tabbed_dialog(int num_tabs, const char *tabnames[]) {
        int i;
 
        StrBufAppendPrintf(WC->trailing_javascript,
@@ -86,13 +82,6 @@ void end_tab(int tabnum, int num_tabs) {
        else {
                wc_printf("</div>\n");
                wc_printf("<!-- end tab %d of %d -->\n", tabnum, num_tabs);
-       
-               if (tabnum == num_tabs-1) {
-                       wc_printf("<script type=\"text/javascript\">"
-                               " Nifty(\"table#TheTabs td\", \"small transparent top\");"
-                               "</script>"
-                       );
-               }
        }
 }
 
@@ -138,7 +127,7 @@ void StrTabbedDialog(StrBuf *Target, int num_tabs, StrBuf *tabnames[]) {
                        ( (i==0) ? "tab_cell_label" : "tab_cell_edit" ),
                        i
                        );
-               StrBufAppendBuf(Target, tabnames[i], 0);
+               StrEscAppend(Target, tabnames[i], NULL, 0, 0);
                StrBufAppendBufPlain(
                        Target, 
                        HKEY(
@@ -173,7 +162,7 @@ void StrBeginTab(StrBuf *Target, int tabnum, int num_tabs, StrBuf **Names) {
        else {
                StrBufAppendBufPlain(
                        Target, 
-                       HKEY("<!-- begin tab"), 0);
+                       HKEY("<!-- begin tab "), 0);
                StrBufAppendPrintf(
                        Target,  "%d of %d [",
                        tabnum, num_tabs);
@@ -209,18 +198,10 @@ void StrEndTab(StrBuf *Target, int tabnum, int num_tabs) {
                StrBufAppendPrintf(
                        Target, 
                        "</div>\n",
-                       "<!-- end tab %d of %d -->\n", tabnum, num_tabs);
-       
-               if (tabnum == num_tabs-1) {
-                       StrBufAppendBufPlain(
-                               Target, 
-                               HKEY(
-                                       "<script type=\"text/javascript\">"
-                                       " Nifty(\"table#TheTabs td\", \"small transparent top\");"
-                                       "</script>"), 0);
-               }
+                       "<!-- end tab %d of %d -->\n", tabnum, num_tabs
+               );
        }
-       if (HAVEBSTR("last_tabsel"))
+       if (havebstr("last_tabsel"))
        {
                StrBufAppendPrintf(Target, "<script type=\"text/javascript\">tabsel(%s);</script>", BSTR("last_tabsel"));
        }