]> code.citadel.org Git - citadel.git/blobdiff - webcit/roomops.c
* Repaired all my b0rken COLOR tags
[citadel.git] / webcit / roomops.c
index 3be38e15996c9410933a20620c290b3d8c64f5bd..66ffe4dd46c5d9f915890aaa1a4d748f4a2d38c5 100644 (file)
@@ -270,9 +270,8 @@ void list_all_rooms_by_floor(void)
 void zapped_list(void)
 {
        output_headers(1);
-       wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=770000><TR><TD>");
-       wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
-       wprintf("<B>Zapped (forgotten) rooms</B>\n");
+       wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#770000\"><TR><TD>");
+       wprintf("<SPAN CLASS=\"titlebar\">Zapped (forgotten) rooms</SPAN>\n");
        wprintf("</TD></TR></TABLE><BR>\n");
        listrms("LZRM -1");
        wprintf("<BR><BR>\n");
@@ -309,7 +308,7 @@ void embed_room_graphic(void) {
        serv_puts("OIMG _roompic_");
        serv_gets(buf);
        if (buf[0] == '2') {
-               wprintf("<TD BGCOLOR=444455>");
+               wprintf("<TD BGCOLOR=\"#444455\">");
                wprintf("<IMG SRC=\"/image&name=_roompic_&room=");
                urlescputs(WC->wc_roomname);
                wprintf("\"></TD>");
@@ -328,8 +327,8 @@ void embed_newmail_button(void) {
                        "<A HREF=\"/dotgoto?room=_MAIL_\">"
                        "<IMG SRC=\"/static/mail.gif\" border=0 "
                        "ALT=\"You have new mail\">"
-                       "<BR><FONT SIZE=2 COLOR=FFFFFF>"
-                       "%d new mail</FONT></A>", WC->new_mail);
+                       "<BR><SPAN CLASS=\"youhavemail\">"
+                       "%d new mail</SPAN></A>", WC->new_mail);
                WC->remember_new_mail = WC->new_mail;
        }
 }
@@ -348,11 +347,24 @@ void embed_view_o_matic(void) {
                "[selectedIndex].value\">\n");
 
        for (i=0; i<(sizeof viewdefs / sizeof (char *)); ++i) {
-               wprintf("<OPTION %s VALUE=\"/changeview?view=%d\">",
-                       ((i == WC->wc_view) ? "SELECTED" : ""),
-                       i );
-               escputs(viewdefs[i]);
-               wprintf("</OPTION>\n");
+               /*
+                * Only offer the views that make sense, given the default
+                * view for the room.  For example, don't offer a Calendar
+                * view in a non-Calendar room.
+                */
+               if (
+                       (i == WC->wc_view)
+                  ||   (i == WC->wc_default_view)
+                  ||   ( (i == 0) && (WC->wc_default_view == 1) )
+                  ||   ( (i == 1) && (WC->wc_default_view == 0) )
+               ) {
+
+                       wprintf("<OPTION %s VALUE=\"/changeview?view=%d\">",
+                               ((i == WC->wc_view) ? "SELECTED" : ""),
+                               i );
+                       escputs(viewdefs[i]);
+                       wprintf("</OPTION>\n");
+               }
        }
        wprintf("</SELECT></FORM>\n");
 }
@@ -467,6 +479,7 @@ void gotoroom(char *gname, int display_name)
        }
        strcpy(WC->wc_roomname, WC->wc_roomname);
        WC->wc_view = extract_int(&buf[4], 11);
+       WC->wc_default_view = extract_int(&buf[4], 12);
 }
 
 
@@ -476,7 +489,7 @@ void gotoroom(char *gname, int display_name)
  */
 char *pop_march(int desired_floor)
 {
-       static char TheRoom[64];
+       static char TheRoom[128];
        int TheFloor = 0;
        int TheOrder = 32767;
        int TheWeight = 0;
@@ -520,7 +533,7 @@ void gotonext(void)
 {
        char buf[SIZ];
        struct march *mptr, *mptr2;
-       char next_room[32];
+       char next_room[128];
 
        /* First check to see if the march-mode list is already allocated.
         * If it is, pop the first room off the list and go there.
@@ -732,18 +745,18 @@ void display_editroom(void)
 
        /* print the tabbed dialog */
        wprintf("<TABLE border=0 cellspacing=0 cellpadding=0 width=100%%>"
-               "<TR ALIGN=CENTER BGCOLOR=FFFFFF>"
+               "<TR ALIGN=CENTER BGCOLOR=\"#FFFFFF\">"
                "<TD>&nbsp;</TD>\n");
 
        if (!strcmp(tab, "admin")) {
-               wprintf("<TD BGCOLOR=000077><FONT SIZE=+1 COLOR=\"FFFFFF\"><B>");
+               wprintf("<TD BGCOLOR=\"#000077\"><SPAN CLASS=\"tablabel\">");
        }
        else {
-               wprintf("<TD BGCOLOR=AAAAAA><A HREF=\"/display_editroom&tab=admin\">");
+               wprintf("<TD BGCOLOR=\"#AAAAAA\"><A HREF=\"/display_editroom&tab=admin\">");
        }
        wprintf("Room administration");
        if (!strcmp(tab, "admin")) {
-               wprintf("</B></FONT></TD>\n");
+               wprintf("</SPAN></TD>\n");
        }
        else {
                wprintf("</A></TD>\n");
@@ -752,14 +765,14 @@ void display_editroom(void)
        wprintf("<TD>&nbsp;</TD>\n");
 
        if (!strcmp(tab, "config")) {
-               wprintf("<TD BGCOLOR=000077><FONT SIZE=+1 COLOR=\"FFFFFF\"><B>");
+               wprintf("<TD BGCOLOR=\"#000077\"><SPAN CLASS=\"tablabel\">");
        }
        else {
-               wprintf("<TD BGCOLOR=AAAAAA><A HREF=\"/display_editroom&tab=config\">");
+               wprintf("<TD BGCOLOR=\"#AAAAAA\"><A HREF=\"/display_editroom&tab=config\">");
        }
        wprintf("Room configuration");
        if (!strcmp(tab, "config")) {
-               wprintf("</B></FONT></TD>\n");
+               wprintf("</SPAN></TD>\n");
        }
        else {
                wprintf("</A></TD>\n");
@@ -768,14 +781,14 @@ void display_editroom(void)
        wprintf("<TD>&nbsp;</TD>\n");
 
        if (!strcmp(tab, "sharing")) {
-               wprintf("<TD BGCOLOR=000077><FONT SIZE=+1 COLOR=\"FFFFFF\"><B>");
+               wprintf("<TD BGCOLOR=\"#000077\"><SPAN CLASS=\"tablabel\">");
        }
        else {
-               wprintf("<TD BGCOLOR=AAAAAA><A HREF=\"/display_editroom&tab=sharing\">");
+               wprintf("<TD BGCOLOR=\"#AAAAAA\"><A HREF=\"/display_editroom&tab=sharing\">");
        }
        wprintf("Sharing");
        if (!strcmp(tab, "sharing")) {
-               wprintf("</B></FONT></TD>\n");
+               wprintf("</SPAN></TD>\n");
        }
        else {
                wprintf("</A></TD>\n");
@@ -784,21 +797,21 @@ void display_editroom(void)
        wprintf("<TD>&nbsp;</TD>\n");
 
        if (!strcmp(tab, "listserv")) {
-               wprintf("<TD BGCOLOR=000077><FONT SIZE=+1 COLOR=\"FFFFFF\"><B>");
+               wprintf("<TD BGCOLOR=\"#000077\"><SPAN CLASS=\"tablabel\">");
        }
        else {
-               wprintf("<TD BGCOLOR=AAAAAA><A HREF=\"/display_editroom&tab=listserv\">");
+               wprintf("<TD BGCOLOR=\"#AAAAAA\"><A HREF=\"/display_editroom&tab=listserv\">");
        }
        wprintf("Mailing list service");
        if (!strcmp(tab, "listserv")) {
-               wprintf("</B></FONT></TD>\n");
+               wprintf("</SPAN></TD>\n");
        }
        else {
                wprintf("</A></TD>\n");
        }
 
        wprintf("<TD>&nbsp;</TD></TR>"
-               "<TR><TD BGCOLOR=000077 COLSPAN=9 HEIGHT=5> </TD></TR>"
+               "<TR><TD BGCOLOR=\"#000077\" COLSPAN=9 HEIGHT=5> </TD></TR>"
                "</TABLE>\n");
 
        /* end tabbed dialog */ 
@@ -1301,10 +1314,10 @@ void display_whok(void)
 
         output_headers(1);
 
-        wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=007700><TR><TD>");
-        wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"<B>Access control list for ");
+        wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#007700\"><TR><TD>");
+        wprintf("<SPAN CLASS=\"titlebar\">Access control list for ");
        escputs(WC->wc_roomname);
-        wprintf("</B></FONT></TD></TR></TABLE>\n");
+        wprintf("</SPAN></TD></TR></TABLE>\n");
 
         if(!strcmp(bstr("sc"), "Kick")) {
                 sprintf(buf, "KICK %s", username);
@@ -1390,10 +1403,9 @@ void display_entroom(void)
        }
        output_headers(1);
 
-       wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=000077><TR><TD>");
-       wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
-       wprintf("<B>Enter (create) a new room</B>\n");
-       wprintf("</FONT></TD></TR></TABLE>\n");
+       wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#000077\"><TR><TD>");
+       wprintf("<SPAN CLASS=\"titlebar\">Enter (create) a new room</SPAN>\n");
+       wprintf("</TD></TR></TABLE>\n");
 
        wprintf("<FORM METHOD=\"POST\" ACTION=\"/entroom\">\n");
 
@@ -1494,10 +1506,9 @@ void display_private(char *rname, int req_pass)
 
        output_headers(1);
 
-       wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=770000><TR><TD>");
-       wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
-       wprintf("<B>Goto a private room</B>\n");
-       wprintf("</FONT></TD></TR></TABLE>\n");
+       wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#770000\"><TR><TD>");
+       wprintf("<SPAN CLASS=\"titlebar\">Goto a private room</SPAN>\n");
+       wprintf("</TD></TR></TABLE>\n");
 
        wprintf("<CENTER>\n");
        wprintf("If you know the name of a hidden (guess-name) or\n");
@@ -1531,7 +1542,7 @@ void display_private(char *rname, int req_pass)
  */
 void goto_private(void)
 {
-       char hold_rm[32];
+       char hold_rm[SIZ];
        char buf[SIZ];
 
        if (strcasecmp(bstr("sc"), "OK")) {
@@ -1568,10 +1579,9 @@ void display_zap(void)
 {
        output_headers(1);
 
-       wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=770000><TR><TD>");
-       wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
-       wprintf("<B>Zap (forget) the current room</B>\n");
-       wprintf("</FONT></TD></TR></TABLE>\n");
+       wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#770000\"><TR><TD>");
+       wprintf("<SPAN CLASS=\"titlebar\">Zap (forget) the current room</SPAN>\n");
+       wprintf("</TD></TR></TABLE>\n");
 
        wprintf("If you select this option, <em>%s</em> will ", WC->wc_roomname);
        wprintf("disappear from your room list.  Is this what you wish ");
@@ -1633,10 +1643,9 @@ void confirm_delete_room(void)
                return;
        }
        output_headers(1);
-       wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=770000><TR><TD>");
-       wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
-       wprintf("<B>Confirm deletion of room</B>\n");
-       wprintf("</FONT></TD></TR></TABLE>\n");
+       wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#770000\"><TR><TD>");
+       wprintf("<SPAN CLASS=\"titlebar\">Confirm deletion of room</SPAN>\n");
+       wprintf("</TD></TR></TABLE>\n");
 
        wprintf("<CENTER>");
        wprintf("<FORM METHOD=\"GET\" ACTION=\"/delete_room\">\n");
@@ -1967,8 +1976,8 @@ void knrooms() {
        }
 
        /* title bar */
-       wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=000077><TR><TD>"
-               "<FONT SIZE=+1 COLOR=\"FFFFFF\"<B>"
+       wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#000077\"><TR><TD>"
+               "<SPAN CLASS=\"titlebar\">"
        );
        if (!strcasecmp(listviewpref, "rooms")) {
                wprintf("Room list");
@@ -1976,7 +1985,7 @@ void knrooms() {
        if (!strcasecmp(listviewpref, "folders")) {
                wprintf("Folder list");
        }
-       wprintf("</B></TD>\n");
+       wprintf("</SPAN></TD>\n");
 
 
        /* offer the ability to switch views */