X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=blobdiff_plain;f=web%2Fhtdocs%2Fchrome%2Flayout.mc;h=9f32749e98ce19a6fd6ca893b03136d04a01a03b;hp=11c973a24bee21a3eee9e93381abc34ec043a2aa;hb=e6a7bcd91a26d268038ec9e3c1c8ef98643520d5;hpb=41a127419af816d9bce7d3a2a6078ff82e5d564a
diff --git a/web/htdocs/chrome/layout.mc b/web/htdocs/chrome/layout.mc
index 11c973a..9f32749 100644
--- a/web/htdocs/chrome/layout.mc
+++ b/web/htdocs/chrome/layout.mc
@@ -1,15 +1,17 @@
-%# $Id: layout.mc,v 1.26 2007-03-29 17:14:30 mike Exp $
+%# $Id: layout.mc,v 1.34 2007-06-27 11:50:49 mike Exp $
<%args>
$debug => undef
$title
$component
%args>
<%once>
-use URI::Escape;
+use URI::Escape qw(uri_escape uri_escape_utf8);
use ZOOM;
use ZOOM::IRSpy::Web;
-use ZOOM::IRSpy::Utils qw(isodate xml_encode cql_target cql_quote
- irspy_xpath_context modify_xml_document
+use ZOOM::IRSpy::Utils qw(utf8param isodate xml_encode cql_target cql_quote
+ irspy_xpath_context irspy_make_identifier
+ irspy_record2identifier
+ irspy_identifier2target modify_xml_document
bib1_access_point);
%once>
% $r->content_type("text/html; charset=utf-8");
@@ -25,13 +27,19 @@ use ZOOM::IRSpy::Utils qw(isodate xml_encode cql_target cql_quote
-
-
-
- |
-
-
- <% xml_encode($title) %>
+ |
+
+
+
+
+
+ |
+
+
+ <% xml_encode($title) %>
+ |
+
+
|
@@ -66,29 +74,30 @@ use ZOOM::IRSpy::Utils qw(isodate xml_encode cql_target cql_quote
% foreach my $i ('a' .. 'z') {
<% uc($i) %>
% }
- [Others]
+ [Others]
<%perl>
-my $id = $r->param("id");
+# Find the identifier to use in the record-specific menu, if any. If
+# the identifier components are all present (e.g. because a record has
+# just been edited or copied) we make an ID from those; otherwise we
+# use the "id" parameter, if specified.
+my $id = utf8param($r, "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'";
+ # Make up ID for newly created records.
+ my $protocol = utf8param($r, "protocol");
+ my $host = utf8param($r, "host");
+ my $port = utf8param($r, "port");
+ my $dbname = utf8param($r, "dbname");
+ #warn "id='$id', protocol='$protocol' 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";
+ if (defined $protocol && defined $host &&
+ defined $port && defined $dbname) {
+ $id = irspy_make_identifier($protocol, $host, $port, $dbname);
#warn "id set to '$id'";
}
}
%perl>
-% if (defined $id && $r->param("op") ne "copy") {
+% if (defined $id) {
This Target