]>
src.bluestatic.org Git - bugdar.git/blob - includes/class_message_reporter.php
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 = '')
25 if (is_array($this->phrase
) AND empty($this->process
))
27 trigger_error('Message_Reporter::phrase is an array so please use Message_Reporter::error_list_process() to prepare it', E_USER_ERROR
);
30 if (empty($this->process
))
32 $this->process
= phrase($this->phrase
);;
35 $this->process
= (($text) ? $text : $this->process
);
37 $errormessage = $this->process
;
39 eval('$bugsys->template->flush("' . $bugsys->template
->fetch('std_error') . '");');
43 function error_list_process()
45 if (!is_array($this->phrase
) OR count($this->phrase
) < 1)
50 $this->process
= "\n\n<ol style=\"list-style-type: decimal\">";
51 foreach ($this->phrase
AS $phrase)
53 $this->process
.= "\n\t<li>" . phrase($phrase) . "</li>";
55 $this->process
.= "\n</ol>";
58 function error_permission()
60 $this->phrase
= 'error_no_permission';
64 function redirect($text = '', $url = '')
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
= phrase($this->phrase
);;
78 $this->process
= (($text) ? $text : $this->process
);
79 $this->url
= (($url) ? $url : $this->url
);
81 $redirectmessage = $this->process
;
82 $redirecturl = $this->url
;
84 eval('$bugsys->template->flush("' . $bugsys->template
->fetch('std_redirect') . '");');
86 if ($this->useheaders
)
88 header("Location: {$this->url}");
94 function message($text = '')
98 if (is_array($this->phrase
) AND empty($this->process
))
100 trigger_error('Message_Reporter::phrase is an array and cannot be used in Message_Reporter::message()', E_USER_ERROR
);
103 if (empty($this->process
))
105 $this->process
= phrase($this->phrase
);;
108 $this->process
= (($text) ? $text : $this->process
);
110 $message = $this->process
;
112 eval('$bugsys->template->flush("' . $bugsys->template
->fetch('std_message') . '");');
117 /*=====================================================================*\
118 || ###################################################################
121 || ###################################################################
122 \*=====================================================================*/