]>
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 = '' )
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 $this- > process
= ( $text ? $text : $this- > process
);
33 $this- > check_process ();
35 eval ( ' $bugsys- >template->flush("' . $bugsys- > template
-> fetch ( 'std_error' ) . '");' );
39 function error_list_process ()
41 if (! is_array ( $this- > phrase
) OR count ( $this- > phrase
) < 1 )
46 $this- > process
= " \n\n <ol style= \" list-style-type: decimal \" >" ;
47 foreach ( $this- > phrase
AS $phrase )
49 $this- > process
.= " \n\t <li>" . $phrase . "</li>" ;
51 $this- > process
.= " \n </ol>" ;
54 function error_permission ()
58 $this- > phrase
= $bugsys- > lang
-> string ( 'You do not have permission to access this page. If you think that this is an error, please contact an administrator.' );
62 function redirect ( $text = '' , $url = '' )
65 global $doctype , $header , $headinclude , $footer , $focus , $show , $stylevar ;
67 if ( is_array ( $this- > phrase
) AND empty ( $this- > process
))
69 trigger_error ( 'Message_Reporter::phrase is an array and cannot be used in Message_Reporter::redirect()' , E_USER_ERROR
);
72 $this- > process
= ( $text ? $text : $this- > process
);
73 $this- > url
= ( $url ? $url : $this- > url
);
75 $this- > check_process ();
77 eval ( ' $bugsys- >template->flush("' . $bugsys- > template
-> fetch ( 'std_redirect' ) . '");' );
79 if ( $this- > useheaders
)
81 header ( "Location: {$this->url} " );
87 function message ( $text = '' )
90 global $doctype , $header , $headinclude , $footer , $focus , $show , $stylevar ;
92 if ( is_array ( $this- > phrase
) AND empty ( $this- > process
))
94 trigger_error ( 'Message_Reporter::phrase is an array and cannot be used in Message_Reporter::message()' , E_USER_ERROR
);
97 $this- > process
= ( $text ? $text : $this- > process
);
99 $this- > check_process ();
101 eval ( ' $bugsys- >template->flush("' . $bugsys- > template
-> fetch ( 'std_message' ) . '");' );
105 function check_process ()
107 if ( empty ( $this- > process
))
109 trigger_error ( 'Message_Reporter requires some text to display a message' , E_USER_ERROR
);
114 /*=====================================================================*\
115 || ###################################################################
118 || ###################################################################
119 \*=====================================================================*/