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 eval('$bugsys->template->flush("' . $bugsys->template
->fetch('std_error') . '");');
42 function error_list_process()
44 if (!is_array($this->phrase
) OR count($this->phrase
) < 1)
49 $this->process
= "\n\n<ol style=\"list-style-type: decimal\">";
50 foreach ($this->phrase
AS $phrase)
52 $this->process
.= "\n\t<li>" . lang
::p($phrase) . "</li>";
54 $this->process
.= "\n</ol>";
57 function error_permission()
59 $this->phrase
= 'error_no_permission';
63 function redirect($text = '', $url = '')
66 global $doctype, $header, $headinclude, $footer, $focus, $show, $stylevar;
68 if (is_array($this->phrase
) AND empty($this->process
))
70 trigger_error('Message_Reporter::phrase is an array and cannot be used in Message_Reporter::redirect()', E_USER_ERROR
);
73 if (empty($this->process
))
75 $this->process
= lang
::p($this->phrase
);
78 $this->process
= (($text) ?
$text : $this->process
);
79 $this->url
= (($url) ?
$url : $this->url
);
81 eval('$bugsys->template->flush("' . $bugsys->template
->fetch('std_redirect') . '");');
83 if ($this->useheaders
)
85 header("Location: {$this->url}");
91 function message($text = '')
94 global $doctype, $header, $headinclude, $footer, $focus, $show, $stylevar;
96 if (is_array($this->phrase
) AND empty($this->process
))
98 trigger_error('Message_Reporter::phrase is an array and cannot be used in Message_Reporter::message()', E_USER_ERROR
);
101 if (empty($this->process
))
103 $this->process
= lang
::p($this->phrase
);
106 $this->process
= (($text) ?
$text : $this->process
);
108 eval('$bugsys->template->flush("' . $bugsys->template
->fetch('std_message') . '");');
113 /*=====================================================================*\
114 || ###################################################################
117 || ###################################################################
118 \*=====================================================================*/