Model inheritance re-organised
New config method : additional, for stashing additional info, especially from additional_data method
new warn method in maypole/request class/object, over-ridden by Apache::MVC, etc or own driver
- AsForm fixes
+ AsForm fixes to stringification _to_select
new build_form_elements attribute for Maypole request, set it to 0 to avoid building cgi form if you don't need it
2.11 Mon 31 July 2006
sub _to_select {
my ($self, $col, $args) = @_;
- warn "\n---\n[_to_select] col : $col\n";
- warn "[_to_select] self : $self\n";
- warn "[_to_select] args : ",Dumper($args), "\n";
- warn "[_to_select] caller : ",caller(),"\n";
$args ||= {};
# Do we have items already ? Go no further.
$args->{items} = \@objs;
} else {
$args->{items} = $items;
- }
-
- use Data::Dumper;
- warn "Just got items. They are " . Dumper($args->{items});
-
- warn "col : $col\n";
+ }
# Make select HTML element
$a = $self->_select_guts($col, $args);
}
# Single Hash
elsif ($type eq 'HASH') {
- warn "making select of single hash";
$a->push_content($self->_options_from_hash($items, $args));
}
# Single Array
elsif ( $type eq 'ARRAY' and not ref $items->[0] ) {
- warn "making select of single array";
$a->push_content($self->_options_from_array($items, $args));
}
# Array of Objects
elsif ( $type eq 'ARRAY' and $proto !~ /ARRAY|HASH/i ) {
# make select of objects
- warn "making select of objects\n";
$a->push_content($self->_options_from_objects($items, $args));
}
# Array of Arrays
elsif ( $type eq 'ARRAY' and $proto eq 'ARRAY' ) {
- warn "making select of array of arrays\n";
$a->push_content($self->_options_from_arrays($items, $args));
}
# Array of Hashes
elsif ( $type eq 'ARRAY' and $proto eq 'HASH' ) {
- warn "making select of array of \n";
$a->push_content($self->_options_from_hashes($items, $args));
} else {
die "You passed a weird type of data structure to me. Here it is: " .
my $selected = $args->{selected} || {};
my $stringify = $args->{stringify} || $self->stringify_column;
- warn "self : $self\n";
- warn "stringify : $stringify\n";
- warn "stringify column : ", $self->stringify_column, "\n";
- warn "stringify in args : ", $args->{stringify}, "\n";
-
my @res;
for (@$items) {
my $id = $_->id;
sub _options_from_hashes {
my ($self, $items, $args) = @_;
- warn "_options_from_hashes called with $self,", Dumper($items), Dumper($args), "\n";
my $selected = $args->{selected} || {};
my $pk = eval {$args->{class}->primary_column} || 'id';
my $fclass = $args->{class} || '';