X-Git-Url: http://git.shiar.net/sheet.git/blobdiff_plain/dd92616a516d41f9a84d080891f18d5a58754060..74d561810b2bf81617b84bc1581d8b59c359d5c9:/writer.plp diff --git a/writer.plp b/writer.plp index a97bbfa..493f745 100644 --- a/writer.plp +++ b/writer.plp @@ -5,98 +5,7 @@ Html({ version => '1.0', nocache => 1, raw => <<'EOT', - - + EOT }); @@ -104,16 +13,9 @@ EOT use List::Util qw( pairs pairkeys ); my $db = eval { - my @dbinfo = ( - 'DBI:Pg:dbname=sheet;host=localhost', 'sheetadmin', 'fairuse', - ) or die "database not configured\n"; - require DBIx::Simple; - DBIx::Simple->new(@dbinfo[0..2], { - RaiseError => 1, - pg_enable_utf8 => 1, - }); + require Shiar_Sheet::DB; + Shiar_Sheet::DB->connect; } or Abort('Database error', 501, $@); -$db->abstract->{array_datatypes}++; my $user = eval { if (defined $post{username}) { @@ -391,7 +293,7 @@ package Shiar_Sheet::FormRow { sub imagepath { my ($row, $col) = @_; return "data/word/org/$row->{id}.jpg" if $col eq 'source'; - return "data/word/en/$row->{form}.jpg" if $col eq 'thumb'; + return "data/word/en/$row->{id}.jpg" if $col eq 'thumb'; return; } }