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) {