aboutsummaryrefslogtreecommitdiff
path: root/databases/p5-Class-DBI-AsForm
diff options
context:
space:
mode:
authorErwin Lansing <erwin@FreeBSD.org>2004-04-04 21:11:42 +0000
committerErwin Lansing <erwin@FreeBSD.org>2004-04-04 21:11:42 +0000
commit2929a99bad579d593ba4e88f2f9eb14ba5e99134 (patch)
treedce843e4acbcaa214325bcaddecc708b26f0201d /databases/p5-Class-DBI-AsForm
parent6e5777c67012a0c5d123dcb7dc56092a649e058f (diff)
downloadports-2929a99bad579d593ba4e88f2f9eb14ba5e99134.tar.gz
ports-2929a99bad579d593ba4e88f2f9eb14ba5e99134.zip
Add p5-Class-DBI-AsForm 2.2, produce HTML form elements for database
columns. This module helps to generate HTML forms for creating new database rows or editing existing rows. It maps column names in a database table to HTML form elements which fit the schema. Large text fields are turned into textareas, and fields with a has-a relationship to other Class::DBI tables are turned into select drop-downs populated with objects from the joined class. WWW: http://search.cpan.org/dist/Class-DBI-AsForm/ PR: ports/65147 Submitted by: Lars Thegler <lars@thegler.dk>
Notes
Notes: svn path=/head/; revision=106154
Diffstat (limited to 'databases/p5-Class-DBI-AsForm')
-rw-r--r--databases/p5-Class-DBI-AsForm/Makefile35
-rw-r--r--databases/p5-Class-DBI-AsForm/distinfo2
-rw-r--r--databases/p5-Class-DBI-AsForm/files/500503-AsForm.pm49
-rw-r--r--databases/p5-Class-DBI-AsForm/pkg-descr8
-rw-r--r--databases/p5-Class-DBI-AsForm/pkg-plist7
5 files changed, 101 insertions, 0 deletions
diff --git a/databases/p5-Class-DBI-AsForm/Makefile b/databases/p5-Class-DBI-AsForm/Makefile
new file mode 100644
index 000000000000..057ec3428d0f
--- /dev/null
+++ b/databases/p5-Class-DBI-AsForm/Makefile
@@ -0,0 +1,35 @@
+# New ports collection makefile for: p5-Class-DBI-AsForm
+# Date created: Apr 3 2004
+# Whom: Lars Thegler <lars@thegler.dk>
+#
+# $FreeBSD$
+
+PORTNAME= Class-DBI-AsForm
+PORTVERSION= 2.2
+CATEGORIES= databases perl5
+MASTER_SITES= ${MASTER_SITE_PERL_CPAN}
+MASTER_SITE_SUBDIR= Class
+PKGNAMEPREFIX= p5-
+
+MAINTAINER= lars@thegler.dk
+COMMENT= Produce HTML form elements for database columns
+
+BUILD_DEPENDS= ${SITE_PERL}/Class/DBI.pm:${PORTSDIR}/databases/p5-Class-DBI \
+ ${SITE_PERL}/HTML/Element.pm:${PORTSDIR}/www/p5-HTML-Tree \
+ ${SITE_PERL}/Class/DBI/Plugin/Type.pm:${PORTSDIR}/databases/p5-Class-DBI-Plugin-Type
+RUN_DEPENDS= ${BUILD_DEPENDS}
+
+PERL_CONFIGURE= yes
+
+MAN3= Class::DBI::AsForm.3
+
+.include <bsd.port.pre.mk>
+
+.if ${PERL_LEVEL} < 500600
+EXTRA_PATCHES= ${PATCHDIR}/500503-AsForm.pm
+
+post-configure:
+ ${PERL} -pi -e 's,/usr/local/,\$$(PREFIX)/,g' ${WRKSRC}/Makefile
+.endif
+
+.include <bsd.port.post.mk>
diff --git a/databases/p5-Class-DBI-AsForm/distinfo b/databases/p5-Class-DBI-AsForm/distinfo
new file mode 100644
index 000000000000..ee83807e5bbe
--- /dev/null
+++ b/databases/p5-Class-DBI-AsForm/distinfo
@@ -0,0 +1,2 @@
+MD5 (Class-DBI-AsForm-2.2.tar.gz) = 09a3824bfbf260f2b12583828dce5068
+SIZE (Class-DBI-AsForm-2.2.tar.gz) = 3558
diff --git a/databases/p5-Class-DBI-AsForm/files/500503-AsForm.pm b/databases/p5-Class-DBI-AsForm/files/500503-AsForm.pm
new file mode 100644
index 000000000000..e2841c0a0723
--- /dev/null
+++ b/databases/p5-Class-DBI-AsForm/files/500503-AsForm.pm
@@ -0,0 +1,49 @@
+--- AsForm.pm.orig Sat Apr 3 22:37:32 2004
++++ AsForm.pm Sat Apr 3 22:37:38 2004
+@@ -1,16 +1,14 @@
+ package Class::DBI::AsForm;
+-use 5.006;
+ use strict;
+-use warnings;
+ use Class::DBI::Plugin::Type ();
+-our $OLD_STYLE = 0;
++use vars qw($OLD_STYLE);$OLD_STYLE = 0;
+
+ use HTML::Element;
+ require Exporter;
+-our @ISA = qw(Exporter);
+-our @EXPORT = qw( to_cgi to_field _to_textarea _to_textfield _to_select
++use vars qw(@ISA);@ISA = qw(Exporter);
++use vars qw(@EXPORT);@EXPORT = qw( to_cgi to_field _to_textarea _to_textfield _to_select
+ type_of );
+-our $VERSION = '2.2';
++use vars qw($VERSION);$VERSION = '2.2';
+
+ =head1 NAME
+
+@@ -100,14 +98,14 @@
+ sub _to_textarea {
+ my ($self, $col) = @_;
+ my $a = HTML::Element->new("textarea", name => $col);
+- if (ref $self) { $a->push_content($self->$col) }
++ if (ref $self) { $a->push_content($self->$col()) }
+ $OLD_STYLE && return $a->as_HTML;
+ $a;
+ }
+
+ sub _to_textfield {
+ my ($self, $col) = @_;
+- my $value = ref $self && $self->$col;
++ my $value = ref $self && $self->$col();
+ my $a = HTML::Element->new("input", type=> "text", name => $col);
+ $a->attr("value" => $value) if $value;
+ $OLD_STYLE && return $a->as_HTML;
+@@ -122,7 +120,7 @@
+ for (@objs) {
+ my $sel = HTML::Element->new("option", value => $_->id);
+ $sel->attr("selected" => "selected") if ref $self
+- and eval { $_->id == $self->$col->id };
++ and eval { $_->id == $self->$col()->id };
+ $sel->push_content($_->stringify_self);
+ $a->push_content($sel);
+ }
diff --git a/databases/p5-Class-DBI-AsForm/pkg-descr b/databases/p5-Class-DBI-AsForm/pkg-descr
new file mode 100644
index 000000000000..d3f2b5b03e08
--- /dev/null
+++ b/databases/p5-Class-DBI-AsForm/pkg-descr
@@ -0,0 +1,8 @@
+This module helps to generate HTML forms for creating new database
+rows or editing existing rows. It maps column names in a database
+table to HTML form elements which fit the schema. Large text fields
+are turned into textareas, and fields with a has-a relationship to
+other Class::DBI tables are turned into select drop-downs populated
+with objects from the joined class.
+
+WWW: http://search.cpan.org/dist/Class-DBI-AsForm/
diff --git a/databases/p5-Class-DBI-AsForm/pkg-plist b/databases/p5-Class-DBI-AsForm/pkg-plist
new file mode 100644
index 000000000000..72ab20f0dfeb
--- /dev/null
+++ b/databases/p5-Class-DBI-AsForm/pkg-plist
@@ -0,0 +1,7 @@
+%%SITE_PERL%%/Class/DBI/AsForm.pm
+%%SITE_PERL%%/%%PERL_ARCH%%/auto/Class/DBI/AsForm/.packlist
+@dirrm %%SITE_PERL%%/%%PERL_ARCH%%/auto/Class/DBI/AsForm
+@unexec rmdir %D/%%SITE_PERL%%/%%PERL_ARCH%%/auto/Class/DBI 2>/dev/null || true
+@unexec rmdir %D/%%SITE_PERL%%/%%PERL_ARCH%%/auto/Class 2>/dev/null || true
+@unexec rmdir %D/%%SITE_PERL%%/Class/DBI 2>/dev/null || true
+@unexec rmdir %D/%%SITE_PERL%%/Class 2>/dev/null || true