remove_attachment.html from AlphaMail at Krugle
Show remove_attachment.html syntax highlighted
% # vim: set syntax=mason:
<%args>
$attachment => 0
</%args>
<%init>
my $user = Apache::SiteControl->getCurrentUser($r);
my $composition = load_composition($r, $user);
my $to = $composition->{to};
my $cc = $composition->{cc};
my $bcc = $composition->{bcc};
my $ref = $composition->{"ref"};
my $forward = $composition->{forwardflag};
my $reply = $composition->{replyflag};
my $subject = $composition->{subject};
my $message = $composition->{message};
my @attachments = @{$composition->{attachments}} if($composition->{attachments});
my @sizes = @{$composition->{sizes}} if($composition->{sizes});
my @ta = ();
my @s = ();
for(my $i=0; $i <= $#attachments; $i++) {
next if($attachment == $i);
push @ta, $attachments[$i];
push @s, $sizes[$i];
}
@attachments = @ta;
@sizes = @s;
save_composition($r, $user, $to, $cc, $bcc, $subject, $message,
$reply, $forward, $ref, \@attachments, \@sizes, $composition->{richtext});
$m->redirect('/mail/compose.html');
</%init>
See more files for this project here