Changeset 73 in text-formbuilder for trunk/lib/Text/FormBuilder.pm


Ignore:
Timestamp:
03/16/05 13:55:22 (19 years ago)
Author:
peichman
Message:

updated Changes file
can have a hint comment on group fields (displayed after all the subfields)
'#' comments can appear at the end of lines in group field lines

File:
1 edited

Legend:

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

    r72 r73  
    177177                        $$field{name} = "$$_[1]{name}_$$field{name}";                 
    178178                    } 
    179                     $_ = [ 'group', { label => $$_[1]{label} || ucfirst(join(' ',split('_',$$_[1]{name}))), group => \@fields } ]; 
     179                    $_ = [ 
     180                        'group', 
     181                        { 
     182                            label => $$_[1]{label} || ucfirst(join(' ',split('_',$$_[1]{name}))), 
     183                            comment => $$_[1]{comment}, 
     184                            group => \@fields, 
     185                        }, 
     186                    ]; 
    180187                } 
    181188            } 
     
    526533                # mark invalid fields 
    527534                if ($$_{invalid}) { 
    528                     $OUT .= "<td>$$_{field} $$_{comment} ] . $msg_invalid . q[</td>"; 
     535                    $OUT .= qq[<td>$$_{field} <span class="comment">$$_{comment}</span> ] . $msg_invalid . q[</td>]; 
    529536                } else { 
    530                     $OUT .= qq[<td>$$_{field} $$_{comment}</td>]; 
     537                    $OUT .= qq[<td>$$_{field} <span class="comment">$$_{comment}</span></td>]; 
    531538                } 
    532539                 
     
    546553                $OUT .= " ] . $msg_invalid . q[" if grep { $$_{invalid} } @group_fields; 
    547554                 
    548                 $OUT .= qq[    </span></td>\n]; 
     555                $OUT .= qq[ <span class="comment">$$line[1]{comment}</span></span></td>\n]; 
    549556                $OUT .= qq[  </tr>\n]; 
    550557            }    
     
    11801187 
    11811188You can also use groups in normal field lines: 
    1182      
     1189 
    11831190    birthday|Your birthday:DATE 
    11841191 
    11851192The only (currently) supported pieces of a fieldspec that may be used with a 
    1186 group in this notation are name and label. 
     1193group in this notation are name, label, and hint. 
    11871194 
    11881195=head2 Comments 
     
    11901197    # comment ... 
    11911198 
    1192 Any line beginning with a C<#> is considered a comment. 
     1199Any line beginning with a C<#> is considered a comment. Comments can also appear 
     1200after any field line. They I<cannot> appear between items in a C<!list>, or on 
     1201the same line as any of the directives. 
    11931202 
    11941203=head1 TODO 
     
    12071216reset button 
    12081217 
    1209 Allow comments on group fields (rendered after the all the fields) 
     1218Set FB constructor options directly in the formspec (via a C<!fb> or similar 
     1219directive). The major issue here would be what format to use to allow for 
     1220array/hash refs. 
    12101221 
    12111222Pieces that wouldn't make sense in a group field: size, row/col, options, 
Note: See TracChangeset for help on using the changeset viewer.