<%perl> # Show the story summary if needed. if ($show_summary) { my $type = $tile->get_object_type; # Nab the story from the story_prof widget my $asset = get_state_data($type.'_prof', $type); $m->comp('/widgets/summary/summary.mc', asset => $asset, number => ++$i); } <& '/widgets/wrappers/sharky/table_top.mc', caption => $lang->maketext("[_1] Field Text",$field), id => 'containerprof', number => ++$i, &> <& '/widgets/profile/textarea.mc', 'name' => $widget.'|text', 'rows' => $rows, 'cols' => $cols, 'value' => $text &>
<& '/widgets/profile/text.mc', 'name' => $widget.'|cols', 'value' => "$cols", 'size' => 3, 'useTable' => 0 &> <%$lang->maketext('Columns')%>  <& '/widgets/profile/text.mc', 'name' => $widget.'|rows', 'value' => "$rows", 'size' => 3, 'useTable' => 0 &> <%$lang->maketext('Rows')%>
<& '/widgets/wrappers/sharky/table_bottom.mc' &> <& '/widgets/wrappers/sharky/table_top.mc', caption => 'Separator String', number => ++$i, &>
<& '/widgets/profile/radio.mc', 'name' => $widget.'|separator', 'value' => "\n", 'checked' => $sep eq "\n" &> <%$lang->maketext('One blank line')%> <& '/widgets/profile/radio.mc', 'name' => $widget.'|separator', 'value' => '

', 'checked' => $sep eq '

' &> <p>

<& '/widgets/profile/radio.mc', 'name' => $widget.'|separator', 'value' => '
', 'checked' => $sep eq '
' &> <br>
<& '/widgets/profile/radio.mc', 'name' => $widget.'|separator', 'value' => 'custom', 'checked' => $use_custom_sep &>  
<& '/widgets/wrappers/sharky/table_bottom.mc' &> <& '/widgets/wrappers/sharky/table_top.mc', caption => 'Statistics', number => ++$i, &>
<%$lang->maketext('Words')%>
<%$lang->maketext('Characters')%>
', 'words', 'chars')">
<& '/widgets/wrappers/sharky/table_bottom.mc' &> <%args> $widget $show_summary <%init> # the tile object my $tile = get_state_data($widget, 'tile'); my $field = get_state_data($widget, 'field'); my $data = get_state_data($widget, 'data'); my $sep = get_state_data($widget, 'separator'); my $custom_sep = get_state_data($widget, 'custom_sep'); my $cols = get_state_data($widget, 'cols'); my $rows = get_state_data($widget, 'rows'); # Create the text blob my $split = $sep eq "\n" ? '' : $sep; my $text = join("\n$split\n", @$data); my ($i, $words, $bytes, @tmp); foreach (@$data) { $words += scalar(@tmp = /\S+/g); $bytes += length; } my $use_custom_sep = get_state_data($widget, 'use_custom_sep') || 0;