+ $main::lxdebug->leave_sub();
+}
+
+sub delete_drafts {
+ $main::lxdebug->enter_sub();
+
+ my $form = $main::form;
+ my %myconfig = %main::myconfig;
+
+ my @ids;
+ foreach (keys %{$form}) {
+ push @ids, $1 if (/^checked_(.*)/ && $form->{$_});
+ }
+ Drafts->remove(\%myconfig, $form, @ids) if (@ids);
+
+ restore_form($form->{SAVED_FORM}, 1);
+ delete $form->{SAVED_FORM};
+
+ add();
+
+ $main::lxdebug->leave_sub();
+}
+
+sub draft_action_dispatcher {
+ $main::lxdebug->enter_sub();
+
+ my $form = $main::form;
+ my $locale = $main::locale;
+
+ if ($form->{draft_action} eq $locale->text("Skip")) {
+ dont_load_draft();
+
+ } elsif ($form->{draft_action} eq $locale->text("Delete drafts")) {
+ delete_drafts();
+ }
+
+ $main::lxdebug->leave_sub();