wprintf("Skip to next room</B></A><BR>\n");
wprintf("(come back here later)</LI>\n");
- if ((strlen(ugname) > 0) && (strcasecmp(ugname, wc_roomname))) {
+ if ((strlen(WC->ugname) > 0) && (strcasecmp(WC->ugname, WC->wc_roomname))) {
wprintf("<LI><B><A HREF=\"/ungoto\">\n");
wprintf("Ungoto</B></A><BR>\n");
- wprintf("(oops! Back to %s)</LI>\n", ugname);
+ wprintf("(oops! Back to %s)</LI>\n", WC->ugname);
}
wprintf("</UL>\n");
wprintf("Create a new room</A>\n");
wprintf("<LI><A HREF=\"/display_zap\">");
- wprintf("Zap (forget) this room (%s)</A>\n", wc_roomname);
+ wprintf("Zap (forget) this room (%s)</A>\n", WC->wc_roomname);
wprintf("<LI><A HREF=\"/zapped_list\">");
wprintf("List all forgotten rooms</A>\n");
wprintf("</TD><TD>");
- if ((axlevel >= 6) || (is_room_aide)) {
+ if ((WC->axlevel >= 6) || (WC->is_room_aide)) {
wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=007777><TR><TD>");
wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
wprintf("<B>Administrative functions</B>\n");
wprintf("<UL>");
wprintf("<LI><A HREF=\"/display_editroom\">\n");
- wprintf("Edit this room</A>\n");
-
- wprintf("<LI><A HREF=\"/confirm_delete_room\">\n");
- wprintf("Delete this room</A>\n");
-
- wprintf("<LI><A HREF=\"/display_editroompic\">\n");
- wprintf("Set or change the graphic for this room's banner</A>\n");
-
- wprintf("<LI><A HREF=\"/display_editinfo\">\n");
- wprintf("Edit this room's Info file</A>\n");
+ wprintf("Edit or delete this room</A>\n");
wprintf("<LI><A HREF=\"/display_siteconfig\">\n");
wprintf("Edit site-wide configuration</A>\n");
- if (axlevel >= 6) {
+ if (WC->axlevel >= 6) {
wprintf("<LI><A HREF=\"/validate\">\n");
wprintf("Validate new users</A>\n");
void display_main_menu(void)
{
printf("HTTP/1.0 200 OK\n");
- output_headers(1, "bottom");
+ output_headers(1);
embed_main_menu();
wDumpContent(2);
}
void display_advanced_menu(void)
{
printf("HTTP/1.0 200 OK\n");
- output_headers(1, "bottom");
+ output_headers(1);
embed_advanced_menu();
embed_main_menu();
wDumpContent(2);
void display_generic(void)
{
printf("HTTP/1.0 200 OK\n");
- output_headers(1, "bottom");
+ output_headers(1);
wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770077><TR><TD>");
wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
display_main_menu();
return;
}
+
+ printf("HTTP/1.0 200 OK\n");
+ output_headers(1);
+
serv_printf("%s", bstr("g_cmd"));
serv_gets(buf);
- printf("HTTP/1.0 200 OK\n");
- output_headers(1, "bottom");
wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770077><TR><TD>");
wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
wprintf("<B>Server command results</B>\n");
wprintf("<A HREF=\"/display_advanced\">Return to menu</A>\n");
wDumpContent(1);
}
+
+
+
+
+/*
+ * Display the menubar. Set as_single_page to
+ * display HTML headers and footers -- otherwise it's assumed
+ * that the menubar is being embedded in another page.
+ */
+void display_menubar(int as_single_page) {
+ FILE *menubar_body;
+ char buf[256];
+
+ if (as_single_page) {
+ printf("HTTP/1.0 200 OK\n");
+ output_headers(0);
+ wprintf("<HTML>\n"
+ "<HEAD>\n"
+ "<TITLE>MenuBar</TITLE>\n"
+ "<STYLE TYPE=\"text/css\">\n"
+ "BODY { text-decoration: none; }\n"
+ "</STYLE>\n"
+ "</HEAD>\n"
+ "<BODY BACKGROUND=\"/image&name=background\" "
+ "TEXT=\"#000000\" LINK=\"#FFFFFF\" "
+ "ALINK=\"#FFFFFF\" VLINK=\"#FFFFFF\">\n");
+ }
+
+ menubar_body = fopen("static/menubar.html", "r");
+ if (menubar_body == NULL) {
+ wprintf("menubar<BR>%s", strerror(errno));
+ } else {
+ while (fgets(buf, sizeof(buf), menubar_body) != NULL) {
+ wprintf("%s", buf);
+ }
+ fclose(menubar_body);
+ }
+
+
+ if (as_single_page) {
+ wDumpContent(2);
+ }
+
+
+}