* All OS-level includes are now included from webcit.h instead of from
[citadel.git] / webcit / roomops.c
index c8216f7a907fa0ad14da152974dc83a44a41fd26..c587381df3d28ea2697fc00d697c5f6b72d279fa 100644 (file)
@@ -4,25 +4,6 @@
  * Lots of different room-related operations.
  */
 
-#include <ctype.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <sys/socket.h>
-#include <sys/time.h>
-#include <limits.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#include <string.h>
-#include <pwd.h>
-#include <errno.h>
-#include <stdarg.h>
-#include <pthread.h>
-#include <signal.h>
 #include "webcit.h"
 
 struct folder {
@@ -275,39 +256,38 @@ void embed_room_graphic(void) {
        }
        else if (WC->wc_view == VIEW_ADDRESSBOOK) {
                wprintf("<img height=48 width=48 src=\""
-                       "static/savecontact_48x.gif"
-                       "\">\n"
+                       "static/viewcontacts_48x.gif"
+                       "\">"
                );
        }
        else if (WC->wc_view == VIEW_CALENDAR) {
                wprintf("<img height=48 width=48 src=\""
                        "static/calarea_48x.gif"
-                       "\">\n"
+                       "\">"
                );
        }
        else if (WC->wc_view == VIEW_TASKS) {
                wprintf("<img height=48 width=48 src=\""
                        "static/taskmanag_48x.gif"
-                       "\">\n"
+                       "\">"
                );
        }
        else if (WC->wc_view == VIEW_NOTES) {
                wprintf("<img height=48 width=48 src=\""
                        "static/storenotes_48x.gif"
-                       "\">\n"
+                       "\">"
                );
-               wprintf("'static/storenotes_16x.gif'");
        }
        else if (WC->wc_view == VIEW_MAILBOX) {
                wprintf("<img height=48 width=48 src=\""
                        "static/privatemess_48x.gif"
-                       "\">\n"
+                       "\">"
                );
        }
        else {
                wprintf("<img height=48 width=48 src=\""
                        "static/chatrooms_48x.gif"
-                       "\">\n"
+                       "\">"
                );
        }
 
@@ -336,7 +316,7 @@ void embed_newmail_button(void) {
 void embed_view_o_matic(void) {
        int i;
 
-       wprintf("<FORM NAME=\"viewomatic\">\n"
+       wprintf("<form name=\"viewomatic\" action=\"/changeview\">\n"
                "<span class=\"room_banner_new_messages\">View as: "
                "<SELECT NAME=\"newview\" SIZE=\"1\" "
                "STYLE=\"font-family: Bitstream Vera Sans,Arial,Helvetica,sans-serif;"
@@ -405,13 +385,13 @@ void embed_room_banner(char *got, int navbar_style) {
        if (navbar_style != navbar_none) {
 
                wprintf("<div style=\"position:absolute; bottom:0px; left:0px\">\n"
-                       "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%%\"><tr>\n");
+                       "<table width=\"100%%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr>\n");
 
 
                if (navbar_style == navbar_default) wprintf(
                        "<td>"
                        "<a href=\"/ungoto\">"
-                       "<img align=\"middle\" src=\"/static/back.gif\" border=\"0\">"
+                       "<img align=\"middle\" src=\"/static/ungoto2_24x.gif\" border=\"0\">"
                        "<span class=\"navbar_link\">Ungoto</span></A>"
                        "</td>\n"
                );
@@ -420,7 +400,7 @@ void embed_room_banner(char *got, int navbar_style) {
                        wprintf(
                                "<td>"
                                "<A HREF=\"/readnew\">"
-                               "<img align=\"middle\" src=\"/static/readmsgs.gif\" border=\"0\">"
+                               "<img align=\"middle\" src=\"/static/newmess2_24x.gif\" border=\"0\">"
                                "<span class=\"navbar_link\">Read new messages</span></A>"
                                "</td>\n"
                        );
@@ -432,7 +412,7 @@ void embed_room_banner(char *got, int navbar_style) {
                                        wprintf(
                                                "<td>"
                                                "<A HREF=\"/readfwd\">"
-                                               "<img align=\"middle\" src=\"/static/readmsgs.gif\" "
+                                               "<img align=\"middle\" src=\"/static/viewcontacts_24x.gif\" "
                                                "border=\"0\">"
                                                "<span class=\"navbar_link\">"
                                                "View contacts"
@@ -443,7 +423,7 @@ void embed_room_banner(char *got, int navbar_style) {
                                        wprintf(
                                                "<td>"
                                                "<A HREF=\"/readfwd?calview=day\">"
-                                               "<img align=\"middle\" src=\"/static/day_view.gif\" "
+                                               "<img align=\"middle\" src=\"/static/taskday2_24x.gif\" "
                                                "border=\"0\">"
                                                "<span class=\"navbar_link\">"
                                                "Day view"
@@ -452,7 +432,7 @@ void embed_room_banner(char *got, int navbar_style) {
                                        wprintf(
                                                "<td>"
                                                "<A HREF=\"/readfwd?calview=month\">"
-                                               "<img align=\"middle\" src=\"/static/month_view.gif\" "
+                                               "<img align=\"middle\" src=\"/static/monthview2_24x.gif\" "
                                                "border=\"0\">"
                                                "<span class=\"navbar_link\">"
                                                "Month view"
@@ -463,7 +443,7 @@ void embed_room_banner(char *got, int navbar_style) {
                                        wprintf(
                                                "<td>"
                                                "<A HREF=\"/readfwd\">"
-                                               "<img align=\"middle\" src=\"/static/readmsgs.gif\" "
+                                               "<img align=\"middle\" src=\"/static/taskmanag_24x.gif\" "
                                                "border=\"0\">"
                                                "<span class=\"navbar_link\">"
                                                "View tasks"
@@ -474,7 +454,7 @@ void embed_room_banner(char *got, int navbar_style) {
                                        wprintf(
                                                "<td>"
                                                "<A HREF=\"/readfwd\">"
-                                               "<img align=\"middle\" src=\"/static/readmsgs.gif\" "
+                                               "<img align=\"middle\" src=\"/static/viewnotes_24x.gif\" "
                                                "border=\"0\">"
                                                "<span class=\"navbar_link\">"
                                                "View notes"
@@ -485,7 +465,7 @@ void embed_room_banner(char *got, int navbar_style) {
                                        wprintf(
                                                "<td>"
                                                "<A HREF=\"/readfwd\">"
-                                               "<img align=\"middle\" src=\"/static/readmsgs.gif\" "
+                                               "<img align=\"middle\" src=\"/static/readallmess3_24x.gif\" "
                                                "border=\"0\">"
                                                "<span class=\"navbar_link\">"
                                                "View message list"
@@ -496,7 +476,7 @@ void embed_room_banner(char *got, int navbar_style) {
                                        wprintf(
                                                "<td>"
                                                "<A HREF=\"/readfwd\">"
-                                               "<img align=\"middle\" src=\"/static/readmsgs.gif\" "
+                                               "<img align=\"middle\" src=\"/static/readallmess3_24x.gif\" "
                                                "border=\"0\">"
                                                "<span class=\"navbar_link\">"
                                                "Read all messages"
@@ -507,38 +487,61 @@ void embed_room_banner(char *got, int navbar_style) {
                }
 
                if (navbar_style == navbar_default) {
-                       wprintf(
-                               "<td>"
-                               "<A HREF=\"/display_enter\">"
-                               "<img align=\"middle\" src=\"/static/enter.gif\" border=\"0\">"
-                               "<span class=\"navbar_link\">"
-                       );
                        switch(WC->wc_view) {
                                case VIEW_ADDRESSBOOK:
-                                       wprintf("Add new contact");
+                                       wprintf(
+                                               "<td><A HREF=\"/display_enter\">"
+                                               "<img align=\"middle\" src=\"/static/addnewcontact_24x.gif\" "
+                                               "border=\"0\"><span class=\"navbar_link\">"
+                                               "Add new contact"
+                                               "</span></a></td>\n"
+                                       );
                                        break;
                                case VIEW_CALENDAR:
-                                       wprintf("Add new event");
+                                       wprintf(
+                                               "<td><A HREF=\"/display_enter\">"
+                                               "<img align=\"middle\" src=\"/static/addevent_24x.gif\" "
+                                               "border=\"0\"><span class=\"navbar_link\">"
+                                               "Add new event"
+                                               "</span></a></td>\n"
+                                       );
                                        break;
                                case VIEW_TASKS:
-                                       wprintf("Add new task");
+                                       wprintf(
+                                               "<td><A HREF=\"/display_enter\">"
+                                               "<img align=\"middle\" src=\"/static/newmess3_24x.gif\" "
+                                               "border=\"0\"><span class=\"navbar_link\">"
+                                               "Add new task"
+                                               "</span></a></td>\n"
+                                       );
                                        break;
                                case VIEW_NOTES:
-                                       wprintf("Add new note");
+                                       wprintf(
+                                               "<td><A HREF=\"/display_enter\">"
+                                               "<img align=\"middle\" src=\"/static/enternewnote_24x.gif\" "
+                                               "border=\"0\"><span class=\"navbar_link\">"
+                                               "Add new note"
+                                               "</span></a></td>\n"
+                                       );
                                        break;
                                default:
-                                       wprintf("Enter a message");
+                                       wprintf(
+                                               "<td><A HREF=\"/display_enter\">"
+                                               "<img align=\"middle\" src=\"/static/newmess3_24x.gif\" "
+                                               "border=\"0\"><span class=\"navbar_link\">"
+                                               "Enter a message"
+                                               "</span></a></td>\n"
+                                       );
                                        break;
                        }
-                       wprintf("</span></a></td>\n");
                }
 
                if (navbar_style == navbar_default) wprintf(
                        "<td>"
                        "<A HREF=\"/skip\" "
                        "TITLE=\"Leave all messages marked as unread, go to next room with unread messages\">"
-                       "<span class=\"navbar_link\">Skip this room</span>"
-                       "<img align=\"middle\" src=\"/static/forward.gif\" border=\"0\"></A>"
+                       "<img align=\"middle\" src=\"/static/skipthisroom_24x.gif\" border=\"0\">"
+                       "<span class=\"navbar_link\">Skip this room</span></a>"
                        "</td>\n"
                );
 
@@ -546,8 +549,8 @@ void embed_room_banner(char *got, int navbar_style) {
                        "<td>"
                        "<A HREF=\"/gotonext\" "
                        "TITLE=\"Mark all messages as read, go to next room with unread messages\">"
-                       "<span class=\"navbar_link\">Goto next room</span>"
-                       "<img align=\"middle\" src=\"/static/forward.gif\" border=\"0\"></A>"
+                       "<img align=\"middle\" src=\"/static/markngo_24x.gif\" border=\"0\">"
+                       "<span class=\"navbar_link\">Goto next room</span></a>"
                        "</td>\n"
                );
 
@@ -1972,7 +1975,7 @@ void display_private(char *rname, int req_pass)
        wprintf("so you don't have to keep returning here.\n");
        wprintf("<br /><br />");
 
-       wprintf("<FORM METHOD=\"GET\" ACTION=\"/goto_private\">\n");
+       wprintf("<FORM METHOD=\"POST\" ACTION=\"/goto_private\">\n");
 
        wprintf("<table border=\"0\" cellspacing=\"5\" "
                "cellpadding=\"5\" BGCOLOR=\"#EEEEEE\">\n"
@@ -2048,7 +2051,7 @@ void display_zap(void)
        wprintf("disappear from your room list.  Is this what you wish ");
        wprintf("to do?<br />\n");
 
-       wprintf("<FORM METHOD=\"GET\" ACTION=\"/zap\">\n");
+       wprintf("<FORM METHOD=\"POST\" ACTION=\"/zap\">\n");
        wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
        wprintf("&nbsp;");
        wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
@@ -2308,7 +2311,7 @@ void do_folder_view(struct folder *fold, int max_folders, int num_floors) {
                        wprintf("new Array(closedGif, openGif)");
                }
                else if (fold[i].view == VIEW_ADDRESSBOOK) {
-                       wprintf("'static/savecontact_16x.gif'");
+                       wprintf("'static/viewcontacts_16x.gif'");
                }
                else if (fold[i].view == VIEW_CALENDAR) {
                        wprintf("'static/calarea_16x.gif'");
@@ -2565,7 +2568,7 @@ void knrooms() {
        /* Determine whether the user is trying to change views */
        if (bstr("view") != NULL) {
                if (strlen(bstr("view")) > 0) {
-                       set_preference("roomlistview", bstr("view"));
+                       set_preference("roomlistview", bstr("view"), 1);
                }
        }