summaryrefslogtreecommitdiff
path: root/httemplate/edit/msgcat.cgi
diff options
context:
space:
mode:
authorivan <ivan>2007-01-30 20:59:14 +0000
committerivan <ivan>2007-01-30 20:59:14 +0000
commit15777da47bab33e8f0021e6dd9aa6b434fa9be30 (patch)
tree83359450ba8dcac02c86bdbd0c85db45a699fc06 /httemplate/edit/msgcat.cgi
parent655b4043942c7d361224d283accb4c2a02ef7359 (diff)
its all about control
Diffstat (limited to 'httemplate/edit/msgcat.cgi')
-rwxr-xr-xhttemplate/edit/msgcat.cgi114
1 files changed, 56 insertions, 58 deletions
diff --git a/httemplate/edit/msgcat.cgi b/httemplate/edit/msgcat.cgi
index 54a340d83..b46cdfd46 100755
--- a/httemplate/edit/msgcat.cgi
+++ b/httemplate/edit/msgcat.cgi
@@ -1,59 +1,57 @@
-<!-- mason kludge -->
-%
-%
-%print header("Edit Message catalog", menubar(
-%# 'Main Menu' => $p,
-%)), '<BR>';
-%
-%print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !. $cgi->param('error').
-% '</FONT><BR><BR>'
-% if $cgi->param('error');
-%
-%my $widget = new HTML::Widgets::SelectLayers(
-% 'selected_layer' => 'en_US',
-% 'options' => { 'en_US'=>'en_US' },
-% 'form_action' => 'process/msgcat.cgi',
-% 'layer_callback' => sub {
-% my $layer = shift;
-% my $html = qq!<INPUT TYPE="hidden" NAME="locale" VALUE="$layer">!.
-% "<BR>Messages for locale $layer<BR>". table().
-% "<TR><TH COLSPAN=2>Code</TH>".
-% "<TH>Message</TH>";
-% $html .= "<TH>en_US Message</TH>" unless $layer eq 'en_US';
-% $html .= '</TR>';
-%
-% #foreach my $msgcat ( sort { $a->msgcode cmp $b->msgcode }
-% # qsearch('msgcat', { 'locale' => $layer } ) ) {
-% foreach my $msgcat ( qsearch('msgcat', { 'locale' => $layer } ) ) {
-% $html .=
-% '<TR><TD>'. $msgcat->msgnum. '</TD><TD>'. $msgcat->msgcode. '</TD>'.
-% '<TD><INPUT TYPE="text" SIZE=32 '.
-% qq! NAME="!. $msgcat->msgnum. '" '.
-% qq!VALUE="!. ($cgi->param($msgcat->msgnum)||$msgcat->msg). qq!"></TD>!;
-% unless ( $layer eq 'en_US' ) {
-% my $en_msgcat = qsearchs('msgcat', {
-% 'locale' => 'en_US',
-% 'msgcode' => $msgcat->msgcode,
-% } );
-% $html .= '<TD>'. $en_msgcat->msg. '</TD>';
-% }
-% $html .= '</TR>';
-% }
-%
-% $html .= '</TABLE><BR><INPUT TYPE="submit" VALUE="Apply changes">';
-%
-% $html;
-% },
-%
-%);
-%
-%print $widget->html;
-%
-%print <<END;
-% </TABLE>
-% </BODY>
-%</HTML>
-%END
-%
-%
+<% header("Edit Message catalog" ) %>
+<BR>
+% if ( $cgi->param('error') ) {
+ <FONT SIZE="+1" COLOR="#ff0000">Error: <% $cgi->param('error') %></FONT>
+ <BR><BR>
+% }
+
+<% $widget->html %>
+
+ </TABLE>
+ </BODY>
+</HTML>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
+my $widget = new HTML::Widgets::SelectLayers(
+ 'selected_layer' => 'en_US',
+ 'options' => { 'en_US'=>'en_US' },
+ 'form_action' => 'process/msgcat.cgi',
+ 'layer_callback' => sub {
+ my $layer = shift;
+ my $html = qq!<INPUT TYPE="hidden" NAME="locale" VALUE="$layer">!.
+ "<BR>Messages for locale $layer<BR>". table().
+ "<TR><TH COLSPAN=2>Code</TH>".
+ "<TH>Message</TH>";
+ $html .= "<TH>en_US Message</TH>" unless $layer eq 'en_US';
+ $html .= '</TR>';
+
+ #foreach my $msgcat ( sort { $a->msgcode cmp $b->msgcode }
+ # qsearch('msgcat', { 'locale' => $layer } ) ) {
+ foreach my $msgcat ( qsearch('msgcat', { 'locale' => $layer } ) ) {
+ $html .=
+ '<TR><TD>'. $msgcat->msgnum. '</TD><TD>'. $msgcat->msgcode. '</TD>'.
+ '<TD><INPUT TYPE="text" SIZE=32 '.
+ qq! NAME="!. $msgcat->msgnum. '" '.
+ qq!VALUE="!. ($cgi->param($msgcat->msgnum)||$msgcat->msg). qq!"></TD>!;
+ unless ( $layer eq 'en_US' ) {
+ my $en_msgcat = qsearchs('msgcat', {
+ 'locale' => 'en_US',
+ 'msgcode' => $msgcat->msgcode,
+ } );
+ $html .= '<TD>'. $en_msgcat->msg. '</TD>';
+ }
+ $html .= '</TR>';
+ }
+
+ $html .= '</TABLE><BR><INPUT TYPE="submit" VALUE="Apply changes">';
+
+ $html;
+ },
+
+);
+
+</%init>