View/Edit #2:tell_www_setup

Switch to edit mode.

Name(s): tell_www_setup
1:  "Prints a form allowing web-based setup of this object."
2:  "This verb handles basic setup (name/location/parent/desc)."
3:  "Override to add more functionality.  Don't forget to pass."
4:  caller == this || raise(E_PERM)
5:  player:isa($webber) || raise(E_PERM)
6:  hack = player.user:controls(this)
7:  player:tell("<H1>Setup for <A HREF=\"/", $www:find_ref(this), "\">", $su:nn(this), "</A>.</H1>")
8:  player:tell("<H3>Object setup.</H3>")
9:  player:tell("<FORM ACTION=\"/", $www:find_ref(this), "/setup\" METHOD=post><INPUT TYPE=hidden NAME=objectsetup VALUE=on><TABLE>")
10: desc = this:_get_description()
11: if (hack)
12:   player:tell("<TR><TD><B>Object name:</B></TD><TD><INPUT NAME=name SIZE=60 VALUE=\"", $html_utils:literal_text(this.name), "\"></TD></TR>")
13:   player:tell("<TR><TD><B>Location:</B></TD><TD><INPUT NAME=location SIZE=60 VALUE=\"", $html_utils:literal_text($su:nn(this.location)), "\"></TD></TR>")
14:   player:tell("<TR><TD><B>Parent:</B></TD><TD><INPUT NAME=parent SIZE=60 VALUE=\"", $html_utils:literal_text($su:nn(parent(this))), "\"></TD></TR>")
15:   player:tell("<TR><TD><B>Owner:</B></TD><TD>", $www:link(this.owner, $su:nn(this.owner)), "</TD></TR>")
16:   player:tell("<TR><TD COLSPAN=2><B>Description:</B><BR>")
17:   text = `{tostr("<TEXTAREA NAME=desc ROWS=", length({@desc}) + 4, " COLS=80 WRAP=virtual STYLE='width: 100%'>"), @$html_utils:literal_text(desc), "</TEXTAREA>"} ! E_TYPE => {"<TT>", @$html_utils:literal_text(toliteral(desc)), "</TT>"}'
18:   text[1..2] = {text[1] + text[2]}
19:   length(text) > 1 && (text[$ - 1..$] = {text[$ - 1] + text[$]})
20:   player:tell(text)
21:   player:tell("</TD></TR>")
22:   player:tell("<TR><TD COLSPAN=2><INPUT TYPE=submit VALUE=Change> <INPUT TYPE=reset></TD></TR>")
23: else
24:   player:tell("<TR><TD><B>Object name:</B></TD><TD><TT>", $html_utils:literal_text(this.name), "</TT></TD></TR>")
25:   player:tell("<TR><TD><B>Location:</B></TD><TD>", $web:link(this.location, $su:nn(this.location)), "</TD></TR>")
26:   player:tell("<TR><TD><B>Parent:</B></TD><TD>", $www:link(parent(this), $su:nn(parent(this))), "</TD></TR>")
27:   player:tell("<TR><TD><B>Owner:</B></TD><TD>", $www:link(this.owner, $su:nn(this.owner)), "</TD></TR>")
28:   player:tell("<TR><TD COLSPAN=2><B>Description:</B><BR><TT>", @`$html_utils:literal_text(desc) ! E_TYPE => $html_utils:literal_text(toliteral(desc))', "</TT></TD></TR>")
29: endif
30: player:tell("</TABLE></FORM>")
31: "Last modified by Dax (#789) on Thu Dec 15 15:49:23 2005 MST."

Verb arguments: this none this
Verb perms: Readable eXecutable NOT-Debug
Verb owned by: Dax (#789)

You are not logged in.

[home | help | who | search | setup | code]