diff options
Diffstat (limited to 'httemplate/misc/delete-template_content.html')
-rw-r--r-- | httemplate/misc/delete-template_content.html | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/httemplate/misc/delete-template_content.html b/httemplate/misc/delete-template_content.html new file mode 100644 index 000000000..e77878c25 --- /dev/null +++ b/httemplate/misc/delete-template_content.html @@ -0,0 +1,18 @@ +<%init> +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right(['Edit templates', 'Edit global templates']); + +my ($msgnum, $locale); +$cgi->param('msgnum') =~ /^(\d+)$/ or die "bad msgnum"; +$msgnum = $1; +$cgi->param('locale') =~ /^(\w+)$/ or die "bad locale"; +$locale = $1; +my $content = qsearchs('template_content', + { msgnum => $msgnum, locale => $locale }) + or die "couldn't find $locale version of template #$msgnum"; + +my $error = $content->delete; +my $url = $p.'edit/msg_template.html?msgnum='.$msgnum; +$url .= ";locale=$locale;error=$error" if $error; +</%init> +<% $cgi->redirect($url) %> |