diff options
Diffstat (limited to 'inc/message.inc.php')
-rw-r--r-- | inc/message.inc.php | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/inc/message.inc.php b/inc/message.inc.php new file mode 100644 index 00000000..9409db95 --- /dev/null +++ b/inc/message.inc.php @@ -0,0 +1,29 @@ +<?php + +// TODO: Move to extra file +$error_text = array( + 'loginfail' => 'Benutzername oder Kennwort falsch', + 'token' => 'Ungültiges Token. CSRF Angriff?', +); + +class Message +{ + private static $list = array(); + + public static function addError($id) + { + self::$list[] = array( + 'type' => 'error', + 'id' => $id + ); + } + + public static function renderList() + { + foreach (self::$list as $item) { + Render::addTemplate('messagebox-' . $item['type'], array('message' => $error_text[$item['id']])); + } + } + +} + |