X-Git-Url: http://lists.indexdata.dk/cgi-bin?a=blobdiff_plain;f=web%2Fhtdocs%2Fchrome%2Flayout.mc;h=db224299dfc5a3e7a39e1f36f6ab9982759bd8e0;hb=e580bb0cc081c9efd989aef570687f6f23bc94e5;hp=1b4dd202c861faa91f68760855b6bcf7f01cf30f;hpb=b1a492b8f492e811559bc6d442e4e34e7760b837;p=irspy-moved-to-github.git diff --git a/web/htdocs/chrome/layout.mc b/web/htdocs/chrome/layout.mc index 1b4dd20..db22429 100644 --- a/web/htdocs/chrome/layout.mc +++ b/web/htdocs/chrome/layout.mc @@ -1,17 +1,35 @@ -%# $Id: layout.mc,v 1.9 2006-09-28 16:03:08 mike Exp $ +%# $Id: layout.mc,v 1.17 2006-11-16 11:49:30 mike Exp $ <%args> $debug => undef $title $component %args> -<%once> -BEGIN { - use vars qw($LIBDIR); - $LIBDIR = $r->dir_config("IRSpyLibDir"); +<%perl> +{ + # 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'"; + } } -use lib $LIBDIR; +%perl> +<%once> +use URI::Escape; +use ZOOM; use ZOOM::IRSpy::Web; -use ZOOM::IRSpy::Record qw(xml_encode); +use ZOOM::IRSpy::Utils qw(irspy_xpath_context xml_encode modify_xml_document); %once> <& /chrome/head.mc, title => $title &>