From: Mike Taylor Date: Thu, 16 Nov 2006 17:02:30 +0000 (+0000) Subject: Generation of ID from host/port/db moved from layout.mc to menu.mc, and no longer... X-Git-Tag: CPAN-v1.02~782 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=07bbb862227fad300104fd0ddd7cdb5ec26586bd;p=irspy-moved-to-github.git Generation of ID from host/port/db moved from layout.mc to menu.mc, and no longer lodges the new ID in the params --- diff --git a/web/htdocs/chrome/layout.mc b/web/htdocs/chrome/layout.mc index db22429..83614a0 100644 --- a/web/htdocs/chrome/layout.mc +++ b/web/htdocs/chrome/layout.mc @@ -1,35 +1,15 @@ -%# $Id: layout.mc,v 1.17 2006-11-16 11:49:30 mike Exp $ +%# $Id: layout.mc,v 1.18 2006-11-16 17:02:30 mike Exp $ <%args> $debug => undef $title $component -<%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'"; - } -} - <%once> use URI::Escape; use ZOOM; use ZOOM::IRSpy::Web; -use ZOOM::IRSpy::Utils qw(irspy_xpath_context xml_encode modify_xml_document); +use ZOOM::IRSpy::Utils qw(xml_encode cql_quote cql_target + irspy_xpath_context modify_xml_document); <& /chrome/head.mc, title => $title &> diff --git a/web/htdocs/chrome/menu.mc b/web/htdocs/chrome/menu.mc index d4d905b..9747b54 100644 --- a/web/htdocs/chrome/menu.mc +++ b/web/htdocs/chrome/menu.mc @@ -1,4 +1,4 @@ -%# $Id: menu.mc,v 1.13 2006-11-15 17:44:35 mike Exp $ +%# $Id: menu.mc,v 1.14 2006-11-16 17:02:30 mike Exp $

Home
Test all targets
@@ -12,8 +12,29 @@ <% uc($i) %> % }

-% our $rec; -% my $id = $r->param("id"); +<%perl> +our $rec; +my $id = $r->param("id"); +{ + # 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'"; + } +} + % if (!defined $id) { % $rec = undef; % } else {