DBIx::HTMLView::CGIListView - A List user interface for DBI databases


NAME

  DBIx::HTMLView::CGIListView - A List user interface for DBI databases


SYNOPSIS

  $view=new DBIx::HTMLView::CGIReqEdit($script, $dbi, $cgi);
  print $view->view_html;


DESCRIPTION

This is a database viewer/editer using the CGI interface and HTML forms to present the user interface to the user. It's a very simple interface. At the top all the tables of the database are listed to allow the user to select which one to edit (including a + sign for adding a new post, and at the bottom the selected table is listed. If the table has more than defined in {'rows'}, output is split into pages. Every post has a link to allow you to show, edit or delete them. There is also a link to add new posts to the table.

To be able to use this you need a cgi script that sets up a few things and decides which editor to use to edit single posts and to insert default values and so on... For a simple such script see View.cgi.

This is a subclass to DBIx::HTMLView::CGIView. =head1 METHODS =cut

package DBIx::HTMLView::CGIListView; use strict;

use vars qw(@ISA); require DBIx::HTMLView::CGIView; @ISA = qw(DBIx::HTMLView::CGIView);

sub new { my $self=DBIx::HTMLView::CGIView::new(@_);

  $self->{'view_flds'}=undef;
  $self->{'extra_sql'}=undef;
  $self->{'page'}=1;
  $self->{'rows'}=50;
  $self;
}

$view->rows($nr)

Specifies how many rows should be displayed on one page. Default is 50.

$view->flds_to_view(@flds)

Specifies which flds to view by listing there names. Default is to view all fields of a post but none of the relations.

$view->extra_sql($extra)

If you want to add some extra SQL clauses to the end of the select command they can be given here. This can be used to specify in which order the posts should appear by giving an ORDER clause.

$view->view_html

Returns the html code for the editor as specified by previous methods.

 DBIx::HTMLView::CGIListView - A List user interface for DBI databases