From 9993ca8f4798f02bf8a4328701b797bcfb48d4d0 Mon Sep 17 00:00:00 2001 From: Sebastian Mendel Date: Mon, 15 Oct 2007 11:36:48 +0000 Subject: [PATCH] added more shorthands --- libraries/Message.class.php | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/libraries/Message.class.php b/libraries/Message.class.php index a5cf55766..e5a19d940 100644 --- a/libraries/Message.class.php +++ b/libraries/Message.class.php @@ -145,7 +145,25 @@ class PMA_Message return new PMA_Message($string, PMA_Message::ERROR); } - return PMA_Message::raw($string, PMA_Message::ERROR); + return PMA_Message::rawError($string); + } + + static public function warning($string) + { + if (substr($string, 0, 3) === 'str') { + return new PMA_Message($string, PMA_Message::WARNING); + } + + return PMA_Message::raw($string, PMA_Message::WARNING); + } + + static public function notice($string) + { + if (substr($string, 0, 3) === 'str') { + return new PMA_Message($string, PMA_Message::NOTICE); + } + + return PMA_Message::raw($string, PMA_Message::NOTICE); } static public function raw($message, $type = PMA_Message::NOTICE) @@ -155,6 +173,11 @@ class PMA_Message return $r; } + static public function rawError($message) + { + return PMA_Message::raw($message, PMA_Message::ERROR); + } + public function isSuccess($set = false) { if ($set) {