Adds killError, etc like trigError, etc.
authorStéphane Jacob <jacou@melix.net>
Tue, 20 Jan 2009 21:00:36 +0000 (22:00 +0100)
committerStéphane Jacob <jacou@melix.net>
Tue, 20 Jan 2009 21:00:36 +0000 (22:00 +0100)
classes/plpage.php

index 26445c9..12c7d27 100644 (file)
@@ -246,7 +246,7 @@ abstract class PlPage extends Smarty
     // }}}
     // {{{ function kill()
 
-    public function kill($msg)
+    public function kill($msg, $type = 'errors')
     {
         // PHP is used on command line... do not run the whole page stuff.
         if (php_sapi_name() == 'cli') {
@@ -256,11 +256,26 @@ abstract class PlPage extends Smarty
 
         global $platal;
 
-        $this->trigError($msg);
+        $this->trig($msg, $type);
         $this->_failure = true;
         $this->run();
     }
 
+    public function killError($msg)
+    {
+        $this->kill($msg, 'errors');
+    }
+
+    public function killWarning($msg)
+    {
+        $this->kill($msg, 'warnings');
+    }
+
+    public function killSuccess($msg)
+    {
+        $this->kill($msg, 'success');
+    }
+
     // }}}
     // {{{ function setTitle