summaryrefslogtreecommitdiffstats
path: root/inc/message.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2013-10-28 18:29:29 +0100
committerSimon Rettberg2013-10-28 18:29:29 +0100
commit160880836462e277c77427e71a2ba97a2ad17184 (patch)
tree656a2199846bb762c91fdfdebe30c54fd36b21c4 /inc/message.inc.php
parentShow different content on main page depending on logged in/guest status (diff)
downloadslx-admin-160880836462e277c77427e71a2ba97a2ad17184.tar.gz
slx-admin-160880836462e277c77427e71a2ba97a2ad17184.tar.xz
slx-admin-160880836462e277c77427e71a2ba97a2ad17184.zip
DB-Support, add user functionality
Diffstat (limited to 'inc/message.inc.php')
-rw-r--r--inc/message.inc.php15
1 files changed, 13 insertions, 2 deletions
diff --git a/inc/message.inc.php b/inc/message.inc.php
index 238ed939..b24bf2a1 100644
--- a/inc/message.inc.php
+++ b/inc/message.inc.php
@@ -2,13 +2,18 @@
// TODO: Move to extra file
$error_text = array(
- 'loginfail' => 'Benutzername oder Kennwort falsch',
- 'token' => 'Ungültiges Token. CSRF Angriff?',
+ 'loginfail' => 'Benutzername oder Kennwort falsch',
+ 'token' => 'Ungültiges Token. CSRF Angriff?',
+ 'adduser-disabled' => 'Keine ausreichenden Rechte, um weitere Benutzer hinzuzufügen',
+ 'password-mismatch' => 'Passwort und Passwortbestätigung stimmen nicht überein',
+ 'empty-field' => 'Ein benötigtes Feld wurde nicht ausgefüllt',
+ 'adduser-success' => 'Benutzer erfolgreich hinzugefügt',
);
class Message
{
private static $list = array();
+ private static $flushed = false;
public static function addError($id)
{
@@ -16,6 +21,7 @@ class Message
'type' => 'error',
'id' => $id
);
+ if (self::$flushed) self::renderList();
}
public static function addWarning($id)
@@ -24,6 +30,7 @@ class Message
'type' => 'warning',
'id' => $id
);
+ if (self::$flushed) self::renderList();
}
public static function addInfo($id)
@@ -32,6 +39,7 @@ class Message
'type' => 'info',
'id' => $id
);
+ if (self::$flushed) self::renderList();
}
public static function addSuccess($id)
@@ -40,6 +48,7 @@ class Message
'type' => 'success',
'id' => $id
);
+ if (self::$flushed) self::renderList();
}
public static function renderList()
@@ -48,6 +57,8 @@ class Message
foreach (self::$list as $item) {
Render::addTemplate('messagebox-' . $item['type'], array('message' => $error_text[$item['id']]));
}
+ self::$list = array();
+ self::$flushed = true;
}
}