import torrus 1.0.9
[freeside.git] / httemplate / browse / msgcat.cgi
index 5dab5cf..2c916dc 100755 (executable)
@@ -1,10 +1,12 @@
-<!-- mason kludge -->
-<%
-
-print header("Message catalog", menubar(
-  'Main Menu' => $p,
+<% include('/elements/header.html', "View Message catalog", menubar(
   'Edit message catalog' => $p. "edit/msgcat.cgi",
-)), '<BR>';
+)) %>
+<%  $widget->html %>
+<% include('/elements/footer.html') %>
+<%init>
+
+die "access denied"
+  unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
 
 my $widget = new HTML::Widgets::SelectLayers(
   'selected_layer' => 'en_US',
@@ -18,8 +20,8 @@ my $widget = new HTML::Widgets::SelectLayers(
     $html .= '</TR>';
 
     #foreach my $msgcat ( sort { $a->msgcode cmp $b->msgcode }
-    #                       qsearchs('msgcat', { 'locale' => $layer } ) ) {
-    foreach my $msgcat ( qsearchs('msgcat', { 'locale' => $layer } ) ) {
+    #                       qsearch('msgcat', { 'locale' => $layer } ) ) {
+    foreach my $msgcat ( qsearch('msgcat', { 'locale' => $layer } ) ) {
       $html .= '<TR><TD>'. $msgcat->msgnum. '</TD>'.
                '<TD>'. $msgcat->msgcode. '</TD>'.
                '<TD>'. $msgcat->msg. '</TD>';
@@ -39,12 +41,4 @@ my $widget = new HTML::Widgets::SelectLayers(
 
 );
 
-print $widget->html;
-
-print <<END;
-    </TABLE>
-  </BODY>
-</HTML>
-END
-
-%>
+</%init>