Handle hostnames with upper-case letters
[webmin.git] / status / list_tmpls.cgi
1 #!/usr/local/bin/perl
2 # List all email templates
3
4 require './status-lib.pl';
5 $access{'edit'} || &error($text{'tmpls_ecannot'});
6 &ui_print_header(undef, $text{'tmpls_title'}, "");
7
8 @tmpls = &list_templates();
9 @links = ( "<a href='edit_tmpl.cgi?new=1'>$text{'tmpls_add'}</a>" );
10 if (@tmpls) {
11         unshift(@links, &select_all_link("d"), &select_invert_link("d"));
12         print &ui_form_start("delete_tmpls.cgi", "post");
13         print &ui_links_row(\@links);
14         @tds = ( "width=5" );
15         print &ui_columns_start(
16             [ "", $text{'tmpls_desc'}, $text{'tmpls_email'} ], 100, 0, \@tds);
17         foreach $tmpl (@tmpls) {
18                 $msg = $tmpl->{'email'};
19                 $msg = substr($msg, 0, 80)." ..." if (length($msg) > 80);
20                 print &ui_checked_columns_row(
21                         [ "<a href='edit_tmpl.cgi?id=$tmpl->{'id'}'>".
22                           "$tmpl->{'desc'}</a>", &html_escape($msg) ],
23                         \@tds, "d", $tmpl->{'id'});
24                 }
25         print &ui_columns_end();
26         print &ui_links_row(\@links);
27         print &ui_form_end([ [ undef, $text{'tmpls_delete'} ] ]);
28         }
29 else {
30         print "<b>$text{'tmpls_none'}</b><p>\n";
31         print &ui_links_row(\@links);
32         }
33
34 &ui_print_footer("", $text{'index_return'});
35