use the same way to display all banners and services contents
[citadel.git] / webcit / preferences.c
index 987b2ac2c625857add7b921a9369baa2d602eabd..079fd6a7a8be2875c4417eb2881502bb72c58d89 100644 (file)
@@ -199,24 +199,26 @@ void display_preferences(void)
        int i;
 
        wprintf("<div id=\"banner\">\n");
-       wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>");
-       wprintf("<img src=\"static/advanpage2_48x.gif\" ALT=\" \" ALIGN=MIDDLE>");
-       wprintf("<SPAN CLASS=\"titlebar\">&nbsp;");
+       wprintf("<img src=\"static/advanpage2_48x.gif\">");
+       wprintf("<h1>");
        wprintf(_("Preferences and settings"));
-       wprintf("</SPAN></TD><TD ALIGN=RIGHT>");
+       wprintf("</h1>");
+       wprintf("<ul><li>");
        offer_start_page();
-       wprintf("</TD></TR></TABLE>\n");
-       wprintf("</div>\n"
-               "<div id=\"content\">\n");
+       wprintf("</li></ul>\n");
+       wprintf("</div>\n");
+
+       wprintf("<div id=\"content\" class=\"service\">\n");
 
        wprintf("<div class=\"fix_scrollbar_bug\">"
-               "<table border=0 width=100%% bgcolor=\"#ffffff\"><tr><td>\n");
+               "<table class=\"preferences_background\"><tr><td>\n");
 
        /** begin form */
        wprintf("<center>\n"
                "<form name=\"prefform\" action=\"set_preferences\" "
                "method=\"post\">\n"
                "<table border=0 cellspacing=5 cellpadding=5>\n");
+       wprintf("<input type=\"hidden\" name=\"nonce\" value=\"%ld\">\n", WC->nonce);
 
        /**
         * Room list view
@@ -377,7 +379,9 @@ void display_preferences(void)
        wprintf("<tr><td>");
        wprintf(_("Default character set for email headers:"));
        wprintf("</td><td>");
-       wprintf("<input type=\"text\" NAME=\"default_header_charset\" MAXLENGTH=\"32\" VALUE=\"%s\">", buf);
+       wprintf("<input type=\"text\" NAME=\"default_header_charset\" MAXLENGTH=\"32\" VALUE=\"");
+       escputs(buf);
+       wprintf("\">");
        wprintf("</td></tr>");
 
        /** submit buttons */
@@ -402,7 +406,7 @@ void set_preferences(void)
 {
        char ebuf[300];
 
-       if (strlen(bstr("change_button")) == 0) {
+       if (IsEmptyStr(bstr("change_button"))) {
                safestrncpy(WC->ImportantMessage, 
                        _("Cancelled.  No settings were changed."),
                        sizeof WC->ImportantMessage);