From 044631ed2ac590a5e67ba4ac07267e790f814863 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 18 Oct 2013 13:20:31 +0200 Subject: Show different content on main page depending on logged in/guest status --- inc/message.inc.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'inc/message.inc.php') diff --git a/inc/message.inc.php b/inc/message.inc.php index 9409db95..238ed939 100644 --- a/inc/message.inc.php +++ b/inc/message.inc.php @@ -18,8 +18,33 @@ class Message ); } + public static function addWarning($id) + { + self::$list[] = array( + 'type' => 'warning', + 'id' => $id + ); + } + + public static function addInfo($id) + { + self::$list[] = array( + 'type' => 'info', + 'id' => $id + ); + } + + public static function addSuccess($id) + { + self::$list[] = array( + 'type' => 'success', + 'id' => $id + ); + } + public static function renderList() { + global $error_text; foreach (self::$list as $item) { Render::addTemplate('messagebox-' . $item['type'], array('message' => $error_text[$item['id']])); } -- cgit v1.2.3-55-g7522