]> code.citadel.org Git - citadel.git/blobdiff - webcit/roomops.c
More work on the wiki view. Don't try to use it yet.
[citadel.git] / webcit / roomops.c
index e461bcb1e95354f62c0726a473e45bac1758cf5f..9573fc9b3860bc681a5593b38d2fd35fbb0fc88f 100644 (file)
@@ -8,7 +8,7 @@
 
 char floorlist[128][SIZ];
 
-char *viewdefs[6];
+char *viewdefs[7];
 
 void initialize_viewdefs(void) {
        viewdefs[0] = _("Bulletin Board");
@@ -17,6 +17,7 @@ void initialize_viewdefs(void) {
        viewdefs[3] = _("Calendar");
        viewdefs[4] = _("Task List");
        viewdefs[5] = _("Notes List");
+       viewdefs[6] = _("Wiki");
 }
 
 
@@ -225,6 +226,9 @@ void readinfo(void)
        if (buf[0] == '1') {
                fmout("CENTER");
        }
+       else {
+               wprintf(" ");
+       }
 }
 
 
@@ -295,7 +299,9 @@ void embed_view_o_matic(void) {
        int i;
 
        wprintf("<form name=\"viewomatic\" action=\"changeview\">\n"
-               "<span class=\"room_banner_new_messages\">View as: "
+               "<span class=\"room_banner_new_messages\">");
+       wprintf(_("View as:"));
+       wprintf(" "
                "<SELECT NAME=\"newview\" SIZE=\"1\" "
                "STYLE=\"font-family: Bitstream Vera Sans,Arial,Helvetica,sans-serif;"
                " font-size: 7pt; background: #444455; color: #ddddcc;\" "
@@ -339,6 +345,13 @@ void embed_room_banner(char *got, int navbar_style) {
                got = fakegot;
        }
 
+       /* The browser needs some information for its own use */
+       wprintf("<script type=\"text/javascript\">      \n"
+               "       room_is_trash = %d;             \n"
+               "</script>\n",
+               WC->wc_is_trash
+       );
+
        /* If the user happens to select the "make this my start page" link,
         * we want it to remember the URL as a "/dotskip" one instead of
         * a "skip" or "gotonext" or something like that.
@@ -351,8 +364,11 @@ void embed_room_banner(char *got, int navbar_style) {
        WC->wc_view = extract_int(&got[4], 11);
 
        svprintf("ROOMNAME", WCS_STRING, "%s", WC->wc_roomname);
-       svprintf("NEWMSGS", WCS_STRING, "%d", extract_int(&got[4], 1));
-       svprintf("TOTALMSGS", WCS_STRING, "%d", extract_int(&got[4], 2));
+       svprintf("NUMMSGS", WCS_STRING,
+               _("%d new of %d messages"),
+               extract_int(&got[4], 1),
+               extract_int(&got[4], 2)
+       );
        svcallback("ROOMPIC", embed_room_graphic);
        svcallback("ROOMINFO", readinfo);
        svcallback("VIEWOMATIC", embed_view_o_matic);
@@ -501,6 +517,9 @@ void embed_room_banner(char *got, int navbar_style) {
                                                "</span></a></td>\n", _("Add new note")
                                        );
                                        break;
+                               case VIEW_WIKI:
+                                       /* Don't let users create unlinked pages. */
+                                       break;
                                default:
                                        wprintf(
                                                "<td><a href=\"display_enter\">"
@@ -582,6 +601,7 @@ int gotoroom(char *gname)
        WC->wc_floor = extract_int(&buf[4], 10);
        WC->wc_view = extract_int(&buf[4], 11);
        WC->wc_default_view = extract_int(&buf[4], 12);
+       WC->wc_is_trash = extract_int(&buf[4], 13);
 
        if (WC->is_aide)
                WC->is_room_aide = WC->is_aide;
@@ -865,7 +885,7 @@ void display_editroom(void)
 
        /* print the tabbed dialog */
        wprintf("<br />"
-               "<div id=\"fix_scrollbar_bug\">"
+               "<div class=\"fix_scrollbar_bug\">"
                "<TABLE border=0 cellspacing=0 cellpadding=0 width=100%%>"
                "<TR ALIGN=CENTER>"
                "<TD>&nbsp;</TD>\n");
@@ -970,7 +990,7 @@ void display_editroom(void)
        /* end tabbed dialog */ 
 
        /* begin content of whatever tab is open now */
-       wprintf("<div id=\"fix_scrollbar_bug\">"
+       wprintf("<div class=\"fix_scrollbar_bug\">"
                "<TABLE border=0 width=100%% bgcolor=\"#FFFFFF\">\n"
                "<TR><TD>\n");
 
@@ -1445,7 +1465,8 @@ void display_editroom(void)
                wprintf("<br />\n");
                wprintf("<INPUT TYPE=\"radio\" NAME=\"roompolicy\" VALUE=\"2\" %s>",
                        ((roompolicy == 2) ? "CHECKED" : "") );
-               wprintf("Expire by message count<br />\n");
+               wprintf(_("Expire by message count"));
+               wprintf("<br />\n");
                wprintf("<INPUT TYPE=\"radio\" NAME=\"roompolicy\" VALUE=\"3\" %s>",
                        ((roompolicy == 3) ? "CHECKED" : "") );
                wprintf(_("Expire by message age"));
@@ -1781,7 +1802,8 @@ void display_whok(void)
 
         wprintf("<CENTER><FORM METHOD=\"POST\" action=\"do_invt_kick\">\n");
        wprintf("<INPUT TYPE=\"hidden\" NAME=\"tab\" VALUE=\"access\">\n");
-        wprintf("Invite: ");
+        wprintf(_("Invite:"));
+       wprintf(" ");
         wprintf("<input type=\"text\" name=\"username\" style=\"width:100%%\"><br />\n"
                "<input type=\"hidden\" name=\"invite_button\" value=\"Invite\">"
                "<input type=\"submit\" value=\"%s\">"
@@ -1820,7 +1842,7 @@ void display_entroom(void)
                "</div>\n<div id=\"content\">\n"
        );
 
-       wprintf("<div id=\"fix_scrollbar_bug\">"
+       wprintf("<div class=\"fix_scrollbar_bug\">"
                "<table border=0 width=100%% bgcolor=\"#ffffff\"><tr><td>\n");
 
        wprintf("<form name=\"create_room_form\" method=\"POST\" action=\"entroom\">\n");
@@ -1843,14 +1865,15 @@ void display_entroom(void)
         wprintf("</SELECT>\n");
 
        /* Our clever little snippet of JavaScript automatically selects
-        * a public room if the view is set to Bulletin Board, and it
-        * selects a mailbox room otherwise.  The user can override this,
-        * of course.
+        * a public room if the view is set to Bulletin Board or wiki, and
+        * it selects a mailbox room otherwise.  The user can override this,
+        * of course.  We also disable the floor selector for mailboxes.
         */
        wprintf("<LI>");
        wprintf(_("Default view for room: "));
         wprintf("<SELECT NAME=\"er_view\" SIZE=\"1\" OnChange=\""
-               "       if (this.form.er_view.value == 0) {     "       
+               "       if ( (this.form.er_view.value == 0)             "
+               "          || (this.form.er_view.value == 6) ) {        "
                "               this.form.type[0].checked=true;         "
                "               this.form.er_floor.disabled = false;    "
                "       }                                               "
@@ -2029,7 +2052,7 @@ void display_private(char *rname, int req_pass)
                "</div>\n<div id=\"content\">\n"
        );
 
-       wprintf("<div id=\"fix_scrollbar_bug\">"
+       wprintf("<div class=\"fix_scrollbar_bug\">"
                "<table border=0 width=100%% bgcolor=\"#ffffff\"><tr><td>\n");
 
        wprintf("<CENTER>\n");
@@ -2827,13 +2850,13 @@ void knrooms() {
                "<SPAN CLASS=\"titlebar\">"
        );
        if (!strcasecmp(listviewpref, "rooms")) {
-               wprintf("Room list");
+               wprintf(_("Room list"));
        }
        if (!strcasecmp(listviewpref, "folders")) {
-               wprintf("Folder list");
+               wprintf(_("Folder list"));
        }
        if (!strcasecmp(listviewpref, "table")) {
-               wprintf("Room list");
+               wprintf(_("Room list"));
        }
        wprintf("</SPAN></TD>\n");