-%# $Id: layout.mc,v 1.2 2006-09-15 16:49:05 mike Exp $
+%# $Id: layout.mc,v 1.16 2006-11-14 16:21:08 mike Exp $
<%args>
$debug => undef
$title
$component
</%args>
-<%once>
-use lib "/usr/local/src/cvs/irspy/lib";
-use ZOOM::IRSpy;
-</%once>
<%perl>
-my $text = $m->scomp($component, %ARGS);
+{
+ # Make up ID for newly created records. It would be more
+ # rigorously correct, but insanely inefficient, to submit the
+ # record to Zebra and then search for it; but since we know the
+ # formula for IDs anyway, we just build one by hand.
+ my $id = $r->param("id");
+ my $host = $r->param("host");
+ my $port = $r->param("port");
+ my $dbname = $r->param("dbname");
+ #warn "id='$id', host='$host', port='$port', dbname='$dbname'";
+ #warn "%ARGS = {\n" . join("", map { "\t'$_' => '" . $ARGS{$_} . ",'\n" } sort keys %ARGS) . "}\n";
+ if ((!defined $id || $id eq "") &&
+ defined $host && defined $port && defined $dbname) {
+ $id = "$host:$port/$dbname";
+ $r->param(id => $id);
+ $ARGS{id} = $id;
+ #warn "id set to '$id'";
+ }
+}
</%perl>
+<%once>
+use URI::Escape;
+use ZOOM::IRSpy::Web;
+use ZOOM::IRSpy::Utils qw(irspy_xpath_context xml_encode modify_xml_document);
+</%once>
<& /chrome/head.mc, title => $title &>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<& /chrome/bannerrow.mc, title => $title &>
<td valign="top" class="panel1">
<& /chrome/menu.mc &>
</td>
- <td class="spacer"></td>
+ <td class="spacer"> </td>
<td valign="top">
- <% $text %>
- </td>
- <td class="spacer">
- </td>
- <td valign="top" class="panel2">
-<& /chrome/pmenu.mc &>
+<& $component, %ARGS &>
</td>
</tr>
</table>