diff options
author | Simon Rettberg | 2013-10-17 19:45:55 +0200 |
---|---|---|
committer | Simon Rettberg | 2013-10-17 19:45:55 +0200 |
commit | 0869034ed71e3d3a6bc03551e48657bd83be9b96 (patch) | |
tree | d14a007fb1f198d7320ad0983c6f737422760495 /inc/message.inc.php | |
parent | New stuff (diff) | |
download | slx-admin-0869034ed71e3d3a6bc03551e48657bd83be9b96.tar.gz slx-admin-0869034ed71e3d3a6bc03551e48657bd83be9b96.tar.xz slx-admin-0869034ed71e3d3a6bc03551e48657bd83be9b96.zip |
Day 3
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']])); + } + } + +} + |