%
print header("View Message catalog", menubar(
'Main Menu' => $p,
'Edit message catalog' => $p. "edit/msgcat.cgi",
)), '
';
my $widget = new HTML::Widgets::SelectLayers(
'selected_layer' => 'en_US',
'options' => { 'en_US'=>'en_US' },
'layer_callback' => sub {
my $layer = shift;
my $html = "
Messages for locale $layer
". table().
"
Code | ".
"Message | ";
$html .= "en_US Message | " unless $layer eq 'en_US';
$html .= '
';
#foreach my $msgcat ( sort { $a->msgcode cmp $b->msgcode }
# qsearch('msgcat', { 'locale' => $layer } ) ) {
foreach my $msgcat ( qsearch('msgcat', { 'locale' => $layer } ) ) {
$html .= ''. $msgcat->msgnum. ' | '.
''. $msgcat->msgcode. ' | '.
''. $msgcat->msg. ' | ';
unless ( $layer eq 'en_US' ) {
my $en_msgcat = qsearchs('msgcat', {
'locale' => 'en_US',
'msgcode' => $msgcat->msgcode,
} );
$html .= ''. $en_msgcat->msg. ' | ';
}
$html .= '
';
}
$html .= '';
$html;
},
);
print $widget->html;
print <