2 /*=====================================================================*\
3 || ################################################################### ||
4 || # BugStrike [#]version[#]
5 || # --------------------------------------------------------------- # ||
6 || # Copyright ©2002-[#]year[#] by Iris Studios, Inc. All Rights Reserved. # ||
7 || # This file may not be reproduced in any way without permission. # ||
8 || # --------------------------------------------------------------- # ||
9 || # User License Agreement at http://www.iris-studios.com/license/ # ||
10 || ################################################################### ||
11 \*=====================================================================*/
13 class Message_Reporter
16 var $useheaders = false
;
21 function error($text = '')
24 global $doctype, $header, $headinclude, $footer, $focus, $show, $stylevar;
26 if (is_array($this->phrase
) AND empty($this->process
))
28 trigger_error('Message_Reporter::phrase is an array so please use Message_Reporter::error_list_process() to prepare it', E_USER_ERROR
);
31 if (empty($this->process
))
33 $this->process
= lang
::p($this->phrase
);
36 $this->process
= (($text) ?
$text : $this->process
);
38 $errormessage = $this->process
;
40 eval('$bugsys->template->flush("' . $bugsys->template
->fetch('std_error') . '");');
44 function error_list_process()
46 if (!is_array($this->phrase
) OR count($this->phrase
) < 1)
51 $this->process
= "\n\n<ol style=\"list-style-type: decimal\">";
52 foreach ($this->phrase
AS $phrase)
54 $this->process
.= "\n\t<li>" . lang
::p($phrase) . "</li>";
56 $this->process
.= "\n</ol>";
59 function error_permission()
61 $this->phrase
= 'error_no_permission';
65 function redirect($text = '', $url = '')
68 global $doctype, $header, $headinclude, $footer, $focus, $show, $stylevar;
70 if (is_array($this->phrase
) AND empty($this->process
))
72 trigger_error('Message_Reporter::phrase is an array and cannot be used in Message_Reporter::redirect()', E_USER_ERROR
);
75 if (empty($this->process
))
77 $this->process
= lang
::p($this->phrase
);
80 $this->process
= (($text) ?
$text : $this->process
);
81 $this->url
= (($url) ?
$url : $this->url
);
83 $redirectmessage = $this->process
;
84 $redirecturl = $this->url
;
86 eval('$bugsys->template->flush("' . $bugsys->template
->fetch('std_redirect') . '");');
88 if ($this->useheaders
)
90 header("Location: {$this->url}");
96 function message($text = '')
99 global $doctype, $header, $headinclude, $footer, $focus, $show, $stylevar;
101 if (is_array($this->phrase
) AND empty($this->process
))
103 trigger_error('Message_Reporter::phrase is an array and cannot be used in Message_Reporter::message()', E_USER_ERROR
);
106 if (empty($this->process
))
108 $this->process
= lang
::p($this->phrase
);
111 $this->process
= (($text) ?
$text : $this->process
);
113 $message = $this->process
;
115 eval('$bugsys->template->flush("' . $bugsys->template
->fetch('std_message') . '");');
120 /*=====================================================================*\
121 || ###################################################################
124 || ###################################################################
125 \*=====================================================================*/