diff --git a/postfix/canonical.cgi b/postfix/canonical.cgi index a9d4741c2..fcaf734c2 100755 --- a/postfix/canonical.cgi +++ b/postfix/canonical.cgi @@ -22,45 +22,28 @@ require './postfix-lib.pl'; $access{'canonical'} || &error($text{'canonical_ecannot'}); &ui_print_header(undef, $text{'canonical_title'}, "", "canonical"); - - -# alias general options - -print "
\n"; +# Buttons to edit the three map types print &ui_hr(); -print "| \n"; -print " |
| \n"; -print "\n"; -print "\n"; -print "\n"; -print " |
\n";
+print &ui_submit($text{'edit_canonical_maps'}, "which1");
+print &ui_submit($text{'edit_recipient_canonical_maps'}, "which2");
+print &ui_submit($text{'edit_sender_canonical_maps'}, "which3");
+print &ui_form_end();
&ui_print_footer("", $text{'index_return'});
diff --git a/postfix/canonical_edit.cgi b/postfix/canonical_edit.cgi
index 48ef57311..2678865ad 100755
--- a/postfix/canonical_edit.cgi
+++ b/postfix/canonical_edit.cgi
@@ -21,7 +21,7 @@ require './postfix-lib.pl';
my $first_line = $text{'map_click'}." ".
- "".&hlink("$text{'help_map_format'}", "canonical")."\n
\n";
+ &hlink($text{'help_map_format'}, "canonical");
if ($in{'which1'})
{
diff --git a/postfix/lang/en b/postfix/lang/en
index 56e13eb20..0dd4ae85e 100644
--- a/postfix/lang/en
+++ b/postfix/lang/en
@@ -339,13 +339,13 @@ opts_ldap_server_host=LDAP server hostname
canonical_title=Canonical Mapping
canonical_ecannot=You are not allowed to edit the canonical mapping configuration
opts_canonical_maps=Address mapping lookup tables
-opts_recipient_canonical_maps=Tables for RECIPIENT addresses
-opts_sender_canonical_maps=Tables for SENDER addresses
-edit_canonical_maps=Edit canonical maps
-edit_recipient_canonical_maps=Edit recipient canonical maps
-edit_sender_canonical_maps=Edit sender canonical maps
-edit_canonical_maps_general=Click on one of these buttons to edit the canonical maps
-canonical_edit_title=Edit A Canonical Map
+opts_recipient_canonical_maps=Tables for recipient addresses
+opts_sender_canonical_maps=Tables for sender addresses
+edit_canonical_maps=Edit Canonical Maps
+edit_recipient_canonical_maps=Edit Recipient Canonical Maps
+edit_sender_canonical_maps=Edit Sender Canonical Maps
+edit_canonical_maps_general=Click on one of these buttons to edit the canonical maps ..
+canonical_edit_title=Edit Canonical Map
canonical_return_sender=sender canonical maps
canonical_return_recipient=recipient canonical maps
canonical_return=canonical maps
@@ -361,7 +361,7 @@ new_manual=Edit Map Manually
new_manualmsg=Click this button to manually edit the files from which this map is built.
map_save=Save mapping
delete_map=Delete mapping
-edit_map_title=Edit A Map
+edit_map_title=Edit Map
map_save_err=Error while saving a mapping
mapps_no_map_file=No map file defined
map_delete_failed=Failed to delete map: $1
@@ -372,6 +372,7 @@ help_map_format=What format should I use?
map_noname=Missing or invalid mapping name
map_cannot=This map cannot be edited : $1
map_unknown=Webmin does not support the map type $1
+mapping_none=No mappings of this type have been defined yet.
virtual_title=Virtual Domains
virtual_ecannot=You are not allowed to edit the virtual domains mapping configuration
diff --git a/postfix/postfix-lib.pl b/postfix/postfix-lib.pl
index 84b2d534d..8a98b7e1e 100644
--- a/postfix/postfix-lib.pl
+++ b/postfix/postfix-lib.pl
@@ -858,6 +858,9 @@ sub generate_map_edit
my $nt = $_[3] || $text{'mapping_name'};
my $vt = $_[4] || $text{'mapping_value'};
+ local @links = ( "".
+ $text{'new_mapping'}."",);
+
if ($#{$mappings} ne -1)
{
# Map description
@@ -888,11 +891,8 @@ sub generate_map_edit
# Start of the overall form
print &ui_form_start("delete_mappings.cgi", "post");
print &ui_hidden("map_name", $_[0]),"\n";
- local @links = ( &select_all_link("d", 1),
- &select_invert_link("d", 1),
- "".
- $text{'new_mapping'}."",
- );
+ unshift(@links, &select_all_link("d", 1),
+ &select_invert_link("d", 1));
print &ui_links_row(\@links);
my @grid;
@@ -932,6 +932,11 @@ sub generate_map_edit
print &ui_links_row(\@links);
print &ui_form_end([ [ "delete", $text{'mapping_delete'} ] ]);
}
+ else {
+ # None, so just show edit link
+ print "$text{'mapping_none'}
\n"; + print &ui_links_row(\@links); + } # Manual edit button if ($access{'manual'} && &can_map_manual($_[0])) {