wDumpContent(1);
}
-
-
-/*
- * display the form for entering a new room
- */
-void display_entroom(void)
-{
- StrBuf *Buf;
- int i;
- char buf[SIZ];
-
- Buf = NewStrBuf();
- serv_puts("CRE8 0");
- serv_getln(buf, sizeof buf);
-
- if (buf[0] != '2') {
- strcpy(WC->ImportantMessage, &buf[4]);
- display_main_menu();
- FreeStrBuf(&Buf);
- return;
- }
-
- output_headers(1, 1, 1, 0, 0, 0);
-
- svprintf(HKEY("BOXTITLE"), WCS_STRING, _("Create a new room"));
- do_template("beginbox", NULL);
-
- wc_printf("<form name=\"create_room_form\" method=\"POST\" action=\"entroom\">\n");
- wc_printf("<input type=\"hidden\" name=\"nonce\" value=\"%d\">\n", WC->nonce);
-
- wc_printf("<table class=\"altern\"> ");
-
- wc_printf("<tr class=\"even\"><td>");
- wc_printf(_("Name of room: "));
- wc_printf("</td><td>");
- wc_printf("<input type=\"text\" NAME=\"er_name\" MAXLENGTH=\"127\">\n");
- wc_printf("</td></tr>");
-
- wc_printf("<tr class=\"odd\"><td>");
- wc_printf(_("Resides on floor: "));
- wc_printf("</td><td>");
-// load_floorlist(Buf);
- wc_printf("<select name=\"er_floor\" size=\"1\">\n");
- for (i = 0; i < 128; ++i)
- if (!IsEmptyStr(floorlist[i])) {
- wc_printf("<option ");
- wc_printf("value=\"%d\">", i);
- escputs(floorlist[i]);
- wc_printf("</option>\n");
- }
- wc_printf("</select>\n");
- wc_printf("</td></tr>");
-
- /*
- * Our clever little snippet of JavaScript automatically selects
- * a public room if the view is set to Bulletin Board or wiki, and
- * it selects a mailbox room otherwise. The user can override this,
- * of course. We also disable the floor selector for mailboxes.
- */
- wc_printf("<tr class=\"even\"><td>");
- wc_printf(_("Default view for room: "));
- wc_printf("</td><td>");
- wc_printf("<select name=\"er_view\" size=\"1\" OnChange=\""
- " if ( (this.form.er_view.value == 0) "
- " || (this.form.er_view.value == 6) ) { "
- " this.form.type[0].checked=true; "
- " this.form.er_floor.disabled = false; "
- " } "
- " else { "
- " this.form.type[4].checked=true; "
- " this.form.er_floor.disabled = true; "
- " } "
- "\">\n");
- for (i=0; i<(sizeof viewdefs / sizeof (char *)); ++i) {
-/*
- if (is_view_allowed_as_default(i)) {
- wc_printf("<option %s value=\"%d\">",
- ((i == 0) ? "selected" : ""), i );
- escputs(viewdefs[i]);
- wc_printf("</option>\n");
- }
-*/
- }
- wc_printf("</select>\n");
- wc_printf("</td></tr>");
-
- wc_printf("<tr class=\"even\"><td>");
- wc_printf(_("Type of room:"));
- wc_printf("</td><td>");
- wc_printf("<ul class=\"adminlist\">\n");
-
- wc_printf("<li><input type=\"radio\" NAME=\"type\" VALUE=\"public\" ");
- wc_printf("CHECKED OnChange=\""
- " if (this.form.type[0].checked == true) { "
- " this.form.er_floor.disabled = false; "
- " } "
- "\"> ");
- wc_printf(_("Public (automatically appears to everyone)"));
- wc_printf("</li>");
-
- wc_printf("\n<li><input type=\"radio\" NAME=\"type\" VALUE=\"hidden\" OnChange=\""
- " if (this.form.type[1].checked == true) { "
- " this.form.er_floor.disabled = false; "
- " } "
- "\"> ");
- wc_printf(_("Private - hidden (accessible to anyone who knows its name)"));
- wc_printf("</li>");
-
- wc_printf("\n<li><input type=\"radio\" NAME=\"type\" VALUE=\"passworded\" OnChange=\""
- " if (this.form.type[2].checked == true) { "
- " this.form.er_floor.disabled = false; "
- " } "
- "\"> ");
- wc_printf(_("Private - require password: "));
- wc_printf("<input type=\"text\" NAME=\"er_password\" MAXLENGTH=\"9\">\n");
- wc_printf("</li>");
-
- wc_printf("<li><input type=\"radio\" NAME=\"type\" VALUE=\"invonly\" OnChange=\""
- " if (this.form.type[3].checked == true) { "
- " this.form.er_floor.disabled = false; "
- " } "
- "\"> ");
- wc_printf(_("Private - invitation only"));
- wc_printf("</li>");
-
- wc_printf("\n<li><input type=\"radio\" NAME=\"type\" VALUE=\"personal\" "
- "OnChange=\""
- " if (this.form.type[4].checked == true) { "
- " this.form.er_floor.disabled = true; "
- " } "
- "\"> ");
- wc_printf(_("Personal (mailbox for you only)"));
- wc_printf("</li>");
-
- wc_printf("\n</ul>\n");
- wc_printf("</td></tr></table>\n");
-
- wc_printf("<div class=\"buttons\">\n");
- wc_printf("<input type=\"submit\" name=\"ok_button\" value=\"%s\">", _("Create new room"));
- wc_printf(" ");
- wc_printf("<input type=\"submit\" name=\"cancel_button\" value=\"%s\">", _("Cancel"));
- wc_printf("</div>\n");
- wc_printf("</form>\n<hr />");
- serv_printf("MESG roomaccess");
- serv_getln(buf, sizeof buf);
- if (buf[0] == '1') {
- fmout("LEFT");
- }
-
- do_template("endbox", NULL);
-
- wDumpContent(1);
- FreeStrBuf(&Buf);
-}
-
-
-
-
/*
* support function for entroom() -- sets the default view
*/
WebcitAddUrlHandler(HKEY("goto_private"), "", 0, goto_private, NEED_URL);
WebcitAddUrlHandler(HKEY("zap"), "", 0, zap, 0);
- WebcitAddUrlHandler(HKEY("display_entroom"), "", 0, display_entroom, 0);
WebcitAddUrlHandler(HKEY("entroom"), "", 0, entroom, 0);
WebcitAddUrlHandler(HKEY("display_whok"), "", 0, display_whok, 0);
WebcitAddUrlHandler(HKEY("do_invt_kick"), "", 0, do_invt_kick, 0);