/[wopi2]/trunk/editor.cgi
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/editor.cgi

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5 - (show annotations)
Fri Jun 25 16:16:08 2004 UTC (19 years, 10 months ago) by dpavlin
File size: 766 byte(s)
a lot of changes, poll is in it's own database,
edit and delete of questions, display of status messages

1 #!/usr/bin/perl -w
2
3 use strict;
4 use lib './lib';
5 use WOPI;
6
7 # name to database file (web server writable)
8 my $db_file = '/tmp/wopi.db';
9
10 # name of poll
11 my $poll_name = 'nadareni';
12
13 use Data::Dumper;
14
15 my $wopi = WOPI->new(
16 db_file => $db_file,
17 templates => './template',
18 poll_name => $poll_name,
19 );
20
21
22 my $q = $wopi->{'cgi'} || die "no CGI object?";
23
24 $wopi->{'param'}->{'self'} = $wopi->{'cgi'}->url(
25 -relative => 1,
26 -query=>0,
27 -path=>0,
28 );
29
30 my $do = $q->param('do') || 'editor';
31 $do='editor' if ($q->param('cancel'));
32
33 print $q->header;
34
35 if ($wopi->can($do) =~ /^CODE/) {
36 print qq{<!-- do: $do -->};
37 my $out = $wopi->$do() || die "can't do '$do'";
38
39 # confess "no output from '$do', probably bug!" if (! $out);
40
41 print $out;
42 } else {
43 die "no method '$do'";
44 }

Properties

Name Value
svn:executable

  ViewVC Help
Powered by ViewVC 1.1.26