/[Frey]/branches/zimbardo/lib/Frey/Web.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /branches/zimbardo/lib/Frey/Web.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 720 by dpavlin, Thu Dec 4 20:20:45 2008 UTC revision 725 by dpavlin, Fri Dec 5 17:33:00 2008 UTC
# Line 446  sub DEMOLISH { Line 446  sub DEMOLISH {
446  sub icon_path {  sub icon_path {
447          my ($self,$class,$variant) = @_;          my ($self,$class,$variant) = @_;
448          my $icon = $class;          my $icon = $class;
449            $icon ||= $self->title;
450          $icon =~ s{::}{/}g;          $icon =~ s{::}{/}g;
451          $icon .= "/$variant" if $variant;          $icon .= "/$variant" if $variant;
452          my $path = 'static/icons/' . $icon . '.png';          my $path = 'static/icons/' . $icon . '.png';
# Line 659  Generate checkbox html markup from some Line 660  Generate checkbox html markup from some
660  sub checkbox {  sub checkbox {
661          my ($self,$name,$value) = @_;          my ($self,$name,$value) = @_;
662          my $checked = '';          my $checked = '';
663          my $all_checkboxes = $self->$name;          my $all_checkboxes = eval { $self->$name };
664            warn "ERROR tried to get checkbox value for '$name' which is unknown: $@" if $@;
665          $all_checkboxes = [ $all_checkboxes ] unless ref($all_checkboxes) eq 'ARRAY'; # sigh, too chatty          $all_checkboxes = [ $all_checkboxes ] unless ref($all_checkboxes) eq 'ARRAY'; # sigh, too chatty
666          $checked = ' checked' if grep { $_ eq $value } @$all_checkboxes;          $checked = ' checked' if grep { defined $_ && $_ eq $value } @$all_checkboxes;
667          warn "# checkbox $name $value $checked\t", $self->dump( $self->$name );          warn "# checkbox $name $value $checked\t", $self->dump( $self->$name );
668          qq|<input name="$name" value="$value" type="checkbox"$checked>|;          qq|<input name="$name" value="$value" type="checkbox"$checked>|;
669  }  }

Legend:
Removed from v.720  
changed lines
  Added in v.725

  ViewVC Help
Powered by ViewVC 1.1.26