2013-09-18 01:38:36 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gibt zwischengespeicherte Fehlermeldungen zurück und löscht den Zwischenspeicher
|
|
|
|
*/
|
|
|
|
function msg() {
|
2013-10-13 00:52:44 +02:00
|
|
|
if (! isset($_SESSION['msg']))
|
2013-09-18 01:38:36 +02:00
|
|
|
return "";
|
|
|
|
$msg = $_SESSION['msg'];
|
|
|
|
$_SESSION['msg'] = "";
|
|
|
|
return $msg;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Rendert eine Information
|
|
|
|
*/
|
|
|
|
function info($msg, $immediatly = false) {
|
|
|
|
if ($immediatly) {
|
|
|
|
if ($msg == "")
|
|
|
|
return "";
|
|
|
|
return '<p class="info">' . $msg . '</p>';
|
|
|
|
} else {
|
2013-10-13 00:52:44 +02:00
|
|
|
if (! isset($_SESSION['msg']))
|
2013-09-18 01:38:36 +02:00
|
|
|
$_SESSION['msg'] = "";
|
|
|
|
$_SESSION['msg'] .= info($msg, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Rendert eine Fehlermeldung
|
|
|
|
*/
|
|
|
|
function error($msg, $immediatly = false) {
|
|
|
|
if ($immediatly) {
|
|
|
|
if ($msg == "")
|
|
|
|
return "";
|
|
|
|
return '<p class="error">' . $msg . '</p>';
|
|
|
|
} else {
|
2013-10-13 00:52:44 +02:00
|
|
|
if (! isset($_SESSION['msg']))
|
2013-09-18 01:38:36 +02:00
|
|
|
$_SESSION['msg'] = "";
|
|
|
|
$_SESSION['msg'] .= error($msg, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Rendert eine Erfolgsmeldung
|
|
|
|
*/
|
|
|
|
function success($msg, $immediatly = false) {
|
|
|
|
if ($immediatly) {
|
|
|
|
if ($msg == "")
|
|
|
|
return "";
|
|
|
|
return '<p class="success">' . $msg . '</p>';
|
|
|
|
} else {
|
2013-10-13 00:52:44 +02:00
|
|
|
if (! isset($_SESSION['msg']))
|
2013-09-18 01:38:36 +02:00
|
|
|
$_SESSION['msg'] = "";
|
|
|
|
$_SESSION['msg'] .= success($msg, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|