(2003-2009) * @author Froxlor team (2010-) * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt * @package Functions * */ /** * Prints Question on screen * * @param string $text The question * @param string $yesfile File which will be called with POST if user clicks yes * @param array $params Values which will be given to $yesfile. Format: array(variable1=>value1, variable2=>value2, variable3=>value3) * @param string $targetname Name of the target eg Domain or eMail address etc. * @param int $back_nr Number of steps to go back when "No" is pressed * * @author Florian Lippert * @author Froxlor team (2010-) * * @return string outputs parsed question_yesno template */ function ask_yesno($text, $yesfile, $params = array(), $targetname = '', $back_nr = 1) { global $userinfo, $db, $s, $header, $footer, $lng, $theme; $hiddenparams = ''; if(is_array($params)) { foreach($params as $field => $value) { $hiddenparams.= '' . "\n"; } } if(isset($lng['question'][$text])) { $text = $lng['question'][$text]; } $text = strtr($text, array('%s' => $targetname)); eval("echo \"" . getTemplate('misc/question_yesno', '1') . "\";"); exit; } function ask_yesno_withcheckbox($text, $chk_text, $yesfile, $params = array(), $targetname = '', $show_checkbox = true) { global $userinfo, $db, $s, $header, $footer, $lng, $theme; $hiddenparams = ''; if(is_array($params)) { foreach($params as $field => $value) { $hiddenparams.= '' . "\n"; } } if(isset($lng['question'][$text])) { $text = $lng['question'][$text]; } if(isset($lng['question'][$chk_text])) { $chk_text = $lng['question'][$chk_text]; } if ($show_checkbox) { $checkbox = makecheckbox('delete_userfiles', $chk_text, '1', false, '0', true, true); } else { $checkbox = '' . "\n";; } $text = strtr($text, array('%s' => $targetname)); eval("echo \"" . getTemplate('misc/question_yesno_checkbox', '1') . "\";"); exit; }