From f0c9bd99579e8a63b3e1e7c2f6c807960c9db634 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Mon, 18 Aug 2008 12:22:38 -0400 Subject: [PATCH] Update MessageReporter --- includes/class_message_reporter.php | 42 ++++++++++++++++++----------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/includes/class_message_reporter.php b/includes/class_message_reporter.php index 8ddedf9..8bd5d5e 100755 --- a/includes/class_message_reporter.php +++ b/includes/class_message_reporter.php @@ -82,15 +82,14 @@ class MessageReporter */ function error($error = null) { - global $bugsys; - global $doctype, $header, $headinclude, $footer, $focus, $show, $stylevar; - if ($error == null) { $error = $this->errorBox; } - eval('$bugsys->template->flush("' . $bugsys->template->fetch('std_error') . '");'); + $tpl = new BSTemplate('std_error'); + $tpl->vars = array('error' => $error); + $tpl->evaluate()->flush(); exit; } @@ -112,16 +111,18 @@ class MessageReporter */ function redirect($message, $url) { - global $bugsys; - global $doctype, $header, $headinclude, $footer, $focus, $show, $stylevar; - if (bugdar::$options['redirectheaders']) { header("Location: $url"); exit; } - eval('$bugsys->template->flush("' . $bugsys->template->fetch('std_redirect') . '");'); + $tpl = new BSTemplate('std_redirect'); + $tpl->vars = array( + 'message' => $message, + 'url' => $url + ); + $tpl->evaluate()->flush(); exit; } @@ -133,10 +134,11 @@ class MessageReporter */ function message($message) { - global $bugsys; - global $doctype, $header, $headinclude, $footer, $focus, $show, $stylevar; - - eval('$bugsys->template->flush("' . $bugsys->template->fetch('std_message') . '");'); + $tpl = new BSTemplate('std_message'); + $tpl->vars = array( + 'message' => $message + ); + $tpl->evaluate()->flush(); exit; } @@ -155,17 +157,25 @@ class MessageReporter */ function confirm($message, $action, $do, $button, $cancel, $arrextra) { - global $bugsys; - global $doctype, $header, $headinclude, $footer, $focus, $show, $stylevar; + global $show; $show['confirm'] = true; - foreach ($arrextra AS $name => $value) + foreach ($arrextra as $name => $value) { $extra .= '' . "\n"; } - eval('$bugsys->template->flush("' . $bugsys->template->fetch('std_message') . '");'); + $tpl = new BSTemplate('std_confirm'); + $tpl->vars = array( + 'message' => $message, + 'action' => $action, + 'do' => $do, + 'button' => $button, + 'cancel' => $cancel, + 'extra' => $extra + ); + $tpl->evaluate()->flush(); exit; } } -- 2.43.5