phrase) > 0 AND empty($this->process))
{
trigger_error('Message_Reporter->phrase is an array so please use Message_Reporter::error_list_process() to prepare it', E_USER_ERROR);
}
$this->process = ($text ? $text : $this->process);
$this->check_process();
eval('$bugsys->template->flush("' . $bugsys->template->fetch('std_error') . '");');
exit;
}
/**
* Converts the phrase array into a list for use in error()
*/
function error_list_process()
{
if (!is_array($this->phrase) OR count($this->phrase) < 1)
{
return;
}
$this->process = "\n\n
";
foreach ($this->phrase AS $phrase)
{
$this->process .= "\n\t- " . $phrase . "
";
}
$this->process .= "\n
";
}
/**
* Throws a common no-permission error
*/
function error_permission()
{
global $bugsys;
$this->error($bugsys->lang->string('You do not have permission to access this page. If you think that this is an error, please contact an administrator.'));
}
/**
* Performs a front-end redirect by either header or
*
* @param string Redirect message text
* @param string URL to take the user
*/
function redirect($text = '', $url = '')
{
global $bugsys;
global $doctype, $header, $headinclude, $footer, $focus, $show, $stylevar;
$this->process = ($text ? $text : $this->process);
$this->url = ($url ? $url : $this->url);
$this->check_process();
eval('$bugsys->template->flush("' . $bugsys->template->fetch('std_redirect') . '");');
if ($this->useheaders)
{
header("Location: {$this->url}");
}
exit;
}
/**
* Displays a fatal warning/notice that is usually not an error
*
* @param string Warning text
*/
function message($text = '')
{
global $bugsys;
global $doctype, $header, $headinclude, $footer, $focus, $show, $stylevar;
$this->process = ($text ? $text : $this->process);
$this->check_process();
eval('$bugsys->template->flush("' . $bugsys->template->fetch('std_message') . '");');
exit;
}
/**
* Checks to make sure that there is some text in the processed variable
*/
function check_process()
{
if (empty($this->process))
{
trigger_error('Message_Reporter requires some text to display a message', E_USER_ERROR);
}
}
}
/*=====================================================================*\
|| ###################################################################
|| # $HeadURL$
|| # $Id$
|| ###################################################################
\*=====================================================================*/
?>