summaryrefslogtreecommitdiff
path: root/includes/helper/message_helper.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/helper/message_helper.php')
-rw-r--r--includes/helper/message_helper.php53
1 files changed, 28 insertions, 25 deletions
diff --git a/includes/helper/message_helper.php b/includes/helper/message_helper.php
index 37fc84bb..323eee4d 100644
--- a/includes/helper/message_helper.php
+++ b/includes/helper/message_helper.php
@@ -3,51 +3,54 @@
/**
* Gibt zwischengespeicherte Fehlermeldungen zurück und löscht den Zwischenspeicher
*/
-function msg() {
- if (! isset($_SESSION['msg'])) {
- return "";
- }
- $msg = $_SESSION['msg'];
- $_SESSION['msg'] = "";
- return $msg;
+function msg()
+{
+ if (! isset($_SESSION['msg'])) {
+ return "";
+ }
+ $msg = $_SESSION['msg'];
+ $_SESSION['msg'] = "";
+ return $msg;
}
/**
* Rendert eine Information
*/
-function info($msg, $immediatly = false) {
- return alert('info', $msg, $immediatly);
+function info($msg, $immediatly = false)
+{
+ return alert('info', $msg, $immediatly);
}
/**
* Rendert eine Fehlermeldung
*/
-function error($msg, $immediatly = false) {
- return alert('danger', $msg, $immediatly);
+function error($msg, $immediatly = false)
+{
+ return alert('danger', $msg, $immediatly);
}
/**
* Rendert eine Erfolgsmeldung
*/
-function success($msg, $immediatly = false) {
- return alert('success', $msg, $immediatly);
+function success($msg, $immediatly = false)
+{
+ return alert('success', $msg, $immediatly);
}
/**
* Renders an alert with given alert-* class.
*/
-function alert($class, $msg, $immediatly = false) {
- if ($immediatly) {
- if ($msg == "") {
- return "";
+function alert($class, $msg, $immediatly = false)
+{
+ if ($immediatly) {
+ if ($msg == "") {
+ return "";
+ }
+ return '<div class="alert alert-' . $class . '">' . $msg . '</div>';
}
- return '<div class="alert alert-' . $class . '">' . $msg . '</div>';
- }
- if (! isset($_SESSION['msg'])) {
- $_SESSION['msg'] = "";
- }
- $_SESSION['msg'] .= alert($class, $msg, true);
+ if (! isset($_SESSION['msg'])) {
+ $_SESSION['msg'] = "";
+ }
+ $_SESSION['msg'] .= alert($class, $msg, true);
}
-
-?> \ No newline at end of file