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