View/Edit #85!description

File name: description
<!DOCTYPE HTML PUBLIC "<%=this.www_doctype_fpi%>" "<%=this.www_doctype_uri%>">
<HTML><HEAD>
  <TITLE><%=$name%>: <%=this.name%></TITLE>
<link REL="icon" HREF="/favicon.ico" TYPE="image/x-ico">
<link REL="SHORTCUT ICON" HREF="/favicon.ico">
</HEAD>

<BODY <%=this.www_body_args%>>
<CENTER>
<%=$html_utils:tabbar(5, "Search", "/search", "Grep", "/grep", "Tree", "/tree", "Audit", "/audit", "Names", "/names")%>
</CENTER>

<%
if (del = $www:parse_GET("del"))
  this:del_ref(del);
elseif ((add = $www:parse_GET("add")) && (base = $www:parse_GET("base")) && (object = $www:parse_GET("obj")))
  this:add_ref(add, base, object);
endif
%>
<H2><%=this.name%></H2>

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>
<%
sort = toint($www:parse_GET("sort") || 1);
who = $www:parse_GET("who");
if (who)
  who = toobj(who);
elseif (!player.user:isa($prog) || player.user.wizard)
  who = #-1;
else
  who = player.user;
endif
if (who == #-1) %>
  <% if (player.user:isa($prog) && !player.user.wizard) %>
    View the list of <A HREF="/names?who=<%=toint(player.user)%>&sort=<%=sort%>">your references</A>.<P>
  <% endif %>
  Below are <I>all</I> the Moo's references.  The ones in bold are system references, the rest are user-defined.
<% elseif (who == player.user) %>
  View the list of <A HREF="/names?who=-1&sort=<%=sort%>">every reference</A>.<P>
  Below are all the references you control:
<% else %>
  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>
  Below are all the references <%=$www:link(player.user)%> controls:
<% endif %>
<BR>

<SCRIPT LANGUAGE="JavaScript"><!--
function del_ref(what) {
  x = confirm("Are you sure you want to delete this reference: $"+what);
  if (x) {
    window.location.pathname = "/names?who=<%=toint(who)%>&sort=<%=sort%>&del="+what;
  }
}
//--></SCRIPT>

<%
refs = this:references(who);
table = this:table(refs);
if (table && (sort < 1 || length(table[1]) < sort))
  raise(E_INVARG);
endif
table = $list_utils:sort_alist_suspended(table, sort);
link = (sort == 1) ? "<U>Reference</U>" | tostr("<A HREF='/names?who=",toint(who),"&sort=1'>Reference</A>");
name = (sort == 2) ? "<U>Name</U>" | tostr("<A HREF='/names?who=",toint(who),"&sort=2'>Name</A>");
type = (sort == 3) ? "<U>Parent Type</U>" | tostr("<A HREF='/names?who=",toint(who),"&sort=3'>Parent Type</A>");
owner = (sort == 4) ? "<U>Owner</U>" | tostr("<A HREF='/names?who=",toint(who),"&sort=4'>Owner</A>");
host = (sort == 5) ? "<U>Host</U>" | tostr("<A HREF='/names?who=",toint(who),"&sort=5'>Host</A>");
delete = "&nbsp;";
table = {{1, 1, 1, 1, 1, 1}, {link, name, type, owner, host, delete}, @table};
if (player.user == $no_one)
  "Lose the last column.";
  for x in [1..length(table)]
    table[x] = table[x][1..$-1];
  endfor
endif
player:tellColumns(@table);
%>

<% if (player.user:isa($prog)) %>
<HR>
<P>
Create a new reference:<BR>
<FORM ACTION="/names">
<INPUT TYPE="hidden" NAME="who" VALUE="<%=toint(who)%>">
<INPUT TYPE="hidden" NAME="sort" VALUE="<%=sort%>">
Add $<INPUT TYPE="text" NAME="add" SIZE=20>
<% if (player.user.wizard) %>
  on <SELECT NAME="base">
<%
base = #0;
while (valid(base) && base:isa($base_0))
  player:tell("<OPTION VALUE='",toint(base),"'",(base == $ref_db ? " SELECTED" | ""),">", $find_ref(base) || base);
  base = parent(base);
endwhile
%>
  </SELECT>
<% else %>
  <INPUT TYPE="hidden" NAME="base" VALUE="<%=toint($ref_db)%>">
<% endif %>
referenced to #<INPUT TYPE="text" NAME="obj" SIZE=6>
<INPUT TYPE="submit" VALUE="Create!">
</FORM>
<% endif %>

<% this:tell_www_tail(@args); %>
</BODY></HTML>
<!-- Last modified by Dax (#789) on Thu Sep 26 07:18:16 2002 MDT. -->

http://files.moo.ca:8081/8/5/description
Size: 3,819 bytes.
File perms: Readable


You are not logged in.

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