", $message); $message = str_replace(" ", " ", $message); global $_ERRORS; $_ERRORS[] = $message; } /** * Write text into stderr * * @param string $text Text to log */ function debug ($text) { error_log("\n> $text" . PHP_EOL); } /** * Echoes HTML code to display all collected error messages */ function insertErrorsHtml() { global $_ERRORS; if (count ($_ERRORS) == 0) return; // Dialog frame HTML $base_html = '
Fehler beim Laden der Seite:

%s
'; $errors_html = ""; foreach ($_ERRORS as $error) { $errors_html .= "{$error}
"; } printf ($base_html, $errors_html); } /** * Hides the dialog box asking for an ICS URL if one * was already specified by the user */ function hideMissingIcsDialog () { global $_GET; if (isset ($_GET["ics_url"]) && $_GET["ics_url"] != "") { echo "hidden"; } }