Reverted menu-left-example.png back to original and cleaned up menu-top-example to...
[freeside.git] / httemplate / edit / msgcat.cgi
1 <& /elements/header-popup.html, emt("Edit Message catalog") &>
2 <BR>
3
4 <& /elements/error.html &>
5
6 <% $widget->html %>
7
8     </TABLE>
9   </BODY>
10 </HTML>
11 <%init>
12
13 die "access denied"
14   unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
15
16 my $widget = new HTML::Widgets::SelectLayers(
17   'selected_layer' => 'en_US',
18   'options'        => { 'en_US'=>'en_US', 'iw_IL' => 'iw_IL', },
19   'form_action'    => 'process/msgcat.cgi',
20   'layer_callback' => sub {
21     my $layer = shift;
22     my $html = qq!<INPUT TYPE="hidden" NAME="locale" VALUE="$layer">!.
23                "<BR>".emt("Messages for locale [_1]",$layer)."<BR>". table().
24                "<TR><TH COLSPAN=2>".emt('Code')."</TH>".
25                "<TH>".emt('Message')."</TH>";
26     $html .= "<TH>en_US Message</TH>" unless $layer eq 'en_US';
27     $html .= '</TR>';
28
29     #foreach my $msgcat ( sort { $a->msgcode cmp $b->msgcode }
30     #                       qsearch('msgcat', { 'locale' => $layer } ) ) {
31     foreach my $msgcat ( qsearch('msgcat', { 'locale' => $layer } ) ) {
32       $html .=
33         '<TR><TD>'. $msgcat->msgnum. '</TD><TD>'. $msgcat->msgcode. '</TD>'.
34         '<TD><INPUT TYPE="text" SIZE=32 '.
35         qq! NAME="!. $msgcat->msgnum. '" '.
36         qq!VALUE="!. ($cgi->param($msgcat->msgnum)||$msgcat->msg). qq!"></TD>!;
37       unless ( $layer eq 'en_US' ) {
38         my $en_msgcat = qsearchs('msgcat', {
39           'locale'  => 'en_US',
40           'msgcode' => $msgcat->msgcode,
41         } );
42         $html .= '<TD>'. $en_msgcat->msg. '</TD>' if $en_msgcat;
43       }
44       $html .= '</TR>';
45     }
46
47     $html .= '</TABLE><BR><INPUT TYPE="submit" VALUE="'.emt('Apply changes').'">';
48
49     $html;
50   },
51
52 );
53
54 </%init>