/*
- * $Id$
- *
* Miscellaneous functions which handle calendar components.
+ *
+ * Copyright (c) 1996-2010 by the citadel.org team
+ *
+ * This program is open source software. You can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "webcit.h"
*/
void display_icaltimetype_as_webform(struct icaltimetype *t, char *prefix, int date_only) {
+ wcsession *WCC = WC;
int i;
time_t now;
struct tm tm_now;
localtime_r(&tt, &tm);
}
- wprintf("<input type=\"text\" name=\"");
- wprintf(prefix);
- wprintf("\" id=\"");
- wprintf(prefix);
- wprintf("\" size=\"10\" maxlength=\"10\" value=\"");
+ wc_printf("<input type=\"text\" name=\"");
+ StrBufAppendBufPlain(WCC->WBuf, prefix, -1, 0);
+ wc_printf("\" id=\"");
+ StrBufAppendBufPlain(WCC->WBuf, prefix, -1, 0);
+ wc_printf("\" size=\"10\" maxlength=\"10\" value=\"");
wc_strftime(timebuf, 32, "%Y-%m-%d", &tm);
- wprintf(timebuf);
- wprintf("\">");
+ StrBufAppendBufPlain(WCC->WBuf, timebuf, -1, 0);
+ wc_printf("\">");
StrBufAppendPrintf(WC->trailing_javascript, "attachDatePicker('");
StrBufAppendPrintf(WC->trailing_javascript, prefix);
* This keeps the data model consistent.
*/
if (date_only) {
- wprintf("<div style=\"display:none\">");
+ wc_printf("<div style=\"display:none\">");
}
- wprintf("<span ID=\"");
- wprintf(prefix);
- wprintf("_time\">");
- wprintf(_("Hour: "));
- wprintf("<SELECT NAME=\"%s_hour\" SIZE=\"1\">\n", prefix);
+ wc_printf("<span ID=\"");
+ StrBufAppendBufPlain(WCC->WBuf, prefix, -1, 0);
+ wc_printf("_time\">");
+ wc_printf(_("Hour: "));
+ wc_printf("<SELECT NAME=\"%s_hour\" SIZE=\"1\">\n", prefix);
for (i=0; i<=23; ++i) {
if (time_format == WC_TIMEFORMAT_24) {
- wprintf("<OPTION %s VALUE=\"%d\">%d</OPTION>\n",
+ wc_printf("<OPTION %s VALUE=\"%d\">%d</OPTION>\n",
((tm.tm_hour == i) ? "SELECTED" : ""),
i, i
);
}
else {
- wprintf("<OPTION %s VALUE=\"%d\">%s</OPTION>\n",
+ wc_printf("<OPTION %s VALUE=\"%d\">%s</OPTION>\n",
((tm.tm_hour == i) ? "SELECTED" : ""),
i, hourname[i]
);
}
}
- wprintf("</SELECT>\n");
+ wc_printf("</SELECT>\n");
- wprintf(_("Minute: "));
- wprintf("<SELECT NAME=\"%s_minute\" SIZE=\"1\">\n", prefix);
+ wc_printf(_("Minute: "));
+ wc_printf("<SELECT NAME=\"%s_minute\" SIZE=\"1\">\n", prefix);
for (i=0; i<=59; ++i) {
if ( (i % 5 == 0) || (tm.tm_min == i) ) {
- wprintf("<OPTION %s VALUE=\"%d\">:%02d</OPTION>\n",
+ wc_printf("<OPTION %s VALUE=\"%d\">:%02d</OPTION>\n",
((tm.tm_min == i) ? "SELECTED" : ""),
i, i
);
}
}
- wprintf("</SELECT></span>\n");
+ wc_printf("</SELECT></span>\n");
if (date_only) {
- wprintf("</div>");
+ wc_printf("</div>");
}
}