NAME
DBIx::HTMLView::CGIReqView - A Requester viewer/editor for DBI databases
SYNOPSIS
require DBIx::HTMLView::CGIReqView; require DBIx::HTMLView::CGIListView;
$q = new CGI; if (DBIx::HTMLView::CGIReqView::Handles($q)) { $v=new DBIx::HTMLView::CGIReqView($db, {}, $q); } else { $v=new DBIx::HTMLView::CGIListView($db, {}, $q, \@tabels); }
$v->PrintPage($script);
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 not is modified, in which case it should contain a regexp matching all editable fields. It could be costruncted as "<field1>|<field2>|<field3>|...".
By seting the _Add key 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 _Add, _Edit and _Show are never used and thereby on no importance.
Most of it's properties can be customized by subclassing it and overriding.
METHODS
$c=new DBIx::HTMLView::CGIListView($db, $fmt, $query, $tabs)
Initiats the viewer. $db and $fmt is the database specifier and format specification as descriped in the DBIx::HTMLView manual. $tabs is an array reference to an array listing the table that should show up in list at the top. $query is the cgi query as returned by "new CGI;".
$c=new DBIx::HTMLView::CGIListView($db, $fmt, $query, $tabs)
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 objects as those created by "new CGI";
Author
Hakan Ardo <hakan@debian.org>