From 0b3df4c7d79f6443d25f97bd54843ba515c95bb7 Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Sun, 17 Nov 2013 12:31:15 +0100 Subject: [PATCH] removed unused global db-variables Signed-off-by: Michael Kaufmann (d00p) --- lib/functions/output/function.ask_yesno.php | 39 +++++++------------ .../output/function.standard_error.php | 26 +++++-------- 2 files changed, 24 insertions(+), 41 deletions(-) diff --git a/lib/functions/output/function.ask_yesno.php b/lib/functions/output/function.ask_yesno.php index 876953ea..16abf515 100644 --- a/lib/functions/output/function.ask_yesno.php +++ b/lib/functions/output/function.ask_yesno.php @@ -25,29 +25,25 @@ * @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) { -function ask_yesno($text, $yesfile, $params = array(), $targetname = '', $back_nr = 1) -{ - global $userinfo, $db, $s, $header, $footer, $lng, $theme; + global $userinfo, $s, $header, $footer, $lng, $theme; $hiddenparams = ''; - if(is_array($params)) - { - foreach($params as $field => $value) - { + if (is_array($params)) { + foreach ($params as $field => $value) { $hiddenparams.= '' . "\n"; } } - if(isset($lng['question'][$text])) - { + if (isset($lng['question'][$text])) { $text = $lng['question'][$text]; } @@ -56,27 +52,23 @@ function ask_yesno($text, $yesfile, $params = array(), $targetname = '', $back_n exit; } -function ask_yesno_withcheckbox($text, $chk_text, $yesfile, $params = array(), $targetname = '', $show_checkbox = true) -{ - global $userinfo, $db, $s, $header, $footer, $lng, $theme; +function ask_yesno_withcheckbox($text, $chk_text, $yesfile, $params = array(), $targetname = '', $show_checkbox = true) { + + global $userinfo, $s, $header, $footer, $lng, $theme; $hiddenparams = ''; - if(is_array($params)) - { - foreach($params as $field => $value) - { + if (is_array($params)) { + foreach ($params as $field => $value) { $hiddenparams.= '' . "\n"; } } - if(isset($lng['question'][$text])) - { + if (isset($lng['question'][$text])) { $text = $lng['question'][$text]; } - - if(isset($lng['question'][$chk_text])) - { + + if (isset($lng['question'][$chk_text])) { $chk_text = $lng['question'][$chk_text]; } @@ -90,4 +82,3 @@ function ask_yesno_withcheckbox($text, $chk_text, $yesfile, $params = array(), $ eval("echo \"" . getTemplate('misc/question_yesno_checkbox', '1') . "\";"); exit; } - diff --git a/lib/functions/output/function.standard_error.php b/lib/functions/output/function.standard_error.php index 7733bf3b..d202a2c4 100644 --- a/lib/functions/output/function.standard_error.php +++ b/lib/functions/output/function.standard_error.php @@ -25,15 +25,14 @@ * @author Florian Lippert * @author Ron Brand */ +function standard_error($errors = '', $replacer = '') { + + global $userinfo, $s, $header, $footer, $lng, $theme; -function standard_error($errors = '', $replacer = '') -{ - global $db, $userinfo, $s, $header, $footer, $lng, $theme; $_SESSION['requestData'] = $_POST; $replacer = htmlentities($replacer); - if(!is_array($errors)) - { + if (!is_array($errors)) { $errors = array( $errors ); @@ -45,25 +44,18 @@ function standard_error($errors = '', $replacer = '') } $error = ''; - foreach($errors as $single_error) - { - if(isset($lng['error'][$single_error])) - { + foreach ($errors as $single_error) { + if (isset($lng['error'][$single_error])) { $single_error = $lng['error'][$single_error]; $single_error = strtr($single_error, array('%s' => $replacer)); - } - else - { + } else { $error = 'Unknown Error (' . $single_error . '): ' . $replacer; break; } - if(empty($error)) - { + if (empty($error)) { $error = $single_error; - } - else - { + } else { $error.= ' ' . $single_error; } }