Will things ever be the same again?
[freeside.git] / httemplate / browse / msgcat.cgi
1 <% include('/elements/header.html', "View Message catalog", menubar(
2   'Edit message catalog' => $p. "edit/msgcat.cgi",
3 )) %>
4 %
5 %
6 %my $widget = new HTML::Widgets::SelectLayers(
7 %  'selected_layer' => 'en_US',
8 %  'options'        => { 'en_US'=>'en_US' },
9 %  'layer_callback' => sub {
10 %    my $layer = shift;
11 %    my $html = "<BR>Messages for locale $layer<BR>". table().
12 %               "<TR><TH COLSPAN=2>Code</TH>".
13 %               "<TH>Message</TH>";
14 %    $html .= "<TH>en_US Message</TH>" unless $layer eq 'en_US';
15 %    $html .= '</TR>';
16 %
17 %    #foreach my $msgcat ( sort { $a->msgcode cmp $b->msgcode }
18 %    #                       qsearch('msgcat', { 'locale' => $layer } ) ) {
19 %    foreach my $msgcat ( qsearch('msgcat', { 'locale' => $layer } ) ) {
20 %      $html .= '<TR><TD>'. $msgcat->msgnum. '</TD>'.
21 %               '<TD>'. $msgcat->msgcode. '</TD>'.
22 %               '<TD>'. $msgcat->msg. '</TD>';
23 %      unless ( $layer eq 'en_US' ) {
24 %        my $en_msgcat = qsearchs('msgcat', {
25 %          'locale'  => 'en_US',
26 %          'msgcode' => $msgcat->msgcode,
27 %        } );
28 %        $html .= '<TD>'. $en_msgcat->msg. '</TD>';
29 %      }
30 %      $html .= '</TR>';
31 %    }
32 %
33 %    $html .= '</TABLE>';
34 %    $html;
35 %  },
36 %
37 %);
38 %
39
40
41 <%  $widget->html %>
42 <% include('/elements/footer.html') %>