function textinput(name, value) { return "" } function hidden(name, value) { return "" } function button(name, caption) { return ">\" />" } function sel_option(name, caption, default, sel) { if (default == name) sel = " selected=\"selected\"" else sel = "" return "" } function close_field() { if (field_open == 1) print "
 
" field_open = 0 } BEGIN { FS="|" } # trim leading whitespaces { gsub(/^[ \t]+/,"",$1) } $1 ~ /^onchange/ { onchange = $2 } ($1 != "") && ($1 !~ /^option/) && (select_open == 1) { select_open = 0 printf "" } $1 ~ /^infotext/ { close_field() print "

@TR<<" $2 ">>

" } # # Table issues # $1 ~/^infotable/ { close_field() print "

@TR<<" $2 ">>

" } # # Table title # $1 ~/^tabletitle/ { close_field() print "

@TR<<" $2 ">>

" } # # $2: the summary of the table. # $1 ~ /^start_table/ { close_field() print "" } $1 ~ /^start_border_table/ { close_field() print "
" } $1 ~ /^end_border_table/ { close_field() print "
" } $1 ~ /^end_table/ { close_field() print "" } # # $2: The title of the table # $1 ~ /^table_caption/ { close_field() print "" $2 "" } # # Begins a new row to the table # $1 ~ /^add_row/ { close_field() print "" } $1 ~ /^end_row/ { close_field() print "" } # # Add a cell to the row: # $2: height of the row # $3: width of the row # $4: text of the row $1 ~ /^add_title_cell/ { close_field() print "@TR<<" $2 ">>" } $1 ~ /^add_normal_cell/ { close_field() print "" $2 "" } $1 ~ /^add_data_cell/ { close_field() print "" $2 "" } $1 ~ /^add_label_cell/ { close_field() print "" } $1 ~ /^add_pass_cell/ { close_field print "" print "" $5 print "" } $1 ~ /^start_select_cell/ { opts = "" if (onchange != "") opts = opts " onChange=\"" onchange "()\"" print "" print "" } $1 ~ /^add_input_cell/ { print "" print "" $5 print "" } $1 ~ /^add_button_cell/ { close_field() print "" print "" print "" } $1 ~ /^add_check_cell/ { opts="" if (onchange != "") opts = opts " onClick=\"" onchange "()\" onChange=\"" onchange "()\"" print ""$3 print "" print "" } # Draw a line $1 ~ /^draw_line/ { close_field() print "
" } $1 ~ /^start_div/ { close_field() print "
" } $1 ~ /^end_div/ { close_field() print "
" } $1 ~ /^field/ { close_field() print "
" field_open=1 } $1 ~ /^checkbox/ { if ($3==$4) opts="checked=\"checked\" " else opts="" if (onchange != "") opts = opts " onClick=\"" onchange "()\" onChange=\"" onchange "()\"" print "" } $1 ~ /^radio/ { if ($3==$4) opts="checked=\"checked\" " else opts="" if (onchange != "") opts = opts " onClick=\"" onchange "()\" onChange=\"" onchange "()\"" print "" } $1 ~ /^select/ { opts = "" if (onchange != "") opts = opts " onChange=\"" onchange "()\"" print "" $4 } $1 ~ /^password/ { print "" $4 } $1 ~ /^submit/ { close_field() print "" } ($1 ~ /^checkbox/) || ($1 ~ /^radio/) { print $5 } END { close_field() }