View/Edit #85:_render_page

Switch to edit mode.

Name(s): _render_page
1:  "*** DON'T TOUCH THIS CODE *** AUTOMATICALLY GENERATED ***"
2:  caller == this || raise(E_PERM)
3:  player:tell("<!DOCTYPE HTML PUBLIC \"", this.www_doctype_fpi, "\" \"", this.www_doctype_uri, "\">")
4:  player:tell("<HTML><HEAD>")
5:  player:tell("  <TITLE>", $name, ": ", this.name, "</TITLE>")
6:  player:tell({"<link REL=\"icon\" HREF=\"/favicon.ico\" TYPE=\"image/x-ico\">", "<link REL=\"SHORTCUT ICON\" HREF=\"/favicon.ico\">", "</HEAD>", ""})
7:  player:tell("<BODY ", this.www_body_args, ">")
8:  player:tell("<CENTER>")
9:  player:tell($html_utils:tabbar(5, "Search", "/search", "Grep", "/grep", "Tree", "/tree", "Audit", "/audit", "Names", "/names"))
10: player:tell({"</CENTER>", ""})
11: if (del = $www:parse_GET("del"))
12:   this:del_ref(del)
13: elseif ((add = $www:parse_GET("add")) && (base = $www:parse_GET("base")) && (object = $www:parse_GET("obj")))
14:   this:add_ref(add, base, object)
15: endif
16: player:tell("<H2>", this.name, "</H2>")
17: player:tell({"", "Every object on the Moo can be uniquely identified by its serial number.  Some of our more important objects have been assigned reference names.", "<P>"})
18: sort = toint($www:parse_GET("sort") || 1)
19: who = $www:parse_GET("who")
20: if (who)
21:   who = toobj(who)
22: elseif (!player.user:isa($prog) || player.user.wizard)
23:   who = #-1
24: else
25:   who = player.user
26: endif
27: if (who == #-1)
28:   if (player.user:isa($prog) && !player.user.wizard)
29:     player:tell("    View the list of <A HREF=\"/names?who=", toint(player.user), "&sort=", sort, "\">your references</A>.<P>")
30:   endif
31:   player:tell("  Below are <I>all</I> the Moo's references.  The ones in bold are system references, the rest are user-defined.")
32: elseif (who == player.user)
33:   player:tell("  View the list of <A HREF=\"/names?who=-1&sort=", sort, "\">every reference</A>.<P>")
34:   player:tell("  Below are all the references you control:")
35: else
36:   player:tell("  View the list of <A HREF=\"/names?who=", toint(player.user), "&sort=", sort, "\">your references</A> or the list of <A HREF=\"/names?who=-1&sort=", sort, "\">every reference</A>.<P>")
37:   player:tell("  Below are all the references ", $www:link(player.user), " controls:")
38: endif
39: player:tell({"<BR>", "", "<SCRIPT LANGUAGE=\"JavaScript\"><!--", "function del_ref(what) {", "  x = confirm(\"Are you sure you want to delete this reference: $\"+what);", "  if (x) {"})
40: player:tell("    window.location.pathname = \"/names?who=", toint(who), "&sort=", sort, "&del=\"+what;")
41: player:tell({"  }", "}", "//--></SCRIPT>", ""})
42: refs = this:references(who)
43: table = this:table(refs)
44: if (table && (sort < 1 || length(table[1]) < sort))
45:   raise(E_INVARG)
46: endif
47: table = $list_utils:sort_alist_suspended(table, sort)
48: link = sort == 1 ? "<U>Reference</U>" | tostr("<A HREF='/names?who=", toint(who), "&sort=1'>Reference</A>")
49: name = sort == 2 ? "<U>Name</U>" | tostr("<A HREF='/names?who=", toint(who), "&sort=2'>Name</A>")
50: type = sort == 3 ? "<U>Parent Type</U>" | tostr("<A HREF='/names?who=", toint(who), "&sort=3'>Parent Type</A>")
51: owner = sort == 4 ? "<U>Owner</U>" | tostr("<A HREF='/names?who=", toint(who), "&sort=4'>Owner</A>")
52: host = sort == 5 ? "<U>Host</U>" | tostr("<A HREF='/names?who=", toint(who), "&sort=5'>Host</A>")
53: delete = "&nbsp;"
54: table = {{1, 1, 1, 1, 1, 1}, {link, name, type, owner, host, delete}, @table}
55: if (player.user == $no_one)
56:   "Lose the last column."
57:   for x in [1..length(table)]
58:     table[x] = table[x][1..$ - 1]
59:   endfor
60: endif
61: player:tellColumns(@table)
62: player:tell()
63: if (player.user:isa($prog))
64:   player:tell({"<HR>", "<P>", "Create a new reference:<BR>", "<FORM ACTION=\"/names\">"})
65:   player:tell("<INPUT TYPE=\"hidden\" NAME=\"who\" VALUE=\"", toint(who), "\">")
66:   player:tell("<INPUT TYPE=\"hidden\" NAME=\"sort\" VALUE=\"", sort, "\">")
67:   player:tell("Add $<INPUT TYPE=\"text\" NAME=\"add\" SIZE=20>")
68:   if (player.user.wizard)
69:     player:tell("  on <SELECT NAME=\"base\">")
70:     base = #0
71:     while (valid(base) && base:isa($base_0))
72:       player:tell("<OPTION VALUE='", toint(base), "'", base == $ref_db ? " SELECTED" | "", ">", $find_ref(base) || base)
73:       base = parent(base)
74:     endwhile
75:     player:tell("  </SELECT>")
76:   else
77:     player:tell("  <INPUT TYPE=\"hidden\" NAME=\"base\" VALUE=\"", toint($ref_db), "\">")
78:   endif
79:   player:tell({"referenced to #<INPUT TYPE=\"text\" NAME=\"obj\" SIZE=6>", "<INPUT TYPE=\"submit\" VALUE=\"Create!\">", "</FORM>"})
80: endif
81: player:tell()
82: this:tell_www_tail(@args)
83: player:tell("</BODY></HTML>")
84: "Last modified by Dax (#789) on Tue May  3 14:09:30 2005 MDT."

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]