]> code.citadel.org Git - citadel.git/blobdiff - webcit/roomops.c
* Reinstated the 'Delete' button in the mailbox view, for use by users who don't...
[citadel.git] / webcit / roomops.c
index 5a7e8347a915d8895ec45461cfaac14a2a30ea14..f8664cf156dd673da228bfac61557080fa699d24 100644 (file)
@@ -278,7 +278,7 @@ void zapped_list(void)
        output_headers(1, 1, 1, 0, 0, 0);
        memset(&SubTP, 0, sizeof(WCTemplputParams));
        Buf = NewStrBufPlain(_("Zapped (forgotten) rooms"), -1);
-       SubTP.ContextType = CTX_STRBUF;
+       SubTP.Filter.ContextType = CTX_STRBUF;
        SubTP.Context = Buf;
        DoTemplate(HKEY("beginbox"), NULL, &SubTP);
 
@@ -448,12 +448,11 @@ void embed_search_o_matic(StrBuf *Target, WCTemplputParams *TP)
 {
        wprintf("<form name=\"searchomatic\" action=\"do_search\">\n");
        wprintf("<div style=\"display: inline;\"><input type=\"hidden\" name=\"nonce\" value=\"%d\">\n", WC->nonce);
-       wprintf("<label for=\"search_name\">");
+       wprintf("<label for=\"srchquery\">");
        wprintf(_("Search: "));
        wprintf("</label><input ");
-       wprintf("%s", serv_info.serv_fulltext_enabled ? "" : "disabled ");
-       wprintf("type=\"text\" name=\"query\" id=\"srchquery\" size=\"15\" maxlength=\"128\" "
-               "id=\"search_name\" class=\"inputbox\">\n"
+       wprintf("%s", WC->serv_info->serv_fulltext_enabled ? "" : "disabled ");
+       wprintf("type=\"text\" name=\"query\" id=\"srchquery\" size=\"15\" maxlength=\"128\" class=\"inputbox\">\n"
                );
        wprintf("</div></form>\n");
 }
@@ -497,8 +496,11 @@ void embed_room_banner(char *got, int navbar_style) {
         * we want it to remember the URL as a "/dotskip" one instead of
         * a "skip" or "gotonext" or something like that.
         */
-       snprintf(WC->this_page, sizeof(WC->this_page), "dotskip&room=%s",
-                ChrPtr(WC->wc_roomname));
+       if (WC->this_page == NULL)
+               WC->this_page = NewStrBuf();
+       StrBufPrintf(WC->this_page, 
+                    "dotskip&room=%s",
+                    ChrPtr(WC->wc_roomname));
 
        /** Check for new mail. */
        WC->new_mail = extract_int(&got[4], 9);
@@ -723,6 +725,14 @@ void embed_room_banner(char *got, int navbar_style) {
                                        "%s"
                                        "</span></a></li>\n", _("Write mail")
                                        );
+                               wprintf(
+                                       "<li class=\"newmess\">"
+                                       "<a href=\"javascript:deleteAllSelectedMessages();\">"
+                                       "<img  src=\"static/delete.gif\" "
+                                       "alt=\"\"><span class=\"navbar_link\">"
+                                       "%s"
+                                       "</span></a></li>\n", _("Delete")
+                                       );
                                break;
                        default:
                                wprintf(
@@ -1795,7 +1805,7 @@ void display_editroom(void)
                wprintf(_("The URL for subscribe/unsubscribe is: "));
                wprintf("<TT>%s://%s/listsub</TT></td></tr>\n",
                        (is_https ? "https" : "http"),
-                       WC->http_host);
+                       ChrPtr(WC->http_host));
                /* Public posting? */
                wprintf("<tr><td>");
                wprintf(_("Allow non-subscribers to mail to this room."));
@@ -2146,6 +2156,12 @@ void editroom(void)
                FreeStrBuf(&Buf);
                return;
        }
+
+       er_name = NewStrBuf();
+       er_password = NewStrBuf();
+       er_dirname = NewStrBuf();
+       er_roomaide = NewStrBuf();
+
        StrBufCutLeft(Buf, 4);
        StrBufExtract_token(er_name, Buf, 0, '|');
        StrBufExtract_token(er_password, Buf, 1, '|');
@@ -2706,7 +2722,7 @@ void display_private(char *rname, int req_pass)
 
        Buf = NewStrBufPlain(_("Go to a hidden room"), -1);
        memset(&SubTP, 0, sizeof(WCTemplputParams));
-       SubTP.ContextType = CTX_STRBUF;
+       SubTP.Filter.ContextType = CTX_STRBUF;
        SubTP.Context = Buf;
        DoTemplate(HKEY("beginbox"), NULL, &SubTP);
 
@@ -3223,7 +3239,7 @@ void do_rooms_view(struct folder *fold, int max_folders, int num_floors) {
 
                        Buf = NewStrBufPlain(floor_name, -1);
                        memset(&SubTP, 0, sizeof(WCTemplputParams));
-                       SubTP.ContextType = CTX_STRBUF;
+                       SubTP.Filter.ContextType = CTX_STRBUF;
                        SubTP.Context = Buf;
                        DoTemplate(HKEY("beginbox"), NULL, &SubTP);
                        
@@ -3631,7 +3647,7 @@ void knrooms(void)
 
        /** title bar */
        wprintf("<div id=\"banner\">\n");
-       wprintf("<div class=\"room_banner\">");
+       wprintf("<div class=\"room_banner\" id=\"room_banner\">");
        wprintf("<h1>");
        if (!strcasecmp(ChrPtr(ListView), "rooms")) {
                wprintf(_("Room list"));
@@ -3643,8 +3659,9 @@ void knrooms(void)
                wprintf(_("Room list"));
        }
        wprintf("</h1></div>\n");
-
+       
        /** offer the ability to switch views */
+       wprintf("<div id=\"actiondiv\">");
        wprintf("<ul class=\"room_actions\">\n");
        wprintf("<li class=\"start_page\">");
        offer_start_page(NULL, &NoCtx);
@@ -3668,7 +3685,7 @@ void knrooms(void)
 
        wprintf("</select>");
        wprintf("</form></li>");
-       wprintf("</ul></div>\n");
+       wprintf("</ul></div></div>\n");
 
        wprintf("<div id=\"content\" class=\"service\">\n");
 
@@ -3811,7 +3828,7 @@ void jsonRoomFlr(void) {
        /* Send as our own (application/json) content type */
   hprintf("HTTP/1.1 200 OK\r\n");
   hprintf("Content-type: application/json; charset=utf-8\r\n");
-  hprintf("Server: %s / %s\r\n", PACKAGE_STRING, ChrPtr(serv_info.serv_software));
+  hprintf("Server: %s / %s\r\n", PACKAGE_STRING, ChrPtr(WC->serv_info->serv_software));
   hprintf("Connection: close\r\n");
   hprintf("Pragma: no-cache\r\nCache-Control: no-store\r\nExpires:-1\r\n");
   begin_burst();
@@ -3995,11 +4012,11 @@ void
 InitModule_ROOMOPS
 (void)
 {
-       RegisterPreference(HKEY("roomlistview"),
+       RegisterPreference("roomlistview",
                            _("Room list view"),
                            PRF_STRING,
                            NULL);
-        RegisterPreference(HKEY("emptyfloors"), _("Show empty floors"), PRF_YESNO, NULL);
+        RegisterPreference("emptyfloors", _("Show empty floors"), PRF_YESNO, NULL);
 
        RegisterNamespace("ROOMNAME", 0, 1, tmplput_RoomName, 0);