Show take.html syntax highlighted
% # vim:set syntax=mason:
<%args>
$folder => 'none'
$addresslist => ''
</%args>
<& /mail/header.mhtml, title => "Address Book Editor", folder => $folder &>
<form method="post" action="/mail/addressbook/process_edit.html">
<input type="submit" name="save" value="Save Changes to Entries">
<table class="addressbookeditor">
<tr><th colspan="3">New Entries</th></tr>
<tr><th>Add</th><th>Alias</th><th>Address(es) (comma separated)</th></tr>
% for my $k (@toadd) {
% $k =~ m/(?:"?(\w+)\s+\w+"?)?.*\b(\w+)\@\w+\b/;
% my $tmpalias = lc($1) || lc($2);
% $k =~ s/^\s*(\S)/$1/;
% $k =~ s/(\S)\s*$/$1/;
<tr>
<td><input type="checkbox" checked name="take" value="<% $k |h %>"></td>
<td>
<input type="text" name="takealias" value="<% $tmpalias |h %>">
<input type="hidden" name="takealiaskey" value="<% $k |h %>">
</td>
<td>
<input type="text" size="80" name="takeaddress" value="<% $k |h %>">
</td>
</tr>
% }
<tr>
<th colspan="3">
Existing Entries
</th>
</tr>
<tr>
<th>Delete<br>(check)</th>
<th>Alias</th>
<th>Current Addresses</th>
</tr>
<tr>
</tr>
% for my $k (sort keys %{$addresses}) {
% local $" = ", ";
<tr>
<td>
<input type="checkbox" name="delete" value="<% $k |h %>">
</td>
<td>
<input type="hidden" name="oldalias" value="<% $k |h %>">
<input type="text" name="renamedalias" value="<% $k |h %>">
</td>
<td>
<input type="text" size="80" name="oldaddress" value="<% "@{$addresses->{$k}}" |h %>">
</td>
</tr>
% }
</table>
</form>
<& /mail/footer.mhtml &>
<%init>
my $user = Apache::SiteControl->getCurrentUser($r);
my $book = new AlphaMail::AddressBook($user->getUsername(), $user->getAttribute('imap'), $config);
my $addresses = $book->get_all;
my @toadd = split(/,/, $addresslist);
</%init>
<%once>
use Carp;
use AlphaMail::AddressBook;
our $logger = Log::Log4perl->get_logger('alphamail');
</%once>
See more files for this project here