Changeset 60 in text-formbuilder for trunk/lib/Text


Ignore:
Timestamp:
02/10/05 16:16:05 (20 years ago)
Author:
peichman
Message:

using the 'columns' argument to get columns of checkboxes (instead of 'ulist')
updated version number

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Text/FormBuilder.pm

    r59 r60  
    77use vars qw($VERSION @EXPORT); 
    88 
    9 $VERSION = '0.09_01'; 
     9$VERSION = '0.09_02'; 
    1010@EXPORT = qw(create_form); 
    1111 
     
    2424my $DEFAULT_CSS = <<END; 
    2525table { padding: 1em; } 
     26td table { padding: 0; } /* exclude the inner checkbox tables */ 
    2627#author, #footer { font-style: italic; } 
    2728caption h2 { padding: .125em .5em; background: #ccc; text-align: left; } 
     
    227228    # use the list for displaying checkbox groups 
    228229    foreach (@{ $self->{form_spec}{fields} }) { 
    229         $$_{ulist} = 1 if ref $$_{options} and @{ $$_{options} } >= 3; 
     230        if (ref $$_{options} and @{ $$_{options} } >= 3) { 
     231            $$_{columns} = int(@{ $$_{options} } / 8) + 1; 
     232        } 
     233        #$$_{ulist} = 1 if ref $$_{options} and @{ $$_{options} } >= 3; 
    230234    } 
    231235     
     
    532536                $OUT .= qq[    <td><span class="fieldgroup">]; 
    533537                $OUT .= join(' ', map { qq[<small class="sublabel">$$_{label}</small> $$_{field} $$_{comment}] } @group_fields); 
    534                 $OUT .= " $msg_invalid" if $$_{invalid}; 
     538                $OUT .= " ] . $msg_invalid . q[" if $$_{invalid}; 
    535539                 
    536540                $OUT .= qq[    </span></td>\n]; 
Note: See TracChangeset for help on using the changeset viewer.