* fix_scrollbar_bug is now a class instead of an id. Fixes validator warnings.
[citadel.git] / webcit / graphics.c
index 7bf365ab8f4d4961bc4046f3a777e1e93ddc7183..4bc9e8e1146a5f47ce0c8299264c8cb59b648567 100644 (file)
@@ -4,25 +4,6 @@
  * Handles HTTP upload of graphics files into the system.
  */
 
-#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"
 
 void display_graphics_upload(char *description, char *check_cmd, char *uplurl)
@@ -36,40 +17,44 @@ void display_graphics_upload(char *description, char *check_cmd, char *uplurl)
                display_main_menu();
                return;
        }
-       output_headers(1, 1, 0, 0, 0, 0, 0);
+       output_headers(1, 1, 0, 0, 0, 0);
 
-       output_headers(1, 1, 2, 0, 0, 0, 0);
+       output_headers(1, 1, 2, 0, 0, 0);
        wprintf("<div id=\"banner\">\n"
                "<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
-               "<SPAN CLASS=\"titlebar\">Image upload</SPAN>"
+               "<SPAN CLASS=\"titlebar\">");
+       wprintf(_("Image upload"));
+       wprintf("</SPAN>"
                "</TD></TR></TABLE>\n"
                "</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");
 
-       wprintf("<FORM ENCTYPE=\"multipart/form-data\" ACTION=\"%s\" "
+       wprintf("<FORM ENCTYPE=\"multipart/form-data\" action=\"%s\" "
                "METHOD=\"POST\" NAME=\"graphicsupload\">\n", uplurl);
 
        wprintf("<INPUT TYPE=\"hidden\" NAME=\"which_room\" VALUE=\"");
        urlescputs(bstr("which_room"));
        wprintf("\">\n");
 
-       wprintf("You can upload any image directly from your computer,\n");
-       wprintf("as long as it is in GIF format (JPEG, PNG, etc. won't\n");
-       wprintf("work).<br /><br />\n");
+       wprintf(_("You can upload any image directly from your computer, "
+               "as long as it is in GIF format (JPEG, PNG, etc. won't "
+               "work)."));
+       wprintf("<br /><br />\n");
 
-       wprintf("Please select a file to upload:<br /><br />\n");
+       wprintf(_("Please select a file to upload:"));
+       wprintf("<br /><br />\n");
        wprintf("<INPUT TYPE=\"FILE\" NAME=\"filename\" SIZE=\"35\">\n");
        wprintf("<br /><br />");
-       wprintf("<INPUT TYPE=\"SUBMIT\" NAME=\"sc\" VALUE=\"Upload\">\n");
+       wprintf("<INPUT TYPE=\"SUBMIT\" NAME=\"upload_button\" VALUE=\"%s\">\n", _("Upload"));
        wprintf("&nbsp;");
-       wprintf("<INPUT TYPE=\"RESET\" VALUE=\"Reset Form\">\n");
+       wprintf("<INPUT TYPE=\"RESET\" VALUE=\"%s\">\n", _("Reset form"));
        wprintf("&nbsp;");
-       wprintf("<INPUT TYPE=\"SUBMIT\" NAME=\"sc\" VALUE=\"Cancel\">\n");
+       wprintf("<INPUT TYPE=\"SUBMIT\" NAME=\"cancel_button\" VALUE=\"%s\">\n", _("Cancel"));
        wprintf("</FORM>\n");
        wprintf("</CENTER>\n");
        wprintf("</td></tr></table></div>\n");
@@ -83,16 +68,16 @@ void do_graphics_upload(char *upl_cmd)
        int pos = 0;
        int thisblock;
 
-       if (!strcasecmp(bstr("sc"), "Cancel")) {
+       if (strlen(bstr("cancel_button")) > 0) {
                strcpy(WC->ImportantMessage,
-                       "Graphics upload cancelled.");
+                       _("Graphics upload has been cancelled."));
                display_main_menu();
                return;
        }
 
        if (WC->upload_length == 0) {
                strcpy(WC->ImportantMessage,
-                       "You didn't upload a file.");
+                       _("You didn't upload a file."));
                display_main_menu();
                return;
        }