NAME
DBIx::HTMLView::CGIReqView - A Requester viewer/editor for DBI databases
SYNOPSIS
use DBIx::HTMLView::CGIListView; use DBIx::HTMLView::CGIReqView;
my $db="DBI:mSQL:HTMLViewTester:athena.af.lu.se:1114";
$q = new CGI; if (DBIx::HTMLView::CGIReqView::Handles($q)) { $v=new DBIx::HTMLView::CGIReqView($db, {}, $q); } else { # Use some other view list CGIListView for example... }
$v->PrintPage("this_file.cgi");
DESCRIPTION
This is a CGI interface based on the CGIView class (eg a subclass of) that allows you to edit or view one post in a table. Alla data is shown and all data except the key is editable, if the $self->{'editable'} variable is not modified, in which case it should contain a regexp matching all editable fields. It could be costruncted as "<field1>|<field2>|<field3>|...".
By seting the _New key in the CGI query a blank form will show upp for adding new posts. By setting the key _Edit together with _Id, the vaule of _Id will be looked up as the key of a post and that post will be presented for editing.
Is is also possible to show a post by setting _Show and _Id. The value of _New, _Edit and _Show are never used and thereby on no importance.
METHODS
$c=new DBIx::HTMLView::CGIReqView($db, $fmt, $query)
Initiats the viewer. $db and $fmt is the database specifier and format specification as descriped in the DBIx::HTMLView manual. $query is the cgi query as returned by "new CGI;".
$c->PrintPage($script)
Will print the html page, with links back to the cgi script $script.
DBIx::HTMLView::CGIReqView::Handles($q)
Returns 1 if this object can handle the request make by $q, otherwise 0. $q should be an CGI object created with "new CGI";
Author
Hakan Ardo <hakan@debian.org>