ID used for target-specific menu is that of newly created, copied or
[irspy-moved-to-github.git] / web / htdocs / chrome / layout.mc
1 %# $Id: layout.mc,v 1.31 2007-05-03 09:33:10 mike Exp $
2 <%args>
3 $debug => undef
4 $title
5 $component
6 </%args>
7 <%once>
8 use URI::Escape qw(uri_escape uri_escape_utf8);
9 use ZOOM;
10 use ZOOM::IRSpy::Web;
11 use ZOOM::IRSpy::Utils qw(isodate xml_encode cql_target cql_quote
12                           irspy_xpath_context irspy_make_identifier
13                           irspy_record2identifier
14                           irspy_identifier2target modify_xml_document
15                           bib1_access_point);
16 </%once>
17 % $r->content_type("text/html; charset=utf-8");
18 <?xml version="1.0" encoding="UTF-8"?>
19 <!DOCTYPE html 
20      PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
21     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
22 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
23  <head>
24   <title>IRSpy: <% xml_encode($title) %></title>
25   <link rel="stylesheet" type="text/css" href="/style.css"/>
26  </head>
27  <body>
28   <table border="0" cellpadding="0" cellspacing="0" width="100%">
29    <tr class="banner">
30     <td>
31      <table width="100%">
32       <tr>
33     <td align="left">
34      <br/>
35      <h1><a class="logo" href="/">IRSpy</a></h1>
36     </td>
37     <td align="right">
38      <br/>
39      <h1 class="title"><% xml_encode($title) %></h1>
40     </td>
41       </table>
42      </tr>
43     </td>
44    </tr>
45   </table>
46   <table border="0" cellpadding="0" cellspacing="0" width="100%">
47    <tr class="panel3">
48     <td align="left">
49      &nbsp; <!-- Force display -->
50      <!-- Lmenu left -->
51     </td>
52     <td>
53      <!-- Lmenu middle -->
54     </td>
55     <td align="right">
56      <!-- Lmenu right -->
57     </td>
58    </tr>
59   </table>
60   <p></p>
61   <table border="0" cellpadding="0" cellspacing="0" width="100%">
62    <tr>
63     <td valign="top" class="panel1">
64      <p>
65       <a href="/"><b>Home</b></a><br/>
66       <a href="/admin/all.html">Test&nbsp;all&nbsp;targets</a><br/>
67       <a href="/find.html">Find a target</a><br/>
68       <a href="/admin/edit.html?op=new">Add a target</a><br/>
69       <a href="/stats.html">Statistics</a><br/>
70      </p>
71      <p>
72       <b>Show targets</b>
73       <br/>
74 % foreach my $i ('a' .. 'z') {
75       <a href="/find.html?dc.title=^<% $i %>*&amp;_sort=dc.title&amp;_count=9999&amp;_search=Search"><tt><% uc($i) %></tt></a>
76 % }
77       <a href="/find.html?cql.allRecords=1+not+dc.title+=/regexp/firstInField+[a-z].*&amp;_sort=dc.title&amp;_count=9999&amp;_search=Search">[Others]</a>
78      </p>
79 <%perl>
80 # Find the identifier to use in the record-specific menu, if any.  If
81 # the identifier components are all present (e.g. because a record has
82 # just been edited or copied) we make an ID from those; otherwise we
83 # use the "id" parameter, if specified.
84 my $id = $r->param("id");
85 {
86     # Make up ID for newly created records.
87     my $protocol = $r->param("protocol");
88     my $host = $r->param("host");
89     my $port = $r->param("port");
90     my $dbname = $r->param("dbname");
91     #warn "id='$id', protocol='$protocol' host='$host', port='$port', dbname='$dbname'";
92     #warn "%ARGS = {\n" . join("", map { "\t'$_' => '" . $ARGS{$_} . ",'\n" } sort keys %ARGS) . "}\n";
93     if (defined $protocol && defined $host &&
94         defined $port && defined $dbname) {
95         $id = irspy_make_identifier($protocol, $host, $port, $dbname);
96         #warn "id set to '$id'";
97     }
98 }
99 </%perl>
100 % if (defined $id) {
101      <div class="panel2">
102       <b>This Target</b>
103       <br/>
104       <a href="<% xml_encode("/full.html?id=" . uri_escape($id)) %>">Show details</a>
105       <br/>
106       <a href="<% xml_encode("/admin/edit.html?op=edit&id=" . uri_escape($id)) %>">Edit details</a>
107       <br/>
108       <a href="<% xml_encode("/admin/edit.html?op=copy&id=" . uri_escape($id)) %>">Copy target</a>
109       <br/>
110       <a href="<% xml_encode("/admin/delete.html?id=" . uri_escape($id)) %>">Delete target</a>
111       <p>
112        <a href="<% xml_encode("/admin/check.html?id=" . uri_escape($id)) . "&amp;test=Quick" %>">Quick Test</a>
113        <br/>
114        <a href="<% xml_encode("/admin/check.html?id=" . uri_escape($id)) . "&amp;test=Main" %>">Full Test</a>
115       </p>
116       <p>
117        <a href="<% xml_encode("/raw.html?id=" . uri_escape($id)) %>">XML</a>
118       </p>
119 <%doc><!-- Maybe this would be too heavyweight -->
120       <br/>
121 % my $host = "bagel.indexdata.dk";
122 % my $port = 210;
123       <a href="/find.html?net.host=<% $host %>&net.port=<% $port %>&_search=Search"
124         >All databases on this server</a>
125 </%doc>
126      </div>
127 % }
128      <p>
129       <b>Documentation</b>
130       <br/>
131       <a href="/doc.html">Contents</a>
132      </p>
133      <p>&nbsp;</p>
134      <p>
135       <a href="http://validator.w3.org/check?uri=referer"><img
136         src="/valid-xhtml10.png"
137         alt="Valid XHTML 1.0 Strict" height="31" width="88" /></a>
138       <br/>
139       <a href="http://jigsaw.w3.org/css-validator/"><img
140         src="/vcss.png"
141         alt="Valid CSS!" height="31" width="88" /></a>
142      </p>
143     </td>
144     <td class="spacer">&nbsp;</td>
145     <td valign="top">
146 <& $component, %ARGS &>
147     </td>
148    </tr>
149   </table>
150   <p/>
151   <hr/>
152   <div class="right">
153    <small>
154     Powered by <a style="text-decoration: none"
155         href="http://indexdata.com/"
156         >Index&nbsp;Data</a>
157    </small>
158   </div>
159  </body>
160 </html>