The 'edit room' tab panel now uses the same CSS that is used
authorArt Cancro <ajc@citadel.org>
Sun, 22 Jun 2008 04:36:04 +0000 (04:36 +0000)
committerArt Cancro <ajc@citadel.org>
Sun, 22 Jun 2008 04:36:04 +0000 (04:36 +0000)
in the tabs.c API.  This eliminates the problem with tabs breaking out into two
floating rows on narrow screens.

webcit/roomops.c
webcit/tabs.c

index 788b8cfe1a01ce9d58238adf0b91b8fff8522b4c..6fb8bafb43814103dba002f8bc4034e6c22040ab 100644 (file)
@@ -1136,10 +1136,15 @@ void display_editroom(void)
 
        wprintf("<div class=\"fix_scrollbar_bug\">");
 
-       /** print the tabbed dialog */
-       wprintf("<ul class=\"tabbed_dialog\">\n");
+       wprintf("<br />\n");
 
-       wprintf("<li class=\"tablabel ");
+       /* print the tabbed dialog */
+       wprintf("<div align=\"center\">");
+       wprintf("<table id=\"AdminTabs\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\""
+               "<tr align=\"center\" style=\"cursor:pointer\"><td>&nbsp;</td>"
+               );
+
+       wprintf("<td class=\"");
        if (!strcmp(tab, "admin")) {
                wprintf(" tab_cell_label\">");
                wprintf(_("Administration"));
@@ -1149,11 +1154,12 @@ void display_editroom(void)
                wprintf(_("Administration"));
                wprintf("</a>");
        }
-       wprintf("</li>\n");
+       wprintf("</td>\n");
+       wprintf("<td>&nbsp;</td>\n");
 
        if ( (WC->axlevel >= 6) || (WC->is_room_aide) ) {
 
-               wprintf("<li class=\"tablabel ");
+               wprintf("<td class=\"");
                if (!strcmp(tab, "config")) {
                        wprintf(" tab_cell_label\">");
                        wprintf(_("Configuration"));
@@ -1163,9 +1169,10 @@ void display_editroom(void)
                        wprintf(_("Configuration"));
                        wprintf("</a>");
                }
-               wprintf("</li>\n");
+               wprintf("</td>\n");
+               wprintf("<td>&nbsp;</td>\n");
 
-               wprintf("<li class=\"tablabel ");
+               wprintf("<td class=\"");
                if (!strcmp(tab, "expire")) {
                        wprintf(" tab_cell_label\">");
                        wprintf(_("Message expire policy"));
@@ -1175,9 +1182,10 @@ void display_editroom(void)
                        wprintf(_("Message expire policy"));
                        wprintf("</a>");
                }
-               wprintf("</li>\n");
+               wprintf("</td>\n");
+               wprintf("<td>&nbsp;</td>\n");
        
-               wprintf("<li class=\"tablabel ");
+               wprintf("<td class=\"");
                if (!strcmp(tab, "access")) {
                        wprintf(" tab_cell_label\">");
                        wprintf(_("Access controls"));
@@ -1187,9 +1195,10 @@ void display_editroom(void)
                        wprintf(_("Access controls"));
                        wprintf("</a>");
                }
-               wprintf("</li>\n");
+               wprintf("</td>\n");
+               wprintf("<td>&nbsp;</td>\n");
 
-               wprintf("<li class=\"tablabel ");
+               wprintf("<td class=\"");
                if (!strcmp(tab, "sharing")) {
                        wprintf(" tab_cell_label\">");
                        wprintf(_("Sharing"));
@@ -1199,9 +1208,10 @@ void display_editroom(void)
                        wprintf(_("Sharing"));
                        wprintf("</a>");
                }
-               wprintf("</li>\n");
+               wprintf("</td>\n");
+               wprintf("<td>&nbsp;</td>\n");
 
-               wprintf("<li class=\"tablabel ");
+               wprintf("<td class=\"");
                if (!strcmp(tab, "listserv")) {
                        wprintf(" tab_cell_label\">");
                        wprintf(_("Mailing list service"));
@@ -1211,11 +1221,12 @@ void display_editroom(void)
                        wprintf(_("Mailing list service"));
                        wprintf("</a>");
                }
-               wprintf("</li>\n");
+               wprintf("</td>\n");
+               wprintf("<td>&nbsp;</td>\n");
 
        }
 
-       wprintf("<li class=\"tablabel ");
+       wprintf("<td class=\"");
        if (!strcmp(tab, "feeds")) {
                wprintf(" tab_cell_label\">");
                wprintf(_("Remote retrieval"));
@@ -1225,11 +1236,18 @@ void display_editroom(void)
                wprintf(_("Remote retrieval"));
                wprintf("</a>");
        }
-       wprintf("</li>\n");
+       wprintf("</td>\n");
+       wprintf("<td>&nbsp;</td>\n");
 
-       wprintf("</ul>\n");
+       wprintf("</tr></table>\n");
+       wprintf("</div>\n");
        /* end tabbed dialog */ 
 
+       wprintf("<script type=\"text/javascript\">"
+               " Nifty(\"table#AdminTabs td\", \"small transparent top\");"
+               "</script>"
+       );
+
        /* begin content of whatever tab is open now */
 
        if (!strcmp(tab, "admin")) {
index 6ef4bfde6b2b36250f0aa21196304bcea4605b39..c87cf4a4c269e43bdcd544e226faca256be8c17f 100644 (file)
@@ -1,17 +1,12 @@
 /*
  * $Id$
+ *
  */
-/**
- * \defgroup TabUtils Utility functions for creating tabbed dialogs
- * \ingroup WebcitDisplayItems
- */
-/*@{*/
+
 #include "webcit.h"
 
-/**
- * \brief print tabbed dialog
- * \param num_tabs how many tabs do we have?
- * \param tabnames the headers of the tables
+/*
+ * print tabbed dialog
  */
 void tabbed_dialog(int num_tabs, char *tabnames[]) {
        int i;
@@ -53,10 +48,12 @@ void tabbed_dialog(int num_tabs, char *tabnames[]) {
        wprintf("</tr></table>\n");
 }
 
-/**
- * \brief print the tab-header
- * \param tabnum number of the tab to print
- * \param num_tabs total number oftabs to be printed
+/*
+ * print the tab-header
+ *
+ * tabnum:      number of the tab to print
+ * num_tabs:    total number oftabs to be printed
+ *
  */
 void begin_tab(int tabnum, int num_tabs) {
        wprintf("<!-- begin tab %d of %d -->\n", tabnum, num_tabs);
@@ -66,10 +63,11 @@ void begin_tab(int tabnum, int num_tabs) {
        );
 }
 
-/**
- * \brief print the tab-footer
- * \param tabnum number of the tab to print
- * \param num_tabs total number of tabs to be printed
+/*
+ * print the tab-footer
+ * tabnum:      number of the tab to print
+ * num_tabs:    total number of tabs to be printed
+ *
  */
 void end_tab(int tabnum, int num_tabs) {
        wprintf("</div>\n");
@@ -86,4 +84,3 @@ void end_tab(int tabnum, int num_tabs) {
 }
 
 
-/*@}*/