ucfirst(title)
[irspy-moved-to-github.git] / web / htdocs / details / form.mc
index 73536b7..2fd8bf8 100644 (file)
@@ -1,4 +1,4 @@
-%# $Id: form.mc,v 1.1 2006-11-14 14:54:06 mike Exp $
+%# $Id: form.mc,v 1.5 2006-11-15 13:15:19 mike Exp $
 <%args>
 $id => undef
 $conn
@@ -8,7 +8,8 @@ $rec
 my $xc = irspy_xpath_context($rec);
 my @fields =
     (
-     [ protocol     => 0, "Protocol", "e:serverInfo/\@protocol" ],
+     [ protocol     => [ qw(Z39.50 SRW SRU SRW/U) ],
+       "Protocol", "e:serverInfo/\@protocol" ],
      [ host         => 0, "Host", "e:serverInfo/e:host" ],
      [ port         => 0, "Port", "e:serverInfo/e:port" ],
      [ dbname       => 0, "Database Name", "e:serverInfo/e:database",
@@ -17,7 +18,7 @@ my @fields =
        qw() ],
      [ password     => 0, "Password (if needed)", "e:serverInfo/e:authentication/e:password",
        qw(e:user) ],
-     [ title        => 0, "title", "e:databaseInfo/e:title",
+     [ title        => 0, "Title", "e:databaseInfo/e:title",
        qw() ],
      [ description  => 5, "Description", "e:databaseInfo/e:description",
        qw(e:title) ],
@@ -55,7 +56,7 @@ if (defined $update) {
     ZOOM::IRSpy::_really_rewrite_record($conn, $xc->getContextNode());
 }
 </%perl>
- <h2><% xml_encode($xc->find("e:databaseInfo/e:title")) %></h2>
+ <h2><% xml_encode($xc->find("e:databaseInfo/e:title"), "[Untitled]") %></h2>
 % if ($nchanges) {
  <p style="font-weight: bold">
   The record has been updated.<br/>
@@ -71,8 +72,14 @@ foreach my $ref (@fields) {
    <tr>
     <th><% $caption %></th>
     <td>
-% my $data = xml_encode($xc->find($xpath));
-% if ($nlines) {
+% my $data = xml_encode($xc->find($xpath), "");
+% if (ref $nlines) {
+     <select name="<% $name %>" size="1">
+%     foreach my $val (@$nlines) {
+      <option value="<% $val %>"><% $val %></option>
+%     }
+     </select>
+% } elsif ($nlines) {
      <textarea name="<% $name %>" rows="<% $nlines %>" cols="61"><% $data %></textarea>
 % } else {
      <input name="<% $name %>" type="text" size="60" value="<% $data %>">