- only show checkbox for e-mail file deletion if there really is some data on the filesystem

This commit is contained in:
Michael Kaufmann (d00p)
2010-07-24 17:26:24 +00:00
parent e430092eda
commit 51673f3569
3 changed files with 53 additions and 4 deletions

View File

@@ -66,7 +66,7 @@ function ask_yesno($text, $yesfile, $params = array(), $targetname = '')
exit;
}
function ask_yesno_withcheckbox($text, $chk_text, $yesfile, $params = array(), $targetname = '')
function ask_yesno_withcheckbox($text, $chk_text, $yesfile, $params = array(), $targetname = '', $show_checkbox = true)
{
global $userinfo, $db, $s, $header, $footer, $lng;
@@ -89,8 +89,12 @@ function ask_yesno_withcheckbox($text, $chk_text, $yesfile, $params = array(), $
{
$chk_text = $lng['question'][$chk_text];
}
$checkbox = makecheckbox('delete_userfiles', $chk_text, '1', false, '0', true, true);
if ($show_checkbox) {
$checkbox = makecheckbox('delete_userfiles', $chk_text, '1', false, '0', true, true);
} else {
$checkbox = '<input type="hidden" name="delete_userfiles" value="0" />' . "\n";;
}
$text = strtr($text, array('%s' => $targetname));
eval("echo \"" . getTemplate('misc/question_yesno_checkbox', '1') . "\";");