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 "";
|
2014-08-22 22:34:13 +02:00
|
|
|
return '<div class="alert alert-info">' . $msg . '</div>';
|
2013-09-18 01:38:36 +02:00
|
|
|
} 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 "";
|
2014-08-22 22:34:13 +02:00
|
|
|
return '<div class="alert alert-danger">' . $msg . '</div>';
|
2013-09-18 01:38:36 +02:00
|
|
|
} 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 "";
|
2014-08-22 22:34:13 +02:00
|
|
|
return '<div class="alert alert-success">' . $msg . '</div>';
|
2013-09-18 01:38:36 +02:00
|
|
|
} 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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|