Beispiel #1
0
function error($message, $parser, $line = 0)
{
    // if line argument is provided ==> display current line and line number
    global $err;
    global $line_buffer;
    global $log_hawxy_errors;
    global $error_skin;
    $myDeck = new HAW_deck($err[4]);
    if ($error_skin) {
        $myDeck->use_simulator("http://www.hawhaw.de/skin/error/skin.css");
    }
    if ($line > 0) {
        // add line number to message
        $message = $err[10] . " " . $line . ": " . $message;
    }
    $myText2 = new HAW_text($message, HAW_TEXTFORMAT_BOLD);
    $myDeck->add_text($myText2);
    if ($line > 0) {
        // display wrong line
        $myRule = new HAW_rule();
        $myDeck->add_rule($myRule);
        $wrong = new HAW_text($line_buffer[$line - 1]);
        $myDeck->add_text($wrong);
    }
    $myDeck->set_width("80%");
    $myDeck->create_page();
    xml_parser_free($parser);
    if ($log_hawxy_errors == true) {
        error_log("Hawxy error: " . $message);
    }
    exit;
    // there is nothing else to do
}